PageSourceSearch

https://flow.team/flow-renewal/dist/js/signinModule.min.js?v=97faf5623d686d8c

js flow.team collected 2026-10-01 15:48:17 UTC 1,862,976 bytes, 18,781 lines download raw bytes

1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.cancelCompanyJoinRequest=cancelCompanyJoinRequest,exports.checkAuthNum=checkAuthNum,exports.checkDuplicateEmail=checkDuplicateEmail,exports.checkSubDomain=checkSubDomain,exports.createNewCompany=createNewCompany,exports.findInviterList=findInviterList,exports.getCompanyInfo=getCompanyInfo,exports.getCompanyInfoByInviteKey=getCompanyInfoByInviteKey,exports.registerUserByUserInfo=registerUserByUserInfo,exports.sendAuthNumberToEmail=sendAuthNumberToEmail;function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
2return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var _Mutil=Mutil,Ajax=_Mutil.Ajax,AJAX_OPTION=_Mutil.AJAX_OPTION;function checkDuplicateEmail(a){return _checkDuplicateEmail.apply(this,arguments)}function _checkDuplicateEmail(){return _checkDuplicateEmail=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g=arguments;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=1<g.length&&void 0!==g[1]?g[1]:"",d=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),b.p=1,b.n=2,d.executeApi("COLABO_USER_DUPLICATE_R001",{USER_ID:a,ID_GB:c});case 2:e=b.v,b.n=4;break;case 3:b.p=3,f=b.v,Mutil.mlog("ERROR in sendAuthNumberToEmail : ".concat(f.DATA.ERROR_MESSAGE));case 4:return b.a(2,e)}},b,null,[[1,3]])})),_checkDuplicateEmail.apply(this,arguments)}function sendAuthNumberToEmail(a){return _sendAuthNumberToEmail.apply(this,arguments)}function _sendAuthNumberToEmail(){return _sendAuthNumberToEmail=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),b.p=1,b.n=2,c.executeApi("FLOW_AUTH_NO_CHECK_R002",_objectSpread({},a),!0);case 2:return d=b.v,b.a(2,d);case 3:return b.p=3,e=b.v,Mutil.mlog("ERROR in sendAuthNumberToEmail : ".concat(e.DATA.ERROR_MESSAGE)),b.a(2,e)}},b,null,[[1,3]])})),_sendAuthNumberToEmail.apply(this,arguments)}function findInviterList(a){return _findInviterList.apply(this,arguments)}function _findInviterList(){return _findInviterList=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),b.p=1,b.n=2,c.executeApi("ACT_FIND_TEAM_INVT_R001",{USER_ID:a});case 2:d=b.v,b.n=4;break;case 3:b.p=3,e=b.v,Mutil.mlog("ERROR in findInviterList : ".concat(e));case 4:return b.a(2,d)}},b,null,[[1,3]])})),_findInviterList.apply(this,arguments)}function checkAuthNum(a){return _checkAuthNum.apply(this,arguments)}function _checkAuthNum(){return _checkAuthNum=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),b.p=1,b.n=2,c.executeApi("FLOW_AUTH_NO_CHECK_R001",_objectSpread({},a));case 2:d=b.v,b.n=4;break;case 3:b.p=3,e=b.v,Mutil.mlog("ERROR in checkAuthNum : ".concat(e.DATA.ERROR_MESSAGE));case 4:return b.a(2,d)}},b,null,[[1,3]])})),_checkAuthNum.apply(this,arguments)}function checkSubDomain(){return _checkSubDomain.apply(this,arguments)}function _checkSubDomain(){return _checkSubDomain=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f=arguments;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:return b=0<f.length&&void 0!==f[0]?f[0]:"",c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.p=1,a.n=2,c.executeApi("FLOW_SUB_DOM_R001",{SUB_DOM:b});case 2:d=a.v,a.n=4;break;case 3:a.p=3,e=a.v,Mutil.mlog("ERROR in checkSubDomain : ".concat(e.DATA.ERROR_MESSAGE));case 4:return a.a(2,d)}},a,null,[[1,3]])})),_checkSubDomain.apply(this,arguments)}function getCompanyInfo(){return _getCompanyInfo.apply(this,arguments)}function _getCompanyInfo(){return _getCompanyInfo=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f=arguments;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:return b=0<f.length&&void 0!==f[0]?f[0]:"",c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.p=1,a.n=2,c.executeApi("ACT_COMPANY_INFO",{USE_INTT_ID:b});case 2:d=a.v,a.n=4;break;case 3:a.p=3,e=a.v,Mutil.mlog("ERROR in getCompanyInfo : ".concat(e.DATA.ERROR_MESSAGE));case 4:return a.a(2,d)}},a,null,[[1,3]])})),_getCompanyInfo.apply(this,arguments)}function cancelCompanyJoinRequest(){return _cancelCompanyJoinRequest.apply(this,arguments)}function _cancelCompanyJoinRequest(){return _cancelCompanyJoinRequest=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f=arguments;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:return b=0<f.length&&void 0!==f[0]?f[0]:"",c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.p=1,a.n=2,c.executeApi("ACT_CANCEL_COMPANY_JOIN_REQUEST",{USER_ID:b});case 2:d=a.v,a.n=4;break;case 3:a.p=3,e=a.v,Mutil.mlog("ERROR in cancelCompanyJoinRequest : ".concat(e.DATA.ERROR_MESSAGE));case 4:return a.a(2,d)}},a,null,[[1,3]])}
2)),_cancelCompanyJoinRequest.apply(this,arguments)}function registerUserByUserInfo(a){return _registerUserByUserInfo.apply(this,arguments)}function _registerUserByUserInfo(){return _registerUserByUserInfo=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),b.p=1,e=CommonJoin.getPartnerInfo()||{},b.n=2,c.executeApi("COLABO2_REGISTER_C001",_objectSpread(_objectSpread({},a),e),!0);case 2:d=b.v,b.n=4;break;case 3:b.p=3,f=b.v,Mutil.mlog("ERROR in cancelCompanyJoinRequest : ".concat(f.DATA.ERROR_MESSAGE));case 4:return b.a(2,d)}},b,null,[[1,3]])})),_registerUserByUserInfo.apply(this,arguments)}function createNewCompany(a){return _createNewCompany.apply(this,arguments)}function _createNewCompany(){return _createNewCompany=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),b.p=1,b.n=2,c.executeApi("FLOW_SUB_DOM_C001",_objectSpread({},a),!0);case 2:d=b.v,b.n=4;break;case 3:b.p=3,e=b.v,Mutil.mlog("ERROR in cancelCompanyJoinRequest : ".concat(e.DATA.ERROR_MESSAGE));case 4:return b.a(2,d)}},b,null,[[1,3]])})),_createNewCompany.apply(this,arguments)}function getCompanyInfoByInviteKey(a){return _getCompanyInfoByInviteKey.apply(this,arguments)}function _getCompanyInfoByInviteKey(){return _getCompanyInfoByInviteKey=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),b.p=1,b.n=2,c.executeApi("COLABO2_INVT_R006",{INVT_KEY:a});case 2:d=b.v,b.n=4;break;case 3:b.p=3,e=b.v,Mutil.mlog("ERROR in cancelCompanyJoinRequest : ".concat(e.DATA.ERROR_MESSAGE));case 4:return b.a(2,d)}},b,null,[[1,3]])})),_getCompanyInfoByInviteKey.apply(this,arguments)}
3
4},{}],2:[function(require,module,exports){
5"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserFlagApiCall=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
5q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var UserFlagApiCall=exports.UserFlagApiCall=function(){function a(b){var c=this;_classCallCheck(this,a),_defineProperty(this,"isFlagY",function(){var a=_asyncToGenerator(_regenerator().m(function b(a){var d;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,c.find({CATEGORY:c.CATEGORY,TYPE:a});case 1:return d=b.v,b.a(2,"Y"===d)}},b)}));return function(b){return a.apply(this,arguments)}}()),_defineProperty(this,"setFlagY",function(a){return c.save({CATEGORY:c.CATEGORY,TYPE:a,VALUE:"Y"})}),this.CATEGORY=b,this.ajaxSpace=new Mutil.Ajax}return _createClass(a,[{key:"save",value:function(){function a(a){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return c=a.CATEGORY,d=a.TYPE,e=a.VALUE,b.n=1,this.ajaxSpace.executeApi("USER_FLAG",{ACTION:"SAVE",CATEGORY:c,TYPE:d,VALUE:e});case 1:f=this.getValue(c,d),f?this.jsonArr=this.jsonArr.map(function(a){return a.CATEGORY===c&&a.TYPE===d?_objectSpread(_objectSpread({},a),{},{VALUE:e}):a}):(this.jsonArr=Array.isArray(this.jsonArr)?this.jsonArr:[],this.jsonArr=[].concat(_toConsumableArray(this.jsonArr),[{CATEGORY:c,TYPE:d,VALUE:e}])),Mutil.mlog("Save USER_FLAG by ".concat(c,".").concat(d,"=").concat(e));case 2:return b.a(2)}},b,this)}));return a}()},{key:"delete",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.a(2)}},a)}));return a}()},{key:"deleteFlag",value:function(){function a(a){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function b(a){var c=this;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,this.ajaxSpace.executeApi("USER_FLAG",{ACTION:"DELETE",CATEGORY:this.CATEGORY,TYPE:a});case 1:Array.isArray(this.jsonArr)&&(this.jsonArr=this.jsonArr.filter(function(b){return b.CATEGORY!==c.CATEGORY||b.TYPE!==a}));case 2:return b.a(2)}},b,this)}));return a}()},{key:"find",value:function(){function a(a){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h,i;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:if(c=a||{},d=c.CATEGORY,e=c.TYPE,this.jsonArr){b.n=2;break}return b.n=1,this.ajaxSpace.executeApi("USER_FLAG",{ACTION:"FIND"});case 1:f=b.v,g=f.JSON_STR,h=f.GUBUN,this.jsonArr=Mutil.parse(g,[]),Mutil.mlog("Find USER_FLAG by ".concat(h),this.jsonArr);case 2:if(!(d&&e)){b.n=3;break}return b.a(2,(null===(i=this.getValue(d,e))||void 0===i?void 0:i.VALUE)||"");case 3:return b.a(2,this.jsonArr)}},b,this)}));return a}()},{key:"getValue",value:function c(a,b){var d;return null===(d=this.jsonArr)||void 0===d?void 0:d.find(function(c){return c.CATEGORY===a&&c.TYPE===b})}}])}();
6
7},{}],3:[function(require,module,exports){
8"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sendMoveMobileSignUp=exports.sendMoveMobileSignIn=exports.sendMobileSignIn=exports.openTextMessageApp=exports.openSocialSignUpPopup=exports.openShareContents=exports.openMailApp=exports.closeInviteView=void 0;function isWeb(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB";return"WEB"===a}function isIOS(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB";return"IOS"===a}function isAOS(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB";return"AOS"===a}var sendMoveMobileSignUp=exports.sendMoveMobileSignUp=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB";
8if(!isWeb(a))try{if(isIOS(a)){var b;return Mutil.mlog("[IOS] sendMoveMobileSignUp"),null===(b=window)||void 0===b||null===(b=b.webkit)||void 0===b||null===(b=b.messageHandlers)||void 0===b||null===(b=b.FLOW_WEB_BRIDGE)||void 0===b?void 0:b.postMessage({CODE:"moveMobileSignUpEvent"})}if(isAOS(a)){var c;return Mutil.mlog("[AOS] sendMoveMobileSignUp"),null===(c=window)||void 0===c||null===(c=c.AndroidBridgeSign)||void 0===c?void 0:c.moveMobileSignUpEvent()}}catch(a){Mutil.mlog("sendMoveMobileSignUp Send Error")}},sendMoveMobileSignIn=exports.sendMoveMobileSignIn=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB";if(!isWeb(a))try{if(isIOS(a)){var b;return Mutil.mlog("[IOS] sendMoveMobileSignIn"),null===(b=window)||void 0===b||null===(b=b.webkit.messageHandlers)||void 0===b||null===(b=b.FLOW_WEB_BRIDGE)||void 0===b?void 0:b.postMessage({CODE:"moveMobileSignInEvent"})}if(isAOS(a)){var c;return Mutil.mlog("[AOS] sendMoveMobileSignIn"),null===(c=window)||void 0===c||null===(c=c.AndroidBridgeSign)||void 0===c?void 0:c.moveMobileSignInEvent()}}catch(a){Mutil.mlog("sendMoveMobileSignIn Send Error")}},sendMobileSignIn=exports.sendMobileSignIn=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB",b=1<arguments.length?arguments[1]:void 0;if(!isWeb(a)){var c=b.ID_GB,d=void 0===c?"":c,e=b.USER_ID,f=void 0===e?"":e,g=b.EMAIL,h=void 0===g?"":g,i=b.USER_NM,j=void 0===i?"":i,k=b.PRFL_PHTG,l=void 0===k?"":k,m=b.SUB_DOM,n=void 0===m?"":m,o=b.PWD,p=void 0===o?"":o;if(!(Mutil.empty(d)||Mutil.empty(f))){var q={CODE:"mobileSignInEvent",VALUE:{idGubun:d,userId:f,userEmail:h,userName:j,userProfilePath:l,subDomain:n,password:p}};try{if(isIOS(a)){var r;return Mutil.mlog("[IOS] mobileSignInEvent"),null===(r=window)||void 0===r||null===(r=r.webkit.messageHandlers)||void 0===r?void 0:r.FLOW_WEB_BRIDGE.postMessage(q)}if(isAOS(a)){var s;return Mutil.mlog("[AOS] mobileSignInEvent"),null===(s=window)||void 0===s||null===(s=s.AndroidBridgeSign)||void 0===s?void 0:s.mobileSignInEvent(JSON.stringify(q.VALUE))}}catch(a){Mutil.mlog("mobileSignInEvent Send Error")}}}},openMailApp=exports.openMailApp=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB",b=1<arguments.length?arguments[1]:void 0;if(!isWeb(a)){var c=b.appName,d=void 0===c?"":c;if(Mutil.empty(d))return void Mutil.mlog("\uC5B4\uD50C\uB9AC\uCF00\uC774\uC158 \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");var e={CODE:"openMailApp",VALUE:{appName:d}};try{if(isIOS(a)){var f;return Mutil.mlog("[IOS] openMailApp"),null===(f=window)||void 0===f||null===(f=f.webkit.messageHandlers)||void 0===f?void 0:f.FLOW_WEB_BRIDGE.postMessage(e)}if(isAOS(a)){var g;return Mutil.mlog("[AOS] openMailApp"),null===(g=window)||void 0===g||null===(g=g.AndroidBridgeSign)||void 0===g?void 0:g.openMailApp(JSON.stringify(e.VALUE))}}catch(a){Mutil.mlog("openMailApp Send Error")}}},openShareContents=exports.openShareContents=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB",b=1<arguments.length?arguments[1]:void 0;if(!isWeb(a)){var c=b.text,d=void 0===c?"":c,e=b.title,f=void 0===e?"":e;try{if(isAOS(a)){var g;return Mutil.mlog("[AOS] openShareContents"),null===(g=window)||void 0===g||null===(g=g.AndroidBridgeSign)||void 0===g?void 0:g.openShareContents(JSON.stringify({CODE:"openShareContents",VALUE:{body:d,title:f}}.VALUE))}}catch(a){Mutil.mlog("openShareContents Send Error")}}},openSocialSignUpPopup=exports.openSocialSignUpPopup=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB",b=1<arguments.length?arguments[1]:void 0;if(!isWeb(a)){var c=b.appName,d=void 0===c?"":c;if(Mutil.empty(d))return void Mutil.mlog("\uBE0C\uB9BF\uC9C0 : openSocialSignUpPopup()\uC5D0 appName\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.  ");var e={CODE:"openSocialSignUpPopup",VALUE:{appName:d.toUpperCase()}};try{if(isIOS(a)){var f;return Mutil.mlog("[IOS] openSocialSignUpPopup"),null===(f=window)||void 0===f||null===(f=f.webkit.messageHandlers)||void 0===f?void 0:f.FLOW_WEB_BRIDGE.postMessage(e)}if(isAOS(a)){var g;return Mutil.mlog("[AOS] openSocialSignUpPopup"),null===(g=window)||void 0===g||null===(g=g.AndroidBridgeSign)||void 0===g?void 0:g.openSocialSignUpPopup(JSON.stringify(e.VALUE))}}catch(a){Mutil.mlog("openSocialSignUpPopup Send Error")}}},openTextMessageApp=exports.openTextMessageApp=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB",b=1<arguments.length?arguments[1]:void 0;if(!isWeb(a)){var c=b.inviteMsg,d=void 0===c?"":c;if(Mutil.empty(d))return void Mutil.mlog("\uCD08\uB300 \uBA54\uC2DC\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");var e={CODE:"openTextMessageApp",VALUE:{inviteMsg:d}};try{if(isIOS(a)){var f;return Mutil.mlog("[IOS] openTextMessageApp"),null===(f=window)||void 0===f||null===(f=f.webkit.messageHandlers)||void 0===f?void 0:f.FLOW_WEB_BRIDGE.postMessage(e)}if(isAOS(a)){var g;return Mutil.mlog("[AOS] openTextMessageApp"),null===(g=window)||void 0===g||null===(g=g.AndroidBridgeSign)||void 0===g?void 0:g.openTextMessageApp(JSON.stringify(e.VALUE))}}catch(a){Mutil.mlog("openTextMessageApp Send Error")}}},closeInviteView=exports.closeInviteView=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"WEB";if(!isWeb(a)){try{if(isIOS(a)){var b;return Mutil.mlog("[IOS] closeWebView"),null===(b=window)||void 0===b||null===(b=b.webkit.messageHandlers)||void 0===b?void 0:b.FLOW_WEB_BRIDGE.postMessage({CODE:"closeWebView"})}if(isAOS(a)){var c;return Mutil.mlog("[AOS] closeWebView"),null===(c=window)||void 0===c?void 0:c.FLOW_WEB_BRIDGE.closeWebView()}}catch(a){console.error("closeInviteView Send Error")}}};
9
10},{}],4:[function(require,module,exports){
11"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sendMoveMobileSignUpPage=exports.sendMoveMobileSignInPage=exports.mobileSignIn=exports.mobileOpenTextMessageApp=exports.mobileOpenSocialSignUpPopup=exports.mobileOpenShareContents=exports.mobileOpenMailApp=exports.mobileCloseFunc=exports.SignUpBridge=void 0;var _event=require("./event.js"),sendMoveMobileSignUpPage=exports.sendMoveMobileSignUpPage=function(){(0,_event.sendMoveMobileSignUp)(getDevice()
11)},sendMoveMobileSignInPage=exports.sendMoveMobileSignInPage=function(){(0,_event.sendMoveMobileSignIn)(getDevice())},mobileSignIn=exports.mobileSignIn=function(a){(0,_event.sendMobileSignIn)(getDevice(),a)},mobileOpenMailApp=exports.mobileOpenMailApp=function(a){(0,_event.openMailApp)(getDevice(),a)},mobileOpenShareContents=exports.mobileOpenShareContents=function(a){(0,_event.openShareContents)(getDevice(),a)},mobileOpenSocialSignUpPopup=exports.mobileOpenSocialSignUpPopup=function(a){(0,_event.openSocialSignUpPopup)(getDevice(),a)},mobileOpenTextMessageApp=exports.mobileOpenTextMessageApp=function(a){(0,_event.openTextMessageApp)(getDevice(),a)},mobileCloseFunc=exports.mobileCloseFunc=function(){(0,_event.closeInviteView)(getDevice())},getDevice=function(){var a=navigator.userAgent.toLowerCase();return 0<=a.indexOf("iphone")||0<=a.indexOf("ipad")||0<=a.indexOf("macintosh")?"IOS":"AOS"},SignUpBridge=exports.SignUpBridge={mobileSignIn:mobileSignIn};
12
13},{"./event.js":3}],5:[function(require,module,exports){
14"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.loginRequest=exports.getMsalConfig=void 0;var getMsalConfig=exports.getMsalConfig=function(){var a=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0],b=a?"https://".concat(window.location.hostname,"/mobileAzureLogin.act"):"/",c=location.host,d=c.includes("flowtest"),e=d?"63bd5b6c-5613-4f36-8fbe-13c2d15adbf4":Often.isGlobal()?"7da91c41-0c22-4145-b7f3-c064e366f63d":"bc7f685e-37c9-4728-a6fc-895947422c5e",f=d?"a43bf5df-204d-441c-abb3-9fb616732eab":Often.isGlobal()?"common":"7cf932c0-bced-4490-b11f-48d23b1fe0d9";return{auth:{clientId:e,authority:"https://login.microsoftonline.com/".concat(f),redirectUri:b,navigateToLoginRequestUrl:!0},cache:{cacheLocation:a?"sessionStorage":"memoryStorage",storeAuthStateInCookie:a}}},loginRequest=exports.loginRequest={scopes:["openid","email","User.Read"],prompt:"select_account"};
15
16},{}],6:[function(require,module,exports){
17"use strict";var _authConfig=require("./authConfig");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.handleAzureLogin=void 0;function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=_typeof(a)&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
17return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var msal=null,myMSALObj=null;function initMsal(){return _initMsal.apply(this,arguments)}function _initMsal(){return _initMsal=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(!window.msal){a.n=1;break}msal=window.msal,a.n=3;break;case 1:return a.n=2,Promise.resolve().then(function(){return _interopRequireWildcard(require("@azure/msal-browser"))});case 2:b=a.v,msal=b;case 3:c=(0,_authConfig.getMsalConfig)(!0),myMSALObj=new msal.PublicClientApplication(c);case 4:return a.a(2)}},a)})),_initMsal.apply(this,arguments)}var handleSignInResponse=function b(a){var c=a.accessToken,d=a.idToken;if(!c||!d)throw new Error("Necessary data is missing, response: ".concat(JSON.stringify(a)));var e={USER_ID:d,TOKEN:c,ID_GB:SignCode.TYPE.AZURE};try{var f=localStorage.getItem("azure_login_device");if("ios"===f)window.webkit.messageHandlers.FLOW_WEB_BRIDGE.postMessage(JSON.stringify(e));else if("aos"===f||"android"===f)window.FLOW_WEB_BRIDGE.postMessage(JSON.stringify(e));else throw new Error("no device type");localStorage.removeItem("azure_login_device")}catch(a){console.error("login data post to mobile error",a)}},handleAzureLogin=exports.handleAzureLogin=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(myMSALObj){a.n=1;break}return a.n=1,initMsal();case 1:return a.n=2,myMSALObj.handleRedirectPromise();case 2:if(b=a.v,!b){a.n=3;break}return handleSignInResponse(b),a.a(2);case 3:if(c=document.referrer.includes("login.microsoftonline.com"),c){a.n=5;break}if(d=new URLSearchParams(window.location.search),e=d.get("device"),e){a.n=4;break}throw new Error("no device type");case 4:try{localStorage.setItem("azure_login_device",e.toLowerCase()),myMSALObj.loginRedirect(_authConfig.loginRequest)}catch(a){console.error("Error mobile azure login request",a)}case 5:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}();
18
19},{"./authConfig":5,"@azure/msal-browser":179}],7:[function(require,module,exports){
20"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createProfileData=createProfileData,exports.signIn=signIn,exports.signUp=signUp;var _authConfig=require("./authConfig"),msal=_interopRequireWildcard(require("@azure/msal-browser"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function e(a,b){if(!b&&a&&a.__esModule)return a;var g,h,j={__proto__:null,default:a};if(null===a||"object"!=_typeof(a)&&"function"!=typeof a)return j;if(g=b?d:c){if(g.has(a))return g.get(a);g.set(a,j)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((h=(g=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(h.get||h.set)?g(j,f,h):j[f]=a[f]);return j})(a,b)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
20return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var msalConfig=(0,_authConfig.getMsalConfig)(),myMSALObj=new msal.PublicClientApplication(msalConfig);function signIn(){handleMsalPopup(null,handleSignInResponse).catch(function(a){return console.error("SignIn Error:",a)})}function signUp(){handleMsalPopup(null,handleSignUpResponse).catch(function(a){return console.error("SignUp Error:",a)})}var handleSignInResponse=function b(a){if(!a)throw new Error("SignIn Response is missing.");var c=a.accessToken,d=a.idToken;if(!c||!d)throw new Error("Necessary data is missing, response: ".concat(JSON.stringify(a)));CommonLogin.goLogin({USER_ID:d,TOKEN:c,ID_GB:SignCode.TYPE.AZURE})};function handleMsalPopup(a,b){return _handleMsalPopup.apply(this,arguments)}function _handleMsalPopup(){return _handleMsalPopup=_asyncToGenerator(_regenerator().m(function c(a,b){var d,e,f,g;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:if(c.p=0,!window.msal){c.n=1;break}d=window.msal,c.n=3;break;case 1:return c.n=2,Promise.resolve().then(function(){return _interopRequireWildcard(require("@azure/msal-browser"))});case 2:d=c.v;case 3:return e=new d.PublicClientApplication(msalConfig),c.n=4,e.initialize();case 4:return c.n=5,e.loginPopup(_authConfig.loginRequest);case 5:f=c.v,b(f),c.n=7;break;case 6:c.p=6,g=c.v,console.error("Error acquireTokenPopup:",g),a&&a(g);case 7:return c.a(2)}},c,null,[[0,6]])})),_handleMsalPopup.apply(this,arguments)}function handleSignUpResponse(a){if(!a)throw new Error("SignUp Response is missing.");var b=a.accessToken,c=a.idToken;if(!b||!c)throw new Error("Necessary data is missing, response: ".concat(JSON.stringify(a)));var d=createProfileData(a),e=requireModule("SignUpViewChanger",{on:["signup","index","newSignup"]})();e.loadSocialLoginSuccess(d)}function createProfileData(a){var b,c,d=Often.null2Void(a.idTokenClaims.email,null===a||void 0===a||null===(b=a.account)||void 0===b?void 0:b.username),e=Often.null2Void(a.idTokenClaims.name,null===a||void 0===a||null===(c=a.account)||void 0===c?void 0:c.name);return{USER_ID:d,ID_GB:SignCode.TYPE.AZURE,OBJ_CNTS_NM:ElectronApi.Comm.isElectron()?"desktop":"",EMAIL:d,USER_NM:e,TOKEN:a.accessToken,TOKEN_ID:a.idToken}}
21
22},{"./authConfig":5,"@azure/msal-browser":179}],8:[function(require,module,exports){
23"use strict";var Mobile=_interopRequireWildcard(require("./authMobile.js"));var Web=_interopRequireWildcard(require("./authWeb.js"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Web=exports.Mobile=void 0;exports.Mobile=Mobile;exports.Web=Web;function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=_typeof(a)&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}
24
25},{"./authMobile.js":6,"./authWeb.js":7}],9:[function(require,module,exports){
26"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addGuideLayerEvent=addGuideLayerEvent,exports.desktopDownload=desktopDownload;var _render=require("./render"),_Mutil=Mutil,isKey=_Mutil.isKey;function addGuideLayerEvent(){var a=$("#desktopGuideLayer");a.off("mousedown").on("mousedown",function(a){return a.stopPropagation()}),a.find(".js-close-btn").off("click").on("click",_render.removeDesktopGuideLayer),a.find("#desktopDownload").off("click").on("click",desktopDownload),a.off("keydown").on("keydown",keyDownDesktopLayer)}function desktopDownload(){var a=function(){var a="",b=navigator.userAgent;return a=-1<b.indexOf("Macintosh")?"OS_X":-1<b.indexOf("Linux")?"LINUX":"WINDOWS",a}(),b="team.flow.flowMiniRenewal",c=!Mutil.exist(window._USER_ID);
26(Often.isFunc(Func.CLOUD.SECURE_CONNECT)||Often.isFunc("MINI_SECURE_DOWNLOAD")||"secure.flow.team"===window.location.hostname)&&(b="secure.team.flow.flowMiniRenewal"),Often.isFunc(Func.CLOUD.MINI_DIRECTORY_DOWNLOAD)&&(b="dir.team.flow.flowMiniRenewal"),"Y"===Often.null2Void(_ENTER_YN,"N")&&(b="team.flow.flowEntMini"),Often.isGlobal()&&(b="com.morningmate.flowMiniRenewal"),Often.isFunc("CANNOT_ACCESS_S3")&&(b="direct.team.flow.flowMiniRenewal");var d={PCK_NM:b,GB:a};c&&(d.RGSN_DTTM="NO-SESSION"),Ajax.executeApi(RestApi.GET.FLOW_UPDATE_R001,d,function(a){""===Often.null2Void(a.flow_rec[0],"")||(ElectronApi.Comm.isElectronApp()?ElectronApi.Download.download(a.flow_rec[0].LINK_URL,"_blank"):window.open(a.flow_rec[0].LINK_URL,"_blank"))})}function keyDownDesktopLayer(a){if(a.stopPropagation(),isKey(a,"ESC"))return(0,_render.removeDesktopGuideLayer)()}
27
28},{"./render":11}],10:[function(require,module,exports){
29"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DesktopGuide=void 0;var _render=require("./render"),_event=require("./event.js"),_Mutil=Mutil,isFunc=_Mutil.isFunc,DesktopGuide=exports.DesktopGuide=function(){return{addEventOnDesktopGuideLayer:_render.addEventOnDesktopGuideLayer,initDesktopGuide:function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:Mutil.noop,b=isFunc("DESKTOP_GUIDE")||window.isShowdesktopGuide;return b?void(0,_render.loadDesktopGuideLayer)(a):void a()},desktopDownload:_event.desktopDownload}}();
30
31},{"./event.js":9,"./render":11}],11:[function(require,module,exports){
32"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addEventOnDesktopGuideLayer=addEventOnDesktopGuideLayer,exports.loadDesktopGuideLayer=loadDesktopGuideLayer,exports.removeDesktopGuideLayer=removeDesktopGuideLayer;var _event=require("./event"),_index=require("../popup-queue/index.js"),_Mutil=Mutil,isAct=_Mutil.isAct,requireIIFE=_Mutil.requireIIFE;function addEventOnDesktopGuideLayer(){var a=$("#desktopGuideLayer");history.replaceState({},null,location.pathname),a.focus(),(0,_event.addGuideLayerEvent)()}function loadDesktopGuideLayer(a){function b(){c.focus(),(0,_event.addGuideLayerEvent)()}var c=$("#desktopGuideLayer"),d=$("#desktopDownloadGuideArea");return 0<c.length?(c.show(),d.find("#continueWeb").css("display","none"),addEventOnDesktopGuideLayer()):void d.load("/flow-renewal/view/mainview/desktopDownloadGuide.jsp",function(){isAct("main")||$("body").css("overflow-y","hidden"),d.find("#continueWeb").css("display","none"),b(),"function"==typeof a&&a(),d.css("display","block")})}function removeDesktopGuideLayer(){isAct("main")?collectGoogleManager():$("body").css("overflow-y","auto"),Often.setCookie("DESKTOP_GUIDE_SHOW","N"),$("#desktopGuideLayer").remove(),$("#desktopDownloadGuideArea").css("display","none")}function collectGoogleManager(){var a=$("#desktopDownloadGuideArea"),b=a.find("#continueWeb").is(":visible");if(window.isFirstLogin&&"N"===OVER_GUIDE_PERIOD_YN&&b){var c=requireIIFE("GoogleTagManager");Often.isFunc("POPUP_QUEUE")?($("#userguiding").css("display","none"),(0,_index.inputPopupQueue)("#userguiding",900,function(){setTimeout(function(){var a;$("#userguiding").css("display","block"),null===c||void 0===c||c.collect({event:"NewUser"}),null===c||void 0===c||c.collect({event:"onboarding_AB1",userId:window._USER_ID,home:"".concat(null!==(a=window.globalValue)&&void 0!==a&&a.isDashBoardHome?"A":"B")})},1e3)})):setTimeout(function(){var a;null===c||void 0===c||c.collect({event:"NewUser"}),null===c||void 0===c||c.collect({event:"onboarding_AB1",userId:window._USER_ID,home:"".concat(null!==(a=window.globalValue)&&void 0!==a&&a.isDashBoardHome?"A":"B")})},1500)}}
33
34},{"../popup-queue/index.js":22,"./event":9}],12:[function(require,module,exports){
35"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TOAST_TEAMS_CLOSE=exports.TOAST_COMPLETE=exports.STEP_FLAGS=exports.SHOWCASE_PAGE_CODE=exports.SEL=exports.REUSED=exports.LAUNCH_TIP=exports.FLAG_CATEGORY=exports.FLAG=exports.FEATURE_KEY=exports.CARD_COPY=exports.ALL_STEPS=void 0;var _i18n=require("./i18n.js"),FEATURE_KEY=exports.FEATURE_KEY="ONBOARDING_CHECKLIST",FLAG_CATEGORY=exports.FLAG_CATEGORY="ONBOARDING_CHECKLIST",FLAG=exports.FLAG={STEP1_TOUR:"STEP1_TOUR",STEP2_PROFILE:"STEP2_PROFILE",STEP3_PROJECT:"STEP3_PROJECT",STEP4_INVITE:"STEP4_INVITE",STEP5_POST:"STEP5_POST",DISMISSED:"DISMISSED",SHOWN:"SHOWN",COMPLETED:"COMPLETED",TOUR_SEEN:"TOUR_SEEN",TEAMS_DISMISSED:"TEAMS_DISMISSED"},STEP_FLAGS=exports.STEP_FLAGS=[FLAG.STEP1_TOUR,FLAG.STEP2_PROFILE,FLAG.STEP3_PROJECT,FLAG.STEP4_INVITE,FLAG.STEP5_POST],ALL_STEPS=exports.ALL_STEPS=[{flag:FLAG.STEP1_TOUR},{flag:FLAG.STEP2_PROFILE},{flag:FLAG.STEP3_PROJECT},{flag:FLAG.STEP4_INVITE,inviteExcluded:!0},{flag:FLAG.STEP5_POST}],SHOWCASE_PAGE_CODE=exports.SHOWCASE_PAGE_CODE="anotherProject",SEL=exports.SEL={MY_PROJECT:"li[data-code=\"project\"]",DASHBOARD:"li[data-code=\"dashboard\"]",ACCOUNT:"#accountTopButton",PROJECT_MAKE:"#projectMakeButton",INVITE:"li[data-code=\"invite-member\"]",PROJECT_BOARD_UL:"#projectBoardUl",PROJECT_LIST_UL:"#projectListUl",POST_AREA:"#createPostUl",POST_TAB:"#createPostUl li.post-filter",SIDEBAR:"flow-sidebar"},REUSED=exports.REUSED={get DASHBOARD(){return(0,_i18n.tk)("dictionary:dashboard","\uB300\uC2DC\uBCF4\uB4DC")},get CALENDAR(){return(0,_i18n.tk)("dictionary:calendar","\uCE98\uB9B0\uB354")},get POST_TYPE(){return(0,_i18n.tk)("dictionary:articleType","\uAC8C\uC2DC\uBB3C \uC720\uD615")},get LOOK_AROUND(){var a=(0,_i18n.tk)("dictionary:screen",""),b=a?(0,_i18n.tk)("common:lookAround","",{val:a}):"";return b||(0,_i18n.t)("step1.label","\uD654\uBA74 \uB458\uB7EC\uBCF4\uAE30")},get WIKI(){return(0,_i18n.tk)("dictionary:wiki",(0,_i18n.t)("tour.wiki","\uC704\uD0A4"))},get DRIVE(){return(0,_i18n.tk)("dictionary:drive",(0,_i18n.t)("tour.drive","\uB4DC\uB77C\uC774\uBE0C"))},get OKR(){return(0,_i18n.tk)("dictionary:okr",(0,_i18n.t)("tour.okr","OKR"))},get REPATTERN_AI(){return(0,_i18n.tk)("dictionary:repatternAI",(0,_i18n.t)("tour.repatternAi","\uB9AC\uD328\uD134 AI"))},get MY_PROJECT(){return(0,_i18n.tk)("common:myProjects","\uB0B4 \uD504\uB85C\uC81D\uD2B8")},get NEW_PROJECT(){return(0,_i18n.tk)("common:new","\uC0C8 \uD504\uB85C\uC81D\uD2B8",{val:(0,_i18n.tk)("dictionary:project","\uD504\uB85C\uC81D\uD2B8")})},get PROJECT_SETTING(){return(0,_i18n.tk)("common:setting_plural","\uD504\uB85C\uC81D\uD2B8 \uC124\uC815",{val:(0,_i18n.tk)("dictionary:project","\uD504\uB85C\uC81D\uD2B8")})}
35,get OPEN_PROJECT(){return(0,_i18n.tk)("common:open","\uD504\uB85C\uC81D\uD2B8 \uC5F4\uAE30",{val:(0,_i18n.tk)("dictionary:project","\uD504\uB85C\uC81D\uD2B8")})},get PROFILE_SETTING(){return(0,_i18n.tk)("main:tutorial.addProfile","\uD504\uB85C\uD544 \uC124\uC815\uD558\uAE30")},get CREATE_PROJECT(){return(0,_i18n.tk)("main:createBlackProject","\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uB9CC\uB4E4\uAE30")},get INVITE_EMPLOYEE(){return(0,_i18n.tk)("main:inviteEmployee.inviteEmployee","\uC9C1\uC6D0 \uCD08\uB300")},get WRITE_POST(){return(0,_i18n.tk)("common:writePost","\uAC8C\uC2DC\uBB3C \uC791\uC131")},get INTEGRATION(){return(0,_i18n.tk)("main:mySetting.integrationSetting","\uC678\uBD80\uC11C\uBE44\uC2A4 \uC5F0\uB3D9")},get EDIT_PHOTO(){return(0,_i18n.tk)("main:mySetting.editPhoto","\uC0AC\uC9C4 \uBCC0\uACBD")},get SKIP(){return(0,_i18n.tk)("common:skipForNow","\uB098\uC911\uC5D0 \uD558\uAE30")},get NOTI_DISPLAY_SETTING(){return"".concat((0,_i18n.tk)("common:notificationSetting","\uC54C\uB9BC \uC124\uC815")," \xB7 ").concat((0,_i18n.tk)("main:mySetting.displaySetting","\uB514\uC2A4\uD50C\uB808\uC774 \uC124\uC815"))},get USE_CASE(){return(0,_i18n.tk)("main:gallery.flowUseCase","\uC0C1\uC704 5% \uAE30\uC5C5\uC758 \uD50C\uB85C\uC6B0 \uD65C\uC6A9\uBC95")},get USE_CASE_DESC(){return(0,_i18n.tk)("main:gallery.flowUseCaseDesc","\uB2E4\uB978 \uD68C\uC0AC\uB294 \uD50C\uB85C\uC6B0\uB97C \uC5B4\uB5BB\uAC8C \uC4F0\uACE0 \uC788\uB294\uC9C0 \uAD81\uAE08\uD558\uC2E0\uAC00\uC694? \uC9C0\uAE08 \uBC14\uB85C \uB2E4\uB978 \uD68C\uC0AC \uD504\uB85C\uC81D\uD2B8\uB97C \uAD6C\uACBD\uD574\uBCF4\uC138\uC694!")},get USE_CASE_BTN(){return(0,_i18n.tk)("main:task.tutorialPreview","\uD65C\uC6A9\uC608\uC2DC \uBCF4\uAE30")}},CARD_COPY=exports.CARD_COPY={get TITLE(){return(0,_i18n.t)("card.title","\uAE30\uBCF8 \uC124\uC815\uBD80\uD130 \uCCAB \uC5C5\uBB34 \uB4F1\uB85D\uAE4C\uC9C0, \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uD601\uC2E0\uC744 \uBC14\uB85C \uC2DC\uC791\uD558\uC138\uC694")},SUB_PROGRESS:function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:5,c="main:onboarding.card.subProgress";try{if("undefined"!=typeof i18next&&i18next.exists&&i18next.exists(c))return i18next.t(c,{count:a,total:b})}catch(a){}return"".concat(a,"/").concat(b," \uB2E8\uACC4 \uC644\uB8CC")},get SUB_DONE(){return(0,_i18n.t)("card.subDone","\uBAA8\uB4E0 \uC900\uBE44\uAC00 \uB05D\uB0AC\uC2B5\uB2C8\uB2E4")},get STEP_NAMES(){return[REUSED.LOOK_AROUND,REUSED.PROFILE_SETTING,REUSED.CREATE_PROJECT,REUSED.INVITE_EMPLOYEE,REUSED.WRITE_POST]},get SHOWCASE_BADGE(){return(0,_i18n.t)("showcase.badge","\u2B50 \uC0C1\uC704 5% \uD65C\uC6A9\uBC95")},get SHOWCASE_TITLE(){return REUSED.USE_CASE},get SHOWCASE_DESC(){return REUSED.USE_CASE_DESC},get SHOWCASE_BTN(){return REUSED.USE_CASE_BTN}},TOAST_COMPLETE=exports.TOAST_COMPLETE=function(){var a=(0,_i18n.t)("toast.completeTail","");return a?(0,_i18n.joinSentence)(CARD_COPY.SUB_DONE,a):(0,_i18n.t)("toast.complete","\uBAA8\uB4E0 \uC900\uBE44\uAC00 \uB05D\uB0AC\uC2B5\uB2C8\uB2E4. \uC2E4\uC2DC\uAC04 \uD611\uC5C5\uC73C\uB85C \uC5C5\uBB34\uB97C \uAD00\uB9AC\uD558\uC138\uC694.")},TOAST_TEAMS_CLOSE=exports.TOAST_TEAMS_CLOSE=function(){return(0,_i18n.t)("launch.flow","\uC628\uBCF4\uB529 \uCCB4\uD06C\uB9AC\uC2A4\uD2B8\uB294 \uD50C\uB85C\uC6B0\uC5D0\uC11C \uB2E4\uC2DC \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4")}
35,LAUNCH_TIP=exports.LAUNCH_TIP={get TITLE(){return(0,_i18n.t)("launch.title","\uC774\uC5B4\uC11C \uC9C4\uD589\uD558\uC138\uC694.")},get DESC(){return(0,_i18n.t)("launch.desc","\uC628\uBCF4\uB529 \uCCB4\uD06C\uB9AC\uC2A4\uD2B8\uB294 \uC774\uACF3\uC5D0\uC11C<br>\uB2E4\uC2DC \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.")}};
36
37},{"./i18n.js":14}],13:[function(require,module,exports){
38"use strict";var _constant=require("./constant.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.isBizplayLinked=isBizplayLinked,exports.isFeatureOn=isFeatureOn,exports.isGuest=isGuest,exports.isNewSignup=isNewSignup,exports.isTeamsCtx=isTeamsCtx;function isNewSignup(){try{return!!(window.globalValue&&!0===window.globalValue.isOnboardingTarget)}catch(a){return(!1)}}function isFeatureOn(){try{if(window.Mutil&&"function"==typeof window.Mutil.isFunc)return!!window.Mutil.isFunc(_constant.FEATURE_KEY);if(window.Often&&"function"==typeof window.Often.isFunc)return!!window.Often.isFunc(_constant.FEATURE_KEY)}catch(a){}return(!1)}function isTeamsCtx(){try{var a=window.Mutil&&"function"==typeof window.Mutil.requireIIFE?window.Mutil.requireIIFE("TeamsHelper",!1):window.TeamsHelper;if(!a)return(!1);if("function"==typeof a.isTeamsContext)return!!a.isTeamsContext();if("function"==typeof a.isTeams)return!!a.isTeams()}catch(a){}return(!1)}function isGuest(){try{if(window.Mutil&&"function"==typeof window.Mutil.isGuest)return!!window.Mutil.isGuest();if(window.Often&&"function"==typeof window.Often.isGuest)return!!window.Often.isGuest()}catch(a){}return(!1)}function isBizplayLinked(){try{return"string"==typeof window._USE_INTT_ID&&0===window._USE_INTT_ID.indexOf("UTLZ_")}catch(a){return(!1)}}
39
40},{"./constant.js":12}],14:[function(require,module,exports){
41"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.joinSentence=joinSentence,exports.t=t,exports.tk=tk;function t(a,b){try{var c="main:onboarding.".concat(a);if("undefined"!=typeof i18next&&i18next.exists&&i18next.exists(c))return i18next.t(c)}catch(a){}return b}var SENTENCE_END=/[.。!?!?]$/;function joinSentence(a,b){var c=((a||"")+"").trim(),d=((b||"")+"").trim();if(!d)return c;if(!c)return d;var e=SENTENCE_END.test(d)?d.slice(-1):".",f="\u3002"===e,g=SENTENCE_END.test(c)?c:c+(f?"\u3002":e);return f?g+d:"".concat(g," ").concat(d)}function tk(a,b,c){try{if("undefined"!=typeof i18next&&i18next.exists&&i18next.exists(a))return c?i18next.t(a,c):i18next.t(a)}catch(a){}return b}
42
43},{}],15:[function(require,module,exports){
44"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.latchStep=latchStep,exports.seedLatched=seedLatched;var _UserFlagApiCall=require("../../apiCall/user-flag/UserFlagApiCall.js"),_constant=require("./constant.js"),_gating=require("./gating.js"),_tracking=require("./tracking.js"),_state=require("./state.js");function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}var api=new _UserFlagApiCall.UserFlagApiCall(_constant.FLAG_CATEGORY),VALID=new Set([].concat(_toConsumableArray(_constant.STEP_FLAGS),[_constant.FLAG.DISMISSED,_constant.FLAG.SHOWN,_constant.FLAG.COMPLETED,_constant.FLAG.TOUR_SEEN,_constant.FLAG.TEAMS_DISMISSED])),LATCH_ONCE=new Set([].concat(_toConsumableArray(_constant.STEP_FLAGS),[_constant.FLAG.COMPLETED,_constant.FLAG.TOUR_SEEN,_constant.FLAG.TEAMS_DISMISSED])),sent=new Set;
44function seedLatched(a){(a||[]).forEach(function(a){LATCH_ONCE.has(a)&&sent.add(a)})}function latchStep(a){if((0,_gating.isFeatureOn)()&&VALID.has(a)){if(LATCH_ONCE.has(a)){if(sent.has(a))return;sent.add(a)}(0,_state.isLoadFailed)()||(a===_constant.FLAG.COMPLETED?(0,_tracking.trackCompleted)():(0,_tracking.trackStepCompleted)(a));try{api.setFlagY(a)}catch(a){}try{window.dispatchEvent(new CustomEvent("onboarding:step",{detail:{type:a}}))}catch(a){}}}
45
46},{"../../apiCall/user-flag/UserFlagApiCall.js":2,"./constant.js":12,"./gating.js":13,"./state.js":16,"./tracking.js":19}],16:[function(require,module,exports){
47"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.doneCount=doneCount,exports.doneTypes=doneTypes,exports.has=has,exports.isAllDone=isAllDone,exports.isCelebrated=isCelebrated,exports.isDismissed=isDismissed,exports.isLoadFailed=isLoadFailed,exports.isReady=isReady,exports.isTeamsDismissed=isTeamsDismissed,exports.load=load,exports.markLocal=markLocal,exports.remove=remove,exports.stepDone=stepDone;var _UserFlagApiCall=require("../../apiCall/user-flag/UserFlagApiCall.js"),_constant=require("./constant.js"),_steps=require("./steps.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var api=new _UserFlagApiCall.UserFlagApiCall(_constant.FLAG_CATEGORY),flags=new Set,ready=!1,loadFailed=!1;function load(){return _load.apply(this,arguments)}function _load(){return _load=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:return a.p=0,a.n=1,api.find();case 1:b=a.v,c=Array.isArray(b)?b:[],flags=new Set(c.filter(function(a){return a&&a.CATEGORY===_constant.FLAG_CATEGORY&&"Y"===a.VALUE}).map(function(a){return a.TYPE})),loadFailed=!1,a.n=3;break;case 2:a.p=2,d=a.v,flags=new Set,loadFailed=!0;case 3:return ready=!0,a.a(2,flags)}},a,null,[[0,2]])})),_load.apply(this,arguments)}function isReady(){return ready}function isLoadFailed(){return loadFailed}function has(a){return flags.has(a)}function doneTypes(){return Array.from(flags)}function stepDone(a){return flags.has((0,_steps.activeFlags)()[a])}function doneCount(){return(0,_steps.activeFlags)().filter(function(a){return flags.has(a)}).length}function isAllDone(){var b=(0,_steps.activeFlags)();return 0<b.length&&b.every(function(a){return flags.has(a)})}function isDismissed(){return flags.has(_constant.FLAG.DISMISSED)}function isTeamsDismissed(){return flags.has(_constant.FLAG.TEAMS_DISMISSED)}function isCelebrated(){return flags.has(_constant.FLAG.COMPLETED)}function markLocal(a){return!flags.has(a)&&(flags.add(a),!0)}function remove(a){return _remove.apply(this,arguments)}function _remove(){return _remove=_asyncToGenerator(_regenerator().m(function b(a){var c;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return b.p=0,b.n=1,api.deleteFlag(a);case 1:b.n=3;break;case 2:b.p=2,c=b.v;case 3:flags.delete(a);case 4:return b.a(2)}},b,null,[[0,2]])})),_remove.apply(this,arguments)}
48
49},{"../../apiCall/user-flag/UserFlagApiCall.js":2,"./constant.js":12,"./steps.js":17}],17:[function(require,module,exports){
50"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.activeCount=activeCount,exports.activeFlags=activeFlags,exports.activeSteps=activeSteps,exports.stepNumOf=stepNumOf;var _constant=require("./constant.js"),_tours=require("./tours.js"),_gating=require("./gating.js");function activeSteps(){var a=(0,_gating.isGuest)()||(0,_gating.isBizplayLinked)(),b=_constant.CARD_COPY.STEP_NAMES,c=[];
50return _constant.ALL_STEPS.forEach(function(d,e){a&&d.inviteExcluded||c.push({flag:d.flag,name:b[e],tour:_tours.STEPS[e]})}),c}function activeFlags(){return activeSteps().map(function(a){return a.flag})}function activeCount(){return activeSteps().length}function stepNumOf(a){var b=activeFlags().indexOf(a);return 0>b?0:b+1}
51
52},{"./constant.js":12,"./gating.js":13,"./tours.js":18}],18:[function(require,module,exports){
53"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.STEPS=exports.POST_TYPE_MARK=void 0,exports.guideCard=guideCard;var _constant=require("./constant.js"),_i18n=require("./i18n.js"),_gating=require("./gating.js");function rail(a){return{shadow:_constant.SEL.SIDEBAR,selector:"[data-menu-id=\"".concat(a,"\"] .nav-rail__tile-btn")}}var STEP1_SEQ=[{target:_constant.SEL.MY_PROJECT,get h(){return _constant.REUSED.MY_PROJECT},get d(){return(0,_i18n.t)("tour.myProjectDesc","\uCC38\uC5EC \uC911\uC778 \uBAA8\uB4E0 \uD504\uB85C\uC81D\uD2B8\uB97C \uD55C\uACF3\uC5D0\uC11C \uAD00\uB9AC\uD569\uB2C8\uB2E4.")}},{target:_constant.SEL.DASHBOARD,optional:!0,get h(){return _constant.REUSED.DASHBOARD},get d(){return(0,_i18n.t)("tour.dashboardDesc","\uC9C4\uD589\uC911\uC778 \uC5C5\uBB34\uC640 \uC77C\uC815\uC744 \uD55C \uB208\uC5D0 \uD655\uC778\uD569\uB2C8\uB2E4. \uC704\uC82F \uC124\uC815\uC73C\uB85C \uD654\uBA74\uC744 \uC6D0\uD558\uB294 \uB300\uB85C \uAD6C\uC131\uD560 \uC218 \uC788\uC5B4\uC694.")}},{target:rail("wiki"),optional:!0,video:"coach-wiki",get h(){return _constant.REUSED.WIKI},get d(){return(0,_i18n.t)("tour.wikiDesc","\uD769\uC5B4\uC9C4 \uBB38\uC11C\uAC00 \uD300\uC758 \uC790\uC0B0\uC774 \uB429\uB2C8\uB2E4")},get bullets(){return[(0,_i18n.t)("tour.wikiBullet1","\uC2E4\uC2DC\uAC04 \uB3D9\uC2DC \uD3B8\uC9D1"),(0,_i18n.t)("tour.wikiBullet2","AI \uAE30\uBC18 \uBB38\uC11C \uD3B8\uC9D1"),(0,_i18n.t)("tour.wikiBullet3","\uC790\uB3D9\uC73C\uB85C \uC313\uC774\uB294 \uBCC0\uACBD \uC774\uB825")]}},{target:rail("calendar"),optional:!0,video:"coach-calendar",get h(){return _constant.REUSED.CALENDAR},get d(){return(0,_i18n.t)("tour.calendarDesc","\uC804\uCCB4 \uC77C\uC815\uC744 \uD1B5\uD569\uCE98\uB9B0\uB354\uC5D0\uC11C \uAD00\uB9AC\uD569\uB2C8\uB2E4")},get bullets(){return[(0,_i18n.t)("tour.calendarBullet1","\uC804\uCCB4 \uC77C\uC815\uC744 \uD55C\uB208\uC5D0 \uACF5\uC720"),(0,_i18n.t)("tour.calendarBullet2","\uD504\uB85C\uC81D\uD2B8 \uC77C\uC815\uACFC \uC790\uB3D9 \uC5F0\uACB0"),(0,_i18n.t)("tour.calendarBullet3","\uAD6C\uAE00\xB7\uC544\uC6C3\uB8E9 \uCE98\uB9B0\uB354 \uC5F0\uB3D9")]}},{target:rail("drive"),optional:!0,video:"coach-drive",get h(){return _constant.REUSED.DRIVE},get d(){return(0,_i18n.t)("tour.driveDesc","\uD544\uC694\uD55C \uD30C\uC77C\uC744 1\uCD08 \uB9CC\uC5D0 \uCC3E\uC544\uB0C5\uB2C8\uB2E4")},get bullets(){return[(0,_i18n.t)("tour.driveBullet1","\uAD8C\uD55C \uAE30\uBC18 \uC548\uC804\uD55C \uACF5\uC720"),(0,_i18n.t)("tour.driveBullet2","\uBCF8\uBB38\uAE4C\uC9C0 \uCC3E\uB294 \uC2A4\uB9C8\uD2B8 \uAC80\uC0C9"),(0,_i18n.t)("tour.driveBullet3","\uD504\uB85C\uC81D\uD2B8\uC640 \uD30C\uC77C\uC744 \uD55C\uACF3\uC5D0")]}},{target:rail("okr"),optional:!0,video:"coach-okr",get h(){return _constant.REUSED.OKR},get d(){return(0,_i18n.t)("tour.okrDesc","\uC138\uC6B4 \uBAA9\uD45C\uAC00 \uC8FC\uAC04 \uBCF4\uACE0\uC11C\uB85C \uC644\uC131\uB429\uB2C8\uB2E4")},get bullets(){return[(0,_i18n.t)("tour.okrBullet1","\uBAA9\uD45C\uBD80\uD130 \uBCF4\uACE0\uC11C\uAE4C\uC9C0 AI\uB85C \uC5F0\uACB0"),(0,_i18n.t)("tour.okrBullet2","\uC2E4\uC2DC\uAC04 \uB370\uC774\uD130 \uC5F0\uB3D9 \uBAA9\uD45C \uAD00\uB9AC"),(0,_i18n.t)("tour.okrBullet3","OKR\xB7\uC2E4\uD589\xB7\uBCF4\uACE0\uC11C\uB97C \uD558\uB098\uB85C")]}},{target:rail("flow-ai"),optional:!0,video:"coach-flow-ai",get h(){return _constant.REUSED.REPATTERN_AI},get d(){return(0,_i18n.t)("tour.repatternAiDesc","\uBC18\uBCF5 \uC5C5\uBB34\uB97C AI\uAC00 \uB300\uC2E0\uD569\uB2C8\uB2E4")},get bullets(){return[(0,_i18n.t)("tour.repatternAiBullet1","\uB300\uD654\xB7\uAC80\uC0C9\xB7\uCC57\uBD07\xB7\uC774\uBBF8\uC9C0 \uC0DD\uC131"),(0,_i18n.t)("tour.repatternAiBullet2","\uC2A4\uC2A4\uB85C \uCC98\uB9AC\uD558\uB294 \uC2A4\uB9C8\uD2B8 \uC5D0\uC774\uC804\uD2B8"),(0,_i18n.t)("tour.repatternAiBullet3","\uD55C\uB208\uC5D0 \uAD00\uB9AC\uD558\uB294 \uD300 \uC804\uCCB4 AI")]}}],TEAMS_STEP1_LEN=2,STEPS=exports.STEPS=[{get label(){return _constant.REUSED.LOOK_AROUND},isTour:!0,get seq(){return(0,_gating.isTeamsCtx)()?STEP1_SEQ.slice(0,TEAMS_STEP1_LEN):STEP1_SEQ}},{get label(){return _constant.REUSED.PROFILE_SETTING},launch:"profile",seq:[{target:_constant.SEL.ACCOUNT,get h(){return _constant.REUSED.EDIT_PHOTO},get d(){return(0,_i18n.t)("profile.photoDesc","\uB0B4 \uD504\uB85C\uD544 &gt; \uC815\uBCF4\uC218\uC815\uC5D0\uC11C \uC0AC\uC9C4\uC744 \uB4F1\uB85D\uD569\uB2C8\uB2E4.")}},{target:_constant.SEL.ACCOUNT,get h(){return _constant.REUSED.NOTI_DISPLAY_SETTING},get d(){return(0,_i18n.t)("profile.settingDesc","\uD658\uACBD\uC124\uC815 &gt; \uC54C\uB9BC/\uB514\uC2A4\uD50C\uB808\uC774 \uC124\uC815\uC744 \uC6D0\uD558\uB294\uB300\uB85C \uBCC0\uACBD\uD560 \uC218 \uC788\uC5B4\uC694.")}},{target:_constant.SEL.ACCOUNT,get h(){return _constant.REUSED.INTEGRATION},get d(){return(0,_i18n.t)("profile.integrationDesc","ZOOM \uD654\uC0C1\uD68C\uC758, \uAD6C\uAE00\xB7\uC544\uC6C3\uB8E9 \uCE98\uB9B0\uB354 \uB4F1<br>\uC678\uBD80 \uC11C\uBE44\uC2A4\uB97C \uC5F0\uACB0\uD558\uC5EC \uC5C5\uBB34\uB97C \uD655\uC7A5\uD574\uBCF4\uC138\uC694.")}}]},{get label(){return _constant.REUSED.CREATE_PROJECT},launch:"project",seq:[{target:_constant.SEL.PROJECT_MAKE,optional:!0,total:2,index:0,get h(){return _constant.REUSED.NEW_PROJECT},get d(){return(0,_i18n.t)("project.newDesc","\uBAA9\uD45C \uB2EC\uC131\uC758 \uC9C0\uB984\uAE38, \uC0C8 \uD504\uB85C\uC81D\uD2B8\uB97C \uB9CC\uB4E4\uC5B4 \uC2E4\uC2DC\uAC04 \uC5C5\uBB34 \uD611\uC5C5\uC744 \uC2DC\uC791\uD558\uC138\uC694.")}},{target:_constant.SEL.PROJECT_MAKE,optional:!0,total:2,index:1,get h(){return _constant.REUSED.PROJECT_SETTING},get d(){return(0,_i18n.t)("project.settingDesc","\uD648 \uD0ED\uACFC \uACF5\uAC1C \uBC94\uC704, \uAC8C\uC2DC\uAE00\xB7\uB313\uAE00 \uB4F1\uC758 \uD504\uB85C\uC81D\uD2B8 \uAD8C\uD55C\uC744 \uC124\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.")}}]},{get label(){return _constant.REUSED.INVITE_EMPLOYEE},launch:"invite",seq:[{target:_constant.SEL.INVITE,optional:!0,get h(){return _constant.REUSED.INVITE_EMPLOYEE},get d(){return(0,_i18n.t)("invite.memberDesc","\uC774\uBA54\uC77C\uC744 \uBCF4\uB0B4\uAC70\uB098 \uCD08\uB300\uC7A5 \uB9C1\uD06C\uB97C \uACF5\uC720\uD558\uC5EC \uD611\uC5C5\uD560 \uC9C1\uC6D0\uC744 \uCD08\uB300\uD558\uC138\uC694.")}}]},{get label(){return _constant.REUSED.WRITE_POST}
53,launch:"feed",seq:[{target:guideCard,waitMs:6e3,total:2,index:0,forceNext:!0,get h(){return _constant.REUSED.OPEN_PROJECT},get d(){return(0,_i18n.t)("post.enterDesc","\uD504\uB85C\uC81D\uD2B8 \uC548\uC5D0\uC11C \uCCAB \uAC8C\uC2DC\uBB3C\uC744 \uB4F1\uB85D\uD569\uB2C8\uB2E4.")}}]}],POST_TYPE_MARK=exports.POST_TYPE_MARK={target:_constant.SEL.POST_AREA,waitMs:8e3,total:2,index:1,list:!0,get h(){return _constant.REUSED.POST_TYPE},get d(){return(0,_i18n.t)("post.typeDesc","\uBAA9\uC801\uC5D0 \uB9DE\uB294 \uAE00 \uC720\uD615\uC744 \uC120\uD0DD\uD558\uC138\uC694.")},get bullets(){return[(0,_i18n.t)("post.typeBullet1","\uAE00: \uC18C\uC2DD\xB7\uC815\uBCF4\uB97C \uC790\uC720\uB86D\uAC8C \uB098\uB204\uB294 \uAC8C\uC2DC\uAE00"),(0,_i18n.t)("post.typeBullet2","\uC5C5\uBB34: \uB2F4\uB2F9\uC790\uC640 \uAE30\uD55C\uC744 \uC815\uD574 \uC9C4\uD589\uD558\uB294 \uC5C5\uBB34"),(0,_i18n.t)("post.typeBullet3","\uC77C\uC815: \uD300\uACFC \uD568\uAED8 \uACF5\uC720\uD558\uB294 \uC77C\uC815\xB7\uC774\uBCA4\uD2B8"),(0,_i18n.t)("post.typeBullet4","\uD560 \uC77C: \uCCB4\uD06C\uB9AC\uC2A4\uD2B8\uB85C \uAD00\uB9AC\uD558\uB294 \uD560 \uC77C"),(0,_i18n.t)("post.typeBullet5","\uD22C\uD45C: \uD300\uC6D0 \uC758\uACAC\uC744 \uBE60\uB974\uAC8C \uBAA8\uC73C\uB294 \uD22C\uD45C")]}};function guideCard(){var a=[_constant.SEL.PROJECT_BOARD_UL,_constant.SEL.PROJECT_LIST_UL].flatMap(function(a){return Array.from(document.querySelectorAll("".concat(a," .project-item")))}),b=a.filter(function(a){var b=a.getBoundingClientRect();return 0<b.width&&0<b.height}),c=b.length?b:a,d=c.find(function(a){var b=a.querySelector(".project-ttl");return b&&/시작가이드|가이드/.test(b.textContent||"")});return d||c[0]||null}
54
55},{"./constant.js":12,"./gating.js":13,"./i18n.js":14}],19:[function(require,module,exports){
56"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.specStepOf=specStepOf,exports.trackClosed=trackClosed,exports.trackCompleted=trackCompleted,exports.trackShown=trackShown,exports.trackStepClicked=trackStepClicked,exports.trackStepCompleted=trackStepCompleted;var _constant=require("./constant.js"),_steps=require("./steps.js"),_gating=require("./gating.js"),_trackerWorkspace=require("../../core/tracker-workspace.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var SPEC_STEP=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},_constant.FLAG.STEP1_TOUR,{step_number:1,step_name:"tour"}),_constant.FLAG.STEP2_PROFILE,{step_number:2,step_name:"profile_setup"}),_constant.FLAG.STEP3_PROJECT,{step_number:3,step_name:"project_create"}),_constant.FLAG.STEP4_INVITE,{step_number:4,step_name:"invite_member"}),_constant.FLAG.STEP5_POST,{step_number:5,step_name:"post_create"});function startedAtKey(){var a="";try{a=window._USER_ID||""}catch(a){}return"onb.startedAt."+a}var shownSent=!1;function targetProps(){try{return{is_onboarding_target:(0,_gating.isNewSignup)()?"Y":"N"}}catch(a){return{}}}function send(a,b){try{var c=Mutil.requireIIFE("GoogleTagManager",!1);if(!c)return;c.collect(_objectSpread(_objectSpread({event:a},(0,_trackerWorkspace.workspaceProps)()),b))}catch(b){try{Mutil.mlog("onboarding GA4 skip",a,b)}catch(a){}}}function specStepOf(a){return SPEC_STEP[a]||null}function trackShown(){if(!shownSent){shownSent=!0;try{var a=startedAtKey();localStorage.getItem(a)||localStorage.setItem(a,Date.now()+"")}catch(a){}send("onboarding_shown",_objectSpread({total_steps:(0,_steps.activeCount)()},targetProps()))}}function trackStepClicked(a){var b=specStepOf(a);b&&send("onboarding_step_clicked",_objectSpread(_objectSpread({},b),targetProps()))}function trackStepCompleted(a){var b=specStepOf(a);b&&send("onboarding_step_completed",_objectSpread(_objectSpread({},b),{},{total_steps:(0,_steps.activeCount)()},targetProps()))}function trackCompleted(){var a=_objectSpread({total_steps:(0,_steps.activeCount)()},targetProps());try{var b=startedAtKey(),c=+localStorage.getItem(b);if(0<c){var d=Math.round((Date.now()-c)/1e3);0<=d&&(a.total_duration_sec=d)}localStorage.removeItem(b)}catch(a){}send("onboarding_completed",a)}function trackClosed(a){send("onboarding_closed",_objectSpread({completed_steps:a,total_steps:(0,_steps.activeCount)()},targetProps()))}
57
58},{"../../core/tracker-workspace.js":30,"./constant.js":12,"./gating.js":13,"./steps.js":17}],20:[function(require,module,exports){
59"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.connectAzure=connectAzure,exports.getOrganizationData=getOrganizationData,exports.goAzureLogin=goAzureLogin,exports.inactivateUserFromAzure=inactivateUserFromAzure;var _util=_interopRequireDefault(require("../../util")),_index=require("../../util/electron/index.js"),_index2=_interopRequireDefault(require("../../util/index.js"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
vendor: 3,836 bytes, line 59
59:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var Ajax=_util.default.Ajax,AJAX_OPTION=_util.default.AJAX_OPTION,USE_INTT_ID=window._USE_INTT_ID||"",RGSN_DTTM=window._RGSN_DTTM||"",USER_ID=window._USER_ID||"";function getTeamsOAuthClientId(){switch(!0){case-1<_USE_INTT_ID.indexOf("KYOWON"):return{client_id:"ec8b1ab2-a5c9-41c3-983f-c0b00fc8b818",tenant_id:"6
59aba328a-b414-4a52-bf31-46f3e35e8b39"};case Often.isGlobal()&&-1<_USE_INTT_ID.indexOf("BFLOW_300000009787"):return{client_id:"7396615a-f613-4fb0-a2d7-682d74654686",tenant_id:"59242678-28eb-4391-831c-23557bc72f5c"};case-1<_USE_INTT_ID.indexOf("LOCAL")||-1<location.href.indexOf("entertest"):return{client_id:"9adf41af-3031-41a0-aaad-eeba5a7a35ab",tenant_id:"Q9h8Q~bH.LlvJfq0ysUTgUxY.FZOX3q76D-njaD5"};case Often.isGlobal():return{client_id:"7da91c41-0c22-4145-b7f3-c064e366f63d",tenant_id:"cd16b666-9fd3-4188-847b-843c857a62d8"};default:return{client_id:"e7d7139f-f062-4d0e-87a2-04cbd368fd96",tenant_id:"cd16b666-9fd3-4188-847b-843c857a62d8"}}}function connectAzure(){return _connectAzure.apply(this,arguments)}function _connectAzure(){return _connectAzure=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i,j,k,l,m,n;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=USER_ID,c=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),Often.isAct("signin")){a.n=2;break}return d=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.n=1,d.executeApi("FLOW_USE_INTT_INFM_R001",{USE_INTT_ID:USE_INTT_ID});case 1:e=a.v,f=Mutil.n2v(e.SUB_DOM,"").toLowerCase(),location.host.startsWith("".concat(f,"."))&&(c=c.replace("".concat(f,"."),""));case 2:return g=getTeamsOAuthClientId(),h=g.client_id,i=g.tenant_id,j="https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?client_id="+h+"&response_type=code&redirect_uri="+(c+"/msteams_oauth.act&response_mode=query&scope=offline_access%20user.read%20https://graph.microsoft.com/Directory.Read.All&prompt=login&state=")+b,k=500,l=600,m=(window.innerWidth-k)/2,n=(window.innerHeight-l)/2,window.open(j,"_blank","width="+k+",height="+l+",left="+m+",top="+n),a.a(2)}},a)})),_connectAzure.apply(this,arguments)}function isConnected(){return _isConnected.apply(this,arguments)}function _isConnected(){return _isConnected=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.n=1,b.executeApi("FLOW_EXT_SERVICE_R001",{});case 1:return c=a.v,d=!1,c.EXT_SERVICE_REC&&0<c.EXT_SERVICE_REC.length&&$.each(c.EXT_SERVICE_REC,function(a,b){"MsTeams"===b.EXT_SERVICE_NM&&(d=!0)}),a.a(2,d)}},a)})),_isConnected.apply(this,arguments)}function getAzureOrgAPI(){return _getAzureOrgAPI.apply(this,arguments)}function _getAzureOrgAPI(){return _getAzureOrgAPI=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.n=1,b.executeApi("MJS_AZURE_ORG_U001",{USE_INTT_ID:USE_INTT_ID,RGSN_DTTM:RGSN_DTTM});case 1:c=a.v;case 2:return a.a(2)}},a)})),_getAzureOrgAPI.apply(this,arguments)}function getAzureData(){return _getAzureData.apply(this,arguments)}function _getAzureData(){return _getAzureData=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.n=1,c.executeApi("MJS_AZURE_ORG_C001",{USE_INTT_ID:USE_INTT_ID,RGSN_DTTM:RGSN_DTTM});case 1:return b=a.v,a.a(2,b)}},a)})),_getAzureData.apply(this,arguments)}function updateAzureInactiveData(){return _updateAzureInactiveData.apply(this,arguments)}function _updateAzureInactiveData(){return _updateAzureInactiveData=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return c=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),a.n=1,c.executeApi("MJS_AZURE_ORG_D001",{USE_INTT_ID:USE_INTT_ID,RGSN_DTTM:RGSN_DTTM});case 1:return b=a.v,a.a(2,b)}},a)})),_updateAzureInactiveData.apply(this,arguments)}function updateUser(a,b){return _updateUser.apply(this,arguments)}function _updateUser(){return _updateUser=_asyncToGenerator(_regenerator().m(function c(a,b){var d,e,f;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:return d="",c.p=1,e=new Ajax({packetOption:AJAX_OPTION.PREVENT_EXECUTE}),c.n=2,e.executeApi("MJS_AZURE_ORG_C001",{USE_INTT_ID:USE_INTT_ID,RGSN_DTTM:RGSN_DTTM,USER_REC:a,MODE:b});case 2:d=c.v,c.n=4;break;case 3:c.p=3,f=c.v,Mutil.mlog("\uB370\uC774\uD130: ".concat(a,"\n\uD398\uC774\uC9D5 \uC218: ").concat(b));case 4:return c.a(2,d)}},c,null,[[1,3]])}
59)),_updateUser.apply(this,arguments)}function inactivateUserFromAzure(){return _inactivateUserFromAzure.apply(this,arguments)}function _inactivateUserFromAzure(){return _inactivateUserFromAzure=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:return b=waitView.call($("#loadingPendingLayerPopup")),b.start(function(){return"Azure\u4E0A\u306B\u5B58\u5728\u3057\u306A\u3044\u30E6\u30FC\u30B6\u30FC\u3092\u7121\u52B9\u5316\u3057\u3066\u3044\u307E\u3059\u3002\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044\u3002"}),a.p=1,a.n=2,updateAzureInactiveData();case 2:c=a.v,c.COMMON_HEAD.ERROR?_index2.default.toast("error",i18next.t(exception.error.update)):(_index2.default.toast("info","".concat(c.TOTAL_CNT," \u30E6\u30FC\u30B6\u30FC\u306E\u7121\u52B9\u5316\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002")),d=["USE_INTT_NM","FLNM","DVSN_NM","JBCL_NM","USER_ID","RGSN_DTTM"],e=["\u4F1A\u793E\u60C5\u5831","\u540D\u524D","\u90E8\u7F72","\u5F79\u8077","\u30E1\u30FC\u30EB\uFF08ID","\u52A0\u5165\u65E5"],simpleTableToExcelJson("\u7121\u52B9\u30E6\u30FC\u30B6\u30FC",c.MISSING_USER_REC,d,e,1)),a.n=4;break;case 3:a.p=3,f=a.v,console.error(f);case 4:return a.p=4,b.end(),a.f(4);case 5:return a.a(2)}},a,null,[[1,3,4,5]])})),_inactivateUserFromAzure.apply(this,arguments)}function getOrganizationData(){return _getOrganizationData.apply(this,arguments)}function _getOrganizationData(){return _getOrganizationData=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i,j,k,l,m,n;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:return a.n=1,isConnected();case 1:if(b=a.v,c={},b){a.n=3;break}return a.n=2,connectAzure();case 2:a.n=16;break;case 3:return f=waitView.call($("#loadingPendingLayerPopup")),f.start(function(){return"Azure\u90E8\u9580\u3068\u30E6\u30FC\u30B6\u30FC\u3092\u53D6\u5F97\u4E2D\u3067\u3059\u3002<br> \u3053\u308C\u306B\u306F\u6700\u5927\u30675\u5206\u304B\u304B\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002"}),a.p=4,a.n=5,getAzureData();case 5:if(g=a.v,g.COMMON_HEAD.ERROR){a.n=10;break}d=g.USER_CNT,e=g.DVSN_CNT,h=g.USER_REC,i=200,j=0,c={},k=1;case 6:return l=h.slice(j,j+i),a.n=7,updateUser(l,k);case 7:m=a.v,(!m||m.COMMON_HEAD.ERROR||"Y"!==m.USER_CNT)&&(c=_objectSpread(_objectSpread({},c),l)),j+=i,k++;case 8:if(j<h.length){a.n=6;break}case 9:a.n=11;break;case 10:throw c=g.USER_REC,_index2.default.toast("error","fail to load azure data!!"),new Error("user load Error");case 11:if(!(0<c.length)){a.n=12;break}throw _index2.default.toast("error","".concat(c.length," user(s) update Error")),new Error("user update Error");case 12:_index2.default.toast("info","".concat(e," \u90E8\u9580\u3068 ").concat(d," \u30E6\u30FC\u30B6\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002"));case 13:a.n=15;break;case 14:a.p=14,n=a.v,Mutil.mlog(n);case 15:return a.p=15,f.end(),a.f(15);case 16:return a.a(2,c)}},a,null,[[4,14,15,16]])})),_getOrganizationData.apply(this,arguments)}function getProfileJson(a){var b=_index.ElectronApi.Comm.isElectron();return{USER_ID:a,ID_GB:SignCode.TYPE.AZURE,EMAIL:"",USER_NM:"",OBJ_CNTS_NM:b?"desktop":""}}function goAzureLogin(a){CommonLogin.goLogin(getProfileJson(a))}
60
61},{"../../util":175,"../../util/electron/index.js":166,"../../util/index.js":175}],21:[function(require,module,exports){
62"use strict";var _queue=require("./queue.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getQueueRunStatus=getQueueRunStatus,exports.nextQueue=nextQueue,exports.observePopup=observePopup;function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
62q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function a(){};return{s:f,n:function a(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function b(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function a(){d=d.call(b)},n:function a(){var b=d.next();return h=b.done,b},e:function b(a){i=!0,g=a},f:function a(){try{h||null==d.return||d.return()}finally{if(i)throw g}}}}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var FINAL_TARGET=["browserPopup"],isQueueRunning=!1;function observePopup(a,b){var c=a.target,d=a.checkChildRemove,e=void 0===d||d,f=a.callback,g=new MutationObserver(function(){var a=_asyncToGenerator(_regenerator().m(function d(a,c){var f,g,h,i,j,k,l,m,n,o;return _regenerator().w(function(d){for(;1;)switch(d.p=d.n){case 0:f=!0,g=_createForOfIteratorHelper(a),d.p=1,g.s();case 2:if((h=g.n()).done){d.n=4;break}if(i=h.value,j="attributes"===i.type,k="style"===i.attributeName,l="none"===i.target.style.display,m=j&&k&&l,n=!1,e&&(n="childList"===i.type&&0<i.removedNodes.length),!((m||n)&&f)){d.n=3;break}return 0<(0,_queue.getQueueCount)()?b():isQueueRunning=!1,f=!1,d.n=3,c.disconnect();case 3:d.n=2;break;case 4:d.n=6;break;case 5:d.p=5,o=d.v,g.e(o);case 6:return d.p=6,g.f(),d.f(6);case 7:return d.a(2)}},d,null,[[1,5,6,7]])}));return function(b,c){return a.apply(this,arguments)}}());
62if(isQueueRunning=!0,-1<FINAL_TARGET.indexOf(c))return 0<(0,_queue.getQueueCount)()&&Mutil.mlog("[POPUP QUEUE] We've gone through the last popup branch, but there are still popups left in the queue."),f(),void(isQueueRunning=!1);f();var h=$(c).get(0);return h?void g.observe(h,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0}):void(isQueueRunning=!1)}function nextQueue(){observePopup((0,_queue.outQueue)(),nextQueue)}function getQueueRunStatus(){return JSON.parse(JSON.stringify(isQueueRunning))}
63
64},{"./queue.js":23}],22:[function(require,module,exports){
65"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"getQueueClone",{enumerable:!0,get:function(){return _queue.getQueueClone}}),exports.inputPopupQueue=inputPopupQueue;var _queue=require("./queue.js"),_event=require("./event.js");function inputPopupQueue(a,b,c,d){if("function"==typeof c&&void 0===d&&(d=c,c=!0),Mutil.mlog("[INPUT POPUP QUEUE]",a,b),""===Often.null2Void(a))return void Mutil.mlog("There is no target of the popup inputting to the popup queue.");var e=(0,_queue.getQueueClone)();""===Often.null2Void(b)&&(b=e[e.length-1].priority+1),(0,_queue.inQueue)(a,b,c,d);var f=(0,_queue.getQueueClone)(),g=(0,_event.getQueueRunStatus)();!g&&0<f.length&&(0,_event.observePopup)((0,_queue.outQueue)(),_event.nextQueue),Mutil.mlog("[POPUP QUEUE STATUS]",f,g)}
66
67},{"./event.js":21,"./queue.js":23}],23:[function(require,module,exports){
68"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getQueueClone=getQueueClone,exports.getQueueCount=getQueueCount,exports.inQueue=inQueue,exports.outQueue=outQueue;var queue=[];function inQueue(a,b,c,d){queue.push({target:a,priority:b,checkChildRemove:c,callback:d}),queue.sort(function(c,a){return c.priority-a.priority})}function outQueue(){return queue.shift()}function getQueueClone(){return queue.slice()}function getQueueCount(){return queue.length}
69
70},{}],24:[function(require,module,exports){
71"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.confirmCertNo=confirmCertNo,exports.requestPassTwoFactor=requestPassTwoFactor,exports.requestTwoFactor=requestTwoFactor;function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
71:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var _Mutil=Mutil,Ajax=_Mutil.Ajax,PREVENT_EXECUTE=_Mutil.AJAX_OPTION.PREVENT_EXECUTE;function requestTwoFactor(a){return _requestTwoFactor.apply(this,arguments)}function _requestTwoFactor(){return _requestTwoFactor=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:if(c=a.USER_ID,d=a.DUID,e=a.DUID_NM,f=a.AUTH_TYPE,g=Often.getDeviceJson(_CLIENT_IP),h=new Ajax({packetOption:PREVENT_EXECUTE}),b.p=1,!ServerChecker.isKsfc){b.n=4;break}return b.n=2,h.executeApi("TWO_FACTOR_C001",_objectSpread(_objectSpread({},g),{},{USER_ID:c,DUID_NM:e,AUTH_TYPE:f}));case 2:if(i=b.v,j=i.ERR_CD,k=i.ERR_MSG,""===j){b.n=3;break}throw new Error(k);case 3:l=i.OTP_TR_ID,m=i.CHALLENGE,n=i.OTP_VALUE,o=void 0===n?"":n,Mutil.setCookie("OTP_TR_ID",l),Mutil.setCookie("CHALLENGE",m),Mutil.setCookie("OTP_VALUE",o),b.n=6;break;case 4:return b.n=5,h.executeApi("TWO_FACTOR_C001",{USER_ID:c,DUID:d,DUID_NM:e,AUTH_TYPE:f});case 5:return b.a(2,b.v);case 6:b.n=8;break;case 7:b.p=7,p=b.v,Often.toast("error",p.message),Mutil.mlog("ERROR in requestTwoFactor : ".concat(p));case 8:return b.a(2)}},b,null,[[1,7]])})),_requestTwoFactor.apply(this,arguments)}function confirmCertNo(a){return _confirmCertNo.apply(this,arguments)}function _confirmCertNo(){return _confirmCertNo=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h,i,j,k;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=a.USER_ID,d=a.DUID,e=a.AUTH_NO,f=a.AUTH_TIME_MM,g=a.OTP_TR_ID,h=a.AUTH_TYPE,i=a.CHALLENGE,j=new Ajax({packetOption:PREVENT_EXECUTE}),b.p=1,b.n=2,j.executeApi("FLOW_AUTH_NO_CHECK_R001",{USER_ID:c,AUTH_NO:e,DUID:d,AUTH_TIME_MM:f,OTP_TR_ID:g,AUTH_TYPE:h,CHALLENGE:i});case 2:return b.a(2,b.v);case 3:b.p=3,k=b.v,Mutil.mlog("ERROR in confirmCertNo : ".concat(k));case 4:return b.a(2)}},b,null,[[1,3]])})),_confirmCertNo.apply(this,arguments)}function requestPassTwoFactor(a){return _requestPassTwoFactor.apply(this,arguments)}function _requestPassTwoFactor(){return _requestPassTwoFactor=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:return c=a.USER_ID,d=a.DUID,e=new Ajax({packetOption:PREVENT_EXECUTE}),b.p=1,b.n=2,e.executeApi("TWO_FACTOR_C002",{USER_ID:c,DUID:d});case 2:return b.a(2,b.v);case 3:b.p=3,f=b.v,Mutil.mlog("ERROR in passTwoFactor : ".concat(f));case 4:return b.a(2)}},b,null,[[1,3]])})),_requestPassTwoFactor.apply(this,arguments)}
72
73},{}],25:[function(require,module,exports){
74"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TWO_FACTOR_TYPE=exports.TWO_FACTOR_ERR_CD=void 0;var TWO_FACTOR_TYPE=exports.TWO_FACTOR_TYPE={WEB:"W",EMAIL:"E",CELLPHONE:"H",EMAIL_OR_CELLPHONE:"S"},TWO_FACTOR_ERR_CD=exports.TWO_FACTOR_ERR_CD={NO_PROBLEM:"0000"};
75
76},{}],26:[function(require,module,exports){
77"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.render=void 0;var _Component2=_interopRequireDefault(require("../../core/Component.js")),_item=require("./item.js"),_api=require("./api.js"),_contants=require("./contants.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
77function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var render=exports.render=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},c=b.authType,d=b.eml,e=b.clphNo,f=b.timeLimit,g=b.userId,h=b.isPass,i=void 0!==h&&h,j=b.successCallback,k=void 0===j?Mutil.noop:j;return i?void passFactor(g,k).then():void($("body").append("<div id=\"twoFactorPopArea\"></div>"),new TwoFactorPop($("#twoFactorPopArea"),{authType:c,eml:d,clphNo:e,timeLimit:f,userId:g,successCallback:k}))}
77,passFactor=function(){var a=_asyncToGenerator(_regenerator().m(function c(a,b){var d,e,f;return _regenerator().w(function(c){for(;1;)switch(c.n){case 0:return c.n=1,(0,_api.requestPassTwoFactor)({USER_ID:a,DUID:Mutil.getLocal("ONLY_DEVICE_ID")});case 1:if(d=c.v,e=d.ERR_CD,f=void 0===e?"":e,_contants.TWO_FACTOR_ERR_CD.NO_PROBLEM===f){c.n=2;break}return Mutil.mlog("[passFactor()  \uC624\uB958] \uC11C\uBC84 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. [\uCF54\uB4DC :".concat(f,"] ")),Mutil.toast("info",i18next.t(exception.error.processError)),c.a(2);case 2:if("function"==typeof b){c.n=3;break}return Mutil.mlog("[passFactor()  \uC624\uB958] successCallback\uC774 \uD568\uC218\uAC00 \uC544\uB2D9\uB2C8\uB2E4."),c.a(2);case 3:b();case 4:return c.a(2)}},c)}));return function d(b,c){return a.apply(this,arguments)}}(),TwoFactorPop=function(a){function b(){var a;_classCallCheck(this,b);for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return a=_callSuper(this,b,[].concat(d)),_defineProperty(a,"closePop",function(){$("body").css("overflow-y",""),$(a.$target).remove()}),_defineProperty(a,"keydownCertNo",function(b){if(Mutil.isKey(b,"ENTER"))return void a.confirmCert().then();var c=$(b.target).val(),d=$(a.$target).find(".auth-popup.step2"),e=d.find(".confirm-button"),f=function b(a){return /^\d*$/.test(a)};return f(c)?void(d.find("#noneNumericAuth").css("display","none"),6===c.length?e.addClass("on"):e.removeClass("on")):void d.find("#noneNumericAuth").css("display","inline-block")}),_defineProperty(a,"confirmCert",_asyncToGenerator(_regenerator().m(function b(){var c,d,e,f,g,h,i,j,k,l,m,n;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:if(c=$(a.$target).find(".confirm-button"),c.hasClass("on")){b.n=1;break}return b.a(2);case 1:return d=a.$props,e=d.timeLimit,f=void 0===e?"3":e,g=d.successCallback,h=void 0===g?Mutil.noop:g,b.n=2,(0,_api.confirmCertNo)({USER_ID:a.getUserId(),DUID:Mutil.getLocal("ONLY_DEVICE_ID"),AUTH_NO:a.getCertNo(),AUTH_TIME_MM:f,OTP_TR_ID:Often.getCookie("OTP_TR_ID"),CHALLENGE:Often.getCookie("CHALLENGE"),AUTH_TYPE:a.AUTH_TYPE});case 2:if(i=b.v,j=i.RSLT_CD,k=void 0===j?"":j,l=i.ERR_MSG,"9203"!==k){b.n=3;break}return Mutil.toast("error",l),b.a(2);case 3:if(_contants.TWO_FACTOR_ERR_CD.NO_PROBLEM===k){b.n=4;break}return m=$(a.$target).find(".auth-popup.step2"),n=m.find("#timeoutAuth").is(":visible"),m.find("#unValidAuth").css("display",n?"none":"inline-block"),m.find("#resendAuth").css("display","inline-block"),b.a(2);case 4:if("function"==typeof h){b.n=5;break}return Mutil.mlog("[TwoFactorPop.confirmCert() \uC624\uB958] successCallback\uC774 \uD568\uC218\uAC00 \uC544\uB2D9\uB2C8\uB2E4."),$("#normalLoginButton").trigger("click"),b.a(2);case 5:h(a);case 6:return b.a(2)}},b)}))),_defineProperty(a,"showAuthSelect",function(){$(a.$target).find(".auth-popup.step1").show(),$(a.$target).find(".auth-popup.step2").hide()}),_defineProperty(a,"showCertInput",function(){var b=_asyncToGenerator(_regenerator().m(function c(b){var d,e,f,g,h,i,j,k,l,m,n,o,p;return _regenerator().w(function(c){for(;1;)switch(c.n){case 0:if(d=b.twoFactorType,e=b.isSkipSend,f=a.$props,g=f.eml,h=f.clphNo,i=f.web,j=a.convertSecretData({eml:g,clphNo:h}),k=j.secretEml,l=j.secretClphNo,!ServerChecker.isKsfc){c.n=1;break}a.AUTH_TYPE="web"===d||"W"===d?_contants.TWO_FACTOR_TYPE.WEB:"mail"===d?_contants.TWO_FACTOR_TYPE.EMAIL:_contants.TWO_FACTOR_TYPE.CELLPHONE,c.n=2;break;case 1:if(a.AUTH_TYPE="mail"===d?_contants.TWO_FACTOR_TYPE.EMAIL:_contants.TWO_FACTOR_TYPE.CELLPHONE,"phone"!==d||""!==l){c.n=2;break}return Mutil.toast("error","\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uD578\uB4DC\uD3F0 \uBC88\uD638\uC785\uB2C8\uB2E4!"),c.a(2);case 2:if(m="mail"===d?k:l,n=$(a.$target).find(".auth-popup.step2"),o=i18next.t(main.alert.sendVerificationCode,{val:m,count:6}),e){c.n=3;break}return c.n=3,a.sendCert();case 3:if(!ServerChecker.isKsfc){c.n=5;break}if(KsfcConfig.allowedUser()){c.n=4;break}return c.n=4,a.sendCert();case 4:p=Often.null2Void(Often.getCookie("OTP_VALUE"),""),o=p?"\n                    <div>
77\n                        <span>\uC778\uC99D\uBC88\uD638\uB97C \uC785\uB825\uD574 \uC8FC\uC2DC\uAE30 \uBC14\uB78D\uB2C8\uB2E4.</span>\n                        <p style=\"font-size: 0.9em;font-weight:bold;\">\uC778\uC99D\uBC88\uD638 : <span id=\"otpValue\">".concat(p,"</span></p>\n                    </div>"):"\n                    <div>\n                        <span>\uC778\uC99D\uBC88\uD638\uB97C \uC785\uB825\uD574 \uC8FC\uC2DC\uAE30 \uBC14\uB78D\uB2C8\uB2E4.</span>\n                    </div>";case 5:n.find(".popup-cont").html(o),n.find("#otpValue").click(function(a){var b=n.find("#otpValue").text();window.navigator.clipboard.writeText(b).then(function(){Often.toast("success","\uBCF5\uC0AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.")}).catch(function(a){Often.toast("error","\uBCF5\uC0AC \uC2E4\uD328")})}),a.countingTimer(),$(a.$target).find(".auth-popup.step1").hide(),n.show(),n.find("input").focus();case 6:return c.a(2)}},c)}));return function(a){return b.apply(this,arguments)}}()),_defineProperty(a,"getCertNo",function(){return $.trim($("#certNo").val())}),_defineProperty(a,"getUserId",function(){var b=a.$props.userId,c=void 0===b?"":b;return $.trim(Mutil.n2v(c,$("#userId").val()))}),_defineProperty(a,"reSendCert",_asyncToGenerator(_regenerator().m(function b(){var c;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return a.countingTimer(),c=$(a.$target).find(".auth-popup.step2"),c.find("#timeoutAuth, #resendAuth").css("display","none"),c.find("input").focus(),b.n=1,a.sendCert();case 1:return b.a(2)}},b)}))),_defineProperty(a,"sendCert",_asyncToGenerator(_regenerator().m(function b(){return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,(0,_api.requestTwoFactor)({USER_ID:a.getUserId(),DUID:Mutil.getLocal("ONLY_DEVICE_ID"),DUID_NM:Mutil.getLocal("ONLY_DEVICE_NM"),AUTH_TYPE:a.AUTH_TYPE});case 1:return b.a(2)}},b)}))),_defineProperty(a,"countingTimer",function(){var b=a.$props.timeLimit,c=void 0===b?"3":b,d=$(a.$target).find(".auth-popup.step2");d.find("#unValidAuth, #timeoutAuth, #resendAuth").css("display","none");var e=60*+c;
77Mutil.isServerOn("ALL_TEST")?(e=30,Mutil.toast("info","\uC2E4\uC81C \uC6B4\uC601\uC740 3\uBD84 \uD0C0\uC774\uBA38\uAC00 \uC791\uB3D9\uB429\uB2C8\uB2E4! (\uD14C\uC2A4\uD2B8 30\uCD08)")):ServerChecker.isKsfc&&(e=c),clearInterval(a.counterTimer),a.counterTimer=setInterval(function(){e--;var b=parseInt(e/60+""),c=("0"+e%60).slice(-2);d.find(".js-auth-counter").text("".concat(b,":").concat(c)),0<e||(clearInterval(a.counterTimer),d.find("#timeoutAuth, #resendAuth").css("display","inline-block"),d.find("#unValidAuth").css("display","none"))},1e3)}),_defineProperty(a,"convertSecretData",function(a){var b=a.eml,c=a.clphNo,d=function b(a){return a.substring(0,a.length-2)+"**"},e=function b(a){return 8>a.length?"":0!==a.indexOf("+82")&&0!==a.indexOf("01")?"":(a=a.replace(/ /gi,"-").replace(/--/g,"-"),0===a.indexOf("+")?d(a.replace(/[^+\-\d]/g,"")):d(a.replace(/[^0-9]/g,"").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3")))},f=b.indexOf("@");return{secretEml:b.substring(0,f-2)+"**"+b.substring(f),secretClphNo:e(c)}}),a}return _inherits(b,a),_createClass(b,[{key:"template",value:function a(){var b=this.$props.authType;return(0,_item.popItem)({authType:b})}},{key:"setEvent",value:function a(){var b=this;this.addEvent("mousedown",".back-area",function(a){0<$(a.target).closest(".auth-popup").length||b.closePop()}),this.addEvent("click",".phone",function(){return b.showCertInput({twoFactorType:"phone"})}),this.addEvent("click",".mail",function(){return b.showCertInput({twoFactorType:"mail"})}),this.addEvent("click",".web",function(){return b.showCertInput({twoFactorType:"web"})}),this.addEvent("click",".btn-back",function(){return b.showAuthSelect()}),this.addEvent("click",".btn-close",function(){return b.closePop()}),this.addEvent("click","#resendAuth",function(){return b.reSendCert()}),this.addEvent("click",".confirm-button",function(){return b.confirmCert()}),this.addEvent("keyup","#certNo",function(a){return b.keydownCertNo(a)})}},{key:"mounted",value:function a(){var b=this;$("body").css("overflow-y","hidden");var c=this.$props.authType;if(c!==_contants.TWO_FACTOR_TYPE.EMAIL_OR_CELLPHONE){var d="";ServerChecker.isKsfc&&("web"===c||"W"===c?d=_contants.TWO_FACTOR_TYPE.WEB:"mail"===c?d=_contants.TWO_FACTOR_TYPE.EMAIL:d=_contants.TWO_FACTOR_TYPE.CELLPHONE),d=c===_contants.TWO_FACTOR_TYPE.EMAIL?"mail":"phone",setTimeout(function(){return b.showCertInput({twoFactorType:d,isSkipSend:!0})},0)}}}])}(_Component2.default);
78
79},{"../../core/Component.js":28,"./api.js":24,"./contants.js":25,"./item.js":27}],27:[function(require,module,exports){
80"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.popItem=void 0;var _contants=require("./contants.js"),popItem=exports.popItem=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=a.authType,c=void 0===b?_contants.TWO_FACTOR_TYPE.EMAIL_OR_CELLPHONE:b,d=c===_contants.TWO_FACTOR_TYPE.EMAIL_OR_CELLPHONE,e={step1:{title:i18next.exists(login.twoFactor.title)?i18next.t(login.twoFactor.title):i18next.t(main.twoFactor.title),desc1:i18next.exists(login.twoFactor.desc)?i18next.t(login.twoFactor.desc):i18next.t(main.twoFactor.desc),desc2:i18next.exists(login.twoFactor.chooseOption)?i18next.t(login.twoFactor.chooseOption):i18next.t(main.twoFactor.chooseOption)},step2:{title:i18next.t(common.inputValue,{val:$t(common.confirmVerificationCode)}),placeholder:i18next.t(main.alert.enterWord,{val:$t(common.confirmVerificationCode)}),unValidAuth:i18next.t(main.alert.verificationNotMatch),timeoutAuth:i18next.t(main.alert.verificationExpired),resendAuth:i18next.t(dictionary.resend),noneNumericAuth:i18next.t(common.enterDigitOnly)}},f="".concat(e.step1.title),g="".concat(e.step1.desc1,"<br>").concat(e.step1.desc2),h="\n            <button class=\"phone js-two-factor-type\" data-code=\"phone\">\n                    <svg width=\"17\" height=\"16\" fill=\"none\" class=\"phone\">\n                        <rect width=\"11.444\" height=\"15\" x=\"2.778\" y=\".5\" stroke=\"\" rx=\"1.5\"/>\n                        <path stroke=\"\" stroke-linecap=\"round\" d=\"M6.333 12.882h4.334\"/>\n                        <circle cx=\"8.5\" cy=\"3.441\" r=\".889\" fill=\"\"/>\n                    </svg>\n                    SMS\n                </button>\n            <button class=\"mail js-two-factor-type\" data-code=\"mail\">\n                <svg width=\"16\" height=\"16\" fill=\"none\">\n                    <path fill=\"\" fill-rule=\"evenodd\" \n                        d=\"M0 4.255a2.478 2.478 0 0 1 2.478-2.478H13.5a2.5 2.5 0 0 1 2.5 2.5v7.445a2.5 2.5 0 0 1-2.5 2.5h-11a2.5 2.5 0 0 1-2.5-2.5V4.255Zm1 6.337V5.567l3.625 2.54L1 10.593Zm.002 1.21a1.5 1.5 0 0 0 1.498 1.42h11a1.5 1.5 0 0 0 1.495-1.37L10.38 8.72l-.7.497a3 3 0 0 1-3.458.01l-.723-.507-4.497 3.082ZM5.8 7.71l.997.699a2 2 0 0 0 2.305-.007l.98-.695 4.91-3.594A1.5 1.5 0 0 0 13.5 2.778H2.478C1.662 2.778 1 3.439 1 4.255v.09l4.78 3.351a.51.51 0 0 1 .02.014ZM15 5.346l-3.758 2.75L15 10.648v-5.3Z\" clip-rule=\"evenodd\"/>\n                </svg>\n                E-MAIL\n            </button>\n    ";return ServerChecker.isKsfc&&(h="\n            <button class=\"phone js-two-factor-type\" data-code=\"phone\">\n                <svg width=\"17\" height=\"16\" fill=\"none\" class=\"phone\">\n                    <rect width=\"11.444\" height=\"15\" x=\"2.778\" y=\".5\" stroke=\"\" rx=\"1.5\"/>\n                    <path stroke=\"\" stroke-linecap=\"round\" d=\"M6.333 12.882h4.334\"/>\n                    <circle cx=\"8.5\" cy=\"3.441\" r=\".889\" fill=\"\"/>\n                </svg>\n                M-OTP\n            </button>\n            <button class=\"web js-two-factor-type\" data-code=\"web\">\n                <svg width=\"22\" height=\"23\" viewBox=\"0 0 22 23\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11 20.8086C15.9706 20.8086 20 16.7792 20 11.8086C20 6.83803 
8015.9706 2.80859 11 2.80859C6.02944 2.80859 2 6.83803 2 11.8086C2 16.7792 6.02944 20.8086 11 20.8086ZM11 21.8086C16.5228 21.8086 21 17.3314 21 11.8086C21 6.28575 16.5228 1.80859 11 1.80859C5.47715 1.80859 1 6.28575 1 11.8086C1 17.3314 5.47715 21.8086 11 21.8086Z\" fill=\"black\"/>\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.228 18.4735C13.9633 16.8192 14.4436 14.4636 14.4436 11.8086C14.4436 9.15359 13.9633 6.79803 13.228 5.14366C12.8598 4.31522 12.4473 3.70671 12.0397 3.31884C11.6373 2.93588 11.2874 2.80859 10.9991 2.80859C10.7109 2.80859 10.361 2.93588 9.95854 3.31884C9.55097 3.70671 9.13844 4.31522 8.77025 5.14366C8.03497 6.79803 7.55469 9.15359 7.55469 11.8086C7.55469 14.4636 8.03497 16.8192 8.77025 18.4735C9.13844 19.302 9.55097 19.9105 9.95854 20.2983C10.361 20.6813 10.7109 20.8086 10.9991 20.8086C11.2874 20.8086 11.6373 20.6813 12.0397 20.2983C12.4473 19.9105 12.8598 19.302 13.228 18.4735ZM10.9991 21.8086C13.4537 21.8086 15.4436 17.3314 15.4436 11.8086C15.4436 6.28575 13.4537 1.80859 10.9991 1.80859C8.54453 1.80859 6.55469 6.28575 6.55469 11.8086C6.55469 17.3314 8.54453 21.8086 10.9991 21.8086Z\" fill=\"black\"/>\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.3327 8.97559H2.66602V7.97559H19.3327V8.97559Z\" fill=\"black\"/>\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.3327 15.6416H2.66602V14.6416H19.3327V15.6416Z\" fill=\"black\"/>\n                </svg>\n                W-OTP\n            </button>\n        ",f=i18next.t("ksfc.login.twofactor.title"),g="".concat(i18next.t("ksfc.login.twofactor.desc"),"<br>").concat(i18next.t("ksfc.login.twofactor.chooseOption"))),"\n        <div class=\"flow-all-background-1 back-area\" tabindex=\"0\">\n            <div class=\"flow-project-make-1 back-area\">\n                <div class=\"flow-project-make-2 back-area contents\">\n                    <div class=\"auth-popup flow-login-popup flow-project-popup-6 step1\" style=\"display: ".concat(d?"block":"none","\">\n                        <div class=\"flow-project-header-1\">\n                            <dt class=\"popup-title\">").concat(f,"</dt>\n                            <button class=\"btn-close close-event\"></button>\n                        </div>\n                        <div class=\"flow-content\">\n                            <div class=\"login-number-wrap\">\n                                <p class=\"login-number\">").concat(g,"</p>\n                            </div>\n                            <div class=\"btn-wrap\">\n                                ").concat(h,"\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"auth-popup flow-login-popup flow-project-popup-6 step2\" style=\"display: ").concat(d?"none":"block","\">\n                        <div class=\"flow-project-header-1\">\n                            <button class=\"btn-back\" style=\"display: ").concat(d?"block":"none","\"></button>\n                            <dt class=\"popup-title\">").concat(e.step2.title,"</dt>\n                            <button class=\"btn-close close-event\"></button>\n                        </div>\n                        <div class=\"flow-content\">\n                            <div class=\"login-number-wrap\">\n                                <p class=\"login-number\"><span class=\"popup-cont\"></span></p>\n                            </div>\n                            <div class=\"login-input-wrap\">\n                                <input id=\"certNo\" type=\"text\" placeholder=\"").concat(e.step2.placeholder,"\"\n                                       class=\"login-popup-input\" maxlength=\"6\" autocomplete=\"off\">\n                                <div class=\"login-text-count js-auth-counter\"></div>\n                            </div>                \n                            <div class=\"auth-error-text\">\n                                <span id=\"unValidAuth\" style=\"display : none\">").concat(e.step2.unValidAuth,"</span>
80\n                                <span id=\"timeoutAuth\" style=\"display : none\">").concat(e.step2.timeoutAuth,"</span>\n                                <span id=\"resendAuth\" class=\"resend-txt cursor-pointer\" style=\"display : none\">").concat(e.step2.resendAuth,"</span>\n                                <span id=\"noneNumericAuth\" style=\"display : none\">").concat(e.step2.noneNumericAuth,"</span>\n                            </div>\n                            <a class=\"cursor-pointer\">\n                                <div class=\"confirm-button login-popup-button submit-event\">").concat(i18next.t(dictionary.confirm),"</div>\n                            </a>\n                        </div>\n                    </div>    \n                </div>\n            </div>\n        </div>\n    ")};
81
82},{"./contants.js":25}],28:[function(require,module,exports){
83"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var Component=exports.default=function(){function a(b){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},d=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2],e=3<arguments.length?arguments[3]:void 0;_classCallCheck(this,a),_defineProperty(this,"$target",void 0),_defineProperty(this,"$props",void 0),_defineProperty(this,"$state",void 0),_defineProperty(this,"isAppend",void 0),_defineProperty(this,"$store",void 0),this.isAppend=d,b instanceof jQuery?(this.$target=b[0],1<b.length&&console.warn("Multi Elements!")):this.$target=b,this.$props=c,e&&(this.$store=e,this.$state=null===e||void 0===e?void 0:e.state),this.setup();this.$target&&(this.render(),this.setEvent(),0<$(this.$target).find("input").length&&$(this.$target).find("input:first").focus())}return _createClass(a,[{key:"setup",value:function(){}},{key:"mounted",value:function(){}},{key:"template",value:function(){return""}},{key:"render",value:function(){var a=this.template();a&&(this.isAppend?$(this.$target).append(a):this.$target.innerHTML=a,this.mounted())}},{key:"setEvent",value:function(){}},{key:"setState",value:function(a){this.$state=_objectSpread(_objectSpread({},this.$state),a),this.render()}},{key:"addEvent",value:function(a,b,c){"function"==typeof b&&(c=b,b=null);var d=_toConsumableArray(this.$target.querySelectorAll(b)),e=function c(a){return d.includes(a)||a.closest(b)},f=!1,g=!1;a.includes(".prevent")&&(a=a.replace(".prevent",""),f=!0),a.includes(".stop")&&(a=a.replace(".stop",""),g=!0);var h=function d(a){b&&!e(a.target)||(f&&a.preventDefault(),g&&a.stopPropagation(),c(a))};$(this.$target).on(a,h)}}])}();
84
85},{}],29:[function(require,module,exports){
86"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initUserKey=initUserKey,exports.userProperties=userProperties;function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
86q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var userKeyCache=null,userKeyPending=!1;function toHex(a){return Array.from(new Uint8Array(a)).map(function(a){return a.toString(16).padStart(2,"0")}).join("")}function initUserKey(){return _initUserKey.apply(this,arguments)}function _initUserKey(){return _initUserKey=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(!(userKeyCache||userKeyPending)){a.n=1;break}return a.a(2);case 1:if(d=((null!==(b=window._USER_ID)&&void 0!==b?b:"")+"").trim().toLowerCase(),d&&null!==(c=window.crypto)&&void 0!==c&&c.subtle){a.n=2;break}return a.a(2);case 2:return userKeyPending=!0,a.p=3,a.n=4,crypto.subtle.digest("SHA-256",new TextEncoder().encode(d));case 4:e=a.v,userKeyCache=toHex(e),window._USER_ID_HASH=userKeyCache,a.n=6;break;case 5:a.p=5,f=a.v,userKeyCache=null;case 6:return a.p=6,userKeyPending=!1,a.f(6);case 7:return a.a(2)}},a,null,[[3,5,6,7]])})),_initUserKey.apply(this,arguments)}function userProperties(){var a;userKeyCache||userKeyPending||initUserKey();var b={workspace_id:window._USE_INTT_ID,IS_TEST:/@(?:yopmail\.com|flow\.team)$/i.test((null!==(a=window._USER_ID)&&void 0!==a?a:"")+"")};return userKeyCache&&(b.user_id_hash=userKeyCache),b}
87
88},{}],30:[function(require,module,exports){
89"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.workspaceProps=workspaceProps;function workspaceProps(){try{var a,b=((null!==(a=window._USE_INTT_ID)&&void 0!==a?a:"")+"").trim();return b?{workspace_id:b}:{}}catch(a){return{}}}
90
91},{}],31:[function(require,module,exports){
92"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlarmTabTracker=void 0;var _index=require("../index.js"),event=["main:alarm-tab-mention:click","main:alarm-tab-registrant:click","main:alarm-tab-worker:click"],AlarmTabTracker=exports.AlarmTabTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){return 0>event.indexOf(b.event)?void 0:a.trackAction(b)},a};
93
94},{"../index.js":34}],32:[function(require,module,exports){
95"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MentionTracker=void 0,exports.mentionTest=mentionTest;var _index=require("../index.js"),chatMentionEvent=["main:chatting-list:click","main:chatting-list:hover","main:notification:click","main:notification:close","messenger:mention-select:enter","messenger:mention-select:click","messenger:mention-cancel:keyEvent","messenger:mention-profile:click"],MentionTracker=exports.MentionTracker=function(a){var b=a.userInfo,c=Object.create(_index.UserTracker);return c.userInfo=b,c.funcName="mention",c.track=function(a){return 0>chatMentionEvent.indexOf(a.event)?void Mutil.log("\uC815\uC758\uB418\uC9C0 \uC54A\uC740 event \uC785\uB2C8\uB2E4."):c.trackAction(a)},c};function mentionTest(a){var b=MentionTracker({userInfo:"1"}),c=null===b||void 0===b?void 0:b.track({event:a,value:"test"});return c}mentionTest("messenger:mention-profile:click");
96
97},{"../index.js":34}],33:[function(require,module,exports){
98"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CorpSignTracker=void 0;var _index=require("../index.js"),eventDics={"login-click":"corp-sign-in:login:click","login-enter":"corp-sign-in:login:enter",signup:"corp-sign-up:sign-up:move",register:"corp-sign-up:register:click","pw-find-email-click":"corp-sign-in:pw-find-email:click","pw-find-email-enter"
98:"corp-sign-in:pw-find-email:enter"},CorpSignTracker=exports.CorpSignTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c,d=eventDics[b];return d?a.trackAction({event:d,value:null!==(c=USE_INTT_ID)&&void 0!==c?c:null,data:{}}):void 0},a};
99
100},{"../index.js":34}],34:[function(require,module,exports){
101"use strict";var _trackerUserProps=require("../tracker-user-props.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserTracker=void 0,exports.loadUserTracker=loadUserTracker;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var userTrackerStatus=!1,UserTracker=exports.UserTracker={trackAction:function(a){if(userTrackerStatus)return this.eventNameValidityCheck(null===a||void 0===a?void 0:a.event)?(collect(a),"success"):void 0},eventNameValidityCheck:function(a){var b=/^[\w\-]+?:[\w\-]+?:[\w\-]+$/.test(a);return b||Mutil.mlog("[dev] \uC720\uC800 \uD2B8\uB798\uCEE4 \uC774\uBCA4\uD2B8\uBA85\uC774 \uCEE8\uBCA4\uC158\uC5D0 \uBD80\uD569\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."),b}};function isLimitMonitor(){var a;return!!(window.ServerChecker&&window.Often&&(ServerChecker.isEnter||ServerChecker.isInnerNetwork))||(null!==(a=window.isUserTracker)&&void 0!==a?!a:!Mutil.isFunc("USER_TRACKER")||Mutil.isFunc("BLOCK_USER_TRACKER"))}function loadUserTracker(){if(!isLimitMonitor()){var a={GA:{prod:"G-Y2LT9ZCH4Y",dev:"G-MX97V2VT8H"}},b=Mutil.isServerOn("REAL")?a.GA.prod:a.GA.dev,c=MonitorUtil.getGtmKey();GoogleTagManager.initSetting(c),GoogleAnalytics.load(b),GoogleAnalytics.initGoogleAnalytics4(b),(0,_trackerUserProps.initUserKey)(),userTrackerStatus=!0}}function collect(a){delete a.USER_ID,delete a.USER_NM,delete a.USE_INTT_ID,delete a.userId,a.date=Time.currentTime();var b=Mutil.n2v(JSON.stringify(null===a||void 0===a?void 0:a.data));window.dataLayer=window.dataLayer||[],window.dataLayer.push(_objectSpread(_objectSpread({event:a.event,value:a.value,data:b.replace(/\s\s+/g," ")},statisticalIndicatorAttribute()),(0,_trackerUserProps.userProperties)()))}function statisticalIndicatorAttribute(){var a,b,c,d,e,f=/(?:signin|signup)/.test(location.pathname);return f?{PLAN_ID:null,CORP_TYPE:null,CORP_EXPERIENCE:null,IS_MANAGER:null,IS_ELECTRON:null,IS_GUEST:null,IS_MINI_MODE:"Y"===LocalUtil.getElectronYn()&&!ElectronApi.Comm.getConfig({key:"b_fullMode"})}:{PLAN_ID:null!==(a=null===(b=PlanFunc.getPlanInfo())||void 0===b?void 0:b.PLAN_ID)&&void 0!==a?a:"",CORP_TYPE:_USE_INTT_ID.split("_")[0],CORP_EXPERIENCE:"Y"===LocalUtil.getLocalValue("ONLY_BUY_SETTING","CARD_BANNER_YN"),IS_MANAGER:!(null===(c=LocalUtil.getLocalValue("ONLY_COMPANY_JSON","isManager"))||void 0===c)&&c,IS_ELECTRON:"Y"===LocalUtil.getElectronYn(),IS_GUEST:Mutil.isGuest(),IS_MINI_MODE:"Y"===LocalUtil.getElectronYn()&&!ElectronApi.Comm.getConfig({key:"b_fullMode"}),TRANSLATION_LANGUAGE:null!==(d=null===(e=window.globalValue)||void 0===e||null===(e=e.translationInfo)||void 0===e?void 0:e.TARGET_LANGUAGE)&&void 0!==d?d:"\uC124\uC815\uAC12 \uC5C6\uC74C",ENV:Mutil.getServerMode()}}
102
103},{"../tracker-user-props.js":29}],35:[function(require,module,exports){
104"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _index=require("./top-menu/index.js"),_index2=require("./left-menu/index.js"),_index3=require("./mini-left-menu/index.js"),_index4=require("./signin/index.js"),_index5=require("./corp-signin/index.js"),_index6=require("./signup/index.js"),_index7=require("./viewer/index.js"),_index8=require("./alarm-filter/index.js"),_index9=require("./chat-mention/index.js"),_index0=require("./project-invite/index.js"),_scheduleFilter=require("./schedule/scheduleFilter.js"),_index1=require("./translate/index.js"),_index10=require("./mini-notice/index.js"),_index11=require("./shortcut/index.js"),_index12=require("./invite-employee/index.js"),_index13=require("./integration-setting/index.js"),_index14=require("./task-grid/index.js"),_index15=require("./task-grid/experience/index.js"),_index16=require("./task-grid/guide/index.js"),UserTracker={AlarmTabTracker:_index8.AlarmTabTracker,TopMenuTracker:_index.TopMenuTracker,LeftMenuTracker:_index2.LeftMenuTracker,MentionTracker:_index9.MentionTracker,MiniLeftMenuTracker:_index3.MiniLeftMenuTracker,ProjectInviteTracker:_index0.ProjectInviteTracker,ScheduleFilterTracker:_scheduleFilter.ScheduleFilterTracker,SignInTracker:_index4.SignInTracker,CorpSignTracker:_index5.CorpSignTracker,ViewerTracker:_index7.ViewerTracker,TranslateTracker:_index1.TranslateTracker,MiniNoticeTracker:_index10.MiniNoticeTracker,SignUpTracker:_index6.SignUpTracker,ShortcutTracker:_index11.ShortcutTracker,InviteEmplUserTracker:_index12.InviteEmplUserTracker,IntegrationSettingTracker:_index13.IntegrationSettingTracker,TaskGridHeaderTracker:_index14.TaskGridHeaderTracker,TaskGridColumnTracker:_index14.TaskGridColumnTracker,TaskGridInGridTracker:_index14.TaskGridInGridTracker,TaskGridFeedTracker:_index14.TaskGridFeedTracker,TaskGridExpTracker:_index15.TaskGridExpTracker,TaskGridGuideTracker:_index16.TaskGridGuideTracker},_default=exports.default=UserTracker;
105
106},{"./alarm-filter/index.js":31,"./chat-mention/index.js":32,"./corp-signin/index.js":33,"./integration-setting/index.js":36,"./invite-employee/index.js":37,"./left-menu/index.js":38,"./mini-left-menu/index.js":39,"./mini-notice/index.js":40,"./project-invite/index.js":41,"./schedule/scheduleFilter.js":42,"./shortcut/index.js":43,"./signin/index.js":44,"./signup/index.js":45,"./task-grid/experience/index.js":46,"./task-grid/guide/index.js":47,"./task-grid/index.js":48,"./top-menu/index.js":49,"./translate/index.js":50,"./viewer/index.js":51}],36:[function(require,module,exports){
107"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IntegrationSettingTracker=void 0;var _index=require("../index.js"),eventDics={"request-service-click":"integration-setting:request-service-click:click","show-more-detail-click":"integration-setting:show-more-detail-click:click","connect-button-click":"integration-setting:connect-button-click:click","remove-button-click":"integration-setting:remove-button-click:click"},IntegrationSettingTracker=exports.IntegrationSettingTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=eventDics[b];return d?a.trackAction({event:d,value:c,data:{}}):void 0},a};
108
109},{"../index.js":34}],37:[function(require,module,exports){
110"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InviteEmplUserTracker=void 0;var _index=require("../index.js"),_latch=require("../../../components/onboarding-checklist/latch.js"),_constant=require("../../../components/onboarding-checklist/constant.js"),eventDics={"copy-invitation-link-click":"invite-employee:copy-invitation-link-click:click","email-invite-click":"invite-employee:email-invite-click:click","google-invite-click":"invite-employee:google-invite-click:click","excel-invite-click":"invite-employee:excel-invite-click:click"},ONBOARDING_INVITE_EVENTS=new Set(["copy-invitation-link-click","email-invite-click","google-invite-click","excel-invite-click"]),InviteEmplUserTracker=exports.InviteEmplUserTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=eventDics[b];if(d)return ONBOARDING_INVITE_EVENTS.has(b)&&(0,_latch.latchStep)(_constant.FLAG.STEP4_INVITE),a.trackAction({event:d,value:c,data:{}})},a};
111
112},{"../../../components/onboarding-checklist/constant.js":12,"../../../components/onboarding-checklist/latch.js":15,"../index.js":34}],38:[function(require,module,exports){
113"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LeftMenuTracker=void 0;var _index=require("../index.js"),eventDics={logo:"main:left-menu-logo:click",project:"main:left-menu-project:click","new-project":"main:left-menu-new-project:click",dashboard:"main:left-menu-dashboard:click",report:"main:left-menu-report:click",open:"main:left-menu-open-project:click","project-more":"main:left-menu-project-more:click",nokeep:"main:left-menu-nokeep:cl
113ick",unread:"main:left-menu-unread:click",star:"main:left-menu-star:click",hidden:"main:left-menu-hidden:click",more:"main:left-menu-more:click",task:"main:left-menu-task:click",gantt:"main:left-menu-gantt:click",schd:"main:left-menu-schd:click",calendar:"main:left-menu-calendar:click",file:"main:left-menu-file:click",bookmark:"main:left-menu-bookmark:click",mention:"main:left-menu-mention:click",my_post:"main:left-menu-my-post:click",tmpPost:"main:left-menu-temp-post:click","collect-more":"main:left-menu-collect-more:click","recent-project-more":"main:left-menu-recent-project-more:click","label-more":"main:left-menu-label-more:click","help-center":"main:left-menu-help-center:click","invite-member":"main:left-menu-invite-member:click","manager-admin":"main:left-menu-manager-admin:click","service-upgrade":"main:left-menu-service-upgrade:click",fold:"main:left-menu-fold:click"},LeftMenuTracker=exports.LeftMenuTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=eventDics[b];return c?a.trackAction({event:c,value:null,data:{}}):void 0},a};
114
115},{"../index.js":34}],39:[function(require,module,exports){
116"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MiniLeftMenuTracker=void 0;var _index=require("../index.js"),eventDics={Profile:"mini:left-menu-profile:click",Favorite:"mini:left-menu-favorite:click",Project:"mini:left-menu-project:click",Organization:"mini:left-menu-organization:click",Contact:"mini:left-menu-contact:click",Chatting:"mini:left-menu-chatting:click",FlowMain:"mini:left-menu-flow-main:click",Setting:"mini:left-menu-setting:click"},MiniLeftMenuTracker=exports.MiniLeftMenuTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=eventDics[b];return c?a.trackAction({event:c,value:null,data:{}}):void 0},a};
117
118},{"../index.js":34}],40:[function(require,module,exports){
119"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MiniNoticeTracker=void 0;var _index=require("../index.js"),eventDics={"never-see":"mini:never-see-again:click","notice-link":"mini:notice-link:click"},MiniNoticeTracker=exports.MiniNoticeTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=eventDics[b];return d?a.trackAction({event:d,value:c,data:{}}):void 0},a};
120
121},{"../index.js":34}],41:[function(require,module,exports){
122"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProjectInviteTracker=void 0;var _index=require("../index.js"),eventDics={team:"main:project-invite-team:click",email:"main:project-invite-email:click","copy-link":"main:project-invite-copy-link:click"},ProjectInviteTracker=exports.ProjectInviteTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=eventDics[b];return c?a.trackAction({event:c,value:null,data:{}}):void 0},a};
123
124},{"../index.js":34}],42:[function(require,module,exports){
125"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ScheduleFilterTracker=void 0;var _index=require("../index.js"),eventDics={"schd-all":"main:schd-all:click","schd-my":"main:schd-my:click","schd-register":"main:schd-register:click","schd-none":"main:schd-none:click","task-all":"main:task-all:click","task-my":"main:task-my:click","task-request":"main:task-request:click","task-none":"main:task-none:click"},ScheduleFilterTracker=exports.ScheduleFilterTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b,c){var d="";if("schd"===b)"0,1"===c?d="schd-all":"1"===c?d="schd-my":"0"===c?d="schd-register":"-1"===c?d="schd-none":void 0;else if("task"===b)"2"===c?d="task-all":"0"===c?d="task-my":"1"===c?d="task-request":"-1"===c?d="task-none":void 0;else return;var e=eventDics[d];return e?a.trackAction({event:e,value:null,data:{}}):void 0},a};
126
127},{"../index.js":34}],43:[function(require,module,exports){
128"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShortcutTracker=void 0;var _index=require("../index.js"),eventDics={"personal-shortcut-click":"shortcut:personal-shortcut-click:click","intt-shortcut-click":"shortcut:intt-shortcut-click:click","portal-shortcut-click":"shortcut:portal-shortcut-click:click","sample-sh
128ortcut-click":"shortcut:sample-shortcut-click:click","personal-shortcut-add":"shortcut:personal-shortcut-add:click","personal-shortcut-update":"shortcut:personal-shortcut-update:click","personal-shortcut-delete":"shortcut:personal-shortcut-delete:click","intt-shortcut-add":"shortcut:intt-shortcut-add:click","intt-shortcut-update":"shortcut:intt-shortcut-update:click","intt-shortcut-delete":"shortcut:intt-shortcut-delete:click","intt-shortcut-display-update":"shortcut:intt-shortcut-display-update:click"},ShortcutTracker=exports.ShortcutTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=eventDics[b];return d?a.trackAction({event:d,value:c,data:{}}):void 0},a};
129
130},{"../index.js":34}],44:[function(require,module,exports){
131"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SignInTracker=void 0;var _index=require("../index.js"),eventDics={"normal-login-click":"sign-in:normal-login:click","normal-login-enter":"sign-in:normal-login:enter","mini-login-click":"mini-sign-in:normal-login:click","mini-login-enter":"mini-sign-in:normal-login:enter","google-login":"sign-in:google-login:click","kakao-login":"sign-in:kakao-login:click","apple-login":"sign-in:apple-login:click","google-mini-login":"mini-sign-in:google-login:click","kakao-mini-login":"mini-sign-in:kakao-login:click","apple-mini-login":"mini-sign-in:apple-login:click","pw-find":"sign-in:pw-find:click","mini-pw-find":"mini-sign-in:pw-find:click","corp-pw-find":"corp-sign-in:pw-find:click","pw-find-email-click":"sign-in:pw-find-email:click","pw-find-email-enter":"sign-in:pw-find-email:enter","auto-login-check":"sign-in:auto-login-check:click"},SignInTracker=exports.SignInTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=eventDics[b];return d?a.trackAction({event:d,value:c,data:{}}):void 0},a};
132
133},{"../index.js":34}],45:[function(require,module,exports){
134"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SignUpTracker=void 0;var _index=require("../index.js"),eventDics={"google-sign-up":"sign-up:google-sign-up:click","invite-kakaotalk":"sign-up:invite-kakaotalk:click","invite-messenger":"sign-up:invite-messenger:click","invite-google-contacts":"sign-up:invite-google-contacts:click","invite-google-workspace":"sign-up:invite-google-workspace:click","invite-google-submit":"sign-up:invite-google-submit:click","invite-email":"sign-up:invite-email:click","invite-email-submit":"sign-up:invite-email-submit:click","invite-text-app":"sign-up:invite-text-app:click","copy-invite-link":"sign-up:copy-invite-link:click"},SignUpTracker=exports.SignUpTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=eventDics[b];return d?a.trackAction({event:d,value:c,data:{}}):void 0},a};
135
136},{"../index.js":34}],46:[function(require,module,exports){
137"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TaskGridExpTracker=void 0;var _index=require("../../index.js"),eventDics={"entry-click":"task-grid-exp:entry-button:click","category-click":"task-grid-exp:category:click","project-click":"task-grid-exp:project:click"},TaskGridExpTracker=exports.TaskGridExpTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},e=eventDics[b];return e?a.trackAction({event:e,value:c,data:d}):void 0},a};
138
139},{"../../index.js":34}],47:[function(require,module,exports){
140"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TaskGridGuideTracker=void 0;var _index=require("../../index.js"),eventDics={"guide-button-click":"task-grid-guide:button:click","list-item-click":"task-grid-guide:list-item:click","detail-click":"task-grid-guide:detail:click","help-click":"task-grid-guide:help:click","feedback-click":"task-grid-guide:feedback:click","ping-click":"task-grid-guide:ping:click"},TaskGridGuideTracker=exports.TaskGridGuideTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},e=eventDics[b];return e?a.trackAction({event:e,value:c,data:d}):void 0},a};
141
142},{"../../index.js":34}],48:[function(require,module,exports){
143"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TaskGridInGridTracker=exports.TaskGridHeaderTracker=exports.TaskGridFeedTracker=exports.TaskGridEventDics=exports.TaskGridColumnTracker=void 0;var _index=require("../index.js"),TaskGridEventDics=exports.TaskGridEventDics={header:{viewClick:"task-grid:header-view:click",viewCreate:"task-grid:header-view-create:click",myViewClick:"task-grid:header-view-mine:click",projectShareClick:"task-grid:header-view-share:click",allTaskClick:"task-grid:header-view-all:click",filterClick:"task-grid:header-filter:click",quickFilterClick:"task-grid:header-quick-filter:click",filterAddClick:"task-grid:header-filter-add:click",filterTypeClick:"task-grid:header-filter-type:click",filterOptionClick:"task-grid:header-filter-option:click",filterResetClick:"task-grid:header-filter-reset:click",sortClick:"task-grid:header-sort:click",sortTypeClick:"task-grid:header-sort-type:click",sortOrderClick:"task-grid:header-sort-order:click",sortResetClick:"task-grid:header-sort-reset:click",groupClick:"task-grid:header-group:click",groupTypeClick:"task-grid:header-group-type:click",groupOrderClick:"task-grid:header-group-order:click",groupResetClick:"task-grid:header-group-reset:click",groupEmptyClick:"task-grid:header-group-empty:click",hideClick:"task-grid:header-hide:click",hideItemClick:"task-grid:header-hide-item:click",hideAllClick:"task-grid:header-hide-all:click",hideResetClick:"task-grid:header-hide-reset:click",searchClick:"task-grid:header-search-btn:click",generalSearch:"task-grid:header-general-search:enter",aiButtonClick:"task-grid:header-ai-search:click",aiSearchEnter:"task-grid:header-ai-search:enter",addTaskClick:"task-grid:header-add-task:click",moreClick:"task-grid:header-more:click",excelDownloadClick:"task-grid:header-excel-download:click",ganttTodayViewClick:"task-grid:header-gantt-today:click",ganttDateRangeClick:"task-grid:header-gantt-range:click",ganttModeClick:"task-grid:header-gantt-mode:click",taskClick:"task-grid:header-task:click",feedClick:"task-grid:header-feed:click",ganttClick:"task-grid:header-gantt:click",insightClick:"task-grid:header-insight:click",newViewCreateClick:"task-grid:header-view-create:click",viewResetClick:"task-grid:header-view-reset:click"},column:{click:"task-grid:column:click",hide:"task-grid:column-hide:click",edit:"task-grid:column-edit:click",delete:"task-grid:column-delete:click",ascending:"task-grid:column-ascending:click",descending:"task-grid:column-descending:click",group:"task-grid:column-group:click",filter:"task-grid:column-filter:click"},grid:{addTaskClick:"task-grid:grid-add-task:click",cellClick:"task-grid:grid-cell:click",cellValueChange:"task-grid:grid-cell-value:change",taskMoreView:"task-grid:grid-task-more:click",subTaskMoreView:"task-grid:grid-subtask-more:click",toggleButton:"task-grid:grid-toggle-button:click",titleCellAddSubTask:"task-grid:grid-title-cell-add-subtask:click",titleCellPostView:"task-grid:grid-title-cell-post-view:click",groupAdd:"task-grid:grid-group-add:click",numberCalc:"task-grid:grid-number-calc:click",numberCalcChange:"task-grid:grid-number-calc-ch
143ange:change"},feed:{detail:"task-grid:list-detail:click",minify:"task-grid:list-minify:click"}},createTrackerForCategory=function(a){var b=TaskGridEventDics[a];return function(){var a=Object.create(_index.UserTracker);return a.track=function(c){var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},f=b[c];return f?a.trackAction({event:f,value:d,data:e}):void 0},a}},TaskGridHeaderTracker=exports.TaskGridHeaderTracker=createTrackerForCategory("header"),TaskGridColumnTracker=exports.TaskGridColumnTracker=createTrackerForCategory("column"),TaskGridInGridTracker=exports.TaskGridInGridTracker=createTrackerForCategory("grid"),TaskGridFeedTracker=exports.TaskGridFeedTracker=createTrackerForCategory("feed");
144
145},{"../index.js":34}],49:[function(require,module,exports){
146"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TopMenuTracker=void 0;var _index=require("../index.js"),eventDics={okr:"main:top-menu-okr:click",portal:"main:top-menu-portal:click",letter:"main:top-menu-letter:click",org:"main:top-menu-org:click",chat:"main:top-menu-chat:click",alarm:"main:top-menu-alarm:click",profile:"main:top-menu-profile:click",search:"main:top-menu-search:click","electron-history-back":"main:top-menu-electron-history-back:click","electron-history-forward":"main:top-menu-electron-history-forward:click","electron-reload-btn":"main:top-menu-electron-reload-btn:click","electron-reload-menu":"main:top-menu-electron-reload-menu:click"},TopMenuTracker=exports.TopMenuTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=eventDics[b];return c?a.trackAction({event:c,value:null,data:{}}):void 0},a};
147
148},{"../index.js":34}],50:[function(require,module,exports){
149"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TranslateTracker=void 0;var _index=require("../index.js"),eventDics={post:"main:translate-post:click",comment:"main:translate-comment:click",reply:"main:translate-reply:click"},TranslateTracker=exports.TranslateTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=eventDics[b];return c?a.trackAction({event:c}):void 0},a};
150
151},{"../index.js":34}],51:[function(require,module,exports){
152"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViewerTracker=void 0;var _index=require("../index.js"),eventDics={search:"main:search:view",main:"main:project:view",project:"main:project:view",miniProject:"main:mini-project:view",nokeep:"main:nokeep:view",unread:"main:unread:view",star:"main:star:view",gantt:"main:gantt:view",task:"main:task:view",schd:"main:schd:view",file:"main:file:view",fileChange:"main:file-change:view",history:"main:history:view",dash:"main:dashboard:view",insight:"main:insight:view",bookmark:"main:bookmark:view",mention:"main:mention:view",mypost:"main:my-post:view",tmpPost:"main:tmp-post:view",open:"main:open:view",offc:"main:offc:view",label:"main:label:view",hidden:"main:hidden:view",detail
152:"main:detail:view",upgrade:"main:upgrade:view",payment:"main:payment:view",portalApp:"main:portal-app:view",stripePayment:"main:stripe-payment:view",dashboard:"main:dashboard:view",calendar:"main:calendar:view",routine:"main:routine:view",report:"main:report:view"},ViewerTracker=exports.ViewerTracker=function(){var a=Object.create(_index.UserTracker);return a.track=function(b){var c=eventDics[b];return c?a.trackAction({event:c,value:null,data:{}}):void 0},a};
153
154},{"../index.js":34}],52:[function(require,module,exports){
155"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getVideoViewer=exports.getToastChart=exports.getSwiper=exports.getSortable=exports.getSocketIo=exports.getSocketClient=exports.getSlick=exports.getRequest=exports.getQuill=exports.getProtobufjs=exports.getOneDrive=exports.getJuiChart=exports.getHtml2Pdf=exports.getHtml2Canvas=exports.getGoogleMap=exports.getGoogleDrive=exports.getGoogleAccountApi=exports.getFullCalendar=exports.getFlowTaskUtil=exports.getFlowPopupKit=exports.getFlowInlineLinkPopup=exports.getFlowGrid=exports.getFlowDatePicker=exports.getFlatpickr=exports.getExcelLib=exports.getEmoji=exports.getEWSFullCalendar=exports.getConfirmDate=exports.getCKEditor=exports.getActiveLib=void 0,exports.insertScriptTag=insertScriptTag,exports.loadPreactLib=void 0,exports.loadScript=loadScript;function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d.return&&(k=d.return(),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
155return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var html2CanvasLoading,activeLib=[],getActiveLib=exports.getActiveLib=function a(){return activeLib},getGoogleMapKey=function a(){return ServerChecker.isFlowCloud||ServerChecker.isGlobal?"AIzaSyCjtpi59GMt3q8fKeOVP1Poh1-JlovcaeE":"AIzaSyADjbtMn46r9DGFyo_ZRz3c6fOXzuOKWCw"},getGoogleMap=exports.getGoogleMap=function a(){return loadScript(function(){var a;return null===(a=window.google)||void 0===a||null===(a=a.maps)||void 0===a?void 0:a.places},"https://maps.googleapis.com/maps/api/js?libraries=places&key=".concat(getGoogleMapKey()))},getRequest=exports.getRequest=function a(){return loadScript(function(){return window.superagent},"superagent/superagent.min.js")},getSortable=exports.getSortable=function a(){return loadScript(function(){return window.Sortable},"sortablejs/Sortable.min.js")},getOneDrive=exports.getOneDrive=function a(){return loadScript(function(){return window.OneDrive},"oneDrive/OneDrive.js")},getJuiChart=exports.getJuiChart=function a(){return loadScript(function(){return window.graph},"jui-chart-master/chart.js")},getCKEditor=exports.getCKEditor=function a(){return loadScript(function(){return window.CKEDITOR},"ckeditor/ckeditor.js")},getHtml2Canvas=exports.getHtml2Canvas=function a(){return html2CanvasLoading||(html2CanvasLoading=insertScriptTag(function(){return"function"==typeof window.html2canvas?window.html2canvas:void 0},"".concat(window.basePath||"","/flow-renewal/dist/js/html2canvasLib.min.js?v=").concat(window.html2canvasLibVersion||window.version||"")).then(function(a){if("function"!=typeof a)throw new Error("html2canvas failed to initialize");return a}).catch(function(a){throw html2CanvasLoading=void 0,a})),html2CanvasLoading},getHtml2Pdf=exports.getHtml2Pdf=function a(){return loadScript(function(){return window.html2pdf},"html2pdf/html2pdf.bundle.min.js")},getEmoji=exports.getEmoji=function(){var a=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.picmo},"picmo/picmo.js");case 1:return a.n=2,loadScript(function(){return window.picmoTwemoji},"picmoTwemoji/picmoTwemoji.js");case 2:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),getGoogleDrive=exports.getGoogleDrive=function(){var a=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(!Often.isGlobal()){a.n=3;break}return a.n=1,loadScript(function(){var a;return null===(a=window.google)||void 0===a?void 0:a.account},"https://apis.google.com/js/api.js");case 1:return a.n=2,loadScript(function(){var a;return null===(a=window.google)||void 0===a?void 0:a.account},"https://accounts.google.com/gsi/client");case 2:a.n=4;break;case 3:return a.n=4,loadScript(function(){var a;return null===(a=window.google)||void 0===a?void 0:a.picker},"https://apis.google.com/js/platform.js?google-drive");case 4:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),getGoogleAccountApi=exports.getGoogleAccountApi=function(){var a=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){var a;return null===(a=window.google)||void 0===a?void 0:a.account},"https://apis.google.com/js/api.js");case 1:return a.n=2,loadScript(function(){var a;return null===(a=window.google)||void 0===a?void 0:a.account},"https://accounts.google.com/gsi/client");case 2:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),getToastChart=exports.getToastChart=function a(){var b=loadScript(function(){var a;return null===(a=window.toastui)||void 0===a?void 0:a.Chart},"@toast-ui/toastui-chart.min.js");return loadStyle("","@toast-ui/toastui-chart.min.css"),b},getExcelLib=exports.getExcelLib=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,Promise.allSettled([loadScript(function(){return window.saveAs},"excel/FileSaver.js"),loadScript(function(){return window.XLSX},"excel/xlsx.style.min.js")]);case 1:if(b=a.v,c=_slicedToArray(b,2),d=c[0],e=c[1],"fulfilled"===d.status&&"fulfilled"===e.status){a.n=2;break}throw new Error("Library issue : \uC5D1\uC140 \uB2E4\uC6B4 \uBD88\uAC00!");case 2:return a.a(2,{saveAs:d.value,XLSX:e.value})}},a)}));return function b(){return a.apply(this,arguments)}}(),getSlick=exports.getSlick=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.$.slick},"slick/slick.min.js");
155case 1:return b=a.v,loadStyle("slick","slick/slick.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getSwiper=exports.getSwiper=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.Swiper},"swiper/swiper-bundle.min.js");case 1:return b=a.v,loadStyle("swiper","swiper/swiper-bundle.min.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getFullCalendar=exports.getFullCalendar=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.moment},"moment/moment.min.js");case 1:return a.n=2,loadScript(function(){return window.$.fullCalendar},"fullcalendar-3.10.2/fullcalendar.min.js");case 2:return b=a.v,a.n=3,loadScript(function(){return 1<Object.keys(window.$.fullCalendar.locales).length},"fullcalendar-3.10.2/locale-all.js");case 3:return loadStyle("fullcalendar","fullcalendar-3.10.2/fullcalendar.min.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getEWSFullCalendar=exports.getEWSFullCalendar=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.moment},"moment/moment.min.js");case 1:return a.n=2,loadScript(function(){return window.EwsFullCalendar},"fullcalendar/lib/main.js");case 2:return b=a.v,loadStyle("EWSFullcalendar","fullcalendar/lib/main.css"),loadStyle("fullcalendar","fullcalendar-3.10.2/fullcalendar.min.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getVideoViewer=exports.getVideoViewer=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.videojs},"videojs/video.min.js");case 1:return b=a.v,loadStyle("VideoJs","videojs/video-js.min.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),loadPreactLib=exports.loadPreactLib=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=!window.preact,!b){a.n=1;break}return a.n=1,loadScript(function(){return window.preact},"preact/preact.umd.js");case 1:if(c=!window.preactHooks,!c){a.n=2;break}return a.n=2,loadScript(function(){return window.preactHooks},"preact/hooks.umd.js");case 2:if(d=!window.preactCompat,!d){a.n=3;break}return a.n=3,loadScript(function(){return window.preactCompat},"preact/compat.umd.js");case 3:if(e=!window.preactSignalsCore,!e){a.n=4;break}return a.n=4,loadScript(function(){return window.preactSignalsCore},"preact/signals-core.min.js");case 4:if(f=!window.preactSignals,!f){a.n=5;break}return a.n=5,loadScript(function(){return window.preactSignals},"preact/signals.min.js");case 5:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),getFlowGrid=exports.getFlowGrid=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=Mutil.isFunc("FLOW_MODULE_DEBUG"),a.n=1,loadPreactLib();case 1:if(!window.FlowGrid){a.n=2;break}d=window.FlowGrid,a.n=4;break;case 2:return a.n=3,loadScript(function(){return window.FlowGrid},b?"flow-grid/flow-grid.debug.min.js":"flow-grid/flow-grid.min.js");case 3:d=a.v;case 4:return c=d,loadStyle("flowGrid","flow-grid/flow-grid.css"),loadStyle("flowTaskUtil","flow-task-util/flow-task-util.css"),a.a(2,c)}},a)}));return function b(){return a.apply(this,arguments)}}(),getFlowDatePicker=exports.getFlowDatePicker=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=Mutil.isFunc("FLOW_MODULE_DEBUG"),loadStyle("flowDatePicker","flow-datepicker/flow-datepicker.css"),a.n=1,loadPreactLib();case 1:if(!window.FlowDatePicker){a.n=2;break}d=window.FlowDatePicker,a.n=4;break;case 2:return a.n=3,loadScript(function(){return window.FlowDatePicker},b?"flow-datepicker/flow-datepicker.debug.min.js":"flow-datepicker/flow-datepicker.min.js");case 3:d=a.v;case 4:return c=d,a.a(2,c)}},a)}));return function b(){return a.apply(this,arguments)}}(),getFlowPopupKit=exports.getFlowPopupKit=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=Mutil.isFunc("FLOW_MODULE_DEBUG"),a.n=1,loadPreactLib();case 1:if(!window.FlowPopupKit){a.n=2;break}d=window.FlowPopupKit,a.n=4;break;case 2:return a.n=3,loadScript(function(){return window.FlowPopupKit},b?"flow-popup-kit/flow-popup-kit.debug.min.js":"flow-popup-kit/flow-popup-kit.min.js");case 3:d=a.v;case 4:return c=d,a.a(2,c)}},a)}));return function b(){return a.apply(this,arguments)}}(),ensureReactGlobalsForInlineLink=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadPreactLib();case 1:return a.n=2,loadScript(function(){return window.jsxRuntime},"preact/jsxRuntime.umd.js");case 2:window.React||(window.React=window.preactCompat),"function"!=typeof(null===(b=window.ReactDOM)||void 0===b?void 0:b.createRoot)&&(window.ReactDOM=Object.assign({},window.preactCompat,{createRoot:function b(a){return{render:function c(b){return window.preact.render(b,a)},unmount:function b(){return window.preact.render(null,a)}}}})),window.jsxRuntime&&!window.jsxRuntime.Fragment&&(window.jsxRuntime.Fragment=window.preact.Fragment);case 3:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}
155(),getFlowInlineLinkPopup=exports.getFlowInlineLinkPopup=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(loadStyle("flowInlineLinkPopup","flow-inline-link-popup/flow-inline-link-popup.css"),"function"==typeof(null===(b=window.FlowInlineLinkPopup)||void 0===b?void 0:b.initInlineLinkPopup)){a.n=2;break}return delete window.FlowInlineLinkPopup,a.n=1,ensureReactGlobalsForInlineLink();case 1:return a.n=2,loadScript(function(){return window.FlowInlineLinkPopup},"flow-inline-link-popup/flow-inline-link-popup.min.js");case 2:return a.a(2,window.FlowInlineLinkPopup)}},a)}));return function b(){return a.apply(this,arguments)}}(),getFlowTaskUtil=exports.getFlowTaskUtil=function(){var a=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:loadStyle("flowTaskUtil","flow-task-util/flow-task-util.css");case 1:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),getSocketClient=exports.getSocketClient=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.SocketClient},"socket.io-client/socket.io.js");case 1:return b=a.v,a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getFlatpickr=exports.getFlatpickr=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.flatpickr},"flatpickr/flatpickr.min.js");case 1:return b=a.v,a.n=2,loadScript(function(){return window.ko},"flatpickr/l10n/ko.js");case 2:return a.n=3,loadScript(function(){return window.ja},"flatpickr/l10n/ja.js");case 3:return a.n=4,loadScript(function(){return window.es},"flatpickr/l10n/es.js");case 4:return a.n=5,loadScript(function(){return window.vi},"flatpickr/l10n/vi.js");case 5:return a.n=6,loadScript(function(){return window.de},"flatpickr/l10n/de.js");case 6:return a.n=7,loadScript(function(){return window.fr},"flatpickr/l10n/fr.js");case 7:return flatpickr.localize(flatpickr.l10ns[Internationalization.getCurrentLanguage()]),loadStyle("Flatpickr","flatpickr/flatpickr.min.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getConfirmDate=exports.getConfirmDate=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.confirmDatePlugin},"confirmDate/confirmDate.js");case 1:return b=a.v,loadStyle("ConfirmDate","confirmDate/confirmDate.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getQuill=exports.getQuill=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.Quill},"quill/quill.js");case 1:return b=a.v,loadStyle("Quill","quill/quill.snow.css"),a.a(2,b)}},a)}));return function b(){return a.apply(this,arguments)}}(),getSocketIo=exports.getSocketIo=function(){var a=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.socketIo},"socket.io-client/socket.io.js");case 1:return a.a(2,a.v)}},a)}));return function b(){return a.apply(this,arguments)}}(),getProtobufjs=exports.getProtobufjs=function(){var a=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,loadScript(function(){return window.protobuf},"@protobufjs/protobuf.min.js");case 1:return a.a(2,a.v)}},a)}));return function b(){return a.apply(this,arguments)}}();function loadScript(a,b){var c=window.basePath?window.basePath:"";return b.includes("https://")||(b.startsWith("util")?b=c+"/flow-renewal/module/"+b+"?ver="+(window.version||""):b=c+"/flow-renewal/module/lib/"+b+"?ver="+(window.version||"")),insertScriptTag(a,b)}function loadStyle(a,b){var c,d=null!==(c=window.basePath)&&void 0!==c?c:"",e=d+"/flow-renewal/module/lib/"+b;if(!(a&&document.getElementById(a))){for(var f,g=document.querySelectorAll("link[rel=\"stylesheet\"]"),h=0;h<g.length;h++)if(f=g[h].getAttribute("href"),f&&f.split("?")[0]===e)return;var j=document.createElement("link");a&&(j.id=a),j.rel="stylesheet",j.href=e+"?ver="+(window.version||"");var k=document.getElementsByTagName("link")[0];k.parentElement.insertBefore(j,k)}}function insertScriptTag(a,b){return new Promise(function(c,d){var e=a();if(e&&activeLib.includes(b))return void c(e);var f=document.createElement("script"),g=!1;f.type="text/javascript",f.src=b,f.async=!0,f.onerror=function(a){return d(a,f)},f.onload=f.onreadystatechange=function(){g||this.readyState&&"complete"!==this.readyState||(g=!0,activeLib.push(b),c(a())
155)};var h=document.getElementsByTagName("script")[0];h.parentElement.insertBefore(f,h)})}
156
157},{}],53:[function(require,module,exports){
158"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.openMessenger=exports.executeDeeplink=exports.addEvent=void 0;function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var openMessenger=exports.openMessenger=function(){var a=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,checkTokenExpiry();case 1:null!==(c=window)&&void 0!==c&&c.ElectronProcessApi?ElectronApi.Chat.openChatDirect({chat_token:null===(d=window)||void 0===d?void 0:d._CHAT_TOKEN,roomSrnoByToken:a}):(f="".concat(window.location.origin,"/messenger.act?chat_token=").concat(null===(e=window)||void 0===e?void 0:e._CHAT_TOKEN),g=OpenUtil.getWhljJson("MESSENGER"),window.open(f,"_blank","width=".concat(g.width,"px, height=").concat(g.height,"px, left=").concat(g.left,"\", Top=").concat(g.top)));case 2:return b.a(2)}},b)}));return function c(b){return a.apply(this,arguments)}}(),executeDeeplink=exports.executeDeeplink=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,getParsedChatTokenData();case 1:if(c=a.v,"Y"!==c.TOKEN_EXPIRED_YN){a.n=2;break}return a.a(2,redirectErrorPage());case 2:d=new Date,null!==(b=window)&&void 0!==b&&b.isMobile?(location.href="".concat(window.location.origin,"/messenger.act?chat_token=").concat(null===(e=window)||void 0===e?void 0:e._CHAT_TOKEN),setTimeout(function(){2500>
158new Date-d&&(window.location.href=getDownloadUrl())},2e3)):(g="flownew://",location.href="".concat(g,"openChat?chat_token=").concat(null===(f=window)||void 0===f?void 0:f._CHAT_TOKEN,"&roomSrnoByToken=").concat(c.ROOM_SRNO));case 3:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),addEvent=exports.addEvent=function a(){var b=$(".js-launcher-section");b.off("click").on("click",function(){var a=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:if(g=function b(){var d,e=c.closest(".js-app-download");if(0===e.length)return(!1);if(a.preventDefault(),null!==(d=window)&&void 0!==d&&d.isMobile){var f,g=getDownloadUrl();null===(f=window)||void 0===f||f.open(g,"_blank")}else DesktopGuide.desktopDownload();return!0},f=function a(){return f=_asyncToGenerator(_regenerator().m(function a(){var b,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=c.closest("#executeDesktopAppBtn"),d=c.closest("#executeMobileAppBtn"),0!==b.length||0!==d.length){a.n=1;break}return a.a(2,!1);case 1:return a.n=2,executeDeeplink();case 2:return a.a(2,!0)}},a)})),f.apply(this,arguments)},e=function a(){return f.apply(this,arguments)},d=function a(){var b=c.closest("#executeWebBtn");if(0===b.length)return(!1);if(isLogin)openMessenger();else{var d,e="".concat(window.location.origin,"/signin.act?chat_token=").concat(null===(d=window)||void 0===d?void 0:d._CHAT_TOKEN);window.open(e,"_blank")}return!0},c=$(a.target),!d()){b.n=1;break}return b.a(2);case 1:return b.n=2,e();case 2:if(!b.v){b.n=3;break}return b.a(2);case 3:if(!g()){b.n=4;break}return b.a(2);case 4:return b.a(2)}},b)}));return function(b){return a.apply(this,arguments)}}())},getDownloadUrl=function a(){var b,c={global:{IOS:"https://apps.apple.com/app/morningmate-workspace-with-ai/id6445914029",AOS:"https://play.google.com/store/apps/details?id=com.morningmate.flow"},flow:{IOS:"https://apps.apple.com/app/flow-ai-collaboration-tool/id939143477",AOS:"https://play.google.com/store/apps/details?id=com.webcash.bizplay.collabo"}},d=window.navigator.userAgent.toLowerCase(),e=0<=d.indexOf("iphone")||0<=d.indexOf("ipad")||0<=d.indexOf("macintosh")?"IOS":"AOS",f=Often.isGlobal()?"global":"flow";return(null===(b=c[f])||void 0===b?void 0:b[e])||""},getParsedChatTokenData=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,Ajax.executeApi("ACT_PARSE_CHAT_TOKEN",{TOKEN:null===(b=window)||void 0===b?void 0:b._CHAT_TOKEN});case 1:return a.a(2,a.v)}},a)}));return function b(){return a.apply(this,arguments)}}(),checkTokenExpiry=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,getParsedChatTokenData();case 1:if(b=a.v,"Y"!==b.TOKEN_EXPIRED_YN){a.n=2;break}return a.a(2,redirectErrorPage());case 2:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),redirectErrorPage=function a(){window.location.href="".concat(window.location.origin,"/errorpage.act?c=token-expiry")};
159
160},{}],54:[function(require,module,exports){
161"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DraftRemarkData=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var DraftRemarkData=exports.DraftRemarkData=function(){function a(){_classCallCheck(this,a),_defineProperty(this,"draftRemarkDataMap",new Map)}return _createClass(a,[{key:"setDraftDataMap",value:function(a){var b=a.key,c=a.value;b&&c||(Mutil.mlog("::::::::::::::::::::::::::::::::::::::::::::"),Mutil.mlog("setDraftDataMap :::: Key or Value is empty"),Mutil.mlog("key ::: ".concat(b)),Mutil.mlog("value :::",c),Mutil.mlog("::::::::::::::::::::::::::::::::::::::::::::")),this.draftRemarkDataMap.set(b,c)}},{key:"getDraftDataMap",value:function(){return this.draftRemarkDataMap}},{key:"getDraftDataByKey",value:function(a){return this.draftRemarkDataMap.get(a)}}
161,{key:"deleteDraftDataByKey",value:function(a){if(a)return this.draftRemarkDataMap.delete(a),!0;throw new Error("deleteDraftDataByKey :::: Key is empty")}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new a),this.instance}}])}();_defineProperty(DraftRemarkData,"instance",null);
162
163},{}],55:[function(require,module,exports){
164"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Header=void 0;var _Component2=_interopRequireDefault(require("../../../core/Component.js")),_index=require("../util/view-changer/index.js"),_index2=require("../../../bridge/renewal-signup/index.js"),_store=require("../store.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var Header=exports.Header=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.isShowLoginBtn,c=a.isShowPrevBtn,d=a.isShowCloseBtn;return"\n                  ".concat(void 0!==c&&c?this.getPrevBtnTemplate():"","\n                   ").concat(void 0!==b&&b?this.getLoginBtnTemplate():"","\n                   ").concat(void 0!==d&&d?this.getCloseBtnTemplate():"","\n                ")}},{key:"getPrevBtnTemplate",value:function(){var a=this.$props.isShowPrevText;return"\n            <div class=\"prev-button-wrap\" style=\"\">\n                    <button id=\"prevBtn\"><i class=\"ic-ic-096\"></i>".concat(void 0!==a&&a?"<span class=\"prev-button-text\">".concat(i18next.t(dictionary.goBack),"</span>"):"","</button>\n                </div>\n        ")}},{key:"getLoginBtnTemplate",value:function(){var a=this.$props.isSignupCta;return void 0!==a&&a?"\n            <div class=\"login-button-wrap\">
164\n                    <span>".concat(i18next.t(login.notMemberYet),"</span>\n                    <button id=\"moveSignUpBtn\">").concat(i18next.t(login.signup),"</button>\n                </div>\n        "):"\n            <div class=\"login-button-wrap\">\n                    <span>".concat(i18next.t(login.alreadyAccount),"</span>\n                    <button id=\"moveSignInBtn\">").concat(i18next.t(dictionary.login),"</button>\n                </div>\n        ")}},{key:"getCloseBtnTemplate",value:function(){return"\n            <div class=\"close-button-wrap\" style=\"display: none;\">\n                <button type=\"button\" class=\"Btn-Icon js-signup-step-close\" aria-label=\"".concat(i18next.t(dictionary.close),"\"><i class=\"ic-ic-078-b\" aria-hidden=\"true\"></i></button>\n            </div>\n        ")}},{key:"setEvent",value:function(){this.addClickEventOfLoginBtn(),this.addClickEventOfPrevBtn()}},{key:"addClickEventOfPrevBtn",value:function(){var a=this.$props.isShowPrevBtn;void 0!==a&&a&&this.addEvent("click","#prevBtn",function(){history.back()})}},{key:"addClickEventOfLoginBtn",value:function(){var a=this.$props,b=a.isShowLoginBtn,c=a.isSignupCta;return void 0!==b&&b?void 0!==c&&c?void this.addEvent("click","#moveSignUpBtn",function(){_index.SignUpViewChanger.moveNewSignUpPage()}):void this.addEvent("click","#moveSignInBtn",function(){return(0,_store.isWebView)()?void(0,_index2.sendMoveMobileSignInPage)():void _index.SignUpViewChanger.moveSignInPage()}):void 0}}])}(_Component2.default);
165
166},{"../../../bridge/renewal-signup/index.js":4,"../../../core/Component.js":28,"../store.js":100,"../util/view-changer/index.js":108}],56:[function(require,module,exports){
167"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.InviterList=void 0;var _SignUpComponent2=require("./SignUpComponent.js"),_store=require("../store.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var InviterList=exports.InviterList=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this,b=this.$props.inviterList,c=void 0===b?[]:b;return c.map(function(b){return a.getInviterItemTemplate(b)}).join(" ")}},{key:"getInviterItemTemplate",value:function(a){var b=a.FLNM,c=void 0===b?"":b,d=a.PRFL_PHTG,e=void 0===d?"":d,f=a.USER_ID,g=void 0===f?"":f,h=a.USE_INTT_ID,i=a.USE_INTT_NM,j=void 0===i?"":i,k=Mutil.empty(j)?"":"<dd>".concat(j,"</dd>");return"\n                 <button class=\"js-inviter-li\" use-intt-id=\"".concat(h,"\">\n                        <i class=\"profile\">\n                            <img src=\"").concat(e,"\" alt=\"\" onerror=\"this.src='/flow-renewal/assets/images/profile-default.png'\">\n                        </i>\n                        <div>\n                            <em>").concat(i18next.t(login.usingBy,{val:Mutil.n2v(c)}),"</em>
167\n                            <span>").concat(k,"</span>\n                        </div>\n                        <i>\n                            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"19\" viewBox=\"0 0 18 19\" fill=\"none\">\n                                <path d=\"M6.75 5L11.25 9.5L6.75 14\" stroke=\"#999999\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n                            </svg>\n                        </i>\n                 </button>\n         ")}},{key:"setEvent",value:function(){var a=this.$props.moveCompanyInfoPage,b=void 0===a?Mutil.noop:a;this.addEvent("click.stop",".js-inviter-li",function(a){var c=$(a.target).closest(".js-inviter-li"),d=c.attr("use-intt-id");(0,_store.addJoinUseInttId)(d),b()})}}])}(_SignUpComponent2.SignUpComponent);
168
169},{"../store.js":100,"./SignUpComponent.js":57}],57:[function(require,module,exports){
170"use strict";var _Component2=_interopRequireDefault(require("../../../core/Component.js"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SignUpComponent=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var SignUpComponent=exports.SignUpComponent=function(a){function b(a){var c,d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return(_classCallCheck(this,b),c=_callSuper(this,b),a instanceof jQuery?(c.$target=a[0],1<a.length&&console.warn("Multi Elements!")):c.$target=a,c.$props=d,c.setup(),!c.$target)?_possibleConstructorReturn(c):(c.render(),c.setEvent(),c)}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){var a=this.template();if(a){var b=this.$props,c=b.isAppend,d=b.isAfter,e=b.$posTarget,f=void 0===e?this.$target:e;return void 0!==c&&c?($(this.$target).append(a),void this.mounted()):void 0!==d&&d?(f.after(a),void this.mounted()):void(this.$target.innerHTML=a,this.mounted())}}},{key:"addEvent",value:function(a,b,c){"function"==typeof b&&(c=b,b=null);var d=_toConsumableArray(this.$target.querySelectorAll(b)),e=function c(a){return d.includes(a)||a.closest(b)},f=!1,g=!1;a.includes(".prevent")&&(a=a.replace(".prevent",""),f=!0),a.includes(".stop")&&(a=a.replace(".stop",""),g=!0);var h=function d(a){b&&!e(a.target)||(f&&a.preventDefault(),g&&a.stopPropagation(),c(a))};$(this.$target).find(b).on(a,h)}},{key:"interactiveFormFunc",value:function a(){var b=$(".js-interactive-form-wrap"),c=$(".js-interactive-form-wrap").children(".interactive-form-input"),d=$(".js-interactive-form-wrap").children("select.interactive-form-input");c.val()&&$(this).parent(b).addClass("interactive"),c.on("focusout",function(){$(this).val()?$(this).parent(b).addClass("interactive"):$(this).parent(b).removeClass("interactive")}),d.on("change",function(a){$(this).parent(b).addClass("interactive"),0===$(this).val().length&&$(this).parent(b).removeClass("interactive")})}}])}(_Component2.default);
171
172},{"../../../core/Component.js":28}],58:[function(require,module,exports){
173"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var init=function(a){render(a.target,a.renderOption,a.template)},render=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"html",c=2<arguments.length?arguments[2]:void 0,d=c();"prepend"===b&&a.prepend(d),"append"===b&&a.append(d),"before"===b&&a.before(d),"after"===b&&a.after(d),"html"===b&&a.html(d)},_default=exports.default={init:init};
174
175},{}],59:[function(require,module,exports){
176"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppleButton=void 0;var _SnSButton2=require("./SnSButton.js"),_store=require("../../store.js"),_index=require("../../../../bridge/renewal-signup/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
176function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var AppleButton=exports.AppleButton=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"setup",value:function(){this.$props.isRender=!!window.appleApiAvailable}},{key:"getButtonDataJson",value:function(){return{snsType:"apple",id:"appleLoginButton",className:"login-apple",buttonText:i18next.t(login.applestrt)}}},{key:"setEvent",value:function(){var a=this,b=this.getButtonDataJson(),c=b.id,d=b.snsType,f=Mutil.requireIIFE("AppleLogin");this.addEvent("click.prevent","#".concat(c),function(b){a.runSocialSignUpWithTermAgree(function(){return(0,_store.isWebView)()?void(0,_index.mobileOpenSocialSignUpPopup)({appName:d.toUpperCase()}):void f.clickAppleLoginButton(b)})})}}])}(_SnSButton2.SnSButton);
177
178},{"../../../../bridge/renewal-signup/index.js":4,"../../store.js":100,"./SnSButton.js":65}],60:[function(require,module,exports){
179"use strict";var _SnSButton2=require("./SnSButton.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.AzureButton=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var AzureButton=exports.AzureButton=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"setup",value:function(){this.$props.isRender=!!window.googleApiAvailable}},{key:"getButtonDataJson",value:function(){var a=this.$props.id,b=void 0===a?"azureSignUpButton":a;return{snsType:"azure",id:b,className:"login-azure",buttonText:i18next.t(login.microsoftsrt)}}},{key:"setEvent",value:function(){var a=this,b=this.getButtonDataJson(),c=b.id;this.addEvent("click.prevent","#".concat(c),function(){Often.isGlobal()&&GoogleTagManager.collect({event:"EV_mm_signup2_t",guestDate:Time.currentTime()}),a.runSocialSignUpWithTermAgree(function(){var a,b=requireModule("AzureOauth");
179null===(a=b())||void 0===a||a.Web.signUp()})}),this.replaceEmWithIcon()}},{key:"replaceEmWithIcon",value:function(){requestAnimationFrame(function(){var a=document.querySelector(".login-azure");if(a){var b=a.querySelector("em");if(b){var c=document.createElement("i");c.className="svg-sb-041",b.replaceWith(c)}}})}}])}(_SnSButton2.SnSButton),AzureOauth=requireModule("AzureOauth",{on:["signup"]});
180
181},{"./SnSButton.js":65}],61:[function(require,module,exports){
182"use strict";var _SignUpComponent2=require("../SignUpComponent.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmailButton=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var EmailButton=exports.EmailButton=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.id,c=void 0===b?"":b,d=a.buttonText,e=void 0===d?"":d;return"<a id = \"".concat(Mutil.n2v(c),"\" class=\"js-email-button next-page-link\" ><i class=\"icon-next-link\"></i>").concat(Mutil.n2v(e),"</a>")}},{key:"setEvent",value:function(){var a=this.$props.clickFunc,c=void 0===a?Mutil.noop:a;_superPropGet(b,"setEvent",this,3)([]),this.addEvent("click.prevent",".js-email-button",function(){"function"==typeof c&&c()})}}])}(_SignUpComponent2.SignUpComponent);
183
184},{"../SignUpComponent.js":57}],62:[function(require,module,exports){
185"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GoogleButton=void 0;var _SnSButton2=require("./SnSButton.js"),_store=require("../../store"),_index=require("../../../../bridge/renewal-signup/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
185function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var GoogleButton=exports.GoogleButton=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"setup",value:function(){this.$props.isRender=!!window.googleApiAvailable}},{key:"getButtonDataJson",value:function(){var a=this.$props.id,b=void 0===a?"googleLoginButton":a;return{snsType:"google",id:b,className:"login-google",buttonText:Often.isGlobal()?i18next.t(login.googlestrt):"Google\uB85C \uACC4\uC18D\uD558\uAE30"}}},{key:"setEvent",value:function(){var a=this,b=this.getButtonDataJson(),c=b.id,d=b.snsType,f=Mutil.requireIIFE("GoogleLogin");this.addEvent("click.prevent","#".concat(c),function(b){var c,e=e||requireModule("userTracker",{on:["signup"]})();null===e||void 0===e||null===(c=e.SignUpTracker())||void 0===c||c.track("google-sign-up"),a.runSocialSignUpWithTermAgree(function(){return(0,_store.isWebView)()?void(0,_index.mobileOpenSocialSignUpPopup)({appName:d.toUpperCase()}):void f.clickGoogleLoginButton(b)})})}}])}(_SnSButton2.SnSButton);
186
187},{"../../../../bridge/renewal-signup/index.js":4,"../../store":100,"./SnSButton.js":65}],63:[function(require,module,exports){
188"use strict";var _SignUpComponent2=require("../SignUpComponent.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.IconButton=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var IconButton=exports.IconButton=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.id,c=void 0===b?"":b,d=a.buttonText,e=void 0===d?"":d,f=a.desc,g=void 0===f?"":f;return"\n                <button id=\"".concat(c,"\" class=\"js-icon-button\">\n                    ").concat(this.getIconTemplate(),"\n                    <div>\n                        <em>").concat(e,"</em>\n                        ").concat(""===g?"":"<span>".concat(g,"</span>"),"\n                    </div>\n                    <i>\n                        <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"19\" viewBox=\"0 0 18 19\" fill=\"none\">\n                            <path d=\"M6.75 5L11.25 9.5L6.75 14\" stroke=\"#999999\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n                        </svg>\n                    </i>\n                </button>\n        ")}},{key:"getIconTemplate",value:function(){var a=this.$props.icon,b=void 0===a?"":a;return"plus"===b?this.plusIconTemplate():"clip"===b?this.clipIconTemplate():"person"===b?this.externalEmplTemplate():"company"===b?this.internalEmplTemplate():""}},{key:"plusIconTemplate",value:function(){return"\n            <i>\n                <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"34\" height=\"35\" viewBox=\"0 0 34 35\" fill=\"none\">\n                    <circle cx=\"17\" cy=\"17.5\" r=\"17\" fill=\"#9F00BA\"/>\n                    <path d=\"M17.0002 11.1207L17.0002 23.8795\" stroke=\"white\" stroke-width=\"1.7\" stroke-linecap=\"round\"/>\n                    <path d=\"M10.6217 17.4988L23.3759 17.4988\" stroke=\"white\" stroke-width=\"1.7\" stroke-linecap=\"round\"/>\n                </svg>\n            </i>\n        "}},{key:"clipIconTemplate",value:function(){return"\n            <i>\n                <svg width=\"34\" height=\"34\" viewBox=\"0 0 34 34\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                    <rect width=\"34\" height=\"34\" rx=\"17\" fill=\"#1ECDC3\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.8285 19.3039C10.8912 20.2411 10.8912 21.7607 11.8285 22.698C12.7657 23.6352 14.2853 23.6352 15.2226 22.698L17.4853 20.4352C17.7977 20.1228 18.3043 20.1228 18.6167 20.4352C18.9291 20.7477 18.9291 21.2542 18.6167 21.5666L16.3539 23.8294C14.7918 25.3915 12.2592 25.3915 10.6971 23.8294C9.13498 22.2673 9.13498 19.7346 10.6971 18.1725L12.9598 15.9098C13.2722 15.5973 13.7788 15.5973 14.0912 15.9098C14.4036 16.2222 14.4036 16.7287 14.0912 17.0411L11.8285 19.3039Z\" fill=\"white\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M18.9392 12.1922C19.8764 11.2549 21.396 11.2549 22.3333 12.1922C23.2705 13.1294 23.2705 14.649 22.3333 15.5863L20.0705 17.849C19.7581 18.1614 19.7581 18.668 20.0705 18.9804C20.383 19.2928 20.8895 19.2928 21.2019 
18818.9804L23.4647 16.7177C25.0268 15.1556 25.0268 12.6229 23.4647 11.0608C21.9026 9.49871 19.3699 9.49871 17.8078 11.0608L15.5451 13.3235C15.2326 13.636 15.2326 14.1425 15.5451 14.4549C15.8575 14.7673 16.364 14.7673 16.6764 14.4549L18.9392 12.1922Z\" fill=\"white\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M14.5768 19.9504C14.2644 19.6379 14.2644 19.1314 14.5768 18.819L18.4558 14.94C18.7682 14.6276 19.2747 14.6276 19.5872 14.94C19.8996 15.2524 19.8996 15.759 19.5872 16.0714L15.7082 19.9504C15.3957 20.2628 14.8892 20.2628 14.5768 19.9504Z\" fill=\"white\"/>\n                </svg>\n            </i>\n        "}},{key:"externalEmplTemplate",value:function(){return"\n            <i>\n                <svg width=\"34\" height=\"34\" viewBox=\"0 0 34 34\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                    <circle cx=\"17\" cy=\"17.5\" r=\"17\" fill=\"#520060\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.9828 17.6536C18.4247 17.6536 19.5936 16.4847 19.5936 15.0428C19.5936 13.6009 18.4247 12.432 16.9828 12.432C15.5409 12.432 14.372 13.6009 14.372 15.0428C14.372 16.4847 15.5409 17.6536 16.9828 17.6536ZM16.9828 19.2536C19.3083 19.2536 21.1936 17.3684 21.1936 15.0428C21.1936 12.7173 19.3083 10.832 16.9828 10.832C14.6572 10.832 12.772 12.7173 12.772 15.0428C12.772 17.3684 14.6572 19.2536 16.9828 19.2536Z\" fill=\"white\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.9829 19.6273C13.825 19.6273 11.4667 21.8234 11.4667 24.3008C11.4667 24.7426 11.1085 25.1008 10.6667 25.1008C10.2249 25.1008 9.8667 24.7426 9.8667 24.3008C9.8667 20.7324 13.1641 18.0273 16.9829 18.0273C20.8017 18.0273 24.0991 20.7324 24.0991 24.3008C24.0991 24.7426 23.7409 25.1008 23.2991 25.1008C22.8573 25.1008 22.4991 24.7426 22.4991 24.3008C22.4991 21.8234 20.1408 19.6273 16.9829 19.6273Z\" fill=\"white\"/>\n                </svg>\n            </i>\n        "}},{key:"internalEmplTemplate",value:function(){return"\n            <i>\n                <svg width=\"34\" height=\"34\" viewBox=\"0 0 34 34\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                    <g clip-path=\"url(#clip0_5370_1745)\">\n                    <circle cx=\"17\" cy=\"17.5\" r=\"17\" fill=\"#9F00BA\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.9999 13.0312H21.9999C23.5739 13.0312 24.8499 14.3072 24.8499 15.8812V24.8437C24.8499 26.4177 23.5739 27.6937 21.9999 27.6937H11.9999C10.4259 27.6937 9.1499 26.4177 9.1499 24.8437V15.8812C9.1499 14.3072 10.4259 13.0312 11.9999 13.0312ZM11.9999 14.6313C11.3095 14.6313 10.7499 15.1909 10.7499 15.8812V24.8437C10.7499 25.534 11.3095 26.0937 11.9999 26.0937H21.9999C22.6903 26.0937 23.2499 25.534 23.2499 24.8437V15.8812C23.2499 15.1909 22.6903 14.6313 21.9999 14.6313H11.9999Z\" fill=\"white\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.4497 12.4992C12.4497 11.367 13.3675 10.4492 14.4997 10.4492H19.4997C20.6319 10.4492 21.5497 11.367 21.5497 12.4992V13.407C21.5497 13.8489 21.1915 14.207 20.7497 14.207C20.3079 14.207 19.9497 13.8489 19.9497 13.407V12.4992C19.9497 12.2507 19.7482 12.0492 19.4997 12.0492H14.4997C14.2512 12.0492 14.0497 12.2507 14.0497 12.4992V13.407C14.0497 13.8489 13.6915 14.207 13.2497 14.207C12.8079 14.207 12.4497 13.8489 12.4497 13.407V12.4992Z\" fill=\"white\"/>\n                    <path d=\"M12.752 17.7344C12.752 17.4582 12.9758 17.2344 13.252 17.2344H15.752C16.0281 17.2344 16.252 17.4582 16.252 17.7344V19.2344C16.252 19.5105 16.0281 19.7344 15.752 19.7344H13.252C12.9758 19.7344 12.752 19.5105 12.752 19.2344V17.7344Z\" fill=\"white\"/>\n                    <path d=\"M12.752 21.4844C12.752 21.2082 12.9758 20.9844 13.252 20.9844H15.752C16.0281 20.9844 16.252 21.2082 16.252 21.4844V22.9844C16.252 23.2605 16.0281 23.4844 15.752 23.4844H13.252C12.9758 23.4844 12.752 23.2605 12.752 22.9844V21.4844Z\" fill=\"white\"/>\n                    <path d=\"M17.752 17.7344C17.752 17.4582 17.9758 17.2344 18.252 17.2344H20.752C21.0281 17.2344 21.252 17.4582 21.252 17.7344V19.2344C21.252 19.5105 21.0281 19.7344 20.752 19.7344H18.252C17.9758 19.7344 17.752 19.5105 17.752 19.2344V17.7344Z\" fill=\"white\"/>\n                    <path d=\"M17.752 21.4844C17.752 21.2082 17.9758 20.9844 18.252 20.9844H20.752C21.0281 20.9844 21.252 21.2082 21.252 21.4844V22.9844C21.252 23.2605 21.0281 23.4844 20.752 23.4844H18.252C17.9758 23.4844 17.752 23.2605 17.752 22.9844V21.4844Z\" fill=\"white\"/>\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.9494 11.8164C16.5076 11.8164 16.1494 11.4582 16.1494 11.0164L16.1494 8.53437C16.1494 8.09255 16.5076 7.73437 16.9494 7.73437C17.3912 7.73437 17.7494 8.09255 17.7494 8.53437L17.7494 11.0164C17.7494 11.4582 17.3912 11.8164 16.9494 11.8164Z\" fill=\"white\"/>\n                    </g>\n                    <defs>\n                    <clipPath id=\"clip0_5370_1745\">\n                    <rect y=\"0.5\" width=\"34\" height=\"34\" rx=\"17\" fill=\"white\"/>\n                    </clipPath>\n                    </defs>\n                </svg>\n            </i>\n        "}},{key:"setEvent",value:function(){var a=this.$props,c=a.id,d=void 0===c?"":c,e=a.click
188Func,f=void 0===e?Mutil.noop:e;_superPropGet(b,"setEvent",this,3)([]);var g=Mutil.empty(d)?".js-icon-button":"#".concat(d);this.addEvent("click.prevent",g,function(){"function"==typeof f&&f()})}}])}(_SignUpComponent2.SignUpComponent);
189
190},{"../SignUpComponent.js":57}],64:[function(require,module,exports){
191"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.KakaoButton=void 0;var _SnSButton2=require("./SnSButton.js"),_store=require("../../store.js"),_index=require("../../../../bridge/renewal-signup/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var KakaoButton=exports.KakaoButton=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"setup",value:function(){this.$props.isRender=!!window.kakaoApiAvailable}},{key:"getButtonDataJson",value:function(){return{snsType:"kakao",id:"kakaoLoginButton",className:"login-kakao ",buttonText:i18next.t(login.kakaosrt)}}},{key:"setEvent",value:function(){var a=this,b=this.getButtonDataJson(),c=b.id,d=b.snsType,f=Mutil.requireIIFE("KakaoLogin");this.addEvent("click.prevent","#".concat(c),function(b){a.runSocialSignUpWithTermAgree(function(){return(0,_store.isWebView)()?void(0,_index.mobileOpenSocialSignUpPopup)({appName:d.toUpperCase()}):void f.clickKakaoLoginButton(b)})})}}])}(_SnSButton2.SnSButton);
192
193},{"../../../../bridge/renewal-signup/index.js":4,"../../store.js":100,"./SnSButton.js":65}],65:[function(require,module,exports){
194"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SnSButton=void 0;var _store=require("../../store.js"),_index=require("../../util/view-changer/index.js"),_SignUpComponent2=require("../SignUpComponent.js"),_index2=require("../../../../bridge/renewal-signup/index.js"),_TermAgreePopup=require("../popup/TermAgreePopup.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
194function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var SnSButton=exports.SnSButton=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"runSocialSignUpWithTermAgree",value:function(a){new _TermAgreePopup.TermAgreePopup($("body"),{isAppend:!0,onAgree:function(b){var c=b.marketingYn;(0,_store.addMarketingYn)(c),a()}})}},{key:"render",value:function(){var a=this.$props.isRender;(void 0===a||a)&&_superPropGet(b,"render",this,3)([])}},{key:"template",value:function(){var a=this.$props.type,b=void 0===a?"a":a,c=this.getButtonDataJson(),d=c.id,e=void 0===d?"":d,f=c.className,g=void 0===f?"":f,h=c.buttonText,i=void 0===h?"":h,j=c.snsType,k=void 0===j?"SNS":j;return"a"===b?"<a id=\"".concat(e,"\" class =\"").concat(g," cursor-pointer js-sns-signup-btn\"><em></em><span>").concat(i,"</span></a>"):"<button id=\"".concat(e,"\" class=\"").concat(g,"  start-").concat(k.toLowerCase(),"-button cursor-pointer js-sns-signup-btn\"><em></em><span>").concat(i,"</span></button>")}},{key:"getButtonDataJson",value:function(){return{snsType:"",id:"",className:"",buttonText:"SNS \uD68C\uC6D0 \uAC00\uC785 \uACC4\uC815\uC73C\uB85C \uC2DC\uC791\uD558\uAE30"}}}])}(_SignUpComponent2.SignUpComponent);
195
196},{"../../../../bridge/renewal-signup/index.js":4,"../../store.js":100,"../../util/view-changer/index.js":108,"../SignUpComponent.js":57,"../popup/TermAgreePopup.js":93}],66:[function(require,module,exports){
197"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _store=require("../../store.js"),MarketingAgreementCheckbox=function(a){var b,c={US:"US",KOREA:"KR"},d="marketing-checkbox",e=function a(){return window._CLIENT_REGION||c.KOREA},f=function a(){return e()===c.US},g=i18next.t(login.marketingUS,{termsOfService:"<a href=\"/terms\" target=\"_blank\">".concat(i18next.t(dictionary.termsOfService),"</a>"),privacyPolicy:"<a href=\"/terms\" target=\"_blank\">".concat(i18next.t(dictionary.privacyPolicy),"</a>"),interpolation:{escapeValue:!1}}),h=i18next.t(login.marketingOtherCountry,{termsOfService:"<a href=\"/terms\" target=\"_blank\">".concat(i18next.t(dictionary.termsOfService),"</a>"),privacyPolicy:"<a href=\"/privacy\" target=\"_blank\">".concat(i18next.t(dictionary.privacyPolicy),"</a>"),interpolation:{escapeValue:!1}}),i="<div class=\"link-wrap\">".concat(f()?g:h,"<div>"),j="\n\t\t<div class=\"check-wrap\">\n\t\t\t<label class=\"labelSelectSquareS\">\n\t\t\t\t<input type=\"checkbox\" id=\"".concat(d,"\">\n\t\t\t\t<i></i>\n\t\t\t\t<span>").concat(i18next.t(login.marketingAdminOtherCountry),"</span>\n\t\t\t</label>\n\t\t</div>\n\t"),k=function a(){LocalUtil.setLocal("temporaryDataForMarketing","Y")},l=function c(){var d=f(),e=d?"Y":"N";k(),"module"===a&&(0,_store.addMarketingYn)(e),b=e},m=function d(c){var e=c.target.checked?"Y":"N";"module"===a&&(0,_store.addMarketingYn)(e),b=e},n=function a(){var b=document.getElementById(d);b&&b.addEventListener("change",m)},o=function a(){return b};return{init:function a(){l()},render:function a(){return Often.isGlobal()?f()?i:(setTimeout(n,0),i+j):""},getState:o}},_default=exports.default=MarketingAgreementCheckbox;
198
199},{"../../store.js":100}],67:[function(require,module,exports){
200"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _store=require("../../store.js"),_PhoneAuthInput=_interopRequireDefault(require("../../util/phone-auth/PhoneAuthInput.js")),_inputValidation=require("../../util/input-validate/inputValidation.js"),_index=require("../../util/view-changer/index.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
200q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var PhoneAuth=function a(){var b=void 0,c=function b(a){e(a.target,a.renderOption),f(a.target)},d=function a(){return"\n            <div>\n                <div class=\"js-interactive-form-wrap interactive-form-wrap\">\n                    <input \n                        id=\"phoneNumberInput\"\n                        class=\"interactive-form-input join-phone-input\"\n                        type=\"text\"\n                        inputmode=\"numeric\"\n                        maxlength=\"20\"\n                        pattern=\"[0-9\\+\\-]\"\n                        tabindex=\"3\"\n                        autocomplete=\"off\"\n                        placeholder=\"\"\n                    />\n                    <span class=\"interactive-form-placeholder\">".concat(i18next.t(dictionary.phoneNumber),"</span>\n                </div>\n                <button class=\"js-phone-auth-button phone-confirm-button new-pp-btn\" disabled>\n                    ").concat(i18next.t(dictionary.verify),"\n                </button>\n            </div>\n            <div class=\"js-phone-error-wrap error-txt-wrap\">\n                <span class=\"error-text\">").concat(i18next.t(main.phoneNumber.checkPhoneNumber),"</span>\n            </div>\n            <div class=\"js-auth-code-wrap phone-auth-wrap\" style=\"display: none;\">\n                <div class=\"js-interactive-form-wrap interactive-form-wrap auth-num-input-wrap\">\n                    <input\n                        id=\"authCodeInput\"\n                        class=\"interactive-form-input phone-certi-input\"\n                        type=\"text\"\n                        inputmode=\"numeric\"\n                        maxlength=\"6\"\n                        pattern=\"[0-9]\"\n                        tabindex=\"4\"\n                        autocomplete=\"off\"\n                        placeholder=\"\"\n                    />\n                    <span class=\"interactive-form-placeholder\">").concat(i18next.t(common.confirmVerificationCode),"</span>
200\n                    <span class=\"js-counter-remaining auth-counter\">00:00</span>\n                </div>\n                <div class=\"js-counter-wrap count-wrap\">\n                    <span class=\"js-counter-message\">").concat(i18next.t(main.verificationSent),"</span>\n                </div>\n            </div>\n        ")},e=function b(a){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"html",e=d();"prepend"===c&&a.prepend(e),"append"===c&&a.append(e),"before"===c&&a.before(e),"after"===c&&a.after(e),"html"===c&&a.html(e)},f=function c(a){var d=a.find("#phoneNumberInput"),f=a.find(".js-phone-auth-button"),k=a.find(".js-phone-error-wrap"),l=a.find(".js-auth-code-wrap"),m=a.find("#authCodeInput"),n=a.find(".js-counter-wrap"),o=a.find(".js-counter-message"),p=a&&"function"==typeof a.closest?a.closest("section"):$(),q=p;if(!q.length){var r=_index.SignUpViewChanger.getViewId(),s="userProfileInput"===r?"profileInputSection":"companyJoin"===r?"companyJoinSection":"invitationUserFormSection";q=$("#".concat(s))}var t=q.find(".js-next-page-button"),u=!1,v=function a(){k.show(),d.closest(".js-interactive-form-wrap").addClass("status-error")};d.on({keyPress:function b(a){PhoneNumKeyEvent.validNumOnKeypress(a)},keyup:function c(a){var e=new Set(["Enter","NumpadEnter"]);return e.has(a.code)&&"disabled"!==f.attr("disabled")?void f.trigger("click"):(PhoneNumKeyEvent.validNumOnKeyUp(a),f.text(i18next.t(dictionary.verify)),l.hide(),n.hide(),t.attr("disabled",!0),"undefined"!=typeof b&&b.reset(),""===a.target.value)?(k.hide(),f.attr("disabled",!0),void d.closest(".js-interactive-form-wrap").removeClass("interactive status-error")):(d.closest(".js-interactive-form-wrap").addClass("interactive"),g(a.target.value,10,20)?(k.hide(),f.attr("disabled",!1),void d.closest(".js-interactive-form-wrap").removeClass("status-error")):void(f.attr("disabled",!0),u&&v()))}}),d.on("focusout",function(){var a=d.val();""===a||g(a,10,20)||(u=!0,v())}),f.on("click",function(a){var c=q.find(".js-join-input");_inputValidation.InputValidator.inputsValidate(c)&&(m.val(""),f.text(i18next.t(dictionary.resend)),"undefined"!=typeof b&&b.reset(),b=(0,_PhoneAuthInput.default)({userId:(0,_store.getUserId)(),phoneNumber:d.val(),deviceData:Often.getDeviceJson(_CLIENT_IP),timeLimit:"3",$confirmButton:t}),b.init(),l.show(),n.show(),m.focus())}),m.on({keypress:i,keyup:function b(a){var c=new Set(["Enter","NumpadEnter"]);if(c.has(a.code))return void t.trigger("click");h(a),m.closest(".js-interactive-form-wrap").removeClass("status-error");var d=m.val();return""===d?(t.attr("disabled",!0),void m.closest(".js-interactive-form-wrap").removeClass("interactive")):(m.closest(".js-interactive-form-wrap").addClass("interactive"),j(d)?void t.attr("disabled",!1):void t.attr("disabled",!0))},input:function b(a){$(a.target).trigger("keyup")}})},g=function d(a,b,c){var e="";"undefined"!=typeof b&&(e="undefined"==typeof c?"{".concat(b,",}"):"{".concat(b,",").concat(c,"}"));var f=new RegExp("^[+\\-0-9]".concat(e,"$"));return f.test(a)},h=function b(a){var c=a.target.value,d=new RegExp(/^[0-9]$/);d.test(c)||$(a.target).val(c.replace(/[^0-9]/g,""))},i=function b(a){var c=a.which||a.keyCode,d=new Set([8,9,13,16,17,39,46,187]),e=a.ctrlKey||d.has(c),f=48<=c&&57>=c;f||e||a.preventDefault()},j=function b(a){var c=new RegExp(/^[0-9]{6}$/);return c.test(a)},k=function a(){var b=$("#phoneNumberInput"),c=$("#authCodeInput"),d=b.val(),e=c.val();return 0!==d.length&&g(d,10,20)?void((0===e.length||!j(e))&&c.focus()):void b.focus()},l=function(){var a=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,b.confirm();case 1:return a.a(2,a.v)}},a)}));return function b(){return a.apply(this,arguments)}}(),m=function a(){b.reset()};return{init:c,validatePhoneAuthInputs:k,verifyAuthCode:l,stopCounter:m}},_default=exports.default=PhoneAuth;
201
202},{"../../store.js":100,"../../util/input-validate/inputValidation.js":104,"../../util/phone-auth/PhoneAuthInput.js":105,"../../util/view-changer/index.js":108}],68:[function(require,module,exports){
203"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyNameInput=void 0;var _Input2=require("./Input.js"),_index=require("../../util/input-error-handler/index.js"),_inputValidation=require("../../util/input-validate/inputValidation.js"),_constant=require("../../constant.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
203function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyNameInput=exports.CompanyNameInput=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.addClassName,b=void 0===a?"":a;return"\n            <div class=\"interactive-form-wrap js-interactive-form-wrap\">\n                <input type=\"text\"\n                        autocomplete=\"off\"\n                          id=\"teamNameInput\"\n                           class=\"js-name-input interactive-form-input ".concat(b,"\"\n                           placeholder=\"\"\n                           data-required-yn=\"Y\"\n                           maxlength=\"50\" \n                           data-over-msg=\"").concat(i18next.t(login.inputAlert,{val:50}),"\"\n                           data-empty-msg=\" ").concat(i18next.t(login.common.enter,{val:$t(login.companyName)}),"\"\n                           data-valid=\"name\"\n                           data-un-valid-msg=\"").concat(i18next.t(login.recheckCompanyName),"\">\n                <span class=\"interactive-form-placeholder\">").concat(i18next.t(login.companyName),"</span>\n            </div>\n            <p class=\"error-txt-wrap\">\n                <span class=\"js-error-txt\"></span>\n            </p>\n            ")}},{key:"getInputSelector",value:function(){return"#teamNameInput"}},{key:"getSubDomain",value:function(){var a=this.getInputValue();if(!Mutil.empty(a)){var b=_inputValidation.InputValidator.isValidTeamUrl(a);return b?a:_constant.DEFAULT_SUB_DOMAIN}}}])}(_Input2.Input);
204
205},{"../../constant.js":98,"../../util/input-error-handler/index.js":102,"../../util/input-validate/inputValidation.js":104,"./Input.js":71}],69:[function(require,module,exports){
206"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmailAuthInput=void 0;var _Input2=require("./Input.js"),_index=require("../../util/input-error-handler/index.js"),_inputValidation=require("../../util/input-validate/inputValidation.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");
206if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var EmailAuthInput=exports.EmailAuthInput=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"setup",value:function a(){_superPropGet(b,"setup",this,3)([]),this.$props.timer=null,this.$props.NOT_NUMERIC_REG=/\D/g}},{key:"template",value:function a(){var b=this.$props,c=b.addClassName,d=void 0===c?"":c,e=b.inputId,f=void 0===e?"authNumberInput":e;return"\n            <div class=\"auth-num-row\">\n                <div id=\"emailAuthInputLayer\" class=\"auth-num-input-wrap interactive-form-wrap js-interactive-form-wrap\">\n                     <input id=\"".concat(f,"\"\n                          type=\"text\"\n                           inputmode=\"numeric\"\n                           class=\"").concat(d," interactive-form-input\"\n                           data-valid=\"number\"\n                           data-required-yn='Y'\n                           data-empty-msg=\"").concat(i18next.t(main.alert.enterWord,{val:$t(common.confirmVerificationCode)}),"\"\n                           pattern=\"[0-9]\"\n                           data-un-valid-msg=\"").concat(i18next.t(common.enterDigitOnly),"\"\n                           placeholder=\"\"\n                           autocomplete=\"off\"\n                           minlength=\"6\"\n                           maxlength=\"6\">
206\n                           <span class=\"interactive-form-placeholder\">").concat(i18next.t(common.inputValue,{val:$t(common.confirmVerificationCode)}),"</span>\n                           <span id=\"authCounter\" class=\"auth-counter\" style=\"display: none\"></span>\n                   </div>\n                   <button id=\"resendAuthCheckBtn\" class=\"BasicL_Face\">").concat(i18next.t(dictionary.resend),"</button>\n            </div>\n              <p class=\"error-txt-wrap\">\n                <span class = \"js-error-txt\">").concat(i18next.t(main.alert.verificationNotMatch),"</span>\n              </p>")}},{key:"mounted",value:function a(){$(this.getInputSelector()).focus()}},{key:"getInputSelector",value:function a(){var b=this.$props.inputId,c=void 0===b?"authNumberInput":b;return"#".concat(c)}},{key:"setEvent",value:function a(){var b=this,c=this.$props.sendEmail,d=void 0===c?Mutil.noop:c;this.addEvent("keyup",this.getInputSelector(),this.keyUpEventHandlerOfInput.bind(this)),this.addEvent("input",this.getInputSelector(),function(a){var c=b.get$Input().val();b.addAuthNumber(c)}),this.addEvent("click","#resendAuthCheckBtn",function(){var a=_asyncToGenerator(_regenerator().m(function c(a){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:_index.InputErrorHandler.unActiveErrorModeAboutInput($("#emailAuthInputLayer")),d(),b.get$Input().val("");case 1:return a.a(2)}},c)}));return function(b){return a.apply(this,arguments)}}()),this.interactiveFormFunc()}},{key:"addAuthNumber",value:function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",c=$("".concat(this.getInputSelector()));c.val(b.replace(this.$props.NOT_NUMERIC_REG,""))}},{key:"keyUpEventHandlerOfInput",value:function b(a){var c=this.$props,d=c.isLast,e=void 0!==d&&d,f=c.submit,g=void 0===f?Mutil.noop:f;if(!Mutil.isAvailableKeyCode(a))return(_index.InputErrorHandler.unActiveErrorModeAboutInput($("#emailAuthInputLayer")),e&&Mutil.isKey(a,"ENTER"))?void g():void 0}},{key:"inputValidate",value:function a(){var b=$("".concat(this.getInputSelector())),c=b.parent(),d=_inputValidation.InputValidator.getInputErrorJson(b),e=0<Object.values(d).length;return e?(_index.InputErrorHandler.activeErrorModeAboutInputTempLayer(c,d.errorMessage),!1):(_index.InputErrorHandler.unActiveErrorModeAboutInputTempLayer(c),Mutil.mlog("\uC778\uC99D \uBC88\uD638 \uC785\uB825 \uD0DC\uADF8 \uD0C0\uB2F9\uC131 \uAC80\uC0AC ".concat(e?"\uC2E4\uD328!":"\uC131\uACF5!"," >> ").concat($(b).val())),!0)}},{key:"startCounter",value:function b(a){function c(){var a=new Date,b=d-a,c=0>b,e=$("#emailAuthInputLayer");if(c)return clearInterval(i),void _index.InputErrorHandler.activeErrorModeAboutInput(e,i18next.t(main.alert.verificationExpired));var f=!e.is(":visible");if(f)return void clearInterval(i);var g=Math.floor(b%3600000/60000),j=Math.floor(b%60000/1000);10>j&&(j="0"+j),h.text(g+":"+j)}null!==this.$props.timer&&clearInterval(this.$props.timer);var d=new Date;d.setMinutes(d.getMinutes()+ +a);var e=1e3,f=60000,g=60*f,h=$("#authCounter");h.css("display","block");var i=setInterval(c,1e3);this.$props.timer=i,h.data("timer",i)}}])}(_Input2.Input);
207
208},{"../../util/input-error-handler/index.js":102,"../../util/input-validate/inputValidation.js":104,"./Input.js":71}],70:[function(require,module,exports){
209"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmailInput=void 0;var _Input2=require("./Input.js"),_index=require("../../util/input-error-handler/index.js"),_inputValidation=require("../../util/input-validate/inputValidation.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
209function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var EmailInput=exports.EmailInput=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.addClass,c=void 0===b?"":b,d=a.inputId,e=void 0===d?"emailInput":d,f=a.emailValue,g=void 0===f?"":f,h=Mutil.exist(g);return"\n            <div class=\"interactive-form-wrap js-interactive-form-wrap ".concat(h?"interactive":"","\">\n                <input id=\"").concat(e,"\"\n                                    type=\"text\" placeholder=\"\"\n                                    autocomplete=\"off\"\n                                    data-required-yn='Y' \n                                    data-uppercase-yn = 'N'\n                                    maxlength=\"50\"  \n                                    data-valid=\"email\"\n                                    value=\"\"\n                                    data-in-valid-letter-case-msg = \"").concat(i18next.t(common.capitalOnly,{val:$t(dictionary.email)}),"\"\n                                    data-empty-msg=\"").concat(i18next.t(login.common.enter,{val:$t(dictionary.email)}),"\"  \n                                    data-un-valid-msg=\"").concat(i18next.t(login.invalidEmail),"\"  class=\"").concat(c," company-email-input interactive-form-input\">\n                <span class=\"interactive-form-placeholder\">").concat(i18next.t(common.companyEmail),"</span>\n            </div>\n            <p class=\"error-txt-wrap\">\n                <span class=\"js-error-txt\"></span>\n            </p>")}},{key:"mounted",value:function(){var a=this.$props.emailValue,b=void 0===a?"":a;this.get$Input().focus(),Mutil.empty(b)||this.get$Input().val(b.toLowerCase())}},{key:"getInputSelector",value:function(){var a=this.$props.inputId,b=void 0===a?"emailInput":a;return"#".concat(b)}},{key:"keyUpEventHandlerOfInput",value:function(a){var b=this.$props,c=b.isLast,d=b.submit,e=void 0===d?Mutil.noop:d;if(!Mutil.isAvailableKeyCode(a)){if(void 0!==c&&c&&Mutil.isKey(a,"ENTER"))return void e();var f=$("#emailInput");_index.InputErrorHandler.removeBlank(f),_index.InputErrorHandler.unActiveErrorModeAboutInput(f),this.changeUpperCase()}}},{key:"changeUpperCase",value:function(){var a=$("#emailInput");_inputValidation.InputValidator.checkContainUpperCase(a.val())&&(_index.InputErrorHandler.changeUpperCase2Lowercase(a),_index.InputErrorHandler.activeErrorModeAboutInput(a,i18next.t(common.capitalOnly,{val:$t(dictionary.email)})))}}])}(_Input2.Input);
210
211},{"../../util/input-error-handler/index.js":102,"../../util/input-validate/inputValidation.js":104,"./Input.js":71}],71:[function(require,module,exports){
212"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Input=void 0;var _SignUpComponent2=require("../SignUpComponent.js"),_inputValidation=require("../../util/input-validate/inputValidation.js"),_index=require("../../util/input-error-handler/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
212function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var Input=exports.Input=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"setEvent",value:function(){var a=this;this.addEvent("keyup",this.getInputSelector(),this.keyUpEventHandlerOfInput.bind(this)),this.addEvent("focusout",this.getInputSelector(),function(){Mutil.empty(a.get$Input().val())||!a.inputValidate()&&(a._errorShown=!0)}),this.interactiveFormFunc()}},{key:"getInputSelector",value:function(){return"input"}},{key:"keyUpEventHandlerOfInput",value:function(a){var b=this.$props,c=b.isLast,d=b.submit,e=void 0===d?Mutil.noop:d,f=b.allowBlank,g=$(a.target);if(!Mutil.isAvailableKeyCode(a)){void 0===f||f||_index.InputErrorHandler.removeBlank(g);var h=void 0!==c&&c&&Mutil.isKey(a,"ENTER");return(this._errorShown||h)&&!this.inputValidate()?void(this._errorShown=!0):void(h&&e())}}},{key:"getInputValue",value:function(){return this.get$Input().val()}},{key:"get$Input",value:function(){return $(this.getInputSelector())}},{key:"inputValidate",value:function(){return _inputValidation.InputValidator.inputValidate(this.get$Input())}}])}(_SignUpComponent2.SignUpComponent);
213
214},{"../../util/input-error-handler/index.js":102,"../../util/input-validate/inputValidation.js":104,"../SignUpComponent.js":57}],72:[function(require,module,exports){
215"use strict";var _Input2=require("./Input.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.NameInput=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var NameInput=exports.NameInput=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.addClassName,c=void 0===b?"":b,d=a.value,e=void 0===d?"":d,f=Mutil.exist(e);return"\n            <div class=\"interactive-form-wrap js-interactive-form-wrap ".concat(f?"interactive":"","\">\n                <input type=\"text\"\n                    autocomplete=\"off\"\n                    id=\"joinUserName\"\n                    class=\"js-name-input join-name-input interactive-form-input ").concat(c,"\"\n                    placeholder=\"\"\n                    data-required-yn=\"Y\"\n                    maxlength=\"").concat(Often.isGlobal()?80:20,"\"\n                    data-valid=\"n
215ame\"\n                    data-empty-msg=\"").concat(i18next.t(login.common.enter,{val:$t(dictionary.name)}),"\"\n                    data-un-valid-msg=\"").concat(i18next.t(login.recheckName),"\"\n                    tabindex=\"1\"\n                    data-over-msg=\"").concat(i18next.t(login.inputAlert,{val:Often.isGlobal()?80:20}),"\"\n                />\n                <span class=\"interactive-form-placeholder\">").concat(i18next.t(login.enterName),"</span>\n            </div>\n            <p class=\"error-txt-wrap\">\n                <span class=\"js-error-txt\"></span>\n            </p>\n        ")}},{key:"mounted",value:function(){var a=this.$props,b=a.value,c=void 0===b?"":b,d=a.autoFocus;(void 0===d||d)&&this.get$Input().focus(),Mutil.empty(c)||this.get$Input().val(c)}},{key:"getInputSelector",value:function(){return"#joinUserName"}}])}(_Input2.Input);
216
217},{"./Input.js":71}],73:[function(require,module,exports){
218"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.PasswordInput=void 0;var _Input2=require("./Input.js"),_index=require("../../util/input-error-handler/index.js"),_inputValidation=require("../../util/input-validate/inputValidation.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var PasswordInput=exports.PasswordInput=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.addClassName,b=void 0===a?"":a;return"\n            <div class=\"interactive-form-wrap js-interactive-form-wrap\">
218\n                <button id=\"viewPasswordBtn\" type=\"button\" class=\"password-view-button js-view-button\" style=\"\"></button>\n                <input id=\"password\"\n                    type=\"password\"\n                    class=\"join-password-input js-join-password interactive-form-input ".concat(b,"\"\n                    placeholder=\"\"\n                    autocomplete=\"off\"\n                    data-required-yn=\"Y\"\n                    minlength=\"8\"\n                    maxlength=\"20\"\n                    data-valid=\"password\"\n                    tabindex=\"2\"\n                    data-empty-msg=\"").concat(i18next.t(login.common.enter,{val:$t(dictionary.password)}),"\"\n                    data-over-msg=\"").concat(i18next.t(login.passwordWarning),"\" \n                    data-under-msg=\"").concat(i18next.t(login.passwordWarning),"\" \n                    data-un-valid-msg=\"").concat(i18next.t(login.passwordWarning),"\"\n                />\n                <span class=\"interactive-form-placeholder\">").concat(i18next.t(dictionary.password),"</span>\n            </div>\n            <p class=\"error-txt-wrap\">\n                <span class=\"js-error-txt\"></span>\n            </p>\n        ")}},{key:"setEvent",value:function(){_superPropGet(b,"setEvent",this,3)([]);var a=Mutil.isMobile()||Mutil.isTablet();return a?void this.addEvent("mousedown","#viewPasswordBtn",this.togglePasswordBtn.bind(this)):void(this.addEvent("mousedown","#viewPasswordBtn",this.showPassword.bind(this)),this.addEvent("mouseup","#viewPasswordBtn",this.hidePassword.bind(this)))}},{key:"getInputSelector",value:function(){return"#password"}},{key:"togglePasswordBtn",value:function(){var a=$("#viewPasswordBtn");return a.hasClass("on")?(a.removeClass("on"),void this.hidePassword()):void(a.addClass("on"),this.showPassword())}},{key:"showPassword",value:function(){$(this.getInputSelector()).attr("type","text")}},{key:"hidePassword",value:function(){$(this.getInputSelector()).attr("type","password")}},{key:"keyUpEventHandlerOfInput",value:function(a){var b=this.$props,c=b.isLast,d=b.submit,e=void 0===d?Mutil.noop:d,f=b.allowBlank,g=$(a.target);if(!Mutil.isAvailableKeyCode(a)){void 0===f||f||_index.InputErrorHandler.removeBlank(g),this.togglePasswordViewButton();var h=void 0!==c&&c&&Mutil.isKey(a,"ENTER");return(this._errorShown||h)&&!this.inputValidate()?void(this._errorShown=!0):void(h&&e())}}},{key:"togglePasswordViewButton",value:function(){var a=this.getInputValue(),b=$("#viewPasswordBtn");0===a.length?b.css("display","none"):b.css("display","block")}}])}(_Input2.Input);
219
220},{"../../util/input-error-handler/index.js":102,"../../util/input-validate/inputValidation.js":104,"./Input.js":71}],74:[function(require,module,exports){
221"use strict";var _Input2=require("./Input.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.PhoneNumberInput=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
221function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var PhoneNumberInput=exports.PhoneNumberInput=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.addClassName,c=void 0===b?"":b,d=a.inputId,e=void 0===d?"phoneNumberInput":d,f=a.phoneNumber,g=void 0===f?"":f,h=Mutil.exists(g);return"\n            <div class=\"js-interactive-form-wrap interactive-form-wrap ".concat(h?"interactive":"","\">\n                <input \n                    id=\"").concat(e,"\"\n                    class=\"interactive-form-input ").concat(c,"\"\n                    type=\"text\"\n                    inputmode=\"numeric\"\n                    maxlength=\"17\"\n                    pattern=\"[0-9\\+\\-]\"\n                    tabindex=\"3\"\n                    autocomplete=\"off\"\n                    placeholder=\"\"\n                    data-valid=\"phoneNumber\"\n                    data-required-yn=\"Y\"\n                    data-empty-msg=\"").concat(i18next.t(login.common.enter,{val:$t(dictionary.phoneNumber)}),"\"\n                    data-un-valid-msg=\"").concat(i18next.t(main.phoneNumber.checkPhoneNumber),"\"\n                />\n                <span class=\"interactive-form-placeholder\">").concat(i18next.t(dictionary.phoneNumber),"</span>\n            </div>\n            <p class=\"error-txt-wrap\">\n                <span class=\"js-error-txt\"></span>\n            </p>\n        ")}},{key:"getInputSelector",value:function(){var a=this.$props.inputId,b=void 0===a?"phoneNumberInput":a;return"#".concat(b)}},{key:"keyUpEventHandlerOfInput",value:function(a){var b=this.$props,c=b.isLast,d=b.submit,e=void 0===d?Mutil.noop:d;Mutil.isAvailableKeyCode(a)||!this.inputValidate()||void 0!==c&&c&&Mutil.isKey(a,"ENTER")&&e()}}])}(_Input2.Input);
222
223},{"./Input.js":71}],75:[function(require,module,exports){
224"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubDomainInput=void 0;var _Input2=require("./Input.js"),_inputValidation=require("../../util/input-validate/inputValidation.js"),_index=require("../../util/input-error-handler/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
224function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var SubDomainInput=exports.SubDomainInput=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.addClassName,c=void 0===b?"":b,d=a.inputId,e=void 0===d?"subDomainInput":d;return"\n                    <div id=\"subDomainInputTempLayer\" >\n                        <div class=\"interactive-form-wrap js-interactive-form-wrap\">\n                            <input\n                               id=\"".concat(e,"\"\n                               class=\"").concat(c," interactive-form-input\"\n                               type=\"text\" \n                                data-valid=\"teamUrl\"\n                                data-required-yn=\"Y\" \n                                maxlength=\"50\" \n                                data-over-msg=\"").concat(i18next.t(login.inputAlert,{val:50}),"\" \n                                data-empty-msg=\"").concat(i18next.t(login.common.enter,{val:$t(login.companyURL)}),"\" \n                                data-un-valid-msg=\"").concat(i18next.t(login.companyURLPlaceHolder),"\"\n                                placeholder=\"\">\n                            <span class=\"interactive-form-placeholder\">").concat(i18next.t(login.companyURL),"</span>\n                        </div>\n                        <em class=\"url-wrap-em\">.").concat(location.host,"</em>\n                    </div>\n                    <p class=\"error-txt-wrap\">\n                      <span class=\"js-error-txt\"></span>\n                    </p>\n        ")}},{key:"getInputSelector",value:function(){var a=this.$props.inputId,b=void 0===a?"subDomainInput":a;return"#".concat(b)}},{key:"inputValidate",value:function(){var a=$("".concat(this.getInputSelector())),b=_inputValidation.InputValidator.getInputErrorJson(a),c=0<Object.values(b).length;return c?(_index.InputErrorHandler.activeErrorModeAboutInputTempLayer(this.getInputErrorElement(),b.errorMessage),!1):(_index.InputErrorHandler.unActiveErrorModeAboutInputTempLayer(this.getInputErrorElement()),!0)}},{key:"getInputErrorElement",value:function(){return $("#subDomainInputTempLayer")}}])}(_Input2.Input);
225
226},{"../../util/input-error-handler/index.js":102,"../../util/input-validate/inputValidation.js":104,"./Input.js":71}],76:[function(require,module,exports){
227"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppSumoLayout=void 0;var _Layout2=require("./Layout.js"),_store=require("../../store.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
227function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var AppSumoLayout=exports.AppSumoLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.sectionId,c=void 0===b?"":b,d=a.userId,e=void 0===d?"":d;return"\n                <section id=\"".concat(c,"\" class=\"signup-wide-pop btn-bottom-case\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            <ul>\n                             \t").concat(this.getUserEmailInputTemplate(),"\n                             \t<li id =\"companyNameLayer\"></li>\n                                <li id =\"userNameLayer\"></li>\n                                <li id =\"passwordLayer\"></li>\n                              </ul>\n                              <div class=\"bottom-button-wrap\">\n                                 ").concat(this.getNexPageButtonTemplate(),"\n                              </div>\n                        </div>\n                    </article>\n                </section>")}},{key:"getCompanyNameLayer",value:function(){return $("#companyNameLayer")}},{key:"getSubDomainInputLayer",value:function(){return $("#subDomainInputLayer")}},{key:"getUserNameLayer",value:function(){return $("#userNameLayer")}},{key:"getPasswordLayer",value:function(){return $("#passwordLayer")}},{key:"getUserEmailInputTemplate",value:function(){var a=(0,_store.getUserId)();return"<li>\n                   <div class=\"interactive-form-wrap js-interactive-form-wrap\">\n                   \t\t<input class=\"js-name-input join-name-input interactive-form-input js-join-input\" placeholder=\"".concat(a,"\" value=\"").concat(a,"\" disabled>\n                   </div>\n                 </li>")}},{key:"getNexPageButtonTemplate",value:function(){var a=this.$props.nextButton,b=void 0===a?{}:a;return"<button id = \"".concat(b.id,"\" class=\"js-next-page-button button-sign-next\" tabindex=\"4\" >Get Started</button>")}}])}(_Layout2.Layout);
228
229},{"../../store.js":100,"./Layout.js":85}],77:[function(require,module,exports){
230"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BusinessEmailLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
230function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var BusinessEmailLayout=exports.BusinessEmailLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop morningmate-type business-email-type\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        ").concat(this.getPromoBannerTemplate(),"\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            ").concat(this.getNexPageButtonTemplate(),"\n                        </div>\n                    </article>\n                </section>")}}])}(_Layout2.Layout);
231
232},{"./Layout.js":85}],78:[function(require,module,exports){
233"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BusinessSnsLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var BusinessSnsLayout=exports.BusinessSnsLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n            <section id=\"".concat(b,"\" class=\"signup-wide-pop  morningmate-type\">\n                    <header class=\"js-section-header\"></header>\n                    <article>
233\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            ").concat(this.getNextLinkTemplate(),"\n                        </div>\n                        <p class=\"bottom-text\" style=\"text-align: center\">\n                          ").concat(this.getPolicyBottomTemplate(),"\n                        </p>\n                    </article>\n                </section>")}},{key:"getPolicyBottomTemplate",value:function(){return Often.isGlobal()?_superPropGet(b,"getPolicyBottomTemplate",this,3)([]):""}}])}(_Layout2.Layout);
234
235},{"./Layout.js":85}],79:[function(require,module,exports){
236"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyInfoLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyInfoLayout=exports.CompanyInfoLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.sectionId,c=void 0===b?"":b,d=a.companyName,e=void 0===d?"":d,f=a.employeeList,g=void 0===f?[]:f;return"\n                <section id=\"".concat(c,"\" class=\"signup-wide-pop\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            <div class=\"company-info-read-wrap\">\n                                <em>").concat(e,"</em>\n                                <div>").concat(this.getProfileContents(g),"</div>\n                                <p>").concat(this.getNameContents(g),"</p>\n                                ").concat(this.getNexPageButtonTemplate(),"\n                              </div>\n                        </div>\n                    </article>\n                </section>")}},{key:"getProfileContents",value:function(){var a=this,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return 0===b.length?"":b.map(function(b){return a.getProfilePhotoTemplate(b.PRFL_PHTG)}).join(" ")}},{key:"getProfilePhotoTemplate",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return"<p class=\"js-profile user-img\" style=\"background-image: url(".concat(a,")  , url(").concat("/flow-renewal/assets/images/profile-default.png",") ;\"></p>")}},{key:"getNameContents",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return 0===a.length?"":a.map(function(a){return Mutil.empty(a.FLNM)?"":"<span>".concat(a.FLNM,"</span>")}).join(", ")+" ".concat(i18next.t(login.participating))}}])}(_Layout2.Layout);
237
238},{"./Layout.js":85}],80:[function(require,module,exports){
239"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyJoinLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
239function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyJoinLayout=exports.CompanyJoinLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop business-email-type company-join-page\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        ").concat(this.getPromoBannerTemplate(),"\n                        <div class=\"pop-main js-contents-main\">\n                            <div class=\"company-join\">\n                                ").concat(this.getStep1Template(),"\n                                ").concat(this.getStep2Template(),"\n                                ").concat(this.getStep3Template(),"\n                                ").concat(this.getStep4Template(),"\n                            </div>\n                        </div>\n                    </article>\n                </section>")}},{key:"getStep1Template",value:function(){return"\n            <div class=\"company-join__step is-active\" data-step=\"1\">\n                <div class=\"company-join__head\">\n                    <h3>\uAE30\uC874 \uD68C\uC0AC\uC5D0 \uCC38\uC5EC\uD558\uAE30</h3><!-- \uBAA9\uC5C5 v2.7 \uBB38\uAD6C (\uB2E4\uAD6D\uC5B4 \uBBF8\uC801\uC6A9 \uD655\uC815) -->\n                    <p>\uC6B0\uB9AC \uD68C\uC0AC\uC758 URL\uC744 \uC785\uB825\uD558\uC5EC \uCC38\uC5EC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.</p>\n                </div>\n                <div class=\"company-join__field\">\n                    <label class=\"company-join__label\" for=\"companyUrlInput\">".concat(i18next.t(login.companyURL),"</label>\n                    <div class=\"company-join__row\">\n                        <div class=\"company-join__url-field\">\n                            <div class=\"InputL company-join__input\">\n                                <input id=\"companyUrlInput\" type=\"text\" placeholder=\"").concat(i18next.t(login.companyURL),"\" autocomplete=\"off\"\n                                       data-valid=\"teamUrl\" data-required-yn=\"Y\" maxlength=\"50\"\n                                       data-over-msg=\"").concat(i18next.t(login.inputAlert,{val:50}),"\"\n                                       data-empty-msg=\"").concat(i18next.t(login.common.enter,{val:$t(login.companyURL)}),"\"\n                                       data-un-valid-msg=\"").concat(i18next.t(login.companyURLPlaceHolder),"\">\n                            </div>\n                            <em class=\"company-join__url-suffix\">.").concat(location.host,"</em>\n                        </div>\n                        <button type=\"button\" class=\"BasicL_Face company-join__inline-btn js-cj-next\">\uD655\uC778</button>\n                    </div>\n                    <p class=\"company-join__error js-cj-url-error\" style=\"display:none;\"></p>\n                </div>\n                <div class=\"company-join__help signup-help-banner\">\n                    <p>\uD68C\uC0AC URL \uC8FC\uC18C\uB97C \uBAA8\uB974\uC2DC\uB098\uC694? \uAD00\uB9AC\uC790\uC5D0\uAC8C \uC694\uCCAD\uD558\uBA74 \uCD08\uB300 \uBA54\uC77C\uB85C\uB3C4 \uCC38\uC5EC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.</p>\n                </div>\n            </div>")}},{key:"getStep2Template",value:function(){return"\n            <div class=\"company-join__step\" data-step=\"2\">\n                <div class=\"company-join__head\">\n                    <h3>".concat(i18next.t(login.confirmCompanyInfo),"</h3>\n                    <p>").concat(i18next.t(login.confirmCompanyDesc),"</p>\n                </div>\n                <div class=\"company-join__company-card\">\n                    <div class=\"company-join__company-info\">\n                        <strong class=\"company-join__company-name\">\uB9C8\uB4DC\uB77C\uC2A4\uCCB4\uD06C</strong>\n                        <div class=\"company-join__avatars\">
239\n                            <span class=\"company-join__avatar\"><img src=\"/flow-renewal/assets/images/renewal-popup-profile-01.png\" alt=\"\"></span>\n                            <span class=\"company-join__avatar\"><img src=\"/flow-renewal/assets/images/renewal-popup-profile-02.png\" alt=\"\"></span>\n                            <span class=\"company-join__avatar\"><img src=\"/flow-renewal/assets/images/renewal-popup-profile-03.png\" alt=\"\"></span>\n                        </div>\n                        <p class=\"company-join__company-desc\">\uD64D\uAE38\uB3D9, \uAE40\uCCA0\uC218, \uC774\uC601\uD76C \uC678 \uCC38\uC5EC\uC911\uC785\uB2C8\uB2E4</p>\n                    </div>\n                    <button type=\"button\" class=\"BasicL_Face company-join__request js-cj-next\">").concat(i18next.t(common.requestedToJoin),"</button>\n                </div>\n            </div>")}},{key:"getStep3Template",value:function(){return"\n            <div class=\"company-join__step\" data-step=\"3\">\n                <div class=\"company-join__head\">\n                    <h3>".concat(i18next.t(login.signupInfoTitle),"</h3>\n                    <p>").concat(i18next.t(login.joinInfoDesc),"</p>\n                </div>\n                <ul class=\"user-info-wrap\">\n                    <li id=\"cjUserNameLayer\"></li>\n                    <li id=\"cjPasswordLayer\"></li>\n                    <li id=\"cjPhoneAuthLayer\" class=\"phone-confirm-wrap\"></li>\n                </ul>\n                <button type=\"button\" class=\"BasicL_Face company-join__request js-cj-next\">\uCC38\uC5EC \uC694\uCCAD\uD558\uAE30</button>\n            </div>")}},{key:"getUserNameLayer",value:function(){return $("#cjUserNameLayer")}},{key:"getPasswordLayer",value:function(){return $("#cjPasswordLayer")}},{key:"getPhoneAuthLayer",value:function(){return $("#cjPhoneAuthLayer")}},{key:"getStep4Template",value:function(){return"\n            <div class=\"company-join__step\" data-step=\"4\">\n                <div class=\"company-join__head\">\n                    <h3>".concat(i18next.t(login.joinRequestComplete),"</h3>\n                    <p>").concat(i18next.t(login.adminPendingDesc),"</p>\n                </div>\n                <div class=\"company-join__done\">\n                    <button type=\"button\" class=\"BasicL_Face company-join__request\">").concat(i18next.t(common.redirectLoginPage),"</button>\n                    <a href=\"#\" class=\"company-join__cancel js-cj-reset\">").concat(i18next.t(login.cancelRegisteration),"</a>\n                </div>\n            </div>")}},{key:"setEvent",value:function(){_superPropGet(b,"setEvent",this,3)([]),this.$props.manualStep||(this.addEvent("click",".js-cj-next",this.goNextStep.bind(this)),this.addEvent("click.prevent",".js-cj-reset",this.resetStep.bind(this)))}},{key:"goNextStep",value:function(a){var b=$(a.target).closest(".company-join__step"),c=+b.attr("data-step")+1,d=b.closest(".company-join").find(".company-join__step[data-step=\"".concat(c,"\"]"));d.length&&(b.removeClass("is-active"),d.addClass("is-active"),$(window).scrollTop(0))}},{key:"resetStep",value:function(a){var b=$(a.target).closest(".company-join");b.find(".company-join__step").removeClass("is-active"),b.find(".company-join__step[data-step=\"1\"]").addClass("is-active"),$(window).scrollTop(0)}}])}(_Layout2.Layout);
240
241},{"./Layout.js":85}],81:[function(require,module,exports){
242"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyJoinWaitLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
242function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyJoinWaitLayout=exports.CompanyJoinWaitLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            <div class=\"req-done-wrap\">\n                                <img src=\"/flow-renewal/assets/images/sign-req-complete.png\" alt=\"\">\n                                <em>").concat(i18next.t(login.adminPending),"</em>\n                                <span>").concat(i18next.t(login.adminPendingDesc),"</span>\n                             </div>\n                            ").concat(this.getNexPageButtonTemplate(),"\n                            ").concat(this.getJoinCancelButtonTemplate(),"\n                        </div>\n                    </article>\n                </section>\n               \n        ")}},{key:"setEvent",value:function(){this.setNextPageButtonEvent(),this.setJoinCancelButtonEvent()}},{key:"getJoinCancelButtonTemplate",value:function(){var a=this.$props.cancelButton,b=void 0===a?{}:a;return 0<Object.values(b).length?"<button id = \"".concat(b.id,"\" class=\"js-cancel-button btn-underline\">").concat(Mutil.n2v(b.text),"</button>"):""}},{key:"setJoinCancelButtonEvent",value:function(){var a=this.$props.cancelButton,b=void 0===a?{}:a;if(0!==Object.values(b).length){var c=b.cancelFunc,d=void 0===c?Mutil.noop:c,e=new Mutil.DebounceNThrottle(function(){d()},300);this.addEvent("click",".js-cancel-button",function(){e.debounceAfterStart()})}}}])}(_Layout2.Layout);
243
244},{"./Layout.js":85}],82:[function(require,module,exports){
245"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyProfileLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
245function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyProfileLayout=exports.CompanyProfileLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            <div id=\"companyNameLayer\"></div>\n                            <div id=\"companyCategorySelectLayer\" class=\"select-wrap\"> </div>\n                            <div id=\"hopeCountSelectLayer\" class=\"select-wrap\"></div>\n                            ").concat(this.getServiceTypeTemplate(),"\n                            ").concat(this.getNexPageButtonTemplate(),"\n                        </div>\n                    </article>\n                </section>")}},{key:"getNexPageButtonTemplate",value:function(){var a=this.$props.nextButton,b=void 0===a?{}:a;return 0<Object.values(b).length?"<button id = \"".concat(b.id,"\" class=\"btn-next js-next-page-button\" >").concat(Mutil.n2v(b.text),"</button>"):""}},{key:"getNextLinkTemplate",value:function(){var a=this.$props.nextLink,b=void 0===a?{}:a;return 0<Object.values(b).length?"<a id = \"".concat(Mutil.n2v(b.id),"\" class=\"js-next-page-link comp-info-link\" >").concat(Mutil.n2v(b.text),"</a>"):""}},{key:"getServiceTypeTemplate",value:function(){return"\n            <div class=\"product-selection js-service-type-layer\" style=\"display: none;\"> \n                <p class=\"product-selection-title\">\uC0C1\uD488\uC720\uD615\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.</p>\n                <label class=\"product-group\">\n                    <input type=\"radio\" name=\"radioOption\" value=\"\uD074\uB77C\uC6B0\uB4DC \uB3C4\uC785\uBB38\uC758\" checked>\n                    <span></span>\n                    <div>\n                        <p>\uAD6C\uB3C5\uD615(\uD074\uB77C\uC6B0\uB4DC)</p>\n                        <span>\uC911\uC18C, \uC911\uACAC \uAE30\uC5C5\uC5D0 \uC801\uD569</span>\n                    </div>\n                </label> \n                <label class=\"product-group\">\n                <input type=\"radio\" name=\"radioOption\" value=\"\uAD6C\uCD95\uC0C1\uD488 \uB3C4\uC785\uBB38\uC758\">\n                <span></span>\n                <div>\n                    <p>\uAD6C\uCD95\uD615(\uC5D4\uD130\uD504\uB77C\uC774\uC988)</p>\n                    <span>\uB300\uAE30\uC5C5, \uACF5\uACF5\uAE30\uAD00, \uAE08\uC735\uD68C\uC0AC \uB4F1\uC5D0 \uC801\uD569</span>    \n                </div>\n                </label>\n            </div>\n        "}}])}(_Layout2.Layout);
246
247},{"./Layout.js":85}],83:[function(require,module,exports){
248"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmailAuthLayout=void 0;var _Layout2=require("./Layout.js"),_constant=require("../../constant.js"),_store=require("../../store.js"),_index=require("../../../../bridge/renewal-signup/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
248function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var EmailAuthLayout=exports.EmailAuthLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"<section id=\"".concat(b,"\" class=\"signup-wide-pop business-email-type\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        ").concat(this.getPromoBannerTemplate(),"\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            ").concat(this.getNexPageButtonTemplate(),"\n                        </div>\n                    </article>\n                </section>")}},{key:"getSubTextTemplate",value:function(){var a=this.$props.subText,b=void 0===a?"":a;return Mutil.empty(b)?"":"<p id=\"subTxt\">".concat(b,"</p>")}},{key:"showAuthInfoText",value:function(){$("#authInfoTxt").css("display","block")}},{key:"setEvent",value:function(){_superPropGet(b,"setEvent",this,3)([]),this.addEvent("click",".js-mail-page-move-btn",this.clickHandlerOfMoveMailPageButton.bind(this))}},{key:"clickHandlerOfMoveMailPageButton",value:function(a){var b=$(a.target).closest(".js-mail-page-move-btn"),c=b.attr("email-type"),d=!Mutil.isMobile()&&!Mutil.isTablet();return d?void this.moveMailWebPage(c):(0,_store.isWebView)()?void(0,_index.mobileOpenMailApp)({appName:c}):void this.openMailApp(c)}},{key:"moveMailWebPage",value:function(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(!Mutil.empty(b)){var c=null===(a=_constant.MAIL["".concat(b)])||void 0===a?void 0:a.WEB;Mutil.empty(c)||Mutil.open(c,"_blank")}}},{key:"executeApp",value:function(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";Mutil.empty(b)||(location.href=null===(a=_constant.MAIL["".concat(b)])||void 0===a?void 0:a.SCHEME)}},{key:"goStore",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(!Mutil.empty(a)){var b=_constant.MAIL["".concat(a)],c="IPHONE"===window._GUBUN||"IPAD"===window._GUBUN;return c?void(location.href=null===b||void 0===b?void 0:b.APP_STORE):void(location.href="market://details?id=".concat(null===b||void 0===b?void 0:b.PLAY_STORE))}}},{key:"openMailApp",value:function(a){var b=this;if(!Mutil.empty(a)){Mutil.toast("info",i18next.t(common.goDirect)),this.executeApp(a);setTimeout(function(){b.goStore(a)},2e3)}}}])}(_Layout2.Layout);
249
250},{"../../../../bridge/renewal-signup/index.js":4,"../../constant.js":98,"../../store.js":100,"./Layout.js":85}],84:[function(require,module,exports){
251"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.InviteLayout=void 0;var _Layout2=require("./Layout.js"),_index=require("../../util/view-changer/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
251function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var InviteLayout=exports.InviteLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop morningmate-type\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            <div class=\"corp-process-wrap\">\n                                <ul>\n                                    <li id=\"corpButtonLayer\"> </li>\n                                    <li  id=\"inviterUl\" class=\"exist-corp-wrap\" style=\"display: none\">\n                                        <p>").concat(i18next.t(login.existingTeamDesc),"</p>\n                                    </li>\n                                </ul>\n                            </div>\n                     \n                        </div>\n                    </article>\n                </section>")}},{key:"getCorpButtonLayer",value:function(){return $("#corpButtonLayer")}},{key:"showInviteUlLayer",value:function(){var a=this.getInviteUlLayer();a.is(":visible")||a.show()}},{key:"getInviteUlLayer",value:function(){return $("#inviterUl")}}])}(_Layout2.Layout);
252
253},{"../../util/view-changer/index.js":108,"./Layout.js":85}],85:[function(require,module,exports){
254"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Layout=void 0;var _SignUpComponent2=require("../SignUpComponent.js"),_store=require("../../store.js"),_SignUpCarouselJson=require("./SignUpCarouselJson.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
254function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var Layout=exports.Layout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            ").concat(this.getNexPageButtonTemplate(),"\n                        </div>\n                    </article>\n                </section>")}},{key:"getPromoBannerTemplate",value:function(){return"\n                <div class=\"promo-banner-wrap\" aria-hidden=\"true\">\n                    <img class=\"promo-banner\" src=\"/flow-renewal/assets/images/signup/signup-promo-banner.svg\" alt=\"\">\n                    <div class=\"promo-text\">\n                        <img class=\"promo-logo\" src=\"/flow-renewal/assets/images/logo/logo-flow-wh.svg\" alt=\"flow\">\n                        <strong>\uC54C\uB9CC\uD55C \uAE30\uC5C5\uB4E4\uC774<br>\uC9C0\uAE08 \uD50C\uB85C\uC6B0\uB97C \uC120\uD0DD\uD558\uB294 \uC774\uC720!</strong>\n                        <p>\uC6CC\uD06C\uD50C\uB85C\uC6B0\uAC00 \uBC14\uB00C\uBA74 \uC131\uACFC\uAC00 \uBC14\uB01D\uB2C8\uB2E4</p>\n                    </div>\n                </div>"}},{key:"getMainTextTemplate",value:function(){var a=this.$props.mainText,b=void 0===a?"":a;return Mutil.empty(b)?"":"<h3 id=\"mainTxt\">".concat(b,"</h3>")}},{key:"getSubTextTemplate",value:function(){var a=this.$props.subText,b=void 0===a?"":a;return Mutil.empty(b)?"":"<p id=\"subTxt\">".concat(b,"</p>")}},{key:"getNexPageButtonTemplate",value:function(){var a=this.$props.nextButton,b=void 0===a?{}:a;return 0===Object.values(b).length?"":"<button id = \"".concat(b.id,"\" class=\"js-next-page-button btn-next\">").concat(Mutil.n2v(b.text),"</button>")}},{key:"getNextLinkTemplate",value:function(){var a=this.$props.nextLink,b=void 0===a?{}:a;if(0===Object.values(b).length)return"";var c=b.id,d=void 0===c?"":c,e=b.text,f=void 0===e?"":e,g=b.isBottom,h=b.isView;return void 0===h||h?Often.isGlobal()?"":"<a id = \"".concat(Mutil.n2v(d),"\" class=\"js-next-page-link ").concat(void 0!==g&&g?"sign-bottom-link":"","\" > ").concat(Mutil.n2v(f),"</a>"):""}},{key:"setEvent",value:function(){this.setNextPageButtonEvent(),this.setNextPageLinkEvent()}},{key:"setNextPageLinkEvent",value:function(){var a=this.$props.nextLink,b=void 0===a?{}:a;if(0!==Object.values(b).length){var c=b.nextPageFunc,d=void 0===c?Mutil.noop:c;this.addEvent("click.prevent",".js-next-page-link",function(){d()})}}},{key:"setNextPageButtonEvent",value:function(){var a=this.$props.nextButton,b=void 0===a?{}:a;if(0!==Object.values(b).length){var c=b.nextPageFunc,d=void 0===c?Mutil.noop:c,e=new Mutil.DebounceNThrottle(function(){d()},300);this.addEvent("click",".js-next-page-button",function(){e.debounceAfterStart()})}}},{key:"getHeaderSelector",value:function(){return".js-section-header"}},{key:"getHeaderLayer",value:function(){return $(this.getSelectionSelector()).find("".concat(this.getHeaderSelector()))}},{key:"getSelectionSelector",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return Mutil.empty(b)?"section":"#".concat(b)}},{key:"getMainArticle",value:function(){return $(this.getSelectionSelector()).find("article")}},{key:"getMainLayer",value:function(){return $(this.getSelectionSelector()).find(".js-contents-main")}},{key:"getSubTextLayer",value:function(){return $("#subTxt")}},{key:"getPolicyBottomTemplate",value:function(){if(Often.isGlobal())return"";var a="<a href=\"https://flow.team/kr/terms\" target=\"".concat((0,_store.isWebView)()?"_self":"_blank","\">").concat(i18next.t(login.srvcetrms),"</a>, <a href=\"https://flow.team/kr/privacy\" target=\"").concat((0,_store.isWebView)()?"_self":"_blank","\">").concat(i18next.t(login.pvcyplcy),"</a>"),b=Mutil.requireIIFE("Internationalization");return b.getCurrentLanguage().toLowerCase().includes("en")?"By signing up, you agree to our "+a+". <br />
254You also agree to receive product related emails.":"ko"===b.getCurrentLanguage().toLowerCase()||"ja"===b.getCurrentLanguage().toLowerCase()?a+"".concat(i18next.t(login.agreepvcy)):"".concat(i18next.t(login.agreepvcy))+a}}])}(_SignUpComponent2.SignUpComponent);
255
256},{"../../store.js":100,"../SignUpComponent.js":57,"./SignUpCarouselJson.js":87}],86:[function(require,module,exports){
257"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProjectInvitationLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var ProjectInvitationLayout=exports.ProjectInvitationLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n            <section id=\"".concat(b,"\" class=\"signup-wide-pop morningmate-type\">\n                <header class=\"js-section-header\"></header>\n                <article>\n                    <div class=\"js-contents-main pop-main\">\n                        ").concat(this.getMainTextTemplate(),"\n                        ").concat(this.getSubTextTemplate(),"\n                        <div class=\"corp-process-wrap\">\n                            <ul>\n                                <li id=\"inviteButtonLayer\"></li>\n                                <li id=\"invitationListLayer\" class=\"exist-corp-wrap\" style=\"display: none\">\n                                    <p>").concat(i18next.t(login.existingTeamDesc),"</p>\n                                </li>\n                            </ul>\n                        </div>\n                    </div>\n                </article>\n            </section>\n        ")}},{key:"getInviteButtonWrap",value:function(){return $("#inviteButtonLayer")}},{key:"getInvitationListLayer",value:function(){return $("#invitationListLayer")}},{key:"showInvitationListLayer",value:function(){var a=this.getInvitationListLayer();a.is(":visible")||a.show()}}])}(_Layout2.Layout);
258
259},{"./Layout.js":85}],87:[function(require,module,exports){
260"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.imageSliderJsonArrayB=exports.imageSliderJsonArrayA=void 0;var imageSliderJsonArrayA=exports.imageSliderJsonArrayA=[{title:"\uD55C \uACF3\uC73C\uB85C \uC5C5\uBB34\uAC00 \uBAA8\uC5EC \uB204\uB77D\uC774 \uC0AC\uB77C\uC84C\uC5B4\uC694.",description:"\uBAA8\uB4E0 \uAE30\uAE30\uC5D0\uC11C \uC9C0\uC6D0\uB418\uAE30 \uB54C\uBB38\uC5D0 \uC5C5\uBB34\uD658\uACBD\uC5D0 \uAD6C\uC560\uBC1B\uC9C0 \uC54A\uACE0 \uC0AC\uC6A9\uD560 \uC218 \uC788\uC5C8\uACE0, \uB2F4\uB2F9\uC790\uB97C \uC9C0\uC815\uD55C \uB514\uD14C\uC77C\uD55C \uAE30\uB2A5\uC774 \uC5C5\uBB34 \uCC98\uB9AC\uC5D0 \uC788\uC5B4\uC11C \uD6A8\uACFC\uC801\uC774\uC5D0\uC694.",img:"/flow-renewal/assets/images/flowting-project/ci-logiall.svg",associateName:"\uCD5C\uADDC\uBC94 \uBD80\uB300\uD45C",profileImage:"/flow-renewal/assets/images/flowting-project/associate-1.png"},{title:"\uC804\uAD6D 15,000\uAC1C \uC810\uD3EC\uC640 \uC2E4\uC2DC\uAC04 \uC18C\uD1B5\uD574\uC694.",description:"\uD3B8\uC758\uC810 \uD2B9\uC131\uC0C1 \uC218\uC2DC\uB85C \uC2E0\uC0C1\uD488\uC774 \uB098\uC624\uACE0 \uD589\uC0AC\uAC00 \uC9C4\uD589\uB418\uB294\uB370, \uC774\uC288\uAC00 \uC788\uC744 \uB54C \uB9C8\uB2E4 \uBAA8\uBC14\uC77C\uB85C \uC18C\uD1B5\uD560 \uC218 \uC788\uC5B4\uC11C \uC989\uAC01\uC801\uC778 \uD53C\uB4DC\uBC31\uC774 \uAC00\uB2A5\uD574\uC84C\uC5B4\uC694.",img:"/flow-renewal/assets/images/flowting-project/ci-bgf.svg",associateName:"\uB958\uB300\uC131 \uCC45\uC784",profileImage:"/flow-renewal/assets/images/flowting-project/associate-2.png"},{title:"\uBD88\uD544\uC694\uD55C \uC5C5\uBB34 \uAD00\uB9AC \uC2DC\uAC04\uC774 \uAC10\uC18C\uB410\uC5B4\uC694.",description:"\uC5C5\uBB34 \uC9C4\uD589\uC744 \uD558\uBA74\uC11C \uC313\uC774\uB294 \uBAA8\uB4E0 \uB370\uC774\uD130\uAC00 \uD50C\uB85C\uC6B0 \uC548\uC5D0 \uBCF4\uAD00\uB418\uC5B4 \uC788\uC5B4\uC11C \uBCC4\uB3C4\uC758 \uD788\uC2A4\uD1A0\uB9AC \uAD00\uB9AC\uB97C \uD560 \uD544\uC694\uAC00 \uC5C6\uC5B4\uC84C\uC5B4\uC694.",img:"/flow-renewal/assets/images/flowting-project/ci-artbox.svg",associateName:"\uC774\uB77D\uC5F0 \uD300\uC7A5",profileImage:"/flow-renewal/assets/images/flowting-project/associate-3.png"}],imageSliderJsonArrayB=exports.imageSliderJsonArrayB=[{title:"90%",subTitle:"\uC5C5\uBB34 \uB204\uB77D \uAC10\uC18C",description:"\uC5C5\uBB34 \uB204\uB77D\uACFC \uC790\uB8CC \uC720\uC2E4\uC774<br/> \uBC1C\uC0DD\uD558\uC9C0 \uC54A\uAC8C \uB418\uC5C8\uC5B4\uC694.",graphImage:"/flow-renewal/assets/images/flowting-project/data-1.png"},{title:"70%",subTitle:"\uCEE4\uBBA4\uB2C8\uCF00\uC774\uC158 \uBE44\uC6A9 \uAC10\uC18C",description:"\uC815\uBCF4 \uC804\uB2EC\uACFC \uC18C\uD1B5\uC5D0 \uB4E4\uC5B4\uAC00\uB294<br/> \uB9AC\uC18C\uC2A4\uAC00 \uAC10\uC18C\uB418\uC5C8\uC5B4\uC694.",graphImage:"/flow-renewal/assets/images/flowting-project/data-2.png"},{title:"4.9H",subTitle:"\uD788\uC2A4\uD1A0\uB9AC \uAD00\uB9AC\uC2DC\uAC04 \uAC10\uC18C",description:"\uC5C5\uBB34 \uAC00\uC2DC\uD654\uB85C \uBD88\uD544\uC694\uD55C<br/> \uAD00\uB9AC\uC2DC\uAC04\uC774 \uB2E8\uCD95\uB418\uC5C8\uC5B4\uC694.",graphImage:"/flow-renewal/assets/images/flowting-project/data-3.png"}];
261
262},{}],88:[function(require,module,exports){
263"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SignupSurveyLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
263function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var SignupSurveyLayout=exports.SignupSurveyLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop business-email-type signup-survey-page\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        ").concat(this.getPromoBannerTemplate(),"\n                        <div class=\"pop-main js-contents-main\">\n                            <h3 id=\"mainTxt\">\uB9C8\uC9C0\uB9C9 \uC9C8\uBB38\uC785\uB2C8\uB2E4</h3><!-- \uBAA9\uC5C5 v2.7 \uBB38\uAD6C (\uB2E4\uAD6D\uC5B4 \uBBF8\uC801\uC6A9 \uD655\uC815) -->\n                            <p id=\"subTxt\">\uC6B0\uB9AC \uD68C\uC0AC\uC5D0 \uB531 \uB9DE\uB294 \uD50C\uB85C\uC6B0\uB97C \uC900\uBE44\uD569\uB2C8\uB2E4.</p>\n                            <div class=\"signup-survey\">\n                                ").concat(this.getQuestionGroup("\uD50C\uB85C\uC6B0\uB97C \uC5B4\uB514\uC11C \uCC98\uC74C \uBCF4\uC168\uB098\uC694?",["\uB124\uC774\uBC84/\uAD6C\uAE00 \uAC80\uC0C9","\uC9C0\uC778\xB7\uB3D9\uB8CC \uCD94\uCC9C","\uD604\uC7AC \uD50C\uB85C\uC6B0 \uBB34\uB8CC/\uAC1C\uC778 \uC0AC\uC6A9\uC911","\uC628\uB77C\uC778 \uAD11\uACE0 (\uB124\uC774\uBC84/\uAD6C\uAE00)","\uC720\uD29C\uBE0C/\uC601\uC0C1 \uCF58\uD150\uCE20","SNS (\uC778\uC2A4\uD0C0\uADF8\uB7A8/\uB9C1\uD06C\uB4DC\uC778/\uD398\uC774\uC2A4\uBD81)","\uB274\uC2A4/\uBE14\uB85C\uADF8/\uAE30\uC0AC","\uC624\uD504\uB77C\uC778 \uD589\uC0AC/\uC138\uBBF8\uB098/\uC804\uC2DC\uD68C","\uD50C\uB85C\uC6B0 \uBE14\uB85C\uADF8/\uACF5\uC2DD \uCF58\uD150\uCE20","\uAE30\uD0C0"]),"\n                                ").concat(this.getQuestionGroup("\uD300 \uADDC\uBAA8\uB294 \uC5B4\uB290 \uC815\uB3C4\uC778\uAC00\uC694?",["10\uC778 \uC774\uD558","11~30\uC778","31~50\uC778","51~100\uC778","101~500\uC778","501~1000\uC778","1000\uC778 \uC774\uC0C1"]),"\n                                ").concat(this.getQuestionGroup("\uC5B4\uB5A4 \uC5C5\uC885\uC5D0\uC11C \uC77C\uD558\uC2DC\uB098\uC694?",["\uC81C\uC870\uC5C5","\uC815\uBCF4\uD1B5\uC2E0\uC5C5(IT)","F&B/\uD504\uB79C\uCC28\uC774\uC988","\uB3C4/\uC18C\uB9E4 \uC720\uD1B5 \uD310\uB9E4","\uC5D4\uD130\uD14C\uC778\uBA3C\uD2B8/\uC5EC\uD589/\uC608\uC220","\uC11C\uBE44\uC2A4","\uACF5\uACF5","\uAC74\uC124 \uBC0F \uAE30\uD0C0 \uC0B0\uC5C5","\uC138\uBB34/\uBC95\uBB34/\uB178\uBB34","\uC758\uB8CC\uBCF4\uAC74/\uC0AC\uD68C\uBCF5\uC9C0","\uAE08\uC735","\uD611\uD68C \uBC0F \uB2E8\uCCB4","\uAD50\uC721/\u
263C5F0\uAD6C","\uAE30\uD0C0"]),"\n                                ").concat(this.getQuestionGroup("\uC9C0\uAE08 \uAC00\uC7A5 \uBD88\uD3B8\uD55C \uAC74 \uBB34\uC5C7\uC778\uAC00\uC694?",["\uD504\uB85C\uC81D\uD2B8\xB7\uC5C5\uBB34 \uAD00\uB9AC \uACE0\uB3C4\uD654","\uC0AC\uB0B4 \uBA54\uC2E0\uC800 \uD1B5\uD569","\uBCF4\uACE0\xB7\uACB0\uC7AC \uB514\uC9C0\uD138\uD654","\uC678\uBD80 \uD611\uC5C5 (\uACE0\uAC1D\uC0AC\xB7\uD30C\uD2B8\uB108\uC0AC)","\uC5C5\uBB34 \uB370\uC774\uD130\xB7\uC9C0\uC2DD \uC911\uC559\uD654","\uC7AC\uD0DD\xB7\uD558\uC774\uBE0C\uB9AC\uB4DC \uADFC\uBB34","IT \uBCF4\uC548\xB7\uB9DD\uBD84\uB9AC \uD611\uC5C5","\uADF8\uB8F9\uC6E8\uC5B4/ERP \uC5F0\uB3D9","\uBE44\uC6A9 \uC808\uAC10","\uAE30\uD0C0"],!0),"\n                            </div>\n                            <div class=\"signup-survey__submit-wrap\">\n                                <button type=\"button\" class=\"BasicL_Face signup-survey__submit\">\uD50C\uB85C\uC6B0 \uC2DC\uC791\uD558\uAE30</button>\n                            </div>\n                        </div>\n                    </article>\n                </section>")}},{key:"getQuestionGroup",value:function(a,b){var c=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],d=b.map(function(a){return"<button type=\"button\" class=\"Btn-TabM\">".concat(a,"</button>")}).join("");return"\n            <div class=\"signup-survey__group".concat(c?" signup-survey__group--multiple":"","\">\n                <p class=\"signup-survey__question\">").concat(a,"</p>\n                ").concat(c?"<p class=\"signup-survey__hint\">(\uC911\uBCF5 \uC120\uD0DD \uAC00\uB2A5)</p>":"","\n                <div class=\"signup-survey__answer\">\n                    <div class=\"signup-survey__chips\">").concat(d,"</div>\n                    ").concat(c?"":"<a href=\"#\" class=\"signup-survey__reselect js-survey-reselect\">\uB2E4\uC2DC \uC120\uD0DD</a>","\n                </div>\n            </div>")}},{key:"setEvent",value:function(){_superPropGet(b,"setEvent",this,3)([]),this.addEvent("click",".signup-survey__chips .Btn-TabM",this.clickChip.bind(this)),this.addEvent("click.prevent",".js-survey-reselect",this.clickReselect.bind(this)),this.initProgressive()}},{key:"_$section",value:function(){return $("#".concat(this.$props.sectionId))}},{key:"_$groups",value:function(){return this._$section().find(".signup-survey__group")}},{key:"_$submit",value:function(){return this._$section().find(".signup-survey__submit-wrap")}},{key:"initProgressive",value:function(){this._$groups().each(function(a,b){return $(b).toggle(0===a)}),this._$submit().hide()}},{key:"revealNext",value:function(a){var b=a.nextAll(".signup-survey__group").first();b.length?(b.show(),b.is(this._$groups().last())&&this._$submit().show(),this.scrollToArea(b)):(this._$submit().show(),this.scrollToArea(this._$submit()))}},{key:"scrollToArea",value:function(a){var b=this._$section().find("header").outerHeight()||80;window.scrollTo({top:a.offset().top-b-20,behavior:"smooth"})}},{key:"clickChip",value:function(a){var b=$(a.target).closest(".Btn-TabM"),c=b.closest(".signup-survey__group"),d=c.hasClass("signup-survey__group--multiple");return d?void b.toggleClass("active"):void(c.find(".Btn-TabM").removeClass("active"),b.addClass("active"),c.addClass("is-selected"),this.revealNext(c))}},{key:"clickReselect",value:function(a){var b=$(a.target).closest(".signup-survey__group");b.removeClass("is-selected"),b.find(".Btn-TabM").removeClass("active")}}])}(_Layout2.Layout);
264
265},{"./Layout.js":85}],89:[function(require,module,exports){
266"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SnsButtonsLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
266function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var SnsButtonsLayout=exports.SnsButtonsLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop business-email-type\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        ").concat(this.getPromoBannerTemplate(),"\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            ").concat(this.getNexPageButtonTemplate(),"\n                        </div>\n                    </article>\n                </section>")}}])}(_Layout2.Layout);
267
268},{"./Layout.js":85}],90:[function(require,module,exports){
269"use strict";var _Layout2=require("./Layout.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubDomainLayout=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var SubDomainLayout=exports.SubDomainLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.sectionId,b=void 0===a?"":a;return"\n                <section id=\"".concat(b,"\" class=\"signup-wide-pop\">\n                    <header class=\"js-section-header\"></header>\n                    <article>
269\n                        <div class=\"pop-main js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            <div id=\"subDomainInputLayer\" class=\"url-wrap\"> </div>\n                            ").concat(this.getNexPageButtonTemplate(),"\n                            ").concat(this.getInfoTextTemplate(),"\n                        </div>\n                    </article>\n                </section>")}},{key:"getSubDomainInputLayer",value:function(){return $("#subDomainInputLayer")}},{key:"getInfoTextTemplate",value:function(){var a=this.$props.infoText,b=void 0===a?"":a;return Mutil.empty(b)?"":"<p class=\"info-txt\"><i class=\"sign-icons-exclamation\"></i>".concat(b,"</p>")}}])}(_Layout2.Layout);
270
271},{"./Layout.js":85}],91:[function(require,module,exports){
272"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserProfileLayout=void 0;var _Layout2=require("./Layout.js"),_MarketingAgreementCheckbox=_interopRequireDefault(require("../check-box/MarketingAgreementCheckbox.js"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var UserProfileLayout=exports.UserProfileLayout=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.sectionId,c=void 0===b?"":b,d=a.nextButton.disabled;return"\n                <section id=\"".concat(c,"\" class=\"signup-wide-pop business-email-type btn-bottom-case\">\n                    <header class=\"js-section-header\"></header>\n                    <article>\n                        ").concat(this.getPromoBannerTemplate(),"\n                        <div class=\"pop-main 
272js-contents-main\">\n                            ").concat(this.getMainTextTemplate(),"\n                            ").concat(this.getSubTextTemplate(),"\n                            <div class=\"join-existing-company signup-help-banner\">\n                                <span>").concat(Often.isGlobal()?i18next.t(login.alreadyUsingFlow):"\uD68C\uC0AC\uC5D0\uC11C \uC774\uBBF8 \uD50C\uB85C\uC6B0\uB97C \uC0AC\uC6A9 \uC911\uC774\uC2E0\uAC00\uC694?","</span>\n                                <a href=\"#\" class=\"js-existing-team-link\">").concat(Often.isGlobal()?i18next.t(login.existingTeam):"\uCC38\uC5EC\uD558\uAE30","</a>\n                            </div>\n                            <ul class=\"user-info-wrap\">\n                                <li id=\"companyNameLayer\">\n                                    <div class=\"interactive-form-wrap js-interactive-form-wrap\">\n                                        <input type=\"text\" id=\"teamNameInput\" class=\"interactive-form-input\" placeholder=\"\" autocomplete=\"off\" maxlength=\"50\" tabindex=\"1\">\n                                        <span class=\"interactive-form-placeholder\">").concat(Often.isGlobal()?i18next.t(login.companyName):"\uD68C\uC0AC\uBA85","</span>\n                                    </div>\n                                    <p class=\"error-txt-wrap\"><span class=\"js-error-txt\"></span></p>\n                                </li>\n                                <li id=\"userNameLayer\"></li>\n                                <li id=\"passwordLayer\"></li>\n                                <li id=\"phoneAuthLayer\" class=\"phone-confirm-wrap\"></li>\n                            </ul>\n                            <div class=\"bottom-button-wrap\">\n                                ").concat(this.getNexPageButtonTemplate(void 0!==d&&d),"\n                            </div>\n                            <div class=\"marketing-agree-wrap\">\n                            ").concat(this.getMarketingAgreeCheckbox(),"\n                            </div>\n                        </div>\n                    </article>\n                </section>")}},{key:"getUserNameLayer",value:function(){return $("#userNameLayer")}},{key:"getPasswordLayer",value:function(){return $("#passwordLayer")}},{key:"getPhoneAuthLayer",value:function(){return $("#phoneAuthLayer")}},{key:"getMarketingAgreeCheckbox",value:function(){var a=(0,_MarketingAgreementCheckbox.default)("module");return a.init(),a.render()}},{key:"getNexPageButtonTemplate",value:function(){var a=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0],b=this.$props.nextButton,c=void 0===b?{}:b;return 0<Object.values(c).length?"<button id = \"".concat(c.id,"\" class=\"js-next-page-button button-sign-next btn-next\" tabindex=\"4\" ").concat(a?"disabled":"",">").concat(Mutil.n2v(c.text),"</button>"):""}}])}(_Layout2.Layout);
273
274},{"../check-box/MarketingAgreementCheckbox.js":66,"./Layout.js":85}],92:[function(require,module,exports){
275"use strict";var _SignUpComponent2=require("../SignUpComponent.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.LoadingPopup=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
275function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var LoadingPopup=exports.LoadingPopup=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props,b=a.loadingText,c=void 0===b?i18next.t(main.alert.signupProcessing):b,d=a.isNoLoadingText;return"\n             <section id=\"popDimmed\" class=\"spinner-loading-pop\" style=\"display: flex;\">\n              <article>\n                <div class=\"pop-cont\">\n                  <div class=\"loading type2\">\n                    <i class=\"circle\"></i>\n                    <i class=\"circle\"></i>\n                    <i class=\"circle\"></i>\n                    <i class=\"circle\"></i>\n                    <i class=\"circle\"></i>\n                  </div>\n                  <div>\n                    <p>".concat(c,"</p>\n                    <p>").concat(void 0!==d&&d?"":i18next.t(common.wait)+"...","</p>\n                  </div>\n       \n                </div>\n              </article>\n            </section>\n        ")}},{key:"removePopup",value:function(){$("#popDimmed").remove()}}])}(_SignUpComponent2.SignUpComponent);
276
277},{"../SignUpComponent.js":57}],93:[function(require,module,exports){
278"use strict";var _SignUpComponent2=require("../SignUpComponent.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TermAgreePopup=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var TermAgreePopup=exports.TermAgreePopup=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){return"\n            <section id=\"popDimmed\" class=\"term-agree-pop\" style=\"display: flex\">
278\n                <div id=\"popMainLayer\" class=\"pop-type-basic\">\n                    <div class=\"cont\">\n                        <ul>\n                            <li id=\"allCheckBtnLayer\" class=\"js-check-input-layer\">\n                                <label class=\"labelSelectSquareS\">\n                                    <input type=\"checkbox\" id=\"allCheckBtn\">\n                                    <i></i>\n                                    <span>".concat(Often.isGlobal()?i18next.t(login.agreeAll):"\uC804\uCCB4 \uB3D9\uC758","</span>\n                                </label>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <label class=\"labelSelectSquareS\">\n                                    <input type=\"checkbox\" class=\"js-check-input js-required\" id=\"ageAgree\">\n                                    <i></i>\n                                    <span><em>(").concat(i18next.t(login.required),")</em> ").concat(Often.isGlobal()?i18next.t(common.overAged):"\uB9CC 14\uC138 \uC774\uC0C1 \uD655\uC778","</span>\n                                </label>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <label class=\"labelSelectSquareS\">\n                                    <input type=\"checkbox\" class=\"js-check-input js-required\" id=\"serviceAgree\">\n                                    <i></i>\n                                    <span><em>(").concat(i18next.t(login.required),")</em> ").concat(Often.isGlobal()?i18next.t(login.termsOfUse):"\uC11C\uBE44\uC2A4 \uC774\uC6A9\uC57D\uAD00 \uB3D9\uC758","</span>\n                                </label>\n                                <i data-link=\"/terms\" class=\"ic-ic-095-b js-move-page\"></i>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <label class=\"labelSelectSquareS\">\n                                    <input type=\"checkbox\" class=\"js-check-input js-required\" id=\"privacyAgree\">\n                                    <i></i>\n                                    <span><em>(").concat(i18next.t(login.required),")</em> ").concat(Often.isGlobal()?i18next.t(login.privacyPolicy):"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68 \uB3D9\uC758","</span>\n                                </label>\n                                <i data-link=\"/privacy\" class=\"ic-ic-095-b js-move-page\"></i>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <label class=\"labelSelectSquareS\">\n                                    <input type=\"checkbox\" class=\"js-check-input\" id=\"marketingAgree\">\n                                    <i></i>\n                                    <span>(").concat(i18next.t(login.option),") ").concat(Often.isGlobal()?i18next.t(login.marketingConsent):"\uB9C8\uCF00\uD305 \uC815\uBCF4 \uC218\uC2E0 \uB3D9\uC758","</span>\n                                </label>\n                                <i data-link=\"http://flow.team/ko/term-mkt\" class=\"ic-ic-095-b js-move-page\"></i>\n                            </li>\n                        </ul>\n                    </div>\n                    <div class=\"btn-wrap\">\n                        <button id=\"termAgreeCancelBtn\" class=\"BasicL_LineA\">").concat(i18next.t(dictionary.cancel),"</button>\n                        <button id=\"termAgreeContinueBtn\" class=\"BasicL_Face disabled\" disabled>").concat(Often.isGlobal()?i18next.t(login.agreeContinue):"\uD655\uC778","</button>\n                    </div>\n                </div>\n            </section>\n        ")}},{key:"mounted",value:function(){var a;null===(a=document.activeElement)||void 0===a||a.blur()}},{key:"setEvent",value:function(){var a=this;this.addEvent("click","#popDimmed",function(b){0<$(b.target).closest("#popMainLayer").length||a.removePopup()}),this.addEvent("change",".js-check-input, #allCheckBtn",this.changeCheckboxHandler.bind(this)),this.addEvent("click",".js-move-page",this.movePageBtnClickEvent.bind(this)),this.addEvent("click","#termAgreeCancelBtn",this.removePopup.bind(this)),this.addEvent("click","#termAgreeContinueBtn",this.clickContinueBtn.bind(this)),$(document).on("keydown.termAgreePopup",function(b){"Escape"!==b.key||a.removePopup()})}},{key:"changeCheckboxHandler",value:function(a){var b=$(a.target);b.is("#allCheckBtn")?this.syncAllToChildren():this.syncAllFromChildren(),this.toggleActiveContinueBtn()}},{key:"syncAllToChildren",value:function(){var a=$("#allCheckBtn").prop("checked");$("#popDimmed").find(".js-check-input").prop("checked",a)}},{key:"syncAllFromChildren",value:function(){$("#allCheckBtn").prop("checked",this.isAllCheck())}},{key:"clickContinueBtn",value:function(){if(!this.existOfUncheckedRequiredInput()){var a=this.$props.onAgree,b=void 0===a?Mutil.noop:a,c=$("#marketingAgree").prop("checked")?"Y":"N";this.removePopup(),b({marketingYn:c})}}},{key:"toggleActiveContinueBtn",value:function(){var a=$("#termAgreeContinueBtn"),b=this.existOfUncheckedRequiredInput();a.toggleClass("disabled",b).prop("disabled",b)}},{key:"movePageBtnClickEvent",value:function(a){a.stopPropagation();
278var b=Mutil.n2v($(a.target).closest(".js-move-page").data("link"));Mutil.empty(b)||Mutil.open(b,"_blank")}},{key:"existOfUncheckedRequiredInput",value:function(){var a=$("#popDimmed").find(".js-required");return Array.from(a).some(function(a){return!$(a).prop("checked")})}},{key:"isAllCheck",value:function(){var a=$("#popDimmed").find(".js-check-input");return Array.from(a).every(function(a){return $(a).prop("checked")})}},{key:"removePopup",value:function(){$(document).off("keydown.termAgreePopup");var a=$("#popDimmed");a.off().find("*").off(),a.remove()}}])}(_SignUpComponent2.SignUpComponent);
279
280},{"../SignUpComponent.js":57}],94:[function(require,module,exports){
281"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TermPopup=void 0;var _SignUpComponent2=require("../SignUpComponent.js"),_store=require("../../store.js"),_index=require("../../util/view-changer/index.js"),_LoadingPopup=require("./LoadingPopup.js"),_constant=require("../../constant.js"),_index2=require("../../../../bridge/renewal-signup/index.js");function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
281return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var TermPopup=exports.TermPopup=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function a(){return"\n            <section id=\"popDimmed\" class=\"agree-mini-pop\" style=\"display: flex\">\n                <article id=\"popMainLayer\">\n                    <header>\n                        <h3>".concat(i18next.t(login.conditions),"</h3>\n                        <button id=\"popupCancelBtn\" ><i class=\"sign-icons-close\"></i></button>\n                    </header>\n                    <div class=\"pop-cont\">\n                        <ul>\n                            <li id=\"allCheckBtnLayer\" class=\"js-check-input-layer\">\n                                <input type=\"checkbox\"  id=\"allCheckBtn\" class=\"\" />\n                                <label for=\"allCheckBtn\"></label><span>").concat(i18next.t(login.agreeAll),"</span>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <input type=\"checkbox\" class=\"js-check-input js-required\" id=\"04\" />\n                                <label for=\"04\"></label><span><em>(").concat(i18next.t(login.required),")</em> ").concat(i18next.t(common.overAged),"</span>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <input type=\"checkbox\" class=\"js-check-input js-required\" id=\"02\" />\n                                <label for=\"02\"></label><span><em>(").concat(i18next.t(login.required),")</em> ").concat(i18next.t(login.termsOfUse),"</span><i data-link = \"/terms\" class=\"sign-icons-arrow-mini js-move-page\"></i>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <input type=\"checkbox\" class=\"js-check-input js-required\"  id=\"03\" />\n                                <label for=\"03\"></label><span><em>(").concat(i18next.t(login.required),")</em> ").concat(i18next.t(login.privacyPolicy),"</span><i data-link = \"/privacy\" class=\"sign-icons-arrow-mini js-move-page\"></i>\n                            </li>\n                            <li class=\"js-check-input-layer\">\n                                <input type=\"checkbox\" class=\"js-check-input\" id=\"marketingTerm\" />\n                                <label for=\"marketingTerm\"></label><span>(").concat(i18next.t(login.option),") ").concat(i18next.t(login.marketingConsent),"</span><i  data-link = \"http://flow.team/ko/term-mkt\" class=\"sign-icons-arrow-mini js-move-page\"></i>\n                            </li>\n                        </ul>\n                        <button id=\"moveCompanyJoinBtn\" class=\"inactive\">").concat(i18next.t(dictionary.confirm),"</button>\n                    </div>\n                </article>\n            </section>\n        ")}},{key:"setEvent",value:function a(){var b=this;this.addEvent("click","#popDimmed",function(a){var c=0<$(a.target).closest("#popMainLayer").length;c||b.removePopup()}),this.addEvent("click.prevent",".js-check-input-layer",this.clickEventHandlerOfInputLayer.bind(this)),this.addEvent("click","#popupCancelBtn",this.removePopup.bind(this)),this.addEvent("click","#moveCompanyJoinBtn",this.clickEventHandlerOfJoinBtn.bind(this))}},{key:"clickEventHandlerOfJoinBtn",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(!this.existOfUncheckedRequiredInput()){a.n=1;break}return Mutil.mlog("\uD544\uC218 \uD56D\uBAA9\uC774 \uBAA8\uB450 \uCCB4\uD06C\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."),a.a(2);case 1:if(c=$("#marketingTerm").prop("checked")?"Y":"N",(0,_store.addMarketingYn)(c),!(0,_store.isGuestUser)()){a.n=3;break}return a.n=2,this.getGuestRegister();case 2:return a.a(2);case 3:if(this.removePopup(),d=$(this.$target).find("article"),new _LoadingPopup.LoadingPopup(d,{isAppend:!0,loadingText:i18next.t(common.wait)}),Mutil.empty(null===(b=window)||void 0===b?void 0:b.CONNECT_INVITE_KEY)){a.n=7;break}return a.n=4,(0,_store.getUser)().joinCompanyBySubDom();
281case 4:if(e=a.v,f=Mutil.n2v(e.ERROR_CODE)===_constant.ERROR_CODE.SUCCESS,g=Mutil.n2v(e.ERR_CD)===_constant.ERROR_CODE.BLOCK_DOMAIN,!g){a.n=5;break}return Mutil.toast("error",i18next.t(exception.error.limitEmail)),a.a(2);case 5:if(f||Mutil.toast("error",i18next.t(common.occupy,{val:$t(dictionary.email)})),new _LoadingPopup.LoadingPopup($("body"),{}),h="Y"===Mutil.n2v(e.JNNG_ATHZ_YN,"N"),!h){a.n=6;break}return i=Often.isGlobal()?"new_signup6":"new_joinup3_a",(0,_store.collectGtm)(i),(0,_store.getUser)().signInWithTwoFactor(e),a.a(2);case 6:return _index.SignUpViewChanger.loadCompanyJoinWaitView(),a.a(2);case 7:_index.SignUpViewChanger.loadCompanyInviteView();case 8:return a.a(2)}},a,this)}));return a}()},{key:"clickEventHandlerOfInputLayer",value:function b(a){var c=0<$(a.target).closest(".js-move-page").length;if(c)return void this.movePageBtnClickEvent(a);var d=0<$(a.target).closest("#allCheckBtnLayer").length;d?this.toggleAllCheckBtn(a):this.checkInputClickEvent(a),this.toggleActiveJoinButton()}},{key:"removePopup",value:function a(){var b=$("#popDimmed");b.off().find("*").off(),$("#popDimmed").remove()}},{key:"moveTermsPage",value:function b(a){if(0!==a.length){var c=Mutil.n2v(a.data("link"));return Mutil.empty(c)?void Mutil.mlog("\uC774\uB3D9\uD560 \uC57D\uAD00 \uD398\uC774\uC9C0 URL \uC815\uBCF4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. "):void Mutil.open(c,"_blank")}}},{key:"checkTermsInput",value:function b(a){if(0!==a.length){var c=$("#allCheckBtn"),d=a.prop("checked");return d?void(a.prop("checked",!1),c.prop("checked",!1)):(a.prop("checked",!0),void(this.isAllCheck()&&c.prop("checked",!0)))}}},{key:"checkInputClickEvent",value:function b(a){var c=$(a.target).closest(".js-check-input-layer"),d=c.find(".js-check-input");this.checkTermsInput(d)}},{key:"toggleActiveJoinButton",value:function a(){var b=$("#moveCompanyJoinBtn");return this.existOfUncheckedRequiredInput()?void(b.hasClass("inactive")||b.addClass("inactive")):void(b.hasClass("inactive")&&b.removeClass("inactive"))}},{key:"movePageBtnClickEvent",value:function b(a){var c=$(a.target).closest(".js-move-page");this.moveTermsPage(c)}},{key:"getGuestRegisterBySns",value:function a(){return(0,_store.isSnsSignUp
281)()?(0,_store.isWebView)()?void(0,_index2.mobileSignIn)((0,_store.getUser)().getRegisterGuestBySnsJson()):void(0,_store.getUser)().registerGuestBySnS():void 0}},{key:"getGuestRegister",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return Mutil.mlog((0,_store.getUserInfo)()),new _LoadingPopup.LoadingPopup($("body"),{}),a.n=1,(0,_store.getUser)().registerGuest();case 1:if(b=a.v,c=b.ERR_CD,d=void 0===c?"":c,e=b.PASS_JSON,f=void 0===e?{}:e,g=Mutil.n2v(d)===_constant.ERROR_CODE.SUCCESS,g){a.n=2;break}return _index.SignUpViewChanger.loadGuestEmailView("",d),a.a(2);case 2:if(!(0,_store.isSnsSignUp)()){a.n=3;break}return this.getGuestRegisterBySns(),a.a(2);case 3:if(!(0,_store.isWebView)()){a.n=4;break}return(0,_index2.mobileSignIn)((0,_store.getUser)().getSignInJson()),a.a(2);case 4:h=Mutil.requireIIFE("CommonLogin"),h.goLogin(_objectSpread({},f));case 5:return a.a(2)}},a,this)}));return a}()},{key:"existOfUncheckedRequiredInput",value:function a(){var b=$("#popDimmed"),c=b.find(".js-required"),d=Array.from(c).filter(function(a){return!$(a).prop("checked")});return 0<d.length}},{key:"isAllCheck",value:function a(){var b=$("#popDimmed"),c=b.find(".js-check-input"),d=Array.from(c).filter(function(a){return!$(a).prop("checked")});return 0===d.length}},{key:"toggleAllCheckBtn",value:function a(){var b=$("#allCheckBtn"),c=$("#popDimmed").find(".js-check-input");return b.prop("checked")?(b.prop("checked",!1),void c.prop("checked",!1)):void(b.prop("checked",!0),c.prop("checked",!0))}}])}(_SignUpComponent2.SignUpComponent);
282
283},{"../../../../bridge/renewal-signup/index.js":4,"../../constant.js":98,"../../store.js":100,"../../util/view-changer/index.js":108,"../SignUpComponent.js":57,"./LoadingPopup.js":92}],95:[function(require,module,exports){
284"use strict";var _Select2=require("./Select.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyCategorySelect=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyCategorySelect=exports.CompanyCategorySelect=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.addClassName,b=void 0===a?"":a;return"\n            <div class=\"interactive-form-wrap js-interactive-form-wrap\">\n            \n              <i class=\"sign-icons-arrow-mini\"></i>\n              <select id=\"joinTeamSector\" class=\"join-select-input interactive-form-input ".concat(b,"\" \n                  data-required-yn=\"Y\" \n                  data-empty-msg=\"").concat(i18next.t(login.selectCompanyCategory),"\">>\n                    ").concat(this.getOptionsTemplate(),"\n              </select>
284\n              <span class=\"interactive-form-placeholder\">").concat(i18next.t(login.companyCategory),"</span>\n            </div>\n              <p class=\"error-txt-wrap\">\n                <span class=\"js-error-txt\"></span>\n              </p>")}},{key:"getQuerySelectorOfSelect",value:function(){return"#joinTeamSector"}},{key:"getOptionsDataArr",value:function(){return Often.isGlobal()?[{value:"Consulting Services",text:"".concat(i18next.t(login.category.consult))},{value:"Creative",text:"".concat(i18next.t(login.category.creative))},{value:"Manufacturing",text:"".concat(i18next.t(login.category.produce))},{value:"Information Technology (IT)",text:"".concat(i18next.t(login.category.tech))},{value:"Business Franchises",text:"".concat(i18next.t(login.category.franchise))},{value:"Distribution",text:"".concat(i18next.t(login.category.logistics))},{value:"Arts and Entertainment",text:"".concat(i18next.t(login.category.entertain))},{value:"Public Administration",text:"".concat(i18next.t(login.category.public))},{value:"Construction",text:"".concat(i18next.t(login.category.construct))},{value:"Healthcare",text:"".concat(i18next.t(login.category.medical))},{value:"Service",text:"".concat(i18next.t(login.category.service))},{value:"Finance",text:"".concat(i18next.t(login.category.finance))},{value:"Association",text:"".concat(i18next.t(login.category.association))},{value:"Education and Research",text:"".concat(i18next.t(login.category.research))},{value:"Agriculture",text:"".concat(i18next.t(login.category.primaryIndustry))},{value:"Others",text:"".concat(i18next.t(login.category.etc))}]:[{value:"",text:"".concat(i18next.t(login.selectCompanyCategory))},{value:"Produce",text:"".concat(i18next.t(login.category.produce))},{value:"IT",text:"".concat(i18next.t(login.category.tech))},{value:"Logistics",text:"".concat(i18next.t(login.category.logistics))},{value:"Public",text:"".concat(i18next.t(login.category.public))},{value:"Finance",text:"".concat(i18next.t(login.category.finance))},{value:"Service",text:"".concat(i18next.t(login.category.service))},{value:"Franchise",text:"".concat(i18next.t(login.category.franchise))},{value:"Construct",text:"".concat(i18next.t(login.category.construct))},{value:"Research",text:"".concat(i18next.t(login.category.research))},{value:"Tax",text:"".concat(i18next.t(login.category.tax))},{value:"Medical",text:"".concat(i18next.t(login.category.medical))},{value:"Entertain",text:"".concat(i18next.t(login.category.entertain))},{value:"Association",text:"".concat(i18next.t(login.category.association))},{value:"etc",text:"".concat(i18next.t(login.category.etc))}]}}])}(_Select2.Select);
285
286},{"./Select.js":97}],96:[function(require,module,exports){
287"use strict";var _Select2=require("./Select.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.HopeUserCountSelect=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
287function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var HopeUserCountSelect=exports.HopeUserCountSelect=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"template",value:function(){var a=this.$props.addClassName,b=void 0===a?"":a;return"\n            <div class=\"interactive-form-wrap js-interactive-form-wrap\">\n                <i class=\"sign-icons-arrow-mini\"></i>\n                  <select id=\"hopeCountSelect\" class=\"join-select-input interactive-form-input ".concat(b,"\" \n                      data-required-yn=\"Y\" \n                      data-empty-msg=\"").concat(i18next.t(login.expectMember),"\">>\n                        ").concat(this.getOptionsTemplate(),"\n                  </select>\n                  <span class=\"interactive-form-placeholder\">").concat(i18next.t(common.estimatedNumberOfPeople),"</span>\n            </div>  \n              <p class=\"error-txt-wrap\">\n                <span class=\"js-error-txt\"></span>\n              </p>\n            ")}},{key:"getOptionsDataArr",value:function(){return[{value:"",text:"".concat(i18next.t(login.expectMember))},{value:"10",text:"".concat(i18next.t(login.countBelow,{count:10}))},{value:"11",text:"".concat(i18next.t(login.countBetween,{above:10,below:30}))},{value:"31",text:"".concat(i18next.t(login.countBetween,{above:31,below:50}))},{value:"51",text:"".concat(i18next.t(login.countBetween,{above:51,below:99}))},{value:"100",text:"".concat(i18next.t(login.countOver,{count:100}))},{value:"500",text:"".concat(i18next.t(login.countOver,{count:500}))},{value:"1000",text:"".concat(i18next.t(login.countOver,{count:1e3}))}]}},{key:"getQuerySelectorOfSelect",value:function(){return"#hopeCountSelect"}},{key:"setEvent",value:function(){var a=this;_superPropGet(b,"setEvent",this,3)([]),Often.isGlobal()||this.addEvent("change",this.getQuerySelectorOfSelect(),function(){100<=+Mutil.n2v($(a.getQuerySelectorOfSelect()).val(),"0")?$(".js-service-type-layer").css("display","flex"):$(".js-service-type-layer").css("display","none")})}}])}(_Select2.Select);
288
289},{"./Select.js":97}],97:[function(require,module,exports){
290"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Select=void 0;var _SignUpComponent2=require("../SignUpComponent.js"),_index=require("../../util/input-error-handler/index.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
290function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var Select=exports.Select=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"getOptionsTemplate",value:function(){var a=this;return this.getOptionsDataArr().map(function(b){return a.getOptionTemplate(b)}).join(" ")}},{key:"getOptionsDataArr",value:function(){return[]}},{key:"getOptionTemplate",value:function(a){return""===a.value?"<option selected value=\"".concat(a.value,"\">").concat(a.text,"</option>"):"<option value=\"".concat(a.value,"\">").concat(a.text,"</option>")}},{key:"setEvent",value:function(){var a=this;this.addEvent("click.stop",this.getQuerySelectorOfSelect(),function(a){_index.InputErrorHandler.unActiveErrorModeAboutInput($(a.target))}),this.addEvent("change",this.getQuerySelectorOfSelect(),function(){var b=$("".concat(a.getQuerySelectorOfSelect()));return 0===a.getSelectValue().length?void(b.hasClass("active")&&b.removeClass("active")):void(!b.hasClass("active")&&b.addClass("active"))}),this.interactiveFormFunc()}},{key:"getQuerySelectorOfSelect",value:function(){return"select"}},{key:"getSelectValue",value:function(){return $(this.getQuerySelectorOfSelect()).val()}}])}(_SignUpComponent2.SignUpComponent);
291
292},{"../../util/input-error-handler/index.js":102,"../SignUpComponent.js":57}],98:[function(require,module,exports){
293"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAIL=exports.ID_GB=exports.GUEST_PLAN_ID=exports.ERROR_CODE=exports.ENCRYPT=exports.DEFAULT_SUB_DOMAIN=exports.ACCESS_TYPE=void 0;var ID_GB=exports.ID_GB={NORMAL:"1",KAKAO:"2",GOOGLE:"3",APPLE:"11"},ERROR_CODE=exports.ERROR_CODE={SUCCESS:"0000",EXIST_SUB_DOMAIN:"1000",EXIST_COMPANY:"3000",EXIST_EMAIL:"5000",EXIST_COMPANY_INVIT:"6000",VERIFICATION_FORGED:"4444",BLOCK_DOMAIN:"7000"},ENCRYPT=exports.ENCRYPT={SIMPLE:"Y",SERVER_TIME_CHECK:"YC"},MAIL=exports.MAIL={GMAIL:{NAME:"GMAIL",WEB:"https://mail.google.com/mail/u/0/",PLAY_STORE:"com.google.android.gm",APP_STORE:"https://apps.apple.com/kr/app/gmail-email-from-google/id422689480?ign-mpt=uo%3D4&l=ko&v0=WWW-APIN-ITSTOP100-FREEAPPS",SCHEME:"googlegmail://mail/"},OUTLOOK:{NAME:"OUTLOOK",WEB:"https://outlook.live.com/mail/0/inbox",PLAY_STORE:"com.microsoft.office.outlook",APP_STORE:"https://apps.apple.com/kr/app/microsoft-outlook-email-calendar/id951937596",SCHEME:"ms-outlook://mail/"}},DEFAULT_SUB_DOMAIN=exports.DEFAULT_SUB_DOMAIN="team",GUEST_PLAN_ID=exports.GUEST_PLAN_ID="guest",ACCESS_TYPE=exports.ACCESS_TYPE={BROWSER:"BROWSER",WEB_VIEW:"WEB_VIEW"};
294
295},{}],99:[function(require,module,exports){
296"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MorningMateBusinessEmailInputView=void 0;var _Header=require("../components/Header.js"),_EmailInput=require("../components/input/EmailInput.js"),_inputValidation=require("../util/input-validate/inputValidation.js"),_index=require("../../../apiCall/signup/index.js"),_index2=require("../util/input-error-handler/index.js"),_store=require("../store.js"),_index3=require("../util/view-changer/index.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
296q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function draw(){$("body").append(getTemplate()),new _Header.Header($("#morningmateBusinessEmailInputSection").find(".js-section-header"),{isShowLoginBtn:!0,isShowPrevBtn:!0}),new _EmailInput.EmailInput($("#morningmateBusinessEmailInputSection").find(".js-contents-main"),{isAfter:!0,$posTarget:$("#subTxt"),isLast:!0,addClass:"",submit:moveEmailAuthView}),$("#moveMorningMate").off("click").on("click",function(){moveEmailAuthView()})}function getTemplate(){var a=Often.isGlobal()?i18next.t(login.freetrialMorningmate):i18next.t(login.freetrial30d);return"\n        <section id=\"morningmateBusinessEmailInputSection\" class=\"signup-wide-pop morningmate-type\">\n          <header class=\"js-section-header\"></header>\n          <article>\n            <div class=\"pop-main js-contents-main\">\n              <h3>".concat(getMainText(),"</h3>\n              <p id =\"subTxt\">").concat(getSubText(),"</p>\n              <button id=\"moveMorningMate\">").concat(a,"</button>\n            </div>\n            <p class=\"bottom-text\" style=\"text-align: center\">\n                 ").concat(getPolicyBottomTemplate(),"\n            </p>\n          </article>\n        </section>\n    ")}function getSubText(){var a=Mutil.requireIIFE("Internationalization");if(!a.getCurrentLanguage().toLowerCase().includes("en"))return"".concat(i18next.t(login.starFreeTrialDesc));var b=(0,_store.getPlanId)();return-1<b.indexOf("BUSINESS")?i18next.t(login.starFreeTrialDesc):-1<b.indexOf("PRO")?"No credit card needed. <br /> You can continue, upgrade, or downgrade after.":i18next.t(login.starFreeTrialDesc)}function getMainText(){var a=(0,_store.getPlanId)();return-1<a.indexOf("BUSINESS")&&Often.isGlobal()?"Enjoy the Morningmate Boost!":i18next.t(-1<a.indexOf("BUSINESS")?login.useForFree:login.useForFreeMorningmate)}function getPolicyBottomTemplate(){if(Often.isGlobal())return"";var a="<a href=\"https://flow.team/kr/terms\" target=\"".concat((0,_store.isWebView)()?"_self":"_blank","\">").concat(i18next.t(login.srvcetrms),"</a>, <a href=\"https://flow.team/kr/privacy\" target=\"").concat((0,_store.isWebView)()?"_self":"_blank","\">").concat(i18next.t(login.pvcyplcy),"</a>"),b=Mutil.requireIIFE("Internationalization");return b.getCurrentLanguage().toLowerCase().includes("en")?"By signing up, you agree to our "+a+".<br />
296You also agree to receive product related emails.":"ko"===b.getCurrentLanguage().toLowerCase()||"ja"===b.getCurrentLanguage().toLowerCase()?a+"".concat(i18next.t(login.agreepvcy)):"".concat(i18next.t(login.agreepvcy))+a}function isDuplicateEmail(a){return"0000"!==Mutil.n2v(a)}function moveEmailAuthView(){return _moveEmailAuthView.apply(this,arguments)}function _moveEmailAuthView(){return _moveEmailAuthView=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=$("#emailInput"),_inputValidation.InputValidator.inputValidate(b)){a.n=1;break}return a.a(2);case 1:return c=b.val(),a.n=2,(0,_index.checkDuplicateEmail)(c);case 2:if(d=a.v,!isDuplicateEmail(d.ERR_CD)){a.n=3;break}return _index2.InputErrorHandler.activeErrorModeAboutInput(b,i18next.t(common.occupy,{val:$t(dictionary.email)})),a.a(2);case 3:(0,_store.addEmail)(c),_index3.SignUpViewChanger.loadEmailAuthView();case 4:return a.a(2)}},a)})),_moveEmailAuthView.apply(this,arguments)}var MorningMateBusinessEmailInputView=exports.MorningMateBusinessEmailInputView={draw:draw};
297
298},{"../../../apiCall/signup/index.js":1,"../components/Header.js":55,"../components/input/EmailInput.js":70,"../store.js":100,"../util/input-error-handler/index.js":102,"../util/input-validate/inputValidation.js":104,"../util/view-changer/index.js":108}],100:[function(require,module,exports){
299"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setIsProjectInvitation=exports.setAuthHash=exports.setAsGuestUser=exports.isWebView=exports.isSnsSignUp=exports.isProjectInviation=exports.isInitUser=exports.isGuestUser=exports.isGoogleSignUp=exports.isAzureSignUp=exports.initUser=exports.initTestUserInfo=exports.initAccess=exports.getUserName=exports.getUserInfo=exports.getUserId=exports.getUser=exports.getPlanId=exports.getPhoneNumber=exports.getPhoneAuthCompleted=exports.getJoinUseInttId=exports.getEmail=exports.getAuthHash=exports.collectGtm=exports.addUserName=exports.addUserId=exports.addSnsOauthData=exports.addServiceType=exports.addPhoneNumber=exports.addPhoneAuthCompleted=exports.addPassword=exports.addMarketingYn=exports.addJoinUseInttId=exports.addJobType=exports.addHopeCount=exports.addEmail=exports.addCompanySubDomain=exports.addCompanyName=exports.addCompanyCategory=void 0;var _user=require("./user/user.js"),_constant=require("./constant.js"),_trackerWorkspace=require("../../core/tracker-workspace.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var user=null,access=_constant.ACCESS_TYPE.BROWSER,checkGtmEvent=[],initAccess=exports.initAccess=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:_constant.ACCESS_TYPE.BROWSER;access=a},isWebView=exports.isWebView=function(){var a;return!!(null!==(a=window)&&void 0!==a&&a.isWebViewAccess)},collectGtm=exports.collectGtm=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"",c=!(2<arguments.length&&arguments[2]!==void 0)||arguments[2],d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{};if(!Mutil.empty(a)&&isInitUser()){var e=c?"".concat(a).concat(gtmSuffix(a)):a,f=[e,d.step_number,d.reason,d.result].filter(function(a){return void 0!==a&&null!==a&&""!==a}).join("#");if(!checkGtmEvent.includes(f)){checkGtmEvent.push(f);var g=Mutil.requireIIFE("GoogleTagManager");null===g||void 0===g||g.collect(_objectSpread(_objectSpread({event:"".concat(e),userId:b}
299,(0,_trackerWorkspace.workspaceProps)()),d))}}},gtmSuffix=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(Often.isGlobal())return"";return isGuestUser()?"":function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return-1<a.indexOf("joinup")}(a)?function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return Often.isGlobal()&&isSnsSignUp()?"new_joinup1_a"===a?"b":"_b":""}(a):isSnsSignUp()?"_b":Often.isGlobal()||"new_signup1"===a?"":"_a"},initUser=exports.initUser=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";user=new _user.User(a),user.setPlanId(b)},addEmail=exports.addEmail=function(a){checkNull(),user.setEmail(a),addUserId(a)},addUserId=exports.addUserId=function(a){checkNull(),user.setUserId(a)},addUserName=exports.addUserName=function(a){checkNull(),user.setUserName(a)},addPassword=exports.addPassword=function(a){checkNull(),user.setPassword(a)},addJobType=exports.addJobType=function(a){checkNull(),user.setJobType(a)},addMarketingYn=exports.addMarketingYn=function(a){checkNull(),user.setMarketingYn(a)},addCompanyName=exports.addCompanyName=function(a){checkNull(),user.setCompanyName(a)},addCompanyCategory=exports.addCompanyCategory=function(a){checkNull(),user.setCompanyCategory(a)},addCompanySubDomain=exports.addCompanySubDomain=function(a){checkNull(),user.setCompanySubDomain(a)},addHopeCount=exports.addHopeCount=function(a){checkNull(),user.setHopeCount(a)},addServiceType=exports.addServiceType=function(a){checkNull(),user.setServiceType(a)},addPhoneNumber=exports.addPhoneNumber=function(a){checkNull(),user.setPhoneNumber(a)},addPhoneAuthCompleted=exports.addPhoneAuthCompleted=function(a){checkNull(),user.setPhoneAuthCompleted(a)},getEmail=exports.getEmail=function(){return checkNull(),user.getEmail()},getUserId=exports.getUserId=function(){return checkNull(),user.getUserId()},getUserName=exports.getUserName=function(){return checkNull(),user.getUserName()},addJoinUseInttId=exports.addJoinUseInttId=function(a){return checkNull(),user.setJoinUseInttId(a)},getJoinUseInttId=exports.getJoinUseInttId=function(){return checkNull(),user.getJoinUseInttId()},setAsGuestUser=exports.setAsGuestUser=function(){var a=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0];return checkNull(),user.setAsGuestUser(a)},isGuestUser=exports.isGuestUser=function(){return checkNull(),user.isGuestUser()},getUserInfo=exports.getUserInfo=function(){return checkNull(),user.toString()},setIsProjectInvitation=exports.setIsProjectInvitation=function(a){return checkNull(),user.setIsProjectInvitation(a)},isProjectInviation=exports.isProjectInviation=function(){return checkNull(),user.getIsProjectInvitation()},isSnsSignUp=exports.isSnsSignUp=function(){return checkNull(),user.isSnsSignUp()},isGoogleSignUp=exports.isGoogleSignUp=function(){return checkNull(),user.getIdGb()===SignCode.TYPE.GOOGLE},isAzureSignUp=exports.isAzureSignUp=function(){return checkNull(),user.getIdGb()===SignCode.TYPE.AZURE},getUser=exports.getUser=function(){return checkNull(),user},getPlanId=exports.getPlanId=function(){return checkNull(),user.getPlanId()},getPhoneNumber=exports.getPhoneNumber=function(){return checkNull(),user.getPhoneNumber()},getPhoneAuthCompleted=exports.getPhoneAuthCompleted=function(){return checkNull(),user.getPhoneAuthCompleted()},getAuthHash=exports.getAuthHash=function(){return checkNull(),user.getAuthHash()},setAuthHash=exports.setAuthHash=function(a){return checkNull(),user.setAuthHash(a)},addSnsOauthData=exports.addSnsOauthData=function(a){var b=a.USER_ID,c=void 0===b?"":b,d=a.ID_GB,e=void 0===d?"":d,f=a.OBJ_CNTS_NM,g=void 0===f?"":f,h=a.EMAIL,i=void 0===h?"":h,j=a.USER_NM,k=void 0===j?"":j,l=a.PRFL_PHTG,m=void 0===l?"":l;checkNull(),addEmail(i),addUserName(k),addUserId(c),user.setDeviceName(g),user.setIdGb(e),user.setProfilePhoto(m)},initTestUserInfo=exports.initTestUserInfo=function(){initUser(!1),addEmail("[email protected]"),addPassword("test0123!"),addMarketingYn("Y"),addJobType("Marketing"),addJoinUseInttId("BFLOW_300000011273")},isInitUser=exports.isInitUser=function(){return null!==user},checkNull=function(){if(!isInitUser())throw new Error("\uC720\uC800\uB97C \uCD08\uAE30\uD654\uD574\uC8FC\uC138\uC694")};
300
301},{"../../core/tracker-workspace.js":30,"./constant.js":98,"./user/user.js":101}],101:[function(require,module,exports){
302"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.User=void 0;var _index=require("../../../apiCall/signup/index.js"),_signupFunnelTrack=require("../util/signup-funnel-track.js"),_constant=require("../constant.js"),_comm=require("../../../util/electron/comm.js"),_index2=require("../../../bridge/renewal-signup/index.js"),_store=require("../store.js"),_index3=require("../util/view-changer/index.js");function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
302:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _classPrivateFieldInitSpec(b,c,d){_checkPrivateRedeclaration(b,c),c.set(b,d)}function _checkPrivateRedeclaration(a,b){if(b.has(a))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(b,c){return b.get(_assertClassBrand(b,c))}function _classPrivateFieldSet(b,c,a){return b.set(_assertClassBrand(b,c),a),a}function _assertClassBrand(a,b,c){if("function"==typeof a?a===b:a.has(b))return 3>arguments.length?b:c;throw new TypeError("Private element is not present on this object")}var _userId=new WeakMap,_email=new WeakMap,_userName=new WeakMap,_isGuest=new WeakMap,_password=new WeakMap,_jobType=new WeakMap,_marketingYn=new WeakMap,_companyName=new WeakMap,_companyCategory=new WeakMap,_companySubDomain=new WeakMap,_joinUseInttId=new WeakMap,_idGb=new WeakMap,_profilePhoto=new WeakMap,_deviceNm=new WeakMap,_planId=new WeakMap,_hopeCount=new WeakMap,_phoneNumber=new WeakMap,_phoneAuthCompleted=new WeakMap,_authHash=new WeakMap,_serviceType=new WeakMap,_isProjectInvitation=new WeakMap,User=exports.User=function(){function a(b){_classCallCheck(this,a),_classPrivateFieldInitSpec(this,_userId,""),_classPrivateFieldInitSpec(this,_email,""),_classPrivateFieldInitSpec(this,_userName,""),_classPrivateFieldInitSpec(this,_isGuest,!1),_classPrivateFieldInitSpec(this,_password,""),_classPrivateFieldInitSpec(this,_jobType,""),_classPrivateFieldInitSpec(this,_marketingYn,""),_classPrivateFieldInitSpec(this,_companyName,""),_classPrivateFieldInitSpec(this,_companyCategory,""),_classPrivateFieldInitSpec(this,_companySubDomain,""),_classPrivateFieldInitSpec(this,_joinUseInttId,""),_classPrivateFieldInitSpec(this,_idGb,""),_classPrivateFieldInitSpec(this,_profilePhoto,""),_classPrivateFieldInitSpec(this,_deviceNm,""),_classPrivateFieldInitSpec(this,_planId,""),_classPrivateFieldInitSpec(this,_hopeCount,""),_classPrivateFieldInitSpec(this,_phoneNumber,""),_classPrivateFieldInitSpec(this,_phoneAuthCompleted,!1),_classPrivateFieldInitSpec(this,_authHash,""),_classPrivateFieldInitSpec(this,_serviceType,""),_classPrivateFieldInitSpec(this,_isProjectInvitation,!1),_classPrivateFieldSet(_isGuest,this,b),_classPrivateFieldSet(_idGb,this,"1")}return _createClass(a,[{key:"setUserId",value:function b(a){_classPrivateFieldSet(_userId,this,a)}},{key:"setEmail",value:function b(a){_classPrivateFieldSet(_email,this,a)}},{key:"getEmail",value:function a(){return _classPrivateFieldGet(_email,this)}},{key:"getUserId",value:function a(){return _classPrivateFieldGet(_userId,this)}},{key:"setUserName",value:function b(a){_classPrivateFieldSet(_userName,this,a)}},{key:"getUserName",value:function a(){return _classPrivateFieldGet(_userName,this)}},{key:"setPassword",value:function b(a){_classPrivateFieldSet(_password,this,a)}},{key:"setJobType",value:function b(a){_classPrivateFieldSet(_jobType,this,a)}},{key:"setMarketingYn",value:function b(a){_classPrivateFieldSet(_marketingYn,this,a)}},{key:"setAsGuestUser",value:function a(){var b=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0];_classPrivateFieldSet(_isGuest,this,b)}},{key:"isGuestUser",value:function a(){return _classPrivateFieldGet(_isGuest,this)}},{key:"setCompanyName",value:function b(a){_classPrivateFieldSet(_companyName,this,a)}},{key:"setCompanyCategory",value:function b(a){_classPrivateFieldSet(_companyCategory,this,a)}},{key:"setCompanySubDomain",value:function b(a){_classPrivateFieldSet(_companySubDomain,this,a)}},{key:"setJoinUseInttId",value:function b(a){_classPrivateFieldSet(_joinUseInttId,this,a)}},{key:"setIdGb",value:function b(a){_classPrivateFieldSet(_idGb,this,a)}},{key:"setIsProjectInvitation",value:function b(a){_classPrivateFieldSet(_isProjectInvitation,this,a)}},{key:"getIsProjectInvitation",value:function a(){return _classPrivateFieldGet(_isProjectInvitation,this)}},{key:"getIdGb",value:function a(){return _classPrivateFieldGet(_idGb,this)}},{key:"isSnsSignUp",value:function a(){return"1"!==_classPrivateFieldGet(_idGb,this)}},{key:"setProfilePhoto",value:function b(a){_classPrivateFieldSet(_profilePhoto,this,a)}},{key:"setDeviceName",value:function b(a){_classPrivateFieldSet(_deviceNm,this,a)}},{key:"getJoinUseInttId",value:function a(){return _classPrivateFieldGet(_joinUseInttId,this)}},{key:"setPlanId",value:function b(a){_classPrivateFieldSet(_planId,this,a)}},{key:"getPlanId",value:function a(){return Mutil.n2v(_classPrivateFieldGet(_planId,this))}},{key:"setHopeCount",value:function b(a){_classPrivateFieldSet(_hopeCount,this,a)}},{key:"setServiceType",value:function b(a){_classPrivateFieldSet(_serviceType,this,a)}},{key:"getPhoneNumber",value:function a(){return Mutil.n2v(_classPrivateFieldGet(_phoneNumber,this))}},{key:"setPhoneNumber",value:function b(a){_classPrivateFieldSet(_phoneNumber,this,a)}},{key:"getPhoneAuthCompleted",value:function a(){return _classPrivateFieldGet(_phoneAuthCompleted,this)}},{key:"setPhoneAuthCompleted",value:function b(a){_classPrivateFieldSet(_phoneAuthCompleted,this,Mutil.n2v(a,!1))}},{key:"getAuthHash",value:function a(){return _classPrivateFieldGet(_authHash,this)}},{key:"setAuthHash",value:function b(a){_classPrivateFieldSet(_authHash,this,Mutil.n2v(a,""))}},{key:"getInviterList",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=this.getEmail(),!Mutil.empty(b)){a.n=1;break}return Mutil.mlog("\uC774\uBA54\uC77C \uC815\uBCF4\uAC00 \uC5C6\uC5B4\uC11C \uCD08\uB300\uC790 \uC815\uBCF4\uB97C \uADF8\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."),a.a(2,[]);case 1:return a.n=2,(0,_index.findInviterList)(b);case 2:if(c=a.v,d=c.INVIT_REC,!Mutil.empty(d)){a.n=3;break}return Mutil.mlog("\uCD08\uB300\uC790 \uC815\uBCF4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."),a.a(2,[]);case 3:return a.a(2,d)}},a,this)}));return a}()},{key:"createNewCompany",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=function a(){if(Mutil.empty(window.connectInfo))return{};try{var b=JSON.parse(window.connectInfo.tokenInfo);return Mutil.setCookie("ecommerceDomain","",0),Mutil.setCookie("ecommerceClientId","",0,0),{LINKED_SERVICE_REC:[{ACCESS_TOKEN:b.accessToken,REFRESH_TOKEN:b.refreshToken,LINKED_TYPE:b.linkedType,TOKEN_TYPE:b.tokenType,EXPIRES_IN:b.expires
302In,SERVICE_ID:window.connectInfo.clientId,DOMAIN:window.connectInfo.domain}]}}catch(a){return Mutil.mlog("linkedServiceJson error"),{}}},(0,_signupFunnelTrack.trackWorkspaceCreateSubmitted)({companyName:_classPrivateFieldGet(_companyName,this),industry:_classPrivateFieldGet(_companyCategory,this),teamSize:_classPrivateFieldGet(_hopeCount,this)}),c=Mutil.requireIIFE("CommonJoin"),a.n=1,(0,_index.createNewCompany)(_objectSpread(_objectSpread(_objectSpread({},this.getCreateNewCompanyInfoJson()),null===c||void 0===c?void 0:c.getPartnerInfo()),b()));case 1:return d=a.v,d.PASS_JSON=this.getSignInJson(),d.PASS_JSON.DESKTOP_GUIDE_YN="N",d.COMPANY_INFO_JSON=_objectSpread({},this.getCreateNewCompanyInfoJson()),a.a(2,d)}},a,this)}));return a}()},{key:"getSignInJson",value:function a(){return _objectSpread({ID_GB:_classPrivateFieldGet(_idGb,this),ENCRYPT_YN:_constant.ENCRYPT.SERVER_TIME_CHECK,OBJ_CNTS_NM:(0,_comm.isElectron)()?"desktop":"",DESKTOP_GUIDE_YN:"Y",SUB_DOM:Mutil.n2v(_classPrivateFieldGet(_companySubDomain,this))},this.geUserProfileInfo())}},{key:"joinCompanyBySubDom",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,(0,_index.registerUserByUserInfo)(_objectSpread({},this.getJoinCompanyInfo()));case 1:return b=a.v,b.PASS_JSON=this.getSignInJson(),a.a(2,b)}},a,this)}));return a}()},{key:"registerGuest",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,(0,_index.registerUserByUserInfo)(_objectSpread({},this.geUserProfileInfo()));case 1:return b=a.v,b.PASS_JSON=this.getSignInJson(),a.a(2,b)}},a,this)}));return a}()},{key:"registerGuestBySnS",value:function a(){if(this.isSnsSignUp()){var b=Mutil.requireIIFE("CommonLogin");b.goLogin(this.getRegisterGuestBySnsJson())}}},{key:"signInWithTwoFactor",value:function b(a){var c=a.PASS_JSON,d=void 0===c?{}:c,e=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},c=1<arguments.length?arguments[1]:void 0,d=c.firstLoginYn,e=c.desktopGuideYn;if((0,_store.isWebView)())return void(0,_index2.mobileSignIn)(b);var f=Mutil.requireIIFE("CommonLogin");f.moveMainPage({firstLoginYn:d,desktopGuideYn:e})},f=function a(){return(0,_store.isWebView)()?void(0,_index2.sendMoveMobileSignInPage)():void _index3.SignUpViewChanger.moveSignInPage()},g=Mutil.requireIIFE("CommonLogin");g.goLogin(_objectSpread({},d),function(){var a=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0],b=1<arguments.length?arguments[1]:void 0,c=b.firstLoginYn,g=b.desktopGuideYn;return a?void f():void e(d,{firstLoginYn:c,desktopGuideYn:g})})}},{key:"getRegisterGuestBySnsJson",value:function a(){return{USER_ID:_classPrivateFieldGet(_userId,this),ID_GB:_classPrivateFieldGet(_idGb,this),OBJ_CNTS_NM:Mutil.n2v(_classPrivateFieldGet(_deviceNm,this)),EMAIL:Mutil.n2v(_classPrivateFieldGet(_email,this)),USER_NM:Mutil.n2v(_classPrivateFieldGet(_userName,this)),PRFL_PHTG:Mutil.n2v(_classPrivateFieldGet(_profilePhoto,this)),MARKETING_YN:_classPrivateFieldGet(_marketingYn,this),RSPT_NM:_classPrivateFieldGet(_jobType,this)}}},{key:"getCreateNewCompanyInfoJson",value:function a(){return _objectSpread(_objectSpread({},this.geUserProfileInfo()),{},{ID_GB:_classPrivateFieldGet(_idGb,this),SUB_DOM:_classPrivateFieldGet(_companySubDomain,this),SUB_DOM_NM:_classPrivateFieldGet(_companyName,this),PATH_CD:_classPrivateFieldGet(_companyCategory,this),PLAN_ID:_classPrivateFieldGet(_planId,this),HOPE_USER_COUNT:_classPrivateFieldGet(_hopeCount,this),DUPLICATE_SUB_DOM_YN:"N",TYPE:_classPrivateFieldGet(_serviceType,this)})}},{key:"getJoinCompanyInfo",value:function a(){return this.isSnsSignUp()?{USER_NM:_classPrivateFieldGet(_userName,this),USER_ID:_classPrivateFieldGet(_userId,this),ID_GB:_classPrivateFieldGet(_idGb,this),MARKETING_YN:_classPrivateFieldGet(_marketingYn,this),SUB_DOM:_classPrivateFieldGet(_companySubDomain,this),AUTH_HASH:_classPrivateFieldGet(_authHash,this)}:_objectSpread(_objectSpread({},this.geUserProfileInfo()),{},{SUB_DOM:_classPrivateFieldGet(_companySubDomain,this)})}},{key:"geUserProfileInfo",value:function a(){return{USER_NM:_classPrivateFieldGet(_userName,this),USER_ID:_classPrivateFieldGet(_userId,this),EMAIL:Mutil.n2v(_classPrivateFieldGet(_email,this)),PRFL_PHTG:Mutil.n2v(_classPrivateFieldGet(_profilePhoto,this)),PWD:_classPrivateFieldGet(_password,this),ID_GB:_classPrivateFieldGet(_idGb,this),MARKETING_YN:_classPrivateFieldGet(_marketingYn,this),RSPT_NM:_classPrivateFieldGet(_jobType,this),CLPH_NO:_classPrivateFieldGet(_phoneNumber,this),AUTH_HASH:_classPrivateFieldGet(_authHash,this)}}},{key:"toString",value:function a(){return"\n         \uC720\uC800 \uC544\uC774\uB514 : ".concat(_classPrivateFieldGet(_userId,this)," \n         \uC774\uBA54\uC77C : ").concat(_classPrivateFieldGet(_email,this),"  \n         \uC720\uC800 \uC774\uB984 : ").concat(_classPrivateFieldGet(_userName,this),"\n         \uD0C0\uC785 : ").concat(_classPrivateFieldGet(_isGuest,this)?"\uAC8C\uC2A4\uD2B8":"\uBE44\uC988\uB2C8\uC2A4","\n         \uBE44\uBC00\uBC88\uD638 : ").concat(_classPrivateFieldGet(_password,this),"\n         \uC9C1\uCC45 : ").concat(_classPrivateFieldGet(_jobType,this),"\n         \uB9C8\uCF00\uD305 \uB3D9\uC758 \uC5EC\uBD80 : ").concat(_classPrivateFieldGet(_marketingYn,this),"\n         \uD68C\uC0AC \uC774\uB984 : ").concat(_classPrivateFieldGet(_companyName,this),"\n         \uD68C\uC0AC \uC5C5\uC885 : ").concat(_classPrivateFieldGet(_companyCategory,this),"\n         \uC11C\uBE0C\uB3C4\uBA54\uC778 : ").concat(_classPrivateFieldGet(_companySubDomain,this)," \n         \uD504\uB85C\uD544 \uC774\uBBF8\uC9C0 : ").concat(_classPrivateFieldGet(_profilePhoto,this),"\n         \uC544\uC774\uB514 \uAD6C\uBD84 \uAC12  : ").concat(_classPrivateFieldGet(_idGb,this),"\n         \uD50C\uB79C \uC544\uC774\uB514  : ").concat(_classPrivateFieldGet(_planId,this),"\n        ")}}])}();
303
304},{"../../../apiCall/signup/index.js":1,"../../../bridge/renewal-signup/index.js":4,"../../../util/electron/comm.js":163,"../constant.js":98,"../store.js":100,"../util/signup-funnel-track.js":107,"../util/view-changer/index.js":108}],102:[function(require,module,exports){
305"use strict";var _inputValidation=require("../input-validate/inputValidation.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.InputErrorHandler=void 0;function validHandler(a){var b=_inputValidation.InputValidator.getIn
305putErrorJson(a),c=0<Object.values(b).length;return c?(validErrorHandler(b),!1):(unActiveErrorModeAboutInput(a),!0)}function isErrorAboutInput(a){if(0===$(a).length)return Mutil.mlog("\uC785\uB825 \uD0DC\uADF8\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC544 \uC5D0\uB7EC \uCC98\uB9AC\uB97C \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."),!1;var b=$(a).parent();return b.hasClass("status-error")}function activeErrorModeAboutInput(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"",c=0===$(a).length;if(!(c||Mutil.empty(b))){var d=$(a).parent();isErrorAboutInput(a)||d.addClass("status-error");var e=d.parent().find(".js-error-txt");e.text("".concat(b))}}function activeErrorModeAboutInputTempLayer(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"",c=0===a.length;if(!(c||Mutil.empty(b))){var d=a.find(".js-interactive-form-wrap");if(0!==d.length){d.hasClass("status-error")||d.addClass("status-error");var e=a.parent(),f=e.find(".js-error-txt"),g=f.parent();g.css("display","block"),f.css({"font-weight":"400","font-size":"13px","line-height":"19px",color:"#FF6B6B"}),f.text("".concat(b))}}}function unActiveErrorModeAboutInput(a){var b=0===$(a).length;if(!b&&isErrorAboutInput(a)){var c=$(a).parent();c.removeClass("status-error");var d=c.parent().find(".js-error-txt");d.empty()}}function unActiveErrorModeAboutInputTempLayer(a){var b=0===a.length;if(!b){var c=a.find(".js-interactive-form-wrap");if(0!==c.length){c.removeClass("status-error");var d=a.parent(),e=d.find(".js-error-txt"),f=e.parent();f.css("display","none"),e.empty()}}}function validErrorHandler(a){var b=0<Object.values(a).length;if(b){var c=$(a.errorObj);0===c.length||activeErrorModeAboutInput(c,a.errorMessage)}}function removeBlank(a){if(0===$(a).length)return void Mutil.mlog(" \uC785\uB825 \uD0DC\uADF8\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC544 \uBE48 \uBB38\uC790\uC5F4\uC744 \uC81C\uAC70\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");var b=a.val().replace(/ /gi,"");a.val(b)}function changeUpperCase2Lowercase(a){return 0===a.length?void Mutil.mlog("\uC774\uBA54\uC77C \uC785\uB825 \uD0DC\uADF8\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC544 \uC18C\uBB38\uC790\uB85C \uBC14\uAFC0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.."):void a.val(a.val().toLowerCase())}var InputErrorHandler=exports.InputErrorHandler={validHandler:validHandler,unActiveErrorModeAboutInput:unActiveErrorModeAboutInput,activeErrorModeAboutInput:activeErrorModeAboutInput,removeBlank:removeBlank,changeUpperCase2Lowercase:changeUpperCase2Lowercase,unActiveErrorModeAboutInputTempLayer:unActiveErrorModeAboutInputTempLayer,activeErrorModeAboutInputTempLayer:activeErrorModeAboutInputTempLayer};
306
307},{"../input-validate/inputValidation.js":104}],103:[function(require,module,exports){
308"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VALID_CODE=exports.INPUT_REG_EXP=void 0;var INPUT_REG_EXP=exports.INPUT_REG_EXP={EMAIL:/^([\w\_])*[a-zA-Z0-9]*([\w\.\_\-])*([a-zA-Z0-9])+([\w\_])*@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,8}$/g,TEAM_URL:/^[0-9a-zA-Z\-]{3,50}$/,EMOJI:/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|\uD83E[\uDD10-\uDDFF])/ig,DOMAIN:/^[0-9a-z_+]*$/g,NUMBER:/^[0-9]+$/,PASSWORD:/^(?=.*[A-Za-z])(?=.*\d)(?=.*[`~!@#$%^&*\-_+=,./?:;'"{<>()\[}\]\\|])[A-Za-z\d`~!@#$%^&*\-_+=,./?:;'"{<>()\[}\]\\|]{8,20}$/g,LOGIN_PASSWORD:/^.{1,20}$/g,MORE_THAN_EIGHT:/^.*(?=^.{8,20}$)(?=.*\d)(?=.*[a-zA-Z]).*$/g,NAME_SPECIAL:/[#<>\[\]\\]/,UPPER_CASE:/[A-Z]/g},VALID_CODE=exports.VALID_CODE={EMPTY:"empty",OVER:"over",UNDER:"under",INVALID:"un-valid",INVALID_LETTER_CASE:"in-valid-letter-case"};
309
310},{}],104:[function(require,module,exports){
311"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InputValidator=void 0;var _constant=require("./constant.js"),_index=require("../input-error-handler/index.js");function getInputErrorJson(a,b){var c=getEmptyInput(a),d=0<c.length,e="temporary"===b;if(d){var f=e?i18next.t(main.alert.noTemporaryContents):c.attr("data-"+_constant.VALID_CODE.EMPTY+"-msg");return makeErrorJson(c,_constant.VALID_CODE.EMPTY,f)}var g=getOverInput(a),h=0<g.length;if(h){var i=e?i18next.t(main.alert.noTemporaryContents):g.attr("data-"+_constant.VALID_CODE.OVER+"-msg");return makeErrorJson(g,_constant.VALID_CODE.OVER,i)}var j=getInvalidInput(a),k=0<j.length;if(k){var l=e?i18next.t(main.alert.noTemporaryContents):j.attr("data-"+_constant.VALID_CODE.INVALID+"-msg");return makeErrorJson(j,_constant.VALID_CODE.INVALID,l)}var m=getInvalidLetterCaseInput(a),n=0<m.length;if(n){var o=e?i18next.t(main.alert.noTemporaryContents):m.attr("data-"+_constant.VALID_CODE.INVALID_LETTER_CASE+"-msg");return makeErrorJson(m,_constant.VALID_CODE.INVALID_LETTER_CASE,o)}return{}}function getInputValue(a){return $.trim($(a).val())}function getEmptyInput(a){var b=$("");return $.each(a,function(a,c){var d=getInputValue(c),e="Y"===Mutil.n2v($(c).attr("data-required-yn"),"N");if(Mutil.empty(d)&&e)return b=$(c),!1}),b}function getOverInput(a){var b=$("");return $.each(a,function(a,c){var d=getInputValue(c),e=+Often.null2Void($(c).attr("maxlength"),"50"),f=e<d.length;if(f)return b=$(c),!1}),b}function getUnderInput(a){var b=$("");return $.each(a,function(a,c){var d=getInputValue(c),e=+Often.null2Void($(c).attr("minlength"),"0"),f=e>d.length;if(f)return b=$(c),!1}),b}function getInvalidInput(a){var b=$("");return $.each(a,function(a,c){var d=getInputValue(c),e=Often.null2Void($(c).attr("data-valid"),""),f=isUnValidValue(e,d,c);if(f)return b=$(c),!1}),b}function getInvalidLetterCaseInput(a){var b=$("");return $.each(a,function(a,c){var d=getInputValue(c),e="N"===Mutil.n2v($(c).attr("data-uppercase-yn"),"Y"),f=checkContainUpperCase(d);if(e&&f)return b=$(c),!1}),b}function makeErrorJson(a,b,c){return{errorObj:a,errorCode:b,errorMessage:c}}function isValidInput(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";return 0===Object.values(getInputErrorJson(a,b)).length}
311function inputValidate(a){if(0===a.length)return Mutil.mlog("\uC785\uB825 \uD0DC\uADF8\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC544 \uD0C0\uB2F9\uC131 \uAC80\uC0AC\uB97C \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."),!1;_index.InputErrorHandler.validHandler(a);var b=isValidInput(a);return Mutil.mlog(" \uC785\uB825(".concat(a.attr("data-valid"),") \uD0DC\uADF8 \uD0C0\uB2F9\uC131 \uAC80\uC0AC ").concat(b?"\uC131\uACF5!":"\uC2E4\uD328!"," >> ").concat($(a).val())),b}function inputsValidate(a){if(0===a.length)return void Mutil.mlog("\uC785\uB825 \uD0DC\uADF8\uB4E4\uC774 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC544 \uD0C0\uB2F9\uC131 \uAC80\uC0AC\uB97C \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");var b=Array.from(a).filter(function(a){return!inputValidate($(a))});return 0===b.length}function check(a,b,c){var d=getInputErrorJson(a,c),e=0<Object.values(d).length;return e?(b&&(Often.toast("error",d.errorMessage),d.errorObj.focus()),d):{}}function isUnValidValue(a,b,c){var d=new RegExp(getPasswordRex()).test(b),e=new RegExp(_constant.INPUT_REG_EXP.LOGIN_PASSWORD).test(b),f=new RegExp(_constant.INPUT_REG_EXP.EMOJI).test(b),g=new RegExp(_constant.INPUT_REG_EXP.NAME_SPECIAL).test(b),h=new RegExp(_constant.INPUT_REG_EXP.DOMAIN).test(b),i=new RegExp(/^[\+?(\d*|\-(?!\-))*]{1,20}$/g).test(b),j=new RegExp(/[-+]{2,}/g).test(b),k=new RegExp(/\d/).test(b),l=new RegExp(/^([^+]*\+)?[^+]*$/).test(b),m=!new RegExp(/^-|-$/).test(b),n=new RegExp(_constant.INPUT_REG_EXP.NUMBER).test(b);return"teamUrl"===a&&!isValidTeamUrl(b)||"name"===a&&!(!g&&!f)||"email"===a&&!isValidEmail(b)||"password"===a&&!d||"password-confirm"===a&&!isSamePassword($(c))||"domain"===a&&!h||"phoneNumber"===a&&!(i&&!j&&k&&l&&m)||"number"===a&&!n||"login-password"===a&&!e}function isSamePassword(a){var b=a.parents("form");return 0<b.length&&0<b.find(".js-join-password").length&&a.val()===b.find(".js-join-password").val()}function getPasswordRex(){return Mutil.isFunc(Func.ENTER.PWD_REG_MORE_THAN_EIGHT)?_constant.INPUT_REG_EXP.MORE_THAN_EIGHT:_constant.INPUT_REG_EXP.PASSWORD}function checkContainUpperCase(a){return 0!==a.length&&new RegExp(_constant.INPUT_REG_EXP.UPPER_CASE).test(a)}function isValidTeamUrl(a){return 0!==a.length&&new RegExp(_constant.INPUT_REG_EXP.TEAM_URL).test(a)}function isValidEmail(a){if(Mutil.empty(a)||0===a.length)return(!1);var b=a===a.toLowerCase();return!!b&&new RegExp(_constant.INPUT_REG_EXP.EMAIL).test(a)}var InputValidator=exports.InputValidator={check:check,isValidInput:isValidInput,getInputErrorJson:getInputErrorJson,checkContainUpperCase:checkContainUpperCase,isValidTeamUrl:isValidTeamUrl,inputValidate:inputValidate,inputsValidate:inputsValidate,isValidEmail:isValidEmail};
312
313},{"../input-error-handler/index.js":102,"./constant.js":103}],105:[function(require,module,exports){
314"use strict";var _store=require("../../store.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
314return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var PhoneAuthInput=function b(a){function c(a){m.userId=a.userId,m.phoneNumber=a.phoneNumber,m.deviceData=a.deviceData}function d(){return{isExpired:m.isExpired,userId:m.userId,phoneNumber:m.phoneNumber}}function e(){if(n()){var b;return Mutil.toast("success","[email protected] \uC544\uC774\uB514\uB294 \uC790\uB3D9\uC73C\uB85C \uC778\uC99D\uB429\uB2C8\uB2E4."),m.timeLimit=null!==(b=null===a||void 0===a?void 0:a.AUTH_TIME_MM)&&void 0!==b?b:"3",m.elements.$authCounter.text("".concat(m.timeLimit,":00")).data("auth-limit-minutes",m.timeLimit),f(),m.elements.$authInput.val("000000"),void m.elements.$authConfirmButton.removeClass("disable").attr("disabled",!1)}c(a);var d=_objectSpread(_objectSpread({},m.deviceData),{},{USER_ID:m.userId,AUTH_ID:m.phoneNumber,AUTH_TYPE:"H"});Ajax.executeApi(RestApi.GET.FLOW_AUTH_NO_CHECK_R002,d,function(a){var b;m.timeLimit=null!==(b=null===a||void 0===a?void 0:a.AUTH_TIME_MM)&&void 0!==b?b:"3",m.elements.$authCounter.text("".concat(m.timeLimit,":00")).data("auth-limit-minutes",m.timeLimit),f()})}function f(){var a=new Date;a.setMinutes(a.getMinutes()+ +m.timeLimit),m.timer=setInterval(function(){g(a)},1e3),m.elements.$authCounter.data("timer",m.timer),l.removeClass("status-error"),m.elements.$authCounterMessage.text(i18next.t(main.verificationSent)),m.elements.$authConfirmButton.addClass("disable").attr("disabled",!0)}function g(a){var b=new Date,c=a-b;if(0>c)return m.isExpired=!0,clearInterval(m.timer),l.addClass("status-error"),m.elements.$authCounterMessage.text(i18next.t(main.alert.verificationExpired)),void m.elements.$authConfirmButton.addClass("disable").attr("disabled",!0);var d={HOUR:3600000,MINUTE:60000,SECOND:1e3},e=Math.floor(c%d.HOUR/d.MINUTE),f=Math.floor(c%d.MINUTE/d.SECOND);m.elements.$authCounter.text("".concat(e,":").concat(f.toString().padStart(2,"0")))}function h(){"undefined"!=typeof m.timer&&(clearInterval(m.timer),m.elements.$authCounter.text("".concat(m.timeLimit,":00")))}function i(){return j.apply(this,arguments)}function j(){return j=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(!n()){a.n=1;break}return a.a(2,!0);case 1:if(b=m.elements.$authCounter.data("auth-limit-minutes"),c=m.elements.$authInput.val(),6===c.length){a.n=2;break}return a.a(2,!1);case 2:return d=_objectSpread(_objectSpread({},m.deviceData),{},{USER_ID:m.userId,AUTH_NO:c,AUTH_TIME_MM:b}),a.n=3,Ajax.executeApi(RestApi.GET.FLOW_AUTH_NO_CHECK_R001,d);case 3:if(e=a.v,"0000"===e.RSLT_CD){a.n=4;break}return a.a(2,!1);case 4:return(0,_store.setAuthHash)(Often.null2Void(e.AUTH_HASH)),a.a(2,!0)}},a)})),j.apply(this,arguments)}var k=$(".js-auth-code-wrap"),l=$(".js-counter-wrap"),m={elements:{$authInput:k.find("#authCodeInput"),$authConfirmButton:a&&a.$confirmButton&&a.$confirmButton.length?a.$confirmButton:k.closest("section").find(".js-next-page-button"),$authCounter:k.find(".js-counter-remaining"),$authCounterMessage:l.find(".js-counter-message")},isExpired:!1,userId:void 0,phoneNumber:void 0,deviceData:{},timeLimit:void 0,timer:void 0}
314,n=function b(){return!(0,_store.isSnsSignUp)()&&a.userId.includes("test")&&a.userId.includes("@yopmail.com")};return{getState:d,init:e,reset:h,confirm:i}},_default=exports.default=PhoneAuthInput;
315
316},{"../../store.js":100}],106:[function(require,module,exports){
317"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getRegionPlanId=getRegionPlanId;function getRegionPlanId(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"business",b=window._CLIENT_REGION;return-1<a.indexOf("basic")?!!b&&-1<["KH","UK","US","VI","JP"].indexOf(b)?"MORNING_BASIC_"+b.toUpperCase()+"_A":"MORNING_BASIC_ETC_A":!!b&&-1<["UK","US"].contains(b)?"MORNING_BUSINESS_"+b.toUpperCase()+"_B":"JP"===b?"MORNING_BASIC_JP_A":"MORNING_BUSINESS_ETC_B"}
318
319},{}],107:[function(require,module,exports){
320"use strict";var _store=require("../store.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.trackWorkspaceCreateSubmitted=exports.trackStepViewed=exports.trackStepFailed=exports.trackStepCompleted=exports.trackEmailVerificationResult=exports.SIGNUP_STEP=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var SIGNUP_STEP=exports.SIGNUP_STEP={FREE_TRIAL_START:{step_number:1,step_name:"free_trial_start"},EMAIL_INPUT:{step_number:2,step_name:"email_input"},EMAIL_AUTH:{step_number:3,step_name:"email_auth"},PROFILE_SETUP:{step_number:4,step_name:"profile_setup"},WORKSPACE_SETUP:{step_number:5,step_name:"workspace_setup"},WORKSPACE_CREATE:{step_number:6,step_name:"workspace_create"},INVITE_MEMBERS:{step_number:7,step_name:"invite_members"}},stepEnterTime={},elapsedSec=function(a){var b=stepEnterTime[a];return b?Math.round((Date.now()-b)/1e3):null},trackSignupStarted=function(){var a=new URLSearchParams(location.search);(0,_store.collectGtm)("signup_started","",!1,{step_number:SIGNUP_STEP.FREE_TRIAL_START.step_number,entry_point:location.pathname,referrer:document.referrer||"",utm_source:a.get("utm_source")||"",utm_medium:a.get("utm_medium")||"",utm_campaign:a.get("utm_campaign")||""})},trackStepViewed=exports.trackStepViewed=function(a){a&&(a.step_number<=SIGNUP_STEP.EMAIL_INPUT.step_number&&trackSignupStarted(),stepEnterTime[a.step_number]=Date.now(),(0,_store.collectGtm)("signup_step_viewed","",!1,_objectSpread({},a)))},trackWorkspaceCreateSubmitted=exports.trackWorkspaceCreateSubmitted=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.companyName,c=void 0===b?"":b,d=a.industry,e=void 0===d?"":d,f=a.teamSize,g=void 0===f?"":f;(0,_store.collectGtm)("workspace_create_submitted","",!1,{workspace_name_length:(c+"").length,industry:e||"",team_size:g||""})},trackStepCompleted=exports.trackStepCompleted=function(a){if(a){var b=_objectSpread({},a),c=elapsedSec(a.step_number);null!==c&&(b.duration_sec=c),(0,_store.collectGtm)("signup_step_completed","",!1,b)}},trackStepFailed=exports.trackStepFailed=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";a&&b&&(0,_store.collectGtm)("signup_step_failed","",!1,_objectSpread(_objectSpread({},a),{},{reason:b}))},trackEmailVerificationResult=exports.trackEmailVerificationResult=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(a){var b={result:a},c=elapsedSec(SIGNUP_STEP.EMAIL_AUTH.step_number);null!==c&&(b.time_to_verify_sec=c),(0,_store.collectGtm)("email_verification_result","",!1,b)}};
321
322},{"../store.js":100}],108:[function(require,module,exports){
323"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SignUpViewChanger=void 0;var _store=require("../../store.js"),_index=require("../../morningmate-business-email-input-view/index.js"),_BusinessEmailVie
vendor: 4,231 bytes, line 323
323w=require("../../view/BusinessEmailView.js"),_GuestEmailView=require("../../view/GuestEmailView.js"),_EmailAuthView=require("../../view/EmailAuthView.js"),_signupFunnelTrack=require("../signup-funnel-track.js"),_UserProfileView=require("../../view/UserProfileView.js"),_CompanyInviteUserView=require("../../view/CompanyInviteUserView.js"),_CompanyProfileView=require("../../view/CompanyProfileView.js"),_SubDomainSearchView=require("../../view/SubDomainSearchView.js"),_CompanyInfoView=require("../../view/CompanyInfoView.js"),_index2=require("../../../../bridge/renewal-signup/index.js"),_index3=require("../../../../apiCall/signup/index.js"),_CompanyJoinWaitView=require("../../view/CompanyJoinWaitView.js"),_constant=require("../../constant.js"),_inputValidation=require("../input-validate/inputValidation.js"),_LoadingPopup=require("../../components/popup/LoadingPopup.js"),_MorningmateAppSumo=require("../../view/MorningmateAppSumo.js"),_BusinessSnsView=require("../../view/BusinessSnsView.js"),_ProjectInvitationView=require("../../view/ProjectInvitationView.js"),_InvitationUserFormView=require("../../view/InvitationUserFormView.js"),_InvitationCompanyView=require("../../view/InvitationCompanyView.js"),_InvitationEmailView=require("../../view/InvitationEmailView.js"),_SurveyView=require("../../view/SurveyView.js"),_CompanyJoinView=require("../../view/CompanyJoinView.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEac
323h(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d.return&&(k=d.return(),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}var routerMap={businessEmail:{title:"businessEmail",loadView:loadBusinessEmailView},guestEmail:{title:"guestEmail",loadView:loadGuestEmailView},emailAuth:{title:"emailAuth",loadView:loadEmailAuthView},userProfileInput:{title:"userProfileInput",loadView:loadProfileView},survey:{title:"survey",loadView:loadSurveyView},companyJoin:{title:"companyJoin",loadView:loadCompanyJoinView},companyInvite:{title:"companyInvite",loadView:loadCompanyInviteView},searchCompanySubDomain:{title:"searchCompanySubDomain",loadView:loadSearchCompanyBySubDomain},companyInfo:{title:"companyInfo",loadView:loadCompanyInfoView},companyInfoInput:{title:"companyInfoInput",loadView:loadCompanyInfoInputView},companyJoinWait:{title:"companyJoinWait",loadView:loadCompanyJoinWaitView},morningmateBusinessEmailInput:{title:"morningmateBusinessEmailInput",loadView:loadMorningMateBusinessEmailInputView},businessSns:{title:"businessSns",loadView:loadBusinessSnsView},projectInvitation:{title:"projectInvitation",loadView:loadProjectInvitationView},invitationUserForm:{title:"invitationUserForm",loadView:loadInvitationUserFormView},invitationCompany:{title:"invitationCompany",loadView:loadInvitationCompanyView},invitationEmail:{title:"invitationEmail",loadView:loadInvitationEmail}},customHistory=[];
323function addBackEvent(){window.onpopstate=function(a){if(1>=customHistory.length)return Mutil.removeLocal("SNS_ACCOUNT_SETTING"),void escapeSignUpPageByBack();if(isNotWorkBackButton())return void history.pushState({},"","".concat(location.search));var b=customHistory.pop().title,c=customHistory.pop().title;if(Mutil.mlog("\uB4A4\uB85C \uAC00\uAE30 : ".concat(b," >>> ").concat(c)),isFirstPage(c)){var d=(0,_store.getPlanId)();return void routerMap[c].loadView(d)}routerMap[c].loadView()}}function escapeSignUpPageByBack(){return(0,_store.isWebView)()?void(0,_index2.sendMoveMobileSignUpPage)():void history.back()}function isFirstPage(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=["businessEmail","businessSns"];return b.includes(a)}function isNotWorkBackButton(){return isCompanyWaitView()||isEmployeeInviteView()}function isEmployeeInviteView(){return $("#welcomeStep").is(":visible")}function isCompanyWaitView(){if(0===customHistory.length)return(!1);var a=customHistory[customHistory.length-1];return"companyJoinWait"===a.title}function addCustomHistory(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";history.pushState({title:a},"",convertSignupUrl(a));Mutil.empty(a)||!routerMap.hasOwnProperty(a)||customHistory.push({title:a})}function convertSignupUrl(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(isFirstPage(a)){var b=new URL("".concat(location.origin).concat(location.pathname,"?").concat(a)),c=new URLSearchParams(document.location.search);return _toConsumableArray(c).forEach(function(a){var c=_slicedToArray(a,2),d=c[0],e=c[1];b.searchParams.set(d,e)}),b.toString()}return"?".concat(a)}function drawView(a){var b=a.viewModule,c=void 0===b?Mutil.noop:b,d=a.title,e=void 0===d?"":d,f=a.layer,g=void 0===f?$(""):f;addCustomHistory(e);var h=0===g.length;return h?(emptySignUpView(),void c()):void c(g)}function loadBusinessEmailView(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";(0,_store.initUser)(!1,a);var b=(0,_store.isProjectInviation)();b&&(0,_store.setIsProjectInvitation)(!0),drawBusinessEmailView(a)}function drawBusinessEmailView(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return Mutil.empty(a)?void Mutil.mlog("\uD50C\uB79C\uC774 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4."):void((0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_INPUT),setTimeout(function(){(0,_store.collectGtm)("new_signup2")},1500),drawView({title:"businessEmail",viewModule:function b(){new _BusinessEmailView.BusinessEmailView($("body"),{mainText:getBusinessPageMainText(a),subText:getBusinessPageSubText(a),guestPageButtonText:i18next.t(login.startAsAGuest)})}}))}function getBusinessPageMainText(a){return Often.isGlobal()?-1<a.indexOf("BUSINESS")&&Often.isGlobal()&&Internationalization.getCurrentLanguage().includes("en")?"Enjoy the Morningmate Boost!":i18next.t(-1<a.indexOf("BUSINESS")?login.useForFree:login.useForFreeMorningmate):"\uB2E8 1\uBD84 \uB9CC\uC5D0 \uAC00\uC785\uD558\uACE0<br>\uD300\uC758 \uC131\uACFC\uB97C \uB192\uC5EC\uBCF4\uC138\uC694!"}function getBusinessPageSubText(a){if(Often.isGlobal())return getBusinessPageSubTextByMorningmate(a);var b=Mutil.requireIIFE("Internationalization"),c="ko"===b.getCurrentLanguage().toLowerCase();return c?"\uC124\uCE58 \uC5C6\uC774 \uBAA8\uB4E0 \uAE30\uB2A5\uC744 \uBB34\uB8CC\uB85C \uC368\uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4.":i18next.t(login.useForFree)}function getBusinessPageSubTextByMorningmate(a){return-1<a.indexOf("BUSINESS")?"".concat(i18next.t(login.starFreeTrialDesc)):-1<a.indexOf("PRO")?"No credit card needed. <br /> You can continue, upgrade, or downgrade after.":"".concat(i18next.t(login.starFreeTrialDesc))}function loadBusinessEmailViewWithEmail(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";(0,_store.initUser)(!1,a),(0,_store.addEmail)(b),drawBusinessEmailView(a)}function loadGuestEmailView(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";(0,_store.initUser)(!0,a),(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_INPUT),drawView({title:"guestEmail",viewModule:function a(){new _GuestEmailView.GuestEmailView($("body"),{mainText:i18next.t(login.crgstaccnt),subText:i18next.t(login.invtdprjct)})}}),b===_constant.ERROR_CODE.BLOCK_DOMAIN&&Mutil.toast("error",i18next.t(exception.error.limitEmail))}function loadEmailAuthView(){(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_AUTH),(0,_store.isGuestUser)()||(window.CONNECT_INVITE_KEY?(0,_store.collectGtm)("new_joinup2_c"):(0,_store.isSnsSignUp
323)()?(0,_store.collectGtm)("new_signup2"):Often.isGlobal()?(0,_store.collectGtm)("EV_mm_signup3"):(0,_store.collectGtm)("new_signup3")),drawView({title:"emailAuth",viewModule:function a(){var b=(0,_store.getEmail)();new _EmailAuthView.EmailAuthView($("body"),{mainText:Often.isGlobal()?i18next.t(login.emailAuthTitle):"\uC778\uC99D \uCF54\uB4DC \uC785\uB825",subText:Often.isGlobal()?"".concat(i18next.t(login.emailAuthSentDesc,{val:b}),"<br>").concat(i18next.t(login.emailAuthInputDesc)):"\uC544\uB798 \uC8FC\uC18C\uB85C \uC778\uC99D \uCF54\uB4DC\uB97C \uBCF4\uB0C8\uC2B5\uB2C8\uB2E4.<br><strong class=\"js-auth-email-line\">".concat(b,"</strong>")})}})}function loadFirstEmailAuthView(){return _loadFirstEmailAuthView.apply(this,arguments)}function _loadFirstEmailAuthView(){return _loadFirstEmailAuthView=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=0<g.length&&void 0!==g[0]?g[0]:"",c=1<g.length&&void 0!==g[1]?g[1]:"",_inputValidation.InputValidator.isValidEmail(c)){a.n=1;break}return loadBusinessEmailViewWithEmail(b,c),a.a(2);case 1:return new _LoadingPopup.LoadingPopup($("body"),{loadingText:i18next.t(common.wait),isNoLoadingText:!0}),a.n=2,(0,_index3.checkDuplicateEmail)(c);case 2:if(d=a.v,e=d.ERR_CD,f=Mutil.n2v(e)!==_constant.ERROR_CODE.SUCCESS,!f){a.n=3;break}return loadBusinessEmailViewWithEmail(b,c),a.a(2);case 3:(0,_store.initUser)(!1,b),(0,_store.addEmail)(c),loadEmailAuthView();case 4:return a.a(2)}},a)})),_loadFirstEmailAuthView.apply(this,arguments)}function loadProfileView(){return _loadProfileView.apply(this,arguments)}function _loadProfileView(){return _loadProfileView=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:b=0<e.length&&void 0!==e[0]?e[0]:"",c=1<e.length&&void 0!==e[1]?e[1]:{},d=0<Object.values(c).length,d&&(!(0,_store.isInitUser)()&&Mutil.exist(b)&&(0,_store.initUser)(b===_constant.GUEST_PLAN_ID,b),(0,_store.addSnsOauthData)(c)),(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.PROFILE_SETUP),setTimeout(function(){if(!(0,_store.isGuestUser)()){if(window.CONNECT_INVITE_KEY)return void(0,_store.collectGtm)("new_joinup3_c");if(Often.isGlobal()&&(0,_store.isGoogleSignUp)())return void(0,_store.collectGtm)("EV_mm_signup3_g");if(Often.isGlobal()&&(0,_store.isAzureSignUp)())return void(0,_store.collectGtm)("EV_mm_signup3_t");if(Often.isGlobal()||!d)return void(0,_store.collectGtm)("EV_mm_signup4");(0,_store.collectGtm)("new_signup3")}},1500),drawView({title:"userProfileInput",viewModule:function a(){var b=Mutil.requireIIFE("Internationalization"),c=b.getCurrentLanguage().toLowerCase().includes("en"),d=(0,_store.getUserId)();new _UserProfileView.UserProfileView($("body"),{mainText:Often.isGlobal()?i18next.t(login.signupBasicInfoDesc):"\uAE30\uBCF8 \uC815\uBCF4\uB97C \uC785\uB825\uD574 \uC8FC\uC138\uC694",subText:Often.isGlobal()?i18next.t(login.surveyIntroDesc1):"\uC785\uB825\uD55C \uC815\uBCF4\uB294 \uB098\uC911\uC5D0 \uBC14\uAFC0 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}});case 1:return a.a(2)}},a)})),_loadProfileView.apply(this,arguments)}function loadSurveyView(){(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.WORKSPACE_SETUP),drawView({title:"survey",viewModule:function a(){new _SurveyView.SurveyView($("body"),{})}})}function loadCompanyJoinView(){drawView({title:"companyJoin",viewModule:function a(){new _CompanyJoinView.CompanyJoinView($("body"),{})}})}function loadCompanyInviteView(){Often.isGlobal()&&!(0,_store.isProjectInviation)()?(0,_store.isGoogleSignUp)()?(0,_store.collectGtm)("EV_mm_signup5_g"):(0,_store.isAzureSignUp)()?(0,_store.collectGtm)("EV_mm_signup5_t"):(0,_store.collectGtm)("EV_mm_signup5"):(0,_store.isSnsSignUp
323)()?(0,_store.collectGtm)("new_joinup_b"):(0,_store.collectGtm)("new_joinup1_a"),drawView({title:"companyInvite",viewModule:function a(){new _CompanyInviteUserView.CompanyInviteUserView($("body"),{mainText:i18next.t(login.createCompanyAndJoin),subText:i18next.t(login.createCompanyAndJoinByInvitation)})}})}function loadCompanyInfoInputView(){(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.WORKSPACE_SETUP),Often.isGlobal()&&!(0,_store.isProjectInviation)()?(0,_store.isGoogleSignUp)()?(0,_store.collectGtm)("EV_mm_signup6_g"):(0,_store.isAzureSignUp)()?(0,_store.collectGtm)("EV_mm_signup6_t"):(0,_store.collectGtm)("EV_mm_signup6"):(0,_store.isSnsSignUp)()?(0,_store.collectGtm)("new_signup4"):(0,_store.collectGtm)("new_signup5"),drawView({title:"companyInfoInput",viewModule:function a(){var b=function a(){var b=Mutil.requireIIFE("Internationalization"),c="ko"===b.getCurrentLanguage().toLowerCase();return c?"\uC544\uB798 \uC815\uBCF4\uB97C \uBAA8\uB450 \uC785\uB825\uD574 \uC8FC\uC138\uC694.":i18next.t(login.common.enter,{val:$t(common.companyName)})};new _CompanyProfileView.CompanyProfileView($("body"),{mainText:i18next.t(login.createYourWorkspace),subText:i18next.t(login.startWithAdmin)})}})}function loadInviteUserView(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Often.isGlobal()&&!(0,_store.isProjectInviation)()&&((0,_store.isGoogleSignUp)()?(0,_store.collectGtm)("EV_mm_signup7_g"):(0,_store.isAzureSignUp)()?(0,_store.collectGtm)("EV_mm_signup7_t"):(0,_store.collectGtm)("EV_mm_signup7")),null!==(a=window)&&void 0!==a&&a.isFuncPhoneGetPop?void Mutil.mlog("\uD734\uB300\uD3F0 \uBC88\uD638 \uBC1B\uC744 \uB54C \uCD08\uB300\uD558\uAE30 \uD398\uC774\uC9C0\uB294 \uC0DD\uB7B5"):void((0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.INVITE_MEMBERS),drawView({title:"inviteUser",viewModule:function a(){var c,d=_objectSpread(_objectSpread({},b),{},{WEBVIEW_YN:(0,_store.isWebView)()?"Y":"N",isSns:(0,_store.isSnsSignUp
323)(),mobileOpenShareContents:(0,_store.isWebView)()?_index2.mobileOpenShareContents:Mutil.noop,mobileOpenTextMessageApp:(0,_store.isWebView)()?_index2.mobileOpenTextMessageApp:Mutil.noop,mobileCloseFunc:(0,_store.isWebView)()?_index2.mobileCloseFunc:Mutil.noop,mobileSignInFunc:(0,_store.isWebView)()?function(){(0,_index2.mobileSignIn)(_objectSpread({},(0,_store.getUser)().getCreateNewCompanyInfoJson()))}:Mutil.noop});null!==(c=window)&&void 0!==c&&c.isInviteV2||Often.isServerModeByHost("DEV_TEST")?InviteLayer.toggleInviteEmplLayer({passJson:d}):WelcomeStep.openWelcomeStep(d)}}))}function loadSearchCompanyBySubDomain(){Often.isGlobal()&&!(0,_store.isProjectInviation)()?(0,_store.isGoogleSignUp)()?(0,_store.collectGtm)("EV_mm_joinup1_g"):(0,_store.isAzureSignUp)()?(0,_store.collectGtm)("EV_mm_joinup1_t"):(0,_store.collectGtm)("EV_mm_joinup1"):(0,_store.collectGtm)((0,_store.isSnsSignUp)()?"new_joinup2_a":"new_joinup1_b"),drawView({title:"searchCompanySubDomain",viewModule:function a(){new _SubDomainSearchView.SubDomainSearchView($("body"),{mainText:i18next.t(login.joinCompany),subText:i18next.t(login.invitationDescription)})}})}function loadCompanyInfoView(){var a=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0];Often.isGlobal()&&!(0,_store.isProjectInviation)()?(0,_store.isGoogleSignUp)()?(0,_store.collectGtm)("EV_mm_joinup2_g"):(0,_store.isAzureSignUp)()?(0,_store.collectGtm)("EV_mm_joinup2_t"):(0,_store.collectGtm)("EV_mm_joinup2"):(0,_store.collectGtm)((0,_store.isSnsSignUp
323)()?"new_joinup3_a":"new_joinup2_b"),drawView({title:"companyInfo",viewModule:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=(0,_store.getJoinUseInttId)(),Mutil.load({type:"circle",$area:$("body")}),emptySignUpView(),a.n=1,(0,_index3.getCompanyInfo)(b);case 1:c=a.v,d=c.USE_INTT_NM,e=void 0===d?"":d,f=c.EMPL_REC,g=void 0===f?[]:f,h=c.SUB_DOM,i=void 0===h?"":h,(0,_store.addCompanySubDomain)(i),new _CompanyInfoView.CompanyInfoView($("body"),{mainText:i18next.t(login.confirmCompany),subText:i18next.t(login.confirmCompanyDesc),companyName:e,employeeList:g});case 2:return a.a(2)}},a)}));return a}()})}function loadCompanyJoinWaitView(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:(0,_store.getUserId)();return Mutil.empty(a)?void Mutil.toast("error",i18next.t(main.alert.wrongApproach)):void((0,_store.isInitUser)()&&(Often.isGlobal()?(0,_store.collectGtm)("new_joinup3"):window.CONNECT_INVITE_KEY?(0,_store.collectGtm)("new_joinup4_c"):(0,_store.collectGtm)((0,_store.isSnsSignUp
323)()?"new_joinup4_a":"new_joinup3_b")),drawView({title:"companyJoinWait",viewModule:function b(){new _CompanyJoinWaitView.CompanyJoinWaitView($("body"),{mainText:i18next.t(login.joinRequestComplete),userId:a})}}))}function loadBusinessSnsView(a){(0,_store.initUser)(!1,a),setTimeout(function(){(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.FREE_TRIAL_START),Often.isGlobal()?(0,_store.collectGtm)("EV_mm_signup1"):(0,_store.collectGtm)("new_signup1")},1500),drawView({title:"businessSns",viewModule:function b(){new _BusinessSnsView.BusinessSnsView($("body"),{mainText:getBusinessPageMainText(a),subText:getBusinessPageSubText(a)})}})}function loadMorningMateBusinessEmailInputView(){(0,_store.collectGtm)("EV_mm_signup2"),drawView({title:"morningmateBusinessEmailInput",viewModule:function a(){_index.MorningMateBusinessEmailInputView.draw()}})}function emptySignUpView(){Mutil.removeLocal("SNS_ACCOUNT_SETTING"),$("body > *:not(#welcomeStep,#popupDraw,#inviteEmployeeLayer2)").remove()}function moveSignInPage(){var a=new URL("".concat(location.origin,"/signin.act")),b=Mutil.exist(window.CONNECT_INVITE_KEY),c=getViewId(),d=new Set(["companyJoinWait","projectInvitation"]);b&&d.has(c)&&(a.searchParams.set("INVT_KEY",window.CONNECT_INVITE_KEY),a.searchParams.set("complete","true")),location.href=a.toString()}function loadSocialLoginSuccessByMobile(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b={};try{b=JSON.parse(a)}catch(a){Mutil.mlog("\uBAA8\uBC14\uC77C\uC5D0\uC11C \uC798\uBABB\uB41C \uC815\uBCF4\uAC00 \uB118\uC5B4 \uC654\uC2B5\uB2C8\uB2E4.(JSON \uD30C\uC2F1\uC5D0\uB7EC)")}loadSocialLoginSuccess(b)}function loadSocialLoginSuccess(){return _loadSocialLoginSuccess.apply(this,arguments)}function _loadSocialLoginSuccess(){return _loadSocialLoginSuccess=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i,j,k,l,m,n=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(c=0<n.length&&void 0!==n[0]?n[0]:{},d=0<Object.values(c).length,e=Often.null2Void(new URL(location.href).searchParams.get("gmail_workspace_oauth")).includes("true"),d){a.n=1;break}return Mutil.mlog("\uC18C\uC15C \uC778\uC99D \uC815\uBCF4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."),a.a(2);case 1:if(f=function b(a){if((0,_store.isWebView)())return void(0,_index2.mobileSignIn)(a);var c=Mutil.requireIIFE("CommonLogin");c.goLogin(a)},Mutil.isAct("/newSignup.act")){a.n=2;break}return f(c),a.a(2);case 2:return a.n=3,(0,_index3.checkDuplicateEmail)(c.USER_ID,c.ID_GB);case 3:if(g=a.v,h=g.ERR_CD,i=Mutil.n2v(h)!==_constant.ERROR_CODE.SUCCESS,!i){a.n=4;break}return j=c.ID_GB===SignCode.TYPE.AZURE,j&&(c.USER_ID=c.TOKEN_ID),(0,_store.getUser)().signInWithTwoFactor({PASS_JSON:c}),a.a(2);case 4:if(!e){a.n=5;break}return Mutil.setLocalJson("SNS_ACCOUNT_SETTING",_objectSpread({},c)),Mutil.open("/newSignup.act?account=sns","_blank"),a.a(2);case 5:if(!(null!==(b=window)&&void 0!==b&&b.isSignupStep)){a.n=6;break}return Mutil.setLocalJson("SNS_ACCOUNT_SETTING",_objectSpread({},c)),k=new URL(location.href),k.searchParams.set("account","sns"),location.href=k.toString(),a.a(2);case 6:if(!(0,_store.isInitUser)()){a.n=7;break}return loadProfileView((0,_store.getPlanId)(),c),a.a(2);case 7:l=Mutil.requireIIFE("CommonJoin"),m=Often.isGlobal()?l.getDefaultPlanId():_constant.GUEST_PLAN_ID,loadProfileView(m,c);case 8:return a.a(2)}},a)})),_loadSocialLoginSuccess.apply(this,arguments)}function loadMorningmateAppSumoView(){var a=new URLSearchParams(window.location.search),b=a.get("token");(0,_store.initUser)(!1,"appSumo_".concat(b)),(0,_store.addEmail)(a.get("user_id")),drawView({title:"morningmateAppSumo",viewModule:function a(){new _MorningmateAppSumo.MorningmateAppSumo($("body"),{mainText:"Sign up with App Sumo",subText:"Your plan is ".concat(window.appSumoPlan),token:b})}})}function moveNewSignUpPage(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=0<Object.values(a).length,c=Often.null2Void(new URL(location.href).searchParams.get("gmail_workspace_oauth")).includes("true");return b&&Mutil.setLocalJson("SNS_ACCOUNT_SETTING",_objectSpread({},a)),c?void Mutil.open("/newSignup.act?account=sns","_blank"):void(location.href="/newSignup.act?account=sns")}function moveIndexHomePage(){location.href="/"}function loadProjectInvitationView(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";(0,_store.initUser)(!1,a),(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.FREE_TRIAL_START),(0,_store.setIsProjectInvitation)(!0),drawView({title:"projectInvitation",viewModule:function a(){new _ProjectInvitationView.ProjectInvitationView($("body"),{mainText:i18next.t(login.invite.joinProjectTitle),subText:i18next.t(login.invite.joinProjectSubtitle)})}})}function loadInvitationUserFormView(){drawView({title:"invitationUserForm",viewM
323odule:function a(){var b=Mutil.requireIIFE("Internationalization"),c=b.getCurrentLanguage().toLowerCase().includes("en"),d=(0,_store.getUserId)();new _InvitationUserFormView.InvitationUserFormView($("body"),{mainText:i18next.t(login.signupInfoTitle),subText:i18next.t(login.joinInfoDesc)})}})}function loadInvitationCompanyView(){drawView({title:"invitationCompany",viewModule:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return Mutil.load({type:"circle",$area:$("body")}),emptySignUpView(),b=(0,_store.getJoinUseInttId)(),a.n=1,(0,_index3.getCompanyInfo)(b);case 1:c=a.v,d=c.USE_INTT_NM,e=void 0===d?"":d,f=c.EMPL_REC,g=void 0===f?[]:f,h=c.SUB_DOM,i=void 0===h?"":h,(0,_store.addCompanySubDomain)(i),new _InvitationCompanyView.InvitationCompanyView($("body"),{mainText:i18next.t(login.confirmCompany),subText:i18next.t(login.confirmCompanyDesc),companyName:e,employeeList:g});case 2:return a.a(2)}},a)}));return a}()})}function loadInvitationEmail(){(0,_signupFunnelTrack.trackStepViewed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_INPUT),(0,_store.collectGtm)("new_joinup1_c"),drawView({title:"loadInvitationEmail",viewModule:function a(){new _InvitationEmailView.InvitationEmailView($("body"),{mainText:i18next.t(login.invite.joinCompanyTitle),subText:i18next.t(login.invite.joinCompanySubtitle,{val:i18next.t(Often.isGlobal()?$t(dictionary.morningmate):$t(dictionary.flow))})})}})}function getViewId(){var a=new URL(location.href);return a.search.substring(1)}var SignUpViewChanger=exports.SignUpViewChanger={getViewId:getViewId,loadBusinessEmailView:loadBusinessEmailView,loadBusinessSnsView:loadBusinessSnsView,loadEmailAuthView:loadEmailAuthView,loadProfileView:loadProfileView,loadSurveyView:loadSurveyView,loadCompanyJoinView:loadCompanyJoinView,loadCompanyInviteView:loadCompanyInviteView,loadCompanyInfoView:loadCompanyInfoView,loadCompanyInfoInputView:loadCompanyInfoInputView,moveSignInPage:moveSignInPage,loadSearchCompanyBySubDomain:loadSearchCompanyBySubDomain,loadCompanyJoinWaitView:loadCompanyJoinWaitView,loadGuestEmailView:loadGuestEmailView,addBackEvent:addBackEvent,loadMorningMateBusinessEmailInputView:loadMorningMateBusinessEmailInputView,emptySignUpView:emptySignUpView,moveIndexHomePage:moveIndexHomePage,loadInviteUserView:loadInviteUserView,moveNewSignUpPage:moveNewSignUpPage,loadSocialLoginSuccess:loadSocialLoginSuccess,loadFirstEmailAuthView:loadFirstEmailAuthView,loadSocialLoginSuccessByMobile:loadSocialLoginSuccessByMobile,loadMorningmateAppSumoView:loadMorningmateAppSumoView,loadProjectInvitationView:loadProjectInvitationView,loadInvitationUserFormView:loadInvitationUserFormView,loadInvitationCompanyView:loadInvitationCompanyView,loadInvitationEmail:loadInvitationEmail};
324
325},{"../../../../apiCall/signup/index.js":1,"../../../../bridge/renewal-signup/index.js":4,"../../components/popup/LoadingPopup.js":92,"../../constant.js":98,"../../morningmate-business-email-input-view/index.js":99,"../../store.js":100,"../../view/BusinessEmailView.js":109,"../../view/BusinessSnsView.js":110,"../../view/CompanyInfoView.js":111,"../../view/CompanyInviteUserView.js":112,"../../view/CompanyJoinView.js":113,"../../view/CompanyJoinWaitView.js":114,"../../view/CompanyProfileView.js":115,"../../view/EmailAuthView.js":116,"../../view/GuestEmailView.js":118,"../../view/InvitationCompanyView.js":119,"../../view/InvitationEmailView.js":120,"../../view/InvitationUserFormView.js":121,"../../view/MorningmateAppSumo.js":122,"../../view/ProjectInvitationView.js":124,"../../view/SubDomainSearchView.js":125,"../../view/SurveyView.js":126,"../../view/UserProfileView.js":127,"../input-validate/inputValidation.js":104,"../signup-funnel-track.js":107}],109:[function(require,module,exports){
326"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}
vendor: 4,624 bytes, line 326
326),exports.BusinessEmailView=void 0;var _BusinessEmailLayout=require("../components/layout/BusinessEmailLayout.js"),_EmailInputView2=require("./EmailInputView.js"),_index=require("../util/view-changer/index.js"),_Header=require("../components/Header.js"),_EmailInput=require("../components/input/EmailInput.js"),_store=require("../store.js"),_GoogleButton=require("../components/button/GoogleButton.js"),_AzureButton=require("../components/button/AzureButton.js"),_TermAgreePopup=require("../components/popup/TermAgreePopup.js"),_SimpleComponent=_interopRequireDefault(require("../components/SimpleComponent.js"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
326function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var BusinessEmailView=exports.BusinessEmailView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;this.$props.Layout=new _BusinessEmailLayout.BusinessEmailLayout(this.$target,{isAppend:!0,sectionId:"emailInputSection",mainText:d,subText:f,nextButton:{text:this.getNextButtonText(),nextPageFunc:this.openTermAgreePopup.bind(this)}})}},{key:"openTermAgreePopup",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,this.validateEmailStep();case 1:if(a.v){a.n=2;break}return a.a(2);case 2:new _TermAgreePopup.TermAgreePopup($("#emailInputSection"),{isAppend:!0,onAgree:this.moveEmailAuthView.bind(this)});case 3:return a.a(2)}},a,this)}));return a}()},{key:"renderComponents",value:function a(){new _Header.Header(this.$props.Layout.getHeaderLayer(),{isShowLoginBtn:!0,isShowPrevBtn:!0}),Often.isGlobal()||_SimpleComponent.default.init({target:$("#mainTxt"),renderOption:"before",template:function a(){return"<div class=\"extra-service-tooltip\"><p>2026\uB144\uC5D0 \uAC00\uC785\uD55C \uBAA8\uB4E0 \uACE0\uAC1D\uC5D0\uAC8C <br>\uBA54\uC77C, \uC804\uC790\uACB0\uC7AC, \uCE98\uB9B0\uB354\uAC00 \uD3C9\uC0DD \uBB34\uB8CC!</p><img class=\"tooltip-arrow\" src=\"/flow-renewal/assets/images/tooltip-arrow.png\" alt=\"\"></div>"}}),this.$props.EmailInput=new _EmailInput.EmailInput(this.$props.Layout.getMainLayer(),{inputId:"emailInput",$posTarget:$("#subTxt"),isAfter:!0,isLast:!0,emailValue:(0,_store.getEmail)(),submit:this.openTermAgreePopup.bind(this)}),this.renderGuestPageButton();var b=$(".js-next-page-button");new _GoogleButton.GoogleButton(this.$props.Layout.getMainLayer(),{type:"button",id:"googleLoginButton",isAfter:!0,$posTarget:b}),Often.isGlobal()&&new _AzureButton.AzureButton(this.$props.Layout.getMainLayer(),{type:"button",id:"azureSignUpButton",isAfter:!0,$posTarget:$("#googleLoginButton")}),_SimpleComponent.default.init({target:b,renderOption:"after",template:function a(){return"<div class=\"guest-or\"><span>".concat(i18next.t(login.or),"</span></div>")}})}},{key:"getNextButtonText",value:function a(){return Often.isGlobal()?i18next.t(login.startFreeTrial):"\uBB34\uB8CC\uB85C \uC2DC\uC791\uD558\uAE30"}},{key:"renderGuestPageButton",value:function a(){var b=this.$props.guestPageButtonText,c=void 0===b?"":b;Mutil.empty(window.CONNECT_INVITE_KEY)||Often.isGlobal()||this.$props.Layout.getMainLayer().append("<a class=\"js-move-guest-page-button btn-underline sign-bottom-link\" href=\"#\">".concat(c,"</a>"))}},{key:"setEvent",value:function a(){_superPropGet(b,"setEvent",this,3)([]),this.addEvent("click.stop.prevent",".js-move-guest-page-button",function(){_index.SignUpViewChanger.loadGuestEmailView()})}}])}(_EmailInputView2.EmailInputView);
327
328},{"../components/Header.js":55,"../components/SimpleComponent.js":58,"../components/button/AzureButton.js":60,"../components/button/GoogleButton.js":62,"../components/input/EmailInput.js":70,"../components/layout/BusinessEmailLayout.js":77,"../components/popup/TermAgreePopup.js":93,"../store.js":100,"../util/view-changer/index.js":108,"./EmailInputView.js":117}],110:[function(require,module,exports){
329"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BusinessSnsView=void 0;var _PageView2=require("./PageView.js"),_index=require("../util/view-changer/index.js"),_Header=require("../components/Header.js"),_GoogleButton=require("../components/button/GoogleButton.js"),_store=require("../store.js"),_BusinessSnsLayout=require("../components/layout/BusinessSnsLayout.js"),_EmailButton=require("../components/button/EmailButton.js"),_AzureButton=require("../components/button/AzureButton.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
329function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var BusinessSnsView=exports.BusinessSnsView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function(){var a=this.$props,b=a.mainText,c=void 0===b?"":b,d=a.subText,e=void 0===d?"":d;this.$props.Layout=new _BusinessSnsLayout.BusinessSnsLayout(this.$target,{isAppend:!0,sectionId:"snsInputSection",mainText:c,subText:e,nextLink:{id:"nextLink",isView:Mutil.exist(window.CONNECT_INVITE_KEY),text:i18next.t(login.startAsAGuest),isBottom:!0,nextPageFunc:function(){_index.SignUpViewChanger.loadGuestEmailView((0,_store.getPlanId)())}}})}},{key:"renderComponents",value:function(){var a=!Often.isMobile()&&isAzureLogin;if(this.$props.Layout){new _Header.Header(this.$props.Layout.getHeaderLayer(),{isShowLoginBtn:!0,isShowPrevBtn:!0}),new _GoogleButton.GoogleButton(this.$props.Layout.getMainLayer(),{type:"button",id:"googleLoginButton",isAfter:!0,$posTarget:this.$props.Layout.getSubTextLayer()}),a&&new _AzureButton.AzureButton(this.$props.Layout.getMainLayer(),{type:"button",id:"azureSignUpButton",buttonText:i18next.t(login.microsoftsrt),isAfter:!0,$posTarget:$("#".concat("googleLoginButton"))}),new _EmailButton.EmailButton(this.$props.Layout.getMainLayer(),{isAfter:!0,buttonText:i18next.t(login.emailstrt),$posTarget:$(a?"#".concat("azureSignUpButton"):"#".concat("googleLoginButton")),clickFunc:function(){return Often.isGlobal()?void _index.SignUpViewChanger.loadMorningMateBusinessEmailInputView():void _index.SignUpViewChanger.loadBusinessEmailView((0,_store.getPlanId)())}})}}}])}(_PageView2.PageView);
330
331},{"../components/Header.js":55,"../components/button/AzureButton.js":60,"../components/button/EmailButton.js":61,"../components/button/GoogleButton.js":62,"../components/layout/BusinessSnsLayout.js":78,"../store.js":100,"../util/view-changer/index.js":108,"./PageView.js":123}],111:[function(require,module,exports){
332"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyInfoView=void 0;var _PageView2=require("./PageView.js"),_index=require("../util/view-changer/index.js"),_CompanyInfoLayout=require("../components/layout/CompanyInfoLayout.js"),_store=require("../store.js"),_constant=require("../constant.js"),_LoadingPopup=require("../components/popup/LoadingPopup.js"),_Header=require("../components/Header.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
332q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyInfoView=exports.CompanyInfoView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e,g=b.companyName,h=void 0===g?"":g,i=b.employeeList,j=void 0===i?[]:i;this.$props.CompanyInfoLayOut=new _CompanyInfoLayout.CompanyInfoLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,companyName:h,employeeList:j,nextButton:{id:"joinCompanyBtn",text:this.getNextButtonText(),nextPageFunc:this.joinCompany.bind(this)}})}},{key:"renderComponents",value:function a(){this.$props.CompanyInfoLayOut&&new _Header.Header(this.$props.CompanyInfoLayOut.getHeaderLayer(),{isS
332howLoginBtn:!1,isShowPrevBtn:!0})}},{key:"joinCompany",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,(0,_store.getUser)().joinCompanyBySubDom();case 1:if(b=a.v,c=Mutil.n2v(null===b||void 0===b?void 0:b.ERR_CD),c!==_constant.ERROR_CODE.VERIFICATION_FORGED){a.n=2;break}return Mutil.mlog("\uC778\uC99D\uBC88\uD638 \uAC80\uC99D\uACB0\uACFC\uAC00 \uBCC0\uC870\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),Mutil.toast("error",null!==(d=null===b||void 0===b?void 0:b.ERR_MSG)&&void 0!==d?d:"error.requestForged"),setTimeout(function(){location.reload()},2e3),a.a(2);case 2:if(e=Mutil.n2v(b.ERR_CD)===_constant.ERROR_CODE.BLOCK_DOMAIN,!e){a.n=3;break}return Mutil.toast("error",i18next.t(exception.error.limitEmail)),a.a(2);case 3:if(f=c===_constant.ERROR_CODE.SUCCESS,f){a.n=4;break}return Mutil.toast("error",i18next.t(common.occupy,{val:$t(dictionary.email)})),a.a(2);case 4:if(g="Y"===Mutil.n2v(b.JNNG_ATHZ_YN,"N"),new _LoadingPopup.LoadingPopup(this.$props.CompanyInfoLayOut.getMainArticle(),{isAppend:!0}),!g){a.n=5;break}return Often.isGlobal()?(0,_store.collectGtm)("new_signup6"):(0,_store.collectGtm)("new_joinup3_a"),(0,_store.getUser)().signInWithTwoFactor(b),a.a(2);case 5:_index.SignUpViewChanger.loadCompanyJoinWaitView();case 6:return a.a(2)}},a,this)}));return a}()},{key:"getSectionId",value:function a(){return"profileInputSection"}},{key:"getNextButtonText",value:function a(){return"".concat(i18next.t(common.requestedToJoin))}}])}(_PageView2.PageView);
333
334},{"../components/Header.js":55,"../components/layout/CompanyInfoLayout.js":79,"../components/popup/LoadingPopup.js":92,"../constant.js":98,"../store.js":100,"../util/view-changer/index.js":108,"./PageView.js":123}],112:[function(require,module,exports){
335"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyInviteUserView=void 0;var _PageView2=require("./PageView.js"),_InviteLayout=require("../components/layout/InviteLayout.js"),_index=require("../util/view-changer/index.js"),_Header=require("../components/Header.js"),_store=require("../store.js"),_index2=require("../../../apiCall/signup/index.js"),_InviterList=require("../components/InviterList.js"),_IconButton=require("../components/button/IconButton.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
335return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyInviteUserView=exports.CompanyInviteUserView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;this.$props.InviteLayout=new _InviteLayout.InviteLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f})}},{key:"renderComponents",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(this.$props.InviteLayout){a.n=1;break}return a.a(2);case 1:new _Header.Header(this.$props.InviteLayout.getHeaderLayer(),{isShowLoginBtn:!1,isShowPrevBtn:!0}),new _IconButton.IconButton(this.$props.InviteLayout.getCorpButtonLayer(),{isAppend:!0,id:"create",icon:"plus",buttonText:"".concat(i18next.t(login.createNewCompany)),clickFunc:function a(){_index.SignUpViewChanger.loadCompanyInfoInputView()}}),new _IconButton.IconButton(this.$props.InviteLayout.getCorpButtonLayer(),{isAppend:!0,id:"join",icon:"clip",buttonText:"".concat(i18next.t(login.joinCompany)),clickFunc:function a(){_index.SignUpViewChanger.loadSearchCompanyBySubDomain()}}),this.renderCompanyInviteComponent().then();case 2:return a.a(2)}},a,this)}));return a}()},{key:"renderCompanyInviteComponent",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,(0,_store.getUser)().getInviterList();case 1:if(b=a.v,0!==b.length){a.n=2;break}return a.a(2);case 2:this.$props.InviteLayout.showInviteUlLayer(),new _InviterList.InviterList(this.$props.InviteLayout.getInviteUlLayer(),{isAppend:!0,inviterList:b,moveCompanyInfoPage:function a(){_index.SignUpViewChanger.loadCompanyInfoView(!0)}});case 3:return a.a(2)}},a,this)}));return a}()},{key:"getSectionId",value:function a(){return"companyInviteSection"}},{key:"getNextButtonText",value:function a(){return i18next.t(login.createCompany)}}])}(_PageView2.PageView);
336
337},{"../../../apiCall/signup/index.js":1,"../components/Header.js":55,"../components/InviterList.js":56,"../components/button/IconButton.js":63,"../components/layout/InviteLayout.js":84,"../store.js":100,"../util/view-changer/index.js":108,"./PageView.js":123}],113:[function(require,module,exports){
338"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyJoinView=void 0;var _PageView2=require("./PageView.js"),_CompanyJoinLayout=require("../components/layout/CompanyJoinLayout.js"),_Header=require("../components/Header.js"),_index=require("../util/view-changer/index.js"),_index2=require("../../../apiCall/signup/index.js"),_index3=require("../../../bridge/renewal-signup/index.js"),_store=require("../store.js"),_constant=require("../constant.js"),_LoadingPopup=require("../components/popup/LoadingPopup.js"),_NameInput=require("../components/input/NameInput.js"),_PasswordInput=require("../components/input/PasswordInput.js"),_PhoneAuth=_interopRequireDefault(require("../components/input-group/PhoneAuth.js")),_inputValidation=require("../util/input-validate/inputValidation.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
338q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyJoinView=exports.CompanyJoinView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"getSectionId",value:function a(){return"companyJoinSection"}},{key:"getJoinInputClass",value:function a(){return"js-join-input"}},{key:"renderLayout",value:function a(){this.$props.CompanyJoinLayout=new _CompanyJoinLayout.CompanyJoinLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),manualStep:!0})}},{key:"renderComponents",value:function a(){var b=this;if(this.$props.CompanyJoinLayout){new _Header.Header(this.$props.CompanyJoinLayout.getHeaderLayer(),{isS
338howLoginBtn:!0,isShowPrevBtn:!0});var c=$("#".concat(this.getSectionId()));c.off("click.cjView keydown.cjView"),c.on("click.cjView",".js-cj-next",this.onNext.bind(this)),c.on("keydown.cjView","#companyUrlInput",function(a){"Enter"!==a.key||a.isComposing||(a.preventDefault(),b.searchCompany())}),c.on("click.cjView",".company-join__done .company-join__request",function(a){a.preventDefault(),b.moveSignInPage()}),c.on("click.cjView",".js-cj-reset",function(a){a.preventDefault(),b.cancelJoinRequest()});var d=c.find("#prevBtn")[0];d&&d.addEventListener("click",function(a){var d=+c.find(".company-join__step.is-active").attr("data-step");1<d&&4>d&&(a.stopImmediatePropagation(),a.preventDefault(),b.moveStep(d-1))},!0),this.$props.NameInput=new _NameInput.NameInput(this.$props.CompanyJoinLayout.getUserNameLayer(),{addClassName:this.getJoinInputClass()}),this.$props.PasswordInput=new _PasswordInput.PasswordInput(this.$props.CompanyJoinLayout.getPasswordLayer(),{allowBlank:!1,addClassName:this.getJoinInputClass()});var e=window._CLIENT_REGION||"KR";Often.isGlobal()||"KR"!==e||(this.$props.PhoneAuth=(0,_PhoneAuth.default)(),this.$props.PhoneAuth.init({target:this.$props.CompanyJoinLayout.getPhoneAuthLayer(),renderOption:"append"}))}}},{key:"onNext",value:function b(a){var c=+$(a.target).closest(".company-join__step").attr("data-step");return 1==c?void this.searchCompany():2==c?void this.moveStep(3):3==c?void this.submitJoin():void 0}},{key:"moveStep",value:function b(a){var c=$("#".concat(this.getSectionId()," .company-join"));c.find(".company-join__step").removeClass("is-active"),c.find(".company-join__step[data-step=\"".concat(a,"\"]")).addClass("is-active")}},{key:"searchCompany",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(b=$("#".concat(this.getSectionId()," #companyUrlInput")),c=_inputValidation.InputValidator.getInputErrorJson(b),d=$("#".concat(this.getSectionId()," .js-cj-url-error")),!(0<Object.values(c).length)){a.n=1;break}return b.closest(".company-join__input").addClass("is-error"),d.text(Mutil.n2v(c.errorMessage)).show(),a.a(2);case 1:return b.closest(".company-join__input").removeClass("is-error"),d.hide(),e=Mutil.n2v(b.val()).trim(),a.n=2,(0,_index2.checkSubDomain)(e);case 2:if(f=a.v,"0000"===Mutil.n2v(f.ERR_CD)){a.n=3;break}return Mutil.toast("error",Mutil.n2v(null===f||void 0===f?void 0:f.ERR_MSG)||"\uC785\uB825\uD55C URL\uC758 \uD68C\uC0AC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."),a.a(2);case 3:return(0,_store.addJoinUseInttId)(Mutil.n2v(f.USE_INTT_ID)),g={},a.p=4,a.n=5,(0,_index2.getCompanyInfo)(Mutil.n2v(f.USE_INTT_ID));case 5:if(h=a.v,h){a.n=6;break}h={};case 6:g=h,a.n=8;break;case 7:a.p=7,i=a.v;case 8:(0,_store.addCompanySubDomain)(Mutil.n2v(g.SUB_DOM)),this.renderCompanyCard(g),this.moveStep(2);case 9:return a.a(2)}},a,this,[[4,7]])}));return a}()},{key:"renderCompanyCard",value:function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.USE_INTT_NM,d=void 0===c?"":c,e=b.EMPL_REC,f=void 0===e?[]:e,g=$("#".concat(this.getSectionId()));d&&g.find(".company-join__company-name").text(d);var h=Array.isArray(f)?f:[],i="/flow-renewal/assets/images/profile-default.png",j=h.slice(0,3).map(function(a){var b=Mutil.n2v(a.PRFL_PHTG);return"<span class=\"company-join__avatar\"><img src=\"".concat(b||i,"\" onerror=\"this.src='").concat(i,"'\" alt=\"\"></span>")}).join("");j&&g.find(".company-join__avatars").html(j);var k=h.map(function(a){return Mutil.n2v(a.FLNM)}).filter(function(a){return!Mutil.empty(a)}).slice(0,3);k.length&&g.find(".company-join__company-desc").text(i18next.t(login.joinedCompanies,{val:"".concat(k.join(", ")," \uC678")}))}},{key:"submitJoin",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=$("#".concat(this.getSectionId())).find(".".concat(this.getJoinInputClass())),_inputValidation.InputValidator.inputsValidate(b)){a.n=1;break}return a.a(2);case 1:if(c=window._CLIENT_REGION||"KR",Often.isGlobal()||"KR"!==c){a.n=3;break}if((0,_store.getPhoneAuthCompleted)()){a.n=2;break}return a.n=2,this.verifyAuthCode();case 2:if((0,_store.getPhoneAuthCompleted)()){a.n=3;break}return this.$props.PhoneAuth.validatePhoneAuthInputs(),a.a(2);case 3:return this.addUserInfo(),a.n=4,this.joinCompany();case 4:return a.a(2)}},a,this)}));return a}()},{key:"addUserInfo",value:function a(){var b;
338(0,_store.addUserName)(this.$props.NameInput.getInputValue()),null!==(b=this.$props)&&void 0!==b&&b.PasswordInput&&(0,_store.addPassword)(this.$props.PasswordInput.getInputValue()),(0,_store.addPhoneNumber)($("#".concat(this.getSectionId()," #phoneNumberInput")).val())}},{key:"verifyAuthCode",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=this.$props.CompanyJoinLayout.getPhoneAuthLayer(),c=b.find("#authCodeInput"),d=b.find(".js-counter-message"),a.n=1,this.$props.PhoneAuth.verifyAuthCode();case 1:if(e=a.v,e){a.n=2;break}return c.closest(".js-interactive-form-wrap").addClass("status-error"),d.closest(".js-counter-wrap").addClass("status-error"),d.text(i18next.t(main.alert.verificationNotMatch)),a.a(2);case 2:b.find("#phoneNumberInput").attr("disabled",!0),b.find(".js-phone-auth-button").attr("disabled",!0),c.attr("disabled",!0),b.find(".js-counter-wrap").hide(),(0,_store.addPhoneAuthCompleted)(!0),this.$props.PhoneAuth.stopCounter();case 3:return a.a(2)}},a,this)}));return a}()},{key:"joinCompany",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=new _LoadingPopup.LoadingPopup($("#".concat(this.getSectionId())).find("article"),{isAppend:!0}),a.n=1,(0,_store.getUser)().joinCompanyBySubDom();case 1:if(c=a.v,d=Mutil.n2v(null===c||void 0===c?void 0:c.ERR_CD),d!==_constant.ERROR_CODE.VERIFICATION_FORGED){a.n=2;break}return b.removePopup(),Mutil.toast("error",null!==(e=null===c||void 0===c?void 0:c.ERR_MSG)&&void 0!==e?e:"error.requestForged"),setTimeout(function(){return location.reload()},2e3),a.a(2);case 2:if(d!==_constant.ERROR_CODE.BLOCK_DOMAIN){a.n=3;break}return b.removePopup(),Mutil.toast("error",i18next.t(exception.error.limitEmail)),a.a(2);case 3:if(d===_constant.ERROR_CODE.SUCCESS){a.n=4;break}return b.removePopup(),Mutil.toast("error",i18next.t(common.occupy,{val:$t(dictionary.email)})),a.a(2);case 4:if(f="Y"===Mutil.n2v(c.JNNG_ATHZ_YN,"N"),!f){a.n=5;break}return(0,_store.getUser)().signInWithTwoFactor(c),a.a(2);case 5:b.removePopup(),this.moveStep(4);case 6:return a.a(2)}},a,this)}));return a}()},{key:"moveSignInPage",value:function a(){return(0,_store.isWebView)()?void(0,_index3.sendMoveMobileSignInPage)():void _index.SignUpViewChanger.moveSignInPage()}},{key:"cancelJoinRequest",value:function a(){Mutil.confirm({text:{contents:"".concat(i18next.t(login.cancelRegisterationDesc)," \n  ").concat(i18next.t(login.cancelRegisterationDesc2))},callback:{submitFn:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,(0,_index2.cancelCompanyJoinRequest)((0,_store.getUserId)());case 1:if(b=a.v,"0000"===Mutil.n2v(null===b||void 0===b?void 0:b.ERR_CD)){a.n=2;break}return Mutil.toast("error",i18next.t(common.errorTryAgain)),a.a(2);case 2:if(!(0,_store.isWebView)()){a.n=3;break}return(0,_index3.sendMoveMobileSignInPage)(),a.a(2);case 3:_index.SignUpViewChanger.moveIndexHomePage();case 4:return a.a(2)}},a)}));return a}()}})}}])}(_PageView2.PageView);
339
340},{"../../../apiCall/signup/index.js":1,"../../../bridge/renewal-signup/index.js":4,"../components/Header.js":55,"../components/input-group/PhoneAuth.js":67,"../components/input/NameInput.js":72,"../components/input/PasswordInput.js":73,"../components/layout/CompanyJoinLayout.js":80,"../components/popup/LoadingPopup.js":92,"../constant.js":98,"../store.js":100,"../util/input-validate/inputValidation.js":104,"../util/view-changer/index.js":108,"./PageView.js":123}],114:[function(require,module,exports){
341"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyJoinWaitView=void 0;var _PageView2=require("./PageView.js"),_CompanyJoinWaitLayout=require("../components/layout/CompanyJoinWaitLayout.js"),_store=require("../store.js"),_index=require("../../../bridge/renewal-signup/index.js"),_index2=require("../util/view-changer/index.js"),_index3=require("../../../apiCall/signup/index.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
341q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyJoinWaitView=exports.CompanyJoinWaitView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props.mainText,c=void 0===b?"":b;this.$props.Layout=new _CompanyJoinWaitLayout.CompanyJoinWaitLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:c,nextButton:{id:"joinCompanyBtn",text:i18next.t(common.redirectLoginPage),nextPageFunc:this.moveSignInPage.bind(this)},cancelButton:{id:"joinCancelBtn",text:i18next.t(login.cancelRegisteration),cancelFunc:this.cancelJoin.bind(this)}})}},{key:"setEvent",value:function a(){Mutil.isAct("joinwait.act")&&this.addRefreshPageWarningEvent()}},{key:"cancelJoin",value:function a(){var b=this.$props.userId,c=void 0===b?"":b;Mutil.confirm({text:{contents:"".concat(i18next.t(login.cancelRegisterationDesc)," \n  ").concat(i18next.t(login.cancelRegisterationDesc2))},callback:{submitFn:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,(0,_index3.cancelCompanyJoinRequest)(c);case 1:if(b=a.v,"0000"===Mutil.n2v(b.ERR_CD)){a.n=2;break}return Mutil.toast("error","".concat(i18next.t(common.errorTryAgain))),a.a(2);case 2:if(!(0,_store.isWebView)()){a.n=3;break}return(0,_index.sendMoveMobileSignInPage)(),a.a(2);case 3:_index2.SignUpViewChanger.moveIndexHomePage();case 4:return a.a(2)}},a)}));return a}()}})}},{key:"addRefreshPageWarningEvent",value:function a(){var b=this.$props.userId,c=void 0===b?"":b;window.addEventListener("beforeunload",function(a){a.preventDefault(),Mutil.setCookie("joinUserId",c,0,10000)})}},{key:"moveSignInPage",value:function a(){return(0,_store.isWebView)()?void(0,_index.sendMoveMobileSignInPage)():void _index2.SignUpViewChanger.moveSignInPage()}},{key:"getSectionId",value:function a(){return"companyJoinWaitSection"}},{key:"renderComponents",value:function a(){!this.$props.Layout}}])}(_PageView2.PageView);
342
343},{"../../../apiCall/signup/index.js":1,"../../../bridge/renewal-signup/index.js":4,"../components/layout/CompanyJoinWaitLayout.js":81,"../store.js":100,"../util/view-changer/index.js":108,"./PageView.js":123}],115:[function(require,module,exports){
344"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CompanyProfileView=void 0;var _PageView2=require("./PageView.js"),_Header=require("../components/Header.js"),_
vendor: 5,307 bytes, line 344
344CompanyNameInput=require("../components/input/CompanyNameInput.js"),_CompanyCategorySelect=require("../components/select/CompanyCategorySelect.js"),_index=require("../util/view-changer/index.js"),_CompanyProfileLayout=require("../components/layout/CompanyProfileLayout.js"),_store=require("../store.js"),_constant=require("../constant.js"),_inputValidation=require("../util/input-validate/inputValidation.js"),_LoadingPopup=require("../components/popup/LoadingPopup.js"),_index2=require("../../../bridge/renewal-signup/index.js"),_HopeUserCountSelect=require("../components/select/HopeUserCountSelect.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
344function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var CompanyProfileView=exports.CompanyProfileView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;new _CompanyProfileLayout.CompanyProfileLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,nextButton:{text:"".concat(i18next.t(login.registerComplete)),nextPageFunc:this.createCompany.bind(this)},nextLink:{text:i18next.t(login.existingTeam),nextPageFunc:function a(){_index.SignUpViewChanger.loadSearchCompanyBySubDomain()}}})}},{key:"getSectionId",value:function a(){return"companyInfoInputSection"}},{key:"renderComponents",value:function a(){var b=$("#".concat(this.getSectionId()));new _Header.Header(b.find(".js-section-header"),{isShowLoginBtn:!1,isShowPrevBtn:!0}),this.$props.CompanyNameInput=new _CompanyNameInput.CompanyNameInput(b.find("#companyNameLayer"),{addClassName:this.getCommonJoinInputClassName(),submit:this.createCompany.bind(this)}),this.$props.CompanyCategorySelect=new _CompanyCategorySelect.CompanyCategorySelect(b.find("#companyCategorySelectLayer"),{addClassName:this.getCommonJoinInputClassName()}),this.$props.CompanyHopeUserConutSelect=new _HopeUserCountSelect.HopeUserCountSelect(b.find("#hopeCountSelectLayer"),{addClassName:this.getCommonJoinInputClassName(),isLast:!0})}},{key:"addCompanyInfo",value:function a(){(0,_store.addCompanyName)(this.$props.CompanyNameInput.getInputValue()),(0,_store.addCompanySubDomain)(this.getSubDomain()),(0,_store.addCompanyCategory)(this.$props.CompanyCategorySelect.getSelectValue()),(0,_store.addHopeCount)(this.$props.CompanyHopeUserConutSelect.getSelectValue()),(0,_store.addServiceType)(this.getServiceType())}},{key:"getSubDomain",value:function a(){var b,c=null===(b=this.$props)||void 0===b||null===(b=b.CompanyNameInput)||void 0===b?void 0:b.getInputValue();if(!Mutil.empty(c)){var d=_inputValidation.InputValidator.isValidTeamUrl(c);return d?c:_constant.DEFAULT_SUB_DOMAIN}}},{key:"getServiceType",value:function a(){return Mutil.n2v($(".js-service-type-layer:visible input[name=radioOption]:checked").val(),"")}},{key:"getCommonJoinInputClassName",value:function a(){return"js-join-input"}},{key:"createCompany",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(c=$("#".concat(this.getSectionId())),d=c.find(".".concat(this.getCommonJoinInputClassName())),_inputValidation.InputValidator.inputsValidate(d)){a.n=1;break}return a.a(2);case 1:return e=new _LoadingPopup.LoadingPopup(c.find("article"),{isAppend:!0,loadingText:i18next.t(login.createWorkSpace)}),this.addCompanyInfo(),a.n=2,(0,_store.getUser)().createNewCompany();case 2:if(f=a.v,g=f.ERR_CD,h=void 0===g?"":g,i=f.ERR_MSG,j=void 0===i?"":i,k=f.PASS_JSON,l=void 0===k?{}:k,m=f.COMPANY_INFO_JSON,n=void 0===m?{}:m,o=f.SUB_DOM,p=void 0===o?"":o,h!==_constant.ERROR_CODE.BLOCK_DOMAIN){a.n=3;break}return Mutil.toast("error",i18next.t(exception.error.limitEmail)),e.removePopup(),a.a(2);case 3:if(h!==_constant.ERROR_CODE.EXIST_SUB_DOMAIN){a.n=4;break}return Mutil.mlog("\uC11C\uBE0C\uB3C4\uBA54\uC778\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."),e.removePopup(),a.a(2);case 4:if(h!==_constant.ERROR_CODE.EXIST_COMPANY){a.n=5;break}return Mutil.mlog("\uC774\uBBF8 \uD68C\uC0AC\uAC00 \uC874\uC7AC\uD569\uB2C8\uB2E4."),e.removePopup(),a.a(2);case 5:if(h!==_constant.ERROR_CODE.VERIFICATION_FORGED){a.n=6;break}return Mutil.mlog("\uC778\uC99D\uBC88\uD638 \uAC80\uC99D\uACB0\uACFC\uAC00 \uBCC0\uC870\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),e.removePopup(),Mutil.toast("error",j),setTimeout(function(){location.reload()},2e3),a.a(2);case 6:if(!(null!==(b=window)&&void 0!==b&&b.isFuncPhoneGetPop)){a.n=7;break}return this.signIn(_objectSpread({},l)),a.a(2);case 7:q=Mutil.requireIIFE("CommonLogin"),q.goLogin(_objectSpread({},l),function(){e.removePopup(),_index.SignUpViewChanger.loadInviteUserView(_objectSpread(_objectSpread({},n),{}
344,{SUB_DOM_DATA:p,isSignUpBySnS:(0,_store.isSnsSignUp)()}))});case 8:return a.a(2)}},a,this)}));return a}()},{key:"signIn",value:function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if((0,_store.isWebView)())return void(0,_index2.mobileSignIn)(_objectSpread({},(0,_store.getUser)().getCreateNewCompanyInfoJson()));var c=Mutil.requireIIFE("CommonLogin");c.goLogin(_objectSpread({},b),function(){c.moveMainPage({firstLoginYn:"Y",desktopGuideYn:"Y"})})}}])}(_PageView2.PageView);
345
346},{"../../../bridge/renewal-signup/index.js":4,"../components/Header.js":55,"../components/input/CompanyNameInput.js":68,"../components/layout/CompanyProfileLayout.js":82,"../components/popup/LoadingPopup.js":92,"../components/select/CompanyCategorySelect.js":95,"../components/select/HopeUserCountSelect.js":96,"../constant.js":98,"../store.js":100,"../util/input-validate/inputValidation.js":104,"../util/view-changer/index.js":108,"./PageView.js":123}],116:[function(require,module,exports){
347"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmailAuthView=void 0;var _PageView2=require("./PageView.js"),_EmailAuthLayout=require("../components/layout/EmailAuthLayout.js"),_Header=require("../components/Header.js"),_EmailAuthInput=require("../components/input/EmailAuthInput.js"),_store=require("../store.js"),_signupFunnelTrack=require("../util/signup-funnel-track.js"),_index=require("../../../apiCall/signup/index.js"),_index2=require("../util/view-changer/index.js"),_index3=require("../util/input-error-handler/index.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
347:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var EmailAuthView=exports.EmailAuthView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;this.$props.EmailAuthLayout=new _EmailAuthLayout.EmailAuthLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,nextButton:{text:this.getNextButtonText(),nextPageFunc:this.checkAuthNumber.bind(this)}})}},{key:"renderComponents",value:function a(){this.$props.EmailAuthLayout&&(new _Header.Header(this.$props.EmailAuthLayout.getHeaderLayer(),{isShowLoginBtn:!1,isShowPrevBtn:!0}),this.$props.EmailAuthIput=new _EmailAuthInput.EmailAuthInput(this.$props.EmailAuthLayout.getMainLayer(),{isAfter:!0,$posTarget:$("#subTxt"),inputId:this.getInputId(),isLast:!0,sendEmail:this.sendAuthNumber2Email.bind(this),submit:this.checkAuthNumber.bind(this)}))}},{key:"mounted",value:function a(){this.sendAuthNumber2Email()}},{key:"getInputId",value:function a(){return"authNumberInput"}},{key:"sendAuthNumber2Email",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=(0,_store.getEmail)(),!Mutil.empty(b)){a.n=1;break}return Mutil.mlog("\uC774\uBA54\uC77C \uC815\uBCF4\uAC00 \uC5C6\uC5B4\uC11C \uC778\uC99D \uBC88\uD638\uB97C \uC774\uBA54\uC77C\uB85C \uBCF4\uB0BC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."),a.a(2);case 1:return a.n=2,(0,_index.sendAuthNumberToEmail)(_objectSpread({USER_ID:b,AUTH_ID:b,AUTH_TYPE:"E"},this.getDeviceInfo()));case 2:if(c=a.v,!(c.ERROR&&"429"===c.CODE)){a.n=3;break}return(0,_signupFunnelTrack.trackStepFailed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_AUTH,"send_blocked"),Mutil.toast("error",i18next.t(exception.error.timeLimit)),setTimeout(function(){history.back()},2e3),a.a(2);case 3:this.$props.EmailAuthIput.startCounter(c.AUTH_TIME_MM),this.fillAuthNumByDevelop(c),this.$props.EmailAuthLayout.showAuthInfoText();case 4:return a.a(2)}},a,this)}));return a}()},{key:"getDeviceInfo",value:function a(){var b=function a(){return(0,_store.isGuestUser)()},c=b()?"":window._CLIENT_IP;return Often.getDeviceJson(c)}},{key:"fillAuthNumByDevelop",value:function b(a){var c=a.AUTH_NO,d=void 0===c?"":c;!Mutil.isServerOn("DEV_TEST")||Mutil.empty(d)||(Mutil.toast("success","\uD14C\uC2A4\uD2B8 \uC11C\uBC84\uC774\uBA74\uC11C [email protected] \uB3C4\uBA54\uC778\uC77C \uACBD\uC6B0 2\uCD08 \uB4A4\uC5D0 \uC790\uB3D9\uC73C\uB85C \uC778\uC99D\uBC88\uD638\uAC00 \uCC44\uC6CC\uC9D1\uB2C8\uB2E4."),this.$props.EmailAuthIput.addAuthNumber(d))}},{key:"checkAuthNumber",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(c=0<h.length&&void 0!==h[0]?h[0]:"3",d=$("#".concat(this.getInputId())
347),e=(0,_store.getEmail)(),!Mutil.empty(e)){a.n=1;break}return(0,_signupFunnelTrack.trackStepFailed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_AUTH,"no_email"),Mutil.mlog("\uC774\uBA54\uC77C \uC815\uBCF4\uAC00 \uC5C6\uC5B4\uC11C \uC778\uC99D \uBC88\uD638\uB97C \uCCB4\uD06C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."),a.a(2);case 1:if(this.$props.EmailAuthIput.inputValidate()){a.n=2;break}return(0,_signupFunnelTrack.trackStepFailed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_AUTH,"format"),Mutil.mlog("\uC778\uC99D \uBC88\uD638\uAC00 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC544\uC11C \uC778\uC99D \uBC88\uD638\uB97C \uCCB4\uD06C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."),a.a(2);case 2:return a.n=3,(0,_index.checkAuthNum)(_objectSpread({USER_ID:e,AUTH_NO:d.val(),AUTH_TIME_MM:c},this.getDeviceInfo()));case 3:if(f=a.v,g=d.parent(),"9203"!==Often.null2Void(f.RSLT_CD)){a.n=4;break}return(0,_signupFunnelTrack.trackEmailVerificationResult)("expired"),(0,_signupFunnelTrack.trackStepFailed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_AUTH,"expired"),Mutil.toast("error",null===f||void 0===f?void 0:f.ERR_MSG),a.a(2);case 4:if("0000"===Often.null2Void(f.RSLT_CD)){a.n=5;break}return(0,_signupFunnelTrack.trackEmailVerificationResult)("mismatch"),(0,_signupFunnelTrack.trackStepFailed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_AUTH,"mismatch"),_index3.InputErrorHandler.activeErrorModeAboutInput(g,i18next.t(main.alert.verificationNotMatch)),a.a(2);case 5:if((0,_signupFunnelTrack.trackEmailVerificationResult)("success"),(0,_signupFunnelTrack.trackStepCompleted)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_AUTH),(0,_store.setAuthHash)(Often.null2Void(f.AUTH_HASH)),!(!Mutil.empty(null===(b=window)||void 0===b?void 0:b.CONNECT_INVITE_KEY)&&((0,_store.isGuestUser)()||Often.isGlobal()||(0,_store.isProjectInviation)()))){a.n=6;break}return _index2.SignUpViewChanger.loadInvitationUserFormView(),a.a(2);case 6:return a.n=7,_index2.SignUpViewChanger.loadProfileView();case 7:return a.a(2)}},a,this)}));return a}()}])}(_PageView2.PageView);
348
349},{"../../../apiCall/signup/index.js":1,"../components/Header.js":55,"../components/input/EmailAuthInput.js":69,"../components/layout/EmailAuthLayout.js":83,"../store.js":100,"../util/input-error-handler/index.js":102,"../util/signup-funnel-track.js":107,"../util/view-changer/index.js":108,"./PageView.js":123}],117:[function(require,module,exports){
350"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmailInputView=void 0;var _PageView2=require("./PageView.js"),_Layout=require("../components/layout/Layout.js"),_index=require("../../../apiCall/signup/index.js"),_index2=require("../util/input-error-handler/index.js"),_store=require("../store.js"),_signupFunnelTrack=require("../util/signup-funnel-track.js"),_index3=require("../util/view-changer/index.js"),_constant=require("../constant.js"),_Header=require("../components/Header.js"),_EmailInput=require("../components/input/EmailInput.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
350return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var EmailInputView=exports.EmailInputView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;this.$props.Layout=new _Layout.Layout(this.$target,{isAppend:!0,sectionId:"emailInputSection",mainText:d,subText:f,nextButton:{text:this.getNextButtonText(),nextPageFunc:this.moveEmailAuthView.bind(this)}})}},{key:"renderComponents",value:function a(){this.$props.Layout&&(new _Header.Header(this.$props.Layout.getHeaderLayer(),{isShowLoginBtn:!0,isShowPrevBtn:!0}),this.$props.EmailInput=new _EmailInput.EmailInput(this.$props.Layout.getMainLayer(),{inputId:"emailInput",$posTarget:$("#subTxt"),isAfter:!0,isLast:!0,emailValue:(0,_store.getEmail)(),submit:this.getProceedHandler()}))}},{key:"getProceedHandler",value:function a(){return this.moveEmailAuthView.bind(this)}},{key:"moveEmailAuthView",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=0<c.length&&void 0!==c[0]?c[0]:{},b&&void 0!==b.marketingYn&&(0,_store.addMarketingYn)(b.marketingYn),this.$props.EmailInput.inputValidate()){a.n=1;break}return a.a(2);case 1:return a.n=2,this.checkEmailAvailable();case 2:if(a.v){a.n=3;break}return a.a(2);case 3:(0,_store.addEmail)(this.$props.EmailInput.getInputValue()),(0,_signupFunnelTrack.trackStepCompleted)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_INPUT),_index3.SignUpViewChanger.loadEmailAuthView();case 4:return a.a(2)}},a,this)}));return a}()},{key:"validateEmailStep",value:(function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(this.$props.EmailInput.inputValidate()){a.n=1;break}return(0,_signupFunnelTrack.trackStepFailed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_INPUT,"format"),a.a(2,!1);case 1:return a.n=2,this.checkEmailAvailable();case 2:if(a.v){a.n=3;break}return(0,_signupFunnelTrack.trackStepFailed)(_signupFunnelTrack.SIGNUP_STEP.EMAIL_INPUT,"taken"),a.a(2,!1);case 3:return a.a(2,!0)}},a,this)}));return a}())},{key:"checkEmailAvailable",value:(function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=this.$props.EmailInput.getInputValue(),a.n=1,(0,_index.checkDuplicateEmail)(b);case 1:if(c=a.v,!this.isCompanyRegisterError(c.ERR_CD)){a.n=2;break}return _index2.InputErrorHandler.activeErrorModeAboutInput(this.$props.EmailInput.get$Input(),i18next.t(login.accountAlreadyJoin)),a.a(2,!1);case 2:if(!this.isDuplicateEmail(c.ERR_CD)){a.n=3;break}return _index2.InputErrorHandler.activeErrorModeAboutInput(this.$props.EmailInput.get$Input(),i18next.t(common.occupy,{val:$t(dictionary.email)})),a.a(2,!1);case 3:return a.a(2,!0)}},a,this)}));return a}())},{key:"isCompanyRegisterError",value:function b(a){return Mutil.n2v(a)===_constant.ERROR_CODE.EXIST_COMPANY_INVIT}},{key:"isDuplicateEmail",value:function b(a){return Mutil.n2v(a)!==_constant.ERROR_CODE.SUCCESS}}])}(_PageView2.PageView);
351
352},{"../../../apiCall/signup/index.js":1,"../components/Header.js":55,"../components/input/EmailInput.js":70,"../components/layout/Layout.js":85,"../constant.js":98,"../store.js":100,"../util/input-error-handler/index.js":102,"../util/signup-funnel-track.js":107,"../util/view-changer/index.js":108,"./PageView.js":123}],118:[function(require,module,exports){
353"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GuestEmailView=void 0;var _EmailInputView2=require("./EmailInputView.js"),_GoogleButton=require("../components/button/GoogleButton.js"),_KakaoButton=require("../components/button/KakaoButton.js"),_AppleButton=require("../components/button/AppleButton.js"),_SnsButtonsLayout=require("../components/layout/SnsButtonsLayout.js"),_SimpleComponent=_interopRequireDefault(require("../components/SimpleComponent.js")),_TermAgreePopup=require("../components/popup/TermAgreePopup.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
353q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var GuestEmailView=exports.GuestEmailView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;this.$props.Layout=new _SnsButtonsLayout.SnsButtonsLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,nextButton:{text:this.getNextButtonText(),nextPageFunc:this.openTermAgreePopup.bind(this)}})}},{key:"getProceedHandler",value:function a(){return this.openTermAgreePopup.bind(this)}},{key:"openTermAgreePopup",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,this.validateEmailStep();case 1:if(a.v){a.n=2;break}return a.a(2);case 2:new _TermAgreePopup.TermAgreePopup($("body"),{isAppend:!0,onAgree:this.moveEmailAuthView.bind(this)});case 3:return a.a(2)}},a,this)}));return a}()},{key:"renderComponents",value:function a(){_superPropGet(b,"renderComponents",this,3)([]);var c=$(".js-next-page-button");_SimpleComponent.default.init({target:c,renderOption:"after",template:function a(){return"<div class=\"sns-login-wrap js-sns-button-wrap\"></div>"}}),_SimpleComponent.default.init({target:c,renderOption:"after",template:function a(){return"<div class=\"js-quest-or guest-or\"><span>".concat(i18next.t(login.or),"</span></div>")}}),this.renderSnsButtons()}},{key:"renderSnsButtons",value:function a(){var b=$("#".concat(this.getSectionId())),c=b.find(".js-sns-button-wrap");new _GoogleButton.GoogleButton(c,{type:"a",isAppend:!0}),new _KakaoButton.KakaoButton(c,{type:"a",isAppend:!0}),new _AppleButton.AppleButton(c,{type:"a",isAppend:!0})}}])}(_EmailInputView2.EmailInputView);
354
355},{"../components/SimpleComponent.js":58,"../components/button/AppleButton.js":59,"../components/button/GoogleButton.js":62,"../components/button/KakaoButton.js":64,"../components/layout/SnsButtonsLayout.js":89,"../components/popup/TermAgreePopup.js":93,"./EmailInputView.js":117}],119:[function(require,module,exports){
356"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.InvitationCompanyView=void 0;var _index=require("../util/view-changer/index.js"),_PageView2=require("./PageView.js"),_CompanyInfoLayout=require("../components/layout/CompanyInfoLayout.js"),_Header=require("../components/Header.js");function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
356function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var InvitationCompanyView=exports.InvitationCompanyView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function(){var a=this.$props,b=a.mainText,c=void 0===b?"":b,d=a.subText,e=void 0===d?"":d,f=a.companyName,g=void 0===f?"":f,h=a.employeeList,i=void 0===h?"":h;this.$props.CompanyInfoLayOut=new _CompanyInfoLayout.CompanyInfoLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:c,subText:e,companyName:g,employeeList:i,nextButton:{id:"joinCompanyBtn",text:this.getNextButtonText(),nextPageFunc:this.nextPage.bind(this)}})}},{key:"renderComponents",value:function(){this.$props.CompanyInfoLayOut&&new _Header.Header(this.$props.CompanyInfoLayOut.getHeaderLayer(),{isShowLoginBtn:!1,isShowPrevBtn:!0})}},{key:"getSectionId",value:function(){return"invitationCompanySection"}},{key:"getNextButtonText",value:function(){return"".concat(i18next.t(common.requestedToJoin))}},{key:"nextPage",value:function(){_index.SignUpViewChanger.loadInvitationEmail()}}])}(_PageView2.PageView);
357
358},{"../components/Header.js":55,"../components/layout/CompanyInfoLayout.js":79,"../util/view-changer/index.js":108,"./PageView.js":123}],120:[function(require,module,exports){
359"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.InvitationEmailView=void 0;var _EmailInputView2=require("./EmailInputView.js"),_Layout=require("../components/layout/Layout.js"),_Header=require("../components/Header.js"),_TermAgreePopup=require("../components/popup/TermAgreePopup.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
359return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _superPropGet(a,b,c,d){var e=_get(_getPrototypeOf(1&d?a.prototype:a),b,c);return 2&d&&"function"==typeof e?function(a){return e.apply(c,a)}:e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(a,b,c){var d=_superPropBase(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(3>arguments.length?a:c):e.value}},_get.apply(null,arguments)}function _superPropBase(a,b){for(;!{}.hasOwnProperty.call(a,b)&&null!==(a=_getPrototypeOf(a)););return a}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var InvitationEmailView=exports.InvitationEmailView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;this.$props.Layout=new _Layout.Layout(this.$target,{isAppend:!0,sectionId:"emailInputSection",mainText:d,subText:f,nextButton:{text:this.getNextButtonText(),nextPageFunc:this.openTermAgreePopup.bind(this)}})}},{key:"getProceedHandler",value:function a(){return this.openTermAgreePopup.bind(this)}},{key:"openTermAgreePopup",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,this.validateEmailStep();case 1:if(a.v){a.n=2;break}return a.a(2);case 2:new _TermAgreePopup.TermAgreePopup($("body"),{isAppend:!0,onAgree:this.moveEmailAuthView.bind(this)});case 3:return a.a(2)}},a,this)}));return a}()},{key:"renderComponents",value:function a(){_superPropGet(b,"renderComponents",this,3)([]),new _Header.Header(this.$props.Layout.getHeaderLayer(),{isShowLoginBtn:!0,isShowPrevBtn:!1});var c=$("#emailInputSection");c.addClass("business-email-type"),0===c.find(".promo-banner").length&&c.find("article").prepend("<img class=\"promo-banner\" src=\"/flow-renewal/assets/images/signup/signup-promo-banner.svg\" alt=\"\" aria-hidden=\"true\">")}}])}(_EmailInputView2.EmailInputView);
360
361},{"../components/Header.js":55,"../components/layout/Layout.js":85,"../components/popup/TermAgreePopup.js":93,"./EmailInputView.js":117}],121:[function(require,module,exports){
362"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.InvitationUserFormView=void 0;var _PageView2=require("./PageView.js"),_UserProfileLayout=require("../components/layout/UserProfileLayout.js"),_Header=require("../components/Header.js"),_NameInput=require("../components/input/NameInput.js"),_PasswordInput=require("../components/input/PasswordInput.js"),_inputValidation=require("../util/input-validate/inputValidation.js"),_store=require("../store.js"),_LoadingPopup=require("../components/popup/LoadingPopup.js"),_constant=require("../constant.js"),_index=require("../util/view-changer/index.js"),_PhoneNumberInput=require("../components/input/PhoneNumberInput.js"),_PhoneAuth=_interopRequireDefault(require("../components/input-group/PhoneAuth.js")),_index2=require("../../../bridge/renewal-signup/index.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
vendor: 4,389 bytes, line 362
362:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}
362function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var InvitationUserFormView=exports.InvitationUserFormView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e,g=(0,_store.getUserId)(),h=window._CLIENT_REGION||"KR";this.$props.UserProfileLayout=new _UserProfileLayout.UserProfileLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,userId:g,nextButton:{id:"invitationUserFormSubmit",text:this.getNextButtonText(),nextPageFunc:this.nextPage.bind(this),disabled:!Often.isGlobal()&&"KR"===h}})}},{key:"renderComponents",value:function a(){if(this.$props.UserProfileLayout){new _Header.Header(this.$props.UserProfileLayout.getHeaderLayer(),{isShowLoginBtn:!1,isShowPrevBtn:!0});var b=$("#".concat(this.getSectionId()));b.find("#companyNameLayer").remove(),b.find(".join-existing-company").remove(),this.$props.NameInput=new _NameInput.NameInput(this.$props.UserProfileLayout.getUserNameLayer(),{isLast:Often.isGlobal(),addClassName:this.getJoinInputClassName(),submit:this.nextPage.bind(this),value:(0,_store.isSnsSignUp
362)()?(0,_store.getUserName)():"",autoFocus:!0});var c=new _PasswordInput.PasswordInput(this.$props.UserProfileLayout.getPasswordLayer(),{allowBlank:!1,addClassName:this.getJoinInputClassName()});if(this.$props.PasswordInput=(0,_store.isSnsSignUp)()?null:c,!Often.isGlobal()){var d=window._CLIENT_REGION||"KR";if("KR"===d)return this.$props.PhoneAuth=(0,_PhoneAuth.default)(),void this.$props.PhoneAuth.init({target:this.$props.UserProfileLayout.getPhoneAuthLayer(),renderOption:"append"});this.$props.PhoneNumberInput=new _PhoneNumberInput.PhoneNumberInput(this.$props.UserProfileLayout.getPhoneAuthLayer(),{isLast:!0,addClassName:this.getJoinInputClassName(),submit:this.nextPage.bind(this)})}}}},{key:"getSectionId",value:function a(){return"invitationUserFormSection"}},{key:"getJoinInputClassName",value:function a(){return"js-join-input"}},{key:"setUserData",value:function a(){var b;(0,_store.addUserName)(this.$props.NameInput.getInputValue()),null!==(null===(b=this.$props)||void 0===b?void 0:b.PasswordInput)&&(0,_store.addPassword)(this.$props.PasswordInput.getInputValue()),(0,_store.addPhoneNumber)($("#phoneNumberInput").val())}},{key:"nextPage",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=$("#".concat(this.getSectionId())),c=b.find(".".concat(this.getJoinInputClassName())),_inputValidation.InputValidator.inputsValidate(c)){a.n=1;break}return a.a(2);case 1:if(Often.isGlobal()){a.n=7;break}if(d=window._CLIENT_REGION||"KR","KR"!==d){a.n=3;break}if((0,_store.getPhoneAuthCompleted)()){a.n=2;break}return a.n=2,this.verifyAuthCode();case 2:if((0,_store.getPhoneAuthCompleted)()){a.n=3;break}return this.$props.PhoneAuth.validatePhoneAuthInputs(),a.a(2);case 3:if(this.setUserData(),!(0,_store.isGuestUser)()){a.n=5;break}return a.n=4,this.registerGuest();case 4:a.n=6;break;case 5:return a.n=6,this.joinCompany();case 6:return a.a(2);case 7:if(this.setUserData(),e=(0,_store.getPlanId)(),f=!!e&&-1<e.indexOf("BASIC"),!f){a.n=8;break}return _index.SignUpViewChanger.loadCompanyInfoInputView(!0),a.a(2);case 8:return a.n=9,this.joinCompany();case 9:return a.a(2)}},a,this)}));return a}()},{key:"joinCompany",value:(function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(c=$(this.$target).find("article"),new _LoadingPopup.LoadingPopup(c,{isAppend:!0,loadingText:i18next.t(common.wait)}),!Mutil.empty(null===(b=window)||void 0===b?void 0:b.CONNECT_INVITE_KEY)){a.n=1;break}return Mutil.mlog("CONNECT_INVITE_KEY \uAC12\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.!!!"),a.a(2);case 1:return a.n=2,(0,_store.getUser)().joinCompanyBySubDom();case 2:if(d=a.v,e=Mutil.n2v(d.ERROR_CODE)===_constant.ERROR_CODE.SUCCESS,f=Mutil.n2v(d.ERR_CD)===_constant.ERROR_CODE.BLOCK_DOMAIN,!f){a.n=3;break}return Mutil.toast("error",i18next.t(exception.error.limitEmail)),a.a(2);case 3:if(e||Mutil.toast("error",i18next.t(common.occupy,{val:$t(dictionary.email)})),new _LoadingPopup.LoadingPopup($("body"),{}),g="Y"===Mutil.n2v(d.JNNG_ATHZ_YN,"N"),!g){a.n=4;break}return h=Often.isGlobal()?"new_signup6":"new_joinup3_a",(0,_store.collectGtm)(h),(0,_store.getUser)().signInWithTwoFactor(d),a.a(2);case 4:_index.SignUpViewChanger.loadCompanyJoinWaitView();case 5:return a.a(2)}},a,this)}));return a}())},{key:"registerGuest",value:(function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return new _LoadingPopup.LoadingPopup(this.$props.UserProfileLayout.getMainArticle(),{isAppend:!0,loadingText:Often.isGlobal()?i18next.t(common.wait):"\uAC00\uC785\uC744 \uC644\uB8CC\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4",isNoLoadingText:Often.isGlobal()}),a.n=1,(0,_store.getUser)().registerGuest();case 1:if(b=a.v,c=b.ERR_CD,d=void 0===c?"":c,e=b.PASS_JSON,f=void 0===e?{}:e,Mutil.n2v(d)===_constant.ERROR_CODE.SUCCESS){a.n=2;break}return _index.SignUpViewChanger.loadGuestEmailView("",d),a.a(2);
362case 2:if(!(0,_store.isSnsSignUp)()){a.n=3;break}return this.registerGuestBySns(),a.a(2);case 3:if(!(0,_store.isWebView)()){a.n=4;break}return(0,_index2.mobileSignIn)((0,_store.getUser)().getSignInJson()),a.a(2);case 4:g=Mutil.requireIIFE("CommonLogin"),g.goLogin(_objectSpread({},f));case 5:return a.a(2)}},a,this)}));return a}())},{key:"registerGuestBySns",value:function a(){return(0,_store.isSnsSignUp)()?(0,_store.isWebView)()?void(0,_index2.mobileSignIn)((0,_store.getUser)().getRegisterGuestBySnsJson()):void(0,_store.getUser)().registerGuestBySnS():void 0}},{key:"verifyAuthCode",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=this.$props.UserProfileLayout.getPhoneAuthLayer(),c=b.find("#authCodeInput"),d=b.find(".js-counter-message"),a.n=1,this.$props.PhoneAuth.verifyAuthCode();case 1:if(e=a.v,e){a.n=2;break}return c.closest(".js-interactive-form-wrap").addClass("status-error"),d.closest(".js-counter-wrap").addClass("status-error"),d.text(i18next.t(main.alert.verificationNotMatch)),a.a(2);case 2:b.find("#phoneNumberInput").attr("disabled",!0),b.find(".js-phone-auth-button").attr("disabled",!0),c.attr("disabled",!0),b.find(".js-counter-wrap").hide(),(0,_store.addPhoneAuthCompleted)(!0),this.$props.PhoneAuth.stopCounter();case 3:return a.a(2)}},a,this)}));return a}()}])}(_PageView2.PageView);
363
364},{"../../../bridge/renewal-signup/index.js":4,"../components/Header.js":55,"../components/input-group/PhoneAuth.js":67,"../components/input/NameInput.js":72,"../components/input/PasswordInput.js":73,"../components/input/PhoneNumberInput.js":74,"../components/layout/UserProfileLayout.js":91,"../components/popup/LoadingPopup.js":92,"../constant.js":98,"../store.js":100,"../util/input-validate/inputValidation.js":104,"../util/view-changer/index.js":108,"./PageView.js":123}],122:[function(require,module,exports){
365"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.MorningmateAppSumo=void 0;var _PageView2=require("./PageView.js"),_UserProfileLayout=require("../components/layout/UserProfileLayout.js"),_inputValidation=require("../util/input-validate/inputValidation.js"),_store=require("../store.js"),_PasswordInput=require("../components/input/PasswordInput.js"),_NameInput=require("../components/input/NameInput.js"),_TermPopup=require("../components/popup/TermPopup.js"),_LoadingPopup=require("../components/popup/LoadingPopup.js"),_AppSumoLayout=require("../components/layout/AppSumoLayout.js"),_CompanyNameInput=require("../components/input/CompanyNameInput.js"),_SubDomainInput=require("../components/input/SubDomainInput.js"),_index=require("../util/view-changer/index.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
365:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var MorningmateAppSumo=exports.MorningmateAppSumo=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e,g=b.token,h=void 0===g?"":g,i=(0,_store.getUserId)();this.$props.AppSumoLayout=new _AppSumoLayout.AppSumoLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,userId:i,token:h,nextButton:{text:this.getNextButtonText(),nextPageFunc:this.nextPage.bind(this)}})}},{key:"renderComponents",value:function a(){this.$props.AppSumoLayout&&(this.$props.CompanyNameInput=new _CompanyNameInput.CompanyNameInput(this.$props.AppSumoLayout.getCompanyNameLayer(),{isLast:Often.isGlobal(),addClassName:this.getCommonJoinInputClassName(),submit:this.nextPage.bind(this)}),this.$props.NameInput=new _NameInput.NameInput(this.$props.AppSumoLayout.getUserNameLayer(),{isLast:Often.isGlobal(),addClassName:this.getCommonJoinInputClassName(),submit:this.nextPage.bind(this)}),this.$props.PasswordInput=new _PasswordInput.PasswordInput(this.$props.AppSumoLayout.getPasswordLayer(),{allowBlank:!1,addClassName:this.getCommonJoinInputClassName()}))}},{key:"getSectionId",value:function a(){return"profileInputSection"}},{key:"getCommonJoinInputClassName",value:function a(){return"js-join-input"}},{key:"nextPage",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=$("#".concat(this.getSectionId())),c=b.find(".".concat(this.getCommonJoinInputClassName())),_inputValidation.InputValidator.inputsValidate(c)){a.n=1;break}return a.a(2);case 1:return this.addUserInfo(),a.n=2,(0,_store.getUser)().createNewCompany();case 2:d=a.v,e=d.PASS_JSON,f=void 0===e?{}:e,new _LoadingPopup.LoadingPopup(this.$props.AppSumoLayout.getMainArticle(),{isAppend:!0,loadingText:i18next.t(common.wait)}),g=Mutil.requireIIFE("CommonLogin"),g.goLogin(_objectSpread({},f));case 3:return a.a(2)}},a,this)}));return a}()},{key:"addUserInfo",value:function a(){var b;(0,_store.addCompanyName)(this.$props.CompanyNameInput.getInputValue()),(0,_store.addCompanySubDomain)(this.$props.CompanyNameInput.getSubDomain()),(0,_store.addUser
365Name)(this.$props.NameInput.getInputValue()),null!==(null===(b=this.$props)||void 0===b?void 0:b.PasswordInput)&&(0,_store.addPassword)(this.$props.PasswordInput.getInputValue())}}])}(_PageView2.PageView);
366
367},{"../components/input/CompanyNameInput.js":68,"../components/input/NameInput.js":72,"../components/input/PasswordInput.js":73,"../components/input/SubDomainInput.js":75,"../components/layout/AppSumoLayout.js":76,"../components/layout/UserProfileLayout.js":91,"../components/popup/LoadingPopup.js":92,"../components/popup/TermPopup.js":94,"../store.js":100,"../util/input-validate/inputValidation.js":104,"../util/view-changer/index.js":108,"./PageView.js":123}],123:[function(require,module,exports){
368"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageView=void 0;var _Component=_interopRequireDefault(require("../../../core/Component.js")),_SignUpComponent2=require("../components/SignUpComponent.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var PageView=exports.PageView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"render",value:function(){this.renderLayout(),this.renderComponents(),this.mounted()}},{key:"renderLayout",value:function(){}},{key:"renderComponents",value:function(){}},{key:"getSectionId",value:function(){return"sectionId"}},{key:"getNextButtonText",value:function(){return i18next.t(login.next)}}])}(_SignUpComponent2.SignUpComponent);
369
370},{"../../../core/Component.js":28,"../components/SignUpComponent.js":57}],124:[function(require,module,exports){
371"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProjectInvitationView=void 0;var _index=require("../util/view-changer/index.js"),_PageView2=require("./PageView.js"),_ProjectInvitationLayout=require("../components/layout/ProjectInvitationLayout.js"),_Header=require("../components/Header.js"),_IconButton=require("../components/button/IconButton.js"),_InviterList=require("../components/InviterList.js"),_store=require("../store.js"),_index2=require("../../../apiCall/signup/index.js"),_index3=require("../util/plan/index.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
371q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var ProjectInvitationView=exports.ProjectInvitationView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e;this.$props.ProjectInvitationLayout=new _ProjectInvitationLayout.ProjectInvitationLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f})}},{key:"renderComponents",value:function a(){var b,c;this.$props.ProjectInvitationLayout&&(new _Header.Header(this.$props.ProjectInvitationLayout.getHeaderLayer(),{isS
371howLoginBtn:!0,isShowPrevBtn:!1}),new _IconButton.IconButton(this.$props.ProjectInvitationLayout.getInviteButtonWrap(),{isAppend:!0,id:"joinAsGuest",icon:"person",buttonText:i18next.t(login.invite.joinProjectGuestTitle),desc:i18next.t(login.invite.joinProjectGuestSubtitle),clickFunc:function a(){Often.isGlobal()?_index.SignUpViewChanger.loadBusinessEmailView((0,_index3.getRegionPlanId)("basic")):((0,_store.setAsGuestUser)(!0),_index.SignUpViewChanger.loadGuestEmailView())}}),new _IconButton.IconButton(this.$props.ProjectInvitationLayout.getInviteButtonWrap(),{isAppend:!0,id:"joinAsEmployee",icon:"company",buttonText:i18next.t(login.invite.joinProjectEmployeeTitle),desc:""===(null===(b=window)||void 0===b?void 0:b.CONNECT_INVITED_COMPANY_NAME)?i18next.t(login.invite.joinProjectEmployeeSubtitle):i18next.t(login.invite.joinProjectEmployeeSubtitleWithVal,{val:null===(c=window)||void 0===c?void 0:c.CONNECT_INVITED_COMPANY_NAME}),clickFunc:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(c=null===(b=window)||void 0===b?void 0:b.CONNECT_INVITE_KEY,!Mutil.empty(c)){a.n=1;break}return a.a(2);case 1:return a.n=2,(0,_index2.getCompanyInfoByInviteKey)(c);case 2:if(d=a.v,e=d.USE_INTT_ID,f=void 0===e?"":e,""!==f){a.n=3;break}
371return Mutil.toast("error",i18next.t(invite.invalidInvitation)),a.a(2);case 3:if(f.startsWith("BFLOW")){a.n=4;break}return Mutil.toast("error",i18next.t(invite.syncInstitutionRestricted)),a.a(2);case 4:(0,_store.addJoinUseInttId)(f),_index.SignUpViewChanger.loadInvitationCompanyView();case 5:return a.a(2)}},a)}));return a}()}),this.renderInvitationList().then())}},{key:"renderInvitationList",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,(0,_store.getUser)().getInviterList();case 1:if(b=a.v,!(1>b.length)){a.n=2;break}return a.a(2);case 2:this.$props.ProjectInvitationLayout.showInvitationListLayer(),new _InviterList.InviterList(this.$props.ProjectInvitationLayout.getInvitationListLayer(),{isAppend:!0,inviterList:b,moveCompanyInfoPage:function a(){_index.SignUpViewChanger.loadCompanyInfoView(!0)}});case 3:return a.a(2)}},a,this)}));return a}()},{key:"getSectionId",value:function a(){return"invitationSelectSection"}}])}(_PageView2.PageView);
372
373},{"../../../apiCall/signup/index.js":1,"../components/Header.js":55,"../components/InviterList.js":56,"../components/button/IconButton.js":63,"../components/layout/ProjectInvitationLayout.js":86,"../store.js":100,"../util/plan/index.js":106,"../util/view-changer/index.js":108,"./PageView.js":123}],125:[function(require,module,exports){
374"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubDomainSearchView=void 0;var _PageView2=require("./PageView.js"),_SubDomainLayout=require("../components/layout/SubDomainLayout.js"),_index=require("../../../apiCall/signup/index.js"),_store=require("../store.js"),_index2=require("../util/view-changer/index.js"),_Header=require("../components/Header.js"),_SubDomainInput=require("../components/input/SubDomainInput.js"),_index3=require("../util/input-error-handler/index.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
374return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var SubDomainSearchView=exports.SubDomainSearchView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e,g=b.infoText,h=void 0===g?"":g;this.$props.Layout=new _SubDomainLayout.SubDomainLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,infoText:h,nextButton:{text:i18next.t(login.join),nextPageFunc:this.moveCompanyInfoView.bind(this)}})}},{key:"renderComponents",value:function a(){new _Header.Header(this.$props.Layout.getHeaderLayer(),{isShowLoginBtn:!1,isShowPrevBtn:!0}),this.$props.SubDomainInput=new _SubDomainInput.SubDomainInput(this.$props.Layout.getSubDomainInputLayer(),{inputId:this.getInputId(),isLast:!0,submit:this.moveCompanyInfoView.bind(this)})}},{key:"getInputId",value:function a(){return"subDomainInput"}},{key:"getSectionId",value:function a(){return"companySubDomainSearchSection"}},{key:"moveCompanyInfoView",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=$("#".concat(this.getInputId())),this.$props.SubDomainInput.inputValidate()){a.n=1;break}return a.a(2);case 1:return c=b.val(),a.n=2,(0,_index.checkSubDomain)(c);case 2:if(d=a.v,"0000"===Mutil.n2v(d.ERR_CD)){a.n=3;break}return _index3.InputErrorHandler.activeErrorModeAboutInputTempLayer(this.$props.SubDomainInput.getInputErrorElement(),Mutil.n2v(null===d||void 0===d?void 0:d.ERR_MSG)),a.a(2);case 3:(0,_store.addJoinUseInttId)(Mutil.n2v(d.USE_INTT_ID)),_index2.SignUpViewChanger.loadCompanyInfoView();case 4:return a.a(2)}},a,this)}));return a}()}])}(_PageView2.PageView);
375
376},{"../../../apiCall/signup/index.js":1,"../components/Header.js":55,"../components/input/SubDomainInput.js":75,"../components/layout/SubDomainLayout.js":90,"../store.js":100,"../util/input-error-handler/index.js":102,"../util/view-changer/index.js":108,"./PageView.js":123}],126:[function(require,module,exports){
377"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SurveyView=void 0;var _PageView2=require("./PageView.js"),_SignupSurveyLayout=require("../components/layout/SignupSurveyLayout.js"),_Header=require("../components/Header.js"),_index=require("../util/view-changer/index.js"),_store=require("../store.js"),_constant=require("../constant.js"),_LoadingPopup=require("../components/popup/LoadingPopup.js"),_index2=require("../../../bridge/renewal-signup/index.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
377q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var SurveyView=exports.SurveyView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"getSectionId",value:function a(){return"signupSurveySection"}},{key:"renderLayout",value:function a(){this.$props.SignupSurveyLayout=new _SignupSurveyLayout.SignupSurveyLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId()})}},{key:"renderComponents",value:function a(){this.$props.SignupSurveyLayout&&(new _Header.Header(this.$props.SignupSurveyLayout.getHeaderLayer(),{isS
377howLoginBtn:!0,isShowPrevBtn:!0}),$("#".concat(this.getSectionId())).off("click.surveySubmit").on("click.surveySubmit",".signup-survey__submit",this.onSubmit.bind(this)))}},{key:"readSurvey",value:function a(){var b=$("#".concat(this.getSectionId()," .signup-survey__group")),c=function c(a){return Mutil.n2v(b.eq(a).find(".Btn-TabM.active").first().text()).trim()};return{inflowPath:c(0),userCount:c(1),sector:c(2)}}},{key:"onSubmit",value:function(){function a(){return c.apply(this,arguments)}var c=_asyncToGenerator(_regenerator().m(function a(){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return d=this.readSurvey(),e=d.sector,f=d.userCount,(0,_store.addCompanyCategory)(b.SECTOR_CODE_MAP[e]||"etc"),(0,_store.addHopeCount)(b.HOPE_COUNT_MAP[f]||""),g=new _LoadingPopup.LoadingPopup($("#".concat(this.getSectionId())).find("article"),{isAppend:!0,loadingText:Often.isGlobal()?i18next.t(login.createWorkSpace):"\uAC00\uC785\uC744 \uC644\uB8CC\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4"}),a.n=1,(0,_store.getUser)().createNewCompany();case 1:if(h=a.v,i=h.ERR_CD,j=void 0===i?"":i,k=h.ERR_MSG,l=void 0===k?"":k,m=h.PASS_JSON,n=void 0===m?{}:m,o=h.COMPANY_INFO_JSON,p=void 0===o?{}:o,q=h.SUB_DOM,r=void 0===q?"":q,j!==_constant.ERROR_CODE.BLOCK_DOMAIN){a.n=2;break}return Mutil.toast("error",i18next.t(exception.error.limitEmail)),g.removePopup(),a.a(2);case 2:if(j!==_constant.ERROR_CODE.EXIST_SUB_DOMAIN){a.n=3;break}return Mutil.mlog("\uC11C\uBE0C\uB3C4\uBA54\uC778\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."),g.removePopup(),a.a(2);case 3:if(j!==_constant.ERROR_CODE.EXIST_COMPANY){a.n=4;break}return Mutil.mlog("\uC774\uBBF8 \uD68C\uC0AC\uAC00 \uC874\uC7AC\uD569\uB2C8\uB2E4."),g.removePopup(),a.a(2);case 4:if(j!==_constant.ERROR_CODE.VERIFICATION_FORGED){a.n=5;break}return g.removePopup(),Mutil.toast("error",l),setTimeout(function(){return location.reload()},2e3),a.a(2);case 5:if(!(null!==(c=window)&&void 0!==c&&c.isFuncPhoneGetPop)){a.n=6;break}return this.signIn(_objectSpread({},n)),a.a(2);case 6:s=Mutil.requireIIFE("CommonLogin"),s.goLogin(_objectSpread({},n),function(){g.removePopup(),_index.SignUpViewChanger.loadInviteUserView(_objectSpread(_objectSpread({},p),{}
377,{SUB_DOM_DATA:r,isSignUpBySnS:(0,_store.isSnsSignUp)()}))});case 7:return a.a(2)}},a,this)}));return a}()},{key:"signIn",value:function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if((0,_store.isWebView)())return void(0,_index2.mobileSignIn)(_objectSpread({},(0,_store.getUser)().getCreateNewCompanyInfoJson()));var c=Mutil.requireIIFE("CommonLogin");c.goLogin(_objectSpread({},b),function(){c.moveMainPage({firstLoginYn:"Y",desktopGuideYn:"Y"})})}}])}(_PageView2.PageView);_defineProperty(SurveyView,"HOPE_COUNT_MAP",{"10인 이하":"10","11~30인":"11","31~50인":"31","51~100인":"51","101~500인":"100","501~1000인":"500","1000인 이상":"1000"}),_defineProperty(SurveyView,"SECTOR_CODE_MAP",{제조업:"Produce","정보통신업(IT)":"IT","F&B/프랜차이즈":"Franchise","도/소매 유통 판매":"Logistics","엔터테인먼트/여행/예술":"Entertain",서비스:"Service",공공:"Public","건설 및 기타 산업":"Construct","세무/법무/노무":"Tax","의료보건/사회복지":"Medical",금융:"Finance","협회 및 단체":"Association","교육/연구":"Research",기타:"etc"});
378
379},{"../../../bridge/renewal-signup/index.js":4,"../components/Header.js":55,"../components/layout/SignupSurveyLayout.js":88,"../components/popup/LoadingPopup.js":92,"../constant.js":98,"../store.js":100,"../util/view-changer/index.js":108,"./PageView.js":123}],127:[function(require,module,exports){
380"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserProfileView=void 0;var _PageView2=require("./PageView.js"),_UserProfileLayout=require("../components/layout/UserProfileLayout.js"),_inputValidation=require("../util/input-validate/inputValidation.js"),_index=require("../util/input-error-handler/index.js"),_store=require("../store.js"),_constant=require("../constant.js"),_index2=require("../util/view-changer/index.js"),_index3=require("../../../bridge/renewal-signup/index.js"),_PasswordInput=require("../components/input/PasswordInput.js"),_NameInput=require("../components/input/NameInput.js"),_Header=require("../components/Header.js"),_TermPopup=require("../components/popup/TermPopup.js"),_LoadingPopup=require("../components/popup/LoadingPopup.js"),_PhoneAuth=_interopRequireDefault(require("../components/input-group/PhoneAuth.js")),_PhoneNumberInput=require("../components/input/PhoneNumberInput.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
380q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var UserProfileView=exports.UserProfileView=function(a){function b(){return _classCallCheck(this,b),_callSuper(this,b,arguments)}return _inherits(b,a),_createClass(b,[{key:"renderLayout",value:function a(){var b=this.$props,c=b.mainText,d=void 0===c?"":c,e=b.subText,f=void 0===e?"":e,g=(0,_store.getUserId)(),h=window._CLIENT_REGION||"KR";this.$props.UserProfileLayout=new _UserProfileLayout.UserProfileLayout(this.$target,{isAppend:!0,sectionId:this.getSectionId(),mainText:d,subText:f,userId:g,nextButton:{id:"userProfileSubmit",text:this.getNextButtonText(),nextPageFunc:this.nextPage.bind(this),disabled:!Often.isGlobal()&&"KR"===h}})}},{key:"renderComponents",value:function a(){if(this.$props.UserProfileLayout){if(new _Header.Header(this.$props.UserProfileLayout.getHeaderLayer(),{isS
380howLoginBtn:!1,isShowPrevBtn:!0}),(0,_store.isGuestUser)()){var b=$("#".concat(this.getSectionId()));b.find("#companyNameLayer").remove(),b.find(".join-existing-company").remove()}if($("#".concat(this.getSectionId())).off("click.existingTeam").on("click.existingTeam",".js-existing-team-link",function(a){a.preventDefault(),_index2.SignUpViewChanger.loadCompanyJoinView()}),this.$props.NameInput=new _NameInput.NameInput(this.$props.UserProfileLayout.getUserNameLayer(),{isLast:Often.isGlobal(),addClassName:this.getCommonJoinInputClassName(),submit:this.nextPage.bind(this),value:(0,_store.isSnsSignUp)()?(0,_store.getUserName)():"",autoFocus:(0,_store.isGuestUser)()}),this.$props.PasswordInput=(0,_store.isSnsSignUp)()?null:new _PasswordInput.PasswordInput(this.$props.UserProfileLayout.getPasswordLayer(),{allowBlank:!1,addClassName:this.getCommonJoinInputClassName()}),(0,_store.isGuestUser)()||Mutil.isMobile()||Mutil.isTablet()||$("#".concat(this.getSectionId()," #teamNameInput")).focus(),!Often.isGlobal()){var c=window._CLIENT_REGION||"KR";if("KR"===c)return this.$props.PhoneAuth=(0,_PhoneAuth.default)(),void this.$props.PhoneAuth.init({target:this.$props.UserProfileLayout.getPhoneAuthLayer(),renderOption:"append"});this.$props.PhoneNumberInput=new _PhoneNumberInput.PhoneNumberInput(this.$props.UserProfileLayout.getPhoneAuthLayer(),{isLast:!0,addClassName:this.getCommonJoinInputClassName(),submit:this.nextPage.bind(this)})}}}},{key:"getSectionId",value:function a(){return"profileInputSection"}},{key:"getCommonJoinInputClassName",value:function a(){return"js-join-input"}},{key:"_captureProfile",value:(function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(b=$("#".concat(this.getSectionId())),c=b.find(".".concat(this.getCommonJoinInputClassName())),_inputValidation.InputValidator.inputsValidate(c)){a.n=1;break}return a.a(2,!1);case 1:if(d=window._CLIENT_REGION||"KR",Often.isGlobal()||"KR"!==d){a.n=3;break}if((0,_store.getPhoneAuthCompleted)()){a.n=2;break}return a.n=2,this.verifyAuthCode();case 2:if((0,_store.getPhoneAuthCompleted)()){a.n=3;break}return this.$props.PhoneAuth.validatePhoneAuthInputs(),a.a(2,!1);case 3:return this.addUserInfo(),window.SIGN_UP_ID=(0,_store.getUserId)(),a.a(2,!0)}},a,this)}));return a}())},{key:"nextPage",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,this._captureProfile();case 1:if(a.v){a.n=2;break}return a.a(2);case 2:if(!(0,_store.isGuestUser)()){a.n=4;break}return a.n=3,this.registerGuest();case 3:return a.a(2);case 4:if(b=$("#".concat(this.getSectionId()," #teamNameInput")),c=b.closest(".js-interactive-form-wrap"),!Mutil.empty(Mutil.n2v(b.val()).trim())){a.n=5;break}return _index.InputErrorHandler.activeErrorModeAboutInput(c,i18next.t(main.alert.enterWord,{val:Often.isGlobal()?i18next.t(login.companyName):"\uD68C\uC0AC\uBA85"})),b.focus(),a.a(2);case 5:_index.InputErrorHandler.unActiveErrorModeAboutInput(c),this.storeCompanyName(),new _LoadingPopup.LoadingPopup(this.$props.UserProfileLayout.getMainArticle(),{isAppend:!0,loadingText:i18next.t(common.wait),isNoLoadingText:!0}),_index2.SignUpViewChanger.loadSurveyView();case 6:return a.a(2)}},a,this)}));return a}()},{key:"registerGuest",value:(function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return new _LoadingPopup.LoadingPopup(this.$props.UserProfileLayout.getMainArticle(),{isAppend:!0,loadingText:Often.isGlobal()?i18next.t(common.wait):"\uAC00\uC785\uC744 \uC644\uB8CC\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4",isNoLoadingText:Often.isGlobal()}),a.n=1,(0,_store.getUser)().registerGuest();case 1:if(b=a.v,c=b.ERR_CD,d=void 0===c?"":c,e=b.PASS_JSON,f=void 0===e?{}:e,Mutil.n2v(d)===_constant.ERROR_CODE.SUCCESS){a.n=2;break}return _index2.SignUpViewChanger.loadGuestEmailView("",d),a.a(2);
380case 2:if(!(0,_store.isSnsSignUp)()){a.n=3;break}return this.registerGuestBySns(),a.a(2);case 3:if(!(0,_store.isWebView)()){a.n=4;break}return(0,_index3.mobileSignIn)((0,_store.getUser)().getSignInJson()),a.a(2);case 4:g=Mutil.requireIIFE("CommonLogin"),g.goLogin(_objectSpread({},f));case 5:return a.a(2)}},a,this)}));return a}())},{key:"registerGuestBySns",value:function a(){return(0,_store.isSnsSignUp)()?(0,_store.isWebView)()?void(0,_index3.mobileSignIn)((0,_store.getUser)().getRegisterGuestBySnsJson()):void(0,_store.getUser)().registerGuestBySnS():void 0}},{key:"storeCompanyName",value:function a(){var b=Mutil.n2v($("#teamNameInput").val()).trim();(0,_store.addCompanyName)(b),(0,_store.addCompanySubDomain)(_inputValidation.InputValidator.isValidTeamUrl(b)?b:_constant.DEFAULT_SUB_DOMAIN)}},{key:"addUserInfo",value:function a(){var b;(0,_store.addUserName)(this.$props.NameInput.getInputValue()),null!==(null===(b=this.$props)||void 0===b?void 0:b.PasswordInput)&&(0,_store.addPassword)(this.$props.PasswordInput.getInputValue()),(0,_store.addPhoneNumber)($("#phoneNumberInput").val())}},{key:"verifyAuthCode",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=this.$props.UserProfileLayout.getPhoneAuthLayer(),c=b.find("#authCodeInput"),d=b.find(".js-counter-message"),a.n=1,this.$props.PhoneAuth.verifyAuthCode();case 1:if(e=a.v,e){a.n=2;break}return c.closest(".js-interactive-form-wrap").addClass("status-error"),d.closest(".js-counter-wrap").addClass("status-error"),d.text(i18next.t(main.alert.verificationNotMatch)),a.a(2);case 2:b.find("#phoneNumberInput").attr("disabled",!0),b.find(".js-phone-auth-button").attr("disabled",!0),c.attr("disabled",!0),b.find(".js-counter-wrap").hide(),(0,_store.addPhoneAuthCompleted)(!0),this.$props.PhoneAuth.stopCounter();case 3:return a.a(2)}},a,this)}));return a}()}])}(_PageView2.PageView);
381
382},{"../../../bridge/renewal-signup/index.js":4,"../components/Header.js":55,"../components/input-group/PhoneAuth.js":67,"../components/input/NameInput.js":72,"../components/input/PasswordInput.js":73,"../components/input/PhoneNumberInput.js":74,"../components/layout/UserProfileLayout.js":91,"../components/popup/LoadingPopup.js":92,"../components/popup/TermPopup.js":94,"../constant.js":98,"../store.js":100,"../util/input-error-handler/index.js":102,"../util/input-validate/inputValidation.js":104,"../util/view-changer/index.js":108,"./PageView.js":123}],128:[function(require,module,exports){
383"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _electron=require("../util/electron/"),setGlobal=function(a){a.ElectronApi=_electron.ElectronApi},_default=exports.default={setGlobal:setGlobal,ElectronApi:_electron.ElectronApi};
384
385},{"../util/electron/":166}],129:[function(require,module,exports){
386"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}var _sharedIntegrated=_interopRequireDefault(require("../shared-integrated")),_index=require("../../core/user-tracker/index.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);
386try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function e(a,b){if(!b&&a&&a.__esModule)return a;var g,h,j={__proto__:null,default:a};if(null===a||"object"!=_typeof(a)&&"function"!=typeof a)return j;if(g=b?d:c){if(g.has(a))return g.get(a);g.set(a,j)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((h=(g=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(h.get||h.set)?g(j,f,h):j[f]=a[f]);return j})(a,b)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}_sharedIntegrated.default.setGlobal(window);var _window=window,isAdLogin=_window.isAdLogin,_ENTER_YN=_window._ENTER_YN,_IsMini=_window._IsMini;$(document).ready(_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(LocalUtil.setLocal("ONLY_DEVICE_NM",""),LocalUtil.setLocal("ONLY_DEVICE_ID",""),Often.setCookie("FLOW_DUID",""),Often.setCookie("LAST_SUB_PATH",""),Often.setCookie("googleLoginYn",""),c=new URLSearchParams(location.search),d=c.get("continue"),d&&(window.CONTINUE_URL=d),"extension"!==c.get("callback")){a.n=3;break}return a.n=1,Internationalization.asyncInitSetting();case 1:return a.n=2,Promise.resolve().then(function(){return _interopRequireWildcard(require("./integrated.js"))});case 2:return e=a.v,e.setGlobal(),window.completeLoginCallback=function(){return window.opener.postMessage({action:"refreshWritingView"},"*"),window.close(),!0},CommonLogin.addClickEventOnSignIn(),a.a(2);case 3:f=ElectronApi,g=f.Comm,h=g.isElectronAvailable,i=g.getConfigs,j=g.init,k=g.isElectronApp;try{h()&&i().b_fullMode&&$("header").remove(),h()&&!i().b_fullMode&&$(".mjs-mini-back-btn").removeClass("d-none")}catch(a){Mutil.mlog(a)}return a.n=4,Internationalization.asyncInitSetting();case 4:return a.n=5,Promise.resolve().then(function(){return _interopRequireWildcard(require("./integrated.js"))});case 5:if(l=a.v,l.setGlobal(),m=Often.isAct("mobileAzureLogin"),a.p=6,!m){a.n=7;break}return a.n=7,AzureOauth.Mobile.handleAzureLogin();case 7:a.n=9;break;case 8:a.p=8,o=a.v,Mutil.mlog(o);case 9:j(!1),(0,_index.loadUserTracker)(),TeamsHelper.removeTeams(),"Y"!=_ENTER_YN&&ChannelTalk.drawButton(),CommonLogin.setAutoCheck(),isAdLogin&&k()?AdLogin.checkAdIdAndConnect():CommonLogin.goAutoLogin(),_IsMini&&MiniLogin.addClickEvent(),CommonLogin.addClickEventOnSignIn(),CommonLogin.checkSnsLoginAvailable(),n=null===(b=window.ElectronProcessApi)||void 0===b?void 0:b.getLaunchArgs(),ServerChecker.isHdmf?n&&0===n.length&&CommonLogin.checkUserIdBefore():CommonLogin.checkUserIdBefore(),window.inputUserId&&CommonLogin.setUserIdIn$Input(window.inputUserId),displayCustomPopup(),$(document).scrollTop(0);case 10:return a.a(2)}},a,null,[[6,8]])}))),$(window).on("load",function(){setTimeout(function(){ServerChecker.isKsfc&&!ElectronApi.Comm.isElectron()&&Often.logoutOnBrowserClose(),MonitorUtil.loadGtm()},1e3)});function displayCustomPopup(){if(ServerChecker.isKsfc){var a=new Date,b=new Date("2024-02-28T23:59:59");if(a<b){var c=$("<div id=\"ksfcPopup\" class=\"position-abosolute-center\">\n                                     <img src=\"/enterprise/ksfc/img/underConstruction.png\"/>\n                                </div>\n                           ").dblclick(function(a){$(a.target).closest("#ksfcPopup").remove()});$(document.body).append(c)}}}
387
388},{"../../core/user-tracker/index.js":34,"../shared-integrated":128,"./integrated.js":130}],130:[function(require,module,exports){
389"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.setGlobal=void 0;var _util=_interopRequireDefault(require("../../util")),_desktopGuide=require("../../components/desktop-guide/"),TwoFactorPop=_interopRequireWildcard(require("../../components/twofactor-pop/")),_viewChanger=require("../renewal-signup/util/view-changer/"),Azure=_interopRequireWildcard(require("../../components/org-chart/azure.js")),_integrated=_interopRequireDefault(require("../../core/user-tracker/integrated.js")),AzureOauth=_interopRequireWildcard(require("../../components/
vendor: 5,048 bytes, lines 389-392
389azure-oauth/index.js")),Launcher=_interopRequireWildcard(require("../launcher/event.js"));function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=_typeof(a)&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var setGlobal=exports.setGlobal=function(){return function(a){a.util=_util.default,a.DesktopGuide=_desktopGuide.DesktopGuide,a.TwoFactorPop=TwoFactorPop,a.SignUpViewChanger=_viewChanger.SignUpViewChanger,a.Azure=Azure,a.AzureOauth=AzureOauth,a.userTracker=_integrated.default,a.Launcher=Launcher}(window)};
390
391},{"../../components/azure-oauth/index.js":8,"../../components/desktop-guide/":10,"../../components/org-chart/azure.js":20,"../../components/twofactor-pop/":26,"../../core/user-tracker/integrated.js":35,"../../util":175,"../launcher/event.js":53,"../renewal-signup/util/view-changer/":108}],131:[function(require,module,exports){
392"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Ajax=exports.AJAX_OPTION=void 0;var _Often=require("./Often"),_Confirm=require("./Confirm");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
392return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var AJAX_OPTION=exports.AJAX_OPTION={ALLOW_EXECUTE:"ALLOW_EXECUTE",PREVENT_EXECUTE:"PREVENT_EXECUTE",PREVENT_CALLBACK:"PREVENT_CALLBACK"},instance={},Ajax=exports.Ajax=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.spaceName,d=b.packetOption;return _classCallCheck(this,a),c=c||d||AJAX_OPTION.ALLOW_EXECUTE,instance[c]?(instance[c].count++,instance[c]):void(this.count=0,this.returnJson={},this.packetOption=d||AJAX_OPTION.ALLOW_EXECUTE,this.id="ajax-".concat((0,_Often.guid)()),instance[c]=this)}return _createClass(a,[{key:"setApiData",value:function d(a,b,c){void 0===a||(!this.returnJson[a]&&(this.returnJson[a]={}),this.returnJson[a][b]=c)}},{key:"getData",value:function b(a){return void 0===a||void 0===this.returnJson[a]?{}:this.returnJson[a]}},{key:"executeApi",value:function(){function a(a){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U=arguments;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:if(c=1<U.length&&void 0!==U[1]?U[1]:{},d=!!(2<U.length&&void 0!==U[2])&&U[2],e=!!(3<U.length&&void 0!==U[3])&&U[3],g=Date.now(),h=this.getData(a),i=h.isExecute,!(this.packetOption===AJAX_OPTION.PREVENT_EXECUTE&&i)){b.n=1;break}return b.a(2,{});case 1:return this.setApiData(a,"request",c),this.setApiData(a,"isExecute",!0),this.setApiData(a,"finalResMilliSecond",g),j="/".concat(a,".jct").concat(makeQuery(c)),k=make_JSON_(c,a),b.p=2,b.n=3,Mutil.lib.getRequest();case 3:l=b.v,b.n=5;break;case 4:throw b.p=4,R=b.v,this.setApiData(a,"isExecute",!1),R;case 5:return b.p=5,b.n=6,l.post(j).type("form").set("x-user-timezone",Time.currentTimeZone()).send(k);case 6:f=b.v,f.body=Time.tzApi(f.body,"_DT","CONVT",a),b.n=8;break;case 7:b.p=7,S=b.v,Mutil.mlog(S),401===S.status&&(location.href=S.getResponseHeader("REDIRECT_URL"));case 8:if(T=(0,_Often.isFunc)("API_DELAY_500"),!T){b.n=9;break}return b.n=9,(0,_Often.delay)(500);case 9:if(!(e&&Often.isGlobal())){b.n=10;break}return b.n=10,(0,_Often.delay)(800);case 10:if(this.setApiData(a,"isExecute",!1),this.setApiData(a,"response",f.body),m=f.body.COMMON_HEAD,n=void 0===m?{}:m,"MOVE_NOTICE_PAGE"===n.MESSAGE&&(window.ElectronProcessApi?null===(o=window.ElectronProcessApi)||void 0===o?void 0:o.clearCacheForce({refreshWindows:!0}):location.reload()),!n.ERROR){b.n=23;break}if(p="400"===n.CODE,q=!(0,_Often.exist)(window._RGSN_DTTM)&&p,r=Mutil.requireIIFE("TeamsHelper",!1),!(null!==r&&void 0!==r&&r.isTeams()&&q)){b.n=11;break}return location.replace("/teams/tabs/home"),b.a(2);case 11:if(!q){b.n=12;break}return location.reload(),b.a(2);case 12:if("403"!==n.CODE){b.n=13;break}throw t=n.DATA||{},u=t.ERROR_INTERNATIONAL_CODE,v=t.ERROR_MSG,w=void 0===v?null:v,x=t.MESSAGE,y=void 0===x?null:x,z=null!==(s=null!==w&&void 0!==w?w:y)&&void 0!==s?s:"",A="exception:".concat(u),B=i18next.exists(A)?i18next.t(A):z,C=w.includes("Error Code -> exception")?u:B,Mutil.toast("error",C),{error:!0,message:C};case 13:if("404"!==n.CODE&&"409"!==n.CODE){b.n=14;break}throw n;case 14:if("CONCURRENT_ADMIN_SESSION"!==n.CODE&&"UNAUTHORIZED_IP"!==n.CODE){b.n=15;break}return Mutil.confirm({text:{contents:n.MESSAGE,submit:i18next.t(dictionary.confirm)},display:{cancelBtn:!1},callback:{submitFn:function a(){return location.href="/main.act"}}}),b.a(2);case 15:if("E1"!==n.CODE){b.n=16;break}return D=!0===window._TEAMS_READONLY&&!0!==window._TEAMS_READONLY_INTERACTED,D||Often.toast("error",n.MESSAGE),b.a(2,n.CODE);case 16:if("S0139"!==n.CODE&&"S0002"!==n.CODE){b.n=17;break}if(E=i18next.t(dictionary.back),ServerChecker.isSamsungLife){E=i18next.t(dictionary.confirm);try{window.ElectronProcessApi&&ElectronProcessApi.quit()}catch(a){Mutil.mlog(a)}}return Mutil.confirm({text:{contents:n.MESSAGE||i18next.t(common.noAuth),submit:E},display:{cancelBtn:!1},callback:{submitFn:function a(){location.reload()}}}),b.a(2);case 17:if(F=p?i18next.t(common.notAllowedData):i18next.t(common.unknownServerError),G=F+"\n"+i18next.t(common.pleaseRefresh),"REQ001"!==n.CODE){b.n=18;break}return(0,_Confirm.confirm)({text:{contents:G,more:n.MESSAGE},display:{cancelBtn:!1},callback:{submitFn:function a(){return Often.logoutDirect()},cancelFn:function a(){return Often.logoutDirect()}}}),clearClientDataNSocket(),b.a(2);case 18:if("S0002"!==n.CODE){b.n=19;break}if(ServerChecker.isMobis)try{window.ElectronProcessApi&&ElectronProcessApi.quit()}catch(a){Mutil.mlog(a)}return(0,_Confirm.confirm)({text:{contents:G,more:JSON.stringify(n)},display:{cancelBtn:!1},callback:{submitFn:function a(){var b;return ServerChecker.isKnto&&null!==(b=window)&&void 0!==b&&b.ElectronProcessApi?ElectronProcessApi.quit():Often.logoutDirect()},cancelFn:function a(){return Often.logoutDirect()}}}),clearClientDataNSocket(),b.a(2);case 19:if("9849"!==n.CODE){b.n=20;break}return Mutil.confirm({text:{contents:i18next.t(common.security.alartSetLoginSecurityDesc)},display:{cancelBtn:!1},callback:{submitFn:function a(){Loading.drawLoadingPop(),Often.logoutDirect()},cancelFn:function a(){Loading.drawLoadingPop(),Often.logoutDirect()}}}),b.a(2);case 20:if("9209"!==n.CODE){b.n=21;break}return H=n.DATA,I=void 0===H?{}:H,Mutil.toast("error",null===I||void 0===I?void 0:I.ERROR_MSG),b.a(2,{});case 21:if(!["400","401","500"].includes(n.CODE)){b.n=22;break}throw J=n.DATA||{},K=J.ERROR_INTERNATIONAL_CODE,L=J.ERROR_MSG,M=void 0===L?null:L,N=J.ERROR_MSG_VALUE,O=void 0===N?null:N,P=J.MESSAGE,Q=void 0===P?null:P,O?Often.toast("error",M):K?Often.toast("error",Often.null2Void(i18next.t("exception:"+K))):Often.toast("error",M),n;case 22:throw d||(0,_Confirm.confirm)({text:{contents:G,more:JSON.stringify(n)},display:{cancelBtn:!1}}),n;case 23:if(!(this.packetOption===AJAX_OPTION.PREVENT_CALLBACK&&isSameRequest(this.getData(a),c,g))){b.n=24;break}throw"isSameRequest";case 24:try{!n.ERROR&&("COLABO2_COMMT_C101"===a||"FLOW_VOTE_C001"===a)&&window.OnboardingChecklist&&window.OnboardingChecklist.latch("STEP5_POST")}catch(a){}return b.a(2,f.body)}},b,this,[[5,7],[2,4]])}));return a}()}])}();function clearClientDataNSocket(){var a;window._USER_ID="",window._RGSN_DTTM="";var b=Mutil.requireIIFE("MainSocket",!1),c=Mutil.requireIIFE("Often",!1),d=Mutil.requireIIFE("LocalUtil",!1),e=requireModule("StatusSocket",{on:["main","miniMain","messenger"]});SocketControl.getSocket().disconnect(),null===b||void 0===b||b.disconnectSocket(),null===(a=e())||void 0===a||a.disconnectStatusSocket(),d.setLocal("ONLY_DEVICE_NM",""),d.setLocal("ONLY_DEVICE_ID",""),["flowLogin","miniflowLogin","googleLoginYn","LAST_SUB_PATH","FLOW_DUID"].forEach(function(a){null===c||void 0===c||c.setCo
392okie(a,"",360)}),null===c||void 0===c||c.setCookie("autoLoginCheckYN","N",360),d.setLocal("ONLY_AUTO_LOGIN_YN","N")}function isSameRequest(a,b,c){var d=a.request,e=a.finalResMilliSecond,f=_objectSpread({},d),g=_objectSpread({},b);return["PG_PER_CNT","FILTER_RECORD","FIL_STTS","FIL_PRIORITY","SRCH_WORD","SEARCH_RECORD"].forEach(function(a){f[a]="",g[a]=""}),e!==c&&(0,_Often.deepCompare)(f,g)}function isSocketTarget(a){return-1<["COLABO2_COMMT_U101","COLABO2_COMMT_C101","COLABO2_COMMT_D101","FLOW_SUBTASK_C001","FLOW_SUBTASK_D001","COLABO2_TASK_U001","FLOW_TASK_WORKER_U002","FLOW_VOTE_C001","FLOW_SCHD_ATD_U001","ACT_MEMO"].indexOf(a)}function make_JSON_(a,b){return a.RGSN_DTTM=window._RGSN_DTTM,{_JSON_:encodeURIComponent(JSON.stringify(_objectSpread({USER_ID:(0,_Often.n2v)(window._USER_ID),RGSN_DTTM:(0,_Often.n2v)(window._RGSN_DTTM)},Time.tzrApi(a,"_DT","CONVT",b))))}}function makeQuery(a){var b=a.MODE,c=a.GUBUN,d=a.TYPE,e=a.PG_NO,f=a.CRUD_TYPE,g="";return(0,_Often.exist)(b)?g="&mode="+b:(0,_Often.exist)(c)?g="&mode="+c:(0,_Often.exist)(d)?g="&type="+d:(0,_Often.exist)(f)&&(g="&type="+f),(0,_Often.exist)(e)&&1<+e&&(g+="&page="+e),""!==g&&(g="?"+g.slice(1)),g}
393
394},{"./Confirm":134,"./Often":146}],132:[function(require,module,exports){
395"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Selection=exports.KeyValue=exports.FocusNode=void 0,exports.changeSplitNode=changeSplitNode,exports.changeTargetTextNode=changeTargetTextNode,exports.getPosition=getPosition,exports.getTargetNextWord=getTargetNextWord,exports.insertBeforeFocusNode=insertBeforeFocusNode,exports.insertBeforeFocusTextNode=insertBeforeFocusTextNode,exports.setSelection=void 0;var sel,_Often=require("./Often.js"),Selection=exports.Selection=function(){return sel||window.getSelection()},setSelection=exports.setSelection=function(a){return sel=a},FocusNode=exports.FocusNode=function(a){return a.focusNode},KeyValue=exports.KeyValue=function(a){var b,c=a||Selection(),d=c.focusOffset,e=c.focusNode;try{b=e.textContent.substring(d-1,d)}catch(a){b=""}return b};function getTargetNextWord(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:window.getSelection(),b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(!(0,_Often.exist)(b))return"";var c=a.focusNode,d=a.focusOffset,e=c.textContent,f=ElectronApi.Comm.isElectron()&&Often.getClientOSInfo().isWin&&function(a){var b=a.charAt(d);return /[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/.test(b)}(e),g=e.substring(0,f?d+1:d),h=g.lastIndexOf(b);g=-1<h?g.substring(h+1):g;var i=g.indexOf(" ");return g=-1<i?g.substring(0,i):g,g}function insertBeforeFocusNode(a,b){var c=a.getRangeAt(0);if(!function(a){if(!a||a.nodeType!==Node.ELEMENT_NODE)return(!1);try{return a.classList.contains("editor-extension")}catch(a){return console.error("Error checking editor-extension class:",a),!1}}(c.commonAncestorContainer)){if((0,_Often.isBrowser)("ie"))c.endContainer.insertBefore(b,null);else{var d=document.createTextNode("\xA0");c.insertNode(d),c.commonAncestorContainer.insertBefore(b,d)}c.collapse(!1)}}function insertBeforeFocusTextNode(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"",c=a.getRangeAt(0),d=document.createTextNode(b+"\xA0");(0,_Often.isBrowser)("ie")?c.endContainer.insertBefore(d,null):c.insertNode(d);var e=document.createRange();e.setStart(d,1),a.removeAllRanges(),a.addRange(e)}function changeSplitNode(a,b,c){var d=a.focusNode,e=a.focusOffset,f=d.textContent,g=f.substr(0,e),h=g.split(c).pop(),i=h.length+1,j=e-i,k=createTargetRange(d,j,e);k.commonAncestorContainer.splitText(e),k.commonAncestorContainer.splitText(j);var l=document.createTextNode("\xA0");k.commonAncestorContainer.insertBefore(b,k.endContainer),k.commonAncestorContainer.insertBefore(l,k.endContainer),k.endContainer.deleteData(0,k.endContainer.length||0),k=document.createRange(),k.setStart(l,1),a.removeAllRanges(),a.addRange(k)}function changeTargetTextNode(a,b,c){var d=a.focusNode,e=a.focusOffset,f=d.textContent,g=f.substr(0,e),h=g.length,i=c.length,j=h-i,k=createTargetRange(d,j,e);k.commonAncestorContainer.splitText(e),k.commonAncestorContainer.splitText(j);var l=document.createTextNode("\xA0");k.commonAncestorContainer.insertBefore(b,k.endContainer),k.commonAncestorContainer.insertBefore(l,k.endContainer),k.endContainer.deleteData(0,k.endContainer.length||0),k=document.createRange(),k.setStart(l,1),a.removeAllRanges(),a.addRange(k)}function createTargetRange(a,b,c){var d=document.createRange();return d.setStart(a,b),d.setEnd(a,c),d}function getPosition(a){var b,c,d,e=0,f=0;return a.rangeCount?(b=a.getRangeAt(0).cloneRange(),b.collapse(!0),c=b.getClientRects(),d=0<c.length?c[0]:"",e=d.left||0,f=d.top||0,{top:f,left:e}):{top:f,left:e}}
396
397},{"./Often.js":146}],133:[function(require,module,exports){
398"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.closeLayerByClass=closeLayerByClass,exports.closeLayerById=close
398LayerById;function closeLayerById(a,b){for(var c in b)b.hasOwnProperty(c)&&closeLayer("id",a,c,b[c])}function closeLayerByClass(a,b){for(var c in b)b.hasOwnProperty(c)&&closeLayer("class",a,c,b[c])}function closeLayer(a,b,c,d){var e="class"===a,f=e?".js-".concat(c,"-layer"):"#".concat(c,"Layer"),g=e?".js-".concat(c,"-button"):"#".concat(c,"Button"),h=b.closest(f),i=b.closest(g),j=0===h.length&&0===i.length&&$(f).is(":visible");j&&(d&&"function"==typeof d?d(b):($(g).removeClass("active"),$(f).css("display","none")))}
399
400},{}],134:[function(require,module,exports){
401"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.confirm=confirm;var _Often=require("./Often"),_Keycode=require("./Keycode.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var $confirm=function a(){return $("#confirm")};function confirm(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=$("body"),c=a.text,d=void 0===c?{}:c,e=a.callback,f=void 0===e?{}:e,g=a.display,h=void 0===g?{}:g,i=a.style,j=void 0===i?{}:i,k=a.persist,l=void 0!==k&&k,m=d.title,n=void 0===m?"":m,o=d.contents,p=void 0===o?i18next.t(common.askChange,{val:dictionary.status}):o,q=d.subContents,r=void 0===q?"":q,s=d.more,t=void 0===s?"":s,u=d.submit,v=void 0===u?i18next.t(dictionary.confirm)||"\uD655\uC778":u,w=d.cancel,x=void 0===w?i18next.t(dictionary.cancel)||"\uCDE8\uC18C":w,y=h.cancelBtn,z=!(void 0!==y)||y,A=h.header,B=void 0!==A&&A,C=h.closeBtn,D=void 0!==C&&C,E=j.submitBgColor,F=void 0===E?"#6449fc":E,G=j.submitTextColor,H=void 0===G?"#fff":G,I=j.textAlign,J=void 0===I?"center":I,K=j.contentsBox,L=void 0!==K&&K,M=t.replace(/\r\n/g,"<br>"),N=function a(){$confirm().remove(),$("#confirmStyle").remove(),b.css("overflow","auto")},O=f.submitFn,P=void 0===O?N:O,Q=f.cancelFn,R=void 0===Q?N:Q,S=f.finalFn,T=void 0===S?_Often.noop:S;N(),setConfirmStyle(),b.prepend($(getConfirmHtml({headerDisplay:B,closeBtn:D,titleText:n,contentsText:p,subContentsText:r,moreText:M,cancelText:x,submitText:v,cancelBtnDisplay:z,submitBgColor:F,submitTextColor:H,textAlign:J,contentsBox:L}))),$confirm().on("mousedown mouseup click",function(a){a.stopPropagation()}),$confirm().on("click",function(){var a=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f;return _regenerator().w(function(b){for(;1;
401)switch(b.n){case 0:c=$(a.currentTarget),f=!0,b.n=f===(0,_Often.isTarget)(a,".btn-close-x")?1:f===(0,_Often.isTarget)(a,".cancel")?4:f===!(0,_Often.isTarget)(a,".confirm-content-area")?7:f===(0,_Often.isTarget)(a,".contents-more")?10:f===(0,_Often.isTarget)(a,".submit")?11:13;break;case 1:return b.n=2,R(c,"close");case 2:if(!l){b.n=3;break}return b.a(2);case 3:return N(),b.a(3,14);case 4:return b.n=5,R(c,"cancel");case 5:if(!l){b.n=6;break}return b.a(2);case 6:return N(),b.a(3,14);case 7:return b.n=8,R(c,"outside");case 8:if(!l){b.n=9;break}return b.a(2);case 9:return N(),b.a(3,14);case 10:return d=$(a.target).closest(".contents-more"),e=d.hasClass("active"),d.next()[e?"slideUp":"slideDown"](400),d.toggleClass("active"),b.a(3,14);case 11:return b.n=12,P(c);case 12:return N(),b.a(3,14);case 13:return b.a(3,14);case 14:return b.a(2)}},b)}));return function(b){return a.apply(this,arguments)}}()),$confirm().off("keydown").on("keydown",function(){var a=_asyncToGenerator(_regenerator().m(function b(a){return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:if(a.stopPropagation(),!(0,_Keycode.isKey)(a,"ENTER")){b.n=2;break}return b.n=1,P($confirm);case 1:N();case 2:return b.a(2)}},b)}));return function(b){return a.apply(this,arguments)}}()),$confirm().fadeIn(200,function(){$confirm().focus()}),T($confirm()),b.css("overflow","hidden")}function getConfirmHtml(a){var b=a.headerDisplay,c=a.titleText,d=a.closeBtn,e=a.contentsText,f=a.subContentsText,g=a.moreText,h=a.cancelText,i=a.submitText,j=a.cancelBtnDisplay,k=a.submitBgColor,l=a.submitTextColor,m=a.textAlign,n=a.contentsBox,o="left"===m?"text-align: left;":"",p="left"===m?"style=\"text-align: left;\"":"",q=n?"background: #f5f5f5; padding: 12px 16px; border-radius: 6px; color: #666;":"",r="background: ".concat(k,"; color: ").concat(l,";");return"\n        <div id=\"confirm\" class=\"dimmed-area\" tabindex=\"0\">\n            <div class=\"confirm-content-area\">\n                ".concat(d?"<header>\n                        <button class=\"btn-close-x\" id=\"createEventClose\"></button>\n                    </header>":"","\n                ").concat(b?"<h2 ".concat(p,">").concat(c,"</h2>"):"","\n                <div>\n                <p style=\"").concat(o," ").concat(q,"\">").concat(e,"</p>\n                      ").concat((0,_Often.exist)(f)?"<p style=\"color:#FE6565; ".concat(o,"\">").concat(f,"</p>"):"","\n                </div>\n                ").concat((0,_Often.exist)(g)?"<div>\n                    <div class=\"contents-more\">".concat(i18next.t(common.showDetail),"</div>\n                    <div class=\"contents-more-area\">").concat(g,"</div>\n                </div>"):"","\n                <div class=\"btn-area\">\n                    ").concat(j?"<div class=\"cancel\">".concat(h,"</div>"):"","\n                    <div class=\"submit\" style=\"").concat(r,"\">").concat(i,"</div>\n                </div>\n            </div>\n        </div>\n    ")}function setConfirmStyle(){0<$("#confirmStyle").length||$("head").append("\n        <style id=\"confirmStyle\">\n        .dimmed-area {\n            position: fixed;\n            display: flex;\n            align-items: center;\n            top: 0;\n            right: 0;\n            bottom: 0;\n            left: 0;\n            background: rgba(0,0,0,.6);\n            /*z-index: 101;*/\n            z-index: 2101;\n        }\n        .confirm-content-area {\n            background: #fff;\n            border-radius: 10px;\n            width: 450px;\n            margin: 0 auto;\n            padding: 20px;\n        }\n        .confirm-content-area p:first-child {\n            margin-top: 12px;\n        }\n        .confirm-content-area p:last-child {\n            margin-bottom: 25px;\n        }\n        .confirm-content-area p {\n            /*margin: 12px 0 25px 0;*/\n            text-align: center;\n            white-space: break-spaces;\n        }\n        .confirm-content-area .contents-more {\n            text-align: center;\n            color: #aaa;\n            margin-bottom: 20px;\n            cursor: pointer;\n        }\n        .confirm-content-area .contents-more::after {\n            position: relative;\n            top: -2px;\n            left: 3px;\n            display: inline-block;\n            content: \"\";\n            width: 8px;\n            height: 6px;\n            background-image: url(/flow-renewal/assets/images/sprite-all-task.png);\n            background-position: -403px -3px;\n            background-size: 922px auto;\n        }\n        .confirm-content-area .contents-more.active::after {\n            background-position: -427px 
401-3px;\n        }\n        .confirm-content-area .contents-more-area {\n            display: none;\n            max-height: 200px;\n            padding: 20px;\n            color: rgb(170, 170, 170);\n            background: rgb(238, 238, 238);\n            margin: 20px 0;\n            border-radius: 5px;\n            overflow-y: auto;\n            overflow-x: hidden;\n        }\n        .confirm-content-area .btn-area {\n            width: 100%;\n            text-align: center;\n        }\n        .confirm-content-area .btn-area div {\n            display: inline-block;\n            width: 47%;\n            line-height: 34px;\n            border: 1px solid #ddd;\n            border-radius: 4px;\n            color: #555;\n            font-size: 13px;\n            cursor: pointer;\n        }\n        .confirm-content-area .btn-area .submit {\n            color: #fff;\n            background: #6449fc;\n            margin-left: 8px;\n        }\n        </style>")}
402
403},{"./Keycode.js":143,"./Often":146}],135:[function(require,module,exports){
404"use strict";var _Often=require("./Often.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getNowMonth=exports.getNowDttm=exports.getNowDay=exports.getMonFriDate=exports.getDateBeforeYear=exports.getDateBeforeThreeMonth=exports.getDateBeforeTenYear=exports.getDateBeforeSixMonth=exports.getDateBeforeOneWeek=exports.getDateBeforeOneMonth=exports.getDateBeforeOneDay=exports.getDateBeforeHalfYear=exports.getDateAfterThreeMonth=exports.getDateAfterTenYear=exports.getDateAfterOneDay=exports.formatDttm=exports.formatDate=exports.convertDttm=exports.camelToSnake=exports.TIME_FORMAT=void 0,exports.getProfilesIcon=getProfilesIcon,exports.makeDttm=exports.getYear=exports.getWeekOfYear=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}var TIME_FORMAT=exports.TIME_FORMAT={"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm":"YYYY-MM-DD HH:mm","YYYY-MM-DD (ddd)":"YYYY-MM-DD (ddd)","YYYY-MM-DD (ddd), HH:mm":"YYYY-MM-DD (ddd), HH:mm","YYYY-MM-DD":"YYYY-MM-DD","YYYY-MM":"YYYY-MM",YYYYMM:"YYYYMM","MM/DD":"MM/DD","MM/DD, HH:mm":"MM/DD, HH:mm",YYYY:"YYYY",YYYYMMDDHHmmss:"YYYYMMDDHHmmss",YYYYMMDDHHmm:"YYYYMMDDHHmm",YYYYMMDD:"YYYYMMDD","DD/MM/YYYY":"DD/MM/YYYY","DD-MM-YYYY HH:mm":"DD-MM-YYYY HH:mm"},makeDttm=exports.makeDttm=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return((0,_Often.n2v)(a)+"00000000000000").substring(0,14)},formatDate=exports.formatDate=function(a,b){return dayjs(a).format(b)},formatDttm=exports.formatDttm=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:TIME_FORMAT["YYYY-MM-DD HH:mm"],c=((0,_Often.exist)(a)?dayjs(makeDttm(a)):dayjs()).format(b);return"Invalid Date"===c?"":c},convertDttm=exports.convertDttm=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return formatDttm(a,TIME_FORMAT["YYYY-MM-DD"])},getNowDttm=exports.getNowDttm=function(a){return formatDttm("",a||TIME_FORMAT.YYYYMMDDHHmmss)},getNowDay=exports.getNowDay=function(a){return formatDttm("",a||TIME_FORMAT.YYYYMMDD)},getNowMonth=exports.getNowMonth=function(a){return formatDate(new Date,TIME_FORMAT["YYYY".concat(a?"-":"","MM")])},getYear=exports.getYear=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return(0<a.length?dayjs(a):dayjs()).year()},getWeekOfYear=exports.getWeekOfYear=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return(0<a.length?dayjs(a):dayjs()).isoWeek()},getDateByWeekOfYear=function(a,b,c){return dayjs(String(a,"")).week(+b).day(+c).format("MM/DD")},getMonFriDate=exports.getMonFriDate=function(a,b){return getDateByWeekOfYear(a,b,1)+" ~ "+getDateByWeekOfYear(a,b,5)},getDateBeforeOneDay=exports.getDateBeforeOneDay=function(a){return dayjs(a).subtract(1,"day").format()},getDateBeforeOneWeek=exports.getDateBeforeOneWeek=function(a){return dayjs(a).subtract(1,"week").format()},getDateBeforeOneMonth=exports.getDateBeforeOneMonth=function(a){return dayjs(a).subtract(1,"month").format()},getDateBeforeThreeMonth=exports.getDateBeforeThreeMonth=function(a){return dayjs(a).subtract(3,"month").format()},getDateBeforeSixMonth=exports.getDateBeforeSixMonth=function(a){return dayjs(a).subtract(6,"month").format()},getDateBeforeTenYear=exports.getDateBeforeTenYear=function(a){return dayjs(a).subtract(10,"year").format()},getDateBeforeHalfYear=exports.getDateBeforeHalfYear=function(a){return dayjs(a).subtract(6,"month").format()},getDateBeforeYear=exports.getDateBeforeYear=function(a){return dayjs(a).subtract(12,"month").format()},getDateAfterOneDay=exports.getDateAfterOneDay=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";return dayjs(a).add(1,"day").format(b)},getDateAfterThreeMonth=exports.getDateAfterThreeMonth=function(a){return dayjs(a).add(3,"month").add(-1,"day").format()},getDateAfterTenYear=exports.getDateAfterTenYear=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";return dayjs(a).add(10,"year").add(-1,"day").format(b)},DEFAULT_PROFILE_URL="/flow-renewal/assets/images/profile-default.svg";function getProfilesIcon(a){var b=a.MANAGER_RECORD,c=void 0===b?[]:b,d=a.PROFILE_URL,e=void 0===d?"":d,f=0,g="",h="";return 0<(null===c||void 0===c?void 0:c.length)?{PROFILE_URL:(0,_Often.n2v)(c[0].PROFILE_URL||c[0].WORKER_PRFL_PHTG,DEFAULT_PROFILE_URL),COUNT:c.length-1,NAME:c[0].NAME||c[0].WORKER_NM,ID:c[0].ID||c[0].WORKER_ID}:(0,_Often.exist)(e)?{PROFILE_URL:e,COUNT:f,NAME:g,ID:h}:{PROFILE_URL:DEFAULT_PROFILE_URL,COUNT:f,NAME:g,ID:h}}var _camelToSnake=exports.camelToSnake=function(a){var b={};return null==a?{}:Array.isArray(a)?a.map(function(a){return _camelToSnake(a)}):"object"===_typeof(a)?0===Object.keys(a).length?a:(Object.keys(a).forEac
404h(function(c){var d=a[c],e=c===c.toUpperCase()||c.includes("_")?c:c.replace(/[A-Z]/g,function(a){return"_"+a}).toUpperCase();return Array.isArray(d)?void(b[e]=d.map(function(a){return _camelToSnake(a)})):void(b[e]=null==d?"":d.toString())}),b):a};
405
406},{"./Often.js":146}],136:[function(require,module,exports){
407"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ResourceIdCrypto=void 0;var ResourceIdCrypto=exports.ResourceIdCrypto=function(){var a="x0EYlZ5tbAvg43yQsCTwu91zpFDKLqhHSRUBao8PNVf2OiWcXIJrn7Mkd6ejmG".length;return{encodeResourceId:function(b){if("number"==typeof b){for(var c,d=b,e="";0<d;)c="x0EYlZ5tbAvg43yQsCTwu91zpFDKLqhHSRUBao8PNVf2OiWcXIJrn7Mkd6ejmG".charAt(d%a),e+=c,d=Math.floor(d/a);return e.split("").reverse().join("")}},decodeResourceId:function(b){if("string"==typeof b){for(var c=0,d=0;d<b.length;d++)c=c*a+"x0EYlZ5tbAvg43yQsCTwu91zpFDKLqhHSRUBao8PNVf2OiWcXIJrn7Mkd6ejmG".indexOf(b.charAt(d));return c}}}};
408
409},{}],137:[function(require,module,exports){
410"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DOMOperator=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _classPrivateFieldInitSpec(b,c,d){_checkPrivateRedeclaration(b,c),c.set(b,d)}function _checkPrivateRedeclaration(a,b){if(b.has(a))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(b,c){return b.get(_assertClassBrand(b,c))}function _classPrivateFieldSet(b,c,a){return b.set(_assertClassBrand(b,c),a),a}function _assertClassBrand(a,b,c){if("function"==typeof a?a===b:a.has(b))return 3>arguments.length?b:c;throw new TypeError("Private element is not present on this object")}var _element=new WeakMap,DOMOperator=exports.DOMOperator=function(){function a(b){_classCallCheck(this,a),_classPrivateFieldInitSpec(this,_element,void 0);var c=document.createElement("template");c.innerHTML=b,_classPrivateFieldSet(_element,this,c.content.firstElementChild)}return _createClass(a,[{key:"getElement",value:function(){return _classPrivateFieldGet(_element,this)}},{key:"attachTo",value:function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"afterbegin";a.insertAdjacentElement(b,_classPrivateFieldGet(_element,this))}},{key:"addWidgetTo",value:function(a,b){var c,d,e=null===b||void 0===b?void 0:b.split(",");a.addWidget(_classPrivateFieldGet(_element,this),{x:+e[0],y:+e[1],w:+(null!==(c=e[2])&&void 0!==c?c:"3"),h:+(null!==(d=e[3])&&void 0!==d?d:"3")})}},{key:"removeFrom",value:function(a){if(a!==_classPrivateFieldGet(_element,this).parentElement)throw new Error("Parent mismatch!");a.removeChild(_classPrivateFieldGet(_element,this))}},{key:"attach",value:function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"afterbegin";a.attachTo(_classPrivateFieldGet(_element,this),b)}}])}();
411
412},{}],138:[function(require,module,exports){
413"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DebounceNThrottle=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var DebounceNThrottle=exports.DebounceNThrottle=_createClass(function c(a,b){var d=this;if(_classCallCheck(this,c),_defineProperty(this,"timer",null),_defineProperty(this,"debounce",function(a){clearTimeout(d.timer),d.timer=setTimeout(function(){d.fn(a),d.timer=null},d.duration)}),_defineProperty(this,"debounceAfterStart",function(a){clearTimeout(d.timer),d.timer?Mutil.clog("Skip On debounceAfterStart"):d.fn(a),d.timer=setTimeout(function(){d.timer=null},d.duration)}),_defineProperty(this,"throttle",function(a){d.timer||(d.timer=setTimeout(function(){d.fn(a),d.timer=null},d.duration))}),_defineProperty(this,"throttleAfterStart",function(a){d.timer||(d.fn(a),d.timer=setTimeout(function(){d.timer=null},d.duration))}),"function"!=typeof a)throw new Error("Check!");this.fn=a,this.duration=b||500});
414
415},{}],139:[function(require,module,exports){
416"use strict";var _libIntegrated=require("../integrated/lib.integrated.js");Object.defineProperty(exports,"__esModule",{value:!0}),exports.downExcel=downExcel,exports.downExcelSecure=downExcelSecure,exports.downExcelTemplate=downExcelTemplate,exports.uploadExcel=uploadExcel;function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
416q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var crefregex=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)([1-9]\d{0,5}|10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6])(?![_.\(A-Za-z0-9])/g;function uploadExcel(a){return _uploadExcel.apply(this,arguments)}function _uploadExcel(){return _uploadExcel=_asyncToGenerator(_regenerator().m(function b(a){var c,d;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,(0,_libIntegrated.getExcelLib)();case 1:c=a.successCallback,$("#uploadExcel").remove(),d=$("<input id=\"uploadExcel\" type=\"file\" style=\"display:none;\" />"),d.on("change",function(a){var b=a.target.files;if(!b)throw new Error("No Excel Data!!");if(1!==b.length)throw new Error("Require Only One Excel Data!!");var d=b[0],e=new FileReader;e.readAsBinaryString(d),e.onload=function(a){var b=XLSX.read(a.target.result,{type:"binary"}),e=b.SheetNames;if(1!==e.length)throw new Error("Require Only One Sheet In Excel!!");var f=XLSX.utils.sheet_to_json(b.Sheets[e[0]]);c({dataArr:f,name:d.name})}}),$("body").append(d),d.click();case 2:return b.a(2)}},b)})),_uploadExcel.apply(this,arguments)}function downExcelTemplate(a){return _downExcelTemplate.apply(this,arguments)}function _downExcelTemplate(){return _downExcelTemplate=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h,i,j,k;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,(0,_libIntegrated.getExcelLib)();case 1:c=a.title,d=a.orderedColumnArray,e=a.colWidth,f=void 0===e?20:e,g=d.map(function(a){var b=a.NAME;return b}),h=XLSX.utils.aoa_to_sheet([g]),h["!cols"]=g.map(function(){return{wch:f}}),i=XLSX.utils.book_new(),i.Props={Title:c,Subject:"Excel",CreatedDate:new Date},XLSX.utils.book_append_sheet(i,h,c),j=XLSX.write(i,{bookType:"xlsx",type:"binary"}),k=new Blob([s2ab(j)],{type:"application/octet-stream"}),saveAs(k,c+".xlsx");case 2:return b.a(2)}},b)})),_downExcelTemplate.apply(this,arguments)}function downExcel(a){return _downExcel.apply(this,arguments)}function _downExcel(){return _downExcel=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,(0,_libIntegrated.getExcelLib)();case 1:c=a.title,d=a.dataJsonArray,e=a.orderedColumnArray,f=_toConsumableArray(d),g=0<d.length&&Object.keys(d[0]).length,h=e.map(function(a){var b=a.CODE;return b}),i=e.map(function(a){var b=a.NAME;return b}),j=XLSX.utils.book_new(),k=XLSX.utils.json_to_sheet(f,{header:h}),l=i.length,j.Props={Title:c,Subject:"Excel",Author:"\uC791\uC131\uC790\uC774\uB984",CreatedDate:new Date},j.SheetNames.push(c),changeColName(k,i),g>l&&delete_cols(k,l,g-l),j.Sheets[c]=k,m=XLSX.write(j,{bookType:"xlsx",type:"binary"}),n=new Blob([s2ab(m)],{type:"application/octet-stream"}),saveAs(n,c+".xlsx");case 2:return b.a(2)}},b)})),_downExcel.apply(this,arguments)}function downExcelSecure(a,b){return _downExcelSecure.apply(this,arguments)}function _downExcelSecure(){return _downExcelSecure=_asyncToGenerator(_regenerator().m(function c(a,b){var d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:return c.n=1,(0,_libIntegrated.getExcelLib)();case 1:return d=b.title,e=b.dataJsonArray,f=b.orderedColumnArray,g=_toConsumableArray(e),h=0<e.length&&Object.keys(e[0]).length,j=f.map(function(a){var b=a.CODE;return b}),k=f.map(function(a){var b=a.NAME;return b}),l=XLSX.utils.book_new(),m=XLSX.utils.json_to_sheet(g,{header:j}),n=k.length,l.Props={Title:d,Subject:"Excel",CreatedDate:new Date},l.SheetNames.push(d),changeColName(m,k),h>n&&delete_cols(m,n,h-n),l.Sheets[d]=m,o=XLSX.write(l,{bookType:"xlsx",type:"base64"}),p={USER_ID:window._USER_ID,RGSN_DTTM:window._RGSN_DTTM,FILE_B64:o,FILE_NM:d,DOWN_RSN:a||""},q="_JSON_="+encodeURIComponent(JSON.stringify(p)),c.n=2,fetch("/ACT_MASTER_SECURE_EXCEL_C001.jct",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},credentials:"include",body:q});case 2:return r=c.v,c.p=3,c.n=4,r.json();case 4:s=c.v,c.n=6;break;case 5:return c.p=5,A=c.v,Mutil.toast("error","\uB2E4\uC6B4\uB85C\uB4DC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694."),c.a(2);case 6:if(t=s&&s.COMMON_HEAD||{},u=s&&s.RESULT_FILE,r.ok&&!t.ERROR&&u){c.n=7;break}return v=t&&t.MESSAGE||"\uB2E4\uC6B4\uB85C\uB4DC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",Mutil.toast("error",v),c.a(2);case 7:for(w=atob(u),x=new Uint8Array(w.length),y=0;y<w.length;
416y++)x[y]=w.charCodeAt(y);z=new Blob([x],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),saveAs(z,d+".xlsx"),Mutil.toast("success","\uBE44\uBC00\uBC88\uD638\uB97C \uD50C\uB85C\uC6B0 \uBA54\uC2E0\uC800(\uCCA0\uD1B5\uBCF4\uC548\uBD07)\uB85C \uBCF4\uB0C8\uC2B5\uB2C8\uB2E4.");case 8:return c.a(2)}},c,null,[[3,5]])})),_downExcelSecure.apply(this,arguments)}function s2ab(a){for(var b=new ArrayBuffer(a.length),c=new Uint8Array(b),d=0;d<a.length;d++)c[d]=255&a.charCodeAt(d);return b}function changeColName(a,b){var c=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];$.each(b,function(b,d){var e=b%c.length,f=Math.floor(b/c.length)-1,g="".concat(0<=f?c[f]:"").concat(c[e]);delete a[g+"1"].w,a[g+"1"].v=d})}function clamp_range(a){return 1048576<=a.e.r&&(a.e.r=1048575),16384<=a.e.c&&(a.e.c=16383),a}function delete_cols(a,b,c){if(!a)throw new Error("operation expects a worksheet");c||(c=1),b||(b=0);var d,e,f=XLSX.utils.decode_range(a["!ref"]),g=0,h=0,i=function i(a,d,e,f,g,h){var j=XLSX.utils.decode_row(h),k=XLSX.utils.decode_col(f);return k>=b&&(k-=c,k<b)?"#REF!":d+("$"===e?e+f:XLSX.utils.encode_col(k))+("$"===g?g+h:XLSX.utils.encode_row(j))};for(h=b+c;h<=f.e.c;++h)for(g=f.s.r;g<=f.e.r;++g){if(d=XLSX.utils.encode_cell({r:g,c:h}),e=XLSX.utils.encode_cell({r:g,c:h-c}),!a[d]){delete a[e];continue}a[d].f&&(a[d].f=a[d].f.replace(crefregex,i)),a[e]=a[d]}for(h=f.e.c;h>f.e.c-c;--h)for(g=f.s.r;g<=f.e.r;++g)d=XLSX.utils.encode_cell({r:g,c:h}),delete a[d];for(h=0;h<b;++h)for(g=f.s.r;g<=f.e.r;++g)d=XLSX.utils.encode_cell({r:g,c:h}),a[d]&&a[d].f&&(a[d].f=a[d].f.replace(crefregex,i));f.e.c-=c,f.e.c<f.s.c&&(f.e.c=f.s.c),a["!ref"]=XLSX.utils.encode_range(clamp_range(f)),a["!merges"]&&a["!merges"].forEach(function(d,e){var f;switch(_typeof(d)){case"string":f=XLSX.utils.decode_range(d);break;case"object":f=d;break;default:throw new Error("Unexpected merge ref "+d)}if(f.s.c>=b){if(f.s.c=Math.max(f.s.c-c,b),f.e.c<b+c)return void delete a["!merges"][e];if(f.e.c-=c,f.e.c<f.s.c)return void delete a["!merges"][e]}else f.e.c>=b&&(f.e.c=Math.max(f.e.c-c,b));clamp_range(f),a["!merges"][e]=f}),a["!merges"]&&(a["!merges"]=a["!merges"].filter(function(a){return!!a})),a["!cols"]&&a["!cols"].splice(b,c)}
417
418},{"../integrated/lib.integrated.js":52}],140:[function(require,module,exports){
419"use strict";var _Often=require("./Often");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.convertBase64ToFile=void 0,exports.convertImageUrlToFileObj=convertImageUrlToFileObj,exports.getFileInfo=getFileInfo,exports.getFileSize=getFileSize,exports.getStandardExtension=getStandardExtension,exports.getValidImageSrc=getValidImageSrc,exports.isImageExtension=isImageExtension,exports.isImageType=isImageType,exports.json2formData=json2formData;function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
419return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _callSuper(a,b,c){return b=_getPrototypeOf(b),_possibleConstructorReturn(a,_isNativeReflectConstruct()?Reflect.construct(b,c||[],_getPrototypeOf(a).constructor):b.apply(a,c))}function _possibleConstructorReturn(a,b){if(b&&("object"==_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _wrapNativeSuper(a){var b="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function c(a){function d(){return _construct(a,arguments,_getPrototypeOf(this).constructor)}if(null===a||!_isNativeFunction(a))return a;if("function"!=typeof a)throw new TypeError("Super expression must either be null or a function");if(void 0!==b){if(b.has(a))return b.get(a);b.set(a,d)}return d.prototype=Object.create(a.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(d,a)},_wrapNativeSuper(a)}function _construct(a,b,c){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var d=[null];d.push.apply(d,b);var e=new(a.bind.apply(a,d));return c&&_setPrototypeOf(e,c.prototype),e}function _isNativeReflectConstruct(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(_isNativeReflectConstruct=function b(){return!!a})()}function _isNativeFunction(a){try{return-1!==Function.toString.call(a).indexOf("[native code]")}catch(b){return"function"==typeof a}}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}var convertBase64ToFile=exports.convertBase64ToFile=function c(a,b){var d=window.File;try{new d([],"")}catch(a){d=function(a){function b(a,c){var d,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return _classCallCheck(this,b),d=_callSuper(this,b,[a,e]),d.lastModifiedDate=new Date,d.lastModified=+d.lastModifiedDate,d.name=c,d}return _inherits(b,a),_createClass(b)}(_wrapNativeSuper(Blob))}for(var e=a.split(","),f=e[0].match(/:(.*?);/)[1],g=b+"."+f.split("/")[1],h=atob(e[1]),i=new Uint8Array(j),j=h.length;j--;)i[j]=h.charCodeAt(j);return new d([i],g,{type:f})};function getFileInfo(a){if(!a)return{NAME:"",EXT:""};var b,c=a.lastIndexOf("."),d=a.length,e=-1===c?a:a.substring(0,c);try{b=-1===c?"":a.substring(c+1,d).toLowerCase()}catch(a){b=""}return{name:e,extension:b}}function isImageExtension(a){return"image"===getStandardExtension(a)}
419function getStandardExtension(a){if(!1===(0,_Often.exists)(a))return"etc";a=a.toLowerCase();var b={DEFAULT:["default"],CLOUD:["googleDrive","dropbox","onedrive"],PDF:["pdf"],WORD:["doc","docx"],EXCEL:["xlsx","xlsm","xlsb","xltx","xltxm","xls","xlt","xls","xlam"],HWP:["hwp"],PPT:["ppt","pptx"],IMAGE:["png","jpeg","jpg","bmp","rle","gif","pddv","tif","tiff","raw","al","eps","svg","svgz","iff","fpxv","frm","pcx","pct","pic","pxr","sct","tga","vda","icb","vst"],MEDIA:["avi","mpg","mpeg","mpe","wmv","asf","asx","flv","rm","mov","dat","mpeg1","mpeg2","mpeg4","mp3","mp4","ogg","wma","wav","au","mid"],HTML:["html"],AUTOCAD:["dwg","dwgc","dws","dxf","dwt","plt","lsp"],ZIP:["alz","ace","arc","arj","b64","bh","bhx","bin","bz2","cab","ear","enc","gz","ha","hqx","ice","img","jar","lha","lzh","mim","pak","rar","sit","tar","tgz","uue","war","xxe","z","zip","zoo","001"],TXT:["txt"],PSD:["psd"],AI:["ai"]},c=Object.keys(b).filter(function(c){return b[c].includes(a)});return c=0<c.length?c[0]:"ETC",c.toLowerCase()}function json2formData(a){var b=new FormData;return Object.keys(a).forEach(function(c){return b.append(c,a[c])}),b}function getValidImageSrc(a,b){var c=-1<location.href.indexOf("morningmate")?"/flow-renewal/assets/images/notice/notice_default_mm.png":"/flow-renewal/assets/images/notice/notice_default.jpg",d=b||c;return new Promise(function(b){if(!a)return b(d);var c=new Image;c.setAttribute("crossOrigin","anonymous"),c.onload=function(){var a=document.createElement("canvas");a.width=c.width,a.height=c.height;var d=a.getContext("2d");d.drawImage(c,0,0),b(a.toDataURL("image/png"))},c.onerror=function(){return b(d)},c.src=a})}function getFileSize(a){if(a&&isNaN(+a))return a;if(!a||0==+a)return"-";var b=a>1048576,c=1024<a;return b?Math.round(100*(a/1048576))/100+" MB":c?Math.round(100*(a/1024))/100+" KB":a+" B"}function isImageType(a){return""!==(0,_Often.n2v)(a.THUM_IMG_PATH,"")&&(!(0,_Often.isFunc)("UPLOAD_IMAGE_LIKE_FILE")||"Y"!==(0,_Often.n2v)(a.DRM_YN,""))&&isImageExtension(getFileInfo(a.FILE_NM).extension)&&isImageSize(a.FILE_SIZE)}function isImageSize(a){return!!(20971520>+a)}function convertImageUrlToFileObj(a){return _convertImageUrlToFileObj.apply(this,arguments)}function _convertImageUrlToFileObj(){return _convertImageUrlToFileObj=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:return b.n=1,fetch(a);case 1:return c=b.v,b.n=2,c.blob();case 2:return d=b.v,e=a.split(".").pop(),f=a.split("/").pop(),g=f.replace(".","_".concat(_USER_ID,"_").concat(Math.floor(+new Date/1e3),".")),h={type:"image/".concat(e)},b.a(2,new File([d],g,h))}},b)})),_convertImageUrlToFileObj.apply(this,arguments)}
420
421},{"./Often":146}],141:[function(require,module,exports){
422"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var jqueryUi=function(){return{sortable:function(a){var b=a.$ul,c=a.handleSizzleName;b&&c&&"undefined"!=typeof $().sortable&&(b instanceof Array?b.forEach(function(a){return a.sortable({handle:c,invertSwap:!0})}):b.sortable({handle:c,invertSwap:!0}))},tooltip:function(a){var b=a.$ul;b&&"undefined"!=typeof $().tooltip&&(b instanceof Array?b.forEach(function(a){return a.tooltip({track:!0})}):b.tooltip({track:!0}))}}}(),_default=exports.default=jqueryUi;
423
424},{}],142:[function(require,module,exports){
425"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stringify=exports.parseJSON=exports.parse=exports.encrypt=exports.decrypt=void 0;var stringify=exports.stringify=function(a){return a?JSON.stringify(a):""},parse=exports.parse=function(a,b){if(null===a)return b?[]:{};try{return JSON.parse(a.replace(/\n/g,"\\n").replace(/\r/g,"\\r"))}catch(a){return b?[]:{}}},parseJSON=exports.parseJSON=function(a,b){if(null===a)return b?[]:{};try{return JSON.parse(a.replace(/\n/g,"\\n").replace(/\r/g,"\\r"))}catch(b){return a}},encrypt=exports.encrypt=function(a){try{return btoa(stringify(a)).replace(/=/g,"")}catch(a){return""}},decrypt=exports.decrypt=function(a){try{return parse(atob(a))}catch(a){return{}}};
426
427},{}],143:[function(require,module,exports){
428"use strict";var _Often=require("./Often");Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAvailableKeyCode=isAvailableKeyCode,exports.isKey=isKey,exports.isUpperCaseKeyCode=isUpperCaseKeyCode;function isKey(a,b){var c=a.key,d=a.keyCode;if(b instanceof Array)return b.reduce(function(a,b){return a||isKey({key:c,keyCode:d},b)},!1);var e=(0,_Often.isBrowser)("ie"),f=function(a,b,f){return+d===a?+d===a:c===(e?b:f)},g={BACK:f(8,"Backspace","Backspace"),TAB:f(9,"Tab","Tab"),ENTER:f(13,"Enter","Enter"),SHIFT:f(16,"Shift","Shift"),CTRL:f(17,"Control","Control"),META:f(91,"Meta","Meta"),ALT:f(18,"Alt","Alt"),ESC:f(27,"Esc","Escape"),SPACE_BAR:f(32,"Spacebar"," "),LEFT:f(37,"Left","ArrowLeft"),UP:f(38,"Up","ArrowUp"),RIGHT:f
428(39,"Right","ArrowRight"),DOWN:f(40,"Down","ArrowDown"),DELETE:f(46,"Del","Delete"),F:f(70,"F","F"),PLUS:f(107,"Add","+"),MINUS:f(109,"Subtract","-"),RELOAD_WINDOW:f(116,"F5","F5"),RELOAD_MAC:f(82,"R","R"),KOREAN_INPUTTING:f(229,"Process","Process"),ARROW:f(37,"Left","ArrowLeft")||f(38,"Up","ArrowUp")||f(39,"Right","ArrowRight")||f(40,"Down","ArrowDown"),CAPS_LOCK:f(20,"CapsLock","CapsLock"),NUM_LOCK:f(144,"NumLock","NumLock"),PRINT_SCREEN:f(124,"PrintScreen","PrintScreen"),SCROLL_ROCK:f(145,"Scroll","ScrollLock"),PAUSE:f(19,"Pause","Pause"),INSERT:f(45,"Insert","Insert"),END:f(35,"End","End"),PAGE_UP:f(33,"PageUp","PageUp"),PAGE_DOWN:f(34,"PageDown","PageDown")};return b?g[b]:g}function isAvailableKeyCode(a){return!(65<=a.keyCode&&90>=a.keyCode||48<=a.keyCode&&57>=a.keyCode||96<=a.keyCode&&105>=a.keyCode||specialCharactersKeyCode(a.keyCode)||isKey(a,"BACK")||isKey(a,"DELETE")||isKey(a,"SPACE_BAR")||isKey(a,"ENTER")||isKey(a,"KOREAN_INPUTTING")||Often.isTablet()&&0===a.keyCode)}function specialCharactersKeyCode(a){return!(106!==a&&107!==a&&109!==a&&110!==a&&111!==a&&186!==a&&187!==a&&188!==a&&189!==a&&190!==a&&191!==a&&192!==a&&219!==a&&220!==a&&221!==a&&222!==a)}function isUpperCaseKeyCode(a){var b=a.key;return!!(1===b.length&&/[A-Z]/.test(b))}
429
430},{"./Often":146}],144:[function(require,module,exports){
431"use strict";var _Often=require("./Often.js");Object.defineProperty(exports,"__esModule",{value:!0}
431),exports.closeLoadingPop=closeLoadingPop,exports.load=load,exports.loadInnerStraight=void 0,exports.openLoadingPop=openLoadingPop,exports.removeLoading=removeLoading,exports.updateLoadingPop=updateLoadingPop;function openLoadingPop(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},c=b.type,d=void 0===c?"straight":c,e=b.percent,f=void 0===e?0:e,g=b.contents,h=void 0===g?"":g,i=i18next.t(common.wait)||h,j=$(loadingPop(i)).attr("id","loadingPop");load({type:d,$area:j.find(".load-area")}),j.find(".loading-area").css({margin:"10px 0"}),j.css({"z-index":20}),a.prepend(j)}function updateLoadingPop(a){var b=a.percent,c=void 0===b?0:b,d=a.contents,e=void 0===d?"":d,f=$("#loadingPop");(0,_Often.exists)(e)&&f.find(".content-area").find("p").text(e),f.find(".progress-bar").css({width:c+"%"}),f.find(".progress-bar").text(c+"%")}function load(a){var b=a.type,c=a.$area,d=a.where,e=void 0===d?"full":d,f=a.style,g=void 0===f?{}:f;if(c){setLoadingStyle(),removeLoading(c);var h={circle:loadCircle(),straight:loadStraight(),progress:loadingProgress(),progress2:loadingProgress2()}[b]||loadStraight(),i=$(h);switch(i.css(g),e){case"full":c.html(i);break;case"prepend":c.prepend(i);break;case"append":c.append(i);break;default:}if("progress"===b){var j=i.find(".load-progress-bar");j.animate({width:"0%"},1500,function(){j.animate({width:"60%"},1e3,function(){j.animate({width:"80%"},2e3,function(){j.animate({width:"100%"},5e3)})})})}}}function closeLoadingPop(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:$("body");$("#loadingPop").remove()}function removeLoading(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:$("body");a.find(".loading-area, .load-progress-area").remove()}var loadingProgress=function(){return"<li class=\"load-progress-area\"><div class=\"load-progress-bar\"></div></li>"},loadingProgress2=function(){return"\n        <div class=\"progress\">\n            <div class=\"progress-bar bg-success\"\n                 role=\"progressbar\" \n                 aria-label=\"Success example\"  \n                 style=\"width: 0\"></div>\n        </div>\n    "},loadingPop=function(a){return"\n        <div id=\"confirm\" class=\"dimmed-area\" tabindex=\"0\">\n            <div class=\"content-area\">\n                <div><p>".concat(a,"</p></div>\n                <div class=\"load-area\"></div>\n            </div>\n        </div>\n    ")},loadCircle=function(){return"\n        <div class=\"loading-area\">\n            <div class=\"loading type2\">\n                <i class=\"circle\"></i>\n                <i class=\"circle\"></i>\n                <i class=\"circle\"></i>\n                <i class=\"circle\"></i>\n                <i class=\"circle\"></i>\n            </div>\n        </div>\n    "},loadInnerStraight=exports.loadInnerStraight=function(){return"\n        <div class=\"loading\">\n            <i class=\"circle\"></i>\n            <i class=\"circle\"></i>\n            <i class=\"circle\"></i>\n            <i class=\"circle\"></i>\n        </div>\n    "},loadStraight=function(){return"<div class=\"loading-area\">".concat(loadInnerStraight(),"</div>")};function setLoadingStyle(){0<$("#LoadingStyle").length||$("head").append("\n<style id=\"LoadingStyle\">\n.dimmed-area {\n    position: absolute;\n    display: flex;\n    align-items: center;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n    background: rgba(0,0,0,.6);\n    z-index: 11;\n}\n.content-area {\n    background: #fff;\n    border-radius: 10px;\n    width: 450px;\n    margin: 0 auto;\n    padding: 20px;\n}\n.content-area p {\n    margin: 12px 0 25px 0;\n    text-align: center;\n    white-space: pre;\n}\n.circle {\n    display: inline-block;\n    width: 6px;\n    height: 6px;\n    border-radius: 50%;\n}\n.circle:nth-child(1) {\n    background: #00b2ff;\n    animation-name: loading;\n    animation-duration: 0.7s;\n    animation-delay: 0.2s;\n    animation-timing-function: ease-in-out;\n    animation-iteration-count: infinite;\n}\n.circle:nth-child(2) {\n    background: #00b01c;\n    animation-name: loading;\n    animation-duration: 0.7s;\n    animation-delay: 0.3s;\n    animation-timing-function: ease-in-out;\n    animation-iteration-count: infinite;\n}\n.circle:nth-child(3) {\n    background: #fd7900;\n    animation-name: loading;\n    animation-duration: 0.7s;\n    animation-delay: 0.5s;\n}\n.circle:nth-child(4) {\n    background: #402a9d;\n    animation-name: loading;\n    animation-duration: 0.7s;\n    animation-delay: 0.6s;\n    animation-timing-function: ease-in-out;\n    animation-iteration-count: infinite;\n}\n\n@keyframes loading {\n    0% {\n        transform: translateY(0);\n    }\n    20% {\n        transform: translateY(0);\n    }\n    40% {\n        transform: translateY(0);\n    }\n    60% {\n        transform: translateY(0);\n    }\n    80% {\n        transform: translateY(-10px);\n    }\n    100% {\n        transform: translateY(0);\n    }\n}\n\n.loading-area {\n    grid-column: 1/10;\n    margin: 200px 0;\n    width: 100%;\n    text-align: center;\n}\n.loading.type2 {\n    width: 24px;\n    height: 24px;\n    position: relative;\n    display: inline-block;\n}\n.loading.type2 .circle {\n    position: absolute;\n    width: 7px;\n    height: 7px;\n    border-radius: 50%;\n    opacity: 0.2;\n    animation: dot 1s ease-in-out infinite;\n}
431\n.loading.type2 .circle:nth-child(1) {\n    background: #00b2ff;\n    top: 0;\n    left: 50%;\n    transform: translateX(-50%);\n    animation-delay: 0s;\n}\n.loading.type2 .circle:nth-child(2) {\n    top: 6.5px;\n    right: 0;\n    background: #00b01c;\n    animation-delay: 0.1s;\n}\n.loading.type2 .circle:nth-child(3) {\n    bottom: 0;\n    right: 3px;\n    background: #fd7900;\n    animation-delay: 0.2s;\n}\n.loading.type2 .circle:nth-child(4) {\n    bottom: 0;\n    left: 3px;\n    background: #402a9d;\n    animation-delay: 0.3s;\n}\n.loading.type2 .circle:nth-child(5) {\n    top: 6.5px;\n    left: 0;\n    background: #777777;\n    animation-delay: 0.4s;\n}\n\n@keyframes dot {\n    0% {opacity: 0.2;}\n    20% {opacity: 0.2;}\n    40% {opacity: 1;}\n    60% {opacity: 1;}\n    80% {opacity: 1;}\n    100% {opacity: 0.2;}\n}\n\n@keyframes fadeIn {\n    from {\n        opacity: 0;\n    }\n    to {\n        opacity: 1;\n    }\n}\n\n.load-progress-area {\n    background-color: #eee !important;\n    padding: 0 !important;\n    margin: 0 !important;\n    position: fixed !important;\n    height: 2px !important;\n    width: 400px !important;\n    animation: fadeIn 0.5s ease-in-out forwards;\n    animation-delay: 0.5s;\n    opacity: 0;\n}\n\n.load-progress-bar {\n    /*height: 0.1rem;*/\n    height: 2px;\n    margin: 0;\n    opacity: 0.75;\n    width: 0;\n    background-color: #6449fc;\n}\n</style>")}
432
433},{"./Often.js":146}],145:[function(require,module,exports){
434"use strict";var _Often=require("./Often");Object.defineProperty(exports,"__esModule",{value:!0}),exports.setLocalValue=exports.setLocalJson=exports.setLocal=exports.removeLocal=exports.getLocalValue=exports.getLocalJson=exports.getLocal=exports.checkStorageSize=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function(){};return{s:f,n:function(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function(){d=d.call(b)},n:function(){var a=d.next();return h=a.done,a},e:function(a){i=!0,g=a},f:function(){try{h||null==d.return||d.return()}finally{if(i)throw g}}}}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEac
434h(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var removeLocal=exports.removeLocal=function(a){return localStorage.removeItem(convertKeyByTabId(a))},setLocal=exports.setLocal=function(a,b){return safeSetItem(convertKeyByTabId(a),b)},getLocal=exports.getLocal=function(a){return localStorage.getItem(convertKeyByTabId(a))},setLocalJson=exports.setLocalJson=function(a,b){return safeSetItem(convertKeyByTabId(a),JSON.stringify(b))},PURGE_STEPS=[function(){return purgeDataByKeyPrefix("synap_")},function(){return purgeDataByKeyPrefix("N_recommend_user_")},function(){return purgeDataByKeyPrefix("N_ONLY_MESSENGER-")},function(){return purgeOtherTabProjectSettings()}];function safeSetItem(a,b){var c=trySetItem(a,b);return"quota"===c?(checkStorageSize(function(){return"quota"!==(c=trySetItem(a,b))}),"quota"===c&&safeLog({setItemFailed:a,biggest:getMostMassDataKey()}),"ok"===c):"ok"===c}function trySetItem(a,b){try{return localStorage.setItem(a,b),"ok"}catch(a){return isQuotaError(a)?"quota":"fail"}}function isQuotaError(a){return!!a&&("QuotaExceededError"===a.name||"NS_ERROR_DOM_QUOTA_REACHED"===a.name||22===a.code||1014===a.code)}var getLocalJson=exports.getLocalJson=function(a){return(0,_Often.n2v)(getLocalValue(a),{})},setLocalValue=exports.setLocalValue=function(a,b,c){try{var d=_objectSpread({},JSON.parse(getLocal(a)));d[b]=c,setLocal(a,JSON.stringify(d))}catch(a){}},getLocalValue=exports.getLocalValue=function(a,b){try{return b?JSON.parse(getLocal(a))[b]:JSON.parse(getLocal(a))}catch(b){return(0,_Often.n2v)(getLocal(a))}},checkStorageSize=exports.checkStorageSize=function(a){for(var b=[],c=0,d=PURGE_STEPS;c<d.length;c++){var e=d[c],f=e();if(f.length&&(b.push.apply(b,_toConsumableArray(f)),"function"==typeof a&&a()))break}return b.length&&safeLog({purged:b}),b};function purgeOtherTabProjectSettings(){var a,b="_"+(0,_Often.n2v)(window._TAB_ID),c=Object.keys(localStorage).filter(function(a){return a.startsWith("N_CURRENT_PROJECT_SETTING_")&&!a.endsWith(b)}),d=_createForOfIteratorHelper(c);try{for(d.s();!(a=d.n()).done;){var e=a.value;localStorage.removeItem(e)}}catch(a){d.e(a)}finally{d.f()}return c}function purgeDataByKeyPrefix(a){var b,c=Object.keys(localStorage).filter(function(b){return b.startsWith(a)}),d=_createForOfIteratorHelper(c);try{for(d.s();!(b=d.n()).done;){var e=b.value;localStorage.removeItem(e)}}catch(a){d.e(a)}finally{d.f()}return c}function getMostMassDataKey(){for(var a="",b=0,c=0,d=Object.keys(localStorage);c<d.length;c++){var e=d[c],f=localStorage.getItem(e),g=new Blob([f]).size;g>b&&(a=e,b=g)}return{key:a,size:b}}function saveLocalStorageLog(a){Ajax.executeApi("ACT_FEATURE_LOG_C001",{FEATURE_ID:"LOCAL_STORAGE_QUOTA_EXCEEDED",DETAIL:JSON.stringify(a)})}function safeLog(a){try{saveLocalStorageLog(a)}catch(a){}}function convertKeyByTabId(a){return a=a||"",a.includes("TAB_")?"N_"+a+"_"+(0,_Often.n2v)(window._TAB_ID):"N_"+a}
435
436},{"./Often":146}],146:[function(require,module,exports){
437"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.attr=attr,exports.attrs=attrs,exports.calculateMs=void 0,exports.chunk=chunk,exports.clog=clog,exports.copyClipboard=copyClipboard,exports.deepCompare=deepCompare,exports.delay=delay,exports.deleteCookie=deleteCookie,exports.elog=elog,exports.exists=exports.exist=exports.empty=void 0,exports.getAdmin=getAdmin,exports.getAdminPage=getAdminPage,exports.getCookie=getCookie,exports.getServerMode=getServerMode,exports.getUUID=getUUID,exports.isAct=exports.guid=void 0,exports.isBrowser=isBrowser,exports.isClientOs=isClientOs,exports.isEncodedUrl=isEncodedUrl,exports.isFunc=void 0,exports.isGlobal=isGlobal,exports.isGuest=isGuest,exports.isJson=isJson,exports.isMobile=isMobile,exports.isServerOn=isServerOn,exports.isTablet=isTablet,exports.logPipe=exports.isTarget=void 0,exports.mlog=mlog,exports.n2v=n2v,exports.requireIIFE=exports.range=exports.pipe=exports.numberWithCommas=exports.noop=void 0,exports.setCo
437okie=setCookie,exports.showNRemove=exports.showNHide=void 0,exports.toggleAction=toggleAction,exports.uniq=void 0;var _Toast=require("./Toast"),_Confirm=require("./Confirm"),_LocalStorage=require("./LocalStorage"),_Json=require("./Json");function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}var requireIIFE=exports.requireIIFE=function(a){var b=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],c="string"==typeof a;c&&(a=[a]);var d=[],e=a.map(function(a){var b=window[a];return b||d.push(a),b});return b&&0<d.length&&(0,_Confirm.confirm)({text:{contents:"Not Found [".concat(d.join(","),"] IIFE!")},display:{cancelBtn:!1}}),c?e[0]:e},noop=exports.noop=function(){return""},isFunc=exports.isFunc=function(a){var b,c,d=!!(null!==(b=(0,_Json.parse)((0,_LocalStorage.getLocal)("ONLY_FUNC_LIST")))&&void 0!==b&&b[a]),e=!!(null!==(c=(0,_Json.parse)((0,_LocalStorage.getLocal)("ONLY_FUNC_LIST")))&&void 0!==c&&c["".concat(a,"_INVALID")]);return d&&!e},_s4=function(){return window.crypto.getRandomValues(new Uint16Array(1))[0].toString(16).padStart(4,"0")},guid=exports.guid=function(){return _s4()+_s4()+"-"+_s4()+"-"+_s4()+"-"+_s4()+"-"+_s4()+_s4()+_s4()},isTarget=exports.isTarget=function(a,b){return 0<(b instanceof Array?b:[b]).filter(function(b){return 0<$(a.target).closest(b).length}).length},exist=exports.exist=function(a){return a instanceof Array?0<a.length:a instanceof Object?0<Object.keys(a).length:""!==String(n2v(a),"").trim()},exists=exports.exists=exist,empty=exports.empty=function(a){return(!1)===exist(a)},numberWithCommas=exports.numberWithCommas=function(a){return(+a).toLocaleString("en")},isAct=exports.isAct=function(a){return location.pathname.includes(a)},range=exports.range=function(a){return Array.from({length:a},function(a,b){return b})},logPipe=exports.logPipe=function(a){for(var b=arguments.length,c=Array(1<b?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];return clog.apply(void 0,[_typeof(a),a].concat(c)),a},calculateMs=exports.calculateMs=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,c=performance.now();return range(b).forEach(function(){return a()}),Math.ceil(performance.now()-c)+"ms"};function isServerOn(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"DEV_TEST",b=location.host,c=function(){return b.includes("seco.flow.team")||b.includes("zoomok.flow.team")},d=function(){return b.includes("develop.flow.team")||b.includes("staging.flow.team")||b.includes("release.flow.team")||b.includes("hotfix.flow.team")},e=function(){return b.includes("localhost")||b.includes("flowdev.info")||b.includes("flowteam.info")||b.includes("flowtest.info")||b.includes("127.0.0.1")};return{REAL:function(){return b.includes("flow.team")&&!d()&&!e()&&!c()}(),ALL_TEST:d()||e(),REAL_TEST:d(),DEV_TEST:e(),ENTER:function(){var a;return(null===(a=window.ServerChecker)||void 0===a?void 0:a.isEnter)&&!b.includes("dev")&&!e()&&!c()}()}[a]}
437function getServerMode(){var a=location.host,b=function(){return a.includes("develop.flow.team")||a.includes("staging.flow.team")||a.includes("release.flow.team")||a.includes("hotfix.flow.team")||a.includes("staging.morningmate.com")||a.includes("release.morningmate.com")||a.includes("hotfix.morningmate.com")},c=function(){return a.includes("localhost")||a.includes("flowdev.info")||a.includes("flowteam.info")||a.includes("flowtest.info")||a.includes("develop.morningmate.com")||a.includes("morningmate.info")},d=function(){return a.includes("seco.flow.team")||a.includes("zoomok.flow.team")};if(function(){return(a.includes("flow.team")||a.includes("morningmate.com"))&&!b()&&!c()&&!d()}())return"REAL";return b()?"REAL_TEST":c()?"DEV_TEST":b()||c()?"ALL_TEST":void 0}function n2v(a,b){return null==a||""===a||void 0===_typeof(a)||"null"===a||"undefined"===a||void 0===a?"string"==typeof b?b.trim():"number"==typeof b?b:"":"string"==typeof a&&"ranne "!==a?a.trim():a}function attr(a){var b=attrs(a);return 0<b.length?b[0]:{}}function attrs(a){for(var b=[],c=0,d=a.length;c<d;c++){for(var e=void 0,f=a[c].attributes,g={},h=0,j=null!==(k=null===f||void 0===f?void 0:f.length)&&void 0!==k?k:0;h<j;h++){var k;e=f[h];var l=e.nodeName.toUpperCase().replace(/[-]/ig,"_").replace("DATA_",""),m=!["ID","CLASS","CONTENTEDITABLE","STYLE","DATA"].includes(l);m&&(g[l]=e.nodeValue)}b.push(g)}return b}function toggleAction(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},d=c.make,e=void 0===d?noop:d,f=c.show,g=void 0===f?noop:f,h=c.hide,i=void 0===h?noop:h;a.hasClass("active")?(b.css("display","none"),i(a,b)):0===b.length?e(a,b):(b.css("display","flex"),g(a,b)),a.toggleClass("active")}var showNHide=exports.showNHide=function(a,b){return a?b.show():b.hide()},showNRemove=exports.showNRemove=function(a,b){return a?b.show():b.remove()};function isBrowser(a){var b=navigator.userAgent.toLowerCase(),c={ie6:b.includes("msie 6"),ie7:b.includes("msie 7"),ie8:b.includes("msie 8"),ie9:b.includes("msie 9"),ie10:b.includes("msie 10"),ie11:b.includes("msie 11"),ie:b.includes("netscape")||b.includes("trident")||b.includes("msie"),edge:b.includes("edge"),edg:b.includes("edg"),opera:!!window.opera,safari:b.includes("safari")&&!b.includes("chrome"),safari3:b.includes("applewebkir/5"),mac:b.includes("mac"),chrome:b.includes("chrome"),firefox:b.includes("firefox"),whale:b.includes("whale")};return a?c[a]:c}function isClientOs(){var a=navigator.userAgent.toLowerCase();return{isWin:a.includes("windows"),isMac:a.includes("macintosh"),isWin7:a.includes("windows nt 6.1"),isWin8:a.includes("windows nt 6.2"),isWin10:a.includes("windows nt 10.0")}}function isTablet(){var a=navigator.userAgent;return!!a.match(/iPad|Android/)}function isMobile(){var a=navigator.userAgent;return a.match(/Mobile|iP(hone|od)|Windows (CE|Phone)|Minimo|Opera M(obi|ini)|BlackBerry|Nokia/)&&!a.match(/iPad/)}function getCookie(a){for(var b=a+"=",c="",d=document.cookie.split(";"),e=0,f=d.length;e<f;e++)if(" "===d[e][0]&&(d[e]=d[e].substring(1)),0===d[e].indexOf(b))return unescape(d[e].slice(b.length,d[e].length));return c}function setCookie(a,b,c,d){var e,f,g=new Date,h="",i="";(""!==n2v(c)||""!==n2v(d))&&(c?g.setDate(g.getDate()+c):g.setTime(g.getTime()+d),h="expires=",i=g.toGMTString()+";");var j="http:"!==location.protocol&&(!!(null!==(e=requireIIFE("TeamsHelper",!1))&&void 0!==e&&null!==(f=e.isTeams)&&void 0!==f&&f.call(e))||location.pathname.startsWith("/teams/")),k="http:"===location.protocol?"":"; secure",l=j?"; SameSite=None; Partitioned":"";document.cookie="".concat(a,"=").concat(escape(b),"; path=/; ").concat(h+i+k).concat(l)}function deleteCookie(a){document.cookie="".concat(a,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;")}function getUUID(a,b){return exist(a)&&exist(b)?a+"_"+b+"_xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=new Uint8Array(1);window.crypto.getRandomValues(b);var c=b[0]%16,d="x"===a?c:8|3&c;return d.toString(16)}):void(0,_Toast.toast)("error","\uD544\uC218\uAC12 \uCCB4\uD06C")}function isJson(a){try{JSON.parse(a)}catch(a){return(!1)}return!0}function copyClipboard(a){return navigator.clipboard?void navigator.clipboard.writeText(a).then(function(){return(0,_Toast.toast)("success","\uD074\uB9BD \uBCF4\uB4DC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4.")}):void(0,_Toast.toast)("error","\uD074\uB9BD\uBCF4\uB4DC \uBCF5\uC0AC\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")}var pipe=exports.pipe=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduce(function(a,b){return b(a)},a)}},uniq=exports.uniq=function(a){return _toConsumableArray(new Set(a
437))};function deepCompare(a,b){return!(Object.prototype.toString.call(a)!==Object.prototype.toString.call(b))&&("[object Object]"===Object.prototype.toString.call(a)||"[object Array]"===Object.prototype.toString.call(a)?Object.keys(a).length===Object.keys(b).length&&Object.keys(a).every(function(c){return deepCompare(a[c],b[c])}):a===b)}function delay(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:0;return new Promise(function(b){return setTimeout(b,a)})}function chunk(){for(var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:[],b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1,c=[],d=0;d<a.length;d+=b)c.push(a.slice(d,d+b));return c}function clog(){var a;if(!(isServerOn("REAL")||isServerOn("ENTER"))){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];(a=console).log.apply(a,["[\uAC1C\uBC1C\uC11C\uBC84 \uC804\uC6A9\uB85C\uADF8]"].concat(c))}}function elog(){var a;(a=Mutil).mlog.apply(a,arguments)}function mlog(){var a;if(!(isServerOn("REAL")&&!isMadras()||isServerOn("ENTER"))){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];(a=console).log.apply(a,["[\uB9C8\uB4DC\uB77C\uC2A4\uCCB4\uD06C \uC804\uC6A9\uB85C\uADF8]"].concat(c))}}function isMadras(){return"UTLZ_1608261809693"===window._USE_INTT_ID}function isEncodedUrl(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(empty(a))return(!1);try{var b=decodeURIComponent(a);return b!==a}catch(a){return(!1)}}function isGlobal(){return location.host.includes("morningmate")}function isGuest(){var a,b,c,d;return((null===(a=window._USE_INTT_ID)||void 0===a?void 0:a.startsWith("GMAIL"))||(null===(b=window._USE_INTT_ID)||void 0===b?void 0:b.startsWith("KAKAO"))||(null===(c=window._USE_INTT_ID)||void 0===c?void 0:c.startsWith("FLOW"))||(null===(d=window._USE_INTT_ID)||void 0===d?void 0:d.startsWith("APPLE")))&&"Y"!==window._ENTER_YN}function getAdminPage(){return"\\x66\\x6c\\x6f\\x77\\x5f\\x61\\x64\\x6d\\x69\\x6e\\x2e\\x61\\x63\\x74".split("\\x").filter(Boolean).map(function(a){return String.fromCharCode(parseInt(a,16))}).join("")}function getAdmin(){return"\\x66\\x6c\\x6f\\x77\\x5f\\x61\\x64\\x6d\\x69\\x6e".split("\\x").filter(Boolean).map(function(a){return String.fromCharCode(parseInt(a,16))}).join("")}
438
439},{"./Confirm":134,"./Json":142,"./LocalStorage":145,"./Toast":155}],147:[function(require,module,exports){
440"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setMouseDownEvent=exports.isTargetOnMouseDown=exports.initMouseDownEvent=void 0;var mouseDownEvent,_Often=require("./Often"),initMouseDownEvent=exports.initMouseDownEvent=function(){return mouseDownEvent=null},setMouseDownEvent=exports.setMouseDownEvent=function(a){return mouseDownEvent=a},isTargetOnMouseDown=exports.isTargetOnMouseDown=function(a){return(0,_Often.isTarget)(mouseDownEvent,a)};
441
442},{"./Often":146}],148:[function(require,module,exports){
443"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Paging=void 0;var _Often=require("./Often"),_Loading=require("./Loading");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");
443if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var SCROLL_RATIO=.8,Paging=exports.Paging=function(){function a(b){_classCallCheck(this,a);var c=b.pageData,d=void 0===c?{}:c,e=b.noDataHtml,f=void 0===e?"":e,g=b.callback,h=void 0===g?{}:g,i=b.targetObj,j=void 0===i?{}:i,k=b.timeout,l=void 0===k?500:k;this.pageData=d,this.noDataHtml=f,this.callback=h,this.targetObj=j,this.timer=null,this.timeout=l,this.init({view:!0,data:!0}),this.setEvent()}return _createClass(a,[{key:"init",value:function b(a){var c=a.view,d=a.data;this.timer=null;var e=this.targetObj.$ul;c&&e.empty(),d&&(this.pageData.PG_NO=1,this.pageData.NEXT_YN="Y")}},{key:"setPageData",value:function b(a){this.pageData=_objectSpread(_objectSpread({},this.pageData),a)}},{key:"getPageData",value:function a(){return this.pageData}},{key:"setRecords",value:function b(a){this.records=a}},{key:"next",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=0<h.length&&void 0!==h[0]?h[0]:{},c=b.isScrolling,d=void 0!==c&&c,e=b.isDrawLoad,f=void 0!==e&&e,g=this.targetObj.$ul,f?(0,_Loading.load)({type:"circle",$area:g}):!d&&this.init({view:!0}),a.n=1,this.callback.next({isScrolling:d,isDrawLoad:f,$area:g});case 1:return a.a(2)}},a,this)}));return a}()},{key:"setEvent",value:function a(){var b=this,c=this.targetObj,d=c.$ul,e=c.$scroll,f=void 0===e?d:e,g=c.$focus,h=void 0===g?$():g,i=this.callback,j=i.click,k=void 0===j?_Often.noop:j,l=i.next,m=void 0===l?_Often.noop:l;
443d.off("click").on("click",k),f.off("scroll").on("scroll",function(a){var c=a.target,e=c.scrollTop,f=c.clientHeight,g=c.scrollHeight,h=(e+f)/g,i=b.pageData.NEXT_YN,j=void 0===i?"":i;"N"===j||(b.timer&&clearTimeout(b.timer),b.timer=setTimeout(function(){0===e||(SCROLL_RATIO<h&&m({isScrolling:!0,isDrawLoad:!1,$area:d}),clearTimeout(b.timer))},b.timeout))}),h.focus()}},{key:"render",value:function a(){if(!this.records)return void Mutil.mlog(this);var b=1===this.pageData.PG_NO,c=0===this.records.length,d=this.targetObj.$ul,e=this.callback,f=e.final,g=e.item;f=f||_Often.noop,g=g||_Often.noop,(0,_Loading.removeLoading)(d),c?(b&&d.append(this.noDataHtml),this.setPageData({NEXT_YN:"N"})):(d.append(g(this.records)),b&&d.scrollTop(0),this.setPageData({PG_NO:this.pageData.PG_NO+1})),f({$ul:d,isFirstDraw:b})}}])}();
444
445},{"./Loading":144,"./Often":146}],149:[function(require,module,exports){
446"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ping=void 0;function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
446return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d.return&&(k=d.return(),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}var delay=function b(a){return new Promise(function(b){return setTimeout(b,a)})},setStyles=function c(a,b){a&&Object.entries(b).forEach(function(b){var c=_slicedToArray(b,2),d=c[0],e=c[1];
446a.style[d]=e})},getStyle=function c(a,b){return a?window.getComputedStyle(a).getPropertyValue(b):null},getOffset=function b(a){if(!a)return null;var c=a.getBoundingClientRect();return{top:c.top+window.scrollY,left:c.left+window.scrollX}},getElement=function b(a){return a?"string"==typeof a?document.querySelector(a):a instanceof HTMLElement?a:a.jquery&&0<a.length?a[0]:null:null},getAnimationCssInit=function b(a){switch(a){case"focus":return{transform:"scale(1.5)",opacity:"0"};case"spread":default:return{transform:"scale(1)",opacity:"1"}}},getAnimationCssAfter=function b(a){switch(a){case"focus":return{transform:"scale(1)",opacity:"1"};case"spread":default:return{transform:"scale(1.1)",opacity:"0"}}},startAnimation=function(){var a=_asyncToGenerator(_regenerator().m(function d(a,b,c){return _regenerator().w(function(d){for(;1;)switch(d.n){case 0:if(a){d.n=1;break}return d.a(2);case 1:return setStyles(a,{visibility:"hidden"}),d.n=2,delay(100);case 2:return setStyles(a,{visibility:"visible"}),setStyles(a,getAnimationCssAfter(c)),d.n=3,delay(.5*b);case 3:return setStyles(a,{opacity:"0"}),d.n=4,delay(.5*b);case 4:a.remove();case 5:return d.a(2)}},d)}));return function e(b,c,d){return a.apply(this,arguments)}}(),createHighlight=function c(a,b){if(!a)return void console.debug("[PING] TARGET NOT FOUND");var d=b.playTime,e=b.lineColor,f=b.animType,g=b.isStatic,h=getStyle(a,"position");h&&"static"!==h||setStyles(a,{position:"relative"});var i={position:"absolute",border:"4px solid ".concat(e),boxSizing:"border-box",transition:"all ".concat(.5*(.001*d),"s ease-in-out"),zIndex:"9999999999",pointerEvents:"none"},j=document.createElement("div");if(g){var k=getOffset(a),l=a.offsetWidth,m=a.offsetHeight;if(!k||!l||!m)return void console.debug("[PING] TARGET DIMENSIONS NOT AVAILABLE");var n={top:"".concat(k.top,"px"),left:"".concat(k.left,"px"),width:"".concat(l,"px"),height:"".concat(m,"px")};setStyles(j,_objectSpread(_objectSpread(_objectSpread({},i),n),getAnimationCssInit(f))),document.body.appendChild(j)}else{var o={top:"0",left:"0",width:"100%",height:"100%"};setStyles(j,_objectSpread(_objectSpread(_objectSpread({},i),o),getAnimationCssInit(f))),a.appendChild(j)}startAnimation(j,d,f)},isFeatureEnabled=function b(a){return"undefined"==typeof Mutil||"function"!=typeof Mutil.isFunc||Mutil.isFunc(a)},ping=exports.ping=function b(a){var c,d,e,f,g,h,i,j=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};if(isFeatureEnabled("TARGET_PING")){var k=getElement(a);if(!k)return void console.debug("[PING] Invalid target:",a);var l={repeat:null!==(c=null===j||void 0===j?void 0:j.repeat)&&void 0!==c?c:2,repeatBuffer:null!==(d=null===j||void 0===j?void 0:j.repeatBuffer)&&void 0!==d?d:400,playTime:null!==(e=null===j||void 0===j?void 0:j.playTime)&&void 0!==e?e:1e3,animType:null!==(f=null===j||void 0===j?void 0:j.animType)&&void 0!==f?f:"spread",lineColor:null!==(g=null===j||void 0===j?void 0:j.lineColor)&&void 0!==g?g:"#6449fc",isStatic:null===(h=null===j||void 0===j?void 0:j.isStatic)||void 0===h||h},m=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:b=0;case 1:if(!(b<l.repeat)){a.n=3;break}if(createHighlight(k,l),!(l.repeat>b+1)){a.n=2;break}return a.n=2,delay(l.repeatBuffer);case 2:b++,a.n=1;break;case 3:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),n=null!==(i=null===j||void 0===j?void 0:j.buffer)&&void 0!==i?i:100;delay(n).then(m)}};
447
448},{}],150:[function(require,module,exports){
449"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.prompt=prompt;var _Often=require("./Often"),_Toast=require("./Toast");function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
449:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var $prompt=function a(){return $("#prompt")};function prompt(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.renders[0].key,c=a.callbacks||{},d=c.submit,f=void 0===d?_Often.noop:d,g=c.final,h=void 0===g?_Often.noop:g,i=function a(){return $prompt().remove()};setPromptStyle(),i(),$("body").prepend(getConfirmHtml("prompt",a));var j=$prompt();j.on("mousedown mouseup click",function(a){a.stopPropagation()}).on("click",function(){var a=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e;return _regenerator().w(function(b){for(;1;)switch(b.n){case 0:e=!0,b.n=e===(0,_Often.isTarget)(a,[".close",".no"])?1:e===!(0,_Often.isTarget)(a,".layer")?1:e===(0,_Often.isTarget)(a,[".yes"])?2:4;break;case 1:return i(),b.a(3,5);case 2:if(c={},d={is:!1},$(a.currentTarget).find(".inputc:visible").each(function(a,b){if(!d.is){var e=$
449(b),f=!!e.attr("required"),g=$.trim(e.val());if(f&&0===g.length){var h=e.parents("tr").find("th").text().replace(" *","");return void(d={$el:e,message:"Check '".concat(h,"'!!!"),is:!0})}c[e.filter(":visible").attr("class").replace("inputc ","")]=g}}),!d.is){b.n=3;break}return(0,_Toast.toast)("error",d.message),d.$el.focus(),b.a(2);case 3:return f(c),i(),b.a(3,5);case 4:return b.a(3,5);case 5:return b.a(2)}},b)}));return function(b){return a.apply(this,arguments)}}()).on("change",function(a){switch(!0){case(0,_Often.isTarget)(a,["[type=radio]"]):var b=$(a.target).parents("tr").attr("id"),c=$(a.target).val();$(".".concat(b,"_radio_render")).hide(),$(".".concat(c,"_radio_render")).show();break;default:}}),h(j),j.find("input.".concat(b)).focus()}function getConfirmHtml(a,b){var c=b.title,d=b.renders,e=b.submitText,f=void 0===e?"\uD655\uC778":e;return"\n        <div id=\"".concat(a,"\" class=\"prompt\">\n            <div class=\"back\"></div>\n            <div class=\"layer\">\n                <div class=\"top\">\n                    <h1 class=\"head\">\n                        <span class=\"title\">").concat(c,"</span>\n                        <input class=\"close\" type=\"button\">\n                    </h1>\n                </div>\n                <div class=\"body\">\n                    <div class=\"cont\">\n                        <table>\n                            <colgroup>\n                                <col class=\"colc\"><col>\n                            </colgroup>\n                            <tbody>\n                                ").concat(d.map(function(a){return convertItem(a)}).join(""),"   \n                            </tbody>\n                        </table>                                  \n                    </div>\n                    <div class=\"btn\">\n                        <button class=\"no\">\uCDE8\uC18C</button>\n                        <button class=\"yes\">").concat(f,"</button>\n                    </div>\n                </div>\n            </div>\n        </div>\n    ")}function convertItem(a){var b=a.id,c=a.cls,d=a.type,e=a.key,f=a.label,g=a.max,h=a.placeholder,i=a.required,j=a.options,k=a.display;return"line"===d?"<tr><th><br/><div class=\"hr\"></div><br/></th></tr>":"subtitle"===d?"<tr class=\"".concat(c,"\" ><th class=\"sub-title\"><br/>").concat(f,"</th></tr>"):"radio"===d?"\n            <tr id=\"".concat(e,"\" class=\"").concat(c,"\">\n                <th class=\"thc\">").concat(f," ").concat(i?"*":"","</th>\n                <td class=\"tdc radio\">\n                    ").concat(j.map(function(a,b){var c=a.key,d=a.label;return"\n                        <div id=\"".concat(c,"Option\">\n                          <input \n                            type=\"radio\" id=\"").concat(c,"\" value=\"").concat(c,"\" name=\"").concat(e,"\" \n                            ").concat(0===b?"checked=\"checked\"":""," ").concat(i?"required":"","\">\n                          <label for=\"").concat(c,"\">").concat(d,"</label>\n                        </div>\n                    ")}).join(""),"\n                </td>\n            </tr>\n            ").concat(j.map(function(a){var b=a.key,c=a.renders;return null===c||void 0===c?void 0:c.map(function(a){return convertItem(_objectSpread(_objectSpread({},a),{},{cls:"".concat(e,"_radio_render ").concat(b,"_radio_render"),key:"".concat(b,"_").concat(a.key||e)}))})}).flat().join("")," \n        "):"date"===d?"\n            <tr id=\"".concat(b,"\" class=\"").concat(c,"\" ").concat(k?"style=\"display:".concat(k,"\""):"",">\n                <th class=\"thc\">").concat(f," ").concat(i?"*":"","</th>\n                <td class=\"tdc date\">\n                    <input type=\"date\" name=\"START_").concat(e,"\" class=\"inputc START_").concat(e,"\" ").concat(i?"required":"",">\n                    <span> ~ </span> \n                    <input type=\"date\" name=\"END_").concat(e,"\" class=\"inputc END_").concat(e,"\" ").concat(i?"required":"",">\n                </td>\n            </tr>"):"datetime-local"===d?"\n            <tr id=\"".concat(b,"\" class=\"").concat(c,"\" ").concat(k?"style=\"display:".concat(k,"\""):"",">\n                <th class=\"thc\">").concat(f," ").concat(i?"*":"","</th>\n                <td class=\"tdc date\">\n                    <input type=\"datetime-local\" name=\"START_").concat(e,"\" class=\"inputc START_").concat(e,"\" ").concat(i?"required":"",">\n                </td>\n            </tr>"):"\n            <tr id=\"".concat(b,"\" class=\"").concat(c,"\">\n                <th class=\"thc\">").concat(f," ").concat(i?"*":"","</th>\n                <td class=\"tdc\">\n                    <input \n                        class=\"inputc ").concat(e,"\" \n                        type=\"").concat(d,"\" \n                        ").concat(g?"maxlength=".concat(g):"","\n                        placeholder=\"").concat(h,"\" \n                        ").concat(i?"required":"",">\n                </td>\n            </tr>")}function setPromptStyle(){0<$("#promptStyle").length||$("head").append("\n        <style id=\"promptStyle\">\n        .prompt {\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            width: 100vw;\n            height: 100vh;\n            position: absolute;\n        }\n        .prompt .back {\n            position: fixed; \n            width: 100%; \n            height: 100%; \n            overflow: hidden; \n            background: rgb(0, 0, 0); \n            opacity: 0.3; \n            z-index: 100;\n        }\n        .prompt .layer {\n            width: 500px; \n            height: auto; \n            z-index: 100; \n            background-color: rgb(255, 255, 255);\n        }\n        .prompt .top {\n            padding: 25px 30px 0;\n        }\n        .prompt .top .head {\n            padding-bottom: 14px; \n            font-size: 19px; \n            color: rgb(17, 17, 17); \n            font-weight: 700; \n            border-bottom: 1px solid rgb(230, 230, 230);\n            display: flex;\n            justify-content: space-between;\n        }\n        .prompt .top .head .title {\n            font-size: 19px; \n            color: rgb(17, 17, 17); \n            font-weight: 700;\n        }\n        .prompt .top .head .close {\n           cursor: pointer; \n           width: 30px; \n           height: 30px; \n           border: 0; \n           background: url(\"/design2/flow_admin_2019/img/btn_popclose.gif\") center center no-repeat;\n        }
449\n        .prompt .body {\n           padding: 0 30px; \n           margin-bottom: 30px;\n        }\n        .prompt .body .cont {\n               margin-top: 10px;\n        }\n        .prompt .body .btn {\n           margin-top: 15px; \n           text-align: center; \n           width: 100%;\n        }\n        .prompt .sub-title {\n            font-size: 14px;\n            font-weight: bold;\n            width: 200px;\n            display: block;\n            padding: 10px 0;\n            text-align: left;\n            color: rgb(48, 124, 255);\n        }\n        .prompt .tdc.radio {\n            display: flex;\n            gap: 10px;\n        }\n        .prompt .tdc.date {\n            display: flex;\n            align-items: center;\n            width: 98.5%;\n            margin-top: 8px;\n        }\n        .prompt .tdc.date span{\n            margin: 0 10px;\n        }\n        .prompt .hr {\n            border-bottom: 1px solid rgb(230, 230, 230);\n            margin: 10px 0;\n            width: 434px;\n        }\n        .prompt button.upload {\n            padding: 4px;\n            border-radius: 8px;\n            margin-left: 4px;\n        }\n        </style>")}
450
451},{"./Often":146,"./Toast":155}],151:[function(require,module,exports){
452"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.connectSocket=void 0;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _classPrivateMethodInitSpec(b,c){_checkPrivateRedeclaration(b,c),c.add(b)}function _classPrivateFieldInitSpec(b,c,d){_checkPrivateRedeclaration(b,c),c.set(b,d)}function _checkPrivateRedeclaration(a,b){if(b.has(a))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(b,c){return b.get(_assertClassBrand(b,c))}function _classPrivateFieldSet(b,c,a){return b.set(_assertClassBrand(b,c),a),a}function _assertClassBrand(a,b,c){if("function"==typeof a?a===b:a.has(b))return 3>arguments.length?b:c;throw new TypeError("Private element is not present on this object")}var _socket=new WeakMap,_props=new WeakMap,_Socket_brand=new WeakSet,Socket=function(){function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck(this,a),_classPrivateMethodInitSpec(this,_Socket_brand),_classPrivateFieldInitSpec(this,_socket,void 0),_classPrivateFieldInitSpec(this,_props,void 0),_classPrivateFieldSet(_props,this,b),_assertClassBrand(_Socket_brand,this,_setup).call(this)}return _createClass(a,[{key:"emit",value:function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return a?void _classPrivateFieldGet(_socket,this).emit(a,b):Mutil.mlog("empty eventName")}},{key:"on",value:function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=1<arguments.length?arguments[1]:void 0;return a?"function"==typeof b?void _classPrivateFieldGet(_socket,this).off(a).on(a,b):Mutil.mlog("empty callback"):Mutil.mlog("empty eventName")}}])}();function _setup(){var a=_classPrivateFieldGet(_props,this),b=a.NODE_URL,c=void 0===b?"":b,d=_assertClassBrand(_Socket_brand,this,_getOptions).call(this);try{_classPrivateFieldSet(_socket,this,io.connect(c,d))}catch(a){Mutil.mlog("undefined socket io")}}function _getOptions(){return{rememberUpgrade:!0}}var connectSocket=exports.connectSocket=function(a){return new Socket(a)};
453
454},{}],152:[function(require,module,exports){
455"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warning=exports.success=exports.question=exports.normal=exports.info=exports.error=exports.confirm=void 0;var normal,success,error,warning,info,question,confirm,_Often=require("./Often.js"),_Toast=require("./Toast.js"),_Confirm=require("./Confirm.js");exports.normal=normal=function(a){(0,_Toast.toast)("info",a)},exports.success=success=function(a){(0,_Toast.toast)("success",a)},exports.error=error=function(a){(0,_Toast.toast)("error",a)},exports.warning=warning=function(a){(0,_Toast.toast)("warning",a)},exports.info=info=function(a){(0,_Toast.toast)("info",a)},exports.question=question=function(a){(0,_Toast.toast)("info",a)},exports.confirm=confirm=function b(a){var c=a.title,d=a.content,e=void 0===d?"":d,b=a.confirm,f=a.cancel,g=a.confirmCallback,h=a.cancelCallback;(0,_Confirm.confirm)({text:{contents:c+"\n"+e,submit:b,cancel:f||"\uCDE8\uC18C"},callback:{submitFn:g,cancelFn:h}})};
456
457},{"./Confirm.js":134,"./Often.js":146,"./Toast.js":155}],153:[function(require,module,exports){
458"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinkData2Tag=LinkData2Tag,exports.NewLine2Data=NewLine2Data,exports.NewLine2Tag=NewLine2Tag,exports.blank2SpaceTag=blank2SpaceTag,exports.br2n=br2n,exports.checkEmptyNewLine=checkEmptyNewLine,exports.data2Html=data2Html,exports.escapeHtml=escapeHtml,exports.extractHashtags=extractHashtags,exports.extractMentionedUsers=extractMentionedUsers,exports.hashtagData2Tag=hashtagData2Tag,exports.hashtagTag2Data=hashtagTag2Data,exports.html2tag=html2tag,exports.icon2tag=icon2tag,exports.json2text=json2text,exports.link2tag=link2tag,exports.mentionData2Tag=mentionData2Tag,exports.mentionTag2Data=mentionTag2Data,exports.quot2Html=quot2Html,exports.removeAllTag=removeAllTag,exports.removeNewLine=removeNewLine,exports.removePrevNewLine=removePrevNewLine,exports.removeSpecialTag=removeSpecialTag,exports.shortContent=shortContent,exports.shortContentByLong=shortContentByLong,exports.shortContentByNewLine=shortContentByNewLine,exports.spaceTag2Tag=spaceTag2Tag,exports.splitStyle=splitStyle,exports.styleData2TagPlusTag2html=styleData2TagPlusTag2html,exports.styleTag2Data=styleTag2Data,exports.tag2html=tag2html,exports.text2highlight=text2highlight;var _Often=require("./Often"),hashtagDataRegexp=/\#\[([^\[\]\s]+)\]\(([^\[\]\s]+)\)/ig,hashtagTagRegexp=/(<span class=\"tag hashtag-span\" contenteditable=\"false\".*?>\#)([^\[\]\s]+)(<\/span>)/ig,mentionDataRegexp=/\@\[([^\[\]]+)\]\(([^\[\]]+?)\)/ig,mentionTagRegexp=/(<span class=\"tag mention-span\" user-id=\")([a-zA-Zㄱ-힣0-9_\-\/&amp;\@\.\&\^\s]+)(\" contenteditable=\"false\".*?>)([a-zA-Zㄱ-힣0-9&amp;\"\'\!\@\$\%\^\&\*\(\)\_\+\-\=\|\{\}\[\]\\\/\.\&\^\ \,\~\:\?\☆\★\s\u0080-\uFFFF]+)(<\/span>)/ig,mentionTagRegexp1=/(<span class=\"tag mention-span\" contenteditable=\"false\" user-id=\")([a-zA-Zㄱ-힣0-9_\-\/&amp;\@\.\&\^\s]+)(\".*?>)([a-zA-Zㄱ-힣0-9&amp;\"\'\!\@\$\%\^\&\*\(\)\_\+\-\=\|\{\}\[\]\\\/\.\&\^\ \,\~\:\?\☆\★\s\u0080-\uFFFF]+)(<\/span>)/ig;function checkEmptyNewLine(a){var b=tag2html(a);return b=b.replace(/&nbsp;/ig,""),""===b.trim()?"":a}function text2highlight(a,b,c){function d(a){var c=!1,d=new RegExp(a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"g");b=b.replace(d,e().replace("{key}",tag2html(a))),c=!0,c||(b=e().replace("{key}",tag2html(a)))}function e(){return"CHAT_SEARCH"===a?"<span class=\"search-highlight\">{key}</span>":"SEARCH"===a?"<strong>{key}</strong>":"SEARCH2"===a?"<b>{key}</b>":void 0}if(b=quot2Html((0,_Often.n2v)(b,"")),c=quot2Html((0,_Often.n2v)(c,"")),""===c||-1===b.indexOf(c.toUpperCase())&&-1===b.indexOf(c.toLowerCase()))return b;if(-1<c.indexOf(" "))for(var f=c.split(" "),g=0;g<f.length;g++)""!==f[g]&&d(f[g]);else d(c);return b}function br2n(a){return a?a.replace(/(<br>)/ig,"\n"):a}function tag2html(a){return a=(0,_Often.n2v)(a)+"",a.replace(/\<|\>/ig,function(a){return(0,_Often.n2v)({"<":"&lt;",">":"&gt;"}[a])})}function escapeHtml(a){return""===(0,_Often.n2v)(a,"")?"":a.replace(/[\"&<>]/g,function(b){return(0,_Often.n2v)({'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"}[b],"")})}function quot2Html(a){return a=(0,_Often.n2v)(a),a.replace(/\"/ig,"&quot;")}function html2tag(a){return a=(0,_Often.n2v)(a),a.replace(/(&lt;|&gt;|&amp;|&nbsp;|&#x2F;)/ig,function(a){return{"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" ","&#x2F;":"/"}[a]})}function hashtagData2Tag(a){return a.replace(hashtagDataRegexp,"<span class=\"tag hashtag-span\" contenteditable=\"false\">#$1</span>")}function hashtagTag2Data(a){return a.replace(hashtagTagRegexp,"#[$2]($2)")}function mentionData2Tag(a,b){return b?a.replace(mentionDataRegexp,"$1"):a.replace(mentionDataRegexp,"<span class=\"tag mention-span\" user-id=\"$2\" contenteditable=\"false\">$1</span>")}function mentionTag2Data(a){return a.replace(mentionTagRegexp,"@[$4]($2)").replace(mentionTagRegexp1,"@[$4]($2)")}function extractMentionedUsers(a){for(var b=null,c=[];b=mentionDataRegexp.exec(a),!!b;)c.push(b[2]);return c}function extractHashtags(a){for(var b=null,c=[];b=hashtagDataRegexp.exec(a),!!b;)c.push(b[1]);return c}function styleTag2Data(a){return a=splitStyle((0,_Often.n2v)(a)),a.replace(/(<b>|<b style="">|<strong>)(.*?)(<\/b>|<\/strong>)/ig,"<f_b>$2</f_b>").replace(/(<u>|<u style="">)(.*?)(<\/u>)/ig,"<f_u>$2</f_u>").replace(/(<i>|<i style="">|<em>)(.*?)(<\/i>|<\/em>)/ig,"<f_i>$2</f_i>").replace(/(<strike>|<strike style="">)(.*?)(<\/strike>)/ig,"<f_del>$2</f_del>").replace(/(<font face[^>]*>)/ig,"")}function styleData2TagPlusTag2html(a){var b={boldStart:"[[f_b]]",boldEnd:"[[/f_b]]",italicStart:"[[f_i]]",italicEnd:"[[/f_i]]",underlineStart:"[[f_u]]",underlineEnd:"[[/f_u]]",delStart:"[[f_del]]",delEnd:"[[/f_del]
458]"},c={boldStart:"<b>",boldEnd:"</b>",italicStart:"<i>",italicEnd:"</i>",underlineStart:"<u>",underlineEnd:"</u>",delStart:"<strike>",delEnd:"</strike>"};0<navigator.userAgent.indexOf("Trident")&&(c.boldStart="<strong>",c.boldEnd="</strong>",c.italicStart="<em>",c.italicEnd="</em>");var d=a.replace(/<f_b>/ig,b.boldStart).replace(/<\/f_b>/ig,b.boldEnd).replace(/<f_u>/ig,b.underlineStart).replace(/<\/f_u>/ig,b.underlineEnd).replace(/<f_i>/ig,b.italicStart).replace(/<\/f_i>/ig,b.italicEnd).replace(/<f_del>/ig,b.delStart).replace(/<\/f_del>/ig,b.delEnd);return d=tag2html(d),d.replace(/\[\[f_b\]\]/ig,c.boldStart).replace(/\[\[\/f_b\]\]/ig,c.boldEnd).replace(/\[\[f_u\]\]/ig,c.underlineStart).replace(/\[\[\/f_u\]\]/ig,c.underlineEnd).replace(/\[\[f_i\]\]/ig,c.italicStart).replace(/\[\[\/f_i\]\]/ig,c.italicEnd).replace(/\[\[f_del\]\]/ig,c.delStart).replace(/\[\[\/f_del\]\]/ig,c.delEnd)}function splitStyle(a){function b(a,b,c,d,e){var f=[];return f=a.split(b),f.forEach(function(a,b){var g=f[b];-1<g.indexOf(c)&&(-1<g.indexOf("bold")&&(d.concat("<b>"),e="</b>".concat(e)),-1<g.indexOf("underline")&&(d.concat("<u>"),e="</u>".concat(e)),-1<g.indexOf("line-through")&&(d.concat("<strike>"),e="</strike>".concat(d)),-1<g.indexOf("italic")&&(d.concat("<i>"),e="</i>".concat(e)),f[b]=d,f[b+2]=e)}),f.join("")}var c=a,d={BOLD:{STYLE:"font-weight: bold",TAG:/(<b style=".*?">)(.*?)(<\/b>)/},UNDERLINE:{STYLE:"text-decoration-line: underline",TAG:/(<u style=".*?">)(.*?)(<\/u>)/},ITALIC:{STYLE:"font-style: italic",TAG:/(<i style=".*?">)(.*?)(<\/i>)/},STRIKE:{STYLE:"text-decoration-line: line-through",TAG:/(<strike style=".*?">)(.*?)(<\/strike>)/},SPAN:{TAG:/(<span style=".*?">)(.*?)(<\/span>)/}};return-1<a.indexOf("<span style=")&&(c=b(c,d.SPAN.TAG,"<span style=","","")),-1<a.indexOf(d.BOLD.STYLE)&&(c=b(c,d.UNDERLINE.TAG,"<u style=","<u>","</u>"),c=b(c,d.ITALIC.TAG,"<i style=","<i>","</i>"),c=b(c,d.STRIKE.TAG,"<strike style=","<strike>","</strike>")),-1<a.indexOf(d.UNDERLINE.STYLE)&&(c=b(c,d.BOLD.TAG,"<b style=","<b>","</b>"),c=b(c,d.ITALIC.TAG,"<i style=","<i>","</i>"),c=b(c,d.STRIKE.TAG,"<strike style=","<strike>","</strike>")),-1<a.indexOf(d.ITALIC.STYLE)&&(c=b(c,d.BOLD.TAG,"<b style=","<b>","</b>"),c=b(c,d.UNDERLINE.TAG,"<u style=","<u>","</u>"),c=b(c,d.STRIKE.TAG,"<strike style=","<strike>","</strike>")),-1<a.indexOf(d.STRIKE.STYLE)&&(c=b(c,d.BOLD.TAG,"<b style=","<b>","</b>"),c=b(c,d.UNDERLINE.TAG,"<u style=","<u>","</u>"),c=b(c,d.ITALIC.TAG,"<i style=","<i>","</i>")),c}function removeNewLine(a){return a.replace(/(\r\n\t|\n|\r\t|"\\n")/gm," ")}function removePrevNewLine(a){return a.replace(/^\s*/,"")}function removeAllTag(a){return a.replace(/<(\/)?([a-zA-Z]*)(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/ig,"")}function removeSpecialTag(a){var b=/(<\/span>)([a-zA-Zㄱ-힣0-9\(\)\_\-\☆\★\○\●\◇\◆\□\■\△\▲\▽\▼\◁\◀\▷\▶\+@\.\=\~\^\s\[\]\#\%\!\$\&\*\<\>\?\/\'\"\:\,\{\\\}]+)(<span style=\"background-color: )(initial|transparent)(;\">)/ig,c=/(<\/span>)(<span style=\"background-color: )(initial|transparent)(;\">)/ig;return a=a.replace(/(<span style=\"background-color: )(.*?)(\">)([a-zA-Zㄱ-힣0-9\(\)\_\-\☆\★\○\●\◇\◆\□\■\△\▲\▽\▼\◁\◀\▷\▶\+@\.\=\~\^\s\[\]\#\%\!\$\&\*\<\>\?\/\'\"\:\;\,\{\\\}]+)(<\/span>)/ig,"$4").replace(/(<span style=\"white-space:pre)(.*?)(\">)([a-zA-Zㄱ-힣0-9\(\)\_\-\☆\★\○\●\◇\◆\□\■\△\▲\▽\▼\◁\◀\▷\▶\+@\.\=\~\^\s\[\]\#\%\!\$\&\*\<\>\?\/\'\"\:\;\,\{\\\}]+)(<\/span>)/ig,"$4").replace(/(<font style="vertical-align: inherit;">)|(<\/font>)/ig,"").replace(b,"$2").replace(c,"").replace(b,"$2").replace(c,"").replace(/(<div style=\"user-select: auto;\">)|(<div style=\\"user-select: auto;\\">)|(<br style=\\\"user-select: auto;\\\">)|(<br style=\"user-select: auto;\">|<p style=\"user-select: auto;\">|<p style=\\\"user-select: auto;\\\">)/ig,"").replace(/(<sub><\/sub>)|(<sup><\/sup>)|(<sub><\\\/sub>)|(<sup><\\\/sup>)/ig,"").replace(/(<a href=)(.*?\"\>)(.*?)(<\/a>)/ig,"$3").replace(/(<a class=)(.*?\"\>)(.*?)(<\/a>)/ig,"$3").replace(/(<div class="js-hidden-component hidden-component" contenteditable="false">)|(<div class="" contenteditable="">)|(<div class="edit-component" contenteditable="">)/ig,"").replace(/(<p class="js-hidden-component hidden-component" contenteditable="false">)|(<p class="" contenteditable="">)|(<p class="edit-component" contenteditable="">)/ig,""),a}
458function NewLine2Data(a){if(""===a.trim())return"";var b=a.replace(/(\n<\/div>)/ig,"</div>").replace(/((<br><\/p><p>)|(<br><\/div><div>)|(<br><\/p><div>)|(<br><\/div><p>))/ig,"\n").replace(/((<\/p><p>)|(<\/div><p>)|(<\/p><div>)|(<\/div><div>)|<br>)/ig,"\n").replace(/(<div><div>)/ig,"<div>");return b=b.replace(/(\n<div>)/ig,"\n").replace(/(<\/div>\n)/ig,"\n"),0===a.indexOf("<div>")?b=b.substring(5):0===a.indexOf("<p>")&&(b=b.substring(3)),b=b.replace(/((<p>)|(<div>))/ig,"\n").replace(/((<\/p>)|(<\/div>))/ig,""),b}function NewLine2Tag(a){var b=(0,_Often.isClientOs)().isWin,c="<div>"+a.replace(b?/(\r\n|\n)/ig:/(\r|\n)/ig,"</div><div>")+"</div>",d=c.length,e="<div></div>",f=e===c.substring(d-e.length,d);return c=f?c.substring(0,d-e.length):c,c=c.replace(/(<div><\/div>)/ig,"<div></br></div>"),c=c.replace(/(<div><b><\/div>)/ig,"<div></br></div>"),c}function data2Html(a){return a.replace(/\t/ig,"&nbsp;&nbsp;&nbsp;&nbsp;")}function LinkData2Tag(a,b){if(-1===a.indexOf("&nbsp;"))return link2tag(a,b);var c=[];return a.split("&nbsp;").forEach(function(a){c.push(link2tag(a,b))}),c.join("&nbsp;")}function link2tag(a,b){var c=/(((?:(?:(?:https?|ftp|file):\/\/|www\\.|ftp\\.)[-a-zA-Z0-9+&@#/%?=~_|$!:,.;ㄱ-ㅎㅏ-ㅣㄱ-힣()\u2700-\u27BF\uE000-\uF8FF|\uD83C|\uDC00-\uDFFF|\uD83D|\uDC00-\uDFFF|\u2011-\u26FF|\uD83E|\uDD10-\uDDFF]*[-a-zA-Z0-9+&@#/%=~_|ㄱ-ㅎㅏ-ㅣㄱ-힣$?\u2700-\u27BF\uE000-\uF8FF|\uD83C|\uDC00-\uDFFF|\uD83D|\uDC00-\uDFFF|\u2011-\u26FF|\uD83E|\uDD10-\uDDFF]|((?:mailto:)?[a-zA-Z0-9._%+-]+@[a-zA-Z0-9._%-]+\\.[a-zA-Z]{2,4})\\b)|"(?:(?:https?|ftp|file):\/\/|www\\.|ftp\\.)[^\\"\\r\\n]+\\"?|\\'(?:(?:https?|ftp|file):\/\/|www\\.|ftp\\.)[^'\\r\\n]+'?|(http(s)?:\/\/.)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.(aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mn|mn|mo|mp|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|nom|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ra|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw|arpa)\\b([-a-zA-Z0-9@:%_+.~#?&/=]*))|((www\.)[0-9a-zA-z_\-?=%/.&#;()ㄱ-ㅎㅏ-ㅣㄱ-힣?]*[-a-zA-Z0-9+&@#/%=~_|ㄱ-ㅎㅏ-ㅣㄱ-힣$?\u2700-\u27BF\uE000-\uF8FF|\uD83C|\uDC00-\uDFFF|\uD83D|\uDC00-\uDFFF|\u2011-\u26FF|\uD83E|\uDD10-\uDDFF]+))/ig;return b?a.replace(c,"<span class=\"js-hyper-button urllink blue\">$&</span>"):a.replace(c,"<a href=\"$&\" target=\"_blank\" class=\"js-hyper-button urllink blue\">$&</a>")}function shortContentByNewLine(a,b){var c="",d=a.split("\n"),e=0;return d.forEach(function(a){var d=a.trim();""!==d&&e<2&&(e++,c+=shortContent(d,b)+(1===e?"\n":""))}),c}function shortContent(a,b){return a.length<=b?a:a.substring(0,b)+"..."}function shortContentByLong(a){var b=a.split("\n");return 15>b.length?a:299<a.length?a.substring(0,300):b.slice(0,15).join("\n")}function json2text(a){var b=a;if(-1===a.indexOf("{\"COMPS\":")&&-1===a.indexOf("{\"SYS_CODE\":"))return b;var c=jsonContents2text(a,!0);if(""!==c)return c;try{b=b.replace("\n"," ");var d=JSON.parse(b).SYS_CODE,e="[ICON:IMAGE] ("+i18next.t(dictionary.image)+")",f="[ICON:FILE] ("+i18next.t(dictionary.file)+")";b={S13:e,S14:f,S20:e+" "+f}[d]}catch(a){Mutil.mlog(a)}return b}function jsonContents2text(a,b){try{var c="",d=JSON.parse(a).COMPS;return d.forEach(function(a){"TEXT"===a.COMP_TYPE&&(c+=a.COMP_DETAIL.CONTENTS+"\n")}),c}catch(c){return b?"":a}}function icon2tag(a){var b=a,c={FILE:"<i class=\"all-setup-icon-type-1\"/>",IMAGE:"<i class=\"all-setup-icon-type-2\"/>"};return b=b.replace(/\[ICON:IMAGE\]/ig,c.IMAGE),b=b.replace(/\[ICON:FILE\]/ig,c.FILE),b}function blank2SpaceTag(a){return a.replace(/ /gi," &nbsp;")}function spaceTag2Tag(a){return a.replace(/ &nbsp;/gi,"&nbsp;")}
459
460},{"./Often":146}],154:[function(require,module,exports){
461"use strict";var _Often=require("./Often.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.convertDiv2Newline=convertDiv2Newline,exports.convertHtmlCode=convertHtmlCode,exports.convertOnCopy=convertOnCopy,exports.convertOnRead=convertOnRead,exports.convertOnSave=convertOnSave,exports.convertProductMentionServerTag=convertProductMentionServerTag,exports.formatPhoneNumber=formatPhoneNumber,exports.removeMentionTag=removeMentionTag,exports.removeServerTag=removeServerTag,exports.removeUrlTag=removeUrlTag;function _wrapRegExp(){function a(b,c,e){var f=RegExp(b,c);return d.set(f,e||d.get(b)),_setPrototypeOf(f,a.prototype)}function b(a,b){var c=d.get(b);return Object.keys(c).reduce(function(b,d){var e=c[d];if("number"==typeof e)b[d]=a[e];else{for(var f=0;void 0===a[e[f]]&&f+1<e.length;)f++;b[d]=a[e[f]]}return b},Object.create(null))}
461_wrapRegExp=function(b,c){return new a(b,void 0,c)};var c=RegExp.prototype,d=new WeakMap;return _inherits(a,RegExp),a.prototype.exec=function(a){var d=c.exec.call(this,a);if(d){d.groups=b(d,this);var e=d.indices;e&&(e.groups=b(e,this))}return d},a.prototype[Symbol.replace]=function(a,f){if("string"==typeof f){var g=d.get(this);return c[Symbol.replace].call(this,a,f.replace(/\$<([^>]+)(>|$)/g,function(a,b,c){if(""===c)return a;var d=g[b];return Array.isArray(d)?"$"+d.join("$"):"number"==typeof d?"$"+d:""}))}if("function"==typeof f){var h=this;return c[Symbol.replace].call(this,a,function(){var a=arguments;return"object"!=_typeof(a[a.length-1])&&(a=[].slice.call(a)).push(b(a,h)),f.apply(this,a)})}return c[Symbol.replace].call(this,a,f)},_wrapRegExp.apply(this,arguments)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}var STYLE_SERVER_TAG_NAME=["f_b","f_i","f_u","f_del"];function convertOnCopy(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return(0,_Often.pipe)(customTrim,rn2n,html2tag)(a)}function convertOnSave(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"POST";return"POST"===b?(0,_Often.pipe)(convertHashServerTag,convertProductMentionServerTag,convertMentionServerTag,removeUrlTag,TagUtil.splitStyle,convertStyleServerTag,styleServerTag2TempTag,convertDiv2Newline,styleTempTag2ServerTag,removeStyleClassTag,removeCloseTag,html2tag)(a):"REMARK"===b?(0,_Often.pipe)(convertProductMentionServerTag,convertMentionServerTag,removeUrlTag,convertDiv2Newline,removeStyleClassTag,removeCloseTag,html2tag)(a):"CHAT"===b?(0,_Often.pipe)(removeUrlTag,convertDiv2Newline,customTrim,removeStyleClassTag,removeCloseTag,html2tag)(a):"CHAT_ELEMENTS"===b?(0,_Often.pipe)(convertElementsTag,removeUrlTag,convertDiv2Newline,customTrim,removeStyleClassTag,removeCloseTag,html2tag)(a):(console.warn("No Case",a),(0,_Often.pipe)(removeStyleClassTag,removeCloseTag,html2tag)(a))}function convertOnRead(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return(0,_Often.pipe)(styleServerTag2TempTag,tag2html,removeStyleClassTag,removeCloseTag,styleTempTag2ServerTag)(a)}function removeUrlTag(a){return a.replace(/(?:(?:<span|<a)(?:[^>]*?) class="js-hyper-button urllink blue(?:.*?)">(.*?)<\/(?:span>|a>))/ig,"$1")}function removeMentionTag(a){var b=_wrapRegExp(/(?:<span class="tag mention-span.*?(?=user-id)user-id="([^"]+)"[^>]*>([^\[\]<>]+)<\/span>)/ig,{id:1,name:2});return a.replace(b,"$2")}function convertHtmlCode(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return html2tag(a)}function removeServerTag(a){return a.replace(/(<(\/?)((f_b)|(f_del)|(f_u)|(f_i))>)/ig,"")}function convertProductMentionServerTag(a){var b=_wrapRegExp(/(?:<span class="tag mention-span js-mention-product.*?(?=data-linked-product-code)data-linked-product-code="([^"]+)".*?(?=data-product-name)data-product-name="([^"]+)".*?(?=data-linked-type)data-linked-type="([^"]+)".*?(?=data-linked-domain)data-linked-domain="([^"]+)".*?(?=data-user-id)data-user-id="([^"]+)"[^>]*>[^<>]+<\/span>)/ig,{code:1,name:2,linkedtype:3,domain:4,userId:5});return a.replace(b,"$%^[$1][$3][$4][$5]($2)")}function convertMentionServerTag(a){var b=_wrapRegExp(/(?:<span class="tag mention-span.*?(?=user-id)user-id="([^"]+)"[^>]*>([^\[\]<>]+)<\/span>)/ig,{id:1,name:2});return a.replace(b,"@[$2]($1)")}function convertHashServerTag(a){return a.replace(/(?:<span class="tag hashtag-span(.*?)(?=">#)">#([^\[\]<>]+)<\/span>)/ig,"#[$2]($2)")}function convertElementsTag(a){var b=_wrapRegExp(/(?:<span class="tag mention-span.*?"[^>]*>([^\[\]<>]+)<\/span>)/ig,{name:1});return a.replace(b,"$1")}function convertStyleServerTag(a){return a.replace(/(<b>|<b ([^<>]*?)>)(.*?)(<\/b>)|(<strong>|<strong ([^<>]*?)>)(.*?)(<\/strong>)/ig,"<f_b>$3</f_b>").replace(/(<i>|<i ([^<>]*?)>)(.*?)(<\/i>)|(<em>|<em ([^<>]*?)>)(.*?)(<\/em>)/ig,"<f_i>$3</f_i>").replace(/(<u>|<u ([^<>]*?)>)(.*?)(<\/u>)/ig,"<f_u>$3</f_u>").replace(/(<strike>|<strike ([^<>]*?)>)(.*?)(<\/strike>)/ig,"<f_del>$3</f_del>")}function convertDiv2Newline(a){function b(a){j(a).childNodes.forEac
461h(function(a){if(0===a.childNodes.length)return void k(i(a),a,"first text");if(1===a.childNodes.length){var c=a.childNodes[0];return d(a)?void k(i(c),c,"childNode"):g(a)?void k(a.outerHTML,a,"style"):void k(a.innerText,a,"etc")}return 3<=a.childNodes.length&&d(a)&&e(a)?void k("\n",a,"style"):(d(a)&&h(a),b(a.innerHTML))})}var c=(0,_Often.isServerOn)("REAL"),d=function(a){return["DIV","P"].includes(a.nodeName)},e=function(a){var b,c=a.innerHTML;return 0<(null===(b=c.match(/\[\[(f_b|f_i|f_u|f_del)]](<br>)\[\[\/(f_b|f_i|f_u|f_del)]]/ig))||void 0===b?void 0:b.length)},f=function(a){return"BR".includes(a.nodeName)},g=function(a){return STYLE_SERVER_TAG_NAME.includes(a.nodeName.toLowerCase())},h=function(a){var b=a.childNodes[a.childNodes.length-1];f(b)&&a.removeChild(b)},i=function(a){var b,c=tag2html(a.textContent),d=0<(null===(b=c.match(/(\r\n|\r|\n)$/))||void 0===b?void 0:b.length),e={"#text":c+(d?"":"\n"),BR:"\n"}[a.nodeName];return void 0===e?(console.warn("error singleNode2html!"),""===c?"":c+(d?"":"\n")):e},j=function(a){var b=document.createElement("div");return b.innerHTML=a,b},k=function(a,b,c){Mutil.clog("pushData",{txt:a,node:b,flag:c}),l.push(a)},l=[],m=j(a),n=1===m.childNodes.length,o=n&&0===m.childNodes[0].childNodes.length;return o?k(a,"","only text one"):b(a),Mutil.clog("resultData",l),l.join("")}function html2tag(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return a.replace(/(&lt;|&gt;|&amp;|&nbsp;|&#x2F;|&#91;|&#93;)/ig,function(a){return{"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" ","&#x2F;":"/","&#91;":"[","&#93;":"]"}[a]})}function customTrim(a){return a.replace(/(^(\s|\n)*)|((\s|\n)*$)/g,"")}function removeAllTag(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return a.replace(/<(\/)?([a-zA-Z]*)(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/ig,"")}function removeStyleClassTag(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return a.replace(/<([a-zA-Z]*)(\s(style|class)=[^>]*)(\s)*(\/)?>/ig,"")}function removeCloseTag(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return a.replace(/<(\/)([a-zA-Z]*)>/ig,"")}function tag2html(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return"SEM_1"==_USE_INTT_ID?a.replace(/[<>&]/ig,function(a){return{"<":"&lt;",">":"&gt;","&":"&"}[a]}):a.replace(/[<>&]/ig,function(a){return{"<":"&lt;",">":"&gt;","&":"&amp;"}[a]})}function styleServerTag2TempTag(a){return a.replace(/(<(\/?)((f_b)|(f_del)|(f_u)|(f_i))>)/ig,"[[$2$3]]")}function styleTempTag2ServerTag(a){return a.replace(/(\[\[(\/?)(f_b|f_del|f_u|f_i)]])/ig,"<$2$3>")}function rn2n(a){return a=a.split("").map(function(a){return 8232===a.charCodeAt(0)?"\n":a}).join(""),a.replace(/(\r\n|\r|\n)/g,"\n")}function formatPhoneNumber(a){var b=a.replace(/\D/g,"");return b.startsWith("02")?b.replace(/(\d{2})(\d{3,4})(\d{4})/,"$1-$2-$3"):b.replace(/(\d{3})(\d{3,4})(\d{4})/,"$1-$2-$3")}
462
463},{"./Often.js":146}],155:[function(require,module,exports){
464"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toast=toast;var workingTimer,$toast=function(){return $("#toast")};function toast(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"info",b=1<arguments.length?arguments[1]:void 0;setToastStyle(),$toast().remove(),$("body").prepend($(getToastHtml({type:a,message:b}))),$toast().fadeIn(200),workingTimer&&clearTimeout(workingTimer),workingTimer=setTimeout(function(){$toast().fadeOut(200,function(){return $toast().remove()})},2500)}function getToastHtml(a){var b=a.type,c=a.message;return"\n        <div id=\"toast\" class=\"alert-wrap\">\n            <div class=\"alert-type ".concat(b,"\">\n                <div class=\"text\">").concat(c,"</div>\n            </div>\n        </div>\n    ")}function setToastStyle(){0<$("#toastStyle").length||$("head").append("\n        <style id=\"toastStyle\">\n        .alert-wrap {\n          display: none;\n          z-index: 9999;\n          top: 140px;\n          left: 50%;\n          -webkit-transform: translateX(-50%);\n          -ms-transform: translateX(-50%);\n          transform: translateX(-50%);\n          position: fixed;\n          width: max-content;            /* left:50% \uAE30\uC900 shrink-to-fit \uC73C\uB85C \uD3ED\uC774 \uBC18\uD1A0\uB9C9\uB098\uB294 \uAC83 \uBC29\uC9C0 */\n          max-width: calc(100vw - 40px); /* \uC881\uC740 \uD654\uBA74(\uBAA8\uBC14\uC77C)\uC5D0\uC11C \uD1A0\uC2A4\uD2B8\uAC00 \uBDF0\uD3EC\uD2B8 \uBC16\uC73C\uB85C \uB098\uAC00\uC9C0 \uC54A\uAC8C */\n        }\n        .alert-wrap .text {\n          white-space: pre-wrap; /* pre \uB294 \uD55C \uC904 \uACE0\uC815\uC774\uB77C \uAE34 \uBB38\uAD6C\uAC00 \uC881\uC740 \uD3ED\uC5D0\uC11C \uC9E4\uB9BC \u2014 \uC758\uB3C4\uB41C \n \uC740 \uC720\uC9C0\uD558\uBA70 \uC904\uBC14\uAFC8 \uD5C8\uC6A9 */\n          word-break: keep-all;\n        }\n        .alert-type {\n          border-radius: 50px;\n          padding: 9px 17px;\n          text-align: center;\n          font-size: 13px;\n          z-index: 13;\n          -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n        }\n        body[data-enter-id=\"KSFC_1\"] .alert-type.success,\n        body[data-enter-id=\"KSFC_1\"] .alert-type.info{\n          background: #284E96;\n          border: 1px solid #284E96;\n          color: #fff;\n        }\n        .alert-type.success {\n          background: #6449fc;\n          border: 1px solid #6449fc;\n          color: #fff;\n        }\n        .alert-type.info {\n          background: #623ad6;\n          border: 1px solid #623ad6;\n          color: #fff;\n        }\n        .alert-type.error {\n          background: #ff3434;\n          border: 1px solid #ff3434;\n          color: #fff;\n        }\n        .alert-wrap.mini .alert-type {\n          font-size: 13px;\n        }\n        </style>")}
465
466},{}],156:[function(require,module,exports){
467"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.putFile=putFile,exports.putImageFile=putImageFile,exports.sendFile=sendFile,exports.uploadOneFile=exports.uploadImageByFile=exports.uploadImage=void 0;var _File=require("./File"),_Toast=require("./Toast"),_Often=require("./Often"),_Json=require("./Json"),uploadOneFile=exports.uploadOneFile=function(a){var b=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1],c=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2];return new Promise(function(d){var e=b?$("<input type=\"file\" accept=\"image/*\" capture hidden>"):c?$("<input type=\"file\" accept=\"image/*\" hidden>"):$("<input type=\"file\" hidden>"),f=function(){return e.remove()};
467e.on("change",function(b){var e=$(b.target).val(),g=(0,_File.getFileInfo)(e),h=g.extension,i=(b.srcElement||b.target).files,j=i[0];if(!!a&&a<j.size)return(0,_Toast.toast)("error","\uD30C\uC77C\uC740 10MB\uC774\uD558\uB9CC \uCCA8\uBD80\uAC00\uB2A5\uD569\uB2C8\uB2E4.");var k=(0,_File.isImageExtension)(h);return c&&!k?void d({error:"\uC774\uBBF8\uC9C0\uB9CC \uC5C5\uB85C\uB4DC \uAC00\uB2A5\uD569\uB2C8\uB2E4."}):void(!0===k?putImageFile(j).subscribe(function(a){sendFile(a,d)}):putFile(j,d),f())}),$("body").append(e),e.trigger("click")})};function putFile(a,b){var c=(0,_File.json2formData)({USER_ID:window._USER_ID,RGSN_DTTM:window._RGSN_DTTM,NOW:new Date().getTime(),FILE:a,FILE_NAME:a.name});sendFile(c,b)}var uploadImageByFile=exports.uploadImageByFile=function(a){return new Promise(function(b){putImageFile(a).subscribe(function(a){sendFile(a,b)})})},uploadImage=exports.uploadImage=function(){return new Promise(function(a){var b=$("\n        <input type=\"file\"  accept=\"image/*\" hidden>"),c=function(){return b.remove()};b.on("change",function(b){var d=$(b.target).val(),e=(0,_File.getFileInfo)(d),f=e.extension;if(!1===(0,_File.isImageExtension)(f))return void(0,_Toast.toast)("error","Not Image!");var g=(b.srcElement||b.target).files,h=g[0];putImageFile(h).subscribe(function(b){sendFile(b,a)}),c()}),$("body").append(b),b.trigger("click")})};function putImageFile(a){return Rx.Observable.create(function(b){var c=new FileReader,d=new Image;c.onload=function(){d.onload=function(){var c=(0,_File.json2formData)({USER_ID:window._USER_ID,RGSN_DTTM:window._RGSN_DTTM,NOW:new Date().getTime(),FILE:a,WIDTH:(0,_Often.n2v)(d.width),HEIGHT:(0,_Often.n2v)(d.height),FILE_NAME:a.name});b.next(c)},d.src=c.result},c.readAsDataURL(a)})}function sendFile(a,b){var c=new XMLHttpRequest;c.upload.addEventListener("loadstart",function(){return Mutil.clog("onLoadStart")},!1),c.upload.addEventListener("progress",function(){return Mutil.clog("onProgress")},!1),c.upload.addEventListener("abort",function(){return Mutil.clog("onAbort")},!1),c.upload.addEventListener("error",function(){return Mutil.clog("onError")},!1),c.onreadystatechange=function(a){var c=(0,_Json.parse)(a.target.responseText);if(0!==Object.keys(c).length){var d=c.COMMON_HEAD,e=c.FILE_REC;return d.error||!e||0===e.length?(null!==d&&void 0!==d&&d.ERROR&&null!==d&&void 0!==d&&d.MESSAGE&&(0,_Toast.toast)("error",d.MESSAGE),void b({})):void b(e[0])}},c.open("POST","/FLOW_UPLOAD_C001.jct",!0),c.send(a)}
468
469},{"./File":140,"./Json":142,"./Often":146,"./Toast":155}],157:[function(require,module,exports){
470"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Validate=void 0;var _Toast=require("./Toast"),_Often=require("./Often");function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d.return&&(k=d.return(),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}var Validate=exports.Validate=function(){function a(a,c){var d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",e=3<arguments.length?arguments[3]:void 0,f=4<arguments.length?arguments[4]:void 0,g="";return!(d instanceof Array||(d=((0,_Often.n2v)(d)+"").trim()),d.length<+f?g=b(c,f)[a][1===f?"require":"min"]:d.length>+e&&(g=b(c,e)[a].max),""!==g)||((0,_Toast.toast)("error",g),!1)}var b=function(a,b){isFinalTreatment(a)?"\uC740":"\uB294";return{digits:{max:i18next.t(okr.maximumLetterWrite,{val:a,count:b}),min:i18next.t(okr.minimumLetterNecessity,{val:a,count:b}),require:i18next.t(okr.essentialValue,{val:a})},count:{max:i18next.t(okr.maximumCaseWrite,{val:a,count:b}),min:i18next.t(okr.minimumCaseNecessity,{val:a,count:b}),require:i18next.t(okr.essentialValue,{val:a})}}};return{digits:function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",d=2<arguments.length?arguments[2]:void 0,e=3<arguments.length?arguments[3]:void 0;return c=((0,_Often.n2v)(c)+"").trim(),a("digits",b,c,d,e)},count:function(b){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],d=2<arguments.length?arguments[2]:void 0,e=3<arguments.length?arguments[3]:void 0;return a("count",b,c,d,e)},isValidDate:function(a){var b=Mutil.n2v(a,"").match(/\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])/);if(!b)return(!1);var c=b[0].split("-"),d=_slicedToArray(c,3),e=d[0],f=d[1],g=d[2],h=new Date(e,f-1,g);return h.getFullYear()===e&&h.getMonth()+1===f&&h.getDate()===g}}}();function isFinalTreatment(a){var b=(a+"").length;a=(a+"").substring(b-1,b);
470var c=(a.charCodeAt(0)-parseInt("0xac00",16))%28;return 0!=+c}
471
472},{"./Often":146,"./Toast":155}],158:[function(require,module,exports){
473"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViewController=void 0;var _Often=require("./Often"),_Json=require("./Json");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to de
473structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d.return&&(k=d.return(),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var views={},callbacks={},ViewController=exports.ViewController=function(){function a(a,b,c){var d=c.isChangeable,e=void 0===d?_Often.noop:d,f=c.prevShow,g=void 0===f?_Often.noop:f,h=c.nextShow,i=void 0===h?_Often.noop:h;views[a]=b,callbacks[a]={isChangeable:e,prevShow:g,nextShow:i}}function b(a,b){return c.apply(this,arguments)}function c(){return c=_asyncToGenerator(_regenerator().m(function c(a,b){var d,e,f,g,h=arguments;return _regenerator().w(function(c){for(;1;)switch(c.n){case 0:return d=2<h.length&&void 0!==h[2]?h[2]:{},c.n=1,callbacks[a].prevShow(b);case 1:for(e in views)views[e].forEach(function(a){return a.hide()});if(views[a].forEach(function(a){return a.show()}),callbacks[a].nextShow(b),!d.back){c.n=2;break}return c.a(2);case 2:f=(0,_Json.encrypt)(b),g=b&&0!==Object.keys(b).length?"=".concat(f):"",history.pushState({page:a},a,"".concat(location.origin,"/okr.act?").concat(a).concat(g));case 3:return c.a(2)}},c)})),c.apply(this,arguments)}function d(){return location.search.slice(1).split("&").map(function(a){return a.split("=")}).reduce(function(a,b){var c=_slicedToArray(b,2),d=c[0],e=c[1];return _objectSpread(_objectSpread({},a),{},{code:d,json:(0,_Json.decrypt)(e)})},{})}return{addRouter:a,changeView:b,getCurrentCode:d}}();
474
475},{"./Json":142,"./Often":146}],159:[function(require,module,exports){
476"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.open=open,exports.openParent=openParent;function open(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"";window.open(a,b,c)}function openParent(a,b){var c;null!==(c=window)&&void 0!==c&&c.opener?(window.opener.location.href=a,window.opener.focus()):open(a,b)}
477
478},{}],160:[function(require,module,exports){
479"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.updateAlarm=exports.openAlarmWidget=exports.flashAlarmWidget=void 0;var _comm=require("./comm"),openAlarmWidget=exports.openAlarmWidget=function(a){(0,_comm.runElectronFunc)("ElectronAlarmWidgetApi","openAlarmWidget",a)},updateAlarm=exports.updateAlarm=function(a){(0,_comm.runElectronFunc)("ElectronAlarmWidgetApi","updateAlarm",a)},flashAlarmWidget=exports.flashAlarmWidget=function(a){(0,_comm.runElectronFunc)("ElectronAlarmWidgetApi","flashAlarmWidget",a)};
480
481},{"./comm":163}],161:[function(require,module,exports){
482"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateCropWindow=void 0;var _comm=require("./comm"),generateCropWindow=exports.generateCropWindow=function(a){(0,_comm.runElectronFunc)("ElectronCaptureApi","generateCropWindow",a)};
483
484},{"./comm":163}],162:[function(require,module,exports){
485"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setOpacityOnChat=exports.openChatDirect=exports.open=void 0;var _comm=require("./comm"),open=exports.open=function(a){(0,_comm.runElectronFunc)("ElectronChatApi","open",a)},setOpacityOnChat=exports.setOpacityOnChat=function(a){(0,_comm.runElectronFunc)("ElectronChatApi","setOpacityOnChat",a)},openChatDirect=exports.openChatDirect=function(a){(0,_comm.runElectronFunc)("ElectronChatApi","openChatDirect",a)};
486
487},{"./comm":163}],163:[function(require,module,exports){
488"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.showVersionLimit=exports.setElectronGlobalVariable=exports.setConfig=exports.setAjaxErrorToElectron=exports.runElectronFunc=exports.reload=exports.relaunchApp=exports.isTimePassedThreshold=exports.isShiftCtrlAltEvent=exports.isElectronAvailable=exports.isElectronApp=exports.isElectron=exports.init=exports.getVersion=exports.getName=exports.getConfigs=exports.getConfig=exports.electronImprovedVersionCheck=exports.checkSpecialUpdateManually=void 0;var _Often=require("../Often"),_LocalStorage=require("../LocalStorage"),_Toast=require("../Toast"),_download=require("./download");function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
488:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var isElectronApp=exports.isElectronApp=function a(){return"Y"===(0,_Often.n2v)((0,_LocalStorage.getLocalValue)("ONLY_ELECTRON_YN"),"N")},init=exports.init=function b(a){function c(){Often.isMessenger()&&!Often.isChatIntegratedMode()||ElectronApi.Window.setMenuVisibleValue({logoutMenuVisible:a,lockMenuVisible:a&&"Y"!==(0,_Often.getCookie)("googleLoginYn")&&-1===_USE_INTT_ID.indexOf("KAKAO")&&-1===_USE_INTT_ID.indexOf("APPLE")&&-1===_USE_INTT_ID.indexOf("GMAIL"),windowModeVisible:a,serverMenuVisible:ServerChecker.isMadras||Often.isServerModeByHost("DEV_TEST"),alphaDownloadVisible:Often.isFunc("ELECTRON_ALPHA_VERSION_OPEN")})}function d(){(ServerChecker.isSeco||ServerChecker.isZoomok)&&$("body").off("mouseenter mouseleave mousedown keypress").on("mouseenter mouseleave mousedown keypress",function(){MiniLock.setLockState(!0)})}function e(){var a=Often.isFunc("WRITE_ELECTRON_SESSION_ERROR_LOG");ElectronApi.Comm.setConfig({key:"USER_ID",value:_USER_ID}),ElectronApi.Comm.setConfig({key:"_USE_INTT_ID",value:_USE_INTT_ID}),ElectronApi.Comm.setConfig({key:"writeSessionErrLog",value:a})}isElectronAvailable()&&(Often.isFunc("DESKTOP_AUTO_UPDATE")&&(0,_download.autoUpdate)({isSilentUpdate:!0}),c(),e())},setConfig=exports.setConfig=function b(a){try{window.ElectronProcessApi?runElectronFunc("ElectronProcessApi","setConfig",a):fn_setOneConfigForElectron(a.key,a.value)}catch(a){Mutil.mlog("setConfig","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4!")}},getName=exports.getName=function a(){try{return window.ElectronProcessApi?runElectronFunc("ElectronProcessApi","getName"):fn_ElectronNameCheck()}catch(a){Mutil.mlog("getName","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4!")}},getConfig=exports.getConfig=function b(a){return runElectronFunc("ElectronProcessApi","getConfig",a)},getConfigs=exports.getConfigs=function a(){if(window.ElectronProcessApi)return runElectronFunc("ElectronProcessApi","getConfigs");try{return fn_getConfigsForElectron()}catch(a){return Mutil.mlog("getConfigs","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4!"),{b_fullmode:!1}}},getVersion=exports.getVersion=function a(){return window.ElectronProcessApi?ElectronProcessApi.getVersion():fn_ElectronVersionCheck()},isElectron=exports.isElectron=function a(){return"Y"===(0,_Often.n2v)((0,_LocalStorage.getLocalValue)("ONLY_ELECTRON_YN","N"))},reload=exports.reload=function a(){var b=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0];return runElectronFunc("ElectronWindowApi","reload",{isClearCache:b})},relaunchApp=exports.relaunchApp=function a(){return runElectronFunc("ElectronProcessApi","relaunchApp")},isElectronAvailable=exports.isElectronAvailable=function a(){try{var b=(0,_Often.n2v)(getVersion(),"");return setAppDataElectron(b&&""!==b?"Y":"N",b),!0}
488catch(a){return setAppDataElectron("N",""),!1}},setAppDataElectron=function c(a,b){b&&""!==b?((0,_Often.setCookie)("electronVer",b),(0,_LocalStorage.setLocal)("ONLY_ELECTRON_VER",b)):(0,_LocalStorage.removeLocal)("ONLY_ELECTRON_VER"),LocalUtil.setLocal("ONLY_ELECTRON_YN",a),(0,_Often.setCookie)("electronYn",a)},runElectronFunc=exports.runElectronFunc=function d(a,b,c){try{var e,f=null===(e=window[a])||void 0===e?void 0:e[b];return void 0===f&&Mutil.mlog("runElectronFunc error ::::  ".concat(a,".").concat(b," is undefined")),f(c)}catch(c){return Mutil.mlog(c),Mutil.mlog("runElectronFunc error ::::  ".concat(a,".").concat(b," is undefined")),(0,_Toast.toast)("error",i18next.t(main.alert.errorTryAgain)),!1}},showVersionLimit=exports.showVersionLimit=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=0<d.length&&void 0!==d[0]?d[0]:{},a.n=1,getName();case 1:c=a.v,Often.isFunc(Func.CLOUD.STOP_FLOWNEW)&&-1<c.indexOf("new")?(0,_download.checkFlowNewVersion)():Often.isFunc(Func.CLOUD.DESKTOP_UPDATE_POPUP)&&(0,_download.checkFlowVersion)().then(function(){if(Often.isFunc("ELECTRON_ALPHA_VERSION_OPEN")){var a=b.isInit,c=void 0!==a&&a;c||ElectronApi.Comm.checkSpecialUpdateManually()}});case 2:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),checkSpecialUpdateManually=exports.checkSpecialUpdateManually=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},c=b.key,d=void 0===c?"ELECTRON_CUSTOM_VER_UPDATE":c,e=b.showPopupDialog,f=void 0!==e&&e,g=_objectSpread({updateChannel:getUpdateChannel(d)},b);setTimeout(function(){(0,_download.checkForUpdateManually)(g)},500)},getUpdateChannel=function b(a){var c=getCustomFunKeyValue({key:a});return""===c?Often.isFunc("ELECTRON_ALPHA_VERSION_OPEN")?"alpha":"":c},getCustomFunKeyValue=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},c=b.key,d=void 0===c?"ELECTRON_CUSTOM_VER_UPDATE":c,e=LocalUtil.getLocal("ONLY_FUNC_LIST");if(!e)return"";var f=JSON.parse(e),g=[];for(var h in f)if(h.startsWith(d)){var i=h.split(":::")[1];return i.toLowerCase()}return""},setAjaxErrorToElectron=exports.setAjaxErrorToElectron=function a(){var b,c=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},d=c.e,e=c.apiKey,f=c.roomSrno,g=c.url,h=!getConfig("b_fullMode");b=f?"POPUP_CHAT_".concat(f):h?g.includes("miniMain")?"main":"project":g.includes("main")?"main":"",b||Mutil.clog("\uD574\uB2F9 \uC5C6\uB294 \uC9C0\uC5ED");var i={appendKey:b,appendValue:e};setElectronGlobalVariable({key:"pendingApiMap",mode:"appendData",data:i})},setElectronGlobalVariable=exports.setElectronGlobalVariable=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},c=b.key,d=b.data,e=b.mode;window.ElectronProcessApi&&window.ElectronProcessApi.setElectronGlobalVar(b)},isTimePassedThreshold=exports.isTimePassedThreshold=function a(){var b=localStorage.getItem("versionCheckedTime")||"",c=dayjs().format("YYYYMMDDHHmmss"),d=5;return!(b&&!(dayjs().diff(dayjs(b,"YYYYMMDDHHmmss"),"minute")>d))&&(localStorage.setItem("versionCheckedTime",c),!0)},electronImprovedVersionCheck=exports.electronImprovedVersionCheck=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},c=b.$eTarget,d=void 0===c?"":c,e=Often.isFunc("ELECTRON_IMPROVED_VERSION_CHECK"),f=Often.isFunc("SECURE_CONNECT")||"secure.flow.team"===window.location.hostname,g=ServerChecker.isEnter;if(e&&!f&&!g&&d){var h=0===d.closest("#leftBottomUl").length;!f&&!g&&e&&h&&isTimePassedThreshold()&&(0,_download.checkFlowVersion)().then(function(){var a=Often.isFunc("ELECTRON_ALPHA_VERSION_OPEN");a&&ElectronApi.Comm.checkSpecialUpdateManually()})}},isShiftCtrlAltEvent=exports.isShiftCtrlAltEvent=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return!!(b.shiftKey||b.altKey||b.ctrlKey)};
489
490},{"../LocalStorage":145,"../Often":146,"../Toast":155,"./download":165}],164:[function(require,module,exports){
491"use strict";var _comm=require("./comm");Object.defineProperty(exports,"__esModule",{value:!0}),exports.refreshMacAddress=void 0;function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
491q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var refreshMacAddress=exports.refreshMacAddress=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(a.p=0,window.ElectronDeviceApi){a.n=1;break}return a.a(2,null);case 1:return a.n=2,(0,_comm.runElectronFunc)("ElectronDeviceApi","refreshMacAddress");case 2:return a.a(2,a.v);case 3:return a.p=3,b=a.v,a.a(2,null)}},a,null,[[0,3]])}));return function b(){return a.apply(this,arguments)}}();
492
493},{"./comm":163}],165:[function(require,module,exports){
494"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.selectDownloadPath=exports.multiFileDownloads=exports.getPckNm=exports.download=exports.checkForUpdateManually=exports.checkFlowVersion=exports.checkFlowNewVersion=exports.autoUpdate=void 0,exports.userOsCheck=userOsCheck;var _comm=require("./comm"),_window=require("./window"),_Often=require("../Often"),_index=require("../../components/popup-queue/index.js");function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;
494return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}var download=exports.download=function b(a){window.ElectronDownloadApi?(0,_comm.runElectronFunc)("ElectronDownloadApi","fileDownload",a):fn_fileDownloadForElectron(a.url,"_blank")},multiFileDownloads=exports.multiFileDownloads=function b(a){window.ElectronDownloadApi?(0,_comm.runElectronFunc)("ElectronDownloadApi","multiFileDownloads",a):fn_fileDownloadForElectron(a.url,"_blank")},selectDownloadPath=exports.selectDownloadPath=function b(a){window.ElectronDownloadApi&&(0,_comm.runElectronFunc)("ElectronDownloadApi","selectDownloadPath",a)},autoUpdate=exports.autoUpdate=function b(a){window.ElectronDownloadApi?(0,_comm.runElectronFunc)("ElectronDownloadApi","autoUpdate",a):autoUpdateOnForElectron()},checkFlowNewVersion=exports.checkFlowNewVersion=function a(){Company.drawServiceBlock(BLOCK_TYPE.STOP_FLOWNEW,function(){DownloadApp.desktopDownloadDirect(),window.close()},""),$("#tempPopup").addClass("serviceStop")},checkFlowVersion=exports.checkFlowVersion=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i,j;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return c=getPckNm(),d=userOsCheck(),e={PCK_NM:c,GB:d},a.n=1,Ajax.executeApi("FLOW_UPDATE_R001",e);case 1:if(f=a.v,g=null===(b=f.flow_rec)||void 0===b?void 0:b[0],g){a.n=2;break}return a.a(2);case 2:return h=g.MINI_VER,i=g.SELECT_VER,j=g.LINK_URL,a.n=3,checkVersionAndMakePopup({userOs:d,miniVer:h,selectVer:i,linkUrl:j});case 3:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),LINE_REQUIREMENTS={3:{label:"Electron 43 \uB77C\uC778 (x64 \uC804\uC6A9, Win10 1809+/macOS 12+)",winFloorMajor:7,macFloorMajor:12,bitness:"64"}},canRunTargetVersion=function(){var a=_asyncToGenerator(_regenerator().m(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n;return _regenerator().w(function(b){for(;1;)switch(b.p=b.n){case 0:if(c=parseInt((a+"").trim().split(".")[0],10),!isNaN(c)){b.n=1;break}return console.warn("[popup-gate] target=".concat((a+"").trim()," \uBC84\uC804 \uD30C\uC2F1 \uBD88\uAC00 - \uD31D\uC5C5 \uC5B5\uC81C")),b.a(2,!1);case 1:if(!(2>=c)){b.n=2;break}return b.a(2,!0);case 2:if(d=LINE_REQUIREMENTS[c],d){b.n=3;break}return console.warn("[popup-gate] target=".concat((a+"").trim()," \uBBF8\uB4F1\uB85D \uB77C\uC778(major=").concat(c,") - LINE_REQUIREMENTS \uB4F1\uB85D \uC804\uAE4C\uC9C0 \uD31D\uC5C5 \uC5B5\uC81C")),b.a(2,!1);case 3:if(b.p=3,e=navigator.userAgentData,!(null!==e&&void 0!==e&&e.getHighEntropyValues)){b.n=5;break}return b.n=4,e.getHighEntropyValues(["platformVersion","bitness","wow64"]);case 4:return f=b.v,g=f.platformVersion,h=f.bitness,i=f.wow64,j="macOS"===e.platform,k=parseInt((g+"").split(".")[0],10),l=!isNaN(k)&&k>=(j?d.macFloorMajor:d.winFloorMajor),m=j||h===d.bitness,console.info("[popup-gate] target=".concat((a+"").trim()," (").concat(d.label,") platform=").concat(e.platform," platformVersion=").concat(g," bitness=").concat(h," wow64=").concat(i," osOk=").concat(l," bitOk=").concat(m)),b.a(2,l&&m);case 5:return console.warn("[popup-gate] target=".concat((a+"").trim()," UA-CH \uC5C6\uC74C - \uD310\uBCC4 \uBD88\uAC00, \uD31D\uC5C5 \uC5B5\uC81C")),b.a(2,!1);case 6:return b.p=6,n=b.v,console.warn("[popup-gate] \uD310\uBCC4 \uC2E4\uD328 - \uD31D\uC5C5 \uC5B5\uC81C",n),b.a(2,!1)}},b,null,[[3,6]])}));return function c(b){return a.apply(this,arguments)}}(),checkVersionAndMakePopup=function(){var a=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:if(c=0<u.length&&void 0!==u[0]?u[0]:{},Often.isElectron()){a.n=1;break}return a.a(2);case 1:if(d=c.userOs,e=void 0===d?DownloadApp.userOsCheck():d,f=c.miniVer,g=c.selectVer,h=c.linkUrl,i=(0,_Often.n2v)(null===(b=window.ElectronProcessApi)||void 0===b?void 0:b.getVersion(),"2_0_0"),j=i.replace(/[^0-9|_]/g,"").replace(/_/g,".").trim(),k=i.includes("beta"),l=Often.electronIsSmallerThanInputVersion({inputVersion:f.trim().replace(/\./g,"_").replace(/[^0-9_]/g,"")}),m=Often.electronIsSmallerThanInputVersion({inputVersion:g.trim().replace(/\./g,"_").replace(/[^0-9_]/g,"")}),n=!l&&m,o=!Often.isServerModeByHost("REAL")&&"2_5_1"===i,l||n||k||o){a.n=2;break}return a.a(2);case 2:return p=function b(a){return parseInt((a+"").trim().split(".")[0],10)||0},q=o?"2.5.2":p(g)>=p(f)?g:f,a.n=3,canRunTargetVersion(q);case 3:if(a.v){a.n=4;break}return a.a(2);case 4:if(r=getHelpLinkUrl("WINDOWS"===e),s=l||o?BLOCK_TYPE.DESKTOP_FORCE_UPDATE:BLOCK_TYPE.DESKTOP_SELECT_UPDATE,ServerChecker.isKyowon&&(s=BLOCK_TYPE.KYWON_DESKTOP_UPDATE),t=i18next.t(electron.versionReleased)+"\n"+i18next.t(electron.updateRequire)+"\n"+i18next.t(electron.currentVersion)+" &#58; Ver ".concat(j," \n")+i18next.t(electron.latestVersion)+" &#58; Ver ".concat(o?"2.5.2":g),s.main=t,ServerChecker.isSamsungLife&&(s.title="\uC5C5\uB370\uC774\uD2B8",s.main="\uC0C8\uB85C\uC6B4 \uBC84\uC804\uC774 \uCD9C\uC2DC\uB410\uC2B5\uB2C8\uB2E4.\n\uAC00\uC82F\uC5D0\uC11C \u201C\uC628\uB77C\uC778 \uC131\uC7A5 \uB180\uC774\uD130\u201D\uB97C \uAC80\uC0C9 \uD6C4\n\uCD5C\uC2E0\uBC84\uC804(".concat(updateRec.flow_rec[0].SELECT_VER.trim(),")\uC73C\uB85C \uC124\uCE58\uD574\uC8FC\uC138\uC694."),s.submit="",Company.drawServiceBlock(s,"","","")),ServerChecker.isSoil&&(s.main="\uC0C8\uB85C\uC6B4 \uBC84\uC804\uC758 \uB370\uC2A4\uD06C\uD0D1 \uC571\uC774\n\uCD9C\uC2DC\uB410\uC2B5\uB2C8\uB2E4!\n\n\uC0AC\uC6A9\uC790 PC \uD0D0\uC0C9\uAE30 C&#58; \\Temp \uACBD\uB85C\uC5D0\uC11C\n\"flowMini Setup 2.0.1\" \uD30C\uC77C\uC744 \uC2E4\uD589\uD558\uC5EC \uC5C5\uB370\uC774\uD2B8 \uBC14\uB78D\uB2C8\uB2E4.\n\n"+i18
494next.t(electron.currentVersion)+" &#58; Ver ".concat(j," \n")+i18next.t(electron.latestVersion)+" &#58; Ver ".concat(g)),!Often.isFunc("POPUP_QUEUE")){a.n=5;break}(0,_index.inputPopupQueue)(".temp-popup",20,_asyncToGenerator(_regenerator().m(function a(){return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return a.n=1,Company.drawServiceBlock(s,function(){return download({url:h})},"",r);case 1:return a.a(2)}},a)}))),a.n=6;break;case 5:return a.n=6,Company.drawServiceBlock(s,function(){return download({url:h})},"",r);case 6:return a.a(2)}},a)}));return function b(){return a.apply(this,arguments)}}(),getHelpLinkUrl=function b(a){var c="";if(Often.isGlobal()){var d=Often.null2Void(Often.getCookie("FLOW_LANG"),"en_uk");c="ja"===d?"https://support.morningmate.com/ja/articles/7206161":"es"===d?"https://support.morningmate.com/es/articles/12273481":"https://support.morningmate.com/en/articles/12273481"}else c=a?"https://support.flow.team/ko/flow/4408449610265":"https://support.flow.team/ko/flow/360038630092";return c},checkForUpdateManually=exports.checkForUpdateManually=function a(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};window.ElectronDownloadApi&&(0,_comm.runElectronFunc)("ElectronDownloadApi","checkForUpdatesManual",b)};function userOsCheck(){var a="",b=navigator.userAgent;return a=-1<b.indexOf("Macintosh")?"OS_X":-1<b.indexOf("Linux")?"LINUX":"WINDOWS",a}var getPckNm=exports.getPckNm=function a(){var b="team.flow.flowMiniRenewal";return(Often.isFunc(Func.CLOUD.SECURE_CONNECT)||Often.isFunc("MINI_SECURE_DOWNLOAD")||"secure.flow.team"===window.location.hostname)&&(b="secure.team.flow.flowMiniRenewal"),Often.isFunc(Func.CLOUD.MINI_DIRECTORY_DOWNLOAD)&&(b="dir.team.flow.flowMiniRenewal"),"Y"===Often.null2Void(_ENTER_YN,"N")&&(b="team.flow.flowEntMini"),Often.isGlobal()&&(b="com.morningmate.flowMiniRenewal"),b};
495
496},{"../../components/popup-queue/index.js":22,"../Often":146,"./comm":163,"./window":174}],166:[function(require,module,exports){
497"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ElectronApi=void 0;var User=_interopRequireWildcard(require("./user")),Notification=_interopRequireWildcard(require("./notification")),Chat=_interopRequireWildcard(require("./chat")),Comm=_interopRequireWildcard(require("./comm")),Project=_interopRequireWildcard(require("./project")),Download=_interopRequireWildcard(require("./download")),Setting=_interopRequireWildcard(require("./setting")),Thirdparty=_interopRequireWildcard(require("./thirdparty")),Window=_interopRequireWildcard(require("./window")),Capture=_interopRequireWildcard(require("./capture")),Login=_interopRequireWildcard(require("./login")),AlarmWidget=_interopRequireWildcard(require("./alarmWidget")),Ipt=_interopRequireWildcard(require("./ipt")),Device=_interopRequireWildcard(require("./device"));function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=_typeof(a)&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}var ElectronApi=exports.ElectronApi=function(){return{Comm:Comm,User:User,Device:Device,Notification:Notification,Chat:Chat,Project:Project,Download:Download,Setting:Setting,Thirdparty:Thirdparty,Window:Window,Capture:Capture,Login:Login,AlarmWidget:AlarmWidget,Ipt:Ipt}}();
498
499},{"./alarmWidget":160,"./capture":161,"./chat":162,"./comm":163,"./device":164,"./download":165,"./ipt":167,"./login":168,"./notification":169,"./project":170,"./setting":171,"./thirdparty":172,"./user":173,"./window":174}],167:[function(require,module,exports){
500"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.showMenuKyowonPhoneDial=exports.iptGateway=void 0;var _comm=require("./comm"),showMenuKyowonPhoneDial=exports.showMenuKyowonPhoneDial=function(){return(0,_comm.runElectronFunc)("ElectronIptApi","showMenuKyowonPhoneDial")},iptGateway=exports.iptGateway=function(a){return(0,_comm.runElectronFunc)("ElectronIptApi","iptGateway",a)};
501
502},{"./comm":163}],168:[function(require,module,exports){
503"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.executeOCXInstallCheck=void 0;var _comm=require("./comm"),executeOCXInstallCheck=exports.executeOCXInstallCheck=function(a){return(0,_comm.runElectronFunc)("ElectronLoginApi","executeOCXInstallCheck",a)};
504
505},{"./comm":163}],169:[function(require,module,exports){
506"use strict";var _comm=require("./comm");Object.defineProperty(exports,"__esModule",{value:!0}),exports.hideNoti=hideNoti,exports.showNoti=showNoti;function showNoti(a){(0,_comm.runElectronFunc)("ElectronWindowApi","openFlashFrame",a&&"noti_post"!==a?"POPUP_CHAT_"+a:"MAIN")}function hideNoti(a){ElectronApi.Comm.isElectronApp()&&(0,_comm.runElectronFunc)("ElectronWindowApi","hideFlashFrame",a?"POPUP_CHAT_"+a:"MAIN")}
507
508},{"./comm":163}],170:[function(require,module,exports){
509"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.openJoinPage=exports.open=exports.change=void 0;var _comm=require("./comm"),open=exports.open=function(a){try{Often.isFunc("OPEN_URL_IN_CHROME")&&window.ElectronWindowApi?(0,_comm.runElectronFunc)("ElectronWindowApi","openLinkWithChrome",a):window.ElectronProjectApi?(0,_comm.runElectronFunc)("ElectronProjectApi","open",a):fn_openProjectForElectron(a.url,a.projectSrno,a.postSrno,a.remarkSrno,a.x,a.y,a.isInit,a.replySrno)}catch(a){Mutil.mlog("project.open","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4!")}},openJoinPage=exports.openJoinPage=function(a){window.ElectronProjectApi&&(0,_comm.runElectronFunc)("ElectronProjectApi","openJoinPage",a)},change=exports.change=function(a){var b=a.projectSrno,c=a.postSrno,d=a.remarkSrno;b&&ViewChanger.loadPageJson({code:"detail",first:b}),c&&PostPopup.togglePostView(b,c,d,null,!0)};
510
511},{"./comm":163}],171:[function(require,module,exports){
512"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unLock=exports.onLock=exports.getLockSetting=void 0;var onLock=exports.onLock=function(){try{window.ElectronSettingApi.lock.on()}catch(a){Mutil.mlog("onLock","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4.")}},unLock=exports.unLock=function(){try{window.ElectronSettingApi.lock.show()}catch(a){Mutil.mlog("unLock","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4.")}},getLockSetting=exports.getLockSetting=function(a){try{return window.ElectronSettingApi.lock.set(a)}catch(a){Mutil.mlog("getLockSetting","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4.")}};
513
514},{}],172:[function(require,module,exports){
515"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.memo=exports.google=void 0;var google=exports.google=function(){return{openSignin:function(a,b){var c={url:a,title:b,width:600,height:600,x:window.screenLeft+($(window).width()-600)/2,y:window.screenTop+($(window).height()-600)/2};try{window.ElectronThirdpartyApi.google.openSignin(c)}catch(a){Often.toast("error",i18next.t(main.alert.errorTryAgain))}},openDrivePost:function(a){try{window.ElectronThirdpartyApi.google.openDrivePost(a)}catch(a){Often.toast("error",i18next.t(main.alert.errorTryAgain))}},driveInPost:function(a){try{window.ElectronThirdpartyApi.google.driveInPost(a)}catch(a){Often.toast("error",i18next.t(main.alert.errorTryAgain))}}}}(),memo=exports.memo=function(){return{open:function(a){try{window.ElectronThirdpartyApi.memo.open(a)}catch(a){Often.toast("error",i18next.t(main.alert.errorTryAgain))}},set:function(a){try{return window.ElectronThirdpartyApi.memo.set(a)}catch(a){Often.toast("error",i18next.t(main.alert.errorTryAgain))}}}}();
516
517},{}],173:[function(require,module,exports){
518"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.openSystemPreferences=exports.logout=exports.getWhoAmI=exports.getUserIdWithNLogin=exports.getMediaAccessStatus=exports.askForMediaAccess=void 0;var _comm=require("./comm"),_Often=require("../Often"),logout=exports.logout=function(a){if
518(!ServerChecker.isHdmf){var b=a.REmDIRECT_URI;window._IsMini&&location.replace(Often.null2Void(b,"Y"===window._ENTER_YN?"/entMiniSignIn.act?logout=Y":"/miniSignIn.act"))}else if(window._IsMini){var c=""===a?"":"&reason="+a;location.replace("Y"===window._ENTER_YN?"/entMiniSignIn.act?logout=Y"+c:"/miniSignIn.act")}(0,_comm.runElectronFunc)("ElectronUserApi","logout"),ElectronApi.Window.setMenuVisibleValue({logoutMenuVisible:!1,lockMenuVisible:!1,windowModeVisible:!1})},getWhoAmI=exports.getWhoAmI=function(){return(0,_Often.n2v)((0,_comm.runElectronFunc)("ElectronUserApi","getWhoAmI"),"")},getMediaAccessStatus=exports.getMediaAccessStatus=function(){return(0,_comm.runElectronFunc)("ElectronUserApi","getMediaAccessStatus")},askForMediaAccess=exports.askForMediaAccess=function(){return(0,_comm.runElectronFunc)("ElectronUserApi","askForMediaAccess")},openSystemPreferences=exports.openSystemPreferences=function(){return(0,_comm.runElectronFunc)("ElectronUserApi","openSystemPreferences")},getUserIdWithNLogin=exports.getUserIdWithNLogin=function(){try{var a="C:\\ProgramData\\log\\n5login_"+dayjs(Date.now()).format("YYYYMMDD")+".log";return Often.null2Void((0,_comm.runElectronFunc)("ElectronUserApi","getUserIdWithNLogin",{filepath:a,encoding:"binary"}),"")}catch(a){Often.toast("error",i18next.t("front.alert.errorTryAgain"))}};
519
520},{"../Often":146,"./comm":163}],174:[function(require,module,exports){
521"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setState=exports.setPopupSize=exports.setMinSize=exports.setMenuVisibleValue=exports.openUniquePopup=exports.openOneDrive=exports.openMiniMenu=exports.openExternalLink=exports.openDropBox=exports.open=exports.focusMainBrowser=exports.changeProject=void 0;var _comm=require("./comm"),_index=_interopRequireDefault(require("../index"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var setMenuVisibleValue=exports.setMenuVisibleValue=function(a){var b=_objectSpread(_objectSpread({},a),{},{code:"MENU0001",userId:Often.null2Void(_USER_ID,"")});window.ElectronWindowApi?(0,_comm.runElectronFunc)("ElectronWindowApi","visibleMenu",b):fn_sendValueForElectron(b)},focusMainBrowser=exports.focusMainBrowser=function(){(0,_comm.runElectronFunc)("ElectronWindowApi","focusMainBrowser")},open=exports.open=function(a){(0,_comm.runElectronFunc)("ElectronWindowApi","open",_objectSpread(_objectSpread({},a),{x:a.posX,y:a.posY}))},openMiniMenu=exports.openMiniMenu=function(a){window.ElectronWindowApi?(0,_comm.runElectronFunc)("ElectronWindowApi","openContextMenu",a):fn_openContextMenuForElectron(a.target)},openExternalLink=exports.openExternalLink=function(a){var b=a.url,c=void 0===b?"":b;if("string"==typeof c&&0===c.indexOf("https://hiworksmsg.hi.co.kr"))return open({url:c,target:"HIWORKS_LINK",width:1024,height:768,posX:(window.screenX||0)+50,posY:(window.screenY||0)+50});var d=Often.isFunc("OPEN_URL_IN_CHROME")?"openLinkWithChrome":"openLink",e=/https*:\/\//i.test(c)?c:"http://"+c;window.ElectronWindowApi?(0,_comm.runElectronFunc)("ElectronWindowApi",d,_objectSpread(_objectSpread({},a),{},{url:e})):fn_openExternalLinkforElectron(e)}
521,openDropBox=exports.openDropBox=function(){(0,_comm.runElectronFunc)("ElectronWindowApi","openDropBox",{_ROOM_SRNO:_index.default.n2v(window._ROOM_SRNO)})},setState=exports.setState=function(a){(0,_comm.runElectronFunc)("ElectronWindowApi","openContextMenu",a)},HEIGHT_KEEP_EPS=2,keptOuterHeight=0,keepWindowHeight=function(){var a=Math.round(window.outerHeight);return(!keptOuterHeight||Math.abs(a-keptOuterHeight)>HEIGHT_KEEP_EPS)&&(keptOuterHeight=a),keptOuterHeight},setMinSize=exports.setMinSize=function(a){var b=null==a.height?_objectSpread(_objectSpread({},a),{},{height:keepWindowHeight()}):a;try{window.ElectronWindowApi?(0,_comm.runElectronFunc)("ElectronWindowApi","resize",b):windowMinResizeForElectron(b.width,b.height,b.mode)}catch(a){Mutil.mlog("setMinSize","\uC6F9\uC5D0\uC11C \uBBF8\uB2C8\uB97C \uCF30\uC2B5\uB2C8\uB2E4!")}},setPopupSize=exports.setPopupSize=function(a){(0,_comm.runElectronFunc)("ElectronWindowApi","resizePopup",a)},changeProject=exports.changeProject=function(a){var b=a.projectSrno,c=void 0===b?"":b,d=a.postSrno,e=void 0===d?"":d,f=a.remarkSrno,g=void 0===f?"":f,h=a.replySrno,i=void 0===h?"":h,j=a.homeTabCode,k=void 0===j?"":j;return ViewChanger.isOpenProjectHomePage(c,e,g,k)?void ViewChanger.loadProjectHomePage(k,c):void(c&&ViewChanger.loadPageJson({code:"detail",first:c}),e&&PostPopup.togglePostView(c,e,g,null,!0,!1,i))},openOneDrive=exports.openOneDrive=function(){},openUniquePopup=exports.openUniquePopup=function(a){(0,_comm.runElectronFunc)("ElectronWindowApi","openUniquePopup",a)};
522
523},{"../index":175,"./comm":163}],175:[function(require,module,exports){
524"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _Ajax=require("./Ajax"),_Paging=require("./Paging"),_VirtualScroll=require("./virtual-scroll/VirtualScroll.js"),_draftRemarkData=require("../page/main/detail/data-control/data/draftRemarkData.js"),_DebounceNThrottle=require("./DebounceNThrottle"),_Toast=require("./Toast"),_Confirm=require("./Confirm"),_Prompt=require("./Prompt"),_Keycode=require("./Keycode"),_Validate=require("./Validate"),_ViewController=require("./ViewController"),_Close=require("./Close"),LocalStorage=_interopRequireWildcard(require("./LocalStorage")),_Loading=require("./Loading"),_Often=require("./Often"),Convert=_interopRequireWildcard(require("./Convert")),_JqueryUi=_interopRequireDefault(require("./JqueryUi")),Json=_interopRequireWildcard(require("./Json")),TagUtil=_interopRequireWildcard(require("./TagUtil")),_TagUtilV=require("./TagUtilV2"),Window=_interopRequireWildcard(require("./Window")),OutClick=_interopRequireWildcard(require("./OutClick")),File=_interopRequireWildcard(require("./File")),Caret=_interopRequireWildcard(require("./Caret")),Upload=_interopRequireWildcard(require("./Upload")),Excel=_interopRequireWildcard(require("./Excel")),_Socket=require("./Socket"),SweetAlert=_interopRequireWildcard(require("./SweetAlert.js")),_libIntegrated=require("../integrated/lib.integrated.js"),_DOMOperator=require("./DOMOperator.js"),_Ping=require("./Ping.js"),_CryptoUtil=require("./CryptoUtil.js");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=_typeof(a)&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
524:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var util=function(){return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({},{Ajax:_Ajax.Ajax,AJAX_OPTION:_Ajax.AJAX_OPTION}),{},{Paging:_Paging.Paging,VirtualScroll:_VirtualScroll.VirtualScroll,DraftRemarkData:_draftRemarkData.DraftRemarkData},{Paging:_Paging.Paging}),{},{DebounceNThrottle:_DebounceNThrottle.DebounceNThrottle},{toast:_Toast.toast,confirm:_Confirm.confirm,prompt:_Prompt.prompt}),{isKey:_Keycode.isKey,isAvailableKeyCode:_Keycode.isAvailableKeyCode,isUpperCaseKeyCode:_Keycode.isUpperCaseKeyCode}),{Validate:_Validate.Validate}),{ViewController:_ViewController.ViewController}),{closeLayerById:_Close.closeLayerById,closeLayerByClass:_Close.closeLayerByClass}),LocalStorage),{load:_Loading.load,openLoadingPop:_Loading.openLoadingPop,closeLoadingPop:_Loading.closeLoadingPop,updateLoadingPop:_Loading.updateLoadingPop,removeLoading:_Loading.removeLoading,loadInnerStraight:_Loading.loadInnerStraight}),Convert),Json),TagUtil),{convertOnCopy:_TagUtilV.convertOnCopy,convertOnSave:_TagUtilV.convertOnSave,convertDiv2Newline:_TagUtilV.convertDiv2Newline,convertOnRead:_TagUtilV.convertOnRead,removeMentionTag:_TagUtilV.removeMentionTag,convertHtmlCode:_TagUtilV.convertHtmlCode,removeUrlTag:_TagUtilV.removeUrlTag,formatPhoneNumber:_TagUtilV.formatPhoneNumber}),Window),OutClick),{},{jqueryUi:_JqueryUi.default},File),Caret),Upload),Excel),{},{connectSocket:_Socket.connectSocket,SweetAlert:SweetAlert,copyClipboard:_Often.copyClipboard,isFunc:_Often.isFunc,isAct:_Often.isAct,requireIIFE:_Often.requireIIFE,noop:_Often.noop,isTarget:_Often.isTarget,n2v:_Often.n2v,isClientOs:_Often.isClientOs,exist:_Often.exist,exists:_Often.exists,empty:_Often.empty,numberWithCommas:_Often.numberWithCommas,attr:_Often.attr,attrs:_Often.attrs,range:_Often.range,isEncodedUrl:_Often.isEncodedUrl,toggleAction:_Often.toggleAction,showNHide:_Often.showNHide,showNRemove:_Often.showNRemove,isBrowser:_Often.isBrowser,getCookie:_Often.getCookie,setCookie:_Often.setCookie,deleteCookie:_Often.deleteCookie,guid:_Often.guid,isJson:_Often.isJson,getUUID:_Often.getUUID,pipe:_Often.pipe,uniq:_Often.uniq,deepCompare:_Often.deepCompare,logPipe:_Often.logPipe,isServerOn:_Often.isServerOn,getServerMode:_Often.getServerMode,calculateMs:_Often.calculateMs,delay:_Often.delay,chunk:_Often.chunk,clog:_Often.clog,elog:_Often.elog,mlog:_Often.mlog,isMobile:_Often.isMobile,isTablet:_Often.isTablet,isGlobal:_Often.isGlobal,isGuest:_Often.isGuest,ping:_Ping.ping,lib:{loadScript:_libIntegrated.loadScript,getRequest:_libIntegrated.getRequest,getSortable:_libIntegrated.getSortable,getOneDrive:_libIntegrated.getOneDrive,getJuiChart:_libIntegrated.getJuiChart,getToastChart:_libIntegrated.getToastChart,getExcelLib:_libIntegrated.getExcelLib,getSlick:_libIntegrated.getSlick,getSwiper:_libIntegrated.getSwiper,getFullCalendar:_libIntegrated.getFullCalendar,getEWSFullCalendar:_libIntegrated.getEWSFullCalendar,getCKEditor:_libIntegrated.getCKEditor,getVideoViewer:_libIntegrated.getVideoViewer,getFlatpickr:_libIntegrated.getFlatpickr,getConfirmDate:_libIntegrated.getConfirmDate,getQuill:_libIntegrated.getQuill,getGoogleMap:_libIntegrated.getGoogleMap,getGoogleDrive:_libIntegrated.getGoogleDrive,getActiveLib:_libIntegrated.getActiveLib,getFlowGrid:_libIntegrated.getFlowGrid,getFlowInl
524ineLinkPopup:_libIntegrated.getFlowInlineLinkPopup,getFlowPopupKit:_libIntegrated.getFlowPopupKit,getSocketClient:_libIntegrated.getSocketClient,getHtml2Pdf:_libIntegrated.getHtml2Pdf,getEmoji:_libIntegrated.getEmoji,getFlowTaskUtil:_libIntegrated.getFlowTaskUtil,getSocketIo:_libIntegrated.getSocketIo,getProtobufjs:_libIntegrated.getProtobufjs,getFlowDatePicker:_libIntegrated.getFlowDatePicker,getGoogleAccountApi:_libIntegrated.getGoogleAccountApi},DOMOperator:_DOMOperator.DOMOperator,ResourceIdCrypto:_CryptoUtil.ResourceIdCrypto})}(),_default=exports.default=util;
525
526},{"../integrated/lib.integrated.js":52,"../page/main/detail/data-control/data/draftRemarkData.js":54,"./Ajax":131,"./Caret":132,"./Close":133,"./Confirm":134,"./Convert":135,"./CryptoUtil.js":136,"./DOMOperator.js":137,"./DebounceNThrottle":138,"./Excel":139,"./File":140,"./JqueryUi":141,"./Json":142,"./Keycode":143,"./Loading":144,"./LocalStorage":145,"./Often":146,"./OutClick":147,"./Paging":148,"./Ping.js":149,"./Prompt":150,"./Socket":151,"./SweetAlert.js":152,"./TagUtil":153,"./TagUtilV2":154,"./Toast":155,"./Upload":156,"./Validate":157,"./ViewController":158,"./Window":159,"./virtual-scroll/VirtualScroll.js":178}],176:[function(require,module,exports){
527"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Paging=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var Paging=exports.Paging=function(){function a(b){_classCallCheck(this,a),this.pageData=_objectSpread(_objectSpread({},b),{},{PG_NO:1,NEXT_YN:"Y"})}return _createClass(a,[{key:"getPageData",value:function(){return this.pageData}},{key:"setPageData",value:function(a){this.pageData=_objectSpread(_objectSpread({},this.pageData),a)}},{key:"setNextPage",value:function(){this.setPageData({PG_NO:this.pageData.PG_NO+1})}},{key:"refreshData",value:function(){this.pageData.PG_NO=1,this.pageData.NEXT_YN="Y"}}])}();
528
529},{}],177:[function(require,module,exports){
530"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RecordControl=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}
530:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var RecordControl=exports.RecordControl=function(){function a(b){_classCallCheck(this,a),this.records=b}return _createClass(a,[{key:"modifyRecordBy$El",value:function(a){var b=a.type,c=a.record,d=a.$el,e=!!c.TEMP_REMARK_REC;"ADD"===b?this.setRecords([c]):"ADD_FIRST"===b?this.setRecords([c],!0):"UPDATE"===b?this.updateRecordByIndex({record:c,index:this.getIdx(d),isDraftRemark:e}):"DELETE"===b&&this.deleteRecord(c)}},{key:"updateRecordByIndex",value:function(a){var b=a.record,c=a.index,d=a.isDraftRemark;this.records=this.records.map(function(a,e){if(void 0!==d&&d){var f,g=null===(f=b.TEMP_REMARK_REC)||void 0===f?void 0:f.find(function(a){return a.idx===e});return _objectSpread(_objectSpread({},a),{TEMP_REMARK_REC:g})}if(e===c){var h=_objectSpread(_objectSpread({},a),b);return void 0===b.TEMP_REMARK_REC&&(h.TEMP_REMARK_REC=a.TEMP_REMARK_REC),h}return a})}},{key:"updateTaskStatusByPostId",value:function(a,b){this.records.filter(function(b){return b.COLABO_COMMT_SRNO===a}).forEach(function(a){return a.TASK_STTS=b.toString()})}},{key:"updateSubTaskStatusByPostId",value:function(a,b,c){var d=!!(3<arguments.length&&arguments[3]!==void 0)&&arguments[3];this.records.forEach(function(e){var f,g=null===(f=e.SUBTASK_REC)||void 0===f?void 0:f.filter(function(c){return c.COLABO_COMMT_SRNO===a&&c.TASK_SRNO===b});if(!d)null===g||void 0===g||g.forEach(function(a){return a.STTS=c.toString()});else if("STATUS"===(null===c||void 0===c?void 0:c.COLUMN_TYPE))null===g||void 0===g||g.forEach(function(a){if(null!==a&&void 0!==a&&a.TASK_COLUMN_REC){var b,d=null===(b=a.TASK_COLUMN_REC)||void 0===b?void 0:b.find(function(a){return"12"===a.COLUMN_SRNO});d&&Object.assign(d,c)}});else{var h,i=null===c||void 0===c||null===(h=c.COLUMN_DATA_REC)||void 0===h?void 0:h[0].CUSTOM_COLUMN_DATA;null===g||void 0===g||g.forEach(function(a){return a.STTS=i})}})}},{key:"deleteRecord",value:function(a){for(var b=0;b<this.records.length;b++)if(this.records[b].COLABO_COMMT_SRNO===a.COLABO_COMMT_SRNO){this.records.splice(b,1);break}}},{key:"setRecords",value:function(a,b){b&&a.reverse();var c=new Set(a.map(function(a){return a.COLABO_COMMT_SRNO})),d=this.records.filter(function(a){return!c.has(a.COLABO_COMMT_SRNO)});this.records=b?[].concat(_toConsumableArray(a),_toConsumableArray(d)):[].concat(_toConsumableArray(d),_toConsumableArray(a))}},{key:"getRecordBy$El",value:function(a){return this.records[this.getIdx(a)]||{}}},{key:"getRecords",value:function(){return this.records}},{key:"getIdx",value:function(a){return a.parent().children().index(a)}}])}();
531
532},{}],178:[function(require,module,exports){
533"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VirtualScroll=void 0;var _Paging=require("./Paging.js"),_RecordControl=require("./RecordControl.js"),_Loading=require("../Loading.js"),_Often=require("../Often.js");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>
533q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k.return)&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}var USE_CONTENT_VISIBILITY="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("content-visibility","hidden"),VirtualScroll=exports.VirtualScroll=function(){function a(b){var c=b.target,d=void 0===c?{}:c,e=b.pageData,f=void 0===e?{}:e,g=b.renderOption,h=void 0===g?{}:g,i=b.observeOption,j=void 0===i?{}:i,k=b.eventOption,l=void 0===k?{}:k,m=b.callOption,n=void 0===m?{}:m;_classCallCheck(this,a),this.target=d,this.renderOption=h,this.observeOption=j,this.eventOption=l,this.callOption=n,this.isApiCalling=!1,this._hiddenQueue=[],this._recentlyToggled=new Set,this.setup(f),this.initSkeleton(),this.setEvent()}return _createClass(a,[{key:"setup",value:function b(a){this.pageController=new _Paging.Paging(null!==a&&void 0!==a?a:{NEXT_YN:"N",LIMIT:10}),this.recordController=new _RecordControl.RecordControl([])}},{key:"setEvent",value:function a(){var b=this.target.$ul,c=this.eventOption.click,d=void 0===c?_Often.noop:c;d&&b.off("click").on("click",d)}},{key:"callAndRender",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(_regenerator().m(function a(){var b,c,d,e,f,g=arguments;return _regenerator().w(function(a){for(;1;)switch(a.n){case 0:return b=0<g.length&&void 0!==g[0]?g[0]:{},c=b.isDrawLoad,d=void 0!==c&&c,e=this.target.$ul,d&&(0,_Loading.load)({type:"circle",$area:e}),this.callOption.beforeApiCall&&"function"==typeof this.callOption.beforeApiCall&&this.callOption.beforeApiCall({pageData:this.pageController.getPageData()}),this.isApiCalling=!0,a.n=1,this.callOption.callApi();case 1:if(f=a.v,!this._destroyed){a.n=2;break}return a.a(2);case 2:this.isApiCalling=!1,this.callOption.afterApiCall&&"function"==typeof this.callOption.afterApiCall&&this.callOption.afterApiCall({pageData:this.pageController.getPageData(),response:f}),this.render(f);case 3:return a.a(2)}},a,this)}));return a}()},{key:"render",value:function b(a){var c;if(!(null!==(c=this.recordController)&&void 0!==c&&c.records))return void Mutil.mlog(this);var d=1===this.pageController.pageData.PG_NO,e=0===this.recordController.records.length,f=this.target,g=f.$ul,h=f.$scroll,i=this.callOption.final,j=this.renderOption.item;
533i=i||_Often.noop,j=j||_Often.noop,(0,_Loading.removeLoading)(g),d&&(this._hiddenQueue=[],this._recentlyToggled.clear(),g.empty());var k=function a(){return g.children()},l=k().length;if(e)this.pageController.setPageData({NEXT_YN:"N"});else{this.pageController.setPageData({PG_NO:this.pageController.pageData.PG_NO+1});var m=_toConsumableArray(this.recordController.records);if("P"===this.pageController.getPageData().ORDER_TYPE)m.splice(-1*l),g.prepend(j(m));else{var n=j(_toConsumableArray(this.recordController.records).splice(l));g.append(n)}}this.setScroll(),d&&(e?g.append(this.renderOption.noDataHtml):g.scrollTop(0)),i({$ul:g,$scroll:h,isFirstDraw:d,response:a})}},{key:"setScroll",value:function a(){var b=this,c=this.target,d=c.$ul,e=c.$scroll,f=c.itemSelector,g=this.observeOption,h=g.ratio,i=g.isLastIndexPaging,j=g.showCallback,k=g.hideCallback,l=g.beforeRestoreCallback,m=this.observeOption.maxAliveItems||0,n=this.renderOption.item,o=function a(){return d.children()},p=function c(a){(!f||$(a).is(f))&&b.postsIo.observe(a)};if(this.postsIo)return void o().each(function(a,b){return p(b)});var q=function c(a){if(!b._destroyed){var d=o(),f=d.length,g=b.recordController.records.length,p=[],q=new Map(a.map(function(a){return[a.target,a]}));q.forEach(function(a){var c=a.target,e=a.intersectionRatio,f=a.isIntersecting,g=$(c),i=d.index(g);if(-1!==i){var j=e===h&&!f;if(j){if(g.hasClass("vs-hidden")||g.data("vsEmpty")||b._recentlyToggled.has(c))return;k&&k({$target:g})}p.push({entry:a,$t:g,idx:i,hide:j})}});var r,s=e[0];p.forEach(function(a){var b=a.entry,c=b.target,d=b.intersectionRatio,e=b.isIntersecting,f=a.$t,g=a.hide;if(g){var i;a.minHeight=null!==(i=f.data("vsMinHeight"))&&void 0!==i?i:c.offsetHeight}else d>h&&e&&(USE_CONTENT_VISIBILITY&&f.hasClass("vs-hidden")||f.data("vsEmpty"))&&(void 0===r&&(r=s.scrollTop),a.prevHeight=c.offsetHeight,a.aboveViewport=c.offsetTop<r)});var t=[];p.forEach(function(a){var c=a.entry,d=a.$t,e=a.idx,k=a.minHeight,o=a.prevHeight,p=a.aboveViewport,q=c.target,r=c.intersectionRatio,s=c.isIntersecting,u=3,v=g-e<=3;if(r===h&&!s){if(d.hasClass("vs-hidden")||d.data("vsEmpty"))return;if(b._recentlyToggled.has(q))return;if(!USE_CONTENT_VISIBILITY)d.data("vsMinHeight",k),d.css("min-height",k),d.data("vsEmpty",!0),d.empty();else if(d.data("vsMinHeight",k),d.css("min-height",k),d.addClass("vs-hidden"),b._hiddenQueue.push(q),b._recentlyToggled.add(q),requestAnimationFrame(function(){return b._recentlyToggled.delete(q)}),0<m&&b._hiddenQueue.length>m){var w=b._hiddenQueue.shift(),x=$(w);if(x.hasClass("vs-hidden")){var y=x.data("vsMinHeight");x.removeClass("vs-hidden"),x.css("min-height",y),x.data("vsEmpty",!0),x.empty()}}return}if(r>h&&s){if(USE_CONTENT_VISIBILITY&&d.hasClass("vs-hidden")){d.removeClass("vs-hidden"),d.css("min-height",""),d.removeData("vsMinHeight"),p&&t.push({target:q,$t:d,prevHeight:o});var z=b._hiddenQueue.indexOf(q);-1!==z&&b._hiddenQueue.splice(z,1),b._recentlyToggled.add(q),requestAnimationFrame(function(){return b._recentlyToggled.delete(q)})}else if(d.data("vsEmpty")){var A=b.recordController.records[e],B=$(n([A]));l&&l({$item:d,$content:B}),d.html(B.html()),d.data("vsEmpty",!1),d.css("min-height",""),d.removeData("vsMinHeight"),p&&t.push({target:q,$t:d,prevHeight:o})}if(j&&"function"==typeof j&&j({$item:d}),i&&v&&g===f&&"Y"===b.pageController.pageData.NEXT_YN){var C,D;if(b.isApiCalling)return;var E=null!==(C=null===(D=b.target.$scroll)||void 0===D||null===(D=D[0])||void 0===D?void 0:D.scrollTop)&&void 0!==C?C:0;if(E!==b._lastAutoFillScrollTop&&(b._autoFillCount=0,b._lastAutoFillScrollTop=E),b._autoFillCount=(b._autoFillCount||0)+1,5<b._autoFillCount)return;b.callAndRender().then(function(a){})}}}),0<t.length&&requestAnimationFrame(function(){if(!b._destroyed){var a=0;t.forEach(function(b){var c=b.target,d=b.$t,e=b.prevHeight;if(!(!c.isConnected||d.hasClass("vs-hidden")||d.data("vsEmpty"))){var f=c.offsetHeight;0!==f&&(a+=e-f)}}),0!=a&&(s.scrollTop-=a)}})}};this.postsIo=new IntersectionObserver(q,{threshold:[0,1],root:e[0],rootMargin:"1500px 0px"}),o().each(function(a,b){return p(b)})}},{key:"unobserve",value:function a(){var b=this;this._hiddenQueue=[],this._recentlyToggled.clear();var c=this.target.$ul,d=function a(){return c.children()};d().each(function(a,c){var d;null===(d=b.postsIo)||void 0===d||d.unobserve(c),c.remove()})}},{key:"destroy",value:function a(){this._destroyed=!0,this._hiddenQueue=[],this._recentlyToggled.clear(),this.postsIo&&(this.postsIo.disconnect(),this.postsIo=null),this.recordController=null}},{key:"initSkeleton",value:function a(){""!==this.target.$ul.html().trim()||this.target.$ul.html(LoadSkeleton.getPostContentsByDetail())}}])}();
534
535},{"../Loading.js":144,"../Often.js":146,"./Paging.js":176,"./RecordControl.js":177}],179:[function(require,module,exports){
536/*! @azure/msal-browser v2.39.0 2024-06-06 */
537'use strict';
538'use strict';
539
540Object.defineProperty(exports, '__esModule', { value: true });
541
542/*! *****************************************************************************
543Copyright (c) Microsoft Corporation.
544
545Permission to use, copy, modify, and/or distribute this software for any
546purpose with or without fee is hereby granted.
547
548THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
549REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
550AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
551INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
552LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
553OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
554PERFORMANCE OF THIS SOFTWARE.
555***************************************************************************** */
556/* global Reflect, Promise */
557
558var extendStatics$1 = function(d, b) {
559    extendStatics$1 = Object.setPrototypeOf ||
560        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
561        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
562    return extendStatics$1(d, b);
563};
vendor: 5,319 bytes, lines 564-677
564
565function __extends$1(d, b) {
566    extendStatics$1(d, b);
567    function __() { this.constructor = d; }
568    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
569}
570
571var __assign$1 = function() {
572    __assign$1 = Object.assign || function __assign(t) {
573        for (var s, i = 1, n = arguments.length; i < n; i++) {
574            s = arguments[i];
575            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
576        }
577        return t;
578    };
579    return __assign$1.apply(this, arguments);
580};
581
582function __rest(s, e) {
583    var t = {};
584    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
585        t[p] = s[p];
586    if (s != null && typeof Object.getOwnPropertySymbols === "function")
587        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
588            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
589                t[p[i]] = s[p[i]];
590        }
591    return t;
592}
593
594function __awaiter$1(thisArg, _arguments, P, generator) {
595    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
596    return new (P || (P = Promise))(function (resolve, reject) {
597        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
598        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
599        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
600        step((generator = generator.apply(thisArg, _arguments || [])).next());
601    });
602}
603
604function __generator$1(thisArg, body) {
605    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
606    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
607    function verb(n) { return function (v) { return step([n, v]); }; }
608    function step(op) {
609        if (f) throw new TypeError("Generator is already executing.");
610        while (_) try {
611            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
612            if (y = 0, t) op = [op[0] & 2, t.value];
613            switch (op[0]) {
614                case 0: case 1: t = op; break;
615                case 4: _.label++; return { value: op[1], done: false };
616                case 5: _.label++; y = op[1]; op = [0]; continue;
617                case 7: op = _.ops.pop(); _.trys.pop(); continue;
618                default:
619                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
620                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
621                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
622                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
623                    if (t[2]) _.ops.pop();
624                    _.trys.pop(); continue;
625            }
626            op = body.call(thisArg, _);
627        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
628        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
629    }
630}
631
632function __read(o, n) {
633    var m = typeof Symbol === "function" && o[Symbol.iterator];
634    if (!m) return o;
635    var i = m.call(o), r, ar = [], e;
636    try {
637        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
638    }
639    catch (error) { e = { error: error }; }
640    finally {
641        try {
642            if (r && !r.done && (m = i["return"])) m.call(i);
643        }
644        finally { if (e) throw e.error; }
645    }
646    return ar;
647}
648
649function __spread() {
650    for (var ar = [], i = 0; i < arguments.length; i++)
651        ar = ar.concat(__read(arguments[i]));
652    return ar;
653}
654
655/*! @azure/msal-common v13.3.3 2024-06-06 */
656/*! *****************************************************************************
657Copyright (c) Microsoft Corporation.
658
659Permission to use, copy, modify, and/or distribute this software for any
660purpose with or without fee is hereby granted.
661
662THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
663REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
664AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
665INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
666LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
667OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
668PERFORMANCE OF THIS SOFTWARE.
669***************************************************************************** */
670/* global Reflect, Promise */
671
672var extendStatics = function(d, b) {
673    extendStatics = Object.setPrototypeOf ||
674        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
675        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
676    return extendStatics(d, b);
677};
678
679function __extends(d, b) {
680    extendStatics(d, b);
681    function __() { this.constructor = d; }
682    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
683}
684
685var __assign = function() {
686    __assign = Object.assign || function __assign(t) {
687        for (var s, i = 1, n = arguments.length; i < n; i++) {
688            s = arguments[i];
689            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
690        }
691        return t;
692    };
693    return __assign.apply(this, arguments);
694};
695
696function __awaiter(thisArg, _arguments, P, generator) {
697    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
698    return new (P || (P = Promise))(function (resolve, reject) {
699        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
700        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
701        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
702        step((generator = generator.apply(thisArg, _arguments || [])).next());
703    });
704}
705
706function __generator(thisArg, body) {
707    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
708    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
709    function verb(n) { return function (v) { return step([n, v]); }; }
710    function step(op) {
711        if (f) throw new TypeError("Generator is already executing.");
712        while (_) try {
713            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
714            if (y = 0, t) op = [op[0] & 2, t.value];
715            switch (op[0]) {
716                case 0: case 1: t = op; break;
717                case 4: _.label++; return { value: op[1], done: false };
718                case 5: _.label++; y = op[1]; op = [0]; continue;
719                case 7: op = _.ops.pop(); _.trys.pop(); continue;
720                default:
721                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
722                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
723                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
724                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
725                    if (t[2]) _.ops.pop();
726                    _.trys.pop(); continue;
727            }
728            op = body.call(thisArg, _);
729        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
730        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
731    }
732}
733
734function __spreadArrays() {
735    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
736    for (var r = Array(s), k = 0, i = 0; i < il; i++)
737        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
738            r[k] = a[j];
739    return r;
740}
741
742/*! @azure/msal-common v13.3.3 2024-06-06 */
743
744/*
745 * Copyright (c) Microsoft Corporation. All rights reserved.
746 * Licensed under the MIT License.
747 */
748var Constants = {
749    LIBRARY_NAME: "MSAL.JS",
750    SKU: "msal.js.common",
751    // Prefix for all library cache entries
752    CACHE_PREFIX: "msal",
753    // default authority
754    DEFAULT_AUTHORITY: "https://login.microsoftonline.com/common/",
755    DEFAULT_AUTHORITY_HOST: "login.microsoftonline.com",
756    DEFAULT_COMMON_TENANT: "common",
757    // ADFS String
758    ADFS: "adfs",
759    DSTS: "dstsv2",
760    // Default AAD Instance Discovery Endpoint
761    AAD_INSTANCE_DISCOVERY_ENDPT: "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",
762    // CIAM URL
763    CIAM_AUTH_URL: ".ciamlogin.com",
764    AAD_TENANT_DOMAIN_SUFFIX: ".onmicrosoft.com",
765    // Resource delimiter - used for certain cache entries
766    RESOURCE_DELIM: "|",
767    // Placeholder for non-existent account ids/objects
768    NO_ACCOUNT: "NO_ACCOUNT",
769    // Claims
770    CLAIMS: "claims",
771    // Consumer UTID
772    CONSUMER_UTID: "9188040d-6c67-4c5b-b112-36a304b66dad",
773    // Default scopes
774    OPENID_SCOPE: "openid",
775    PROFILE_SCOPE: "profile",
776    OFFLINE_ACCESS_SCOPE: "offline_access",
777    EMAIL_SCOPE: "email",
778    // Default response type for authorization code flow
779    CODE_RESPONSE_TYPE: "code",
780    CODE_GRANT_TYPE: "authorization_code",
781    RT_GRANT_TYPE: "refresh_token",
782    FRAGMENT_RESPONSE_MODE: "fragment",
783    S256_CODE_CHALLENGE_METHOD: "S256",
784    URL_FORM_CONTENT_TYPE: "application/x-www-form-urlencoded;charset=utf-8",
785    AUTHORIZATION_PENDING: "authorization_pending",
786    NOT_DEFINED: "not_defined",
787    EMPTY_STRING: "",
788    NOT_APPLICABLE: "N/A",
789    FORWARD_SLASH: "/",
790    IMDS_ENDPOINT: "http://169.254.169.254/metadata/instance/compute/location",
791    IMDS_VERSION: "2020-06-01",
792    IMDS_TIMEOUT: 2000,
793    AZURE_REGION_AUTO_DISCOVER_FLAG: "TryAutoDetect",
794    REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX: "login.microsoft.com",
795    REGIONAL_AUTH_NON_MSI_QUERY_STRING: "allowestsrnonmsi=true",
796    KNOWN_PUBLIC_CLOUDS: ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"],
797    TOKEN_RESPONSE_TYPE: "token",
798    ID_TOKEN_RESPONSE_TYPE: "id_token",
799    SHR_NONCE_VALIDITY: 240,
800    INVALID_INSTANCE: "invalid_instance",
801};
802var OIDC_DEFAULT_SCOPES = [
803    Constants.OPENID_SCOPE,
804    Constants.PROFILE_SCOPE,
805    Constants.OFFLINE_ACCESS_SCOPE
806];
807var OIDC_SCOPES = __spreadArrays(OIDC_DEFAULT_SCOPES, [
808    Constants.EMAIL_SCOPE
809]);
810/**
811 * Request header names
812 */
813var HeaderNames;
814(function (HeaderNames) {
815    HeaderNames["CONTENT_TYPE"] = "Content-Type";
816    HeaderNames["RETRY_AFTER"] = "Retry-After";
817    HeaderNames["CCS_HEADER"] = "X-AnchorMailbox";
818    HeaderNames["WWWAuthenticate"] = "WWW-Authenticate";
819    HeaderNames["AuthenticationInfo"] = "Authentication-Info";
820    HeaderNames["X_MS_REQUEST_ID"] = "x-ms-request-id";
821    HeaderNames["X_MS_HTTP_VERSION"] = "x-ms-httpver";
822})(HeaderNames || (HeaderNames = {}));
823/**
824 * Persistent cache keys MSAL which stay while user is logged in.
825 */
826var PersistentCacheKeys;
827(function (PersistentCacheKeys) {
828    PersistentCacheKeys["ID_TOKEN"] = "idtoken";
829    PersistentCacheKeys["CLIENT_INFO"] = "client.info";
830    PersistentCacheKeys["ADAL_ID_TOKEN"] = "adal.idtoken";
831    PersistentCacheKeys["ERROR"] = "error";
832    PersistentCacheKeys["ERROR_DESC"] = "error.description";
833    PersistentCacheKeys["ACTIVE_ACCOUNT"] = "active-account";
834    PersistentCacheKeys["ACTIVE_ACCOUNT_FILTERS"] = "active-account-filters"; // new cache entry for active_account for a more robust version for browser
835})(PersistentCacheKeys || (PersistentCacheKeys = {}));
836/**
837 * String constants related to AAD Authority
838 */
839var AADAuthorityConstants;
840(function (AADAuthorityConstants) {
841    AADAuthorityConstants["COMMON"] = "common";
842    AADAuthorityConstants["ORGANIZATIONS"] = "organizations";
843    AADAuthorityConstants["CONSUMERS"] = "consumers";
844})(AADAuthorityConstants || (AADAuthorityConstants = {}));
845/**
846 * Keys in the hashParams sent by AAD Server
847 */
848var AADServerParamKeys;
849(function (AADServerParamKeys) {
850    AADServerParamKeys["CLIENT_ID"] = "client_id";
851    AADServerParamKeys["REDIRECT_URI"] = "redirect_uri";
852    AADServerParamKeys["RESPONSE_TYPE"] = "response_type";
853    AADServerParamKeys["RESPONSE_MODE"] = "response_mode";
854    AADServerParamKeys["GRANT_TYPE"] = "grant_type";
855    AADServerParamKeys["CLAIMS"] = "claims";
856    AADServerParamKeys["SCOPE"] = "scope";
857    AADServerParamKeys["ERROR"] = "error";
858    AADServerParamKeys["ERROR_DESCRIPTION"] = "error_description";
859    AADServerParamKeys["ACCESS_TOKEN"] = "access_token";
860    AADServerParamKeys["ID_TOKEN"] = "id_token";
861    AADServerParamKeys["REFRESH_TOKEN"] = "refresh_token";
862    AADServerParamKeys["EXPIRES_IN"] = "expires_in";
863    AADServerParamKeys["STATE"] = "state";
864    AADServerParamKeys["NONCE"] = "nonce";
865    AADServerParamKeys["PROMPT"] = "prompt";
866    AADServerParamKeys["SESSION_STATE"] = "session_state";
867    AADServerParamKeys["CLIENT_INFO"] = "client_info";
868    AADServerParamKeys["CODE"] = "code";
869    AADServerParamKeys["CODE_CHALLENGE"] = "code_challenge";
870    AADServerParamKeys["CODE_CHALLENGE_METHOD"] = "code_challenge_method";
871    AADServerParamKeys["CODE_VERIFIER"] = "code_verifier";
872    AADServerParamKeys["CLIENT_REQUEST_ID"] = "client-request-id";
873    AADServerParamKeys["X_CLIENT_SKU"] = "x-client-SKU";
874    AADServerParamKeys["X_CLIENT_VER"] = "x-client-VER";
875    AADServerParamKeys["X_CLIENT_OS"] = "x-client-OS";
876    AADServerParamKeys["X_CLIENT_CPU"] = "x-client-CPU";
877    AADServerParamKeys["X_CLIENT_CURR_TELEM"] = "x-client-current-telemetry";
878    AADServerParamKeys["X_CLIENT_LAST_TELEM"] = "x-client-last-telemetry";
879    AADServerParamKeys["X_MS_LIB_CAPABILITY"] = "x-ms-lib-capability";
880    AADServerParamKeys["X_APP_NAME"] = "x-app-name";
881    AADServerParamKeys["X_APP_VER"] = "x-app-ver";
882    AADServerParamKeys["POST_LOGOUT_URI"] = "post_logout_redirect_uri";
883    AADServerParamKeys["ID_TOKEN_HINT"] = "id_token_hint";
884    AADServerParamKeys["DEVICE_CODE"] = "device_code";
885    AADServerParamKeys["CLIENT_SECRET"] = "client_secret";
886    AADServerParamKeys["CLIENT_ASSERTION"] = "client_assertion";
887    AADServerParamKeys["CLIENT_ASSERTION_TYPE"] = "client_assertion_type";
888    AADServerParamKeys["TOKEN_TYPE"] = "token_type";
889    AADServerParamKeys["REQ_CNF"] = "req_cnf";
890    AADServerParamKeys["OBO_ASSERTION"] = "assertion";
891    AADServerParamKeys["REQUESTED_TOKEN_USE"] = "requested_token_use";
892    AADServerParamKeys["ON_BEHALF_OF"] = "on_behalf_of";
893    AADServerParamKeys["FOCI"] = "foci";
894    AADServerParamKeys["CCS_HEADER"] = "X-AnchorMailbox";
895    AADServerParamKeys["RETURN_SPA_CODE"] = "return_spa_code";
896    AADServerParamKeys["NATIVE_BROKER"] = "nativebroker";
897    AADServerParamKeys["LOGOUT_HINT"] = "logout_hint";
898})(AADServerParamKeys || (AADServerParamKeys = {}));
899/**
900 * Claims request keys
901 */
902var ClaimsRequestKeys;
903(function (ClaimsRequestKeys) {
904    ClaimsRequestKeys["ACCESS_TOKEN"] = "access_token";
905    ClaimsRequestKeys["XMS_CC"] = "xms_cc";
906})(ClaimsRequestKeys || (ClaimsRequestKeys = {}));
907/**
908 * we considered making this "enum" in the request instead of string, however it looks like the allowed list of
909 * prompt values kept changing over past couple of years. There are some undocumented prompt values for some
910 * internal partners too, hence the choice of generic "string" type instead of the "enum"
911 */
912var PromptValue = {
913    LOGIN: "login",
914    SELECT_ACCOUNT: "select_account",
915    CONSENT: "consent",
916    NONE: "none",
917    CREATE: "create",
918    NO_SESSION: "no_session"
919};
920/**
921 * SSO Types - generated to populate hints
922 */
923var SSOTypes;
924(function (SSOTypes) {
925    SSOTypes["ACCOUNT"] = "account";
926    SSOTypes["SID"] = "sid";
927    SSOTypes["LOGIN_HINT"] = "login_hint";
928    SSOTypes["ID_TOKEN"] = "id_token";
929    SSOTypes["DOMAIN_HINT"] = "domain_hint";
930    SSOTypes["ORGANIZATIONS"] = "organizations";
931    SSOTypes["CONSUMERS"] = "consumers";
932    SSOTypes["ACCOUNT_ID"] = "accountIdentifier";
933    SSOTypes["HOMEACCOUNT_ID"] = "homeAccountIdentifier";
934})(SSOTypes || (SSOTypes = {}));
935/**
936 * allowed values for codeVerifier
937 */
938var CodeChallengeMethodValues = {
939    PLAIN: "plain",
940    S256: "S256"
941};
942/**
943 * allowed values for response_mode
944 */
945var ResponseMode;
946(function (ResponseMode) {
947    ResponseMode["QUERY"] = "query";
948    ResponseMode["FRAGMENT"] = "fragment";
949    ResponseMode["FORM_POST"] = "form_post";
950})(ResponseMode || (ResponseMode = {}));
951/**
952 * allowed grant_type
953 */
954var GrantType;
955(function (GrantType) {
956    GrantType["IMPLICIT_GRANT"] = "implicit";
957    GrantType["AUTHORIZATION_CODE_GRANT"] = "authorization_code";
958    GrantType["CLIENT_CREDENTIALS_GRANT"] = "client_credentials";
959    GrantType["RESOURCE_OWNER_PASSWORD_GRANT"] = "password";
960    GrantType["REFRESH_TOKEN_GRANT"] = "refresh_token";
961    GrantType["DEVICE_CODE_GRANT"] = "device_code";
962    GrantType["JWT_BEARER"] = "urn:ietf:params:oauth:grant-type:jwt-bearer";
963})(GrantType || (GrantType = {}));
964/**
965 * Account types in Cache
966 */
967var CacheAccountType;
968(function (CacheAccountType) {
969    CacheAccountType["MSSTS_ACCOUNT_TYPE"] = "MSSTS";
970    CacheAccountType["ADFS_ACCOUNT_TYPE"] = "ADFS";
971    CacheAccountType["MSAV1_ACCOUNT_TYPE"] = "MSA";
972    CacheAccountType["GENERIC_ACCOUNT_TYPE"] = "Generic"; // NTLM, Kerberos, FBA, Basic etc
973})(CacheAccountType || (CacheAccountType = {}));
974/**
975 * Separators used in cache
976 */
977var Separators;
978(function (Separators) {
979    Separators["CACHE_KEY_SEPARATOR"] = "-";
980    Separators["CLIENT_INFO_SEPARATOR"] = ".";
981})(Separators || (Separators = {}));
982/**
983 * Credential Type stored in the cache
984 */
985var CredentialType;
986(function (CredentialType) {
987    CredentialType["ID_TOKEN"] = "IdToken";
988    CredentialType["ACCESS_TOKEN"] = "AccessToken";
989    CredentialType["ACCESS_TOKEN_WITH_AUTH_SCHEME"] = "AccessToken_With_AuthScheme";
990    CredentialType["REFRESH_TOKEN"] = "RefreshToken";
991})(CredentialType || (CredentialType = {}));
992/**
993 * Combine all cache types
994 */
995var CacheType;
996(function (CacheType) {
997    CacheType[CacheType["ADFS"] = 1001] = "ADFS";
998    CacheType[CacheType["MSA"] = 1002] = "MSA";
999    CacheType[CacheType["MSSTS"] = 1003] = "MSSTS";
1000    CacheType[CacheType["GENERIC"] = 1004] = "GENERIC";
1001    CacheType[CacheType["ACCESS_TOKEN"] = 2001] = "ACCESS_TOKEN";
1002    CacheType[CacheType["REFRESH_TOKEN"] = 2002] = "REFRESH_TOKEN";
1003    CacheType[CacheType["ID_TOKEN"] = 2003] = "ID_TOKEN";
1004    CacheType[CacheType["APP_METADATA"] = 3001] = "APP_METADATA";
1005    CacheType[CacheType["UNDEFINED"] = 9999] = "UNDEFINED";
1006})(CacheType || (CacheType = {}));
1007/**
1008 * More Cache related constants
1009 */
1010var APP_METADATA = "appmetadata";
1011var CLIENT_INFO = "client_info";
1012var THE_FAMILY_ID = "1";
1013var AUTHORITY_METADATA_CONSTANTS = {
1014    CACHE_KEY: "authority-metadata",
1015    REFRESH_TIME_SECONDS: 3600 * 24 // 24 Hours
1016};
1017var AuthorityMetadataSource;
1018(function (AuthorityMetadataSource) {
1019    AuthorityMetadataSource["CONFIG"] = "config";
1020    AuthorityMetadataSource["CACHE"] = "cache";
1021    AuthorityMetadataSource["NETWORK"] = "network";
1022    AuthorityMetadataSource["HARDCODED_VALUES"] = "hardcoded_values";
1023})(AuthorityMetadataSource || (AuthorityMetadataSource = {}));
1024var SERVER_TELEM_CONSTANTS = {
1025    SCHEMA_VERSION: 5,
1026    MAX_CUR_HEADER_BYTES: 80,
1027    MAX_LAST_HEADER_BYTES: 330,
1028    MAX_CACHED_ERRORS: 50,
1029    CACHE_KEY: "server-telemetry",
1030    CATEGORY_SEPARATOR: "|",
1031    VALUE_SEPARATOR: ",",
1032    OVERFLOW_TRUE: "1",
1033    OVERFLOW_FALSE: "0",
1034    UNKNOWN_ERROR: "unknown_error"
1035};
1036/**
1037 * Type of the authentication request
1038 */
1039exports.AuthenticationScheme = void 0;
1040(function (AuthenticationScheme) {
1041    AuthenticationScheme["BEARER"] = "Bearer";
1042    AuthenticationScheme["POP"] = "pop";
1043    AuthenticationScheme["SSH"] = "ssh-cert";
1044})(exports.AuthenticationScheme || (exports.AuthenticationScheme = {}));
1045/**
1046 * Constants related to throttling
1047 */
1048var ThrottlingConstants = {
1049    // Default time to throttle RequestThumbprint in seconds
1050    DEFAULT_THROTTLE_TIME_SECONDS: 60,
1051    // Default maximum time to throttle in seconds, overrides what the server sends back
1052    DEFAULT_MAX_THROTTLE_TIME_SECONDS: 3600,
1053    // Prefix for storing throttling entries
1054    THROTTLING_PREFIX: "throttling",
1055    // Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling
1056    X_MS_LIB_CAPABILITY_VALUE: "retry-after, h429"
1057};
1058var Errors = {
1059    INVALID_GRANT_ERROR: "invalid_grant",
1060    CLIENT_MISMATCH_ERROR: "client_mismatch",
1061};
1062/**
1063 * Password grant parameters
1064 */
1065var PasswordGrantConstants;
1066(function (PasswordGrantConstants) {
1067    PasswordGrantConstants["username"] = "username";
1068    PasswordGrantConstants["password"] = "password";
1069})(PasswordGrantConstants || (PasswordGrantConstants = {}));
1070/**
1071 * Response codes
1072 */
1073var ResponseCodes;
1074(function (ResponseCodes) {
1075    ResponseCodes[ResponseCodes["httpSuccess"] = 200] = "httpSuccess";
1076    ResponseCodes[ResponseCodes["httpBadRequest"] = 400] = "httpBadRequest";
1077})(ResponseCodes || (ResponseCodes = {}));
1078/**
1079 * Region Discovery Sources
1080 */
1081var RegionDiscoverySources;
1082(function (RegionDiscoverySources) {
1083    RegionDiscoverySources["FAILED_AUTO_DETECTION"] = "1";
1084    RegionDiscoverySources["INTERNAL_CACHE"] = "2";
1085    RegionDiscoverySources["ENVIRONMENT_VARIABLE"] = "3";
1086    RegionDiscoverySources["IMDS"] = "4";
1087})(RegionDiscoverySources || (RegionDiscoverySources = {}));
1088/**
1089 * Region Discovery Outcomes
1090 */
1091var RegionDiscoveryOutcomes;
1092(function (RegionDiscoveryOutcomes) {
1093    RegionDiscoveryOutcomes["CONFIGURED_MATCHES_DETECTED"] = "1";
1094    RegionDiscoveryOutcomes["CONFIGURED_NO_AUTO_DETECTION"] = "2";
1095    RegionDiscoveryOutcomes["CONFIGURED_NOT_DETECTED"] = "3";
1096    RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_SUCCESSFUL"] = "4";
1097    RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_FAILED"] = "5";
1098})(RegionDiscoveryOutcomes || (RegionDiscoveryOutcomes = {}));
1099var CacheOutcome;
1100(function (CacheOutcome) {
1101    CacheOutcome["NO_CACHE_HIT"] = "0";
1102    CacheOutcome["FORCE_REFRESH"] = "1";
1103    CacheOutcome["NO_CACHED_ACCESS_TOKEN"] = "2";
1104    CacheOutcome["CACHED_ACCESS_TOKEN_EXPIRED"] = "3";
1105    CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
1106    CacheOutcome["CLAIMS_REQUESTED_CACHE_SKIPPED"] = "5";
1107})(CacheOutcome || (CacheOutcome = {}));
1108var JsonTypes;
1109(function (JsonTypes) {
1110    JsonTypes["Jwt"] = "JWT";
1111    JsonTypes["Jwk"] = "JWK";
1112    JsonTypes["Pop"] = "pop";
1113})(JsonTypes || (JsonTypes = {}));
1114
1115/*! @azure/msal-common v13.3.3 2024-06-06 */
1116
1117/*
1118 * Copyright (c) Microsoft Corporation. All rights reserved.
1119 * Licensed under the MIT License.
1120 */
1121/**
vendor: 5,178 bytes, lines 1122-1252
1122 * AuthErrorMessage class containing string constants used by error codes and messages.
1123 */
1124var AuthErrorMessage = {
1125    unexpectedError: {
1126        code: "unexpected_error",
1127        desc: "Unexpected error in authentication."
1128    },
1129    postRequestFailed: {
1130        code: "post_request_failed",
1131        desc: "Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."
1132    }
1133};
1134/**
1135 * General error class thrown by the MSAL.js library.
1136 */
1137var AuthError = /** @class */ (function (_super) {
1138    __extends(AuthError, _super);
1139    function AuthError(errorCode, errorMessage, suberror) {
1140        var _this = this;
1141        var errorString = errorMessage ? errorCode + ": " + errorMessage : errorCode;
1142        _this = _super.call(this, errorString) || this;
1143        Object.setPrototypeOf(_this, AuthError.prototype);
1144        _this.errorCode = errorCode || Constants.EMPTY_STRING;
1145        _this.errorMessage = errorMessage || Constants.EMPTY_STRING;
1146        _this.subError = suberror || Constants.EMPTY_STRING;
1147        _this.name = "AuthError";
1148        return _this;
1149    }
1150    AuthError.prototype.setCorrelationId = function (correlationId) {
1151        this.correlationId = correlationId;
1152    };
1153    /**
1154     * Creates an error that is thrown when something unexpected happens in the library.
1155     * @param errDesc
1156     */
1157    AuthError.createUnexpectedError = function (errDesc) {
1158        return new AuthError(AuthErrorMessage.unexpectedError.code, AuthErrorMessage.unexpectedError.desc + ": " + errDesc);
1159    };
1160    /**
1161     * Creates an error for post request failures.
1162     * @param errDesc
1163     * @returns
1164     */
1165    AuthError.createPostRequestFailed = function (errDesc) {
1166        return new AuthError(AuthErrorMessage.postRequestFailed.code, AuthErrorMessage.postRequestFailed.desc + ": " + errDesc);
1167    };
1168    return AuthError;
1169}(Error));
1170
1171/*! @azure/msal-common v13.3.3 2024-06-06 */
1172
1173/*
1174 * Copyright (c) Microsoft Corporation. All rights reserved.
1175 * Licensed under the MIT License.
1176 */
1177var DEFAULT_CRYPTO_IMPLEMENTATION = {
1178    createNewGuid: function () {
1179        var notImplErr = "Crypto interface - createNewGuid() has not been implemented";
1180        throw AuthError.createUnexpectedError(notImplErr);
1181    },
1182    base64Decode: function () {
1183        var notImplErr = "Crypto interface - base64Decode() has not been implemented";
1184        throw AuthError.createUnexpectedError(notImplErr);
1185    },
1186    base64Encode: function () {
1187        var notImplErr = "Crypto interface - base64Encode() has not been implemented";
1188        throw AuthError.createUnexpectedError(notImplErr);
1189    },
1190    generatePkceCodes: function () {
1191        return __awaiter(this, void 0, void 0, function () {
1192            var notImplErr;
1193            return __generator(this, function (_a) {
1194                notImplErr = "Crypto interface - generatePkceCodes() has not been implemented";
1195                throw AuthError.createUnexpectedError(notImplErr);
1196            });
1197        });
1198    },
1199    getPublicKeyThumbprint: function () {
1200        return __awaiter(this, void 0, void 0, function () {
1201            var notImplErr;
1202            return __generator(this, function (_a) {
1203                notImplErr = "Crypto interface - getPublicKeyThumbprint() has not been implemented";
1204                throw AuthError.createUnexpectedError(notImplErr);
1205            });
1206        });
1207    },
1208    removeTokenBindingKey: function () {
1209        return __awaiter(this, void 0, void 0, function () {
1210            var notImplErr;
1211            return __generator(this, function (_a) {
1212                notImplErr = "Crypto interface - removeTokenBindingKey() has not been implemented";
1213                throw AuthError.createUnexpectedError(notImplErr);
1214            });
1215        });
1216    },
1217    clearKeystore: function () {
1218        return __awaiter(this, void 0, void 0, function () {
1219            var notImplErr;
1220            return __generator(this, function (_a) {
1221                notImplErr = "Crypto interface - clearKeystore() has not been implemented";
1222                throw AuthError.createUnexpectedError(notImplErr);
1223            });
1224        });
1225    },
1226    signJwt: function () {
1227        return __awaiter(this, void 0, void 0, function () {
1228            var notImplErr;
1229            return __generator(this, function (_a) {
1230                notImplErr = "Crypto interface - signJwt() has not been implemented";
1231                throw AuthError.createUnexpectedError(notImplErr);
1232            });
1233        });
1234    },
1235    hashString: function () {
1236        return __awaiter(this, void 0, void 0, function () {
1237            var notImplErr;
1238            return __generator(this, function (_a) {
1239                notImplErr = "Crypto interface - hashString() has not been implemented";
1240                throw AuthError.createUnexpectedError(notImplErr);
1241            });
1242        });
1243    }
1244};
1245
1246/*! @azure/msal-common v13.3.3 2024-06-06 */
1247
1248/*
1249 * Copyright (c) Microsoft Corporation. All rights reserved.
1250 * Licensed under the MIT License.
1251 */
1252/**
1253 * ClientAuthErrorMessage class containing string constants used by error codes and messages.
1254 */
1255var ClientAuthErrorMessage = {
1256    clientInfoDecodingError: {
1257        code: "client_info_decoding_error",
1258        desc: "The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."
1259    },
1260    clientInfoEmptyError: {
1261        code: "client_info_empty_error",
1262        desc: "The client info was empty. Please review the trace to determine the root cause."
1263    },
1264    tokenParsingError: {
1265        code: "token_parsing_error",
1266        desc: "Token cannot be parsed. Please review stack trace to determine root cause."
1267    },
1268    nullOrEmptyToken: {
1269        code: "null_or_empty_token",
1270        desc: "The token is null or empty. Please review the trace to determine the root cause."
1271    },
1272    endpointResolutionError: {
1273        code: "endpoints_resolution_error",
1274        desc: "Error: could not resolve endpoints. Please check network and try again."
1275    },
1276    networkError: {
1277        code: "network_error",
1278        desc: "Network request failed. Please check network trace to determine root cause."
1279    },
1280    unableToGetOpenidConfigError: {
1281        code: "openid_config_error",
1282        desc: "Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."
1283    },
1284    hashNotDeserialized: {
1285        code: "hash_not_deserialized",
1286        desc: "The hash parameters could not be deserialized. Please review the trace to determine the root cause."
1287    },
1288    blankGuidGenerated: {
1289        code: "blank_guid_generated",
1290        desc: "The guid generated was blank. Please review the trace to determine the root cause."
1291    },
1292    invalidStateError: {
1293        code: "invalid_state",
1294        desc: "State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."
1295    },
1296    stateMismatchError: {
1297        code: "state_mismatch",
1298        desc: "State mismatch error. Please check your network. Continued requests may cause cache overflow."
1299    },
1300    stateNotFoundError: {
1301        code: "state_not_found",
1302        desc: "State not found"
1303    },
1304    nonceMismatchError: {
1305        code: "nonce_mismatch",
1306        desc: "Nonce mismatch error. This may be caused by a race condition in concurrent requests."
1307    },
1308    nonceNotFoundError: {
1309        code: "nonce_not_found",
1310        desc: "nonce not found"
1311    },
1312    authTimeNotFoundError: {
1313        code: "auth_time_not_found",
1314        desc: "Max Age was requested and the ID token is missing the auth_time variable." +
1315            " auth_time is an optional claim and is not enabled by default - it must be enabled." +
1316            " See https://aka.ms/msaljs/optional-claims for more information."
1317    },
1318    maxAgeTranspiredError: {
1319        code: "max_age_transpired",
1320        desc: "Max Age is set to 0, or too much time has elapsed since the last end-user authentication."
1321    },
1322    noTokensFoundError: {
1323        code: "no_tokens_found",
1324        desc: "No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."
1325    },
1326    multipleMatchingTokens: {
1327        code: "multiple_matching_tokens",
1328        desc: "The cache contains multiple tokens satisfying the requirements. " +
1329            "Call AcquireToken again providing more requirements such as authority or account."
1330    },
1331    multipleMatchingAccounts: {
1332        code: "multiple_matching_accounts",
1333        desc: "The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"
1334    },
1335    multipleMatchingAppMetadata: {
1336        code: "multiple_matching_appMetadata",
1337        desc: "The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"
1338    },
1339    tokenRequestCannotBeMade: {
1340        code: "request_cannot_be_made",
1341        desc: "Token request cannot be made without authorization code or refresh token."
1342    },
1343    appendEmptyScopeError: {
1344        code: "cannot_append_empty_scope",
1345        desc: "Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."
1346    },
1347    removeEmptyScopeError: {
1348        code: "cannot_remove_empty_scope",
1349        desc: "Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."
1350    },
1351    appendScopeSetError: {
1352        code: "cannot_append_scopeset",
1353        desc: "Cannot append ScopeSet due to error."
1354    },
1355    emptyInputScopeSetError: {
1356        code: "empty_input_scopeset",
1357        desc: "Empty input ScopeSet cannot be processed."
1358    },
1359    DeviceCodePollingCancelled: {
1360        code: "device_code_polling_cancelled",
1361        desc: "Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."
1362    },
1363    DeviceCodeExpired: {
1364        code: "device_code_expired",
1365        desc: "Device code is expired."
1366    },
1367    DeviceCodeUnknownError: {
1368        code: "device_code_unknown_error",
1369        desc: "Device code stopped polling for unknown reasons."
1370    },
1371    NoAccountInSilentRequest: {
1372        code: "no_account_in_silent_request",
1373        desc: "Please pass an account object, silent flow is not supported without account information"
1374    },
1375    invalidCacheRecord: {
vendor: 7,287 bytes, lines 1376-1529
1376        code: "invalid_cache_record",
1377        desc: "Cache record object was null or undefined."
1378    },
1379    invalidCacheEnvironment: {
1380        code: "invalid_cache_environment",
1381        desc: "Invalid environment when attempting to create cache entry"
1382    },
1383    noAccountFound: {
1384        code: "no_account_found",
1385        desc: "No account found in cache for given key."
1386    },
1387    CachePluginError: {
1388        code: "no cache plugin set on CacheManager",
1389        desc: "ICachePlugin needs to be set before using readFromStorage or writeFromStorage"
1390    },
1391    noCryptoObj: {
1392        code: "no_crypto_object",
1393        desc: "No crypto object detected. This is required for the following operation: "
1394    },
1395    invalidCacheType: {
1396        code: "invalid_cache_type",
1397        desc: "Invalid cache type"
1398    },
1399    unexpectedAccountType: {
1400        code: "unexpected_account_type",
1401        desc: "Unexpected account type."
1402    },
1403    unexpectedCredentialType: {
1404        code: "unexpected_credential_type",
1405        desc: "Unexpected credential type."
1406    },
1407    invalidAssertion: {
1408        code: "invalid_assertion",
1409        desc: "Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"
1410    },
1411    invalidClientCredential: {
1412        code: "invalid_client_credential",
1413        desc: "Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"
1414    },
1415    tokenRefreshRequired: {
1416        code: "token_refresh_required",
1417        desc: "Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."
1418    },
1419    userTimeoutReached: {
1420        code: "user_timeout_reached",
1421        desc: "User defined timeout for device code polling reached",
1422    },
1423    tokenClaimsRequired: {
1424        code: "token_claims_cnf_required_for_signedjwt",
1425        desc: "Cannot generate a POP jwt if the token_claims are not populated"
1426    },
1427    noAuthorizationCodeFromServer: {
1428        code: "authorization_code_missing_from_server_response",
1429        desc: "Server response does not contain an authorization code to proceed"
1430    },
1431    noAzureRegionDetected: {
1432        code: "no_azure_region_detected",
1433        desc: "No azure region was detected and no fallback was made available"
1434    },
1435    accessTokenEntityNullError: {
1436        code: "access_token_entity_null",
1437        desc: "Access token entity is null, please check logs and cache to ensure a valid access token is present."
1438    },
1439    bindingKeyNotRemovedError: {
1440        code: "binding_key_not_removed",
1441        desc: "Could not remove the credential's binding key from storage."
1442    },
1443    logoutNotSupported: {
1444        code: "end_session_endpoint_not_supported",
1445        desc: "Provided authority does not support logout."
1446    },
1447    keyIdMissing: {
1448        code: "key_id_missing",
1449        desc: "A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."
1450    },
1451    noNetworkConnectivity: {
1452        code: "no_network_connectivity",
1453        desc: "No network connectivity. Check your internet connection."
1454    },
1455    userCanceledError: {
1456        code: "user_canceled",
1457        desc: "User canceled the flow."
1458    }
1459};
1460/**
1461 * Error thrown when there is an error in the client code running on the browser.
1462 */
1463var ClientAuthError = /** @class */ (function (_super) {
1464    __extends(ClientAuthError, _super);
1465    function ClientAuthError(errorCode, errorMessage) {
1466        var _this = _super.call(this, errorCode, errorMessage) || this;
1467        _this.name = "ClientAuthError";
1468        Object.setPrototypeOf(_this, ClientAuthError.prototype);
1469        return _this;
1470    }
1471    /**
1472     * Creates an error thrown when client info object doesn't decode correctly.
1473     * @param caughtError
1474     */
1475    ClientAuthError.createClientInfoDecodingError = function (caughtError) {
1476        return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code, ClientAuthErrorMessage.clientInfoDecodingError.desc + " Failed with error: " + caughtError);
1477    };
1478    /**
1479     * Creates an error thrown if the client info is empty.
1480     * @param rawClientInfo
1481     */
1482    ClientAuthError.createClientInfoEmptyError = function () {
1483        return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code, "" + ClientAuthErrorMessage.clientInfoEmptyError.desc);
1484    };
1485    /**
1486     * Creates an error thrown when the id token extraction errors out.
1487     * @param err
1488     */
1489    ClientAuthError.createTokenParsingError = function (caughtExtractionError) {
1490        return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code, ClientAuthErrorMessage.tokenParsingError.desc + " Failed with error: " + caughtExtractionError);
1491    };
1492    /**
1493     * Creates an error thrown when the id token string is null or empty.
1494     * @param invalidRawTokenString
1495     */
1496    ClientAuthError.createTokenNullOrEmptyError = function (invalidRawTokenString) {
1497        return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code, ClientAuthErrorMessage.nullOrEmptyToken.desc + " Raw Token Value: " + invalidRawTokenString);
1498    };
1499    /**
1500     * Creates an error thrown when the endpoint discovery doesn't complete correctly.
1501     */
1502    ClientAuthError.createEndpointDiscoveryIncompleteError = function (errDetail) {
1503        return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code, ClientAuthErrorMessage.endpointResolutionError.desc + " Detail: " + errDetail);
1504    };
1505    /**
1506     * Creates an error thrown when the fetch client throws
1507     */
1508    ClientAuthError.createNetworkError = function (endpoint, errDetail) {
1509        return new ClientAuthError(ClientAuthErrorMessage.networkError.code, ClientAuthErrorMessage.networkError.desc + " | Fetch client threw: " + errDetail + " | Attempted to reach: " + endpoint.split("?")[0]);
1510    };
1511    /**
1512     * Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data
1513     */
1514    ClientAuthError.createUnableToGetOpenidConfigError = function (errDetail) {
1515        return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code, ClientAuthErrorMessage.unableToGetOpenidConfigError.desc + " Attempted to retrieve endpoints from: " + errDetail);
1516    };
1517    /**
1518     * Creates an error thrown when the hash cannot be deserialized.
1519     * @param hashParamObj
1520     */
1521    ClientAuthError.createHashNotDeserializedError = function (hashParamObj) {
1522        return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code, ClientAuthErrorMessage.hashNotDeserialized.desc + " Given Object: " + hashParamObj);
1523    };
1524    /**
1525     * Creates an error thrown when the state cannot be parsed.
1526     * @param invalidState
1527     */
1528    ClientAuthError.createInvalidStateError = function (invalidState, errorString) {
1529        return new ClientAuthError(ClientAuthErrorMessage.invali
1529dStateError.code, ClientAuthErrorMessage.invalidStateError.desc + " Invalid State: " + invalidState + ", Root Err: " + errorString);
1530    };
1531    /**
1532     * Creates an error thrown when two states do not match.
1533     */
1534    ClientAuthError.createStateMismatchError = function () {
1535        return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code, ClientAuthErrorMessage.stateMismatchError.desc);
1536    };
1537    /**
1538     * Creates an error thrown when the state is not present
1539     * @param missingState
1540     */
1541    ClientAuthError.createStateNotFoundError = function (missingState) {
1542        return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code, ClientAuthErrorMessage.stateNotFoundError.desc + ":  " + missingState);
1543    };
1544    /**
1545     * Creates an error thrown when the nonce does not match.
1546     */
1547    ClientAuthError.createNonceMismatchError = function () {
1548        return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code, ClientAuthErrorMessage.nonceMismatchError.desc);
1549    };
1550    /**
1551     * Creates an error thrown when max_age was provided in the request, but auth_time is not in the token claims
1552     * @param missingNonce
1553     */
1554    ClientAuthError.createAuthTimeNotFoundError = function () {
1555        return new ClientAuthError(ClientAuthErrorMessage.authTimeNotFoundError.code, ClientAuthErrorMessage.authTimeNotFoundError.desc);
1556    };
1557    /**
1558     * Creates an error thrown when too much time has elapsed since the last end-user authentication
1559     */
1560    ClientAuthError.createMaxAgeTranspiredError = function () {
1561        return new ClientAuthError(ClientAuthErrorMessage.maxAgeTranspiredError.code, ClientAuthErrorMessage.maxAgeTranspiredError.desc);
1562    };
1563    /**
1564     * Creates an error thrown when the mnonce is not present
1565     * @param missingNonce
1566     */
1567    ClientAuthError.createNonceNotFoundError = function (missingNonce) {
1568        return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code, ClientAuthErrorMessage.nonceNotFoundError.desc + ":  " + missingNonce);
1569    };
1570    /**
1571     * Throws error when multiple tokens are in cache.
1572     */
1573    ClientAuthError.createMultipleMatchingTokensInCacheError = function () {
1574        return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code, ClientAuthErrorMessage.multipleMatchingTokens.desc + ".");
1575    };
1576    /**
1577     * Throws error when multiple accounts are in cache for the given params
1578     */
1579    ClientAuthError.createMultipleMatchingAccountsInCacheError = function () {
1580        return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code, ClientAuthErrorMessage.multipleMatchingAccounts.desc);
1581    };
1582    /**
1583     * Throws error when multiple appMetada are in cache for the given clientId.
1584     */
1585    ClientAuthError.createMultipleMatchingAppMetadataInCacheError = function () {
1586        return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code, ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);
1587    };
1588    /**
1589     * Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.
1590     */
1591    ClientAuthError.createTokenRequestCannotBeMadeError = function () {
1592        return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);
1593    };
1594    /**
1595     * Throws error when attempting to append a null, undefined or empty scope to a set
1596     * @param givenScope
1597     */
1598    ClientAuthError.createAppendEmptyScopeToSetError = function (givenScope) {
1599        return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, ClientAuthErrorMessage.appendEmptyScopeError.desc + " Given Scope: " + givenScope);
1600    };
1601    /**
1602     * Throws error when attempting to append a null, undefined or empty scope to a set
1603     * @param givenScope
1604     */
1605    ClientAuthError.createRemoveEmptyScopeFromSetError = function (givenScope) {
1606        return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, ClientAuthErrorMessage.removeEmptyScopeError.desc + " Given Scope: " + givenScope);
1607    };
1608    /**
1609     * Throws error when attempting to append null or empty ScopeSet.
1610     * @param appendError
1611     */
1612    ClientAuthError.createAppendScopeSetError = function (appendError) {
1613        return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, ClientAuthErrorMessage.appendScopeSetError.desc + " Detail Error: " + appendError);
1614    };
1615    /**
1616     * Throws error if ScopeSet is null or undefined.
1617     * @param givenScopeSet
1618     */
1619    ClientAuthError.createEmptyInputScopeSetError = function () {
1620        return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, "" + ClientAuthErrorMessage.emptyInputScopeSetError.desc);
1621    };
1622    /**
1623     * Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow
1624     */
1625    ClientAuthError.createDeviceCodeCancelledError = function () {
1626        return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, "" + ClientAuthErrorMessage.DeviceCodePollingCancelled.desc);
1627    };
1628    /**
1629     * Throws error if device code is expired
1630     */
1631    ClientAuthError.createDeviceCodeExpiredError = function () {
1632        return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, "" + ClientAuthErrorMessage.DeviceCodeExpired.desc);
1633    };
1634    /**
1635     * Throws error if device code is expired
1636     */
1637    ClientAuthError.createDeviceCodeUnknownError = function () {
1638        return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, "" + ClientAuthErrorMessage.DeviceCodeUnknownError.desc);
1639    };
1640    /**
1641     * Throws error when silent requests are made without an account object
1642     */
1643    ClientAuthError.createNoAccountInSilentRequestError = function () {
1644        return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, "" + ClientAuthErrorMessage.NoAccountInSilentRequest.desc);
1645    };
1646    /**
1647     * Throws error when cache record is null or undefined.
1648     */
1649    ClientAuthError.createNullOrUndefinedCacheRecord = function () {
1650        return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);
1651    };
1652    /**
1653     * Throws error when provided environment is not part of the CloudDiscoveryMetadata object
1654     */
1655    ClientAuthError.createInvalidCacheEnvironmentError = function () {
1656        return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);
1657    };
1658    /**
1659     * Throws error when account is not found in cache.
1660     */
1661    ClientAuthError.createNoAccountFoundError = function () {
1662        return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);
1663    };
1664    /**
1665     * Throws error if ICachePlugin not set on CacheManager.
1666     */
1667    ClientAuthError.createCachePluginError = function () {
1668        return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, "" + ClientAuthErrorMessage.CachePluginError.desc);
1669    };
1670    /**
1671     * Throws error if crypto object not found.
1672     * @param operationName
1673     */
1674    ClientAuthError.createNoCryptoObjectError = function (operationName) {
1675        return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, "" + ClientAuthErrorMessage.noCryptoObj.desc + operationName);
1676    };
1677    /**
1678     * Throws error if cache type is invalid.
1679     */
1680    ClientAuthError.createInvalidCacheTypeError = function () {
1681        return new ClientAuthError(ClientAuthErrorMessage.invali
1681dCacheType.code, "" + ClientAuthErrorMessage.invalidCacheType.desc);
1682    };
1683    /**
1684     * Throws error if unexpected account type.
1685     */
1686    ClientAuthError.createUnexpectedAccountTypeError = function () {
1687        return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, "" + ClientAuthErrorMessage.unexpectedAccountType.desc);
1688    };
1689    /**
1690     * Throws error if unexpected credential type.
1691     */
1692    ClientAuthError.createUnexpectedCredentialTypeError = function () {
1693        return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, "" + ClientAuthErrorMessage.unexpectedCredentialType.desc);
1694    };
1695    /**
1696     * Throws error if client assertion is not valid.
1697     */
1698    ClientAuthError.createInvalidAssertionError = function () {
1699        return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, "" + ClientAuthErrorMessage.invalidAssertion.desc);
1700    };
1701    /**
1702     * Throws error if client assertion is not valid.
1703     */
1704    ClientAuthError.createInvalidCredentialError = function () {
1705        return new ClientAuthError(ClientAuthErrorMessage.invali
vendor: 11,200 bytes, lines 1705-1987
1705dClientCredential.code, "" + ClientAuthErrorMessage.invalidClientCredential.desc);
1706    };
1707    /**
1708     * Throws error if token cannot be retrieved from cache due to refresh being required.
1709     */
1710    ClientAuthError.createRefreshRequiredError = function () {
1711        return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);
1712    };
1713    /**
1714     * Throws error if the user defined timeout is reached.
1715     */
1716    ClientAuthError.createUserTimeoutReachedError = function () {
1717        return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);
1718    };
1719    /*
1720     * Throws error if token claims are not populated for a signed jwt generation
1721     */
1722    ClientAuthError.createTokenClaimsRequiredError = function () {
1723        return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);
1724    };
1725    /**
1726     * Throws error when the authorization code is missing from the server response
1727     */
1728    ClientAuthError.createNoAuthCodeInServerResponseError = function () {
1729        return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);
1730    };
1731    ClientAuthError.createBindingKeyNotRemovedError = function () {
1732        return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);
1733    };
1734    /**
1735     * Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint
1736     */
1737    ClientAuthError.createLogoutNotSupportedError = function () {
1738        return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);
1739    };
1740    /**
1741     * Create an error when kid attribute is missing from a PoP token's cache record
1742     */
1743    ClientAuthError.createKeyIdMissingError = function () {
1744        return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);
1745    };
1746    /**
1747     * Create an error when the client does not have network connectivity
1748     */
1749    ClientAuthError.createNoNetworkConnectivityError = function () {
1750        return new ClientAuthError(ClientAuthErrorMessage.noNetworkConnectivity.code, ClientAuthErrorMessage.noNetworkConnectivity.desc);
1751    };
1752    /**
1753     * Create an error when the user cancels the flow
1754     */
1755    ClientAuthError.createUserCanceledError = function () {
1756        return new ClientAuthError(ClientAuthErrorMessage.userCanceledError.code, ClientAuthErrorMessage.userCanceledError.desc);
1757    };
1758    return ClientAuthError;
1759}(AuthError));
1760
1761/*! @azure/msal-common v13.3.3 2024-06-06 */
1762
1763/*
1764 * Copyright (c) Microsoft Corporation. All rights reserved.
1765 * Licensed under the MIT License.
1766 */
1767/**
1768 * @hidden
1769 */
1770var StringUtils = /** @class */ (function () {
1771    function StringUtils() {
1772    }
1773    /**
1774     * decode a JWT
1775     *
1776     * @param authToken
1777     */
1778    StringUtils.decodeAuthToken = function (authToken) {
1779        if (StringUtils.isEmpty(authToken)) {
1780            throw ClientAuthError.createTokenNullOrEmptyError(authToken);
1781        }
1782        var tokenPartsRegex = /^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/;
1783        var matches = tokenPartsRegex.exec(authToken);
1784        if (!matches || matches.length < 4) {
1785            throw ClientAuthError.createTokenParsingError("Given token is malformed: " + JSON.stringify(authToken));
1786        }
1787        var crackedToken = {
1788            header: matches[1],
1789            JWSPayload: matches[2],
1790            JWSSig: matches[3]
1791        };
1792        return crackedToken;
1793    };
1794    /**
1795     * Check if a string is empty.
1796     *
1797     * @param str
1798     */
1799    StringUtils.isEmpty = function (str) {
1800        return (typeof str === "undefined" || !str || 0 === str.length);
1801    };
1802    /**
1803     * Check if stringified object is empty
1804     * @param strObj
1805     */
1806    StringUtils.isEmptyObj = function (strObj) {
1807        if (strObj && !StringUtils.isEmpty(strObj)) {
1808            try {
1809                var obj = JSON.parse(strObj);
1810                return Object.keys(obj).length === 0;
1811            }
1812            catch (e) { }
1813        }
1814        return true;
1815    };
1816    StringUtils.startsWith = function (str, search) {
1817        return str.indexOf(search) === 0;
1818    };
1819    StringUtils.endsWith = function (str, search) {
1820        return (str.length >= search.length) && (str.lastIndexOf(search) === (str.length - search.length));
1821    };
1822    /**
1823     * Parses string into an object.
1824     *
1825     * @param query
1826     */
1827    StringUtils.queryStringToObject = function (query) {
1828        var obj = {};
1829        var params = query.split("&");
1830        var decode = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); };
1831        params.forEach(function (pair) {
1832            if (pair.trim()) {
1833                var _a = pair.split(/=(.+)/g, 2), key = _a[0], value = _a[1]; // Split on the first occurence of the '=' character
1834                if (key && value) {
1835                    obj[decode(key)] = decode(value);
1836                }
1837            }
1838        });
1839        return obj;
1840    };
1841    /**
1842     * Trims entries in an array.
1843     *
1844     * @param arr
1845     */
1846    StringUtils.trimArrayEntries = function (arr) {
1847        return arr.map(function (entry) { return entry.trim(); });
1848    };
1849    /**
1850     * Removes empty strings from array
1851     * @param arr
1852     */
1853    StringUtils.removeEmptyStringsFromArray = function (arr) {
1854        return arr.filter(function (entry) {
1855            return !StringUtils.isEmpty(entry);
1856        });
1857    };
1858    /**
1859     * Attempts to parse a string into JSON
1860     * @param str
1861     */
1862    StringUtils.jsonParseHelper = function (str) {
1863        try {
1864            return JSON.parse(str);
1865        }
1866        catch (e) {
1867            return null;
1868        }
1869    };
1870    /**
1871     * Tests if a given string matches a given pattern, with support for wildcards and queries.
1872     * @param pattern Wildcard pattern to string match. Supports "*" for wildcards and "?" for queries
1873     * @param input String to match against
1874     */
1875    StringUtils.matchPattern = function (pattern, input) {
1876        /**
1877         * Wildcard support: https://stackoverflow.com/a/3117248/4888559
1878         * Queries: replaces "?" in string with escaped "\?" for regex test
1879         */
1880        var regex = new RegExp(pattern.replace(/\\/g, "\\\\").replace(/\*/g, "[^ ]*").replace(/\?/g, "\\\?")); // eslint-disable-line security/detect-non-literal-regexp
1881        return regex.test(input);
1882    };
1883    return StringUtils;
1884}());
1885
1886/*! @azure/msal-common v13.3.3 2024-06-06 */
1887
1888/*
1889 * Copyright (c) Microsoft Corporation. All rights reserved.
1890 * Licensed under the MIT License.
1891 */
1892/**
1893 * Log message level.
1894 */
1895exports.LogLevel = void 0;
1896(function (LogLevel) {
1897    LogLevel[LogLevel["Error"] = 0] = "Error";
1898    LogLevel[LogLevel["Warning"] = 1] = "Warning";
1899    LogLevel[LogLevel["Info"] = 2] = "Info";
1900    LogLevel[LogLevel["Verbose"] = 3] = "Verbose";
1901    LogLevel[LogLevel["Trace"] = 4] = "Trace";
1902})(exports.LogLevel || (exports.LogLevel = {}));
1903/**
1904 * Class which facilitates logging of messages to a specific place.
1905 */
1906var Logger = /** @class */ (function () {
1907    function Logger(loggerOptions, packageName, packageVersion) {
1908        // Current log level, defaults to info.
1909        this.level = exports.LogLevel.Info;
1910        var defaultLoggerCallback = function () {
1911            return;
1912        };
1913        var setLoggerOptions = loggerOptions || Logger.createDefaultLoggerOptions();
1914        this.localCallback = setLoggerOptions.loggerCallback || defaultLoggerCallback;
1915        this.piiLoggingEnabled = setLoggerOptions.piiLoggingEnabled || false;
1916        this.level = typeof (setLoggerOptions.logLevel) === "number" ? setLoggerOptions.logLevel : exports.LogLevel.Info;
1917        this.correlationId = setLoggerOptions.correlationId || Constants.EMPTY_STRING;
1918        this.packageName = packageName || Constants.EMPTY_STRING;
1919        this.packageVersion = packageVersion || Constants.EMPTY_STRING;
1920    }
1921    Logger.createDefaultLoggerOptions = function () {
1922        return {
1923            loggerCallback: function () {
1924                // allow users to not set loggerCallback
1925            },
1926            piiLoggingEnabled: false,
1927            logLevel: exports.LogLevel.Info
1928        };
1929    };
1930    /**
1931     * Create new Logger with existing configurations.
1932     */
1933    Logger.prototype.clone = function (packageName, packageVersion, correlationId) {
1934        return new Logger({ loggerCallback: this.localCallback, piiLoggingEnabled: this.piiLoggingEnabled, logLevel: this.level, correlationId: correlationId || this.correlationId }, packageName, packageVersion);
1935    };
1936    /**
1937     * Log message with required options.
1938     */
1939    Logger.prototype.logMessage = function (logMessage, options) {
1940        if ((options.logLevel > this.level) || (!this.piiLoggingEnabled && options.containsPii)) {
1941            return;
1942        }
1943        var timestamp = new Date().toUTCString();
1944        // Add correlationId to logs if set, correlationId provided on log messages take precedence
1945        var logHeader;
1946        if (!StringUtils.isEmpty(options.correlationId)) {
1947            logHeader = "[" + timestamp + "] : [" + options.correlationId + "]";
1948        }
1949        else if (!StringUtils.isEmpty(this.correlationId)) {
1950            logHeader = "[" + timestamp + "] : [" + this.correlationId + "]";
1951        }
1952        else {
1953            logHeader = "[" + timestamp + "]";
1954        }
1955        var log = logHeader + " : " + this.packageName + "@" + this.packageVersion + " : " + exports.LogLevel[options.logLevel] + " - " + logMessage;
1956        // debug(`msal:${LogLevel[options.logLevel]}${options.containsPii ? "-Pii": Constants.EMPTY_STRING}${options.context ? `:${options.context}` : Constants.EMPTY_STRING}`)(logMessage);
1957        this.executeCallback(options.logLevel, log, options.containsPii || false);
1958    };
1959    /**
1960     * Execute callback with message.
1961     */
1962    Logger.prototype.executeCallback = function (level, message, containsPii) {
1963        if (this.localCallback) {
1964            this.localCallback(level, message, containsPii);
1965        }
1966    };
1967    /**
1968     * Logs error messages.
1969     */
1970    Logger.prototype.error = function (message, correlationId) {
1971        this.logMessage(message, {
1972            logLevel: exports.LogLevel.Error,
1973            containsPii: false,
1974            correlationId: correlationId || Constants.EMPTY_STRING
1975        });
1976    };
1977    /**
1978     * Logs error messages with PII.
1979     */
1980    Logger.prototype.errorPii = function (message, correlationId) {
1981        this.logMessage(message, {
1982            logLevel: exports.LogLevel.Error,
1983            containsPii: true,
1984            correlationId: correlationId || Constants.EMPTY_STRING
1985        });
1986    };
1987    /**
1988     * Logs warning messages.
1989     */
1990    Logger.prototype.warning = function (message, correlationId) {
1991        this.logMessage(message, {
1992            logLevel: exports.LogLevel.Warning,
1993            containsPii: false,
1994            correlationId: correlationId || Constants.EMPTY_STRING
1995        });
1996    };
1997    /**
1998     * Logs warning messages with PII.
1999     */
2000    Logger.prototype.warningPii = function (message, correlationId) {
2001        this.logMessage(message, {
2002            logLevel: exports.LogLevel.Warning,
2003            containsPii: true,
2004            correlationId: correlationId || Constants.EMPTY_STRING
2005        });
2006    };
2007    /**
2008     * Logs info messages.
2009     */
2010    Logger.prototype.info = function (message, correlationId) {
2011        this.logMessage(message, {
2012            logLevel: exports.LogLevel.Info,
2013            containsPii: false,
2014            correlationId: correlationId || Constants.EMPTY_STRING
2015        });
2016    };
2017    /**
2018     * Logs info messages with PII.
2019     */
2020    Logger.prototype.infoPii = function (message, correlationId) {
2021        this.logMessage(message, {
2022            logLevel: exports.LogLevel.Info,
2023            containsPii: true,
2024            correlationId: correlationId || Constants.EMPTY_STRING
2025        });
2026    };
2027    /**
2028     * Logs verbose messages.
2029     */
2030    Logger.prototype.verbose = function (message, correlationId) {
2031        this.logMessage(message, {
2032            logLevel: exports.LogLevel.Verbose,
2033            containsPii: false,
2034            correlationId: correlationId || Constants.EMPTY_STRING
2035        });
2036    };
2037    /**
2038     * Logs verbose messages with PII.
2039     */
2040    Logger.prototype.verbosePii = function (message, correlationId) {
2041        this.logMessage(message, {
2042            logLevel: exports.LogLevel.Verbose,
2043            containsPii: true,
2044            correlationId: correlationId || Constants.EMPTY_STRING
2045        });
2046    };
2047    /**
2048     * Logs trace messages.
2049     */
2050    Logger.prototype.trace = function (message, correlationId) {
2051        this.logMessage(message, {
2052            logLevel: exports.LogLevel.Trace,
2053            containsPii: false,
2054            correlationId: correlationId || Constants.EMPTY_STRING
2055        });
2056    };
2057    /**
2058     * Logs trace messages with PII.
2059     */
2060    Logger.prototype.tracePii = function (message, correlationId) {
2061        this.logMessage(message, {
2062            logLevel: exports.LogLevel.Trace,
2063            containsPii: true,
2064            correlationId: correlationId || Constants.EMPTY_STRING
2065        });
2066    };
2067    /**
2068     * Returns whether PII Logging is enabled or not.
2069     */
2070    Logger.prototype.isPiiLoggingEnabled = function () {
2071        return this.piiLoggingEnabled || false;
2072    };
2073    return Logger;
2074}());
2075
2076/*! @azure/msal-common v13.3.3 2024-06-06 */
2077/* eslint-disable header/header */
2078var name$1 = "@azure/msal-common";
2079var version$1 = "13.3.3";
2080
2081/*! @azure/msal-common v13.3.3 2024-06-06 */
2082/*
2083 * Copyright (c) Microsoft Corporation. All rights reserved.
2084 * Licensed under the MIT License.
2085 */
2086exports.AzureCloudInstance = void 0;
2087(function (AzureCloudInstance) {
2088    // AzureCloudInstance is not specified.
2089    AzureCloudInstance[AzureCloudInstance["None"] = 0] = "None";
2090    // Microsoft Azure public cloud
2091    AzureCloudInstance["AzurePublic"] = "https://login.microsoftonline.com";
2092    // Microsoft PPE
2093    AzureCloudInstance["AzurePpe"] = "https://login.windows-ppe.net";
2094    // Microsoft Chinese national cloud
2095    AzureCloudInstance["AzureChina"] = "https://login.chinacloudapi.cn";
2096    // Microsoft German national cloud ("Black Forest")
2097    AzureCloudInstance["AzureGermany"] = "https://login.microsoftonline.de";
2098    // US Government cloud
2099    AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
2100})(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
2101
2102/*! @azure/msal-common v13.3.3 2024-06-06 */
2103
2104/*
2105 * Copyright (c) Microsoft Corporation. All rights reserved.
2106 * Licensed under the MIT License.
2107 */
2108/**
2109 * ClientConfigurationErrorMessage class containing string constants used by error codes and messages.
2110 */
2111var ClientConfigurationErrorMessage = {
2112    redirectUriNotSet: {
2113        code: "redirect_uri_empty",
2114        desc: "A redirect URI is required for all calls, and none has been set."
2115    },
2116    postLogoutUriNotSet: {
2117        code: "post_logout_uri_empty",
2118        desc: "A post logout redirect has not been set."
2119    },
2120    claimsRequestParsingError: {
2121        code: "claims_request_parsing_error",
2122        desc: "Could not parse the given claims request object."
2123    },
2124    authorityUriInsecure: {
2125        code: "authority_uri_insecure",
2126        desc: "Authority URIs must use https.  Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"
2127    },
2128    urlParseError: {
2129        code: "url_parse_error",
2130        desc: "URL could not be parsed into appropriate segments."
2131    },
2132    urlEmptyError: {
2133        code: "empty_url_error",
2134        desc: "URL was empty or null."
2135    },
2136    emptyScopesError: {
2137        code: "empty_input_scopes_error",
2138        desc: "Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."
2139    },
2140    nonArrayScopesError: {
2141        code: "nonarray_input_scopes_error",
2142        desc: "Scopes cannot be passed as non-array."
2143    },
2144    clientIdSingleScopeError: {
2145        code: "clientid_input_scopes_error",
2146        desc: "Client ID can only be provided as a single scope."
2147    },
2148    invalidPrompt: {
2149        code: "invalid_prompt_value",
2150        desc: "Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'.  Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",
2151    },
2152    invalidClaimsRequest: {
2153        code: "invalid_claims",
2154        desc: "Given claims parameter must be a stringified JSON object."
2155    },
2156    tokenRequestEmptyError: {
2157        code: "token_request_empty",
2158        desc: "Token request was empty and not found in cache."
2159    },
2160    logoutRequestEmptyError: {
2161        code: "logout_request_empty",
2162        desc: "The logout request was null or undefined."
2163    },
2164    invalidCodeChallengeMethod: {
2165        code: "invalid_code_challenge_method",
2166        desc: "code_challenge_method passed is invalid. Valid values are \"plain\" and \"S256\"."
2167    },
2168    invalidCodeChallengeParams: {
2169        code: "pkce_params_missing",
2170        desc: "Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"
2171    },
2172    invalidCloudDiscoveryMetadata: {
2173        code: "invalid_cloud_discovery_metadata",
2174        desc: "Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"
2175    },
2176    invalidAuthorityMetadata: {
2177        code: "invalid_authority_metadata",
2178        desc: "Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."
2179    },
2180    untrustedAuthority: {
2181        code: "untrusted_authority",
2182        desc: "The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."
2183    },
2184    invalidAzureCloudInstance: {
2185        code: "invalid_azure_cloud_instance",
2186        desc: "Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"
2187    },
2188    missingSshJwk: {
2189        code: "missing_ssh_jwk",
2190        desc: "Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."
2191    },
2192    missingSshKid: {
2193        code: "missing_ssh_kid",
2194        desc: "Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."
2195    },
2196    missingNonceAuthenticationHeader: {
2197        code: "missing_nonce_authentication_header",
2198        desc: "Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."
2199    },
2200    invalidAuthenticationHeader: {
2201        code: "invalid_authentication_header",
2202        desc: "Invalid authentication header provided"
2203    },
2204    authorityMismatch: {
2205        code: "authority_mismatch",
2206        desc: "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."
2207    }
2208};
2209/**
2210 * Error thrown when there is an error in configuration of the MSAL.js library.
2211 */
2212var ClientConfigurationError = /** @class */ (function (_super) {
2213    __extends(ClientConfigurationError, _super);
2214    function ClientConfigurationError(errorCode, errorMessage) {
2215        var _this = _super.call(this, errorCode, errorMessage) || this;
2216        _this.name = "ClientConfigurationError";
2217        Object.setPrototypeOf(_this, ClientConfigurationError.prototype);
2218        return _this;
2219    }
2220    /**
2221     * Creates an error thrown when the redirect uri is empty (not set by caller)
2222     */
2223    ClientConfigurationError.createRedirectUriEmptyError = function () {
2224        return new ClientConfigurationError(ClientConfigurationErrorMessage.redirectUriNotSet.code, ClientConfigurationErrorMessage.redirectUriNotSet.desc);
2225    };
2226    /**
2227     * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)
2228     */
2229    ClientConfigurationError.createPostLogoutRedirectUriEmptyError = function () {
2230        return new ClientConfigurationError(ClientConfigurationErrorMessage.postLogoutUriNotSet.code, ClientConfigurationErrorMessage.postLogoutUriNotSet.desc);
2231    };
2232    /**
2233     * Creates an error thrown when the claims request could not be successfully parsed
2234     */
2235    ClientConfigurationError.createClaimsRequestParsingError = function (claimsRequestParseError) {
2236        return new ClientConfigurationError(ClientConfigurationErrorMessage.claimsRequestParsingError.code, ClientConfigurationErrorMessage.claimsRequestParsingError.desc + " Given value: " + claimsRequestParseError);
2237    };
2238    /**
2239     * Creates an error thrown if authority uri is given an insecure protocol.
2240     * @param urlString
2241     */
2242    ClientConfigurationError.createInsecureAuthorityUriError = function (urlString) {
2243        return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityUriInsecure.code, ClientConfigurationErrorMessage.authorityUriInsecure.desc + " Given URI: " + urlString);
2244    };
2245    /**
2246     * Creates an error thrown if URL string does not parse into separate segments.
2247     * @param urlString
2248     */
2249    ClientConfigurationError.createUrlParseError = function (urlParseError) {
2250        return new ClientConfigurationError(ClientConfigurationErrorMessage.urlParseError.code, ClientConfigurationErrorMessage.urlParseError.desc + " Given Error: " + urlParseError);
2251    };
2252    /**
2253     * Creates an error thrown if URL string is empty or null.
2254     * @param urlString
2255     */
2256    ClientConfigurationError.createUrlEmptyError = function () {
2257        return new ClientConfigurationError(ClientConfigurationErrorMessage.urlEmptyError.code, ClientConfigurationErrorMessage.urlEmptyError.desc);
2258    };
2259    /**
2260     * Error thrown when scopes are empty.
2261     * @param scopesValue
2262     */
2263    ClientConfigurationError.createEmptyScopesArrayError = function () {
2264        return new ClientConfigurationError(ClientConfigurationErrorMessage.emptyScopesError.code, "" + ClientConfigurationErrorMessage.emptyScopesError.desc);
2265    };
2266    /**
2267     * Error thrown when client id scope is not provided as single scope.
2268     * @param inputScopes
2269     */
2270    ClientConfigurationError.createClientIdSingleScopeError = function (inputScopes) {
2271        return new ClientConfigurationError(ClientConfigurationErrorMessage.clientIdSingleScopeError.code, ClientConfigurationErrorMessage.clientIdSingleScopeError.desc + " Given Scopes: " + inputScopes);
2272    };
2273    /**
2274     * Error thrown when prompt is not an allowed type.
2275     * @param promptValue
2276     */
2277    ClientConfigurationError.createInvalidPromptError = function (promptValue) {
2278        return new ClientConfigurationError(ClientConfigurationErrorMessage.invali
2278dPrompt.code, ClientConfigurationErrorMessage.invalidPrompt.desc + " Given value: " + promptValue);
2279    };
2280    /**
2281     * Creates error thrown when claims parameter is not a stringified JSON object
2282     */
2283    ClientConfigurationError.createInvalidClaimsRequestError = function () {
2284        return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidClaimsRequest.code, ClientConfigurationErrorMessage.invalidClaimsRequest.desc);
2285    };
2286    /**
2287     * Throws error when token request is empty and nothing cached in storage.
2288     */
2289    ClientConfigurationError.createEmptyLogoutRequestError = function () {
2290        return new ClientConfigurationError(ClientConfigurationErrorMessage.logoutRequestEmptyError.code, ClientConfigurationErrorMessage.logoutRequestEmptyError.desc);
2291    };
2292    /**
2293     * Throws error when token request is empty and nothing cached in storage.
2294     */
2295    ClientConfigurationError.createEmptyTokenRequestError = function () {
2296        return new ClientConfigurationError(ClientConfigurationErrorMessage.tokenRequestEmptyError.code, ClientConfigurationErrorMessage.tokenRequestEmptyError.desc);
2297    };
2298    /**
2299     * Throws error when an invalid code_challenge_method is passed by the user
2300     */
2301    ClientConfigurationError.createInvalidCodeChallengeMethodError = function () {
2302        return new ClientConfigurationError(ClientConfigurationErrorMessage.invali
2302dCodeChallengeMethod.code, ClientConfigurationErrorMessage.invalidCodeChallengeMethod.desc);
2303    };
2304    /**
2305     * Throws error when both params: code_challenge and code_challenge_method are not passed together
2306     */
2307    ClientConfigurationError.createInvalidCodeChallengeParamsError = function () {
2308        return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCodeChallengeParams.code, ClientConfigurationErrorMessage.invalidCodeChallengeParams.desc);
2309    };
2310    /**
2311     * Throws an error when the user passes invalid cloudDiscoveryMetadata
2312     */
2313    ClientConfigurationError.createInvalidCloudDiscoveryMetadataError = function () {
2314        return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.code, ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.desc);
2315    };
2316    /**
2317     * Throws an error when the user passes invalid cloudDiscoveryMetadata
2318     */
2319    ClientConfigurationError.createInvalidAuthorityMetadataError = function () {
2320        return new ClientConfigurationError(ClientConfigurationErrorMessage.invali
2320dAuthorityMetadata.code, ClientConfigurationErrorMessage.invalidAuthorityMetadata.desc);
2321    };
2322    /**
2323     * Throws error when provided authority is not a member of the trusted host list
2324     */
2325    ClientConfigurationError.createUntrustedAuthorityError = function () {
2326        return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code, ClientConfigurationErrorMessage.untrustedAuthority.desc);
2327    };
2328    /**
2329     * Throws error when the AzureCloudInstance is set to an invalid value
2330     */
2331    ClientConfigurationError.createInvalidAzureCloudInstanceError = function () {
2332        return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAzureCloudInstance.code, ClientConfigurationErrorMessage.invalidAzureCloudInstance.desc);
2333    };
2334    /**
2335     * Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request
2336     */
2337    ClientConfigurationError.createMissingSshJwkError = function () {
2338        return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshJwk.code, ClientConfigurationErrorMessage.missingSshJwk.desc);
2339    };
2340    /**
2341     * Throws an error when the authentication scheme is set to SSH but the SSH public key ID is omitted from the request
2342     */
2343    ClientConfigurationError.createMissingSshKidError = function () {
2344        return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshKid.code, ClientConfigurationErrorMessage.missingSshKid.desc);
2345    };
2346    /**
2347     * Throws error when provided headers don't contain a header that a server nonce can be extracted from
2348     */
2349    ClientConfigurationError.createMissingNonceAuthenticationHeadersError = function () {
2350        return new ClientConfigurationError(ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.code, ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.desc);
2351    };
2352    /**
2353     * Throws error when a provided header is invalid in any way
2354     */
2355    ClientConfigurationError.createInvalidAuthenticationHeaderError = function (invalidHeaderName, details) {
2356        return new ClientConfigurationError(ClientConfigurationErrorMessage.invali
vendor: 13,968 bytes, lines 2356-2719
2356dAuthenticationHeader.code, ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc + ". Invalid header: " + invalidHeaderName + ". Details: " + details);
2357    };
2358    /**
2359     * Create an error when the authority provided in request does not match authority provided in account or MSAL.js configuration.
2360     */
2361    ClientConfigurationError.createAuthorityMismatchError = function () {
2362        return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityMismatch.code, ClientConfigurationErrorMessage.authorityMismatch.desc);
2363    };
2364    return ClientConfigurationError;
2365}(ClientAuthError));
2366
2367/*! @azure/msal-common v13.3.3 2024-06-06 */
2368
2369/*
2370 * Copyright (c) Microsoft Corporation. All rights reserved.
2371 * Licensed under the MIT License.
2372 */
2373/**
2374 * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes
2375 * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions
2376 * to ensure uniqueness of strings.
2377 */
2378var ScopeSet = /** @class */ (function () {
2379    function ScopeSet(inputScopes) {
2380        var _this = this;
2381        // Filter empty string and null/undefined array items
2382        var scopeArr = inputScopes ? StringUtils.trimArrayEntries(__spreadArrays(inputScopes)) : [];
2383        var filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];
2384        // Validate and filter scopes (validate function throws if validation fails)
2385        this.validateInputScopes(filteredInput);
2386        this.scopes = new Set(); // Iterator in constructor not supported by IE11
2387        filteredInput.forEach(function (scope) { return _this.scopes.add(scope); });
2388    }
2389    /**
2390     * Factory method to create ScopeSet from space-delimited string
2391     * @param inputScopeString
2392     * @param appClientId
2393     * @param scopesRequired
2394     */
2395    ScopeSet.fromString = function (inputScopeString) {
2396        var scopeString = inputScopeString || Constants.EMPTY_STRING;
2397        var inputScopes = scopeString.split(" ");
2398        return new ScopeSet(inputScopes);
2399    };
2400    /**
2401     * Creates the set of scopes to search for in cache lookups
2402     * @param inputScopeString
2403     * @returns
2404     */
2405    ScopeSet.createSearchScopes = function (inputScopeString) {
2406        var scopeSet = new ScopeSet(inputScopeString);
2407        if (!scopeSet.containsOnlyOIDCScopes()) {
2408            scopeSet.removeOIDCScopes();
2409        }
2410        else {
2411            scopeSet.removeScope(Constants.OFFLINE_ACCESS_SCOPE);
2412        }
2413        return scopeSet;
2414    };
2415    /**
2416     * Used to validate the scopes input parameter requested  by the developer.
2417     * @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.
2418     * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not
2419     */
2420    ScopeSet.prototype.validateInputScopes = function (inputScopes) {
2421        // Check if scopes are required but not given or is an empty array
2422        if (!inputScopes || inputScopes.length < 1) {
2423            throw ClientConfigurationError.createEmptyScopesArrayError();
2424        }
2425    };
2426    /**
2427     * Check if a given scope is present in this set of scopes.
2428     * @param scope
2429     */
2430    ScopeSet.prototype.containsScope = function (scope) {
2431        var lowerCaseScopes = this.printScopesLowerCase().split(" ");
2432        var lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);
2433        // compare lowercase scopes
2434        return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;
2435    };
2436    /**
2437     * Check if a set of scopes is present in this set of scopes.
2438     * @param scopeSet
2439     */
2440    ScopeSet.prototype.containsScopeSet = function (scopeSet) {
2441        var _this = this;
2442        if (!scopeSet || scopeSet.scopes.size <= 0) {
2443            return false;
2444        }
2445        return (this.scopes.size >= scopeSet.scopes.size && scopeSet.asArray().every(function (scope) { return _this.containsScope(scope); }));
2446    };
2447    /**
2448     * Check if set of scopes contains only the defaults
2449     */
2450    ScopeSet.prototype.containsOnlyOIDCScopes = function () {
2451        var _this = this;
2452        var defaultScopeCount = 0;
2453        OIDC_SCOPES.forEach(function (defaultScope) {
2454            if (_this.containsScope(defaultScope)) {
2455                defaultScopeCount += 1;
2456            }
2457        });
2458        return this.scopes.size === defaultScopeCount;
2459    };
2460    /**
2461     * Appends single scope if passed
2462     * @param newScope
2463     */
2464    ScopeSet.prototype.appendScope = function (newScope) {
2465        if (!StringUtils.isEmpty(newScope)) {
2466            this.scopes.add(newScope.trim());
2467        }
2468    };
2469    /**
2470     * Appends multiple scopes if passed
2471     * @param newScopes
2472     */
2473    ScopeSet.prototype.appendScopes = function (newScopes) {
2474        var _this = this;
2475        try {
2476            newScopes.forEach(function (newScope) { return _this.appendScope(newScope); });
2477        }
2478        catch (e) {
2479            throw ClientAuthError.createAppendScopeSetError(e);
2480        }
2481    };
2482    /**
2483     * Removes element from set of scopes.
2484     * @param scope
2485     */
2486    ScopeSet.prototype.removeScope = function (scope) {
2487        if (StringUtils.isEmpty(scope)) {
2488            throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);
2489        }
2490        this.scopes.delete(scope.trim());
2491    };
2492    /**
2493     * Removes default scopes from set of scopes
2494     * Primarily used to prevent cache misses if the default scopes are not returned from the server
2495     */
2496    ScopeSet.prototype.removeOIDCScopes = function () {
2497        var _this = this;
2498        OIDC_SCOPES.forEach(function (defaultScope) {
2499            _this.scopes.delete(defaultScope);
2500        });
2501    };
2502    /**
2503     * Combines an array of scopes with the current set of scopes.
2504     * @param otherScopes
2505     */
2506    ScopeSet.prototype.unionScopeSets = function (otherScopes) {
2507        if (!otherScopes) {
2508            throw ClientAuthError.createEmptyInputScopeSetError();
2509        }
2510        var unionScopes = new Set(); // Iterator in constructor not supported in IE11
2511        otherScopes.scopes.forEach(function (scope) { return unionScopes.add(scope.toLowerCase()); });
2512        this.scopes.forEach(function (scope) { return unionScopes.add(scope.toLowerCase()); });
2513        return unionScopes;
2514    };
2515    /**
2516     * Check if scopes intersect between this set and another.
2517     * @param otherScopes
2518     */
2519    ScopeSet.prototype.intersectingScopeSets = function (otherScopes) {
2520        if (!otherScopes) {
2521            throw ClientAuthError.createEmptyInputScopeSetError();
2522        }
2523        // Do not allow OIDC scopes to be the only intersecting scopes
2524        if (!otherScopes.containsOnlyOIDCScopes()) {
2525            otherScopes.removeOIDCScopes();
2526        }
2527        var unionScopes = this.unionScopeSets(otherScopes);
2528        var sizeOtherScopes = otherScopes.getScopeCount();
2529        var sizeThisScopes = this.getScopeCount();
2530        var sizeUnionScopes = unionScopes.size;
2531        return sizeUnionScopes < (sizeThisScopes + sizeOtherScopes);
2532    };
2533    /**
2534     * Returns size of set of scopes.
2535     */
2536    ScopeSet.prototype.getScopeCount = function () {
2537        return this.scopes.size;
2538    };
2539    /**
2540     * Returns the scopes as an array of string values
2541     */
2542    ScopeSet.prototype.asArray = function () {
2543        var array = [];
2544        this.scopes.forEach(function (val) { return array.push(val); });
2545        return array;
2546    };
2547    /**
2548     * Prints scopes into a space-delimited string
2549     */
2550    ScopeSet.prototype.printScopes = function () {
2551        if (this.scopes) {
2552            var scopeArr = this.asArray();
2553            return scopeArr.join(" ");
2554        }
2555        return Constants.EMPTY_STRING;
2556    };
2557    /**
2558     * Prints scopes into a space-delimited lower-case string (used for caching)
2559     */
2560    ScopeSet.prototype.printScopesLowerCase = function () {
2561        return this.printScopes().toLowerCase();
2562    };
2563    return ScopeSet;
2564}());
2565
2566/*! @azure/msal-common v13.3.3 2024-06-06 */
2567
2568/*
2569 * Copyright (c) Microsoft Corporation. All rights reserved.
2570 * Licensed under the MIT License.
2571 */
2572/**
2573 * Function to build a client info object from server clientInfo string
2574 * @param rawClientInfo
2575 * @param crypto
2576 */
2577function buildClientInfo(rawClientInfo, crypto) {
2578    if (StringUtils.isEmpty(rawClientInfo)) {
2579        throw ClientAuthError.createClientInfoEmptyError();
2580    }
2581    try {
2582        var decodedClientInfo = crypto.base64Decode(rawClientInfo);
2583        return JSON.parse(decodedClientInfo);
2584    }
2585    catch (e) {
2586        throw ClientAuthError.createClientInfoDecodingError(e.message);
2587    }
2588}
2589/**
2590 * Function to build a client info object from cached homeAccountId string
2591 * @param homeAccountId
2592 */
2593function buildClientInfoFromHomeAccountId(homeAccountId) {
2594    if (StringUtils.isEmpty(homeAccountId)) {
2595        throw ClientAuthError.createClientInfoDecodingError("Home account ID was empty.");
2596    }
2597    var clientInfoParts = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);
2598    return {
2599        uid: clientInfoParts[0],
2600        utid: clientInfoParts.length < 2 ? Constants.EMPTY_STRING : clientInfoParts[1]
2601    };
2602}
2603
2604/*! @azure/msal-common v13.3.3 2024-06-06 */
2605/*
2606 * Copyright (c) Microsoft Corporation. All rights reserved.
2607 * Licensed under the MIT License.
2608 */
2609/**
2610 * Authority types supported by MSAL.
2611 */
2612var AuthorityType;
2613(function (AuthorityType) {
2614    AuthorityType[AuthorityType["Default"] = 0] = "Default";
2615    AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
2616    AuthorityType[AuthorityType["Dsts"] = 2] = "Dsts";
2617    AuthorityType[AuthorityType["Ciam"] = 3] = "Ciam";
2618})(AuthorityType || (AuthorityType = {}));
2619
2620/*! @azure/msal-common v13.3.3 2024-06-06 */
2621/*
2622 * Copyright (c) Microsoft Corporation. All rights reserved.
2623 * Licensed under the MIT License.
2624 */
2625/**
2626 * Protocol modes supported by MSAL.
2627 */
2628exports.ProtocolMode = void 0;
2629(function (ProtocolMode) {
2630    ProtocolMode["AAD"] = "AAD";
2631    ProtocolMode["OIDC"] = "OIDC";
2632})(exports.ProtocolMode || (exports.ProtocolMode = {}));
2633
2634/*! @azure/msal-common v13.3.3 2024-06-06 */
2635
2636/*
2637 * Copyright (c) Microsoft Corporation. All rights reserved.
2638 * Licensed under the MIT License.
2639 */
2640/**
2641 * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).
2642 *
2643 * Key : Value Schema
2644 *
2645 * Key: <home_account_id>-<environment>-<realm*>
2646 *
2647 * Value Schema:
2648 * {
2649 *      homeAccountId: home account identifier for the auth scheme,
2650 *      environment: entity that issued the token, represented as a full host
2651 *      realm: Full tenant or organizational identifier that the account belongs to
2652 *      localAccountId: Original tenant-specific accountID, usually used for legacy cases
2653 *      username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt
2654 *      authorityType: Accounts authority type as a string
2655 *      clientInfo: Full base64 encoded client info received from ESTS
2656 *      name: Full name for the account, including given name and family name
2657 *      lastModificationTime: last time this entity was modified in the cache
2658 *      lastModificationApp:
2659 *      idTokenClaims: Object containing claims parsed from ID token
2660 *      nativeAccountId: Account identifier on the native device
2661 * }
2662 */
2663var AccountEntity = /** @class */ (function () {
2664    function AccountEntity() {
2665    }
2666    /**
2667     * Generate Account Id key component as per the schema: <home_account_id>-<environment>
2668     */
2669    AccountEntity.prototype.generateAccountId = function () {
2670        var accountId = [this.homeAccountId, this.environment];
2671        return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
2672    };
2673    /**
2674     * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>
2675     */
2676    AccountEntity.prototype.generateAccountKey = function () {
2677        return AccountEntity.generateAccountCacheKey({
2678            homeAccountId: this.homeAccountId,
2679            environment: this.environment,
2680            tenantId: this.realm,
2681            username: this.username,
2682            localAccountId: this.localAccountId
2683        });
2684    };
2685    /**
2686     * Returns the AccountInfo interface for this account.
2687     */
2688    AccountEntity.prototype.getAccountInfo = function () {
2689        return {
2690            homeAccountId: this.homeAccountId,
2691            environment: this.environment,
2692            tenantId: this.realm,
2693            username: this.username,
2694            localAccountId: this.localAccountId,
2695            name: this.name,
2696            idTokenClaims: this.idTokenClaims,
2697            nativeAccountId: this.nativeAccountId,
2698            authorityType: this.authorityType
2699        };
2700    };
2701    /**
2702     * Generates account key from interface
2703     * @param accountInterface
2704     */
2705    AccountEntity.generateAccountCacheKey = function (accountInterface) {
2706        var accountKey = [
2707            accountInterface.homeAccountId,
2708            accountInterface.environment || Constants.EMPTY_STRING,
2709            accountInterface.tenantId || Constants.EMPTY_STRING,
2710        ];
2711        return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
2712    };
2713    /**
2714     * Build Account cache from account properties.
2715     * @param accountDetails
2716     * @param authority
2717     */
2718    AccountEntity.createAccount = function (accountDetails, authority) {
2719        var account = new AccountEntity();
2720        if (authority.authorityType === AuthorityType.Adfs) {
2721            account.authorityType = CacheAccountType.ADFS_ACCOUNT_TYPE;
2722        }
2723        else if (authority.protocolMode === exports.ProtocolMode.AAD) {
2724            account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
2725        }
2726        else {
2727            account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;
2728        }
2729        account.clientInfo = accountDetails.clientInfo;
2730        account.homeAccountId = accountDetails.homeAccountId;
2731        account.nativeAccountId = accountDetails.nativeAccountId;
2732        var env = accountDetails.environment || (authority && authority.getPreferredCache());
2733        if (!env) {
2734            throw ClientAuthError.createInvalidCacheEnvironmentError();
2735        }
2736        account.environment = env;
2737        // non AAD scenarios can have empty realm
2738        account.realm = accountDetails.idTokenClaims.tid || Constants.EMPTY_STRING;
2739        account.idTokenClaims = accountDetails.idTokenClaims;
2740        // How do you account for MSA CID here?
2741        account.localAccountId = accountDetails.idTokenClaims.oid || accountDetails.idTokenClaims.sub || Constants.EMPTY_STRING;
2742        /*
2743         * In B2C scenarios the emails claim is used instead of preferred_username and it is an array.
2744         * In most cases it will contain a single email. This field should not be relied upon if a custom
2745         * policy is configured to return more than 1 email.
2746         */
2747        if (account.authorityType === CacheAccountType.MSSTS_ACCOUNT_TYPE) {
2748            var preferredUsername = accountDetails.idTokenClaims.preferred_username;
2749            var email = (accountDetails.idTokenClaims.emails) ? accountDetails.idTokenClaims.emails[0] : null;
2750            account.username = preferredUsername || email || "";
2751        }
2752        else {
2753            account.username = accountDetails.idTokenClaims.upn || "";
2754        }
2755        account.name = accountDetails.idTokenClaims.name;
2756        account.cloudGraphHostName = accountDetails.cloudGraphHostName;
2757        account.msGraphHost = accountDetails.msGraphHost;
2758        return account;
2759    };
2760    /**
2761     * Creates an account object from AccountInfo
2762     * @param accountInfo
2763     * @param cloudGraphHostName
2764     * @param msGraphHost
2765     * @returns AccountEntity
2766     */
2767    AccountEntity.createFromAccountInfo = function (accountInfo, cloudGraphHostName, msGraphHost) {
2768        var account = new AccountEntity();
vendor: 71,894 bytes, lines 2769-4453
2769        account.authorityType =
2770            accountInfo.authorityType || CacheAccountType.GENERIC_ACCOUNT_TYPE;
2771        account.homeAccountId = accountInfo.homeAccountId;
2772        account.localAccountId = accountInfo.localAccountId;
2773        account.nativeAccountId = accountInfo.nativeAccountId;
2774        account.realm = accountInfo.tenantId;
2775        account.environment = accountInfo.environment;
2776        account.username = accountInfo.username;
2777        account.name = accountInfo.name;
2778        account.idTokenClaims = accountInfo.idTokenClaims;
2779        account.cloudGraphHostName = cloudGraphHostName;
2780        account.msGraphHost = msGraphHost;
2781        return account;
2782    };
2783    /**
2784     * Generate HomeAccountId from server response
2785     * @param serverClientInfo
2786     * @param authType
2787     */
2788    AccountEntity.generateHomeAccountId = function (serverClientInfo, authType, logger, cryptoObj, idTokenClaims) {
2789        var accountId = (idTokenClaims === null || idTokenClaims === void 0 ? void 0 : idTokenClaims.sub) ? idTokenClaims.sub : Constants.EMPTY_STRING;
2790        // since ADFS does not have tid and does not set client_info
2791        if (authType === AuthorityType.Adfs || authType === AuthorityType.Dsts) {
2792            return accountId;
2793        }
2794        // for cases where there is clientInfo
2795        if (serverClientInfo) {
2796            try {
2797                var clientInfo = buildClientInfo(serverClientInfo, cryptoObj);
2798                if (!StringUtils.isEmpty(clientInfo.uid) && !StringUtils.isEmpty(clientInfo.utid)) {
2799                    return "" + clientInfo.uid + Separators.CLIENT_INFO_SEPARATOR + clientInfo.utid;
2800                }
2801            }
2802            catch (e) { }
2803        }
2804        // default to "sub" claim
2805        logger.verbose("No client info in response");
2806        return accountId;
2807    };
2808    /**
2809     * Validates an entity: checks for all expected params
2810     * @param entity
2811     */
2812    AccountEntity.isAccountEntity = function (entity) {
2813        if (!entity) {
2814            return false;
2815        }
2816        return (entity.hasOwnProperty("homeAccountId") &&
2817            entity.hasOwnProperty("environment") &&
2818            entity.hasOwnProperty("realm") &&
2819            entity.hasOwnProperty("localAccountId") &&
2820            entity.hasOwnProperty("username") &&
2821            entity.hasOwnProperty("authorityType"));
2822    };
2823    /**
2824     * Helper function to determine whether 2 accountInfo objects represent the same account
2825     * @param accountA
2826     * @param accountB
2827     * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality
2828     */
2829    AccountEntity.accountInfoIsEqual = function (accountA, accountB, compareClaims) {
2830        if (!accountA || !accountB) {
2831            return false;
2832        }
2833        var claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false
2834        if (compareClaims) {
2835            var accountAClaims = (accountA.idTokenClaims || {});
2836            var accountBClaims = (accountB.idTokenClaims || {});
2837            // issued at timestamp and nonce are expected to change each time a new id token is acquired
2838            claimsMatch = (accountAClaims.iat === accountBClaims.iat) &&
2839                (accountAClaims.nonce === accountBClaims.nonce);
2840        }
2841        return (accountA.homeAccountId === accountB.homeAccountId) &&
2842            (accountA.localAccountId === accountB.localAccountId) &&
2843            (accountA.username === accountB.username) &&
2844            (accountA.tenantId === accountB.tenantId) &&
2845            (accountA.environment === accountB.environment) &&
2846            (accountA.nativeAccountId === accountB.nativeAccountId) &&
2847            claimsMatch;
2848    };
2849    return AccountEntity;
2850}());
2851
2852/*! @azure/msal-common v13.3.3 2024-06-06 */
2853
2854/*
2855 * Copyright (c) Microsoft Corporation. All rights reserved.
2856 * Licensed under the MIT License.
2857 */
2858/**
2859 * JWT Token representation class. Parses token string and generates claims object.
2860 */
2861var AuthToken = /** @class */ (function () {
2862    function AuthToken(rawToken, crypto) {
2863        if (StringUtils.isEmpty(rawToken)) {
2864            throw ClientAuthError.createTokenNullOrEmptyError(rawToken);
2865        }
2866        this.rawToken = rawToken;
2867        this.claims = AuthToken.extractTokenClaims(rawToken, crypto);
2868    }
2869    /**
2870     * Extract token by decoding the rawToken
2871     *
2872     * @param encodedToken
2873     */
2874    AuthToken.extractTokenClaims = function (encodedToken, crypto) {
2875        var decodedToken = StringUtils.decodeAuthToken(encodedToken);
2876        // token will be decoded to get the username
2877        try {
2878            var base64TokenPayload = decodedToken.JWSPayload;
2879            // base64Decode() should throw an error if there is an issue
2880            var base64Decoded = crypto.base64Decode(base64TokenPayload);
2881            return JSON.parse(base64Decoded);
2882        }
2883        catch (err) {
2884            throw ClientAuthError.createTokenParsingError(err);
2885        }
2886    };
2887    /**
2888     * Determine if the token's max_age has transpired
2889     */
2890    AuthToken.checkMaxAge = function (authTime, maxAge) {
2891        /*
2892         * per https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
2893         * To force an immediate re-authentication: If an app requires that a user re-authenticate prior to access,
2894         * provide a value of 0 for the max_age parameter and the AS will force a fresh login.
2895         */
2896        var fiveMinuteSkew = 300000; // five minutes in milliseconds
2897        if ((maxAge === 0) || ((Date.now() - fiveMinuteSkew) > (authTime + maxAge))) {
2898            throw ClientAuthError.createMaxAgeTranspiredError();
2899        }
2900    };
2901    return AuthToken;
2902}());
2903
2904/*! @azure/msal-common v13.3.3 2024-06-06 */
2905
2906/*
2907 * Copyright (c) Microsoft Corporation. All rights reserved.
2908 * Licensed under the MIT License.
2909 */
2910/**
2911 * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.
2912 */
2913var CacheManager = /** @class */ (function () {
2914    function CacheManager(clientId, cryptoImpl, logger) {
2915        this.clientId = clientId;
2916        this.cryptoImpl = cryptoImpl;
2917        this.commonLogger = logger.clone(name$1, version$1);
2918    }
2919    /**
2920     * Returns all accounts in cache
2921     */
2922    CacheManager.prototype.getAllAccounts = function () {
2923        var _this = this;
2924        var allAccountKeys = this.getAccountKeys();
2925        if (allAccountKeys.length < 1) {
2926            return [];
2927        }
2928        var accountEntities = allAccountKeys.reduce(function (accounts, key) {
2929            var entity = _this.getAccount(key);
2930            if (!entity) {
2931                return accounts;
2932            }
2933            accounts.push(entity);
2934            return accounts;
2935        }, []);
2936        if (accountEntities.length < 1) {
2937            return [];
2938        }
2939        else {
2940            var allAccounts = accountEntities.map(function (accountEntity) {
2941                return _this.getAccountInfoFromEntity(accountEntity);
2942            });
2943            return allAccounts;
2944        }
2945    };
2946    /**
2947     * Gets accountInfo object based on provided filters
2948     */
2949    CacheManager.prototype.getAccountInfoFilteredBy = function (accountFilter) {
2950        var allAccounts = this.getAccountsFilteredBy(accountFilter);
2951        if (allAccounts.length > 0) {
2952            return this.getAccountInfoFromEntity(allAccounts[0]);
2953        }
2954        else {
2955            return null;
2956        }
2957    };
2958    CacheManager.prototype.getAccountInfoFromEntity = function (accountEntity) {
2959        var accountInfo = accountEntity.getAccountInfo();
2960        var idToken = this.getIdToken(accountInfo);
2961        if (idToken) {
2962            accountInfo.idToken = idToken.secret;
2963            accountInfo.idTokenClaims = new AuthToken(idToken.secret, this.cryptoImpl).claims;
2964        }
2965        return accountInfo;
2966    };
2967    /**
2968     * saves a cache record
2969     * @param cacheRecord
2970     */
2971    CacheManager.prototype.saveCacheRecord = function (cacheRecord) {
2972        return __awaiter(this, void 0, void 0, function () {
2973            return __generator(this, function (_a) {
2974                switch (_a.label) {
2975                    case 0:
2976                        if (!cacheRecord) {
2977                            throw ClientAuthError.createNullOrUndefinedCacheRecord();
2978                        }
2979                        if (!!cacheRecord.account) {
2980                            this.setAccount(cacheRecord.account);
2981                        }
2982                        if (!!cacheRecord.idToken) {
2983                            this.setIdTokenCredential(cacheRecord.idToken);
2984                        }
2985                        if (!!!cacheRecord.accessToken) return [3 /*break*/, 2];
2986                        return [4 /*yield*/, this.saveAccessToken(cacheRecord.accessToken)];
2987                    case 1:
2988                        _a.sent();
2989                        _a.label = 2;
2990                    case 2:
2991                        if (!!cacheRecord.refreshToken) {
2992                            this.setRefreshTokenCredential(cacheRecord.refreshToken);
2993                        }
2994                        if (!!cacheRecord.appMetadata) {
2995                            this.setAppMetadata(cacheRecord.appMetadata);
2996                        }
2997                        return [2 /*return*/];
2998                }
2999            });
3000        });
3001    };
3002    /**
3003     * saves access token credential
3004     * @param credential
3005     */
3006    CacheManager.prototype.saveAccessToken = function (credential) {
3007        return __awaiter(this, void 0, void 0, function () {
3008            var accessTokenFilter, tokenKeys, currentScopes, removedAccessTokens;
3009            var _this = this;
3010            return __generator(this, function (_a) {
3011                switch (_a.label) {
3012                    case 0:
3013                        accessTokenFilter = {
3014                            clientId: credential.clientId,
3015                            credentialType: credential.credentialType,
3016                            environment: credential.environment,
3017                            homeAccountId: credential.homeAccountId,
3018                            realm: credential.realm,
3019                            tokenType: credential.tokenType,
3020                            requestedClaimsHash: credential.requestedClaimsHash
3021                        };
3022                        tokenKeys = this.getTokenKeys();
3023                        currentScopes = ScopeSet.fromString(credential.target);
3024                        removedAccessTokens = [];
3025                        tokenKeys.accessToken.forEach(function (key) {
3026                            if (!_this.accessTokenKeyMatchesFilter(key, accessTokenFilter, false)) {
3027                                return;
3028                            }
3029                            var tokenEntity = _this.getAccessTokenCredential(key);
3030                            if (tokenEntity && _this.credentialMatchesFilter(tokenEntity, accessTokenFilter)) {
3031                                var tokenScopeSet = ScopeSet.fromString(tokenEntity.target);
3032                                if (tokenScopeSet.intersectingScopeSets(currentScopes)) {
3033                                    removedAccessTokens.push(_this.removeAccessToken(key));
3034                                }
3035                            }
3036                        });
3037                        return [4 /*yield*/, Promise.all(removedAccessTokens)];
3038                    case 1:
3039                        _a.sent();
3040                        this.setAccessTokenCredential(credential);
3041                        return [2 /*return*/];
3042                }
3043            });
3044        });
3045    };
3046    /**
3047     * retrieve accounts matching all provided filters; if no filter is set, get all accounts
3048     * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared
3049     * @param homeAccountId
3050     * @param environment
3051     * @param realm
3052     */
3053    CacheManager.prototype.getAccountsFilteredBy = function (accountFilter) {
3054        var _this = this;
3055        var allAccountKeys = this.getAccountKeys();
3056        var matchingAccounts = [];
3057        allAccountKeys.forEach(function (cacheKey) {
3058            if (!_this.isAccountKey(cacheKey, accountFilter.homeAccountId, accountFilter.realm)) {
3059                // Don't parse value if the key doesn't match the account filters
3060                return;
3061            }
3062            var entity = _this.getAccount(cacheKey);
3063            if (!entity) {
3064                return;
3065            }
3066            if (!!accountFilter.homeAccountId && !_this.matchHomeAccountId(entity, accountFilter.homeAccountId)) {
3067                return;
3068            }
3069            if (!!accountFilter.localAccountId && !_this.matchLocalAccountId(entity, accountFilter.localAccountId)) {
3070                return;
3071            }
3072            if (!!accountFilter.username && !_this.matchUsername(entity, accountFilter.username)) {
3073                return;
3074            }
3075            if (!!accountFilter.environment && !_this.matchEnvironment(entity, accountFilter.environment)) {
3076                return;
3077            }
3078            if (!!accountFilter.realm && !_this.matchRealm(entity, accountFilter.realm)) {
3079                return;
3080            }
3081            if (!!accountFilter.nativeAccountId && !_this.matchNativeAccountId(entity, accountFilter.nativeAccountId)) {
3082                return;
3083            }
3084            matchingAccounts.push(entity);
3085        });
3086        return matchingAccounts;
3087    };
3088    /**
3089     * Returns true if the given key matches our account key schema. Also matches homeAccountId and/or tenantId if provided
3090     * @param key
3091     * @param homeAccountId
3092     * @param tenantId
3093     * @returns
3094     */
3095    CacheManager.prototype.isAccountKey = function (key, homeAccountId, tenantId) {
3096        if (key.split(Separators.CACHE_KEY_SEPARATOR).length < 3) {
3097            // Account cache keys contain 3 items separated by '-' (each item may also contain '-')
3098            return false;
3099        }
3100        if (homeAccountId && !key.toLowerCase().includes(homeAccountId.toLowerCase())) {
3101            return false;
3102        }
3103        if (tenantId && !key.toLowerCase().includes(tenantId.toLowerCase())) {
3104            return false;
3105        }
3106        // Do not check environment as aliasing can cause false negatives
3107        return true;
3108    };
3109    /**
3110     * Returns true if the given key matches our credential key schema.
3111     * @param key
3112     */
3113    CacheManager.prototype.isCredentialKey = function (key) {
3114        if (key.split(Separators.CACHE_KEY_SEPARATOR).length < 6) {
3115            // Credential cache keys contain 6 items separated by '-' (each item may also contain '-')
3116            return false;
3117        }
3118        var lowerCaseKey = key.toLowerCase();
3119        // Credential keys must indicate what credential type they represent
3120        if (lowerCaseKey.indexOf(CredentialType.ID_TOKEN.toLowerCase()) === -1 &&
3121            lowerCaseKey.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) === -1 &&
3122            lowerCaseKey.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) === -1 &&
3123            lowerCaseKey.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) === -1) {
3124            return false;
3125        }
3126        if (lowerCaseKey.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) > -1) {
3127            // Refresh tokens must contain the client id or family id
3128            var clientIdValidation = "" + CredentialType.REFRESH_TOKEN + Separators.CACHE_KEY_SEPARATOR + this.clientId + Separators.CACHE_KEY_SEPARATOR;
3129            var familyIdValidation = "" + CredentialType.REFRESH_TOKEN + Separators.CACHE_KEY_SEPARATOR + THE_FAMILY_ID + Separators.CACHE_KEY_SEPARATOR;
3130            if (lowerCaseKey.indexOf(clientIdValidation.toLowerCase()) === -1 && lowerCaseKey.indexOf(familyIdValidation.toLowerCase()) === -1) {
3131                return false;
3132            }
3133        }
3134        else if (lowerCaseKey.indexOf(this.clientId.toLowerCase()) === -1) {
3135            // Tokens must contain the clientId
3136            return false;
3137        }
3138        return true;
3139    };
3140    /**
3141     * Returns whether or not the given credential entity matches the filter
3142     * @param entity
3143     * @param filter
3144     * @returns
3145     */
3146    CacheManager.prototype.credentialMatchesFilter = function (entity, filter) {
3147        if (!!filter.clientId && !this.matchClientId(entity, filter.clientId)) {
3148            return false;
3149        }
3150        if (!!filter.userAssertionHash && !this.matchUserAssertionHash(entity, filter.userAssertionHash)) {
3151            return false;
3152        }
3153        /*
3154         * homeAccountId can be undefined, and we want to filter out cached items that have a homeAccountId of ""
3155         * because we don't want a client_credential request to return a cached token that has a homeAccountId
3156         */
3157        if ((typeof filter.homeAccountId === "string") && !this.matchHomeAccountId(entity, filter.homeAccountId)) {
3158            return false;
3159        }
3160        if (!!filter.environment && !this.matchEnvironment(entity, filter.environment)) {
3161            return false;
3162        }
3163        if (!!filter.realm && !this.matchRealm(entity, filter.realm)) {
3164            return false;
3165        }
3166        if (!!filter.credentialType && !this.matchCredentialType(entity, filter.credentialType)) {
3167            return false;
3168        }
3169        if (!!filter.familyId && !this.matchFamilyId(entity, filter.familyId)) {
3170            return false;
3171        }
3172        /*
3173         * idTokens do not have "target", target specific refreshTokens do exist for some types of authentication
3174         * Resource specific refresh tokens case will be added when the support is deemed necessary
3175         */
3176        if (!!filter.target && !this.matchTarget(entity, filter.target)) {
3177            return false;
3178        }
3179        // If request OR cached entity has requested Claims Hash, check if they match
3180        if (filter.requestedClaimsHash || entity.requestedClaimsHash) {
3181            // Don't match if either is undefined or they are different
3182            if (entity.requestedClaimsHash !== filter.requestedClaimsHash) {
3183                return false;
3184            }
3185        }
3186        // Access Token with Auth Scheme specific matching
3187        if (entity.credentialType === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {
3188            if (!!filter.tokenType && !this.matchTokenType(entity, filter.tokenType)) {
3189                return false;
3190            }
3191            // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
3192            if (filter.tokenType === exports.AuthenticationScheme.SSH) {
3193                if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {
3194                    return false;
3195                }
3196            }
3197        }
3198        return true;
3199    };
3200    /**
3201     * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata
3202     * @param filter
3203     */
3204    CacheManager.prototype.getAppMetadataFilteredBy = function (filter) {
3205        return this.getAppMetadataFilteredByInternal(filter.environment, filter.clientId);
3206    };
3207    /**
3208     * Support function to help match appMetadata
3209     * @param environment
3210     * @param clientId
3211     */
3212    CacheManager.prototype.getAppMetadataFilteredByInternal = function (environment, clientId) {
3213        var _this = this;
3214        var allCacheKeys = this.getKeys();
3215        var matchingAppMetadata = {};
3216        allCacheKeys.forEach(function (cacheKey) {
3217            // don't parse any non-appMetadata type cache entities
3218            if (!_this.isAppMetadata(cacheKey)) {
3219                return;
3220            }
3221            // Attempt retrieval
3222            var entity = _this.getAppMetadata(cacheKey);
3223            if (!entity) {
3224                return;
3225            }
3226            if (!!environment && !_this.matchEnvironment(entity, environment)) {
3227                return;
3228            }
3229            if (!!clientId && !_this.matchClientId(entity, clientId)) {
3230                return;
3231            }
3232            matchingAppMetadata[cacheKey] = entity;
3233        });
3234        return matchingAppMetadata;
3235    };
3236    /**
3237     * retrieve authorityMetadata that contains a matching alias
3238     * @param filter
3239     */
3240    CacheManager.prototype.getAuthorityMetadataByAlias = function (host) {
3241        var _this = this;
3242        var allCacheKeys = this.getAuthorityMetadataKeys();
3243        var matchedEntity = null;
3244        allCacheKeys.forEach(function (cacheKey) {
3245            // don't parse any non-authorityMetadata type cache entities
3246            if (!_this.isAuthorityMetadata(cacheKey) || cacheKey.indexOf(_this.clientId) === -1) {
3247                return;
3248            }
3249            // Attempt retrieval
3250            var entity = _this.getAuthorityMetadata(cacheKey);
3251            if (!entity) {
3252                return;
3253            }
3254            if (entity.aliases.indexOf(host) === -1) {
3255                return;
3256            }
3257            matchedEntity = entity;
3258        });
3259        return matchedEntity;
3260    };
3261    /**
3262     * Removes all accounts and related tokens from cache.
3263     */
3264    CacheManager.prototype.removeAllAccounts = function () {
3265        return __awaiter(this, void 0, void 0, function () {
3266            var allAccountKeys, removedAccounts;
3267            var _this = this;
3268            return __generator(this, function (_a) {
3269                switch (_a.label) {
3270                    case 0:
3271                        allAccountKeys = this.getAccountKeys();
3272                        removedAccounts = [];
3273                        allAccountKeys.forEach(function (cacheKey) {
3274                            removedAccounts.push(_this.removeAccount(cacheKey));
3275                        });
3276                        return [4 /*yield*/, Promise.all(removedAccounts)];
3277                    case 1:
3278                        _a.sent();
3279                        return [2 /*return*/];
3280                }
3281            });
3282        });
3283    };
3284    /**
3285     * Removes the account and related tokens for a given account key
3286     * @param account
3287     */
3288    CacheManager.prototype.removeAccount = function (accountKey) {
3289        return __awaiter(this, void 0, void 0, function () {
3290            var account;
3291            return __generator(this, function (_a) {
3292                switch (_a.label) {
3293                    case 0:
3294                        account = this.getAccount(accountKey);
3295                        if (!account) {
3296                            throw ClientAuthError.createNoAccountFoundError();
3297                        }
3298                        return [4 /*yield*/, this.removeAccountContext(account)];
3299                    case 1:
3300                        _a.sent();
3301                        this.removeItem(accountKey);
3302                        return [2 /*return*/];
3303                }
3304            });
3305        });
3306    };
3307    /**
3308     * Removes credentials associated with the provided account
3309     * @param account
3310     */
3311    CacheManager.prototype.removeAccountContext = function (account) {
3312        return __awaiter(this, void 0, void 0, function () {
3313            var allTokenKeys, accountId, removedCredentials;
3314            var _this = this;
3315            return __generator(this, function (_a) {
3316                switch (_a.label) {
3317                    case 0:
3318                        allTokenKeys = this.getTokenKeys();
3319                        accountId = account.generateAccountId();
3320                        removedCredentials = [];
3321                        allTokenKeys.idToken.forEach(function (key) {
3322                            if (key.indexOf(accountId) === 0) {
3323                                _this.removeIdToken(key);
3324                            }
3325                        });
3326                        allTokenKeys.accessToken.forEach(function (key) {
3327                            if (key.indexOf(accountId) === 0) {
3328                                removedCredentials.push(_this.removeAccessToken(key));
3329                            }
3330                        });
3331                        allTokenKeys.refreshToken.forEach(function (key) {
3332                            if (key.indexOf(accountId) === 0) {
3333                                _this.removeRefreshToken(key);
3334                            }
3335                        });
3336                        return [4 /*yield*/, Promise.all(removedCredentials)];
3337                    case 1:
3338                        _a.sent();
3339                        return [2 /*return*/];
3340                }
3341            });
3342        });
3343    };
3344    /**
3345     * returns a boolean if the given credential is removed
3346     * @param credential
3347     */
3348    CacheManager.prototype.removeAccessToken = function (key) {
3349        return __awaiter(this, void 0, void 0, function () {
3350            var credential, accessTokenWithAuthSchemeEntity, kid;
3351            return __generator(this, function (_a) {
3352                switch (_a.label) {
3353                    case 0:
3354                        credential = this.getAccessTokenCredential(key);
3355                        if (!credential) {
3356                            return [2 /*return*/];
3357                        }
3358                        if (!(credential.credentialType.toLowerCase() === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())) return [3 /*break*/, 4];
3359                        if (!(credential.tokenType === exports.AuthenticationScheme.POP)) return [3 /*break*/, 4];
3360                        accessTokenWithAuthSchemeEntity = credential;
3361                        kid = accessTokenWithAuthSchemeEntity.keyId;
3362                        if (!kid) return [3 /*break*/, 4];
3363                        _a.label = 1;
3364                    case 1:
3365                        _a.trys.push([1, 3, , 4]);
3366                        return [4 /*yield*/, this.cryptoImpl.removeTokenBindingKey(kid)];
3367                    case 2:
3368                        _a.sent();
3369                        return [3 /*break*/, 4];
3370                    case 3:
3371                        _a.sent();
3372                        throw ClientAuthError.createBindingKeyNotRemovedError();
3373                    case 4: return [2 /*return*/, this.removeItem(key)];
3374                }
3375            });
3376        });
3377    };
3378    /**
3379     * Removes all app metadata objects from cache.
3380     */
3381    CacheManager.prototype.removeAppMetadata = function () {
3382        var _this = this;
3383        var allCacheKeys = this.getKeys();
3384        allCacheKeys.forEach(function (cacheKey) {
3385            if (_this.isAppMetadata(cacheKey)) {
3386                _this.removeItem(cacheKey);
3387            }
3388        });
3389        return true;
3390    };
3391    /**
3392     * Retrieve the cached credentials into a cacherecord
3393     * @param account
3394     * @param clientId
3395     * @param scopes
3396     * @param environment
3397     * @param authScheme
3398     */
3399    CacheManager.prototype.readCacheRecord = function (account, request, environment) {
3400        var tokenKeys = this.getTokenKeys();
3401        var cachedAccount = this.readAccountFromCache(account);
3402        var cachedIdToken = this.getIdToken(account, tokenKeys);
3403        var cachedAccessToken = this.getAccessToken(account, request, tokenKeys);
3404        var cachedRefreshToken = this.getRefreshToken(account, false, tokenKeys);
3405        var cachedAppMetadata = this.readAppMetadataFromCache(environment);
3406        if (cachedAccount && cachedIdToken) {
3407            cachedAccount.idTokenClaims = new AuthToken(cachedIdToken.secret, this.cryptoImpl).claims;
3408        }
3409        return {
3410            account: cachedAccount,
3411            idToken: cachedIdToken,
3412            accessToken: cachedAccessToken,
3413            refreshToken: cachedRefreshToken,
3414            appMetadata: cachedAppMetadata,
3415        };
3416    };
3417    /**
3418     * Retrieve AccountEntity from cache
3419     * @param account
3420     */
3421    CacheManager.prototype.readAccountFromCache = function (account) {
3422        var accountKey = AccountEntity.generateAccountCacheKey(account);
3423        return this.getAccount(accountKey);
3424    };
3425    /**
3426     * Retrieve IdTokenEntity from cache
3427     * @param clientId
3428     * @param account
3429     * @param inputRealm
3430     */
3431    CacheManager.prototype.getIdToken = function (account, tokenKeys) {
3432        var _this = this;
3433        this.commonLogger.trace("CacheManager - getIdToken called");
3434        var idTokenFilter = {
3435            homeAccountId: account.homeAccountId,
3436            environment: account.environment,
3437            credentialType: CredentialType.ID_TOKEN,
3438            clientId: this.clientId,
3439            realm: account.tenantId,
3440        };
3441        var idTokens = this.getIdTokensByFilter(idTokenFilter, tokenKeys);
3442        var numIdTokens = idTokens.length;
3443        if (numIdTokens < 1) {
3444            this.commonLogger.info("CacheManager:getIdToken - No token found");
3445            return null;
3446        }
3447        else if (numIdTokens > 1) {
3448            this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them");
3449            idTokens.forEach(function (idToken) {
3450                _this.removeIdToken(idToken.generateCredentialKey());
3451            });
3452            return null;
3453        }
3454        this.commonLogger.info("CacheManager:getIdToken - Returning id token");
3455        return idTokens[0];
3456    };
3457    /**
3458     * Gets all idTokens matching the given filter
3459     * @param filter
3460     * @returns
3461     */
3462    CacheManager.prototype.getIdTokensByFilter = function (filter, tokenKeys) {
3463        var _this = this;
3464        var idTokenKeys = tokenKeys && tokenKeys.idToken || this.getTokenKeys().idToken;
3465        var idTokens = [];
3466        idTokenKeys.forEach(function (key) {
3467            if (!_this.idTokenKeyMatchesFilter(key, __assign({ clientId: _this.clientId }, filter))) {
3468                return;
3469            }
3470            var idToken = _this.getIdTokenCredential(key);
3471            if (idToken && _this.credentialMatchesFilter(idToken, filter)) {
3472                idTokens.push(idToken);
3473            }
3474        });
3475        return idTokens;
3476    };
3477    /**
3478     * Validate the cache key against filter before retrieving and parsing cache value
3479     * @param key
3480     * @param filter
3481     * @returns
3482     */
3483    CacheManager.prototype.idTokenKeyMatchesFilter = function (inputKey, filter) {
3484        var key = inputKey.toLowerCase();
3485        if (filter.clientId && key.indexOf(filter.clientId.toLowerCase()) === -1) {
3486            return false;
3487        }
3488        if (filter.homeAccountId && key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {
3489            return false;
3490        }
3491        return true;
3492    };
3493    /**
3494     * Removes idToken from the cache
3495     * @param key
3496     */
3497    CacheManager.prototype.removeIdToken = function (key) {
3498        this.removeItem(key);
3499    };
3500    /**
3501     * Removes refresh token from the cache
3502     * @param key
3503     */
3504    CacheManager.prototype.removeRefreshToken = function (key) {
3505        this.removeItem(key);
3506    };
3507    /**
3508     * Retrieve AccessTokenEntity from cache
3509     * @param clientId
3510     * @param account
3511     * @param scopes
3512     * @param authScheme
3513     */
3514    CacheManager.prototype.getAccessToken = function (account, request, tokenKeys) {
3515        var _this = this;
3516        this.commonLogger.trace("CacheManager - getAccessToken called");
3517        var scopes = ScopeSet.createSearchScopes(request.scopes);
3518        var authScheme = request.authenticationScheme || exports.AuthenticationScheme.BEARER;
3519        /*
3520         * Distinguish between Bearer and PoP/SSH token cache types
3521         * Cast to lowercase to handle "bearer" from ADFS
3522         */
3523        var credentialType = (authScheme && authScheme.toLowerCase() !== exports.AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN;
3524        var accessTokenFilter = {
3525            homeAccountId: account.homeAccountId,
3526            environment: account.environment,
3527            credentialType: credentialType,
3528            clientId: this.clientId,
3529            realm: account.tenantId,
3530            target: scopes,
3531            tokenType: authScheme,
3532            keyId: request.sshKid,
3533            requestedClaimsHash: request.requestedClaimsHash,
3534        };
3535        var accessTokenKeys = tokenKeys && tokenKeys.accessToken || this.getTokenKeys().accessToken;
3536        var accessTokens = [];
3537        accessTokenKeys.forEach(function (key) {
3538            // Validate key
3539            if (_this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
3540                var accessToken = _this.getAccessTokenCredential(key);
3541                // Validate value
3542                if (accessToken && _this.credentialMatchesFilter(accessToken, accessTokenFilter)) {
3543                    accessTokens.push(accessToken);
3544                }
3545            }
3546        });
3547        var numAccessTokens = accessTokens.length;
3548        if (numAccessTokens < 1) {
3549            this.commonLogger.info("CacheManager:getAccessToken - No token found");
3550            return null;
3551        }
3552        else if (numAccessTokens > 1) {
3553            this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them");
3554            accessTokens.forEach(function (accessToken) {
3555                _this.removeAccessToken(accessToken.generateCredentialKey());
3556            });
3557            return null;
3558        }
3559        this.commonLogger.info("CacheManager:getAccessToken - Returning access token");
3560        return accessTokens[0];
3561    };
3562    /**
3563     * Validate the cache key against filter before retrieving and parsing cache value
3564     * @param key
3565     * @param filter
3566     * @param keyMustContainAllScopes
3567     * @returns
3568     */
3569    CacheManager.prototype.accessTokenKeyMatchesFilter = function (inputKey, filter, keyMustContainAllScopes) {
3570        var key = inputKey.toLowerCase();
3571        if (filter.clientId && key.indexOf(filter.clientId.toLowerCase()) === -1) {
3572            return false;
3573        }
3574        if (filter.homeAccountId && key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {
3575            return false;
3576        }
3577        if (filter.realm && key.indexOf(filter.realm.toLowerCase()) === -1) {
3578            return false;
3579        }
3580        if (filter.requestedClaimsHash && key.indexOf(filter.requestedClaimsHash.toLowerCase()) === -1) {
3581            return false;
3582        }
3583        if (filter.target) {
3584            var scopes = filter.target.asArray();
3585            for (var i = 0; i < scopes.length; i++) {
3586                if (keyMustContainAllScopes && !key.includes(scopes[i].toLowerCase())) {
3587                    // When performing a cache lookup a missing scope would be a cache miss
3588                    return false;
3589                }
3590                else if (!keyMustContainAllScopes && key.includes(scopes[i].toLowerCase())) {
3591                    // When performing a cache write, any token with a subset of requested scopes should be replaced
3592                    return true;
3593                }
3594            }
3595        }
3596        return true;
3597    };
3598    /**
3599     * Gets all access tokens matching the filter
3600     * @param filter
3601     * @returns
3602     */
3603    CacheManager.prototype.getAccessTokensByFilter = function (filter) {
3604        var _this = this;
3605        var tokenKeys = this.getTokenKeys();
3606        var accessTokens = [];
3607        tokenKeys.accessToken.forEach(function (key) {
3608            if (!_this.accessTokenKeyMatchesFilter(key, filter, true)) {
3609                return;
3610            }
3611            var accessToken = _this.getAccessTokenCredential(key);
3612            if (accessToken && _this.credentialMatchesFilter(accessToken, filter)) {
3613                accessTokens.push(accessToken);
3614            }
3615        });
3616        return accessTokens;
3617    };
3618    /**
3619     * Helper to retrieve the appropriate refresh token from cache
3620     * @param clientId
3621     * @param account
3622     * @param familyRT
3623     */
3624    CacheManager.prototype.getRefreshToken = function (account, familyRT, tokenKeys) {
3625        var _this = this;
3626        this.commonLogger.trace("CacheManager - getRefreshToken called");
3627        var id = familyRT ? THE_FAMILY_ID : undefined;
3628        var refreshTokenFilter = {
3629            homeAccountId: account.homeAccountId,
3630            environment: account.environment,
3631            credentialType: CredentialType.REFRESH_TOKEN,
3632            clientId: this.clientId,
3633            familyId: id,
3634        };
3635        var refreshTokenKeys = tokenKeys && tokenKeys.refreshToken || this.getTokenKeys().refreshToken;
3636        var refreshTokens = [];
3637        refreshTokenKeys.forEach(function (key) {
3638            // Validate key
3639            if (_this.refreshTokenKeyMatchesFilter(key, refreshTokenFilter)) {
3640                var refreshToken = _this.getRefreshTokenCredential(key);
3641                // Validate value
3642                if (refreshToken && _this.credentialMatchesFilter(refreshToken, refreshTokenFilter)) {
3643                    refreshTokens.push(refreshToken);
3644                }
3645            }
3646        });
3647        var numRefreshTokens = refreshTokens.length;
3648        if (numRefreshTokens < 1) {
3649            this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.");
3650            return null;
3651        }
3652        // address the else case after remove functions address environment aliases
3653        this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token");
3654        return refreshTokens[0];
3655    };
3656    /**
3657     * Validate the cache key against filter before retrieving and parsing cache value
3658     * @param key
3659     * @param filter
3660     */
3661    CacheManager.prototype.refreshTokenKeyMatchesFilter = function (inputKey, filter) {
3662        var key = inputKey.toLowerCase();
3663        if (filter.familyId && key.indexOf(filter.familyId.toLowerCase()) === -1) {
3664            return false;
3665        }
3666        // If familyId is used, clientId is not in the key
3667        if (!filter.familyId && filter.clientId && key.indexOf(filter.clientId.toLowerCase()) === -1) {
3668            return false;
3669        }
3670        if (filter.homeAccountId && key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {
3671            return false;
3672        }
3673        return true;
3674    };
3675    /**
3676     * Retrieve AppMetadataEntity from cache
3677     */
3678    CacheManager.prototype.readAppMetadataFromCache = function (environment) {
3679        var appMetadataFilter = {
3680            environment: environment,
3681            clientId: this.clientId,
3682        };
3683        var appMetadata = this.getAppMetadataFilteredBy(appMetadataFilter);
3684        var appMetadataEntries = Object.keys(appMetadata).map(function (key) { return appMetadata[key]; });
3685        var numAppMetadata = appMetadataEntries.length;
3686        if (numAppMetadata < 1) {
3687            return null;
3688        }
3689        else if (numAppMetadata > 1) {
3690            throw ClientAuthError.createMultipleMatchingAppMetadataInCacheError();
3691        }
3692        return appMetadataEntries[0];
3693    };
3694    /**
3695     * Return the family_id value associated  with FOCI
3696     * @param environment
3697     * @param clientId
3698     */
3699    CacheManager.prototype.isAppMetadataFOCI = function (environment) {
3700        var appMetadata = this.readAppMetadataFromCache(environment);
3701        return !!(appMetadata && appMetadata.familyId === THE_FAMILY_ID);
3702    };
3703    /**
3704     * helper to match account ids
3705     * @param value
3706     * @param homeAccountId
3707     */
3708    CacheManager.prototype.matchHomeAccountId = function (entity, homeAccountId) {
3709        return !!((typeof entity.homeAccountId === "string") && (homeAccountId === entity.homeAccountId));
3710    };
3711    /**
3712     * helper to match account ids
3713     * @param entity
3714     * @param localAccountId
3715     * @returns
3716     */
3717    CacheManager.prototype.matchLocalAccountId = function (entity, localAccountId) {
3718        return !!((typeof entity.localAccountId === "string") && (localAccountId === entity.localAccountId));
3719    };
3720    /**
3721     * helper to match usernames
3722     * @param entity
3723     * @param username
3724     * @returns
3725     */
3726    CacheManager.prototype.matchUsername = function (entity, username) {
3727        return !!((typeof entity.username === "string") && (username.toLowerCase() === entity.username.toLowerCase()));
3728    };
3729    /**
3730     * helper to match assertion
3731     * @param value
3732     * @param oboAssertion
3733     */
3734    CacheManager.prototype.matchUserAssertionHash = function (entity, userAssertionHash) {
3735        return !!(entity.userAssertionHash && userAssertionHash === entity.userAssertionHash);
3736    };
3737    /**
3738     * helper to match environment
3739     * @param value
3740     * @param environment
3741     */
3742    CacheManager.prototype.matchEnvironment = function (entity, environment) {
3743        var cloudMetadata = this.getAuthorityMetadataByAlias(environment);
3744        if (cloudMetadata && cloudMetadata.aliases.indexOf(entity.environment) > -1) {
3745            return true;
3746        }
3747        return false;
3748    };
3749    /**
3750     * helper to match credential type
3751     * @param entity
3752     * @param credentialType
3753     */
3754    CacheManager.prototype.matchCredentialType = function (entity, credentialType) {
3755        return (entity.credentialType && credentialType.toLowerCase() === entity.credentialType.toLowerCase());
3756    };
3757    /**
3758     * helper to match client ids
3759     * @param entity
3760     * @param clientId
3761     */
3762    CacheManager.prototype.matchClientId = function (entity, clientId) {
3763        return !!(entity.clientId && clientId === entity.clientId);
3764    };
3765    /**
3766     * helper to match family ids
3767     * @param entity
3768     * @param familyId
3769     */
3770    CacheManager.prototype.matchFamilyId = function (entity, familyId) {
3771        return !!(entity.familyId && familyId === entity.familyId);
3772    };
3773    /**
3774     * helper to match realm
3775     * @param entity
3776     * @param realm
3777     */
3778    CacheManager.prototype.matchRealm = function (entity, realm) {
3779        return !!(entity.realm && realm === entity.realm);
3780    };
3781    /**
3782     * helper to match nativeAccountId
3783     * @param entity
3784     * @param nativeAccountId
3785     * @returns boolean indicating the match result
3786     */
3787    CacheManager.prototype.matchNativeAccountId = function (entity, nativeAccountId) {
3788        return !!(entity.nativeAccountId && nativeAccountId === entity.nativeAccountId);
3789    };
3790    /**
3791     * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.
3792     * @param entity
3793     * @param target
3794     */
3795    CacheManager.prototype.matchTarget = function (entity, target) {
3796        var isNotAccessTokenCredential = (entity.credentialType !== CredentialType.ACCESS_TOKEN && entity.credentialType !== CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME);
3797        if (isNotAccessTokenCredential || !entity.target) {
3798            return false;
3799        }
3800        var entityScopeSet = ScopeSet.fromString(entity.target);
3801        return entityScopeSet.containsScopeSet(target);
3802    };
3803    /**
3804     * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise
3805     * @param entity
3806     * @param tokenType
3807     */
3808    CacheManager.prototype.matchTokenType = function (entity, tokenType) {
3809        return !!(entity.tokenType && entity.tokenType === tokenType);
3810    };
3811    /**
3812     * Returns true if the credential's keyId matches the one in the request, false otherwise
3813     * @param entity
3814     * @param tokenType
3815     */
3816    CacheManager.prototype.matchKeyId = function (entity, keyId) {
3817        return !!(entity.keyId && entity.keyId === keyId);
3818    };
3819    /**
3820     * returns if a given cache entity is of the type appmetadata
3821     * @param key
3822     */
3823    CacheManager.prototype.isAppMetadata = function (key) {
3824        return key.indexOf(APP_METADATA) !== -1;
3825    };
3826    /**
3827     * returns if a given cache entity is of the type authoritymetadata
3828     * @param key
3829     */
3830    CacheManager.prototype.isAuthorityMetadata = function (key) {
3831        return key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) !== -1;
3832    };
3833    /**
3834     * returns cache key used for cloud instance metadata
3835     */
3836    CacheManager.prototype.generateAuthorityMetadataCacheKey = function (authority) {
3837        return AUTHORITY_METADATA_CONSTANTS.CACHE_KEY + "-" + this.clientId + "-" + authority;
3838    };
3839    /**
3840     * Helper to convert serialized data to object
3841     * @param obj
3842     * @param json
3843     */
3844    CacheManager.toObject = function (obj, json) {
3845        for (var propertyName in json) {
3846            obj[propertyName] = json[propertyName];
3847        }
3848        return obj;
3849    };
3850    return CacheManager;
3851}());
3852var DefaultStorageClass = /** @class */ (function (_super) {
3853    __extends(DefaultStorageClass, _super);
3854    function DefaultStorageClass() {
3855        return _super !== null && _super.apply(this, arguments) || this;
3856    }
3857    DefaultStorageClass.prototype.setAccount = function () {
3858        var notImplErr = "Storage interface - setAccount() has not been implemented for the cacheStorage interface.";
3859        throw AuthError.createUnexpectedError(notImplErr);
3860    };
3861    DefaultStorageClass.prototype.getAccount = function () {
3862        var notImplErr = "Storage interface - getAccount() has not been implemented for the cacheStorage interface.";
3863        throw AuthError.createUnexpectedError(notImplErr);
3864    };
3865    DefaultStorageClass.prototype.setIdTokenCredential = function () {
3866        var notImplErr = "Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.";
3867        throw AuthError.createUnexpectedError(notImplErr);
3868    };
3869    DefaultStorageClass.prototype.getIdTokenCredential = function () {
3870        var notImplErr = "Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.";
3871        throw AuthError.createUnexpectedError(notImplErr);
3872    };
3873    DefaultStorageClass.prototype.setAccessTokenCredential = function () {
3874        var notImplErr = "Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.";
3875        throw AuthError.createUnexpectedError(notImplErr);
3876    };
3877    DefaultStorageClass.prototype.getAccessTokenCredential = function () {
3878        var notImplErr = "Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.";
3879        throw AuthError.createUnexpectedError(notImplErr);
3880    };
3881    DefaultStorageClass.prototype.setRefreshTokenCredential = function () {
3882        var notImplErr = "Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.";
3883        throw AuthError.createUnexpectedError(notImplErr);
3884    };
3885    DefaultStorageClass.prototype.getRefreshTokenCredential = function () {
3886        var notImplErr = "Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.";
3887        throw AuthError.createUnexpectedError(notImplErr);
3888    };
3889    DefaultStorageClass.prototype.setAppMetadata = function () {
3890        var notImplErr = "Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.";
3891        throw AuthError.createUnexpectedError(notImplErr);
3892    };
3893    DefaultStorageClass.prototype.getAppMetadata = function () {
3894        var notImplErr = "Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.";
3895        throw AuthError.createUnexpectedError(notImplErr);
3896    };
3897    DefaultStorageClass.prototype.setServerTelemetry = function () {
3898        var notImplErr = "Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.";
3899        throw AuthError.createUnexpectedError(notImplErr);
3900    };
3901    DefaultStorageClass.prototype.getServerTelemetry = function () {
3902        var notImplErr = "Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.";
3903        throw AuthError.createUnexpectedError(notImplErr);
3904    };
3905    DefaultStorageClass.prototype.setAuthorityMetadata = function () {
3906        var notImplErr = "Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.";
3907        throw AuthError.createUnexpectedError(notImplErr);
3908    };
3909    DefaultStorageClass.prototype.getAuthorityMetadata = function () {
3910        var notImplErr = "Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.";
3911        throw AuthError.createUnexpectedError(notImplErr);
3912    };
3913    DefaultStorageClass.prototype.getAuthorityMetadataKeys = function () {
3914        var notImplErr = "Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.";
3915        throw AuthError.createUnexpectedError(notImplErr);
3916    };
3917    DefaultStorageClass.prototype.setThrottlingCache = function () {
3918        var notImplErr = "Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.";
3919        throw AuthError.createUnexpectedError(notImplErr);
3920    };
3921    DefaultStorageClass.prototype.getThrottlingCache = function () {
3922        var notImplErr = "Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.";
3923        throw AuthError.createUnexpectedError(notImplErr);
3924    };
3925    DefaultStorageClass.prototype.removeItem = function () {
3926        var notImplErr = "Storage interface - removeItem() has not been implemented for the cacheStorage interface.";
3927        throw AuthError.createUnexpectedError(notImplErr);
3928    };
3929    DefaultStorageClass.prototype.containsKey = function () {
3930        var notImplErr = "Storage interface - containsKey() has not been implemented for the cacheStorage interface.";
3931        throw AuthError.createUnexpectedError(notImplErr);
3932    };
3933    DefaultStorageClass.prototype.getKeys = function () {
3934        var notImplErr = "Storage interface - getKeys() has not been implemented for the cacheStorage interface.";
3935        throw AuthError.createUnexpectedError(notImplErr);
3936    };
3937    DefaultStorageClass.prototype.getAccountKeys = function () {
3938        var notImplErr = "Storage interface - getAccountKeys() has not been implemented for the cacheStorage interface.";
3939        throw AuthError.createUnexpectedError(notImplErr);
3940    };
3941    DefaultStorageClass.prototype.getTokenKeys = function () {
3942        var notImplErr = "Storage interface - getTokenKeys() has not been implemented for the cacheStorage interface.";
3943        throw AuthError.createUnexpectedError(notImplErr);
3944    };
3945    DefaultStorageClass.prototype.clear = function () {
3946        return __awaiter(this, void 0, void 0, function () {
3947            var notImplErr;
3948            return __generator(this, function (_a) {
3949                notImplErr = "Storage interface - clear() has not been implemented for the cacheStorage interface.";
3950                throw AuthError.createUnexpectedError(notImplErr);
3951            });
3952        });
3953    };
3954    DefaultStorageClass.prototype.updateCredentialCacheKey = function () {
3955        var notImplErr = "Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";
3956        throw AuthError.createUnexpectedError(notImplErr);
3957    };
3958    return DefaultStorageClass;
3959}(CacheManager));
3960
3961/*! @azure/msal-common v13.3.3 2024-06-06 */
3962
3963/*
3964 * Copyright (c) Microsoft Corporation. All rights reserved.
3965 * Licensed under the MIT License.
3966 */
3967// Token renewal offset default in seconds
3968var DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
3969var DEFAULT_SYSTEM_OPTIONS = {
3970    tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
3971    preventCorsPreflight: false
3972};
3973var DEFAULT_LOGGER_IMPLEMENTATION = {
3974    loggerCallback: function () {
3975        // allow users to not set loggerCallback
3976    },
3977    piiLoggingEnabled: false,
3978    logLevel: exports.LogLevel.Info,
3979    correlationId: Constants.EMPTY_STRING
3980};
3981var DEFAULT_CACHE_OPTIONS = {
3982    claimsBasedCachingEnabled: true
3983};
3984var DEFAULT_NETWORK_IMPLEMENTATION = {
3985    sendGetRequestAsync: function () {
3986        return __awaiter(this, void 0, void 0, function () {
3987            var notImplErr;
3988            return __generator(this, function (_a) {
3989                notImplErr = "Network interface - sendGetRequestAsync() has not been implemented";
3990                throw AuthError.createUnexpectedError(notImplErr);
3991            });
3992        });
3993    },
3994    sendPostRequestAsync: function () {
3995        return __awaiter(this, void 0, void 0, function () {
3996            var notImplErr;
3997            return __generator(this, function (_a) {
3998                notImplErr = "Network interface - sendPostRequestAsync() has not been implemented";
3999                throw AuthError.createUnexpectedError(notImplErr);
4000            });
4001        });
4002    }
4003};
4004var DEFAULT_LIBRARY_INFO = {
4005    sku: Constants.SKU,
4006    version: version$1,
4007    cpu: Constants.EMPTY_STRING,
4008    os: Constants.EMPTY_STRING
4009};
4010var DEFAULT_CLIENT_CREDENTIALS = {
4011    clientSecret: Constants.EMPTY_STRING,
4012    clientAssertion: undefined
4013};
4014var DEFAULT_AZURE_CLOUD_OPTIONS = {
4015    azureCloudInstance: exports.AzureCloudInstance.None,
4016    tenant: "" + Constants.DEFAULT_COMMON_TENANT
4017};
4018var DEFAULT_TELEMETRY_OPTIONS = {
4019    application: {
4020        appName: "",
4021        appVersion: ""
4022    }
4023};
4024/**
4025 * Function that sets the default options when not explicitly configured from app developer
4026 *
4027 * @param Configuration
4028 *
4029 * @returns Configuration
4030 */
4031function buildClientConfiguration(_a) {
4032    var userAuthOptions = _a.authOptions, userSystemOptions = _a.systemOptions, userLoggerOption = _a.loggerOptions, userCacheOptions = _a.cacheOptions, storageImplementation = _a.storageInterface, networkImplementation = _a.networkInterface, cryptoImplementation = _a.cryptoInterface, clientCredentials = _a.clientCredentials, libraryInfo = _a.libraryInfo, telemetry = _a.telemetry, serverTelemetryManager = _a.serverTelemetryManager, persistencePlugin = _a.persistencePlugin, serializableCache = _a.serializableCache;
4033    var loggerOptions = __assign(__assign({}, DEFAULT_LOGGER_IMPLEMENTATION), userLoggerOption);
4034    return {
4035        authOptions: buildAuthOptions(userAuthOptions),
4036        systemOptions: __assign(__assign({}, DEFAULT_SYSTEM_OPTIONS), userSystemOptions),
4037        loggerOptions: loggerOptions,
4038        cacheOptions: __assign(__assign({}, DEFAULT_CACHE_OPTIONS), userCacheOptions),
4039        storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions)),
4040        networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
4041        cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
4042        clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
4043        libraryInfo: __assign(__assign({}, DEFAULT_LIBRARY_INFO), libraryInfo),
4044        telemetry: __assign(__assign({}, DEFAULT_TELEMETRY_OPTIONS), telemetry),
4045        serverTelemetryManager: serverTelemetryManager || null,
4046        persistencePlugin: persistencePlugin || null,
4047        serializableCache: serializableCache || null,
4048    };
4049}
4050/**
4051 * Construct authoptions from the client and platform passed values
4052 * @param authOptions
4053 */
4054function buildAuthOptions(authOptions) {
4055    return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
4056}
4057
4058/*! @azure/msal-common v13.3.3 2024-06-06 */
4059
4060/*
4061 * Copyright (c) Microsoft Corporation. All rights reserved.
4062 * Licensed under the MIT License.
4063 */
4064/**
4065 * Error thrown when there is an error with the server code, for example, unavailability.
4066 */
4067var ServerError = /** @class */ (function (_super) {
4068    __extends(ServerError, _super);
4069    function ServerError(errorCode, errorMessage, subError) {
4070        var _this = _super.call(this, errorCode, errorMessage, subError) || this;
4071        _this.name = "ServerError";
4072        Object.setPrototypeOf(_this, ServerError.prototype);
4073        return _this;
4074    }
4075    return ServerError;
4076}(AuthError));
4077
4078/*! @azure/msal-common v13.3.3 2024-06-06 */
4079
4080/*
4081 * Copyright (c) Microsoft Corporation. All rights reserved.
4082 * Licensed under the MIT License.
4083 */
4084var ThrottlingUtils = /** @class */ (function () {
4085    function ThrottlingUtils() {
4086    }
4087    /**
4088     * Prepares a RequestThumbprint to be stored as a key.
4089     * @param thumbprint
4090     */
4091    ThrottlingUtils.generateThrottlingStorageKey = function (thumbprint) {
4092        return ThrottlingConstants.THROTTLING_PREFIX + "." + JSON.stringify(thumbprint);
4093    };
4094    /**
4095     * Performs necessary throttling checks before a network request.
4096     * @param cacheManager
4097     * @param thumbprint
4098     */
4099    ThrottlingUtils.preProcess = function (cacheManager, thumbprint) {
4100        var _a;
4101        var key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
4102        var value = cacheManager.getThrottlingCache(key);
4103        if (value) {
4104            if (value.throttleTime < Date.now()) {
4105                cacheManager.removeItem(key);
4106                return;
4107            }
4108            throw new ServerError(((_a = value.errorCodes) === null || _a === void 0 ? void 0 : _a.join(" ")) || Constants.EMPTY_STRING, value.errorMessage, value.subError);
4109        }
4110    };
4111    /**
4112     * Performs necessary throttling checks after a network request.
4113     * @param cacheManager
4114     * @param thumbprint
4115     * @param response
4116     */
4117    ThrottlingUtils.postProcess = function (cacheManager, thumbprint, response) {
4118        if (ThrottlingUtils.checkResponseStatus(response) || ThrottlingUtils.checkResponseForRetryAfter(response)) {
4119            var thumbprintValue = {
4120                throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),
4121                error: response.body.error,
4122                errorCodes: response.body.error_codes,
4123                errorMessage: response.body.error_description,
4124                subError: response.body.suberror
4125            };
4126            cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
4127        }
4128    };
4129    /**
4130     * Checks a NetworkResponse object's status codes against 429 or 5xx
4131     * @param response
4132     */
4133    ThrottlingUtils.checkResponseStatus = function (response) {
4134        return response.status === 429 || response.status >= 500 && response.status < 600;
4135    };
4136    /**
4137     * Checks a NetworkResponse object's RetryAfter header
4138     * @param response
4139     */
4140    ThrottlingUtils.checkResponseForRetryAfter = function (response) {
4141        if (response.headers) {
4142            return response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) && (response.status < 200 || response.status >= 300);
4143        }
4144        return false;
4145    };
4146    /**
4147     * Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
4148     * @param throttleTime
4149     */
4150    ThrottlingUtils.calculateThrottleTime = function (throttleTime) {
4151        var time = throttleTime <= 0 ? 0 : throttleTime;
4152        var currentSeconds = Date.now() / 1000;
4153        return Math.floor(Math.min(currentSeconds + (time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS), currentSeconds + ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);
4154    };
4155    ThrottlingUtils.removeThrottle = function (cacheManager, clientId, request, homeAccountIdentifier) {
4156        var thumbprint = {
4157            clientId: clientId,
4158            authority: request.authority,
4159            scopes: request.scopes,
4160            homeAccountIdentifier: homeAccountIdentifier,
4161            claims: request.claims,
4162            authenticationScheme: request.authenticationScheme,
4163            resourceRequestMethod: request.resourceRequestMethod,
4164            resourceRequestUri: request.resourceRequestUri,
4165            shrClaims: request.shrClaims,
4166            sshKid: request.sshKid
4167        };
4168        var key = this.generateThrottlingStorageKey(thumbprint);
4169        cacheManager.removeItem(key);
4170    };
4171    return ThrottlingUtils;
4172}());
4173
4174/*! @azure/msal-common v13.3.3 2024-06-06 */
4175
4176/*
4177 * Copyright (c) Microsoft Corporation. All rights reserved.
4178 * Licensed under the MIT License.
4179 */
4180var NetworkManager = /** @class */ (function () {
4181    function NetworkManager(networkClient, cacheManager) {
4182        this.networkClient = networkClient;
4183        this.cacheManager = cacheManager;
4184    }
4185    /**
4186     * Wraps sendPostRequestAsync with necessary preflight and postflight logic
4187     * @param thumbprint
4188     * @param tokenEndpoint
4189     * @param options
4190     */
4191    NetworkManager.prototype.sendPostRequest = function (thumbprint, tokenEndpoint, options) {
4192        return __awaiter(this, void 0, void 0, function () {
4193            var response, e_1;
4194            return __generator(this, function (_a) {
4195                switch (_a.label) {
4196                    case 0:
4197                        ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
4198                        _a.label = 1;
4199                    case 1:
4200                        _a.trys.push([1, 3, , 4]);
4201                        return [4 /*yield*/, this.networkClient.sendPostRequestAsync(tokenEndpoint, options)];
4202                    case 2:
4203                        response = _a.sent();
4204                        return [3 /*break*/, 4];
4205                    case 3:
4206                        e_1 = _a.sent();
4207                        if (e_1 instanceof AuthError) {
4208                            throw e_1;
4209                        }
4210                        else {
4211                            throw ClientAuthError.createNetworkError(tokenEndpoint, e_1);
4212                        }
4213                    case 4:
4214                        ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
4215                        return [2 /*return*/, response];
4216                }
4217            });
4218        });
4219    };
4220    return NetworkManager;
4221}());
4222
4223/*! @azure/msal-common v13.3.3 2024-06-06 */
4224/*
4225 * Copyright (c) Microsoft Corporation. All rights reserved.
4226 * Licensed under the MIT License.
4227 */
4228var CcsCredentialType;
4229(function (CcsCredentialType) {
4230    CcsCredentialType["HOME_ACCOUNT_ID"] = "home_account_id";
4231    CcsCredentialType["UPN"] = "UPN";
4232})(CcsCredentialType || (CcsCredentialType = {}));
4233
4234/*! @azure/msal-common v13.3.3 2024-06-06 */
4235
4236/*
4237 * Copyright (c) Microsoft Corporation. All rights reserved.
4238 * Licensed under the MIT License.
4239 */
4240/**
4241 * Validates server consumable params from the "request" objects
4242 */
4243var RequestValidator = /** @class */ (function () {
4244    function RequestValidator() {
4245    }
4246    /**
4247     * Utility to check if the `redirectUri` in the request is a non-null value
4248     * @param redirectUri
4249     */
4250    RequestValidator.validateRedirectUri = function (redirectUri) {
4251        if (StringUtils.isEmpty(redirectUri)) {
4252            throw ClientConfigurationError.createRedirectUriEmptyError();
4253        }
4254    };
4255    /**
4256     * Utility to validate prompt sent by the user in the request
4257     * @param prompt
4258     */
4259    RequestValidator.validatePrompt = function (prompt) {
4260        var promptValues = [];
4261        for (var value in PromptValue) {
4262            promptValues.push(PromptValue[value]);
4263        }
4264        if (promptValues.indexOf(prompt) < 0) {
4265            throw ClientConfigurationError.createInvalidPromptError(prompt);
4266        }
4267    };
4268    RequestValidator.validateClaims = function (claims) {
4269        try {
4270            JSON.parse(claims);
4271        }
4272        catch (e) {
4273            throw ClientConfigurationError.createInvalidClaimsRequestError();
4274        }
4275    };
4276    /**
4277     * Utility to validate code_challenge and code_challenge_method
4278     * @param codeChallenge
4279     * @param codeChallengeMethod
4280     */
4281    RequestValidator.validateCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {
4282        if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {
4283            throw ClientConfigurationError.createInvalidCodeChallengeParamsError();
4284        }
4285        else {
4286            this.validateCodeChallengeMethod(codeChallengeMethod);
4287        }
4288    };
4289    /**
4290     * Utility to validate code_challenge_method
4291     * @param codeChallengeMethod
4292     */
4293    RequestValidator.validateCodeChallengeMethod = function (codeChallengeMethod) {
4294        if ([
4295            CodeChallengeMethodValues.PLAIN,
4296            CodeChallengeMethodValues.S256
4297        ].indexOf(codeChallengeMethod) < 0) {
4298            throw ClientConfigurationError.createInvalidCodeChallengeMethodError();
4299        }
4300    };
4301    /**
4302     * Removes unnecessary, duplicate, and empty string query parameters from extraQueryParameters
4303     * @param request
4304     */
4305    RequestValidator.sanitizeEQParams = function (eQParams, queryParams) {
4306        if (!eQParams) {
4307            return {};
4308        }
4309        // Remove any query parameters already included in SSO params
4310        queryParams.forEach(function (value, key) {
4311            if (eQParams[key]) {
4312                delete eQParams[key];
4313            }
4314        });
4315        // remove empty string parameters
4316        // eslint-disable-next-line @typescript-eslint/no-unused-vars
4317        return Object.fromEntries(Object.entries(eQParams).filter(function (_a) {
4318            var value = _a[1];
4319            return value !== "";
4320        }));
4321    };
4322    return RequestValidator;
4323}());
4324
4325/*! @azure/msal-common v13.3.3 2024-06-06 */
4326
4327/*
4328 * Copyright (c) Microsoft Corporation. All rights reserved.
4329 * Licensed under the MIT License.
4330 */
4331var RequestParameterBuilder = /** @class */ (function () {
4332    function RequestParameterBuilder() {
4333        this.parameters = new Map();
4334    }
4335    /**
4336     * add response_type = code
4337     */
4338    RequestParameterBuilder.prototype.addResponseTypeCode = function () {
4339        this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE));
4340    };
4341    /**
4342     * add response_type = token id_token
4343     */
4344    RequestParameterBuilder.prototype.addResponseTypeForTokenAndIdToken = function () {
4345        this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.TOKEN_RESPONSE_TYPE + " " + Constants.ID_TOKEN_RESPONSE_TYPE));
4346    };
4347    /**
4348     * add response_mode. defaults to query.
4349     * @param responseMode
4350     */
4351    RequestParameterBuilder.prototype.addResponseMode = function (responseMode) {
4352        this.parameters.set(AADServerParamKeys.RESPONSE_MODE, encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY));
4353    };
4354    /**
4355     * Add flag to indicate STS should attempt to use WAM if available
4356     */
4357    RequestParameterBuilder.prototype.addNativeBroker = function () {
4358        this.parameters.set(AADServerParamKeys.NATIVE_BROKER, encodeURIComponent("1"));
4359    };
4360    /**
4361     * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios
4362     * @param scopeSet
4363     * @param addOidcScopes
4364     */
4365    RequestParameterBuilder.prototype.addScopes = function (scopes, addOidcScopes) {
4366        if (addOidcScopes === void 0) { addOidcScopes = true; }
4367        var requestScopes = addOidcScopes ? __spreadArrays(scopes || [], OIDC_DEFAULT_SCOPES) : scopes || [];
4368        var scopeSet = new ScopeSet(requestScopes);
4369        this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));
4370    };
4371    /**
4372     * add clientId
4373     * @param clientId
4374     */
4375    RequestParameterBuilder.prototype.addClientId = function (clientId) {
4376        this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));
4377    };
4378    /**
4379     * add redirect_uri
4380     * @param redirectUri
4381     */
4382    RequestParameterBuilder.prototype.addRedirectUri = function (redirectUri) {
4383        RequestValidator.validateRedirectUri(redirectUri);
4384        this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));
4385    };
4386    /**
4387     * add post logout redirectUri
4388     * @param redirectUri
4389     */
4390    RequestParameterBuilder.prototype.addPostLogoutRedirectUri = function (redirectUri) {
4391        RequestValidator.validateRedirectUri(redirectUri);
4392        this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));
4393    };
4394    /**
4395     * add id_token_hint to logout request
4396     * @param idTokenHint
4397     */
4398    RequestParameterBuilder.prototype.addIdTokenHint = function (idTokenHint) {
4399        this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));
4400    };
4401    /**
4402     * add domain_hint
4403     * @param domainHint
4404     */
4405    RequestParameterBuilder.prototype.addDomainHint = function (domainHint) {
4406        this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));
4407    };
4408    /**
4409     * add login_hint
4410     * @param loginHint
4411     */
4412    RequestParameterBuilder.prototype.addLoginHint = function (loginHint) {
4413        this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));
4414    };
4415    /**
4416     * Adds the CCS (Cache Credential Service) query parameter for login_hint
4417     * @param loginHint
4418     */
4419    RequestParameterBuilder.prototype.addCcsUpn = function (loginHint) {
4420        this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent("UPN:" + loginHint));
4421    };
4422    /**
4423     * Adds the CCS (Cache Credential Service) query parameter for account object
4424     * @param loginHint
4425     */
4426    RequestParameterBuilder.prototype.addCcsOid = function (clientInfo) {
4427        this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent("Oid:" + clientInfo.uid + "@" + clientInfo.utid));
4428    };
4429    /**
4430     * add sid
4431     * @param sid
4432     */
4433    RequestParameterBuilder.prototype.addSid = function (sid) {
4434        this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));
4435    };
4436    /**
4437     * add claims
4438     * @param claims
4439     */
4440    RequestParameterBuilder.prototype.addClaims = function (claims, clientCapabilities) {
4441        var mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);
4442        RequestValidator.validateClaims(mergedClaims);
4443        this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));
4444    };
4445    /**
4446     * add correlationId
4447     * @param correlationId
4448     */
4449    RequestParameterBuilder.prototype.addCorrelationId = function (correlationId) {
4450        this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));
4451    };
4452    /**
4453     * add library info query params
vendor: 7,207 bytes, lines 4454-4630
4454     * @param libraryInfo
4455     */
4456    RequestParameterBuilder.prototype.addLibraryInfo = function (libraryInfo) {
4457        // Telemetry Info
4458        this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);
4459        this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);
4460        if (libraryInfo.os) {
4461            this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);
4462        }
4463        if (libraryInfo.cpu) {
4464            this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);
4465        }
4466    };
4467    /**
4468     * Add client telemetry parameters
4469     * @param appTelemetry
4470     */
4471    RequestParameterBuilder.prototype.addApplicationTelemetry = function (appTelemetry) {
4472        if (appTelemetry === null || appTelemetry === void 0 ? void 0 : appTelemetry.appName) {
4473            this.parameters.set(AADServerParamKeys.X_APP_NAME, appTelemetry.appName);
4474        }
4475        if (appTelemetry === null || appTelemetry === void 0 ? void 0 : appTelemetry.appVersion) {
4476            this.parameters.set(AADServerParamKeys.X_APP_VER, appTelemetry.appVersion);
4477        }
4478    };
4479    /**
4480     * add prompt
4481     * @param prompt
4482     */
4483    RequestParameterBuilder.prototype.addPrompt = function (prompt) {
4484        RequestValidator.validatePrompt(prompt);
4485        this.parameters.set("" + AADServerParamKeys.PROMPT, encodeURIComponent(prompt));
4486    };
4487    /**
4488     * add state
4489     * @param state
4490     */
4491    RequestParameterBuilder.prototype.addState = function (state) {
4492        if (!StringUtils.isEmpty(state)) {
4493            this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));
4494        }
4495    };
4496    /**
4497     * add nonce
4498     * @param nonce
4499     */
4500    RequestParameterBuilder.prototype.addNonce = function (nonce) {
4501        this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));
4502    };
4503    /**
4504     * add code_challenge and code_challenge_method
4505     * - throw if either of them are not passed
4506     * @param codeChallenge
4507     * @param codeChallengeMethod
4508     */
4509    RequestParameterBuilder.prototype.addCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {
4510        RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);
4511        if (codeChallenge && codeChallengeMethod) {
4512            this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));
4513            this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));
4514        }
4515        else {
4516            throw ClientConfigurationError.createInvalidCodeChallengeParamsError();
4517        }
4518    };
4519    /**
4520     * add the `authorization_code` passed by the user to exchange for a token
4521     * @param code
4522     */
4523    RequestParameterBuilder.prototype.addAuthorizationCode = function (code) {
4524        this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));
4525    };
4526    /**
4527     * add the `authorization_code` passed by the user to exchange for a token
4528     * @param code
4529     */
4530    RequestParameterBuilder.prototype.addDeviceCode = function (code) {
4531        this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));
4532    };
4533    /**
4534     * add the `refreshToken` passed by the user
4535     * @param refreshToken
4536     */
4537    RequestParameterBuilder.prototype.addRefreshToken = function (refreshToken) {
4538        this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));
4539    };
4540    /**
4541     * add the `code_verifier` passed by the user to exchange for a token
4542     * @param codeVerifier
4543     */
4544    RequestParameterBuilder.prototype.addCodeVerifier = function (codeVerifier) {
4545        this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));
4546    };
4547    /**
4548     * add client_secret
4549     * @param clientSecret
4550     */
4551    RequestParameterBuilder.prototype.addClientSecret = function (clientSecret) {
4552        this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));
4553    };
4554    /**
4555     * add clientAssertion for confidential client flows
4556     * @param clientAssertion
4557     */
4558    RequestParameterBuilder.prototype.addClientAssertion = function (clientAssertion) {
4559        if (!StringUtils.isEmpty(clientAssertion)) {
4560            this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));
4561        }
4562    };
4563    /**
4564     * add clientAssertionType for confidential client flows
4565     * @param clientAssertionType
4566     */
4567    RequestParameterBuilder.prototype.addClientAssertionType = function (clientAssertionType) {
4568        if (!StringUtils.isEmpty(clientAssertionType)) {
4569            this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));
4570        }
4571    };
4572    /**
4573     * add OBO assertion for confidential client flows
4574     * @param clientAssertion
4575     */
4576    RequestParameterBuilder.prototype.addOboAssertion = function (oboAssertion) {
4577        this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));
4578    };
4579    /**
4580     * add grant type
4581     * @param grantType
4582     */
4583    RequestParameterBuilder.prototype.addRequestTokenUse = function (tokenUse) {
4584        this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));
4585    };
4586    /**
4587     * add grant type
4588     * @param grantType
4589     */
4590    RequestParameterBuilder.prototype.addGrantType = function (grantType) {
4591        this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));
4592    };
4593    /**
4594     * add client info
4595     *
4596     */
4597    RequestParameterBuilder.prototype.addClientInfo = function () {
4598        this.parameters.set(CLIENT_INFO, "1");
4599    };
4600    /**
4601     * add extraQueryParams
4602     * @param eQParams
4603     */
4604    RequestParameterBuilder.prototype.addExtraQueryParameters = function (eQParams) {
4605        var _this = this;
4606        var sanitizedEQParams = RequestValidator.sanitizeEQParams(eQParams, this.parameters);
4607        Object.keys(sanitizedEQParams).forEach(function (key) {
4608            _this.parameters.set(key, eQParams[key]);
4609        });
4610    };
4611    RequestParameterBuilder.prototype.addClientCapabilitiesToClaims = function (claims, clientCapabilities) {
4612        var mergedClaims;
4613        // Parse provided claims into JSON object or initialize empty object
4614        if (!claims) {
4615            mergedClaims = {};
4616        }
4617        else {
4618            try {
4619                mergedClaims = JSON.parse(claims);
4620            }
4621            catch (e) {
4622                throw ClientConfigurationError.createInvalidClaimsRequestError();
4623            }
4624        }
4625        if (clientCapabilities && clientCapabilities.length > 0) {
4626            if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)) {
4627                // Add access_token key to claims object
4628                mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};
4629            }
4630            // Add xms_cc claim with provided clientCapabilities to access_token key
vendor: 20,081 bytes, lines 4631-5105
4631            mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {
4632                values: clientCapabilities
4633            };
4634        }
4635        return JSON.stringify(mergedClaims);
4636    };
4637    /**
4638     * adds `username` for Password Grant flow
4639     * @param username
4640     */
4641    RequestParameterBuilder.prototype.addUsername = function (username) {
4642        this.parameters.set(PasswordGrantConstants.username, encodeURIComponent(username));
4643    };
4644    /**
4645     * adds `password` for Password Grant flow
4646     * @param password
4647     */
4648    RequestParameterBuilder.prototype.addPassword = function (password) {
4649        this.parameters.set(PasswordGrantConstants.password, encodeURIComponent(password));
4650    };
4651    /**
4652     * add pop_jwk to query params
4653     * @param cnfString
4654     */
4655    RequestParameterBuilder.prototype.addPopToken = function (cnfString) {
4656        if (!StringUtils.isEmpty(cnfString)) {
4657            this.parameters.set(AADServerParamKeys.TOKEN_TYPE, exports.AuthenticationScheme.POP);
4658            this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));
4659        }
4660    };
4661    /**
4662     * add SSH JWK and key ID to query params
4663     */
4664    RequestParameterBuilder.prototype.addSshJwk = function (sshJwkString) {
4665        if (!StringUtils.isEmpty(sshJwkString)) {
4666            this.parameters.set(AADServerParamKeys.TOKEN_TYPE, exports.AuthenticationScheme.SSH);
4667            this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));
4668        }
4669    };
4670    /**
4671     * add server telemetry fields
4672     * @param serverTelemetryManager
4673     */
4674    RequestParameterBuilder.prototype.addServerTelemetry = function (serverTelemetryManager) {
4675        this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());
4676        this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());
4677    };
4678    /**
4679     * Adds parameter that indicates to the server that throttling is supported
4680     */
4681    RequestParameterBuilder.prototype.addThrottling = function () {
4682        this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);
4683    };
4684    /**
4685     * Adds logout_hint parameter for "silent" logout which prevent server account picker
4686     */
4687    RequestParameterBuilder.prototype.addLogoutHint = function (logoutHint) {
4688        this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));
4689    };
4690    /**
4691     * Utility to create a URL from the params map
4692     */
4693    RequestParameterBuilder.prototype.createQueryString = function () {
4694        var queryParameterArray = new Array();
4695        this.parameters.forEach(function (value, key) {
4696            queryParameterArray.push(key + "=" + value);
4697        });
4698        return queryParameterArray.join("&");
4699    };
4700    return RequestParameterBuilder;
4701}());
4702
4703/*! @azure/msal-common v13.3.3 2024-06-06 */
4704
4705/*
4706 * Copyright (c) Microsoft Corporation. All rights reserved.
4707 * Licensed under the MIT License.
4708 */
4709/**
4710 * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
4711 */
4712var BaseClient = /** @class */ (function () {
4713    function BaseClient(configuration, performanceClient) {
4714        // Set the configuration
4715        this.config = buildClientConfiguration(configuration);
4716        // Initialize the logger
4717        this.logger = new Logger(this.config.loggerOptions, name$1, version$1);
4718        // Initialize crypto
4719        this.cryptoUtils = this.config.cryptoInterface;
4720        // Initialize storage interface
4721        this.cacheManager = this.config.storageInterface;
4722        // Set the network interface
4723        this.networkClient = this.config.networkInterface;
4724        // Set the NetworkManager
4725        this.networkManager = new NetworkManager(this.networkClient, this.cacheManager);
4726        // Set TelemetryManager
4727        this.serverTelemetryManager = this.config.serverTelemetryManager;
4728        // set Authority
4729        this.authority = this.config.authOptions.authority;
4730        // set performance telemetry client
4731        this.performanceClient = performanceClient;
4732    }
4733    /**
4734     * Creates default headers for requests to token endpoint
4735     */
4736    BaseClient.prototype.createTokenRequestHeaders = function (ccsCred) {
4737        var headers = {};
4738        headers[HeaderNames.CONTENT_TYPE] = Constants.URL_FORM_CONTENT_TYPE;
4739        if (!this.config.systemOptions.preventCorsPreflight && ccsCred) {
4740            switch (ccsCred.type) {
4741                case CcsCredentialType.HOME_ACCOUNT_ID:
4742                    try {
4743                        var clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);
4744                        headers[HeaderNames.CCS_HEADER] = "Oid:" + clientInfo.uid + "@" + clientInfo.utid;
4745                    }
4746                    catch (e) {
4747                        this.logger.verbose("Could not parse home account ID for CCS Header: " + e);
4748                    }
4749                    break;
4750                case CcsCredentialType.UPN:
4751                    headers[HeaderNames.CCS_HEADER] = "UPN: " + ccsCred.credential;
4752                    break;
4753            }
4754        }
4755        return headers;
4756    };
4757    /**
4758     * Http post to token endpoint
4759     * @param tokenEndpoint
4760     * @param queryString
4761     * @param headers
4762     * @param thumbprint
4763     */
4764    BaseClient.prototype.executePostToTokenEndpoint = function (tokenEndpoint, queryString, headers, thumbprint) {
4765        return __awaiter(this, void 0, void 0, function () {
4766            var response;
4767            return __generator(this, function (_a) {
4768                switch (_a.label) {
4769                    case 0: return [4 /*yield*/, this.networkManager.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers })];
4770                    case 1:
4771                        response = _a.sent();
4772                        if (this.config.serverTelemetryManager && response.status < 500 && response.status !== 429) {
4773                            // Telemetry data successfully logged by server, clear Telemetry cache
4774                            this.config.serverTelemetryManager.clearTelemetryCache();
4775                        }
4776                        return [2 /*return*/, response];
4777                }
4778            });
4779        });
4780    };
4781    /**
4782     * Updates the authority object of the client. Endpoint discovery must be completed.
4783     * @param updatedAuthority
4784     */
4785    BaseClient.prototype.updateAuthority = function (updatedAuthority) {
4786        if (!updatedAuthority.discoveryComplete()) {
4787            throw ClientAuthError.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");
4788        }
4789        this.authority = updatedAuthority;
4790    };
4791    /**
4792     * Creates query string for the /token request
4793     * @param request
4794     */
4795    BaseClient.prototype.createTokenQueryParameters = function (request) {
4796        var parameterBuilder = new RequestParameterBuilder();
4797        if (request.tokenQueryParameters) {
4798            parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);
4799        }
4800        return parameterBuilder.createQueryString();
4801    };
4802    return BaseClient;
4803}());
4804
4805/*! @azure/msal-common v13.3.3 2024-06-06 */
4806
4807/*
4808 * Copyright (c) Microsoft Corporation. All rights reserved.
4809 * Licensed under the MIT License.
4810 */
4811/**
4812 * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc
4813 *
4814 * Key:Value Schema:
4815 *
4816 * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>
4817 *
4818 * Value Schema:
4819 * {
4820 *      homeAccountId: home account identifier for the auth scheme,
4821 *      environment: entity that issued the token, represented as a full host
4822 *      credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
4823 *      clientId: client ID of the application
4824 *      secret: Actual credential as a string
4825 *      familyId: Family ID identifier, usually only used for refresh tokens
4826 *      realm: Full tenant or organizational identifier that the account belongs to
4827 *      target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
4828 *      tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
4829 *      requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request
4830 *      userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow
4831 * }
4832 */
4833var CredentialEntity = /** @class */ (function () {
4834    function CredentialEntity() {
4835    }
4836    /**
4837     * Generate Account Id key component as per the schema: <home_account_id>-<environment>
4838     */
4839    CredentialEntity.prototype.generateAccountId = function () {
4840        return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);
4841    };
4842    /**
4843     * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>
4844     */
4845    CredentialEntity.prototype.generateCredentialId = function () {
4846        return CredentialEntity.generateCredentialIdForCacheKey(this.credentialType, this.clientId, this.realm, this.familyId);
4847    };
4848    /**
4849     * Generate target key component as per schema: <target>
4850     */
4851    CredentialEntity.prototype.generateTarget = function () {
4852        return CredentialEntity.generateTargetForCacheKey(this.target);
4853    };
4854    /**
4855     * generates credential key
4856     */
4857    CredentialEntity.prototype.generateCredentialKey = function () {
4858        return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType, this.requestedClaimsHash);
4859    };
4860    /**
4861     * returns the type of the cache (in this case credential)
4862     */
4863    CredentialEntity.prototype.generateType = function () {
4864        switch (this.credentialType) {
4865            case CredentialType.ID_TOKEN:
4866                return CacheType.ID_TOKEN;
4867            case CredentialType.ACCESS_TOKEN:
4868            case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
4869                return CacheType.ACCESS_TOKEN;
4870            case CredentialType.REFRESH_TOKEN:
4871                return CacheType.REFRESH_TOKEN;
4872            default: {
4873                throw ClientAuthError.createUnexpectedCredentialTypeError();
4874            }
4875        }
4876    };
4877    /**
4878     * generates credential key
4879     * <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
4880     */
4881    CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType, requestedClaimsHash) {
4882        var credentialKey = [
4883            this.generateAccountIdForCacheKey(homeAccountId, environment),
4884            this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),
4885            this.generateTargetForCacheKey(target),
4886            this.generateClaimsHashForCacheKey(requestedClaimsHash),
4887            this.generateSchemeForCacheKey(tokenType)
4888        ];
4889        return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
4890    };
4891    /**
4892     * generates Account Id for keys
4893     * @param homeAccountId
4894     * @param environment
4895     */
4896    CredentialEntity.generateAccountIdForCacheKey = function (homeAccountId, environment) {
4897        var accountId = [homeAccountId, environment];
4898        return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
4899    };
4900    /**
4901     * Generates Credential Id for keys
4902     * @param credentialType
4903     * @param realm
4904     * @param clientId
4905     * @param familyId
4906     */
4907    CredentialEntity.generateCredentialIdForCacheKey = function (credentialType, clientId, realm, familyId) {
4908        var clientOrFamilyId = credentialType === CredentialType.REFRESH_TOKEN
4909            ? familyId || clientId
4910            : clientId;
4911        var credentialId = [
4912            credentialType,
4913            clientOrFamilyId,
4914            realm || Constants.EMPTY_STRING,
4915        ];
4916        return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
4917    };
4918    /**
4919     * Generate target key component as per schema: <target>
4920     */
4921    CredentialEntity.generateTargetForCacheKey = function (scopes) {
4922        return (scopes || Constants.EMPTY_STRING).toLowerCase();
4923    };
4924    /**
4925     * Generate requested claims key component as per schema: <requestedClaims>
4926     */
4927    CredentialEntity.generateClaimsHashForCacheKey = function (requestedClaimsHash) {
4928        return (requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();
4929    };
4930    /**
4931     * Generate scheme key componenet as per schema: <scheme>
4932     */
4933    CredentialEntity.generateSchemeForCacheKey = function (tokenType) {
4934        /*
4935         * PoP Tokens and SSH certs include scheme in cache key
4936         * Cast to lowercase to handle "bearer" from ADFS
4937         */
4938        return (tokenType && tokenType.toLowerCase() !== exports.AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;
4939    };
4940    return CredentialEntity;
4941}());
4942
4943/*! @azure/msal-common v13.3.3 2024-06-06 */
4944
4945/*
4946 * Copyright (c) Microsoft Corporation. All rights reserved.
4947 * Licensed under the MIT License.
4948 */
4949/**
4950 * ID_TOKEN Cache
4951 *
4952 * Key:Value Schema:
4953 *
4954 * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-
4955 *
4956 * Value Schema:
4957 * {
4958 *      homeAccountId: home account identifier for the auth scheme,
4959 *      environment: entity that issued the token, represented as a full host
4960 *      credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
4961 *      clientId: client ID of the application
4962 *      secret: Actual credential as a string
4963 *      realm: Full tenant or organizational identifier that the account belongs to
4964 * }
4965 */
4966var IdTokenEntity = /** @class */ (function (_super) {
4967    __extends(IdTokenEntity, _super);
4968    function IdTokenEntity() {
4969        return _super !== null && _super.apply(this, arguments) || this;
4970    }
4971    /**
4972     * Create IdTokenEntity
4973     * @param homeAccountId
4974     * @param authenticationResult
4975     * @param clientId
4976     * @param authority
4977     */
4978    IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId) {
4979        var idTokenEntity = new IdTokenEntity();
4980        idTokenEntity.credentialType = CredentialType.ID_TOKEN;
4981        idTokenEntity.homeAccountId = homeAccountId;
4982        idTokenEntity.environment = environment;
4983        idTokenEntity.clientId = clientId;
4984        idTokenEntity.secret = idToken;
4985        idTokenEntity.realm = tenantId;
4986        return idTokenEntity;
4987    };
4988    /**
4989     * Validates an entity: checks for all expected params
4990     * @param entity
4991     */
4992    IdTokenEntity.isIdTokenEntity = function (entity) {
4993        if (!entity) {
4994            return false;
4995        }
4996        return (entity.hasOwnProperty("homeAccountId") &&
4997            entity.hasOwnProperty("environment") &&
4998            entity.hasOwnProperty("credentialType") &&
4999            entity.hasOwnProperty("realm") &&
5000            entity.hasOwnProperty("clientId") &&
5001            entity.hasOwnProperty("secret") &&
5002            entity["credentialType"] === CredentialType.ID_TOKEN);
5003    };
5004    return IdTokenEntity;
5005}(CredentialEntity));
5006
5007/*! @azure/msal-common v13.3.3 2024-06-06 */
5008/*
5009 * Copyright (c) Microsoft Corporation. All rights reserved.
5010 * Licensed under the MIT License.
5011 */
5012/**
5013 * Utility class which exposes functions for managing date and time operations.
5014 */
5015var TimeUtils = /** @class */ (function () {
5016    function TimeUtils() {
5017    }
5018    /**
5019     * return the current time in Unix time (seconds).
5020     */
5021    TimeUtils.nowSeconds = function () {
5022        // Date.getTime() returns in milliseconds.
5023        return Math.round(new Date().getTime() / 1000.0);
5024    };
5025    /**
5026     * check if a token is expired based on given UTC time in seconds.
5027     * @param expiresOn
5028     */
5029    TimeUtils.isTokenExpired = function (expiresOn, offset) {
5030        // check for access token expiry
5031        var expirationSec = Number(expiresOn) || 0;
5032        var offsetCurrentTimeSec = TimeUtils.nowSeconds() + offset;
5033        // If current time + offset is greater than token expiration time, then token is expired.
5034        return (offsetCurrentTimeSec > expirationSec);
5035    };
5036    /**
5037     * If the current time is earlier than the time that a token was cached at, we must discard the token
5038     * i.e. The system clock was turned back after acquiring the cached token
5039     * @param cachedAt
5040     * @param offset
5041     */
5042    TimeUtils.wasClockTurnedBack = function (cachedAt) {
5043        var cachedAtSec = Number(cachedAt);
5044        return cachedAtSec > TimeUtils.nowSeconds();
5045    };
5046    /**
5047     * Waits for t number of milliseconds
5048     * @param t number
5049     * @param value T
5050     */
5051    TimeUtils.delay = function (t, value) {
5052        return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); });
5053    };
5054    return TimeUtils;
5055}());
5056
5057/*! @azure/msal-common v13.3.3 2024-06-06 */
5058
5059/*
5060 * Copyright (c) Microsoft Corporation. All rights reserved.
5061 * Licensed under the MIT License.
5062 */
5063/**
5064 * ACCESS_TOKEN Credential Type
5065 *
5066 * Key:Value Schema:
5067 *
5068 * Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read
5069 *
5070 * Value Schema:
5071 * {
5072 *      homeAccountId: home account identifier for the auth scheme,
5073 *      environment: entity that issued the token, represented as a full host
5074 *      credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
5075 *      clientId: client ID of the application
5076 *      secret: Actual credential as a string
5077 *      familyId: Family ID identifier, usually only used for refresh tokens
5078 *      realm: Full tenant or organizational identifier that the account belongs to
5079 *      target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
5080 *      cachedAt: Absolute device time when entry was created in the cache.
5081 *      expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.
5082 *      extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.
5083 *      keyId: used for POP and SSH tokenTypes
5084 *      tokenType: Type of the token issued. Usually "Bearer"
5085 * }
5086 */
5087var AccessTokenEntity = /** @class */ (function (_super) {
5088    __extends(AccessTokenEntity, _super);
5089    function AccessTokenEntity() {
5090        return _super !== null && _super.apply(this, arguments) || this;
5091    }
5092    /**
5093     * Create AccessTokenEntity
5094     * @param homeAccountId
5095     * @param environment
5096     * @param accessToken
5097     * @param clientId
5098     * @param tenantId
5099     * @param scopes
5100     * @param expiresOn
5101     * @param extExpiresOn
5102     */
5103    AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {
5104        var _a, _b;
5105        var atEntity = new AccessTokenEntity();
5106        atEntity.homeAccountId = homeAccountId;
5107        atEntity.credentialType = CredentialType.ACCESS_TOKEN;
5108        atEntity.secret = accessToken;
5109        var currentTime = TimeUtils.nowSeconds();
5110        atEntity.cachedAt = currentTime.toString();
5111        /*
5112         * Token expiry time.
5113         * This value should be  calculated based on the current UTC time measured locally and the value  expires_in Represented as a string in JSON.
5114         */
5115        atEntity.expiresOn = expiresOn.toString();
5116        atEntity.extendedExpiresOn = extExpiresOn.toString();
5117        if (refreshOn) {
5118            atEntity.refreshOn = refreshOn.toString();
5119        }
5120        atEntity.environment = environment;
5121        atEntity.clientId = clientId;
5122        atEntity.realm = tenantId;
5123        atEntity.target = scopes;
5124        atEntity.userAssertionHash = userAssertionHash;
5125        atEntity.tokenType = StringUtils.isEmpty(tokenType) ? exports.AuthenticationScheme.BEARER : tokenType;
5126        if (requestedClaims) {
5127            atEntity.requestedClaims = requestedClaims;
5128            atEntity.requestedClaimsHash = requestedClaimsHash;
5129        }
5130        /*
5131         * Create Access Token With Auth Scheme instead of regular access token
5132         * Cast to lower to handle "bearer" from ADFS
5133         */
5134        if (((_a = atEntity.tokenType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== exports.AuthenticationScheme.BEARER.toLowerCase()) {
5135            atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
5136            switch (atEntity.tokenType) {
5137                case exports.AuthenticationScheme.POP:
5138                    // Make sure keyId is present and add it to credential
5139                    var tokenClaims = AuthToken.extractTokenClaims(accessToken, cryptoUtils);
5140                    if (!((_b = tokenClaims === null || tokenClaims === void 0 ? void 0 : tokenClaims.cnf) === null || _b === void 0 ? void 0 : _b.kid)) {
5141                        throw ClientAuthError.createTokenClaimsRequiredError();
5142                    }
5143                    atEntity.keyId = tokenClaims.cnf.kid;
5144                    break;
5145                case exports.AuthenticationScheme.SSH:
5146                    atEntity.keyId = keyId;
5147            }
5148        }
5149        return atEntity;
5150    };
5151    /**
5152     * Validates an entity: checks for all expected params
5153     * @param entity
5154     */
5155    AccessTokenEntity.isAccessTokenEntity = function (entity) {
5156        if (!entity) {
5157            return false;
5158        }
5159        return (entity.hasOwnProperty("homeAccountId") &&
5160            entity.hasOwnProperty("environment") &&
5161            entity.hasOwnProperty("credentialType") &&
5162            entity.hasOwnProperty("realm") &&
5163            entity.hasOwnProperty("clientId") &&
5164            entity.hasOwnProperty("secret") &&
5165            entity.hasOwnProperty("target") &&
5166            (entity["credentialType"] === CredentialType.ACCESS_TOKEN || entity["credentialType"] === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
5167    };
5168    return AccessTokenEntity;
5169}(CredentialEntity));
5170
5171/*! @azure/msal-common v13.3.3 2024-06-06 */
5172
5173/*
5174 * Copyright (c) Microsoft Corporation. All rights reserved.
5175 * Licensed under the MIT License.
5176 */
5177/**
5178 * REFRESH_TOKEN Cache
5179 *
5180 * Key:Value Schema:
5181 *
5182 * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--
5183 *
5184 * Value:
5185 * {
5186 *      homeAccountId: home account identifier for the auth scheme,
5187 *      environment: entity that issued the token, represented as a full host
5188 *      credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
5189 *      clientId: client ID of the application
5190 *      secret: Actual credential as a string
5191 *      familyId: Family ID identifier, '1' represents Microsoft Family
5192 *      realm: Full tenant or organizational identifier that the account belongs to
5193 *      target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
5194 * }
5195 */
5196var RefreshTokenEntity = /** @class */ (function (_super) {
5197    __extends(RefreshTokenEntity, _super);
5198    function RefreshTokenEntity() {
5199        return _super !== null && _super.apply(this, arguments) || this;
5200    }
5201    /**
5202     * Create RefreshTokenEntity
5203     * @param homeAccountId
5204     * @param authenticationResult
5205     * @param clientId
5206     * @param authority
5207     */
5208    RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash) {
5209        var rtEntity = new RefreshTokenEntity();
vendor: 11,912 bytes, lines 5210-5503
5210        rtEntity.clientId = clientId;
5211        rtEntity.credentialType = CredentialType.REFRESH_TOKEN;
5212        rtEntity.environment = environment;
5213        rtEntity.homeAccountId = homeAccountId;
5214        rtEntity.secret = refreshToken;
5215        rtEntity.userAssertionHash = userAssertionHash;
5216        if (familyId)
5217            rtEntity.familyId = familyId;
5218        return rtEntity;
5219    };
5220    /**
5221     * Validates an entity: checks for all expected params
5222     * @param entity
5223     */
5224    RefreshTokenEntity.isRefreshTokenEntity = function (entity) {
5225        if (!entity) {
5226            return false;
5227        }
5228        return (entity.hasOwnProperty("homeAccountId") &&
5229            entity.hasOwnProperty("environment") &&
5230            entity.hasOwnProperty("credentialType") &&
5231            entity.hasOwnProperty("clientId") &&
5232            entity.hasOwnProperty("secret") &&
5233            entity["credentialType"] === CredentialType.REFRESH_TOKEN);
5234    };
5235    return RefreshTokenEntity;
5236}(CredentialEntity));
5237
5238/*! @azure/msal-common v13.3.3 2024-06-06 */
5239
5240/*
5241 * Copyright (c) Microsoft Corporation. All rights reserved.
5242 * Licensed under the MIT License.
5243 */
5244/**
5245 * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required
5246 */
5247var InteractionRequiredServerErrorMessage = [
5248    "interaction_required",
5249    "consent_required",
5250    "login_required"
5251];
5252var InteractionRequiredAuthSubErrorMessage = [
5253    "message_only",
5254    "additional_action",
5255    "basic_action",
5256    "user_password_expired",
5257    "consent_required"
5258];
5259/**
5260 * Interaction required errors defined by the SDK
5261 */
5262var InteractionRequiredAuthErrorMessage = {
5263    noTokensFoundError: {
5264        code: "no_tokens_found",
5265        desc: "No refresh token found in the cache. Please sign-in."
5266    },
5267    native_account_unavailable: {
5268        code: "native_account_unavailable",
5269        desc: "The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."
5270    }
5271};
5272/**
5273 * Error thrown when user interaction is required.
5274 */
5275var InteractionRequiredAuthError = /** @class */ (function (_super) {
5276    __extends(InteractionRequiredAuthError, _super);
5277    function InteractionRequiredAuthError(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims) {
5278        var _this = _super.call(this, errorCode, errorMessage, subError) || this;
5279        Object.setPrototypeOf(_this, InteractionRequiredAuthError.prototype);
5280        _this.timestamp = timestamp || Constants.EMPTY_STRING;
5281        _this.traceId = traceId || Constants.EMPTY_STRING;
5282        _this.correlationId = correlationId || Constants.EMPTY_STRING;
5283        _this.claims = claims || Constants.EMPTY_STRING;
5284        _this.name = "InteractionRequiredAuthError";
5285        return _this;
5286    }
5287    /**
5288     * Helper function used to determine if an error thrown by the server requires interaction to resolve
5289     * @param errorCode
5290     * @param errorString
5291     * @param subError
5292     */
5293    InteractionRequiredAuthError.isInteractionRequiredError = function (errorCode, errorString, subError) {
5294        var isInteractionRequiredErrorCode = !!errorCode && InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;
5295        var isInteractionRequiredSubError = !!subError && InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;
5296        var isInteractionRequiredErrorDesc = !!errorString && InteractionRequiredServerErrorMessage.some(function (irErrorCode) {
5297            return errorString.indexOf(irErrorCode) > -1;
5298        });
5299        return isInteractionRequiredErrorCode || isInteractionRequiredErrorDesc || isInteractionRequiredSubError;
5300    };
5301    /**
5302     * Creates an error thrown when the authorization code required for a token request is null or empty.
5303     */
5304    InteractionRequiredAuthError.createNoTokensFoundError = function () {
5305        return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);
5306    };
5307    /**
5308     * Creates an error thrown when the native broker returns ACCOUNT_UNAVAILABLE status, indicating that the account was removed and interactive sign-in is required
5309     * @returns
5310     */
5311    InteractionRequiredAuthError.createNativeAccountUnavailableError = function () {
5312        return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.native_account_unavailable.code, InteractionRequiredAuthErrorMessage.native_account_unavailable.desc);
5313    };
5314    return InteractionRequiredAuthError;
5315}(AuthError));
5316
5317/*! @azure/msal-common v13.3.3 2024-06-06 */
5318/*
5319 * Copyright (c) Microsoft Corporation. All rights reserved.
5320 * Licensed under the MIT License.
5321 */
5322var CacheRecord = /** @class */ (function () {
5323    function CacheRecord(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {
5324        this.account = accountEntity || null;
5325        this.idToken = idTokenEntity || null;
5326        this.accessToken = accessTokenEntity || null;
5327        this.refreshToken = refreshTokenEntity || null;
5328        this.appMetadata = appMetadataEntity || null;
5329    }
5330    return CacheRecord;
5331}());
5332
5333/*! @azure/msal-common v13.3.3 2024-06-06 */
5334
5335/*
5336 * Copyright (c) Microsoft Corporation. All rights reserved.
5337 * Licensed under the MIT License.
5338 */
5339/**
5340 * Class which provides helpers for OAuth 2.0 protocol specific values
5341 */
5342var ProtocolUtils = /** @class */ (function () {
5343    function ProtocolUtils() {
5344    }
5345    /**
5346     * Appends user state with random guid, or returns random guid.
5347     * @param userState
5348     * @param randomGuid
5349     */
5350    ProtocolUtils.setRequestState = function (cryptoObj, userState, meta) {
5351        var libraryState = ProtocolUtils.generateLibraryState(cryptoObj, meta);
5352        return !StringUtils.isEmpty(userState) ? "" + libraryState + Constants.RESOURCE_DELIM + userState : libraryState;
5353    };
5354    /**
5355     * Generates the state value used by the common library.
5356     * @param randomGuid
5357     * @param cryptoObj
5358     */
5359    ProtocolUtils.generateLibraryState = function (cryptoObj, meta) {
5360        if (!cryptoObj) {
5361            throw ClientAuthError.createNoCryptoObjectError("generateLibraryState");
5362        }
5363        // Create a state object containing a unique id and the timestamp of the request creation
5364        var stateObj = {
5365            id: cryptoObj.createNewGuid()
5366        };
5367        if (meta) {
5368            stateObj.meta = meta;
5369        }
5370        var stateString = JSON.stringify(stateObj);
5371        return cryptoObj.base64Encode(stateString);
5372    };
5373    /**
5374     * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
5375     * @param state
5376     * @param cryptoObj
5377     */
5378    ProtocolUtils.parseRequestState = function (cryptoObj, state) {
5379        if (!cryptoObj) {
5380            throw ClientAuthError.createNoCryptoObjectError("parseRequestState");
5381        }
5382        if (StringUtils.isEmpty(state)) {
5383            throw ClientAuthError.createInvalidStateError(state, "Null, undefined or empty state");
5384        }
5385        try {
5386            // Split the state between library state and user passed state and decode them separately
5387            var splitState = state.split(Constants.RESOURCE_DELIM);
5388            var libraryState = splitState[0];
5389            var userState = splitState.length > 1 ? splitState.slice(1).join(Constants.RESOURCE_DELIM) : Constants.EMPTY_STRING;
5390            var libraryStateString = cryptoObj.base64Decode(libraryState);
5391            var libraryStateObj = JSON.parse(libraryStateString);
5392            return {
5393                userRequestState: !StringUtils.isEmpty(userState) ? userState : Constants.EMPTY_STRING,
5394                libraryState: libraryStateObj
5395            };
5396        }
5397        catch (e) {
5398            throw ClientAuthError.createInvalidStateError(state, e);
5399        }
5400    };
5401    return ProtocolUtils;
5402}());
5403
5404/*! @azure/msal-common v13.3.3 2024-06-06 */
5405
5406/*
5407 * Copyright (c) Microsoft Corporation. All rights reserved.
5408 * Licensed under the MIT License.
5409 */
5410/**
5411 * Url object class which can perform various transformations on url strings.
5412 */
5413var UrlString = /** @class */ (function () {
5414    function UrlString(url) {
5415        this._urlString = url;
5416        if (StringUtils.isEmpty(this._urlString)) {
5417            // Throws error if url is empty
5418            throw ClientConfigurationError.createUrlEmptyError();
5419        }
5420        if (StringUtils.isEmpty(this.getHash())) {
5421            this._urlString = UrlString.canonicalizeUri(url);
5422        }
5423    }
5424    Object.defineProperty(UrlString.prototype, "urlString", {
5425        get: function () {
5426            return this._urlString;
5427        },
5428        enumerable: false,
5429        configurable: true
5430    });
5431    /**
5432     * Ensure urls are lower case and end with a / character.
5433     * @param url
5434     */
5435    UrlString.canonicalizeUri = function (url) {
5436        if (url) {
5437            var lowerCaseUrl = url.toLowerCase();
5438            if (StringUtils.endsWith(lowerCaseUrl, "?")) {
5439                lowerCaseUrl = lowerCaseUrl.slice(0, -1);
5440            }
5441            else if (StringUtils.endsWith(lowerCaseUrl, "?/")) {
5442                lowerCaseUrl = lowerCaseUrl.slice(0, -2);
5443            }
5444            if (!StringUtils.endsWith(lowerCaseUrl, "/")) {
5445                lowerCaseUrl += "/";
5446            }
5447            return lowerCaseUrl;
5448        }
5449        return url;
5450    };
5451    /**
5452     * Throws if urlString passed is not a valid authority URI string.
5453     */
5454    UrlString.prototype.validateAsUri = function () {
5455        // Attempts to parse url for uri components
5456        var components;
5457        try {
5458            components = this.getUrlComponents();
5459        }
5460        catch (e) {
5461            throw ClientConfigurationError.createUrlParseError(e);
5462        }
5463        // Throw error if URI or path segments are not parseable.
5464        if (!components.HostNameAndPort || !components.PathSegments) {
5465            throw ClientConfigurationError.createUrlParseError("Given url string: " + this.urlString);
5466        }
5467        // Throw error if uri is insecure.
5468        if (!components.Protocol || components.Protocol.toLowerCase() !== "https:") {
5469            throw ClientConfigurationError.createInsecureAuthorityUriError(this.urlString);
5470        }
5471    };
5472    /**
5473     * Given a url and a query string return the url with provided query string appended
5474     * @param url
5475     * @param queryString
5476     */
5477    UrlString.appendQueryString = function (url, queryString) {
5478        if (StringUtils.isEmpty(queryString)) {
5479            return url;
5480        }
5481        return url.indexOf("?") < 0 ? url + "?" + queryString : url + "&" + queryString;
5482    };
5483    /**
5484     * Returns a url with the hash removed
5485     * @param url
5486     */
5487    UrlString.removeHashFromUrl = function (url) {
5488        return UrlString.canonicalizeUri(url.split("#")[0]);
5489    };
5490    /**
5491     * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d
5492     * @param href The url
5493     * @param tenantId The tenant id to replace
5494     */
5495    UrlString.prototype.replaceTenantPath = function (tenantId) {
5496        var urlObject = this.getUrlComponents();
5497        var pathArray = urlObject.PathSegments;
5498        if (tenantId && (pathArray.length !== 0 && (pathArray[0] === AADAuthorityConstants.COMMON || pathArray[0] === AADAuthorityConstants.ORGANIZATIONS))) {
5499            pathArray[0] = tenantId;
5500        }
5501        return UrlString.constructAuthorityUriFromObject(urlObject);
5502    };
5503    /**
vendor: 5,357 bytes, lines 5504-5623
5504     * Returns the anchor part(#) of the URL
5505     */
5506    UrlString.prototype.getHash = function () {
5507        return UrlString.parseHash(this.urlString);
5508    };
5509    /**
5510     * Parses out the components from a url string.
5511     * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.
5512     */
5513    UrlString.prototype.getUrlComponents = function () {
5514        // https://gist.github.com/curtisz/11139b2cfcaef4a261e0
5515        var regEx = RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
5516        // If url string does not match regEx, we throw an error
5517        var match = this.urlString.match(regEx);
5518        if (!match) {
5519            throw ClientConfigurationError.createUrlParseError("Given url string: " + this.urlString);
5520        }
5521        // Url component object
5522        var urlComponents = {
5523            Protocol: match[1],
5524            HostNameAndPort: match[4],
5525            AbsolutePath: match[5],
5526            QueryString: match[7]
5527        };
5528        var pathSegments = urlComponents.AbsolutePath.split("/");
5529        pathSegments = pathSegments.filter(function (val) { return val && val.length > 0; }); // remove empty elements
5530        urlComponents.PathSegments = pathSegments;
5531        if (!StringUtils.isEmpty(urlComponents.QueryString) && urlComponents.QueryString.endsWith("/")) {
5532            urlComponents.QueryString = urlComponents.QueryString.substring(0, urlComponents.QueryString.length - 1);
5533        }
5534        return urlComponents;
5535    };
5536    UrlString.getDomainFromUrl = function (url) {
5537        var regEx = RegExp("^([^:/?#]+://)?([^/?#]*)");
5538        var match = url.match(regEx);
5539        if (!match) {
5540            throw ClientConfigurationError.createUrlParseError("Given url string: " + url);
5541        }
5542        return match[2];
5543    };
5544    UrlString.getAbsoluteUrl = function (relativeUrl, baseUrl) {
5545        if (relativeUrl[0] === Constants.FORWARD_SLASH) {
5546            var url = new UrlString(baseUrl);
5547            var baseComponents = url.getUrlComponents();
5548            return baseComponents.Protocol + "//" + baseComponents.HostNameAndPort + relativeUrl;
5549        }
5550        return relativeUrl;
5551    };
5552    /**
5553     * Parses hash string from given string. Returns empty string if no hash symbol is found.
5554     * @param hashString
5555     */
5556    UrlString.parseHash = function (hashString) {
5557        var hashIndex1 = hashString.indexOf("#");
5558        var hashIndex2 = hashString.indexOf("#/");
5559        if (hashIndex2 > -1) {
5560            return hashString.substring(hashIndex2 + 2);
5561        }
5562        else if (hashIndex1 > -1) {
5563            return hashString.substring(hashIndex1 + 1);
5564        }
5565        return Constants.EMPTY_STRING;
5566    };
5567    /**
5568     * Parses query string from given string. Returns empty string if no query symbol is found.
5569     * @param queryString
5570     */
5571    UrlString.parseQueryString = function (queryString) {
5572        var queryIndex1 = queryString.indexOf("?");
5573        var queryIndex2 = queryString.indexOf("/?");
5574        if (queryIndex2 > -1) {
5575            return queryString.substring(queryIndex2 + 2);
5576        }
5577        else if (queryIndex1 > -1) {
5578            return queryString.substring(queryIndex1 + 1);
5579        }
5580        return Constants.EMPTY_STRING;
5581    };
5582    UrlString.constructAuthorityUriFromObject = function (urlObject) {
5583        return new UrlString(urlObject.Protocol + "//" + urlObject.HostNameAndPort + "/" + urlObject.PathSegments.join("/"));
5584    };
5585    /**
5586     * Returns URL hash as server auth code response object.
5587     */
5588    UrlString.getDeserializedHash = function (hash) {
5589        // Check if given hash is empty
5590        if (StringUtils.isEmpty(hash)) {
5591            return {};
5592        }
5593        // Strip the # symbol if present
5594        var parsedHash = UrlString.parseHash(hash);
5595        // If # symbol was not present, above will return empty string, so give original hash value
5596        var deserializedHash = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedHash) ? hash : parsedHash);
5597        // Check if deserialization didn't work
5598        if (!deserializedHash) {
5599            throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedHash));
5600        }
5601        return deserializedHash;
5602    };
5603    /**
5604     * Returns URL query string as server auth code response object.
5605     */
5606    UrlString.getDeserializedQueryString = function (query) {
5607        // Check if given query is empty
5608        if (StringUtils.isEmpty(query)) {
5609            return {};
5610        }
5611        // Strip the ? symbol if present
5612        var parsedQueryString = UrlString.parseQueryString(query);
5613        // If ? symbol was not present, above will return empty string, so give original query value
5614        var deserializedQueryString = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedQueryString) ? query : parsedQueryString);
5615        // Check if deserialization didn't work
5616        if (!deserializedQueryString) {
5617            throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedQueryString));
5618        }
5619        return deserializedQueryString;
5620    };
5621    /**
5622     * Check if the hash of the URL string contains known properties
5623     */
5624    UrlString.hashContainsKnownProperties = function (hash) {
5625        if (StringUtils.isEmpty(hash) || hash.indexOf("=") < 0) {
5626            // Hash doesn't contain key/value pairs
5627            return false;
5628        }
5629        var parameters = UrlString.getDeserializedHash(hash);
5630        return !!(parameters.code ||
5631            parameters.error_description ||
5632            parameters.error ||
5633            parameters.state);
5634    };
5635    return UrlString;
5636}());
5637
5638/*! @azure/msal-common v13.3.3 2024-06-06 */
5639/*
5640 * Copyright (c) Microsoft Corporation. All rights reserved.
5641 * Licensed under the MIT License.
5642 */
5643/**
5644 * Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.
5645 *
5646 * @export
5647 * @enum {number}
5648 */
5649exports.PerformanceEvents = void 0;
5650(function (PerformanceEvents) {
5651    /**
5652     * acquireTokenByCode API (msal-browser and msal-node).
5653     * Used to acquire tokens by trading an authorization code against the token endpoint.
5654     */
5655    PerformanceEvents["AcquireTokenByCode"] = "acquireTokenByCode";
5656    /**
5657     * acquireTokenByRefreshToken API (msal-browser and msal-node).
5658     * Used to renew an access token using a refresh token against the token endpoint.
5659     */
5660    PerformanceEvents["AcquireTokenByRefreshToken"] = "acquireTokenByRefreshToken";
5661    /**
5662     * acquireTokenSilent API (msal-browser and msal-node).
5663     * Used to silently acquire a new access token (from the cache or the network).
5664     */
5665    PerformanceEvents["AcquireTokenSilent"] = "acquireTokenSilent";
5666    /**
5667     * acquireTokenSilentAsync (msal-browser).
5668     * Internal API for acquireTokenSilent.
5669     */
5670    PerformanceEvents["AcquireTokenSilentAsync"] = "acquireTokenSilentAsync";
5671    /**
5672     * acquireTokenPopup (msal-browser).
5673     * Used to acquire a new access token interactively through pop ups
5674     */
5675    PerformanceEvents["AcquireTokenPopup"] = "acquireTokenPopup";
5676    /**
5677     * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
5678     * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
5679     */
5680    PerformanceEvents["CryptoOptsGetPublicKeyThumbprint"] = "cryptoOptsGetPublicKeyThumbprint";
5681    /**
5682     * signJwt API in CryptoOpts class (msal-browser).
5683     * Used to signed a pop token.
5684     */
5685    PerformanceEvents["CryptoOptsSignJwt"] = "cryptoOptsSignJwt";
5686    /**
5687     * acquireToken API in the SilentCacheClient class (msal-browser).
5688     * Used to read access tokens from the cache.
5689     */
5690    PerformanceEvents["SilentCacheClientAcquireToken"] = "silentCacheClientAcquireToken";
5691    /**
5692     * acquireToken API in the SilentIframeClient class (msal-browser).
5693     * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
5694     */
5695    PerformanceEvents["SilentIframeClientAcquireToken"] = "silentIframeClientAcquireToken";
5696    /**
5697     * acquireToken API in SilentRereshClient (msal-browser).
5698     * Used to acquire a new set of tokens from the token endpoint using a refresh token.
5699     */
5700    PerformanceEvents["SilentRefreshClientAcquireToken"] = "silentRefreshClientAcquireToken";
5701    /**
5702     * ssoSilent API (msal-browser).
5703     * Used to silently acquire an authorization code and set of tokens using a hidden iframe.
5704     */
5705    PerformanceEvents["SsoSilent"] = "ssoSilent";
5706    /**
5707     * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
5708     * Used to load authority metadata for a request.
5709     */
5710    PerformanceEvents["StandardInteractionClientGetDiscoveredAuthority"] = "standardInteractionClientGetDiscoveredAuthority";
5711    /**
5712     * acquireToken APIs in msal-browser.
5713     * Used to make an /authorize endpoint call with native brokering enabled.
5714     */
5715    PerformanceEvents["FetchAccountIdWithNativeBroker"] = "fetchAccountIdWithNativeBroker";
5716    /**
5717     * acquireToken API in NativeInteractionClient class (msal-browser).
5718     * Used to acquire a token from Native component when native brokering is enabled.
5719     */
5720    PerformanceEvents["NativeInteractionClientAcquireToken"] = "nativeInteractionClientAcquireToken";
5721    /**
5722     * Time spent creating default headers for requests to token endpoint
5723     */
5724    PerformanceEvents["BaseClientCreateTokenRequestHeaders"] = "baseClientCreateTokenRequestHeaders";
5725    /**
5726     * Used to measure the time taken for completing embedded-broker handshake 
5726(PW-Broker).
5727     */
5728    PerformanceEvents["BrokerHandhshake"] = "brokerHandshake";
5729    /**
5730     * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
5731     */
5732    PerformanceEvents["AcquireTokenByRefreshTokenInBroker"] = "acquireTokenByRefreshTokenInBroker";
5733    /**
5734     * Time taken for token acquisition by broker
5735     */
5736    PerformanceEvents["AcquireTokenByBroker"] = "acquireTokenByBroker";
5737    /**
5738     * Time spent on the network for refresh token acquisition
5739     */
5740    PerformanceEvents["RefreshTokenClientExecuteTokenRequest"] = "refreshTokenClientExecuteTokenRequest";
5741    /**
5742     * Time taken for acquiring refresh token , records RT size
5743     */
5744    PerformanceEvents["RefreshTokenClientAcquireToken"] = "refreshTokenClientAcquireToken";
5745    /**
5746     * Time taken for acquiring cached refresh token
5747     */
5748    PerformanceEvents["RefreshTokenClientAcquireTokenWithCachedRefreshToken"] = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
5749    /**
5750     * acquireTokenByRefreshToken API in RefreshTokenClient (msal-common).
5751     */
5752    PerformanceEvents["RefreshTokenClientAcquireTokenByRefreshToken"] = "refreshTokenClientAcquireTokenByRefreshToken";
5753    /**
5754     * Helper function to create token request body in RefreshTokenClient (msal-common).
5755     */
5756    PerformanceEvents["RefreshTokenClientCreateTokenRequestBody"] = "refreshTokenClientCreateTokenRequestBody";
5757    /**
5758     * acquireTokenFromCache (msal-browser).
5759     * Internal API for acquiring token from cache
5760     */
5761    PerformanceEvents["AcquireTokenFromCache"] = "acquireTokenFromCache";
5762    /**
5763     * acquireTokenBySilentIframe (msal-browser).
5764     * Internal API for acquiring token by silent Iframe
5765     */
5766    PerformanceEvents["AcquireTokenBySilentIframe"] = "acquireTokenBySilentIframe";
5767    /**
5768     * Internal API for initializing base request in BaseInteractionClient (msal-browser)
5769     */
5770    PerformanceEvents["InitializeBaseRequest"] = "initializeBaseRequest";
5771    /**
5772     * Internal API for initializing silent request in SilentCacheClient (msal-browser)
5773     */
5774    PerformanceEvents["InitializeSilentRequest"] = "initializeSilentRequest";
5775    PerformanceEvents["InitializeClientApplication"] = "initializeClientApplication";
5776    /**
5777     * Helper function in SilentIframeClient class (msal-browser).
5778     */
5779    PerformanceEvents["SilentIframeClientTokenHelper"] = "silentIframeClientTokenHelper";
5780    /**
5781     * SilentHandler
5782     */
5783    PerformanceEvents["SilentHandlerInitiateAuthRequest"] = "silentHandlerInitiateAuthRequest";
5784    PerformanceEvents["SilentHandlerMonitorIframeForHash"] = "silentHandlerMonitorIframeForHash";
5785    PerformanceEvents["SilentHandlerLoadFrame"] = "silentHandlerLoadFrame";
5786    /**
5787     * Helper functions in StandardInteractionClient class (msal-browser)
5788     */
5789    PerformanceEvents["StandardInteractionClientCreateAuthCodeClient"] = "standardInteractionClientCreateAuthCodeClient";
5790    PerformanceEvents["StandardInteractionClientGetClientConfiguration"] = "standardInteractionClientGetClientConfiguration";
5791    PerformanceEvents["StandardInteractionClientInitializeAuthorizationRequest"] = "standardInteractionClientInitializeAuthorizationRequest";
5792    PerformanceEvents["StandardInteractionClientInitializeAuthorizationCodeRequest"] = "standardInteractionClientInitializeAuthorizationCodeRequest";
5793    /**
5794     * getAuthCodeUrl API (msal-browser and msal-node).
5795     */
5796    PerformanceEvents["GetAuthCodeUrl"] = "getAuthCodeUrl";
5797    /**
5798     * Functions from InteractionHandler (msal-browser)
5799     */
5800    PerformanceEvents["HandleCodeResponseFromServer"] = "handleCodeResponseFromServer";
5801    PerformanceEvents["HandleCodeResponseFromHash"] = "handleCodeResponseFromHash";
5802    PerformanceEvents["UpdateTokenEndpointAuthority"] = "updateTokenEndpointAuthority";
5803    /**
5804     * APIs in Authorization Code Client (msal-common)
5805     */
5806    PerformanceEvents["AuthClientAcquireToken"] = "authClientAcquireToken";
5807    PerformanceEvents["AuthClientExecuteTokenRequest"] = "authClientExecuteTokenRequest";
5808    PerformanceEvents["AuthClientCreateTokenRequestBody"] = "authClientCreateTokenRequestBody";
5809    PerformanceEvents["AuthClientCreateQueryString"] = "authClientCreateQueryString";
5810    /**
5811     * Generate functions in PopTokenGenerator (msal-common)
5812     */
5813    PerformanceEvents["PopTokenGenerateCnf"] = "popTokenGenerateCnf";
5814    PerformanceEvents["PopTokenGenerateKid"] = "popTokenGenerateKid";
5815    /**
5816     * handleServerTokenResponse API in ResponseHandler (msal-common)
5817     */
5818    PerformanceEvents["HandleServerTokenResponse"] = "handleServerTokenResponse";
5819    /**
5820     * Authority functions
5821     */
5822    PerformanceEvents["AuthorityFactoryCreateDiscoveredInstance"] = "authorityFactoryCreateDiscoveredInstance";
5823    PerformanceEvents["AuthorityResolveEndpointsAsync"] = "authorityResolveEndpointsAsync";
5824    PerformanceEvents["AuthorityGetCloudDiscoveryMetadataFromNetwork"] = "authorityGetCloudDiscoveryMetadataFromNetwork";
5825    PerformanceEvents["AuthorityUpdateCloudDiscoveryMetadata"] = "authorityUpdateCloudDiscoveryMetadata";
5826    PerformanceEvents["AuthorityGetEndpointMetadataFromNetwork"] = "authorityGetEndpointMetadataFromNetwork";
5827    PerformanceEvents["AuthorityUpdateEndpointMetadata"] = "authorityUpdateEndpointMetadata";
5828    PerformanceEvents["AuthorityUpdateMetadataWithRegionalInformation"] = "authorityUpdateMetadataWithRegionalInformation";
5829    /**
5830     * Region Discovery functions
5831     */
5832    PerformanceEvents["RegionDiscoveryDetectRegion"] = "regionDiscoveryDetectRegion";
5833    PerformanceEvents["RegionDiscoveryGetRegionFromIMDS"] = "regionDiscoveryGetRegionFromIMDS";
5834    PerformanceEvents["RegionDiscoveryGetCurrentVersion"] = "regionDiscoveryGetCurrentVersion";
5835    PerformanceEvents["AcquireTokenByCodeAsync"] = "acquireTokenByCodeAsync";
5836    PerformanceEvents["GetEndpointMetadataFromNetwork"] = "getEndpointMetadataFromNetwork";
5837    PerformanceEvents["GetCloudDiscoveryMetadataFromNetworkMeasurement"] = "getCloudDiscoveryMetadataFromNetworkMeasurement";
5838    PerformanceEvents["HandleRedirectPromiseMeasurement"] = "handleRedirectPromiseMeasurement";
5839    PerformanceEvents["UpdateCloudDiscoveryMetadataMeasurement"] = "updateCloudDiscoveryMetadataMeasurement";
5840    PerformanceEvents["UsernamePasswordClientAcquireToken"] = "usernamePasswordClientAcquireToken";
5841    PerformanceEvents["NativeMessageHandlerHandshake"] = "nativeMessageHandlerHandshake";
5842    /**
5843     * Cache operations
5844     */
5845    PerformanceEvents["ClearTokensAndKeysWithClaims"] = "clearTokensAndKeysWithClaims";
5846})(exports.PerformanceEvents || (exports.PerformanceEvents = {}));
5847/**
5848 * State of the performance event.
5849 *
5850 * @export
5851 * @enum {number}
5852 */
5853var PerformanceEventStatus;
5854(function (PerformanceEventStatus) {
5855    PerformanceEventStatus[PerformanceEventStatus["NotStarted"] = 0] = "NotStarted";
5856    PerformanceEventStatus[PerformanceEventStatus["InProgress"] = 1] = "InProgress";
5857    PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
5858})(PerformanceEventStatus || (PerformanceEventStatus = {}));
5859var IntFields = new Set([
5860    "accessTokenSize",
5861    "durationMs",
5862    "idTokenSize",
5863    "matsSilentStatus",
5864    "matsHttpStatus",
5865    "refreshTokenSize",
5866    "queuedTimeMs",
5867    "startTimeMs",
5868    "status",
5869]);
5870
5871/*! @azure/msal-common v13.3.3 2024-06-06 */
5872
5873/*
5874 * Copyright (c) Microsoft Corporation. All rights reserved.
5875 * Licensed under the MIT License.
5876 */
5877var KeyLocation;
5878(function (KeyLocation) {
5879    KeyLocation["SW"] = "sw";
5880    KeyLocation["UHW"] = "uhw";
5881})(KeyLocation || (KeyLocation = {}));
5882var PopTokenGenerator = /** @class */ (function () {
5883    function PopTokenGenerator(cryptoUtils, performanceClient) {
5884        this.cryptoUtils = cryptoUtils;
5885        this.performanceClient = performanceClient;
5886    }
5887    /**
5888     * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
vendor: 84,591 bytes, lines 5889-7229
5889     * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash
5890     * @param request
5891     * @returns
5892     */
5893    PopTokenGenerator.prototype.generateCnf = function (request) {
5894        var _a, _b;
5895        return __awaiter(this, void 0, void 0, function () {
5896            var reqCnf, reqCnfString, _c;
5897            return __generator(this, function (_d) {
5898                switch (_d.label) {
5899                    case 0:
5900                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5901                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5902                        return [4 /*yield*/, this.generateKid(request)];
5903                    case 1:
5904                        reqCnf = _d.sent();
5905                        reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
5906                        _c = {
5907                            kid: reqCnf.kid,
5908                            reqCnfString: reqCnfString
5909                        };
5910                        return [4 /*yield*/, this.cryptoUtils.hashString(reqCnfString)];
5911                    case 2: return [2 /*return*/, (_c.reqCnfHash = _d.sent(),
5912                            _c)];
5913                }
5914            });
5915        });
5916    };
5917    /**
5918     * Generates key_id for a SHR token request
5919     * @param request
5920     * @returns
5921     */
5922    PopTokenGenerator.prototype.generateKid = function (request) {
5923        var _a;
5924        return __awaiter(this, void 0, void 0, function () {
5925            var kidThumbprint;
5926            return __generator(this, function (_b) {
5927                switch (_b.label) {
5928                    case 0:
5929                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5930                        return [4 /*yield*/, this.cryptoUtils.getPublicKeyThumbprint(request)];
5931                    case 1:
5932                        kidThumbprint = _b.sent();
5933                        return [2 /*return*/, {
5934                                kid: kidThumbprint,
5935                                xms_ksl: KeyLocation.SW
5936                            }];
5937                }
5938            });
5939        });
5940    };
5941    /**
5942     * Signs the POP access_token with the local generated key-pair
5943     * @param accessToken
5944     * @param request
5945     * @returns
5946     */
5947    PopTokenGenerator.prototype.signPopToken = function (accessToken, keyId, request) {
5948        return __awaiter(this, void 0, void 0, function () {
5949            return __generator(this, function (_a) {
5950                return [2 /*return*/, this.signPayload(accessToken, keyId, request)];
5951            });
5952        });
5953    };
5954    /**
5955     * Utility function to generate the signed JWT for an access_token
5956     * @param payload
5957     * @param kid
5958     * @param request
5959     * @param claims
5960     * @returns
5961     */
5962    PopTokenGenerator.prototype.signPayload = function (payload, keyId, request, claims) {
5963        return __awaiter(this, void 0, void 0, function () {
5964            var resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce, resourceUrlString, resourceUrlComponents;
5965            return __generator(this, function (_a) {
5966                switch (_a.label) {
5967                    case 0:
5968                        resourceRequestMethod = request.resourceRequestMethod, resourceRequestUri = request.resourceRequestUri, shrClaims = request.shrClaims, shrNonce = request.shrNonce;
5969                        resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;
5970                        resourceUrlComponents = resourceUrlString === null || resourceUrlString === void 0 ? void 0 : resourceUrlString.getUrlComponents();
5971                        return [4 /*yield*/, this.cryptoUtils.signJwt(__assign({ at: payload, ts: TimeUtils.nowSeconds(), m: resourceRequestMethod === null || resourceRequestMethod === void 0 ? void 0 : resourceRequestMethod.toUpperCase(), u: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.HostNameAndPort, nonce: shrNonce || this.cryptoUtils.createNewGuid(), p: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.AbsolutePath, q: (resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined, client_claims: shrClaims || undefined }, claims), keyId, request.correlationId)];
5972                    case 1: return [2 /*return*/, _a.sent()];
5973                }
5974            });
5975        });
5976    };
5977    return PopTokenGenerator;
5978}());
5979
5980/*! @azure/msal-common v13.3.3 2024-06-06 */
5981
5982/*
5983 * Copyright (c) Microsoft Corporation. All rights reserved.
5984 * Licensed under the MIT License.
5985 */
5986/**
5987 * APP_METADATA Cache
5988 *
5989 * Key:Value Schema:
5990 *
5991 * Key: appmetadata-<environment>-<client_id>
5992 *
5993 * Value:
5994 * {
5995 *      clientId: client ID of the application
5996 *      environment: entity that issued the token, represented as a full host
5997 *      familyId: Family ID identifier, '1' represents Microsoft Family
5998 * }
5999 */
6000var AppMetadataEntity = /** @class */ (function () {
6001    function AppMetadataEntity() {
6002    }
6003    /**
6004     * Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>
6005     */
6006    AppMetadataEntity.prototype.generateAppMetadataKey = function () {
6007        return AppMetadataEntity.generateAppMetadataCacheKey(this.environment, this.clientId);
6008    };
6009    /**
6010     * Generate AppMetadata Cache Key
6011     */
6012    AppMetadataEntity.generateAppMetadataCacheKey = function (environment, clientId) {
6013        var appMetaDataKeyArray = [
6014            APP_METADATA,
6015            environment,
6016            clientId,
6017        ];
6018        return appMetaDataKeyArray.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
6019    };
6020    /**
6021     * Creates AppMetadataEntity
6022     * @param clientId
6023     * @param environment
6024     * @param familyId
6025     */
6026    AppMetadataEntity.createAppMetadataEntity = function (clientId, environment, familyId) {
6027        var appMetadata = new AppMetadataEntity();
6028        appMetadata.clientId = clientId;
6029        appMetadata.environment = environment;
6030        if (familyId) {
6031            appMetadata.familyId = familyId;
6032        }
6033        return appMetadata;
6034    };
6035    /**
6036     * Validates an entity: checks for all expected params
6037     * @param entity
6038     */
6039    AppMetadataEntity.isAppMetadataEntity = function (key, entity) {
6040        if (!entity) {
6041            return false;
6042        }
6043        return (key.indexOf(APP_METADATA) === 0 &&
6044            entity.hasOwnProperty("clientId") &&
6045            entity.hasOwnProperty("environment"));
6046    };
6047    return AppMetadataEntity;
6048}());
6049
6050/*! @azure/msal-common v13.3.3 2024-06-06 */
6051/*
6052 * Copyright (c) Microsoft Corporation. All rights reserved.
6053 * Licensed under the MIT License.
6054 */
6055/**
6056 * This class instance helps track the memory changes facilitating
6057 * decisions to read from and write to the persistent cache
6058 */ var TokenCacheContext = /** @class */ (function () {
6059    function TokenCacheContext(tokenCache, hasChanged) {
6060        this.cache = tokenCache;
6061        this.hasChanged = hasChanged;
6062    }
6063    Object.defineProperty(TokenCacheContext.prototype, "cacheHasChanged", {
6064        /**
6065         * boolean which indicates the changes in cache
6066         */
6067        get: function () {
6068            return this.hasChanged;
6069        },
6070        enumerable: false,
6071        configurable: true
6072    });
6073    Object.defineProperty(TokenCacheContext.prototype, "tokenCache", {
6074        /**
6075         * function to retrieve the token cache
6076         */
6077        get: function () {
6078            return this.cache;
6079        },
6080        enumerable: false,
6081        configurable: true
6082    });
6083    return TokenCacheContext;
6084}());
6085
6086/*! @azure/msal-common v13.3.3 2024-06-06 */
6087
6088/*
6089 * Copyright (c) Microsoft Corporation. All rights reserved.
6090 * Licensed under the MIT License.
6091 */
6092/**
6093 * Class that handles response parsing.
6094 */
6095var ResponseHandler = /** @class */ (function () {
6096    function ResponseHandler(clientId, cacheStorage, cryptoObj, logger, serializableCache, persistencePlugin, performanceClient) {
6097        this.clientId = clientId;
6098        this.cacheStorage = cacheStorage;
6099        this.cryptoObj = cryptoObj;
6100        this.logger = logger;
6101        this.serializableCache = serializableCache;
6102        this.persistencePlugin = persistencePlugin;
6103        this.performanceClient = performanceClient;
6104    }
6105    /**
6106     * Function which validates server authorization code response.
6107     * @param serverResponseHash
6108     * @param cachedState
6109     * @param cryptoObj
6110     */
6111    ResponseHandler.prototype.validateServerAuthorizationCodeResponse = function (serverResponseHash, cachedState, cryptoObj) {
6112        if (!serverResponseHash.state || !cachedState) {
6113            throw !serverResponseHash.state ? ClientAuthError.createStateNotFoundError("Server State") : ClientAuthError.createStateNotFoundError("Cached State");
6114        }
6115        if (decodeURIComponent(serverResponseHash.state) !== decodeURIComponent(cachedState)) {
6116            throw ClientAuthError.createStateMismatchError();
6117        }
6118        // Check for error
6119        if (serverResponseHash.error || serverResponseHash.error_description || serverResponseHash.suberror) {
6120            if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponseHash.error, serverResponseHash.error_description, serverResponseHash.suberror)) {
6121                throw new InteractionRequiredAuthError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror, serverResponseHash.timestamp || Constants.EMPTY_STRING, serverResponseHash.trace_id || Constants.EMPTY_STRING, serverResponseHash.correlation_id || Constants.EMPTY_STRING, serverResponseHash.claims || Constants.EMPTY_STRING);
6122            }
6123            throw new ServerError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);
6124        }
6125        if (serverResponseHash.client_info) {
6126            buildClientInfo(serverResponseHash.client_info, cryptoObj);
6127        }
6128    };
6129    /**
6130     * Function which validates server authorization token response.
6131     * @param serverResponse
6132     */
6133    ResponseHandler.prototype.validateTokenResponse = function (serverResponse) {
6134        // Check for error
6135        if (serverResponse.error || serverResponse.error_description || serverResponse.suberror) {
6136            if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
6137                throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || Constants.EMPTY_STRING, serverResponse.trace_id || Constants.EMPTY_STRING, serverResponse.correlation_id || Constants.EMPTY_STRING, serverResponse.claims || Constants.EMPTY_STRING);
6138            }
6139            var errString = serverResponse.error_codes + " - [" + serverResponse.timestamp + "]: " + serverResponse.error_description + " - Correlation ID: " + serverResponse.correlation_id + " - Trace ID: " + serverResponse.trace_id;
6140            throw new ServerError(serverResponse.error, errString, serverResponse.suberror);
6141        }
6142    };
6143    /**
6144     * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.
6145     * @param serverTokenResponse
6146     * @param authority
6147     */
6148    ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {
6149        var _a;
6150        return __awaiter(this, void 0, void 0, function () {
6151            var idTokenObj, authTime, requestStateObj, cacheRecord, cacheContext, key, account;
6152            return __generator(this, function (_b) {
6153                switch (_b.label) {
6154                    case 0:
6155                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);
6156                        if (serverTokenResponse.id_token) {
6157                            idTokenObj = new AuthToken(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj);
6158                            // token nonce check (TODO: Add a warning if no nonce is given?)
6159                            if (authCodePayload && !StringUtils.isEmpty(authCodePayload.nonce)) {
6160                                if (idTokenObj.claims.nonce !== authCodePayload.nonce) {
6161                                    throw ClientAuthError.createNonceMismatchError();
6162                                }
6163                            }
6164                            // token max_age check
6165                            if (request.maxAge || (request.maxAge === 0)) {
6166                                authTime = idTokenObj.claims.auth_time;
6167                                if (!authTime) {
6168                                    throw ClientAuthError.createAuthTimeNotFoundError();
6169                                }
6170                                AuthToken.checkMaxAge(authTime, request.maxAge);
6171                            }
6172                        }
6173                        // generate homeAccountId
6174                        this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims);
6175                        if (!!authCodePayload && !!authCodePayload.state) {
6176                            requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);
6177                        }
6178                        // Add keyId from request to serverTokenResponse if defined
6179                        serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;
6180                        cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);
6181                        _b.label = 1;
6182                    case 1:
6183                        _b.trys.push([1, , 5, 8]);
6184                        if (!(this.persistencePlugin && this.serializableCache)) return [3 /*break*/, 3];
6185                        this.logger.verbose("Persistence enabled, calling beforeCacheAccess");
6186                        cacheContext = new TokenCacheContext(this.serializableCache, true);
6187                        return [4 /*yield*/, this.persistencePlugin.beforeCacheAccess(cacheContext)];
6188                    case 2:
6189                        _b.sent();
6190                        _b.label = 3;
6191                    case 3:
6192                        /*
6193                         * When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.
6194                         * If not present, we should return null, as it's the case that another application called removeAccount in between
6195                         * the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal, unless explicitly flagged by
6196                         * the developer, as in the case of refresh token flow used in ADAL Node to MSAL Node migration.
6197                         */
6198                        if (handlingRefreshTokenResponse && !forceCacheRefreshTokenResponse && cacheRecord.account) {
6199                            key = cacheRecord.account.generateAccountKey();
6200                            account = this.cacheStorage.getAccount(key);
6201                            if (!account) {
6202                                this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache");
6203                                return [2 /*return*/, ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, undefined, serverRequestId)];
6204                            }
6205                        }
6206                        return [4 /*yield*/, this.cacheStorage.saveCacheRecord(cacheRecord)];
6207                    case 4:
6208                        _b.sent();
6209                        return [3 /*break*/, 8];
6210                    case 5:
6211                        if (!(this.persistencePlugin && this.serializableCache && cacheContext)) return [3 /*break*/, 7];
6212                        this.logger.verbose("Persistence enabled, calling afterCacheAccess");
6213                        return [4 /*yield*/, this.persistencePlugin.afterCacheAccess(cacheContext)];
6214                    case 6:
6215                        _b.sent();
6216                        _b.label = 7;
6217                    case 7: return [7 /*endfinally*/];
6218                    case 8: return [2 /*return*/, ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, serverTokenResponse, serverRequestId)];
6219                }
6220            });
6221        });
6222    };
6223    /**
6224     * Generates CacheRecord
6225     * @param serverTokenResponse
6226     * @param idTokenObj
6227     * @param authority
6228     */
6229    ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload) {
6230        var env = authority.getPreferredCache();
6231        if (StringUtils.isEmpty(env)) {
6232            throw ClientAuthError.createInvalidCacheEnvironmentError();
6233        }
6234        // IdToken: non AAD scenarios can have empty realm
6235        var cachedIdToken;
6236        var cachedAccount;
6237        if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {
6238            cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
6239            cachedAccount = AccountEntity.createAccount({
6240                homeAccountId: this.homeAccountIdentifier,
6241                idTokenClaims: idTokenObj.claims,
6242                clientInfo: serverTokenResponse.client_info || Constants.EMPTY_STRING,
6243                cloudGraphHostName: authCodePayload === null || authCodePayload === void 0 ? void 0 : authCodePayload.cloud_graph_host_name,
6244                msGraphHost: authCodePayload === null || authCodePayload === void 0 ? void 0 : authCodePayload.msgraph_host,
6245            }, authority);
6246        }
6247        // AccessToken
6248        var cachedAccessToken = null;
6249        if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {
6250            // If scopes not returned in server response, use request scopes
6251            var responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);
6252            /*
6253             * Use timestamp calculated before request
6254             * Server may return timestamps as strings, parse to numbers if so.
6255             */
6256            var expiresIn = (typeof serverTokenResponse.expires_in === "string" ? parseInt(serverTokenResponse.expires_in, 10) : serverTokenResponse.expires_in) || 0;
6257            var extExpiresIn = (typeof serverTokenResponse.ext_expires_in === "string" ? parseInt(serverTokenResponse.ext_expires_in, 10) : serverTokenResponse.ext_expires_in) || 0;
6258            var refreshIn = (typeof serverTokenResponse.refresh_in === "string" ? parseInt(serverTokenResponse.refresh_in, 10) : serverTokenResponse.refresh_in) || undefined;
6259            var tokenExpirationSeconds = reqTimestamp + expiresIn;
6260            var extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;
6261            var refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;
6262            // non AAD scenarios can have empty realm
6263            cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);
6264        }
6265        // refreshToken
6266        var cachedRefreshToken = null;
6267        if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {
6268            cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, userAssertionHash);
6269        }
6270        // appMetadata
6271        var cachedAppMetadata = null;
6272        if (!StringUtils.isEmpty(serverTokenResponse.foci)) {
6273            cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);
6274        }
6275        return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);
6276    };
6277    /**
6278     * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
6279     *
6280     * Optionally takes a state string that is set as-is in the response.
6281     *
6282     * @param cacheRecord
6283     * @param idTokenObj
6284     * @param fromTokenCache
6285     * @param stateString
6286     */
6287    ResponseHandler.generateAuthenticationResult = function (cryptoObj, authority, cacheRecord, fromTokenCache, request, idTokenObj, requestState, serverTokenResponse, requestId) {
6288        var _a, _b, _c;
6289        return __awaiter(this, void 0, void 0, function () {
6290            var accessToken, responseScopes, expiresOn, extExpiresOn, familyId, popTokenGenerator, _d, secret, keyId, uid, tid;
6291            return __generator(this, function (_e) {
6292                switch (_e.label) {
6293                    case 0:
6294                        accessToken = Constants.EMPTY_STRING;
6295                        responseScopes = [];
6296                        expiresOn = null;
6297                        familyId = Constants.EMPTY_STRING;
6298                        if (!cacheRecord.accessToken) return [3 /*break*/, 4];
6299                        if (!(cacheRecord.accessToken.tokenType === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
6300                        popTokenGenerator = new PopTokenGenerator(cryptoObj);
6301                        _d = cacheRecord.accessToken, secret = _d.secret, keyId = _d.keyId;
6302                        if (!keyId) {
6303                            throw ClientAuthError.createKeyIdMissingError();
6304                        }
6305                        return [4 /*yield*/, popTokenGenerator.signPopToken(secret, keyId, request)];
6306                    case 1:
6307                        accessToken = _e.sent();
6308                        return [3 /*break*/, 3];
6309                    case 2:
6310                        accessToken = cacheRecord.accessToken.secret;
6311                        _e.label = 3;
6312                    case 3:
6313                        responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
6314                        expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
6315                        extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
6316                        _e.label = 4;
6317                    case 4:
6318                        if (cacheRecord.appMetadata) {
6319                            familyId = cacheRecord.appMetadata.familyId === THE_FAMILY_ID ? THE_FAMILY_ID : Constants.EMPTY_STRING;
6320                        }
6321                        uid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.oid) || (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.sub) || Constants.EMPTY_STRING;
6322                        tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;
6323                        // for hybrid + native bridge enablement, send back the native account Id
6324                        if ((serverTokenResponse === null || serverTokenResponse === void 0 ? void 0 : serverTokenResponse.spa_accountid) && !!cacheRecord.account) {
6325                            cacheRecord.account.nativeAccountId = serverTokenResponse === null || serverTokenResponse === void 0 ? void 0 : serverTokenResponse.spa_accountid;
6326                        }
6327                        return [2 /*return*/, {
6328                                authority: authority.canonicalAuthority,
6329                                uniqueId: uid,
6330                                tenantId: tid,
6331                                scopes: responseScopes,
6332                                account: cacheRecord.account ? cacheRecord.account.getAccountInfo() : null,
6333                                idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
6334                                idTokenClaims: idTokenObj ? idTokenObj.claims : {},
6335                                accessToken: accessToken,
6336                                fromCache: fromTokenCache,
6337                                expiresOn: expiresOn,
6338                                correlationId: request.correlationId,
6339                                requestId: requestId || Constants.EMPTY_STRING,
6340                                extExpiresOn: extExpiresOn,
6341                                familyId: familyId,
6342                                tokenType: ((_a = cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,
6343                                state: requestState ? requestState.userRequestState : Constants.EMPTY_STRING,
6344                                cloudGraphHostName: ((_b = cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,
6345                                msGraphHost: ((_c = cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,
6346                                code: serverTokenResponse === null || serverTokenResponse === void 0 ? void 0 : serverTokenResponse.spa_code,
6347                                fromNativeBroker: false,
6348                            }];
6349                }
6350            });
6351        });
6352    };
6353    return ResponseHandler;
6354}());
6355
6356/*! @azure/msal-common v13.3.3 2024-06-06 */
6357
6358/*
6359 * Copyright (c) Microsoft Corporation. All rights reserved.
6360 * Licensed under the MIT License.
6361 */
6362/**
6363 * Oauth2.0 Authorization Code client
6364 */
6365var AuthorizationCodeClient = /** @class */ (function (_super) {
6366    __extends(AuthorizationCodeClient, _super);
6367    function AuthorizationCodeClient(configuration, performanceClient) {
6368        var _this = _super.call(this, configuration, performanceClient) || this;
6369        // Flag to indicate if client is for hybrid spa auth code redemption
6370        _this.includeRedirectUri = true;
6371        return _this;
6372    }
6373    /**
6374     * Creates the URL of the authorization request letting the user input credentials and consent to the
6375     * application. The URL target the /authorize endpoint of the authority configured in the
6376     * application object.
6377     *
6378     * Once the user inputs their credentials and consents, the authority will send a response to the redirect URI
6379     * sent in the request and should contain an authorization code, which can then be used to acquire tokens via
6380     * acquireToken(AuthorizationCodeRequest)
6381     * @param request
6382     */
6383    AuthorizationCodeClient.prototype.getAuthCodeUrl = function (request) {
6384        var _a, _b;
6385        return __awaiter(this, void 0, void 0, function () {
6386            var queryString;
6387            return __generator(this, function (_c) {
6388                switch (_c.label) {
6389                    case 0:
6390                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.GetAuthCodeUrl, request.correlationId);
6391                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
6392                        return [4 /*yield*/, this.createAuthCodeUrlQueryString(request)];
6393                    case 1:
6394                        queryString = _c.sent();
6395                        return [2 /*return*/, UrlString.appendQueryString(this.authority.authorizationEndpoint, queryString)];
6396                }
6397            });
6398        });
6399    };
6400    /**
6401     * API to acquire a token in exchange of 'authorization_code` acquired by the user in the first leg of the
6402     * authorization_code_grant
6403     * @param request
6404     */
6405    AuthorizationCodeClient.prototype.acquireToken = function (request, authCodePayload) {
6406        var _a, _b, _c, _d, _e, _f;
6407        return __awaiter(this, void 0, void 0, function () {
6408            var atsMeasurement, reqTimestamp, response, requestId, httpVerAuthority, responseHandler;
6409            var _this = this;
6410            return __generator(this, function (_g) {
6411                switch (_g.label) {
6412                    case 0:
6413                        if (!request || !request.code) {
6414                            throw ClientAuthError.createTokenRequestCannotBeMadeError();
6415                        }
6416                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthClientAcquireToken, request.correlationId);
6417                        atsMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement("AuthCodeClientAcquireToken", request.correlationId);
6418                        this.logger.info("in acquireToken call in auth-code client");
6419                        reqTimestamp = TimeUtils.nowSeconds();
6420                        (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
6421                        return [4 /*yield*/, this.executeTokenRequest(this.authority, request)];
6422                    case 1:
6423                        response = _g.sent();
6424                        requestId = (_d = response.headers) === null || _d === void 0 ? void 0 : _d[HeaderNames.X_MS_REQUEST_ID];
6425                        httpVerAuthority = (_e = response.headers) === null || _e === void 0 ? void 0 : _e[HeaderNames.X_MS_HTTP_VERSION];
6426                        if (httpVerAuthority) {
6427                            atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
6428                                httpVerAuthority: httpVerAuthority
6429                            });
6430                        }
6431                        responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);
6432                        // Validate response. This function throws a server error if an error is returned by the server.
6433                        responseHandler.validateTokenResponse(response.body);
6434                        (_f = this.performanceClient) === null || _f === void 0 ? void 0 : _f.setPreQueueTime(exports.PerformanceEvents.HandleServerTokenResponse, request.correlationId);
6435                        return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId).then(function (result) {
6436                                atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
6437                                    success: true
6438                                });
6439                                return result;
6440                            })
6441                                .catch(function (error) {
6442                                _this.logger.verbose("Error in fetching token in ACC", request.correlationId);
6443                                atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
6444                                    errorCode: error.errorCode,
6445                                    subErrorCode: error.subError,
6446                                    success: false
6447                                });
6448                                throw error;
6449                            })];
6450                }
6451            });
6452        });
6453    };
6454    /**
6455     * Handles the hash fragment response from public client code request. Returns a code response used by
6456     * the client to exchange for a token in acquireToken.
6457     * @param hashFragment
6458     */
6459    AuthorizationCodeClient.prototype.handleFragmentResponse = function (hashFragment, cachedState) {
6460        // Handle responses.
6461        var responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, null, null);
6462        // Deserialize hash fragment response parameters.
6463        var hashUrlString = new UrlString(hashFragment);
6464        // Deserialize hash fragment response parameters.
6465        var serverParams = UrlString.getDeserializedHash(hashUrlString.getHash());
6466        // Get code response
6467        responseHandler.validateServerAuthorizationCodeResponse(serverParams, cachedState, this.cryptoUtils);
6468        // throw when there is no auth code in the response
6469        if (!serverParams.code) {
6470            throw ClientAuthError.createNoAuthCodeInServerResponseError();
6471        }
6472        return __assign(__assign({}, serverParams), { 
6473            // Code param is optional in ServerAuthorizationCodeResponse but required in AuthorizationCodePaylod
6474            code: serverParams.code });
6475    };
6476    /**
6477     * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.
6478     * Default behaviour is to redirect the user to `window.location.href`.
6479     * @param authorityUri
6480     */
6481    AuthorizationCodeClient.prototype.getLogoutUri = function (logoutRequest) {
6482        // Throw error if logoutRequest is null/undefined
6483        if (!logoutRequest) {
6484            throw ClientConfigurationError.createEmptyLogoutRequestError();
6485        }
6486        var queryString = this.createLogoutUrlQueryString(logoutRequest);
6487        // Construct logout URI
6488        return UrlString.appendQueryString(this.authority.endSessionEndpoint, queryString);
6489    };
6490    /**
6491     * Executes POST request to token endpoint
6492     * @param authority
6493     * @param request
6494     */
6495    AuthorizationCodeClient.prototype.executeTokenRequest = function (authority, request) {
6496        var _a, _b;
6497        return __awaiter(this, void 0, void 0, function () {
6498            var queryParametersString, endpoint, requestBody, ccsCredential, clientInfo, headers, thumbprint;
6499            return __generator(this, function (_c) {
6500                switch (_c.label) {
6501                    case 0:
6502                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
6503                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
6504                        queryParametersString = this.createTokenQueryParameters(request);
6505                        endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
6506                        return [4 /*yield*/, this.createTokenRequestBody(request)];
6507                    case 1:
6508                        requestBody = _c.sent();
6509                        ccsCredential = undefined;
6510                        if (request.clientInfo) {
6511                            try {
6512                                clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);
6513                                ccsCredential = {
6514                                    credential: "" + clientInfo.uid + Separators.CLIENT_INFO_SEPARATOR + clientInfo.utid,
6515                                    type: CcsCredentialType.HOME_ACCOUNT_ID
6516                                };
6517                            }
6518                            catch (e) {
6519                                this.logger.verbose("Could not parse client info for CCS Header: " + e);
6520                            }
6521                        }
6522                        headers = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);
6523                        thumbprint = {
6524                            clientId: this.config.authOptions.clientId,
6525                            authority: authority.canonicalAuthority,
6526                            scopes: request.scopes,
6527                            claims: request.claims,
6528                            authenticationScheme: request.authenticationScheme,
6529                            resourceRequestMethod: request.resourceRequestMethod,
6530                            resourceRequestUri: request.resourceRequestUri,
6531                            shrClaims: request.shrClaims,
6532                            sshKid: request.sshKid
6533                        };
6534                        return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)];
6535                }
6536            });
6537        });
6538    };
6539    /**
6540     * Generates a map for all the params to be sent to the service
6541     * @param request
6542     */
6543    AuthorizationCodeClient.prototype.createTokenRequestBody = function (request) {
6544        var _a, _b;
6545        return __awaiter(this, void 0, void 0, function () {
6546            var parameterBuilder, clientAssertion, popTokenGenerator, reqCnfData, correlationId, ccsCred, clientInfo, clientInfo;
6547            var _c;
6548            return __generator(this, function (_d) {
6549                switch (_d.label) {
6550                    case 0:
6551                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
6552                        parameterBuilder = new RequestParameterBuilder();
6553                        parameterBuilder.addClientId(this.config.authOptions.clientId);
6554                        /*
6555                         * For hybrid spa flow, there will be a code but no verifier
6556                         * In this scenario, don't include redirect uri as auth code will not be bound to redirect URI
6557                         */
6558                        if (!this.includeRedirectUri) {
6559                            // Just validate
6560                            RequestValidator.validateRedirectUri(request.redirectUri);
6561                        }
6562                        else {
6563                            // Validate and include redirect uri
6564                            parameterBuilder.addRedirectUri(request.redirectUri);
6565                        }
6566                        // Add scope array, parameter builder will add default scopes and dedupe
6567                        parameterBuilder.addScopes(request.scopes);
6568                        // add code: user set, not validated
6569                        parameterBuilder.addAuthorizationCode(request.code);
6570                        // Add library metadata
6571                        parameterBuilder.addLibraryInfo(this.config.libraryInfo);
6572                        parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
6573                        parameterBuilder.addThrottling();
6574                        if (this.serverTelemetryManager) {
6575                            parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
6576                        }
6577                        // add code_verifier if passed
6578                        if (request.codeVerifier) {
6579                            parameterBuilder.addCodeVerifier(request.codeVerifier);
6580                        }
6581                        if (this.config.clientCredentials.clientSecret) {
6582                            parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
6583                        }
6584                        if (this.config.clientCredentials.clientAssertion) {
6585                            clientAssertion = this.config.clientCredentials.clientAssertion;
6586                            parameterBuilder.addClientAssertion(clientAssertion.assertion);
6587                            parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
6588                        }
6589                        parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
6590                        parameterBuilder.addClientInfo();
6591                        if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
6592                        popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
6593                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
6594                        return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
6595                    case 1:
6596                        reqCnfData = _d.sent();
6597                        // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
6598                        parameterBuilder.addPopToken(reqCnfData.reqCnfString);
6599                        return [3 /*break*/, 3];
6600                    case 2:
6601                        if (request.authenticationScheme === exports.AuthenticationScheme.SSH) {
6602                            if (request.sshJwk) {
6603                                parameterBuilder.addSshJwk(request.sshJwk);
6604                            }
6605                            else {
6606                                throw ClientConfigurationError.createMissingSshJwkError();
6607                            }
6608                        }
6609                        _d.label = 3;
6610                    case 3:
6611                        correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();
6612                        parameterBuilder.addCorrelationId(correlationId);
6613                        if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
6614                            parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
6615                        }
6616                        ccsCred = undefined;
6617                        if (request.clientInfo) {
6618                            try {
6619                                clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);
6620                                ccsCred = {
6621                                    credential: "" + clientInfo.uid + Separators.CLIENT_INFO_SEPARATOR + clientInfo.utid,
6622                                    type: CcsCredentialType.HOME_ACCOUNT_ID
6623                                };
6624                            }
6625                            catch (e) {
6626                                this.logger.verbose("Could not parse client info for CCS Header: " + e);
6627                            }
6628                        }
6629                        else {
6630                            ccsCred = request.ccsCredential;
6631                        }
6632                        // Adds these as parameters in the request instead of headers to prevent CORS preflight request
6633                        if (this.config.systemOptions.preventCorsPreflight && ccsCred) {
6634                            switch (ccsCred.type) {
6635                                case CcsCredentialType.HOME_ACCOUNT_ID:
6636                                    try {
6637                                        clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);
6638                                        parameterBuilder.addCcsOid(clientInfo);
6639                                    }
6640                                    catch (e) {
6641                                        this.logger.verbose("Could not parse home account ID for CCS Header: " + e);
6642                                    }
6643                                    break;
6644                                case CcsCredentialType.UPN:
6645                                    parameterBuilder.addCcsUpn(ccsCred.credential);
6646                                    break;
6647                            }
6648                        }
6649                        if (request.tokenBodyParameters) {
6650                            parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
6651                        }
6652                        // Add hybrid spa parameters if not already provided
6653                        if (request.enableSpaAuthorizationCode && (!request.tokenBodyParameters || !request.tokenBodyParameters[AADServerParamKeys.RETURN_SPA_CODE])) {
6654                            parameterBuilder.addExtraQueryParameters((_c = {},
6655                                _c[AADServerParamKeys.RETURN_SPA_CODE] = "1",
6656                                _c));
6657                        }
6658                        return [2 /*return*/, parameterBuilder.createQueryString()];
6659                }
6660            });
6661        });
6662    };
6663    /**
6664     * This API validates the `AuthorizationCodeUrlRequest` and creates a URL
6665     * @param request
6666     */
6667    AuthorizationCodeClient.prototype.createAuthCodeUrlQueryString = function (request) {
6668        var _a;
6669        return __awaiter(this, void 0, void 0, function () {
6670            var parameterBuilder, requestScopes, correlationId, accountSid, accountLoginHintClaim, clientInfo, clientInfo, clientInfo, popTokenGenerator, reqCnfData;
6671            return __generator(this, function (_b) {
6672                switch (_b.label) {
6673                    case 0:
6674                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
6675                        parameterBuilder = new RequestParameterBuilder();
6676                        parameterBuilder.addClientId(this.config.authOptions.clientId);
6677                        requestScopes = __spreadArrays(request.scopes || [], request.extraScopesToConsent || []);
6678                        parameterBuilder.addScopes(requestScopes);
6679                        // validate the redirectUri (to be a non null value)
6680                        parameterBuilder.addRedirectUri(request.redirectUri);
6681                        correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();
6682                        parameterBuilder.addCorrelationId(correlationId);
6683                        // add response_mode. If not passed in it defaults to query.
6684                        parameterBuilder.addResponseMode(request.responseMode);
6685                        // add response_type = code
6686                        parameterBuilder.addResponseTypeCode();
6687                        // add library info parameters
6688                        parameterBuilder.addLibraryInfo(this.config.libraryInfo);
6689                        parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
6690                        // add client_info=1
6691                        parameterBuilder.addClientInfo();
6692                        if (request.codeChallenge && request.codeChallengeMethod) {
6693                            parameterBuilder.addCodeChallengeParams(request.codeChallenge, request.codeChallengeMethod);
6694                        }
6695                        if (request.prompt) {
6696                            parameterBuilder.addPrompt(request.prompt);
6697                        }
6698                        if (request.domainHint) {
6699                            parameterBuilder.addDomainHint(request.domainHint);
6700                        }
6701                        // Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
6702                        if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
6703                            // AAD will throw if prompt=select_account is passed with an account hint
6704                            if (request.sid && request.prompt === PromptValue.NONE) {
6705                                // SessionID is only used in silent calls
6706                                this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request");
6707                                parameterBuilder.addSid(request.sid);
6708                            }
6709                            else if (request.account) {
6710                                accountSid = this.extractAccountSid(request.account);
6711                                accountLoginHintClaim = this.extractLoginHint(request.account);
6712                                // If login_hint claim is present, use it over sid/username
6713                                if (accountLoginHintClaim) {
6714                                    this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
6715                                    parameterBuilder.addLoginHint(accountLoginHintClaim);
6716                                    try {
6717                                        clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
6718                                        parameterBuilder.addCcsOid(clientInfo);
6719                                    }
6720                                    catch (e) {
6721                                        this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
6722                                    }
6723                                }
6724                                else if (accountSid && request.prompt === PromptValue.NONE) {
6725                                    /*
6726                                     * If account and loginHint are provided, we will check account first for sid before adding loginHint
6727                                     * SessionId is only used in silent calls
6728                                     */
6729                                    this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
6730                                    parameterBuilder.addSid(accountSid);
6731                                    try {
6732                                        clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
6733                                        parameterBuilder.addCcsOid(clientInfo);
6734                                    }
6735                                    catch (e) {
6736                                        this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
6737                                    }
6738                                }
6739                                else if (request.loginHint) {
6740                                    this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request");
6741                                    parameterBuilder.addLoginHint(request.loginHint);
6742                                    parameterBuilder.addCcsUpn(request.loginHint);
6743                                }
6744                                else if (request.account.username) {
6745                                    // Fallback to account username if provided
6746                                    this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account");
6747                                    parameterBuilder.addLoginHint(request.account.username);
6748                                    try {
6749                                        clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
6750                                        parameterBuilder.addCcsOid(clientInfo);
6751                                    }
6752                                    catch (e) {
6753                                        this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
6754                                    }
6755                                }
6756                            }
6757                            else if (request.loginHint) {
6758                                this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request");
6759                                parameterBuilder.addLoginHint(request.loginHint);
6760                                parameterBuilder.addCcsUpn(request.loginHint);
6761                            }
6762                        }
6763                        else {
6764                            this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");
6765                        }
6766                        if (request.nonce) {
6767                            parameterBuilder.addNonce(request.nonce);
6768                        }
6769                        if (request.state) {
6770                            parameterBuilder.addState(request.state);
6771                        }
6772                        if (!StringUtils.isEmpty(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
6773                            parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
6774                        }
6775                        if (request.extraQueryParameters) {
6776                            parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
6777                        }
6778                        if (!request.nativeBroker) return [3 /*break*/, 2];
6779                        // signal ests that this is a WAM call
6780                        parameterBuilder.addNativeBroker();
6781                        if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
6782                        popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
6783                        return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
6784                    case 1:
6785                        reqCnfData = _b.sent();
6786                        parameterBuilder.addPopToken(reqCnfData.reqCnfString);
6787                        _b.label = 2;
6788                    case 2: return [2 /*return*/, parameterBuilder.createQueryString()];
6789                }
6790            });
6791        });
6792    };
6793    /**
6794     * This API validates the `EndSessionRequest` and creates a URL
6795     * @param request
6796     */
6797    AuthorizationCodeClient.prototype.createLogoutUrlQueryString = function (request) {
6798        var parameterBuilder = new RequestParameterBuilder();
6799        if (request.postLogoutRedirectUri) {
6800            parameterBuilder.addPostLogoutRedirectUri(request.postLogoutRedirectUri);
6801        }
6802        if (request.correlationId) {
6803            parameterBuilder.addCorrelationId(request.correlationId);
6804        }
6805        if (request.idTokenHint) {
6806            parameterBuilder.addIdTokenHint(request.idTokenHint);
6807        }
6808        if (request.state) {
6809            parameterBuilder.addState(request.state);
6810        }
6811        if (request.logoutHint) {
6812            parameterBuilder.addLogoutHint(request.logoutHint);
6813        }
6814        if (request.extraQueryParameters) {
6815            parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
6816        }
6817        return parameterBuilder.createQueryString();
6818    };
6819    /**
6820     * Helper to get sid from account. Returns null if idTokenClaims are not present or sid is not present.
6821     * @param account
6822     */
6823    AuthorizationCodeClient.prototype.extractAccountSid = function (account) {
6824        var _a;
6825        return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a.sid) || null;
6826    };
6827    AuthorizationCodeClient.prototype.extractLoginHint = function (account) {
6828        var _a;
6829        return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a.login_hint) || null;
6830    };
6831    return AuthorizationCodeClient;
6832}(BaseClient));
6833
6834/*! @azure/msal-common v13.3.3 2024-06-06 */
6835
6836/*
6837 * Copyright (c) Microsoft Corporation. All rights reserved.
6838 * Licensed under the MIT License.
6839 */
6840/**
6841 * OAuth2.0 refresh token client
6842 */
6843var RefreshTokenClient = /** @class */ (function (_super) {
6844    __extends(RefreshTokenClient, _super);
6845    function RefreshTokenClient(configuration, performanceClient) {
6846        return _super.call(this, configuration, performanceClient) || this;
6847    }
6848    RefreshTokenClient.prototype.acquireToken = function (request) {
6849        var _a, _b, _c, _d, _e, _f, _g;
6850        return __awaiter(this, void 0, void 0, function () {
6851            var atsMeasurement, reqTimestamp, response, httpVerToken, requestId, responseHandler;
6852            var _this = this;
6853            return __generator(this, function (_h) {
6854                switch (_h.label) {
6855                    case 0:
6856                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
6857                        atsMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
6858                        this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
6859                        reqTimestamp = TimeUtils.nowSeconds();
6860                        (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6861                        return [4 /*yield*/, this.executeTokenRequest(request, this.authority)];
6862                    case 1:
6863                        response = _h.sent();
6864                        httpVerToken = (_d = response.headers) === null || _d === void 0 ? void 0 : _d[HeaderNames.X_MS_HTTP_VERSION];
6865                        atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
6866                            refreshTokenSize: ((_e = response.body.refresh_token) === null || _e === void 0 ? void 0 : _e.length) || 0,
6867                        });
6868                        if (httpVerToken) {
6869                            atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
6870                                httpVerToken: httpVerToken,
6871                            });
6872                        }
6873                        requestId = (_f = response.headers) === null || _f === void 0 ? void 0 : _f[HeaderNames.X_MS_REQUEST_ID];
6874                        responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
6875                        responseHandler.validateTokenResponse(response.body);
6876                        (_g = this.performanceClient) === null || _g === void 0 ? void 0 : _g.setPreQueueTime(exports.PerformanceEvents.HandleServerTokenResponse, request.correlationId);
6877                        return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId).then(function (result) {
6878                                atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
6879                                    success: true
6880                                });
6881                                return result;
6882                            })
6883                                .catch(function (error) {
6884                                _this.logger.verbose("Error in fetching refresh token", request.correlationId);
6885                                atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
6886                                    errorCode: error.errorCode,
6887                                    subErrorCode: error.subError,
6888                                    success: false
6889                                });
6890                                throw error;
6891                            })];
6892                }
6893            });
6894        });
6895    };
6896    /**
6897     * Gets cached refresh token and attaches to request, then calls acquireToken API
6898     * @param request
6899     */
6900    RefreshTokenClient.prototype.acquireTokenByRefreshToken = function (request) {
6901        var _a, _b, _c, _d;
6902        return __awaiter(this, void 0, void 0, function () {
6903            var isFOCI, noFamilyRTInCache, clientMismatchErrorWithFamilyRT;
6904            return __generator(this, function (_e) {
6905                // Cannot renew token if no request object is given.
6906                if (!request) {
6907                    throw ClientConfigurationError.createEmptyTokenRequestError();
6908                }
6909                (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
6910                // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
6911                if (!request.account) {
6912                    throw ClientAuthError.createNoAccountInSilentRequestError();
6913                }
6914                isFOCI = this.cacheManager.isAppMetadataFOCI(request.account.environment);
6915                // if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest
6916                if (isFOCI) {
6917                    try {
6918                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6919                        return [2 /*return*/, this.acquireTokenWithCachedRefreshToken(request, true)];
6920                    }
6921                    catch (e) {
6922                        noFamilyRTInCache = e instanceof InteractionRequiredAuthError && e.errorCode === InteractionRequiredAuthErrorMessage.noTokensFoundError.code;
6923                        clientMismatchErrorWithFamilyRT = e instanceof ServerError && e.errorCode === Errors.INVALID_GRANT_ERROR && e.subError === Errors.CLIENT_MISMATCH_ERROR;
6924                        // if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)
6925                        if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {
6926                            (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6927                            return [2 /*return*/, this.acquireTokenWithCachedRefreshToken(request, false)];
6928                            // throw in all other cases
6929                        }
6930                        else {
6931                            throw e;
6932                        }
6933                    }
6934                }
6935                // fall back to application refresh token acquisition
6936                (_d = this.performanceClient) === null || _d === void 0 ? void 0 : _d.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6937                return [2 /*return*/, this.acquireTokenWithCachedRefreshToken(request, false)];
6938            });
6939        });
6940    };
6941    /**
6942     * makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached
6943     * @param request
6944     */
6945    RefreshTokenClient.prototype.acquireTokenWithCachedRefreshToken = function (request, foci) {
6946        var _a, _b, _c;
6947        return __awaiter(this, void 0, void 0, function () {
6948            var atsMeasurement, refreshToken, refreshTokenRequest;
6949            return __generator(this, function (_d) {
6950                (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6951                atsMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6952                this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called", request.correlationId);
6953                refreshToken = this.cacheManager.getRefreshToken(request.account, foci);
6954                if (!refreshToken) {
6955                    atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.discardMeasurement();
6956                    throw InteractionRequiredAuthError.createNoTokensFoundError();
6957                }
6958                // attach cached RT size to the current measurement
6959                atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
6960                    success: true
6961                });
6962                refreshTokenRequest = __assign(__assign({}, request), { refreshToken: refreshToken.secret, authenticationScheme: request.authenticationScheme || exports.AuthenticationScheme.BEARER, ccsCredential: {
6963                        credential: request.account.homeAccountId,
6964                        type: CcsCredentialType.HOME_ACCOUNT_ID
6965                    } });
6966                (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
6967                return [2 /*return*/, this.acquireToken(refreshTokenRequest)];
6968            });
6969        });
6970    };
6971    /**
6972     * Constructs the network message and makes a NW call to the underlying secure token service
6973     * @param request
6974     * @param authority
6975     */
6976    RefreshTokenClient.prototype.executeTokenRequest = function (request, authority) {
6977        var _a, _b, _c;
6978        return __awaiter(this, void 0, void 0, function () {
6979            var acquireTokenMeasurement, queryParametersString, endpoint, requestBody, headers, thumbprint;
6980            return __generator(this, function (_d) {
6981                switch (_d.label) {
6982                    case 0:
6983                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6984                        acquireTokenMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6985                        (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
6986                        queryParametersString = this.createTokenQueryParameters(request);
6987                        endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
6988                        return [4 /*yield*/, this.createTokenRequestBody(request)];
6989                    case 1:
6990                        requestBody = _d.sent();
6991                        headers = this.createTokenRequestHeaders(request.ccsCredential);
6992                        thumbprint = {
6993                            clientId: this.config.authOptions.clientId,
6994                            authority: authority.canonicalAuthority,
6995                            scopes: request.scopes,
6996                            claims: request.claims,
6997                            authenticationScheme: request.authenticationScheme,
6998                            resourceRequestMethod: request.resourceRequestMethod,
6999                            resourceRequestUri: request.resourceRequestUri,
7000                            shrClaims: request.shrClaims,
7001                            sshKid: request.sshKid
7002                        };
7003                        return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)
7004                                .then(function (result) {
7005                                acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
7006                                    success: true
7007                                });
7008                                return result;
7009                            })
7010                                .catch(function (error) {
7011                                acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
7012                                    success: false
7013                                });
7014                                throw error;
7015                            })];
7016                }
7017            });
7018        });
7019    };
7020    /**
7021     * Helper function to create the token request body
7022     * @param request
7023     */
7024    RefreshTokenClient.prototype.createTokenRequestBody = function (request) {
7025        var _a, _b, _c;
7026        return __awaiter(this, void 0, void 0, function () {
7027            var correlationId, acquireTokenMeasurement, parameterBuilder, clientAssertion, popTokenGenerator, reqCnfData, clientInfo;
7028            return __generator(this, function (_d) {
7029                switch (_d.label) {
7030                    case 0:
7031                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
7032                        correlationId = request.correlationId;
7033                        acquireTokenMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(exports.PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
7034                        parameterBuilder = new RequestParameterBuilder();
7035                        parameterBuilder.addClientId(this.config.authOptions.clientId);
7036                        parameterBuilder.addScopes(request.scopes);
7037                        parameterBuilder.addGrantType(GrantType.REFRESH_TOKEN_GRANT);
7038                        parameterBuilder.addClientInfo();
7039                        parameterBuilder.addLibraryInfo(this.config.libraryInfo);
7040                        parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
7041                        parameterBuilder.addThrottling();
7042                        if (this.serverTelemetryManager) {
7043                            parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
7044                        }
7045                        parameterBuilder.addCorrelationId(correlationId);
7046                        parameterBuilder.addRefreshToken(request.refreshToken);
7047                        if (this.config.clientCredentials.clientSecret) {
7048                            parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
7049                        }
7050                        if (this.config.clientCredentials.clientAssertion) {
7051                            clientAssertion = this.config.clientCredentials.clientAssertion;
7052                            parameterBuilder.addClientAssertion(clientAssertion.assertion);
7053                            parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
7054                        }
7055                        if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
7056                        popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
7057                        (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
7058                        return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
7059                    case 1:
7060                        reqCnfData = _d.sent();
7061                        // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
7062                        parameterBuilder.addPopToken(reqCnfData.reqCnfString);
7063                        return [3 /*break*/, 3];
7064                    case 2:
7065                        if (request.authenticationScheme === exports.AuthenticationScheme.SSH) {
7066                            if (request.sshJwk) {
7067                                parameterBuilder.addSshJwk(request.sshJwk);
7068                            }
7069                            else {
7070                                acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
7071                                    success: false
7072                                });
7073                                throw ClientConfigurationError.createMissingSshJwkError();
7074                            }
7075                        }
7076                        _d.label = 3;
7077                    case 3:
7078                        if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
7079                            parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
7080                        }
7081                        if (this.config.systemOptions.preventCorsPreflight && request.ccsCredential) {
7082                            switch (request.ccsCredential.type) {
7083                                case CcsCredentialType.HOME_ACCOUNT_ID:
7084                                    try {
7085                                        clientInfo = buildClientInfoFromHomeAccountId(request.ccsCredential.credential);
7086                                        parameterBuilder.addCcsOid(clientInfo);
7087                                    }
7088                                    catch (e) {
7089                                        this.logger.verbose("Could not parse home account ID for CCS Header: " + e);
7090                                    }
7091                                    break;
7092                                case CcsCredentialType.UPN:
7093                                    parameterBuilder.addCcsUpn(request.ccsCredential.credential);
7094                                    break;
7095                            }
7096                        }
7097                        acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
7098                            success: true
7099                        });
7100                        return [2 /*return*/, parameterBuilder.createQueryString()];
7101                }
7102            });
7103        });
7104    };
7105    return RefreshTokenClient;
7106}(BaseClient));
7107
7108/*! @azure/msal-common v13.3.3 2024-06-06 */
7109
7110/*
7111 * Copyright (c) Microsoft Corporation. All rights reserved.
7112 * Licensed under the MIT License.
7113 */
7114var SilentFlowClient = /** @class */ (function (_super) {
7115    __extends(SilentFlowClient, _super);
7116    function SilentFlowClient(configuration, performanceClient) {
7117        return _super.call(this, configuration, performanceClient) || this;
7118    }
7119    /**
7120     * Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
7121     * the given token and returns the renewed token
7122     * @param request
7123     */
7124    SilentFlowClient.prototype.acquireToken = function (request) {
7125        return __awaiter(this, void 0, void 0, function () {
7126            var e_1, refreshTokenClient;
7127            return __generator(this, function (_a) {
7128                switch (_a.label) {
7129                    case 0:
7130                        _a.trys.push([0, 2, , 3]);
7131                        return [4 /*yield*/, this.acquireCachedToken(request)];
7132                    case 1: return [2 /*return*/, _a.sent()];
7133                    case 2:
7134                        e_1 = _a.sent();
7135                        if (e_1 instanceof ClientAuthError && e_1.errorCode === ClientAuthErrorMessage.tokenRefreshRequired.code) {
7136                            refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
7137                            return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(request)];
7138                        }
7139                        else {
7140                            throw e_1;
7141                        }
7142                    case 3: return [2 /*return*/];
7143                }
7144            });
7145        });
7146    };
7147    /**
7148     * Retrieves token from cache or throws an error if it must be refreshed.
7149     * @param request
7150     */
7151    SilentFlowClient.prototype.acquireCachedToken = function (request) {
7152        var _a, _b, _c, _d, _e;
7153        return __awaiter(this, void 0, void 0, function () {
7154            var environment, cacheRecord;
7155            return __generator(this, function (_f) {
7156                switch (_f.label) {
7157                    case 0:
7158                        // Cannot renew token if no request object is given.
7159                        if (!request) {
7160                            throw ClientConfigurationError.createEmptyTokenRequestError();
7161                        }
7162                        if (request.forceRefresh) {
7163                            // Must refresh due to present force_refresh flag.
7164                            (_a = this.serverTelemetryManager) === null || _a === void 0 ? void 0 : _a.setCacheOutcome(CacheOutcome.FORCE_REFRESH);
7165                            this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.");
7166                            throw ClientAuthError.createRefreshRequiredError();
7167                        }
7168                        else if (!this.config.cacheOptions.claimsBasedCachingEnabled && !StringUtils.isEmptyObj(request.claims)) {
7169                            // Must refresh due to presence of claims in request preventing cache lookup
7170                            (_b = this.serverTelemetryManager) === null || _b === void 0 ? void 0 : _b.setCacheOutcome(CacheOutcome.CLAIMS_REQUESTED_CACHE_SKIPPED);
7171                            this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because claims-based caching is disabled and claims were requested.");
7172                            throw ClientAuthError.createRefreshRequiredError();
7173                        }
7174                        // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
7175                        if (!request.account) {
7176                            throw ClientAuthError.createNoAccountInSilentRequestError();
7177                        }
7178                        environment = request.authority || this.authority.getPreferredCache();
7179                        cacheRecord = this.cacheManager.readCacheRecord(request.account, request, environment);
7180                        if (!cacheRecord.accessToken) {
7181                            // Must refresh due to non-existent access_token.
7182                            (_c = this.serverTelemetryManager) === null || _c === void 0 ? void 0 : _c.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);
7183                            this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.");
7184                            throw ClientAuthError.createRefreshRequiredError();
7185                        }
7186                        else if (TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||
7187                            TimeUtils.isTokenExpired(cacheRecord.accessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {
7188                            // Must refresh due to expired access_token.
7189                            (_d = this.serverTelemetryManager) === null || _d === void 0 ? void 0 : _d.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);
7190                            this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within " + this.config.systemOptions.tokenRenewalOffsetSeconds + " seconds.");
7191                            throw ClientAuthError.createRefreshRequiredError();
7192                        }
7193                        else if (cacheRecord.accessToken.refreshOn && TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)) {
7194                            // Must refresh due to the refresh_in value.
7195                            (_e = this.serverTelemetryManager) === null || _e === void 0 ? void 0 : _e.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);
7196                            this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'.");
7197                            throw ClientAuthError.createRefreshRequiredError();
7198                        }
7199                        if (this.config.serverTelemetryManager) {
7200                            this.config.serverTelemetryManager.incrementCacheHits();
7201                        }
7202                        return [4 /*yield*/, this.generateResultFromCacheRecord(cacheRecord, request)];
7203                    case 1: return [2 /*return*/, _f.sent()];
7204                }
7205            });
7206        });
7207    };
7208    /**
7209     * Helper function to build response object from the CacheRecord
7210     * @param cacheRecord
7211     */
7212    SilentFlowClient.prototype.generateResultFromCacheRecord = function (cacheRecord, request) {
7213        return __awaiter(this, void 0, void 0, function () {
7214            var idTokenObj, authTime;
7215            return __generator(this, function (_a) {
7216                switch (_a.label) {
7217                    case 0:
7218                        if (cacheRecord.idToken) {
7219                            idTokenObj = new AuthToken(cacheRecord.idToken.secret, this.config.cryptoInterface);
7220                        }
7221                        // token max_age check
7222                        if (request.maxAge || (request.maxAge === 0)) {
7223                            authTime = idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.auth_time;
7224                            if (!authTime) {
7225                                throw ClientAuthError.createAuthTimeNotFoundError();
7226                            }
7227                            AuthToken.checkMaxAge(authTime, request.maxAge);
7228                        }
7229                        return [4 /*yield*/, ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, c
7229acheRecord, true, request, idTokenObj)];
7230                    case 1: return [2 /*return*/, _a.sent()];
7231                }
7232            });
7233        });
7234    };
7235    return SilentFlowClient;
7236}(BaseClient));
7237
7238/*! @azure/msal-common v13.3.3 2024-06-06 */
7239/*
7240 * Copyright (c) Microsoft Corporation. All rights reserved.
7241 * Licensed under the MIT License.
7242 */
7243function isOpenIdConfigResponse(response) {
7244    return (response.hasOwnProperty("authorization_endpoint") &&
7245        response.hasOwnProperty("token_endpoint") &&
7246        response.hasOwnProperty("issuer") &&
7247        response.hasOwnProperty("jwks_uri"));
7248}
7249
7250/*! @azure/msal-common v13.3.3 2024-06-06 */
7251/*
7252 * Copyright (c) Microsoft Corporation. All rights reserved.
7253 * Licensed under the MIT License.
7254 */
vendor: 24,938 bytes, line 7255
7255var rawMetdataJSON = { "endpointMetadata": { "https://login.microsoftonline.com/common/": { "token_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/common/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.com/common/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net" }, "https://login.chinacloudapi.cn/common/": { "token_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.chinacloudapi.cn/common/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.partner.microsoftonline.cn/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo", "authorization_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.chinacloudapi.cn/common/kerberos", "tenant_region_scope": null, "cloud_instance_name": "partner.microsoftonline.cn", "cloud_graph_host_name": "graph.chinacloudapi.cn", "msgraph_host": "microsoftgraph.chinacloudapi.cn", "rbac_url": "https://pas.chinacloudapi.cn" }, "https://login.microsoftonline.us/common/": { "token_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.us/common/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.us/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.us/common/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.us", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pasff.usgovcloudapi.net" }, "https://login.microsoftonline.com/consumers/": { "token_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/consumers/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.com/consumers/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net" }, "https://login.chinacloudapi.cn/consumers/": { "token_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo", "authorization_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.chinacloudapi.cn/consumers/kerberos", "tenant_region_scope": null, "cloud_instance_name": "partner.microsoftonline.cn", "cloud_graph_host_name": "graph.chinacloudapi.cn", "msgraph_host": "microsoftgraph.chinacloudapi.cn", "rbac_url": "https://pas.chinacloudapi.cn" }, "https://login.microsoftonline.us/consumers/": { "token_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.us/consumers/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.us/consumers/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.us", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pasff.usgovcloudapi.net" }, "https://login.microsoftonline.com/organizations/": { "token_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/organizations/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.com/organizations/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net" }, "https://login.chinacloudapi.cn/organizations/": { "token_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.partner.microsoftonline.cn/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo", "authorization_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.chinacloudapi.cn/organizations/kerberos", "tenant_region_scope": null, "cloud_instance_name": "partner.microsoftonline.cn", "cloud_graph_host_name": "graph.chinacloudapi.cn", "msgraph_host": "microsoftgraph.chinacloudapi.cn", "rbac_url": "https://pas.chinacloudapi.cn" }, "https://login.microsoftonline.us/organizations/": { "token_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.us/organizations/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.us/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.us/organizations/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.us", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pasff.usgovcloudapi.net" } }, "instanceDiscoveryMetadata": { "https://login.microsoftonline.com/common/": { "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.chinacloudapi.cn/common/": { "tenant_discovery_endpoint": "https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.us/common/": { "tenant_discovery_endpoint": "https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.com/consumers/": { "tenant_discovery_endpoint": "https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.chinacloudapi.cn/consumers/": { "tenant_discovery_endpoint": "https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.us/consumers/": { "tenant_discovery_endpoint": "https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.com/organizations/": { "tenant_discovery_endpoint": "https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.chinacloudapi.cn/organizations/": { "tenant_discovery_endpoint": "https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.us/organizations/": { "tenant_discovery_endpoint": "https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] } } };
vendor: 59,554 bytes, lines 7256-8427
7256var EndpointMetadata = rawMetdataJSON.endpointMetadata;
7257var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
7258
7259/*! @azure/msal-common v13.3.3 2024-06-06 */
7260
7261/*
7262 * Copyright (c) Microsoft Corporation. All rights reserved.
7263 * Licensed under the MIT License.
7264 */
7265var AuthorityMetadataEntity = /** @class */ (function () {
7266    function AuthorityMetadataEntity() {
7267        this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
7268    }
7269    /**
7270     * Update the entity with new aliases, preferred_cache and preferred_network values
7271     * @param metadata
7272     * @param fromNetwork
7273     */
7274    AuthorityMetadataEntity.prototype.updateCloudDiscoveryMetadata = function (metadata, fromNetwork) {
7275        this.aliases = metadata.aliases;
7276        this.preferred_cache = metadata.preferred_cache;
7277        this.preferred_network = metadata.preferred_network;
7278        this.aliasesFromNetwork = fromNetwork;
7279    };
7280    /**
7281     * Update the entity with new endpoints
7282     * @param metadata
7283     * @param fromNetwork
7284     */
7285    AuthorityMetadataEntity.prototype.updateEndpointMetadata = function (metadata, fromNetwork) {
7286        this.authorization_endpoint = metadata.authorization_endpoint;
7287        this.token_endpoint = metadata.token_endpoint;
7288        this.end_session_endpoint = metadata.end_session_endpoint;
7289        this.issuer = metadata.issuer;
7290        this.endpointsFromNetwork = fromNetwork;
7291        this.jwks_uri = metadata.jwks_uri;
7292    };
7293    /**
7294     * Save the authority that was used to create this cache entry
7295     * @param authority
7296     */
7297    AuthorityMetadataEntity.prototype.updateCanonicalAuthority = function (authority) {
7298        this.canonical_authority = authority;
7299    };
7300    /**
7301     * Reset the exiresAt value
7302     */
7303    AuthorityMetadataEntity.prototype.resetExpiresAt = function () {
7304        this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
7305    };
7306    /**
7307     * Returns whether or not the data needs to be refreshed
7308     */
7309    AuthorityMetadataEntity.prototype.isExpired = function () {
7310        return this.expiresAt <= TimeUtils.nowSeconds();
7311    };
7312    /**
7313     * Validates an entity: checks for all expected params
7314     * @param entity
7315     */
7316    AuthorityMetadataEntity.isAuthorityMetadataEntity = function (key, entity) {
7317        if (!entity) {
7318            return false;
7319        }
7320        return (key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&
7321            entity.hasOwnProperty("aliases") &&
7322            entity.hasOwnProperty("preferred_cache") &&
7323            entity.hasOwnProperty("preferred_network") &&
7324            entity.hasOwnProperty("canonical_authority") &&
7325            entity.hasOwnProperty("authorization_endpoint") &&
7326            entity.hasOwnProperty("token_endpoint") &&
7327            entity.hasOwnProperty("issuer") &&
7328            entity.hasOwnProperty("aliasesFromNetwork") &&
7329            entity.hasOwnProperty("endpointsFromNetwork") &&
7330            entity.hasOwnProperty("expiresAt") &&
7331            entity.hasOwnProperty("jwks_uri"));
7332    };
7333    return AuthorityMetadataEntity;
7334}());
7335
7336/*! @azure/msal-common v13.3.3 2024-06-06 */
7337/*
7338 * Copyright (c) Microsoft Corporation. All rights reserved.
7339 * Licensed under the MIT License.
7340 */
7341function isCloudInstanceDiscoveryResponse(response) {
7342    return (response.hasOwnProperty("tenant_discovery_endpoint") &&
7343        response.hasOwnProperty("metadata"));
7344}
7345
7346/*! @azure/msal-common v13.3.3 2024-06-06 */
7347/*
7348 * Copyright (c) Microsoft Corporation. All rights reserved.
7349 * Licensed under the MIT License.
7350 */
7351function isCloudInstanceDiscoveryErrorResponse(response) {
7352    return (response.hasOwnProperty("error") &&
7353        response.hasOwnProperty("error_description"));
7354}
7355
7356/*! @azure/msal-common v13.3.3 2024-06-06 */
7357
7358/*
7359 * Copyright (c) Microsoft Corporation. All rights reserved.
7360 * Licensed under the MIT License.
7361 */
7362var RegionDiscovery = /** @class */ (function () {
7363    function RegionDiscovery(networkInterface, performanceClient, correlationId) {
7364        this.networkInterface = networkInterface;
7365        this.performanceClient = performanceClient;
7366        this.correlationId = correlationId;
7367    }
7368    /**
7369     * Detect the region from the application's environment.
7370     *
7371     * @returns Promise<string | null>
7372     */
7373    RegionDiscovery.prototype.detectRegion = function (environmentRegion, regionDiscoveryMetadata) {
7374        var _a, _b, _c, _d;
7375        return __awaiter(this, void 0, void 0, function () {
7376            var autodetectedRegionName, options, localIMDSVersionResponse, currentIMDSVersion, currentIMDSVersionResponse;
7377            return __generator(this, function (_e) {
7378                switch (_e.label) {
7379                    case 0:
7380                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7381                        autodetectedRegionName = environmentRegion;
7382                        if (!!autodetectedRegionName) return [3 /*break*/, 8];
7383                        options = RegionDiscovery.IMDS_OPTIONS;
7384                        _e.label = 1;
7385                    case 1:
7386                        _e.trys.push([1, 6, , 7]);
7387                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7388                        return [4 /*yield*/, this.getRegionFromIMDS(Constants.IMDS_VERSION, options)];
7389                    case 2:
7390                        localIMDSVersionResponse = _e.sent();
7391                        if (localIMDSVersionResponse.status === ResponseCodes.httpSuccess) {
7392                            autodetectedRegionName = localIMDSVersionResponse.body;
7393                            regionDiscoveryMetadata.region_source = RegionDiscoverySources.IMDS;
7394                        }
7395                        if (!(localIMDSVersionResponse.status === ResponseCodes.httpBadRequest)) return [3 /*break*/, 5];
7396                        (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7397                        return [4 /*yield*/, this.getCurrentVersion(options)];
7398                    case 3:
7399                        currentIMDSVersion = _e.sent();
7400                        if (!currentIMDSVersion) {
7401                            regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;
7402                            return [2 /*return*/, null];
7403                        }
7404                        (_d = this.performanceClient) === null || _d === void 0 ? void 0 : _d.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7405                        return [4 /*yield*/, this.getRegionFromIMDS(currentIMDSVersion, options)];
7406                    case 4:
7407                        currentIMDSVersionResponse = _e.sent();
7408                        if (currentIMDSVersionResponse.status === ResponseCodes.httpSuccess) {
7409                            autodetectedRegionName = currentIMDSVersionResponse.body;
7410                            regionDiscoveryMetadata.region_source = RegionDiscoverySources.IMDS;
7411                        }
7412                        _e.label = 5;
7413                    case 5: return [3 /*break*/, 7];
7414                    case 6:
7415                        _e.sent();
7416                        regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;
7417                        return [2 /*return*/, null];
7418                    case 7: return [3 /*break*/, 9];
7419                    case 8:
7420                        regionDiscoveryMetadata.region_source = RegionDiscoverySources.ENVIRONMENT_VARIABLE;
7421                        _e.label = 9;
7422                    case 9:
7423                        // If no region was auto detected from the environment or from the IMDS endpoint, mark the attempt as a FAILED_AUTO_DETECTION
7424                        if (!autodetectedRegionName) {
7425                            regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;
7426                        }
7427                        return [2 /*return*/, autodetectedRegionName || null];
7428                }
7429            });
7430        });
7431    };
7432    /**
7433     * Make the call to the IMDS endpoint
7434     *
7435     * @param imdsEndpointUrl
7436     * @returns Promise<NetworkResponse<string>>
7437     */
7438    RegionDiscovery.prototype.getRegionFromIMDS = function (version, options) {
7439        var _a;
7440        return __awaiter(this, void 0, void 0, function () {
7441            return __generator(this, function (_b) {
7442                (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7443                return [2 /*return*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + "?api-version=" + version + "&format=text", options, Constants.IMDS_TIMEOUT)];
7444            });
7445        });
7446    };
7447    /**
7448     * Get the most recent version of the IMDS endpoint available
7449     *
7450     * @returns Promise<string | null>
7451     */
7452    RegionDiscovery.prototype.getCurrentVersion = function (options) {
7453        var _a;
7454        return __awaiter(this, void 0, void 0, function () {
7455            var response;
7456            return __generator(this, function (_b) {
7457                switch (_b.label) {
7458                    case 0:
7459                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7460                        _b.label = 1;
7461                    case 1:
7462                        _b.trys.push([1, 3, , 4]);
7463                        return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + "?format=json", options)];
7464                    case 2:
7465                        response = _b.sent();
7466                        // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.
7467                        if (response.status === ResponseCodes.httpBadRequest && response.body && response.body["newest-versions"] && response.body["newest-versions"].length > 0) {
7468                            return [2 /*return*/, response.body["newest-versions"][0]];
7469                        }
7470                        return [2 /*return*/, null];
7471                    case 3:
7472                        _b.sent();
7473                        return [2 /*return*/, null];
7474                    case 4: return [2 /*return*/];
7475                }
7476            });
7477        });
7478    };
7479    // Options for the IMDS endpoint request
7480    RegionDiscovery.IMDS_OPTIONS = {
7481        headers: {
7482            Metadata: "true",
7483        },
7484    };
7485    return RegionDiscovery;
7486}());
7487
7488/*! @azure/msal-common v13.3.3 2024-06-06 */
7489
7490/*
7491 * Copyright (c) Microsoft Corporation. All rights reserved.
7492 * Licensed under the MIT License.
7493 */
7494/**
7495 * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
7496 * endpoint. It will store the pertinent config data in this object for use during token calls.
7497 */
7498var Authority = /** @class */ (function () {
7499    function Authority(authority, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
7500        this.canonicalAuthority = authority;
7501        this._canonicalAuthority.validateAsUri();
7502        this.networkInterface = networkInterface;
7503        this.cacheManager = cacheManager;
7504        this.authorityOptions = authorityOptions;
7505        this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };
7506        this.logger = logger;
7507        this.performanceClient = performanceClient;
7508        this.correlationId = correlationId;
7509        this.regionDiscovery = new RegionDiscovery(networkInterface, this.performanceClient, this.correlationId);
7510    }
7511    /**
7512     * Get {@link AuthorityType}
7513     * @param authorityUri {@link IUri}
7514     * @private
7515     */
7516    Authority.prototype.getAuthorityType = function (authorityUri) {
7517        // CIAM auth url pattern is being standardized as: <tenant>.ciamlogin.com
7518        if (authorityUri.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {
7519            return AuthorityType.Ciam;
7520        }
7521        var pathSegments = authorityUri.PathSegments;
7522        if (pathSegments.length) {
7523            switch (pathSegments[0].toLowerCase()) {
7524                case Constants.ADFS:
7525                    return AuthorityType.Adfs;
7526                case Constants.DSTS:
7527                    return AuthorityType.Dsts;
7528            }
7529        }
7530        return AuthorityType.Default;
7531    };
7532    Object.defineProperty(Authority.prototype, "authorityType", {
7533        // See above for AuthorityType
7534        get: function () {
7535            return this.getAuthorityType(this.canonicalAuthorityUrlComponents);
7536        },
7537        enumerable: false,
7538        configurable: true
7539    });
7540    Object.defineProperty(Authority.prototype, "protocolMode", {
7541        /**
7542         * ProtocolMode enum representing the way endpoints are constructed.
7543         */
7544        get: function () {
7545            return this.authorityOptions.protocolMode;
7546        },
7547        enumerable: false,
7548        configurable: true
7549    });
7550    Object.defineProperty(Authority.prototype, "options", {
7551        /**
7552         * Returns authorityOptions which can be used to reinstantiate a new authority instance
7553         */
7554        get: function () {
7555            return this.authorityOptions;
7556        },
7557        enumerable: false,
7558        configurable: true
7559    });
7560    Object.defineProperty(Authority.prototype, "canonicalAuthority", {
7561        /**
7562         * A URL that is the authority set by the developer
7563         */
7564        get: function () {
7565            return this._canonicalAuthority.urlString;
7566        },
7567        /**
7568         * Sets canonical authority.
7569         */
7570        set: function (url) {
7571            this._canonicalAuthority = new UrlString(url);
7572            this._canonicalAuthority.validateAsUri();
7573            this._canonicalAuthorityUrlComponents = null;
7574        },
7575        enumerable: false,
7576        configurable: true
7577    });
7578    Object.defineProperty(Authority.prototype, "canonicalAuthorityUrlComponents", {
7579        /**
7580         * Get authority components.
7581         */
7582        get: function () {
7583            if (!this._canonicalAuthorityUrlComponents) {
7584                this._canonicalAuthorityUrlComponents = this._canonicalAuthority.getUrlComponents();
7585            }
7586            return this._canonicalAuthorityUrlComponents;
7587        },
7588        enumerable: false,
7589        configurable: true
7590    });
7591    Object.defineProperty(Authority.prototype, "hostnameAndPort", {
7592        /**
7593         * Get hostname and port i.e. login.microsoftonline.com
7594         */
7595        get: function () {
7596            return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase();
7597        },
7598        enumerable: false,
7599        configurable: true
7600    });
7601    Object.defineProperty(Authority.prototype, "tenant", {
7602        /**
7603         * Get tenant for authority.
7604         */
7605        get: function () {
7606            return this.canonicalAuthorityUrlComponents.PathSegments[0];
7607        },
7608        enumerable: false,
7609        configurable: true
7610    });
7611    Object.defineProperty(Authority.prototype, "authorizationEndpoint", {
7612        /**
7613         * OAuth /authorize endpoint for requests
7614         */
7615        get: function () {
7616            if (this.discoveryComplete()) {
7617                return this.replacePath(this.metadata.authorization_endpoint);
7618            }
7619            else {
7620                throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
7621            }
7622        },
7623        enumerable: false,
7624        configurable: true
7625    });
7626    Object.defineProperty(Authority.prototype, "tokenEndpoint", {
7627        /**
7628         * OAuth /token endpoint for requests
7629         */
7630        get: function () {
7631            if (this.discoveryComplete()) {
7632                return this.replacePath(this.metadata.token_endpoint);
7633            }
7634            else {
7635                throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
7636            }
7637        },
7638        enumerable: false,
7639        configurable: true
7640    });
7641    Object.defineProperty(Authority.prototype, "deviceCodeEndpoint", {
7642        get: function () {
7643            if (this.discoveryComplete()) {
7644                return this.replacePath(this.metadata.token_endpoint.replace("/token", "/devicecode"));
7645            }
7646            else {
7647                throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
7648            }
7649        },
7650        enumerable: false,
7651        configurable: true
7652    });
7653    Object.defineProperty(Authority.prototype, "endSessionEndpoint", {
7654        /**
7655         * OAuth logout endpoint for requests
7656         */
7657        get: function () {
7658            if (this.discoveryComplete()) {
7659                // ROPC policies may not have end_session_endpoint set
7660                if (!this.metadata.end_session_endpoint) {
7661                    throw ClientAuthError.createLogoutNotSupportedError();
7662                }
7663                return this.replacePath(this.metadata.end_session_endpoint);
7664            }
7665            else {
7666                throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
7667            }
7668        },
7669        enumerable: false,
7670        configurable: true
7671    });
7672    Object.defineProperty(Authority.prototype, "selfSignedJwtAudience", {
7673        /**
7674         * OAuth issuer for requests
7675         */
7676        get: function () {
7677            if (this.discoveryComplete()) {
7678                return this.replacePath(this.metadata.issuer);
7679            }
7680            else {
7681                throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
7682            }
7683        },
7684        enumerable: false,
7685        configurable: true
7686    });
7687    Object.defineProperty(Authority.prototype, "jwksUri", {
7688        /**
7689         * Jwks_uri for token signing keys
7690         */
7691        get: function () {
7692            if (this.discoveryComplete()) {
7693                return this.replacePath(this.metadata.jwks_uri);
7694            }
7695            else {
7696                throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
7697            }
7698        },
7699        enumerable: false,
7700        configurable: true
7701    });
7702    /**
7703     * Returns a flag indicating that tenant name can be replaced in authority {@link IUri}
7704     * @param authorityUri {@link IUri}
7705     * @private
7706     */
7707    Authority.prototype.canReplaceTenant = function (authorityUri) {
7708        return authorityUri.PathSegments.length === 1
7709            && !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0])
7710            && this.getAuthorityType(authorityUri) === AuthorityType.Default
7711            && this.protocolMode === exports.ProtocolMode.AAD;
7712    };
7713    /**
7714     * Replaces tenant in url path with current tenant. Defaults to common.
7715     * @param urlString
7716     */
7717    Authority.prototype.replaceTenant = function (urlString) {
7718        return urlString.replace(/{tenant}|{tenantid}/g, this.tenant);
7719    };
7720    /**
7721     * Replaces path such as tenant or policy with the current tenant or policy.
7722     * @param urlString
7723     */
7724    Authority.prototype.replacePath = function (urlString) {
7725        var _this = this;
7726        var endpoint = urlString;
7727        var cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);
7728        var cachedAuthorityUrlComponents = cachedAuthorityUrl.getUrlComponents();
7729        var cachedAuthorityParts = cachedAuthorityUrlComponents.PathSegments;
7730        var currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;
7731        currentAuthorityParts.forEach(function (currentPart, index) {
7732            var cachedPart = cachedAuthorityParts[index];
7733            if (index === 0 && _this.canReplaceTenant(cachedAuthorityUrlComponents)) {
7734                var tenantId = (new UrlString(_this.metadata.authorization_endpoint)).getUrlComponents().PathSegments[0];
7735                /**
7736                 * Check if AAD canonical authority contains tenant domain name, for example "testdomain.onmicrosoft.com",
7737                 * by comparing its first path segment to the corresponding authorization endpoint path segment, which is
7738                 * always resolved with tenant id by OIDC.
7739                 */
7740                if (cachedPart !== tenantId) {
7741                    _this.logger.verbose("Replacing tenant domain name " + cachedPart + " with id " + tenantId);
7742                    cachedPart = tenantId;
7743                }
7744            }
7745            if (currentPart !== cachedPart) {
7746                endpoint = endpoint.replace("/" + cachedPart + "/", "/" + currentPart + "/");
7747            }
7748        });
7749        return this.replaceTenant(endpoint);
7750    };
7751    Object.defineProperty(Authority.prototype, "defaultOpenIdConfigurationEndpoint", {
7752        /**
7753         * The default open id configuration endpoint for any canonical authority.
7754         */
7755        get: function () {
7756            if (this.authorityType === AuthorityType.Adfs ||
7757                this.authorityType === AuthorityType.Dsts ||
7758                this.protocolMode === exports.ProtocolMode.OIDC) {
7759                return this.canonicalAuthority + ".well-known/openid-configuration";
7760            }
7761            return this.canonicalAuthority + "v2.0/.well-known/openid-configuration";
7762        },
7763        enumerable: false,
7764        configurable: true
7765    });
7766    /**
7767     * Boolean that returns whethr or not tenant discovery has been completed.
7768     */
7769    Authority.prototype.discoveryComplete = function () {
7770        return !!this.metadata;
7771    };
7772    /**
7773     * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network
7774     * and the /authorize, /token and logout endpoints.
7775     */
7776    Authority.prototype.resolveEndpointsAsync = function () {
7777        var _a, _b, _c;
7778        return __awaiter(this, void 0, void 0, function () {
7779            var metadataEntity, cloudDiscoverySource, endpointSource, cacheKey;
7780            return __generator(this, function (_d) {
7781                switch (_d.label) {
7782                    case 0:
7783                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);
7784                        metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);
7785                        if (!metadataEntity) {
7786                            metadataEntity = new AuthorityMetadataEntity();
7787                            metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
7788                        }
7789                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7790                        return [4 /*yield*/, this.updateCloudDiscoveryMetadata(metadataEntity)];
7791                    case 1:
7792                        cloudDiscoverySource = _d.sent();
7793                        this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);
7794                        (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7795                        return [4 /*yield*/, this.updateEndpointMetadata(metadataEntity)];
7796                    case 2:
7797                        endpointSource = _d.sent();
7798                        if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE && endpointSource !== AuthorityMetadataSource.CACHE) {
7799                            // Reset the expiration time unless both values came from a successful cache lookup
7800                            metadataEntity.resetExpiresAt();
7801                            metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
7802                        }
7803                        cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache);
7804                        this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);
7805                        this.metadata = metadataEntity;
7806                        return [2 /*return*/];
7807                }
7808            });
7809        });
7810    };
7811    /**
7812     * Update AuthorityMetadataEntity with new endpoints and return where the information came from
7813     * @param metadataEntity
7814     */
7815    Authority.prototype.updateEndpointMetadata = function (metadataEntity) {
7816        var _a, _b, _c, _d, _e, _f;
7817        return __awaiter(this, void 0, void 0, function () {
7818            var metadata, harcodedMetadata;
7819            return __generator(this, function (_g) {
7820                switch (_g.label) {
7821                    case 0:
7822                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7823                        metadata = this.getEndpointMetadataFromConfig();
7824                        if (metadata) {
7825                            metadataEntity.updateEndpointMetadata(metadata, false);
7826                            return [2 /*return*/, AuthorityMetadataSource.CONFIG];
7827                        }
7828                        if (this.isAuthoritySameType(metadataEntity) && metadataEntity.endpointsFromNetwork && !metadataEntity.isExpired()) {
7829                            // No need to update
7830                            return [2 /*return*/, AuthorityMetadataSource.CACHE];
7831                        }
7832                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7833                        return [4 /*yield*/, this.getEndpointMetadataFromNetwork()];
7834                    case 1:
7835                        metadata = _g.sent();
7836                        if (!metadata) return [3 /*break*/, 4];
7837                        if (!((_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.azureRegion)) return [3 /*break*/, 3];
7838                        (_d = this.performanceClient) === null || _d === void 0 ? void 0 : _d.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7839                        return [4 /*yield*/, this.updateMetadataWithRegionalInformation(metadata)];
7840                    case 2:
7841                        metadata = _g.sent();
7842                        _g.label = 3;
7843                    case 3:
7844                        metadataEntity.updateEndpointMetadata(metadata, true);
7845                        return [2 /*return*/, AuthorityMetadataSource.NETWORK];
7846                    case 4:
7847                        harcodedMetadata = this.getEndpointMetadataFromHardcodedValues();
7848                        if (!(harcodedMetadata && !this.authorityOptions.skipAuthorityMetadataCache)) return [3 /*break*/, 7];
7849                        if (!((_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion)) return [3 /*break*/, 6];
7850                        (_f = this.performanceClient) === null || _f === void 0 ? void 0 : _f.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7851                        return [4 /*yield*/, this.updateMetadataWithRegionalInformation(harcodedMetadata)];
7852                    case 5:
7853                        harcodedMetadata = _g.sent();
7854                        _g.label = 6;
7855                    case 6:
7856                        metadataEntity.updateEndpointMetadata(harcodedMetadata, false);
7857                        return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];
7858                    case 7: throw ClientAuthError.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint);
7859                }
7860            });
7861        });
7862    };
7863    /**
7864     * Compares the number of url components after the domain to determine if the cached
7865     * authority metadata can be used for the requested authority. Protects against same domain different
7866     * authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy
7867     * @param metadataEntity
7868     */
7869    Authority.prototype.isAuthoritySameType = function (metadataEntity) {
7870        var cachedAuthorityUrl = new UrlString(metadataEntity.canonical_authority);
7871        var cachedParts = cachedAuthorityUrl.getUrlComponents().PathSegments;
7872        return cachedParts.length === this.canonicalAuthorityUrlComponents.PathSegments.length;
7873    };
7874    /**
7875     * Parse authorityMetadata config option
7876     */
7877    Authority.prototype.getEndpointMetadataFromConfig = function () {
7878        if (this.authorityOptions.authorityMetadata) {
7879            try {
7880                return JSON.parse(this.authorityOptions.authorityMetadata);
7881            }
7882            catch (e) {
7883                throw ClientConfigurationError.createInvalidAuthorityMetadataError();
7884            }
7885        }
7886        return null;
7887    };
7888    /**
7889     * Gets OAuth endpoints from the given OpenID configuration endpoint.
7890     *
7891     * @param hasHardcodedMetadata boolean
7892     */
7893    Authority.prototype.getEndpointMetadataFromNetwork = function () {
7894        var _a;
7895        return __awaiter(this, void 0, void 0, function () {
7896            var options, response;
7897            return __generator(this, function (_b) {
7898                switch (_b.label) {
7899                    case 0:
7900                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7901                        options = {};
7902                        _b.label = 1;
7903                    case 1:
7904                        _b.trys.push([1, 3, , 4]);
7905                        return [4 /*yield*/, this.networkInterface.
7906                                sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options)];
7907                    case 2:
7908                        response = _b.sent();
7909                        return [2 /*return*/, isOpenIdConfigResponse(response.body) ? response.body : null];
7910                    case 3:
7911                        _b.sent();
7912                        return [2 /*return*/, null];
7913                    case 4: return [2 /*return*/];
7914                }
7915            });
7916        });
7917    };
7918    /**
7919     * Get OAuth endpoints for common authorities.
7920     */
7921    Authority.prototype.getEndpointMetadataFromHardcodedValues = function () {
7922        if (this.canonicalAuthority in EndpointMetadata) {
7923            return EndpointMetadata[this.canonicalAuthority];
7924        }
7925        return null;
7926    };
7927    /**
7928     * Update the retrieved metadata with regional information.
7929     * User selected Azure region will be used if configured.
7930     */
7931    Authority.prototype.updateMetadataWithRegionalInformation = function (metadata) {
7932        var _a, _b, _c, _d;
7933        return __awaiter(this, void 0, void 0, function () {
7934            var userConfiguredAzureRegion, autodetectedRegionName;
7935            return __generator(this, function (_e) {
7936                switch (_e.label) {
7937                    case 0:
7938                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7939                        userConfiguredAzureRegion = (_b = this.authorityOptions.azureRegionConfiguration) === null || _b === void 0 ? void 0 : _b.azureRegion;
7940                        if (!userConfiguredAzureRegion) return [3 /*break*/, 2];
7941                        if (userConfiguredAzureRegion !== Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
7942                            this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
7943                            this.regionDiscoveryMetadata.region_used = userConfiguredAzureRegion;
7944                            return [2 /*return*/, Authority.replaceWithRegionalInformation(metadata, userConfiguredAzureRegion)];
7945                        }
7946                        (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7947                        return [4 /*yield*/, this.regionDiscovery.detectRegion((_d = this.authorityOptions.azureRegionConfiguration) === null || _d === void 0 ? void 0 : _d.environmentRegion, this.regionDiscoveryMetadata)];
7948                    case 1:
7949                        autodetectedRegionName = _e.sent();
7950                        if (autodetectedRegionName) {
7951                            this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL;
7952                            this.regionDiscoveryMetadata.region_used = autodetectedRegionName;
7953                            return [2 /*return*/, Authority.replaceWithRegionalInformation(metadata, autodetectedRegionName)];
7954                        }
7955                        this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
7956                        _e.label = 2;
7957                    case 2: return [2 /*return*/, metadata];
7958                }
7959            });
7960        });
7961    };
7962    /**
7963     * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache
7964     * and returns where the information was retrieved from
7965     * @param metadataEntity
7966     * @returns AuthorityMetadataSource
7967     */
7968    Authority.prototype.updateCloudDiscoveryMetadata = function (metadataEntity) {
7969        var _a, _b;
7970        return __awaiter(this, void 0, void 0, function () {
7971            var metadata, metadataEntityExpired, harcodedMetadata;
7972            return __generator(this, function (_c) {
7973                switch (_c.label) {
7974                    case 0:
7975                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7976                        // attempt to read metadata from the config
7977                        this.logger.verbose("Attempting to get cloud discovery metadata in the config");
7978                        this.logger.verbosePii("Known Authorities: " + (this.authorityOptions.knownAuthorities || Constants.NOT_APPLICABLE));
7979                        this.logger.verbosePii("Authority Metadata: " + (this.authorityOptions.authorityMetadata || Constants.NOT_APPLICABLE));
7980                        this.logger.verbosePii("Canonical Authority: " + (metadataEntity.canonical_authority || Constants.NOT_APPLICABLE));
7981                        metadata = this.getCloudDiscoveryMetadataFromConfig();
7982                        if (metadata) {
7983                            this.logger.verbose("Found cloud discovery metadata in the config.");
7984                            metadataEntity.updateCloudDiscoveryMetadata(metadata, false);
7985                            return [2 /*return*/, AuthorityMetadataSource.CONFIG];
7986                        }
7987                        // If the cached metadata came from config but that config was not passed to this instance, we must go to the network
7988                        this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache.");
7989                        metadataEntityExpired = metadataEntity.isExpired();
7990                        if (this.isAuthoritySameType(metadataEntity) && metadataEntity.aliasesFromNetwork && !metadataEntityExpired) {
7991                            this.logger.verbose("Found metadata in the cache.");
7992                            // No need to update
7993                            return [2 /*return*/, AuthorityMetadataSource.CACHE];
7994                        }
7995                        else if (metadataEntityExpired) {
7996                            this.logger.verbose("The metadata entity is expired.");
7997                        }
7998                        this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network.");
7999                        (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(exports.PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
8000                        return [4 /*yield*/, this.getCloudDiscoveryMetadataFromNetwork()];
8001                    case 1:
8002                        metadata = _c.sent();
8003                        if (metadata) {
8004                            this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()");
8005                            metadataEntity.updateCloudDiscoveryMetadata(metadata, true);
8006                            return [2 /*return*/, AuthorityMetadataSource.NETWORK];
8007                        }
8008                        this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values.");
8009                        harcodedMetadata = this.getCloudDiscoveryMetadataFromHarcodedValues();
8010                        if (harcodedMetadata && !this.options.skipAuthorityMetadataCache) {
8011                            this.logger.verbose("Found cloud discovery metadata from hardcoded values.");
8012                            metadataEntity.updateCloudDiscoveryMetadata(harcodedMetadata, false);
8013                            return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];
8014                        }
8015                        // Metadata could not be obtained from the config, cache, network or hardcoded values
8016                        this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error.");
8017                        throw ClientConfigurationError.createUntrustedAuthorityError();
8018                }
8019            });
8020        });
8021    };
8022    /**
8023     * Parse cloudDiscoveryMetadata config or check knownAuthorities
8024     */
8025    Authority.prototype.getCloudDiscoveryMetadataFromConfig = function () {
8026        // CIAM does not support cloud discovery metadata
8027        if (this.authorityType === AuthorityType.Ciam) {
8028            this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.");
8029            return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
8030        }
8031        // Check if network response was provided in config
8032        if (this.authorityOptions.cloudDiscoveryMetadata) {
8033            this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");
8034            try {
8035                this.logger.verbose("Attempting to parse the cloud discovery metadata.");
8036                var parsedResponse = JSON.parse(this.authorityOptions.cloudDiscoveryMetadata);
8037                var metadata = Authority.getCloudDiscoveryMetadataFromNetworkResponse(parsedResponse.metadata, this.hostnameAndPort);
8038                this.logger.verbose("Parsed the cloud discovery metadata.");
8039                if (metadata) {
8040                    this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.");
8041                    return metadata;
8042                }
8043                else {
8044                    this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.");
8045                }
8046            }
8047            catch (e) {
8048                this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.");
8049                throw ClientConfigurationError.createInvalidCloudDiscoveryMetadataError();
8050            }
8051        }
8052        // If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities
8053        if (this.isInKnownAuthorities()) {
8054            this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.");
8055            return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
8056        }
8057        return null;
8058    };
8059    /**
8060     * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config
8061     *
8062     * @param hasHardcodedMetadata boolean
8063     */
8064    Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
8065        var _a;
8066        return __awaiter(this, void 0, void 0, function () {
8067            var instanceDiscoveryEndpoint, options, match, response, typedResponseBody, metadata, error_1, typedError;
8068            return __generator(this, function (_b) {
8069                switch (_b.label) {
8070                    case 0:
8071                        (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(exports.PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
8072                        instanceDiscoveryEndpoint = "" + Constants.AAD_INSTANCE_DISCOVERY_ENDPT + this.canonicalAuthority + "oauth2/v2.0/authorize";
8073                        options = {};
8074                        match = null;
8075                        _b.label = 1;
8076                    case 1:
8077                        _b.trys.push([1, 3, , 4]);
8078                        return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
8079                    case 2:
8080                        response = _b.sent();
8081                        typedResponseBody = void 0;
8082                        metadata = void 0;
8083                        if (isCloudInstanceDiscoveryResponse(response.body)) {
8084                            typedResponseBody = response.body;
8085                            metadata = typedResponseBody.metadata;
8086                            this.logger.verbosePii("tenant_discovery_endpoint is: " + typedResponseBody.tenant_discovery_endpoint);
8087                        }
8088                        else if (isCloudInstanceDiscoveryErrorResponse(response.body)) {
8089                            this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: " + response.status);
8090                            typedResponseBody = response.body;
8091                            if (typedResponseBody.error === Constants.INVALID_INSTANCE) {
8092                                this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.");
8093                                return [2 /*return*/, null];
8094                            }
8095                            this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is " + typedResponseBody.error);
8096                            this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is " + typedResponseBody.error_description);
8097                            this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []");
8098                            metadata = [];
8099                        }
8100                        else {
8101                            this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse");
8102                            return [2 /*return*/, null];
8103                        }
8104                        this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.");
8105                        match = Authority.getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);
8106                        return [3 /*break*/, 4];
8107                    case 3:
8108                        error_1 = _b.sent();
8109                        if (error_1 instanceof AuthError) {
8110                            this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\nError: " + error_1.errorCode + "\nError Description: " + error_1.errorMessage);
8111                        }
8112                        else {
8113                            typedError = error_1;
8114                            this.logger.error("A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: " + typedError.name + "\nError Description: " + typedError.message);
8115                        }
8116                        return [2 /*return*/, null];
8117                    case 4:
8118                        // Custom Domain scenario, host is trusted because Instance Discovery call succeeded
8119                        if (!match) {
8120                            this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.");
8121                            this.logger.verbose("Creating custom Authority for custom domain scenario.");
8122                            match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
8123                        }
8124                        return [2 /*return*/, match];
8125                }
8126            });
8127        });
8128    };
8129    /**
8130     * Get cloud discovery metadata for common authorities
8131     */
8132    Authority.prototype.getCloudDiscoveryMetadataFromHarcodedValues = function () {
8133        if (this.canonicalAuthority in InstanceDiscoveryMetadata) {
8134            return InstanceDiscoveryMetadata[this.canonicalAuthority];
8135        }
8136        return null;
8137    };
8138    /**
8139     * Helper function to determine if this host is included in the knownAuthorities config option
8140     */
8141    Authority.prototype.isInKnownAuthorities = function () {
8142        var _this = this;
8143        var matches = this.authorityOptions.knownAuthorities.filter(function (authority) {
8144            return UrlString.getDomainFromUrl(authority).toLowerCase() === _this.hostnameAndPort;
8145        });
8146        return matches.length > 0;
8147    };
8148    /**
8149     * helper function to populate the authority based on azureCloudOptions
8150     * @param authorityString
8151     * @param azureCloudOptions
8152     */
8153    Authority.generateAuthority = function (authorityString, azureCloudOptions) {
8154        var authorityAzureCloudInstance;
8155        if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== exports.AzureCloudInstance.None) {
8156            var tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;
8157            authorityAzureCloudInstance = azureCloudOptions.azureCloudInstance + "/" + tenant + "/";
8158        }
8159        return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;
8160    };
8161    /**
8162     * Creates cloud discovery metadata object from a given host
8163     * @param host
8164     */
8165    Authority.createCloudDiscoveryMetadataFromHost = function (host) {
8166        return {
8167            preferred_network: host,
8168            preferred_cache: host,
8169            aliases: [host]
8170        };
8171    };
8172    /**
8173     * Searches instance discovery network response for the entry that contains the host in the aliases list
8174     * @param response
8175     * @param authority
8176     */
8177    Authority.getCloudDiscoveryMetadataFromNetworkResponse = function (response, authority) {
8178        for (var i = 0; i < response.length; i++) {
8179            var metadata = response[i];
8180            if (metadata.aliases.indexOf(authority) > -1) {
8181                return metadata;
8182            }
8183        }
8184        return null;
8185    };
8186    /**
8187     * helper function to generate environment from authority object
8188     */
8189    Authority.prototype.getPreferredCache = function () {
8190        if (this.discoveryComplete()) {
8191            return this.metadata.preferred_cache;
8192        }
8193        else {
8194            throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
8195        }
8196    };
8197    /**
8198     * Returns whether or not the provided host is an alias of this authority instance
8199     * @param host
8200     */
8201    Authority.prototype.isAlias = function (host) {
8202        return this.metadata.aliases.indexOf(host) > -1;
8203    };
8204    /**
8205     * Checks whether the provided host is that of a public cloud authority
8206     *
8207     * @param authority string
8208     * @returns bool
8209     */
8210    Authority.isPublicCloudAuthority = function (host) {
8211        return Constants.KNOWN_PUBLIC_CLOUDS.indexOf(host) >= 0;
8212    };
8213    /**
8214     * Rebuild the authority string with the region
8215     *
8216     * @param host string
8217     * @param region string
8218     */
8219    Authority.buildRegionalAuthorityString = function (host, region, queryString) {
8220        // Create and validate a Url string object with the initial authority string
8221        var authorityUrlInstance = new UrlString(host);
8222        authorityUrlInstance.validateAsUri();
8223        var authorityUrlParts = authorityUrlInstance.getUrlComponents();
8224        var hostNameAndPort = region + "." + authorityUrlParts.HostNameAndPort;
8225        if (this.isPublicCloudAuthority(authorityUrlParts.HostNameAndPort)) {
8226            hostNameAndPort = region + "." + Constants.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX;
8227        }
8228        // Include the query string portion of the url
8229        var url = UrlString.constructAuthorityUriFromObject(__assign(__assign({}, authorityUrlInstance.getUrlComponents()), { HostNameAndPort: hostNameAndPort })).urlString;
8230        // Add the query string if a query string was provided
8231        if (queryString)
8232            return url + "?" + queryString;
8233        return url;
8234    };
8235    /**
8236     * Replace the endpoints in the metadata object with their regional equivalents.
8237     *
8238     * @param metadata OpenIdConfigResponse
8239     * @param azureRegion string
8240     */
8241    Authority.replaceWithRegionalInformation = function (metadata, azureRegion) {
8242        metadata.authorization_endpoint = Authority.buildRegionalAuthorityString(metadata.authorization_endpoint, azureRegion);
8243        // TODO: Enquire on whether we should leave the query string or remove it before releasing the feature
8244        metadata.token_endpoint = Authority.buildRegionalAuthorityString(metadata.token_endpoint, azureRegion, Constants.REGIONAL_AUTH_NON_MSI_QUERY_STRING);
8245        if (metadata.end_session_endpoint) {
8246            metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_endpoint, azureRegion);
8247        }
8248        return metadata;
8249    };
8250    /**
8251     * Transform CIAM_AUTHORIY as per the below rules:
8252     * If no path segments found and it is a CIAM authority (hostname ends with .ciamlogin.com), then transform it
8253     *
8254     * NOTE: The transformation path should go away once STS supports CIAM with the format: `tenantIdorDomain.ciamlogin.com`
8255     * `ciamlogin.com` can also change in the future and we should accommodate the same
8256     *
8257     * @param authority
8258     */
8259    Authority.transformCIAMAuthority = function (authority) {
8260        var ciamAuthority = authority.endsWith(Constants.FORWARD_SLASH) ? authority : "" + authority + Constants.FORWARD_SLASH;
8261        var authorityUrl = new UrlString(authority);
8262        var authorityUrlComponents = authorityUrl.getUrlComponents();
8263        // check if transformation is needed
8264        if (authorityUrlComponents.PathSegments.length === 0 && (authorityUrlComponents.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL))) {
8265            var tenantIdOrDomain = authorityUrlComponents.HostNameAndPort.split(".")[0];
8266            ciamAuthority = "" + ciamAuthority + tenantIdOrDomain + Constants.AAD_TENANT_DOMAIN_SUFFIX;
8267        }
8268        return ciamAuthority;
8269    };
8270    // Reserved tenant domain names that will not be replaced with tenant id
8271    Authority.reservedTenantDomains = (new Set([
8272        "{tenant}",
8273        "{tenantid}",
8274        AADAuthorityConstants.COMMON,
8275        AADAuthorityConstants.CONSUMERS,
8276        AADAuthorityConstants.ORGANIZATIONS
8277    ]));
8278    return Authority;
8279}());
8280
8281/*! @azure/msal-common v13.3.3 2024-06-06 */
8282
8283/*
8284 * Copyright (c) Microsoft Corporation. All rights reserved.
8285 * Licensed under the MIT License.
8286 */
8287var AuthorityFactory = /** @class */ (function () {
8288    function AuthorityFactory() {
8289    }
8290    /**
8291     * Create an authority object of the correct type based on the url
8292     * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)
8293     *
8294     * Also performs endpoint discovery.
8295     *
8296     * @param authorityUri
8297     * @param networkClient
8298     * @param protocolMode
8299     */
8300    AuthorityFactory.createDiscoveredInstance = function (authorityUri, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
8301        return __awaiter(this, void 0, void 0, function () {
8302            var authorityUriFinal, acquireTokenAuthority, e_1;
8303            return __generator(this, function (_a) {
8304                switch (_a.label) {
8305                    case 0:
8306                        performanceClient === null || performanceClient === void 0 ? void 0 : performanceClient.addQueueMeasurement(exports.PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);
8307                        authorityUriFinal = Authority.transformCIAMAuthority(authorityUri);
8308                        acquireTokenAuthority = AuthorityFactory.createInstance(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId);
8309                        _a.label = 1;
8310                    case 1:
8311                        _a.trys.push([1, 3, , 4]);
8312                        performanceClient === null || performanceClient === void 0 ? void 0 : performanceClient.setPreQueueTime(exports.PerformanceEvents.AuthorityResolveEndpointsAsync, correlationId);
8313                        return [4 /*yield*/, acquireTokenAuthority.resolveEndpointsAsync()];
8314                    case 2:
8315                        _a.sent();
8316                        return [2 /*return*/, acquireTokenAuthority];
8317                    case 3:
8318                        e_1 = _a.sent();
8319                        throw ClientAuthError.createEndpointDiscoveryIncompleteError(e_1);
8320                    case 4: return [2 /*return*/];
8321                }
8322            });
8323        });
8324    };
8325    /**
8326     * Create an authority object of the correct type based on the url
8327     * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)
8328     *
8329     * Does not perform endpoint discovery.
8330     *
8331     * @param authorityUrl
8332     * @param networkInterface
8333     * @param protocolMode
8334     */
8335    AuthorityFactory.createInstance = function (authorityUrl, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
8336        // Throw error if authority url is empty
8337        if (StringUtils.isEmpty(authorityUrl)) {
8338            throw ClientConfigurationError.createUrlEmptyError();
8339        }
8340        return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId);
8341    };
8342    return AuthorityFactory;
8343}());
8344
8345/*! @azure/msal-common v13.3.3 2024-06-06 */
8346
8347/*
8348 * Copyright (c) Microsoft Corporation. All rights reserved.
8349 * Licensed under the MIT License.
8350 */
8351var ServerTelemetryEntity = /** @class */ (function () {
8352    function ServerTelemetryEntity() {
8353        this.failedRequests = [];
8354        this.errors = [];
8355        this.cacheHits = 0;
8356    }
8357    /**
8358     * validates if a given cache entry is "Telemetry", parses <key,value>
8359     * @param key
8360     * @param entity
8361     */
8362    ServerTelemetryEntity.isServerTelemetryEntity = function (key, entity) {
8363        var validateKey = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;
8364        var validateEntity = true;
8365        if (entity) {
8366            validateEntity =
8367                entity.hasOwnProperty("failedRequests") &&
8368                    entity.hasOwnProperty("errors") &&
8369                    entity.hasOwnProperty("cacheHits");
8370        }
8371        return validateKey && validateEntity;
8372    };
8373    return ServerTelemetryEntity;
8374}());
8375
8376/*! @azure/msal-common v13.3.3 2024-06-06 */
8377
8378/*
8379 * Copyright (c) Microsoft Corporation. All rights reserved.
8380 * Licensed under the MIT License.
8381 */
8382var ThrottlingEntity = /** @class */ (function () {
8383    function ThrottlingEntity() {
8384    }
8385    /**
8386     * validates if a given cache entry is "Throttling", parses <key,value>
8387     * @param key
8388     * @param entity
8389     */
8390    ThrottlingEntity.isThrottlingEntity = function (key, entity) {
8391        var validateKey = false;
8392        if (key) {
8393            validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;
8394        }
8395        var validateEntity = true;
8396        if (entity) {
8397            validateEntity = entity.hasOwnProperty("throttleTime");
8398        }
8399        return validateKey && validateEntity;
8400    };
8401    return ThrottlingEntity;
8402}());
8403
8404/*! @azure/msal-common v13.3.3 2024-06-06 */
8405
8406/*
8407 * Copyright (c) Microsoft Corporation. All rights reserved.
8408 * Licensed under the MIT License.
8409 */
8410var StubbedNetworkModule = {
8411    sendGetRequestAsync: function () {
8412        var notImplErr = "Network interface - sendGetRequestAsync() has not been implemented for the Network interface.";
8413        return Promise.reject(AuthError.createUnexpectedError(notImplErr));
8414    },
8415    sendPostRequestAsync: function () {
8416        var notImplErr = "Network interface - sendPostRequestAsync() has not been implemented for the Network interface.";
8417        return Promise.reject(AuthError.createUnexpectedError(notImplErr));
8418    }
8419};
8420
8421/*! @azure/msal-common v13.3.3 2024-06-06 */
8422
8423/*
8424 * Copyright (c) Microsoft Corporation. All rights reserved.
8425 * Licensed under the MIT License.
8426 */
8427/**
8428 * ClientAuthErrorMessage class containing string constants used by error codes and messages.
8429 */
8430var JoseHeaderErrorMessage = {
8431    missingKidError: {
8432        code: "missing_kid_error",
8433        desc: "The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."
8434    },
8435    missingAlgError: {
8436        code: "missing_alg_error",
8437        desc: "The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."
8438    },
8439};
8440/**
8441 * Error thrown when there is an error in the client code running on the browser.
8442 */
8443var JoseHeaderError = /** @class */ (function (_super) {
8444    __extends(JoseHeaderError, _super);
8445    function JoseHeaderError(errorCode, errorMessage) {
8446        var _this = _super.call(this, errorCode, errorMessage) || this;
8447        _this.name = "JoseHeaderError";
8448        Object.setPrototypeOf(_this, JoseHeaderError.prototype);
8449        return _this;
8450    }
8451    /**
8452     * Creates an error thrown when keyId isn't set on JOSE header.
8453     */
8454    JoseHeaderError.createMissingKidError = function () {
8455        return new JoseHeaderError(JoseHeaderErrorMessage.missingKidError.code, JoseHeaderErrorMessage.missingKidError.desc);
8456    };
8457    /**
8458     * Creates an error thrown when algorithm isn't set on JOSE header.
8459     */
8460    JoseHeaderError.createMissingAlgError = function () {
8461        return new JoseHeaderError(JoseHeaderErrorMessage.missingAlgError.code, JoseHeaderErrorMessage.missingAlgError.desc);
8462    };
8463    return JoseHeaderError;
8464}(AuthError));
8465
8466/*! @azure/msal-common v13.3.3 2024-06-06 */
8467
8468/*
8469 * Copyright (c) Microsoft Corporation. All rights reserved.
8470 * Licensed under the MIT License.
8471 */
8472var JoseHeader = /** @class */ (function () {
8473    function JoseHeader(options) {
8474        this.typ = options.typ;
8475        this.alg = options.alg;
8476        this.kid = options.kid;
8477    }
8478    /**
8479     * Builds SignedHttpRequest formatted JOSE Header from the
8480     * JOSE Header options provided or previously set on the object and returns
8481     * the stringified header object.
8482     * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
8483     * @param shrHeaderOptions
8484     * @returns
8485     */
8486    JoseHeader.getShrHeaderString = function (shrHeaderOptions) {
8487        // KeyID is required on the SHR header
8488        if (!shrHeaderOptions.kid) {
8489            throw JoseHeaderError.createMissingKidError();
8490        }
8491        // Alg is required on the SHR header
8492        if (!shrHeaderOptions.alg) {
8493            throw JoseHeaderError.createMissingAlgError();
8494        }
8495        var shrHeader = new JoseHeader({
8496            // Access Token PoP headers must have type pop, but the type header can be overriden for special cases
8497            typ: shrHeaderOptions.typ || JsonTypes.Pop,
8498            kid: shrHeaderOptions.kid,
8499            alg: shrHeaderOptions.alg
8500        });
8501        return JSON.stringify(shrHeader);
8502    };
8503    return JoseHeader;
8504}());
8505
8506/*! @azure/msal-common v13.3.3 2024-06-06 */
8507
8508/*
8509 * Copyright (c) Microsoft Corporation. All rights reserved.
8510 * Licensed under the MIT License.
8511 */
8512/**
8513 * This is a helper class that parses supported HTTP response authentication headers to extract and return
8514 * header challenge values that can be used outside the basic authorization flows.
8515 */
8516var AuthenticationHeaderParser = /** @class */ (function () {
8517    function AuthenticationHeaderParser(headers) {
8518        this.headers = headers;
8519    }
8520    /**
8521     * This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.
8522     * @returns
8523     */
8524    AuthenticationHeaderParser.prototype.getShrNonce = function () {
8525        // Attempt to parse nonce from Authentiacation-Info
8526        var authenticationInfo = this.headers[HeaderNames.AuthenticationInfo];
8527        if (authenticationInfo) {
8528            var authenticationInfoChallenges = this.parseChallenges(authenticationInfo);
8529            if (authenticationInfoChallenges.nextnonce) {
8530                return authenticationInfoChallenges.nextnonce;
8531            }
8532            throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.AuthenticationInfo, "nextnonce challenge is missing.");
8533        }
8534        // Attempt to parse nonce from WWW-Authenticate
8535        var wwwAuthenticate = this.headers[HeaderNames.WWWAuthenticate];
8536        if (wwwAuthenticate) {
8537            var wwwAuthenticateChallenges = this.parseChallenges(wwwAuthenticate);
8538            if (wwwAuthenticateChallenges.nonce) {
8539                return wwwAuthenticateChallenges.nonce;
8540            }
8541            throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.WWWAuthenticate, "nonce challenge is missing.");
8542        }
8543        // If neither header is present, throw missing headers error
8544        throw ClientConfigurationError.createMissingNonceAuthenticationHeadersError();
8545    };
8546    /**
8547     * Parses an HTTP header's challenge set into a key/value map.
8548     * @param header
8549     * @returns
8550     */
8551    AuthenticationHeaderParser.prototype.parseChallenges = function (header) {
8552        var schemeSeparator = header.indexOf(" ");
8553        var challenges = header.substr(schemeSeparator + 1).split(",");
8554        var challengeMap = {};
vendor: 30,045 bytes, lines 8555-9181
8555        challenges.forEach(function (challenge) {
8556            var _a = challenge.split("="), key = _a[0], value = _a[1];
8557            // Remove escaped quotation marks (', ") from challenge string to keep only the challenge value
8558            challengeMap[key] = unescape(value.replace(/['"]+/g, Constants.EMPTY_STRING));
8559        });
8560        return challengeMap;
8561    };
8562    return AuthenticationHeaderParser;
8563}());
8564
8565/*! @azure/msal-common v13.3.3 2024-06-06 */
8566
8567/*
8568 * Copyright (c) Microsoft Corporation. All rights reserved.
8569 * Licensed under the MIT License.
8570 */
8571var ServerTelemetryManager = /** @class */ (function () {
8572    function ServerTelemetryManager(telemetryRequest, cacheManager) {
8573        this.cacheOutcome = CacheOutcome.NO_CACHE_HIT;
8574        this.cacheManager = cacheManager;
8575        this.apiId = telemetryRequest.apiId;
8576        this.correlationId = telemetryRequest.correlationId;
8577        this.wrapperSKU = telemetryRequest.wrapperSKU || Constants.EMPTY_STRING;
8578        this.wrapperVer = telemetryRequest.wrapperVer || Constants.EMPTY_STRING;
8579        this.telemetryCacheKey = SERVER_TELEM_CONSTANTS.CACHE_KEY + Separators.CACHE_KEY_SEPARATOR + telemetryRequest.clientId;
8580    }
8581    /**
8582     * API to add MSER Telemetry to request
8583     */
8584    ServerTelemetryManager.prototype.generateCurrentRequestHeaderValue = function () {
8585        var request = "" + this.apiId + SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR + this.cacheOutcome;
8586        var platformFields = [this.wrapperSKU, this.wrapperVer].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
8587        var regionDiscoveryFields = this.getRegionDiscoveryFields();
8588        var requestWithRegionDiscoveryFields = [request, regionDiscoveryFields].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
8589        return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, requestWithRegionDiscoveryFields, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);
8590    };
8591    /**
8592     * API to add MSER Telemetry for the last failed request
8593     */
8594    ServerTelemetryManager.prototype.generateLastRequestHeaderValue = function () {
8595        var lastRequests = this.getLastRequests();
8596        var maxErrors = ServerTelemetryManager.maxErrorsToSend(lastRequests);
8597        var failedRequests = lastRequests.failedRequests.slice(0, 2 * maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
8598        var errors = lastRequests.errors.slice(0, maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
8599        var errorCount = lastRequests.errors.length;
8600        // Indicate whether this header contains all data or partial data
8601        var overflow = maxErrors < errorCount ? SERVER_TELEM_CONSTANTS.OVERFLOW_TRUE : SERVER_TELEM_CONSTANTS.OVERFLOW_FALSE;
8602        var platformFields = [errorCount, overflow].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
8603        return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, lastRequests.cacheHits, failedRequests, errors, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);
8604    };
8605    /**
8606     * API to cache token failures for MSER data capture
8607     * @param error
8608     */
8609    ServerTelemetryManager.prototype.cacheFailedRequest = function (error) {
8610        var lastRequests = this.getLastRequests();
8611        if (lastRequests.errors.length >= SERVER_TELEM_CONSTANTS.MAX_CACHED_ERRORS) {
8612            // Remove a cached error to make room, first in first out
8613            lastRequests.failedRequests.shift(); // apiId
8614            lastRequests.failedRequests.shift(); // correlationId
8615            lastRequests.errors.shift();
8616        }
8617        lastRequests.failedRequests.push(this.apiId, this.correlationId);
8618        if (!StringUtils.isEmpty(error.subError)) {
8619            lastRequests.errors.push(error.subError);
8620        }
8621        else if (!StringUtils.isEmpty(error.errorCode)) {
8622            lastRequests.errors.push(error.errorCode);
8623        }
8624        else if (!!error && error.toString()) {
8625            lastRequests.errors.push(error.toString());
8626        }
8627        else {
8628            lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);
8629        }
8630        this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
8631        return;
8632    };
8633    /**
8634     * Update server telemetry cache entry by incrementing cache hit counter
8635     */
8636    ServerTelemetryManager.prototype.incrementCacheHits = function () {
8637        var lastRequests = this.getLastRequests();
8638        lastRequests.cacheHits += 1;
8639        this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
8640        return lastRequests.cacheHits;
8641    };
8642    /**
8643     * Get the server telemetry entity from cache or initialize a new one
8644     */
8645    ServerTelemetryManager.prototype.getLastRequests = function () {
8646        var initialValue = new ServerTelemetryEntity();
8647        var lastRequests = this.cacheManager.getServerTelemetry(this.telemetryCacheKey);
8648        return lastRequests || initialValue;
8649    };
8650    /**
8651     * Remove server telemetry cache entry
8652     */
8653    ServerTelemetryManager.prototype.clearTelemetryCache = function () {
8654        var lastRequests = this.getLastRequests();
8655        var numErrorsFlushed = ServerTelemetryManager.maxErrorsToSend(lastRequests);
8656        var errorCount = lastRequests.errors.length;
8657        if (numErrorsFlushed === errorCount) {
8658            // All errors were sent on last request, clear Telemetry cache
8659            this.cacheManager.removeItem(this.telemetryCacheKey);
8660        }
8661        else {
8662            // Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed
8663            var serverTelemEntity = new ServerTelemetryEntity();
8664            serverTelemEntity.failedRequests = lastRequests.failedRequests.slice(numErrorsFlushed * 2); // failedRequests contains 2 items for each error
8665            serverTelemEntity.errors = lastRequests.errors.slice(numErrorsFlushed);
8666            this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);
8667        }
8668    };
8669    /**
8670     * Returns the maximum number of errors that can be flushed to the server in the next network request
8671     * @param serverTelemetryEntity
8672     */
8673    ServerTelemetryManager.maxErrorsToSend = function (serverTelemetryEntity) {
8674        var i;
8675        var maxErrors = 0;
8676        var dataSize = 0;
8677        var errorCount = serverTelemetryEntity.errors.length;
8678        for (i = 0; i < errorCount; i++) {
8679            // failedRequests parameter contains pairs of apiId and correlationId, multiply index by 2 to preserve pairs
8680            var apiId = serverTelemetryEntity.failedRequests[2 * i] || Constants.EMPTY_STRING;
8681            var correlationId = serverTelemetryEntity.failedRequests[2 * i + 1] || Constants.EMPTY_STRING;
8682            var errorCode = serverTelemetryEntity.errors[i] || Constants.EMPTY_STRING;
8683            // Count number of characters that would be added to header, each character is 1 byte. Add 3 at the end to account for separators
8684            dataSize += apiId.toString().length + correlationId.toString().length + errorCode.length + 3;
8685            if (dataSize < SERVER_TELEM_CONSTANTS.MAX_LAST_HEADER_BYTES) {
8686                // Adding this entry to the header would still keep header size below the limit
8687                maxErrors += 1;
8688            }
8689            else {
8690                break;
8691            }
8692        }
8693        return maxErrors;
8694    };
8695    /**
8696     * Get the region discovery fields
8697     *
8698     * @returns string
8699     */
8700    ServerTelemetryManager.prototype.getRegionDiscoveryFields = function () {
8701        var regionDiscoveryFields = [];
8702        regionDiscoveryFields.push(this.regionUsed || Constants.EMPTY_STRING);
8703        regionDiscoveryFields.push(this.regionSource || Constants.EMPTY_STRING);
8704        regionDiscoveryFields.push(this.regionOutcome || Constants.EMPTY_STRING);
8705        return regionDiscoveryFields.join(",");
8706    };
8707    /**
8708     * Update the region discovery metadata
8709     *
8710     * @param regionDiscoveryMetadata
8711     * @returns void
8712     */
8713    ServerTelemetryManager.prototype.updateRegionDiscoveryMetadata = function (regionDiscoveryMetadata) {
8714        this.regionUsed = regionDiscoveryMetadata.region_used;
8715        this.regionSource = regionDiscoveryMetadata.region_source;
8716        this.regionOutcome = regionDiscoveryMetadata.region_outcome;
8717    };
8718    /**
8719     * Set cache outcome
8720     */
8721    ServerTelemetryManager.prototype.setCacheOutcome = function (cacheOutcome) {
8722        this.cacheOutcome = cacheOutcome;
8723    };
8724    return ServerTelemetryManager;
8725}());
8726
8727/*! @azure/msal-common v13.3.3 2024-06-06 */
8728
8729/*
8730 * Copyright (c) Microsoft Corporation. All rights reserved.
8731 * Licensed under the MIT License.
8732 */
8733var PerformanceClient = /** @class */ (function () {
8734    /**
8735     * Creates an instance of PerformanceClient,
8736     * an abstract class containing core performance telemetry logic.
8737     *
8738     * @constructor
8739     * @param {string} clientId Client ID of the application
8740     * @param {string} authority Authority used by the application
8741     * @param {Logger} logger Logger used by the application
8742     * @param {string} libraryName Name of the library
8743     * @param {string} libraryVersion Version of the library
8744     */
8745    function PerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {
8746        this.authority = authority;
8747        this.libraryName = libraryName;
8748        this.libraryVersion = libraryVersion;
8749        this.applicationTelemetry = applicationTelemetry;
8750        this.clientId = clientId;
8751        this.logger = logger;
8752        this.callbacks = new Map();
8753        this.eventsByCorrelationId = new Map();
8754        this.queueMeasurements = new Map();
8755        this.preQueueTimeByCorrelationId = new Map();
8756    }
8757    /**
8758     * Starts and returns an platform-specific implementation of IPerformanceMeasurement.
8759     * Note: this function can be changed to abstract at the next major version bump.
8760     *
8761     * @param {string} measureName
8762     * @param {string} correlationId
8763     * @returns {IPerformanceMeasurement}
8764     */
8765    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
8766    PerformanceClient.prototype.startPerformanceMeasurement = function (measureName, correlationId) {
8767        return {};
8768    };
8769    /**
8770     * Starts and returns an platform-specific implementation of IPerformanceMeasurement.
8771     * Note: this incorrectly-named function will be removed at the next major version bump.
8772     *
8773     * @param {string} measureName
8774     * @param {string} correlationId
8775     * @returns {IPerformanceMeasurement}
8776     */
8777    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
8778    PerformanceClient.prototype.startPerformanceMeasuremeant = function (measureName, correlationId) {
8779        return {};
8780    };
8781    /**
8782     * Get integral fields.
8783     * Override to change the set.
8784     */
8785    PerformanceClient.prototype.getIntFields = function () {
8786        return IntFields;
8787    };
8788    /**
8789     * Gets map of pre-queue times by correlation Id
8790     *
8791     * @param {PerformanceEvents} eventName
8792     * @param {string} correlationId
8793     * @returns {number}
8794     */
8795    PerformanceClient.prototype.getPreQueueTime = function (eventName, correlationId) {
8796        var preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);
8797        if (!preQueueEvent) {
8798            this.logger.trace("PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: " + correlationId + ", unable to add queue measurement");
8799            return;
8800        }
8801        else if (preQueueEvent.name !== eventName) {
8802            this.logger.trace("PerformanceClient.getPreQueueTime: no pre-queue time found for " + eventName + ", unable to add queue measurement");
8803            return;
8804        }
8805        return preQueueEvent.time;
8806    };
8807    /**
8808     * Calculates the difference between current time and time when function was queued.
8809     * Note: It is possible to have 0 as the queue time if the current time and the queued time was the same.
8810     *
8811     * @param {number} preQueueTime
8812     * @param {number} currentTime
8813     * @returns {number}
8814     */
8815    PerformanceClient.prototype.calculateQueuedTime = function (preQueueTime, currentTime) {
8816        if (preQueueTime < 1) {
8817            this.logger.trace("PerformanceClient: preQueueTime should be a positive integer and not " + preQueueTime);
8818            return 0;
8819        }
8820        if (currentTime < 1) {
8821            this.logger.trace("PerformanceClient: currentTime should be a positive integer and not " + currentTime);
8822            return 0;
8823        }
8824        if (currentTime < preQueueTime) {
8825            this.logger.trace("PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved");
8826            return 0;
8827        }
8828        return currentTime - preQueueTime;
8829    };
8830    /**
8831     * Adds queue measurement time to QueueMeasurements array for given correlation ID.
8832     *
8833     * @param {PerformanceEvents} eventName
8834     * @param {?string} correlationId
8835     * @param {?number} queueTime
8836     * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
8837     * @returns
8838     */
8839    PerformanceClient.prototype.addQueueMeasurement = function (eventName, correlationId, queueTime, manuallyCompleted) {
8840        if (!correlationId) {
8841            this.logger.trace("PerformanceClient.addQueueMeasurement: correlationId not provided for " + eventName + ", cannot add queue measurement");
8842            return;
8843        }
8844        if (queueTime === 0) {
8845            // Possible for there to be no queue time after calculation
8846            this.logger.trace("PerformanceClient.addQueueMeasurement: queue time provided for " + eventName + " is " + queueTime);
8847        }
8848        else if (!queueTime) {
8849            this.logger.trace("PerformanceClient.addQueueMeasurement: no queue time provided for " + eventName);
8850            return;
8851        }
8852        var queueMeasurement = { eventName: eventName, queueTime: queueTime, manuallyCompleted: manuallyCompleted };
8853        // Adds to existing correlation Id if present in queueMeasurements
8854        var existingMeasurements = this.queueMeasurements.get(correlationId);
8855        if (existingMeasurements) {
8856            existingMeasurements.push(queueMeasurement);
8857            this.queueMeasurements.set(correlationId, existingMeasurements);
8858        }
8859        else {
8860            // Sets new correlation Id if not present in queueMeasurements
8861            this.logger.trace("PerformanceClient.addQueueMeasurement: adding correlationId " + correlationId + " to queue measurements");
8862            var measurementArray = [queueMeasurement];
8863            this.queueMeasurements.set(correlationId, measurementArray);
8864        }
8865        // Delete processed pre-queue event.
8866        this.preQueueTimeByCorrelationId.delete(correlationId);
8867    };
8868    /**
8869     * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
8870     *
8871     * @param {PerformanceEvents} measureName
8872     * @param {?string} [correlationId]
8873     * @returns {InProgressPerformanceEvent}
8874     */
8875    PerformanceClient.prototype.startMeasurement = function (measureName, correlationId) {
8876        var _this = this;
8877        var _a, _b;
8878        // Generate a placeholder correlation if the request does not provide one
8879        var eventCorrelationId = correlationId || this.generateId();
8880        if (!correlationId) {
8881            this.logger.info("PerformanceClient: No correlation id provided for " + measureName + ", generating", eventCorrelationId);
8882        }
8883        // Duplicate code to address spelling error will be removed at the next major version bump.
8884        this.logger.trace("PerformanceClient: Performance measurement started for " + measureName, eventCorrelationId);
8885        var performanceMeasurement = this.startPerformanceMeasuremeant(measureName, eventCorrelationId);
8886        performanceMeasurement.startMeasurement();
8887        var inProgressEvent = {
8888            eventId: this.generateId(),
8889            status: PerformanceEventStatus.InProgress,
8890            authority: this.authority,
8891            libraryName: this.libraryName,
8892            libraryVersion: this.libraryVersion,
8893            clientId: this.clientId,
8894            name: measureName,
8895            startTimeMs: Date.now(),
8896            correlationId: eventCorrelationId,
8897            appName: (_a = this.applicationTelemetry) === null || _a === void 0 ? void 0 : _a.appName,
8898            appVersion: (_b = this.applicationTelemetry) === null || _b === void 0 ? void 0 : _b.appVersion,
8899        };
8900        // Store in progress events so they can be discarded if not ended properly
8901        this.cacheEventByCorrelationId(inProgressEvent);
8902        // Return the event and functions the caller can use to properly end/flush the measurement
8903        return {
8904            endMeasurement: function (event) {
8905                return _this.endMeasurement(__assign(__assign({}, inProgressEvent), event), performanceMeasurement);
8906            },
8907            discardMeasurement: function () {
8908                return _this.discardMeasurements(inProgressEvent.correlationId);
8909            },
8910            addStaticFields: function (fields) {
8911                return _this.addStaticFields(fields, inProgressEvent.correlationId);
8912            },
8913            increment: function (counters) {
8914                return _this.increment(counters, inProgressEvent.correlationId);
8915            },
8916            measurement: performanceMeasurement,
8917            event: inProgressEvent
8918        };
8919    };
8920    /**
8921     * Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes,
8922     * as consumers should instead use the function returned by startMeasurement.
8923     * Adds a new field named as "[event name]DurationMs" for sub-measurements, completes and emits an event
8924     * otherwise.
8925     *
8926     * @param {PerformanceEvent} event
8927     * @param {IPerformanceMeasurement} measurement
8928     * @returns {(PerformanceEvent | null)}
8929     */
8930    PerformanceClient.prototype.endMeasurement = function (event, measurement) {
8931        var _this = this;
8932        var _a, _b;
8933        var rootEvent = this.eventsByCorrelationId.get(event.correlationId);
8934        if (!rootEvent) {
8935            this.logger.trace("PerformanceClient: Measurement not found for " + event.eventId, event.correlationId);
8936            return null;
8937        }
8938        var isRoot = event.eventId === rootEvent.eventId;
8939        var queueInfo = {
8940            totalQueueTime: 0,
8941            totalQueueCount: 0,
8942            manuallyCompletedCount: 0
8943        };
8944        if (isRoot) {
8945            queueInfo = this.getQueueInfo(event.correlationId);
8946            this.discardCache(rootEvent.correlationId);
8947        }
8948        else {
8949            (_a = rootEvent.incompleteSubMeasurements) === null || _a === void 0 ? void 0 : _a.delete(event.eventId);
8950        }
8951        measurement === null || measurement === void 0 ? void 0 : measurement.endMeasurement();
8952        var durationMs = measurement === null || measurement === void 0 ? void 0 : measurement.flushMeasurement();
8953        // null indicates no measurement was taken (e.g. needed performance APIs not present)
8954        if (!durationMs) {
8955            this.logger.trace("PerformanceClient: Performance measurement not taken", rootEvent.correlationId);
8956            return null;
8957        }
8958        this.logger.trace("PerformanceClient: Performance measurement ended for " + event.name + ": " + durationMs + " ms", event.correlationId);
8959        // Add sub-measurement attribute to root event.
8960        if (!isRoot) {
8961            rootEvent[event.name + "DurationMs"] = Math.floor(durationMs);
8962            return __assign({}, rootEvent);
8963        }
8964        var finalEvent = __assign(__assign({}, rootEvent), event);
8965        var incompleteSubsCount = 0;
8966        // Incomplete sub-measurements are discarded. They are likely an instrumentation bug that should be fixed.
8967        (_b = finalEvent.incompleteSubMeasurements) === null || _b === void 0 ? void 0 : _b.forEach(function (subMeasurement) {
8968            _this.logger.trace("PerformanceClient: Incomplete submeasurement " + subMeasurement.name + " found for " + event.name, finalEvent.correlationId);
8969            incompleteSubsCount++;
8970        });
8971        finalEvent.incompleteSubMeasurements = undefined;
8972        finalEvent = __assign(__assign({}, finalEvent), { durationMs: Math.round(durationMs), queuedTimeMs: queueInfo.totalQueueTime, queuedCount: queueInfo.totalQueueCount, queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount, status: PerformanceEventStatus.Completed, incompleteSubsCount: incompleteSubsCount });
8973        this.truncateIntegralFields(finalEvent, this.getIntFields());
8974        this.emitEvents([finalEvent], event.correlationId);
8975        return finalEvent;
8976    };
8977    /**
8978     * Saves extra information to be emitted when the measurements are flushed
8979     * @param fields
8980     * @param correlationId
8981     */
8982    PerformanceClient.prototype.addStaticFields = function (fields, correlationId) {
8983        this.logger.trace("PerformanceClient: Updating static fields");
8984        var event = this.eventsByCorrelationId.get(correlationId);
8985        if (event) {
8986            this.eventsByCorrelationId.set(correlationId, __assign(__assign({}, event), fields));
8987        }
8988        else {
8989            this.logger.trace("PerformanceClient: Event not found for", correlationId);
8990        }
8991    };
8992    /**
8993     * Increment counters to be emitted when the measurements are flushed
8994     * @param counters {Counters}
8995     * @param correlationId {string} correlation identifier
8996     */
8997    PerformanceClient.prototype.increment = function (counters, correlationId) {
8998        this.logger.trace("PerformanceClient: Updating counters");
8999        var event = this.eventsByCorrelationId.get(correlationId);
9000        if (event) {
9001            for (var counter in counters) {
9002                if (!event.hasOwnProperty(counter)) {
9003                    event[counter] = 0;
9004                }
9005                event[counter] += counters[counter];
9006            }
9007        }
9008        else {
9009            this.logger.trace("PerformanceClient: Event not found for", correlationId);
9010        }
9011    };
9012    /**
9013     * Upserts event into event cache.
9014     * First key is the correlation id, second key is the event id.
9015     * Allows for events to be grouped by correlation id,
9016     * and to easily allow for properties on them to be updated.
9017     *
9018     * @private
9019     * @param {PerformanceEvent} event
9020     */
9021    PerformanceClient.prototype.cacheEventByCorrelationId = function (event) {
9022        var rootEvent = this.eventsByCorrelationId.get(event.correlationId);
9023        if (rootEvent) {
9024            this.logger.trace("PerformanceClient: Performance measurement for " + event.name + " added/updated", event.correlationId);
9025            rootEvent.incompleteSubMeasurements = rootEvent.incompleteSubMeasurements || new Map();
9026            rootEvent.incompleteSubMeasurements.set(event.eventId, { name: event.name, startTimeMs: event.startTimeMs });
9027        }
9028        else {
9029            this.logger.trace("PerformanceClient: Performance measurement for " + event.name + " started", event.correlationId);
9030            this.eventsByCorrelationId.set(event.correlationId, __assign({}, event));
9031        }
9032    };
9033    PerformanceClient.prototype.getQueueInfo = function (correlationId) {
9034        var queueMeasurementForCorrelationId = this.queueMeasurements.get(correlationId);
9035        if (!queueMeasurementForCorrelationId) {
9036            this.logger.trace("PerformanceClient: no queue measurements found for for correlationId: " + correlationId);
9037        }
9038        var totalQueueTime = 0;
9039        var totalQueueCount = 0;
9040        var manuallyCompletedCount = 0;
9041        queueMeasurementForCorrelationId === null || queueMeasurementForCorrelationId === void 0 ? void 0 : queueMeasurementForCorrelationId.forEach(function (measurement) {
9042            totalQueueTime += measurement.queueTime;
9043            totalQueueCount++;
9044            manuallyCompletedCount += measurement.manuallyCompleted ? 1 : 0;
9045        });
9046        return {
9047            totalQueueTime: totalQueueTime,
9048            totalQueueCount: totalQueueCount,
9049            manuallyCompletedCount: manuallyCompletedCount
9050        };
9051    };
9052    /**
9053     * Removes measurements for a given correlation id.
9054     *
9055     * @param {string} correlationId
9056     */
9057    PerformanceClient.prototype.discardMeasurements = function (correlationId) {
9058        this.logger.trace("PerformanceClient: Performance measurements discarded", correlationId);
9059        this.eventsByCorrelationId.delete(correlationId);
9060    };
9061    /**
9062     * Removes cache for a given correlation id.
9063     *
9064     * @param {string} correlationId correlation identifier
9065     */
9066    PerformanceClient.prototype.discardCache = function (correlationId) {
9067        this.discardMeasurements(correlationId);
9068        this.logger.trace("PerformanceClient: QueueMeasurements discarded", correlationId);
9069        this.queueMeasurements.delete(correlationId);
9070        this.logger.trace("PerformanceClient: Pre-queue times discarded", correlationId);
9071        this.preQueueTimeByCorrelationId.delete(correlationId);
9072    };
9073    /**
9074     * Registers a callback function to receive performance events.
9075     *
9076     * @param {PerformanceCallbackFunction} callback
9077     * @returns {string}
9078     */
9079    PerformanceClient.prototype.addPerformanceCallback = function (callback) {
9080        var callbackId = this.generateId();
9081        this.callbacks.set(callbackId, callback);
9082        this.logger.verbose("PerformanceClient: Performance callback registered with id: " + callbackId);
9083        return callbackId;
9084    };
9085    /**
9086     * Removes a callback registered with addPerformanceCallback.
9087     *
9088     * @param {string} callbackId
9089     * @returns {boolean}
9090     */
9091    PerformanceClient.prototype.removePerformanceCallback = function (callbackId) {
9092        var result = this.callbacks.delete(callbackId);
9093        if (result) {
9094            this.logger.verbose("PerformanceClient: Performance callback " + callbackId + " removed.");
9095        }
9096        else {
9097            this.logger.verbose("PerformanceClient: Performance callback " + callbackId + " not removed.");
9098        }
9099        return result;
9100    };
9101    /**
9102     * Emits events to all registered callbacks.
9103     *
9104     * @param {PerformanceEvent[]} events
9105     * @param {?string} [correlationId]
9106     */
9107    PerformanceClient.prototype.emitEvents = function (events, correlationId) {
9108        var _this = this;
9109        this.logger.verbose("PerformanceClient: Emitting performance events", correlationId);
9110        this.callbacks.forEach(function (callback, callbackId) {
9111            _this.logger.trace("PerformanceClient: Emitting event to callback " + callbackId, correlationId);
9112            callback.apply(null, [events]);
9113        });
9114    };
9115    /**
9116     * Enforce truncation of integral fields in performance event.
9117     * @param {PerformanceEvent} event performance event to update.
9118     * @param {Set<string>} intFields integral fields.
9119     */
9120    PerformanceClient.prototype.truncateIntegralFields = function (event, intFields) {
9121        intFields.forEach(function (key) {
9122            if (key in event && typeof event[key] === "number") {
9123                event[key] = Math.floor(event[key]);
9124            }
9125        });
9126    };
9127    return PerformanceClient;
9128}());
9129
9130/*! @azure/msal-common v13.3.3 2024-06-06 */
9131
9132/*
9133 * Copyright (c) Microsoft Corporation. All rights reserved.
9134 * Licensed under the MIT License.
9135 */
9136var StubPerformanceMeasurement = /** @class */ (function () {
9137    function StubPerformanceMeasurement() {
9138    }
9139    /* eslint-disable-next-line @typescript-eslint/no-empty-function */
9140    StubPerformanceMeasurement.prototype.startMeasurement = function () { };
9141    /* eslint-disable-next-line @typescript-eslint/no-empty-function */
9142    StubPerformanceMeasurement.prototype.endMeasurement = function () { };
9143    StubPerformanceMeasurement.prototype.flushMeasurement = function () {
9144        return null;
9145    };
9146    return StubPerformanceMeasurement;
9147}());
9148var StubPerformanceClient = /** @class */ (function (_super) {
9149    __extends(StubPerformanceClient, _super);
9150    function StubPerformanceClient() {
9151        return _super !== null && _super.apply(this, arguments) || this;
9152    }
9153    StubPerformanceClient.prototype.generateId = function () {
9154        return "callback-id";
9155    };
9156    StubPerformanceClient.prototype.startPerformanceMeasuremeant = function () {
9157        return new StubPerformanceMeasurement();
9158    };
9159    StubPerformanceClient.prototype.startPerformanceMeasurement = function () {
9160        return new StubPerformanceMeasurement();
9161    };
9162    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
9163    StubPerformanceClient.prototype.calculateQueuedTime = function (preQueueTime, currentTime) {
9164        return 0;
9165    };
9166    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
9167    StubPerformanceClient.prototype.addQueueMeasurement = function (eventName, correlationId, queueTime) {
9168        return;
9169    };
9170    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
9171    StubPerformanceClient.prototype.setPreQueueTime = function (eventName, correlationId) {
9172        return;
9173    };
9174    return StubPerformanceClient;
9175}(PerformanceClient));
9176
9177/*
9178 * Copyright (c) Microsoft Corporation. All rights reserved.
9179 * Licensed under the MIT License.
9180 */
9181/**
9182 * BrowserAuthErrorMessage class containing string constants used by error codes and messages.
9183 */
9184var BrowserAuthErrorMessage = {
9185    pkceNotGenerated: {
9186        code: "pkce_not_created",
9187        desc: "The PKCE code challenge and verifier could not be generated."
9188    },
9189    cryptoDoesNotExist: {
9190        code: "crypto_nonexistent",
9191        desc: "The crypto object or function is not available."
9192    },
9193    httpMethodNotImplementedError: {
9194        code: "http_method_not_implemented",
9195        desc: "The HTTP method given has not been implemented in this library."
9196    },
9197    emptyNavigateUriError: {
9198        code: "empty_navigate_uri",
9199        desc: "Navigation URI is empty. Please check stack trace for more info."
9200    },
9201    hashEmptyError: {
9202        code: "hash_empty_error",
9203        desc: "Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."
9204    },
9205    hashDoesNotContainStateError: {
9206        code: "no_state_in_hash",
9207        desc: "Hash does not contain state. Please verify that the request originated from msal."
9208    },
9209    hashDoesNotContainKnownPropertiesError: {
9210        code: "hash_does_not_contain_known_properties",
9211        desc: "Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."
9212    },
9213    unableToParseStateError: {
9214        code: "unable_to_parse_state",
9215        desc: "Unable to parse state. Please verify that the request originated from msal."
9216    },
9217    stateInteractionTypeMismatchError: {
9218        code: "state_interaction_type_mismatch",
9219        desc: "Hash contains state but the interaction type does not match the caller."
9220    },
9221    interactionInProgress: {
9222        code: "interaction_in_progress",
9223        desc: "Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.  For more visit: aka.ms/msaljs/browser-errors."
9224    },
9225    popupWindowError: {
9226        code: "popup_window_error",
9227        desc: "Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."
9228    },
9229    emptyWindowError: {
9230        code: "empty_window_error",
9231        desc: "window.open returned null or undefined window object."
9232    },
9233    userCancelledError: {
9234        code: "user_cancelled",
9235        desc: "User cancelled the flow."
9236    },
9237    monitorPopupTimeoutError: {
9238        code: "monitor_window_timeout",
9239        desc: "Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."
9240    },
9241    monitorIframeTimeoutError: {
9242        code: "monitor_window_timeout",
9243        desc: "Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."
9244    },
9245    redirectInIframeError: {
9246        code: "redirect_in_iframe",
9247        desc: "Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."
9248    },
9249    blockTokenRequestsInHiddenIframeError: {
9250        code: "block_iframe_reload",
9251        desc: "Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"
9252    },
9253    blockAcquireTokenInPopupsError: {
9254        code: "block_nested_popups",
9255        desc: "Request was blocked inside a popup because MSAL detected it was running in a popup."
9256    },
9257    iframeClosedPrematurelyError: {
9258        code: "iframe_closed_prematurely",
9259        desc: "The iframe being monitored was closed prematurely."
9260    },
9261    silentLogoutUnsupportedError: {
9262        code: "silent_logout_unsupported",
9263        desc: "Silent logout not supported. Please call logoutRedirect or logoutPopup instead."
9264    },
9265    noAccountError: {
9266        code: "no_account_error",
9267        desc: "No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."
9268    },
9269    silentPromptValueError: {
9270        code: "silent_prompt_value_error",
vendor: 10,207 bytes, lines 9271-9475
9271        desc: "The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."
9272    },
9273    noTokenRequestCacheError: {
9274        code: "no_token_request_cache_error",
9275        desc: "No token request found in cache."
9276    },
9277    unableToParseTokenRequestCacheError: {
9278        code: "unable_to_parse_token_request_cache_error",
9279        desc: "The cached token request could not be parsed."
9280    },
9281    noCachedAuthorityError: {
9282        code: "no_cached_authority_error",
9283        desc: "No cached authority found."
9284    },
9285    authRequestNotSet: {
9286        code: "auth_request_not_set_error",
9287        desc: "Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"
9288    },
9289    invalidCacheType: {
9290        code: "invalid_cache_type",
9291        desc: "Invalid cache type"
9292    },
9293    notInBrowserEnvironment: {
9294        code: "non_browser_environment",
9295        desc: "Login and token requests are not supported in non-browser environments."
9296    },
9297    databaseNotOpen: {
9298        code: "database_not_open",
9299        desc: "Database is not open!"
9300    },
9301    noNetworkConnectivity: {
9302        code: "no_network_connectivity",
9303        desc: "No network connectivity. Check your internet connection."
9304    },
9305    postRequestFailed: {
9306        code: "post_request_failed",
9307        desc: "Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"
9308    },
9309    getRequestFailed: {
9310        code: "get_request_failed",
9311        desc: "Network request failed. Please check the network trace to determine root cause."
9312    },
9313    failedToParseNetworkResponse: {
9314        code: "failed_to_parse_response",
9315        desc: "Failed to parse network response. Check network trace."
9316    },
9317    unableToLoadTokenError: {
9318        code: "unable_to_load_token",
9319        desc: "Error loading token to cache."
9320    },
9321    signingKeyNotFoundInStorage: {
9322        code: "crypto_key_not_found",
9323        desc: "Cryptographic Key or Keypair not found in browser storage."
9324    },
9325    authCodeRequired: {
9326        code: "auth_code_required",
9327        desc: "An authorization code must be provided (as the `code` property on the request) to this flow."
9328    },
9329    authCodeOrNativeAccountRequired: {
9330        code: "auth_code_or_nativeAccountId_required",
9331        desc: "An authorization code or nativeAccountId must be provided to this flow."
9332    },
9333    spaCodeAndNativeAccountPresent: {
9334        code: "spa_code_and_nativeAccountId_present",
9335        desc: "Request cannot contain both spa code and native account id."
9336    },
9337    databaseUnavailable: {
9338        code: "database_unavailable",
9339        desc: "IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."
9340    },
9341    unableToAcquireTokenFromNativePlatform: {
9342        code: "unable_to_acquire_token_from_native_platform",
9343        desc: "Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."
9344    },
9345    nativeHandshakeTimeout: {
9346        code: "native_handshake_timeout",
9347        desc: "Timed out while attempting to establish connection to browser extension"
9348    },
9349    nativeExtensionNotInstalled: {
9350        code: "native_extension_not_installed",
9351        desc: "Native extension is not installed. If you think this is a mistake call the initialize function."
9352    },
9353    nativeConnectionNotEstablished: {
9354        code: "native_connection_not_established",
9355        desc: "Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."
9356    },
9357    nativeBrokerCalledBeforeInitialize: {
9358        code: "native_broker_called_before_initialize",
9359        desc: "You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."
9360    },
9361    nativePromptNotSupported: {
9362        code: "native_prompt_not_supported",
9363        desc: "The provided prompt is not supported by the native platform. This request should be routed to the web based flow."
9364    }
9365};
9366/**
9367 * Browser library error class thrown by the MSAL.js library for SPAs
9368 */
9369var BrowserAuthError = /** @class */ (function (_super) {
9370    __extends$1(BrowserAuthError, _super);
9371    function BrowserAuthError(errorCode, errorMessage) {
9372        var _this = _super.call(this, errorCode, errorMessage) || this;
9373        Object.setPrototypeOf(_this, BrowserAuthError.prototype);
9374        _this.name = "BrowserAuthError";
9375        return _this;
9376    }
9377    /**
9378     * Creates an error thrown when PKCE is not implemented.
9379     * @param errDetail
9380     */
9381    BrowserAuthError.createPkceNotGeneratedError = function (errDetail) {
9382        return new BrowserAuthError(BrowserAuthErrorMessage.pkceNotGenerated.code, BrowserAuthErrorMessage.pkceNotGenerated.desc + " Detail:" + errDetail);
9383    };
9384    /**
9385     * Creates an error thrown when the crypto object is unavailable.
9386     * @param errDetail
9387     */
9388    BrowserAuthError.createCryptoNotAvailableError = function (errDetail) {
9389        return new BrowserAuthError(BrowserAuthErrorMessage.cryptoDoesNotExist.code, BrowserAuthErrorMessage.cryptoDoesNotExist.desc + " Detail:" + errDetail);
9390    };
9391    /**
9392     * Creates an error thrown when an HTTP method hasn't been implemented by the browser class.
9393     * @param method
9394     */
9395    BrowserAuthError.createHttpMethodNotImplementedError = function (method) {
9396        return new BrowserAuthError(BrowserAuthErrorMessage.httpMethodNotImplementedError.code, BrowserAuthErrorMessage.httpMethodNotImplementedError.desc + " Given Method: " + method);
9397    };
9398    /**
9399     * Creates an error thrown when the navigation URI is empty.
9400     */
9401    BrowserAuthError.createEmptyNavigationUriError = function () {
9402        return new BrowserAuthError(BrowserAuthErrorMessage.emptyNavigateUriError.code, BrowserAuthErrorMessage.emptyNavigateUriError.desc);
9403    };
9404    /**
9405     * Creates an error thrown when the hash string value is unexpectedly empty.
9406     * @param hashValue
9407     */
9408    BrowserAuthError.createEmptyHashError = function (hashValue) {
9409        return new BrowserAuthError(BrowserAuthErrorMessage.hashEmptyError.code, BrowserAuthErrorMessage.hashEmptyError.desc + " Given Url: " + hashValue);
9410    };
9411    /**
9412     * Creates an error thrown when the hash string value is unexpectedly empty.
9413     */
9414    BrowserAuthError.createHashDoesNotContainStateError = function () {
9415        return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainStateError.code, BrowserAuthErrorMessage.hashDoesNotContainStateError.desc);
9416    };
9417    /**
9418     * Creates an error thrown when the hash string value does not contain known properties
9419     */
9420    BrowserAuthError.createHashDoesNotContainKnownPropertiesError = function () {
9421        return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.code, BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.desc);
9422    };
9423    /**
9424     * Creates an error thrown when the hash string value is unexpectedly empty.
9425     */
9426    BrowserAuthError.createUnableToParseStateError = function () {
9427        return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseStateError.code, BrowserAuthErrorMessage.unableToParseStateError.desc);
9428    };
9429    /**
9430     * Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.
9431     */
9432    BrowserAuthError.createStateInteractionTypeMismatchError = function () {
9433        return new BrowserAuthError(BrowserAuthErrorMessage.stateInteractionTypeMismatchError.code, BrowserAuthErrorMessage.stateInteractionTypeMismatchError.desc);
9434    };
9435    /**
9436     * Creates an error thrown when a browser interaction (redirect or popup) is in progress.
9437     */
9438    BrowserAuthError.createInteractionInProgressError = function () {
9439        return new BrowserAuthError(BrowserAuthErrorMessage.interactionInProgress.code, BrowserAuthErrorMessage.interactionInProgress.desc);
9440    };
9441    /**
9442     * Creates an error thrown when the popup window could not be opened.
9443     * @param errDetail
9444     */
9445    BrowserAuthError.createPopupWindowError = function (errDetail) {
9446        var errorMessage = BrowserAuthErrorMessage.popupWindowError.desc;
9447        errorMessage = !StringUtils.isEmpty(errDetail) ? errorMessage + " Details: " + errDetail : errorMessage;
9448        return new BrowserAuthError(BrowserAuthErrorMessage.popupWindowError.code, errorMessage);
9449    };
9450    /**
9451     * Creates an error thrown when window.open returns an empty window object.
9452     * @param errDetail
9453     */
9454    BrowserAuthError.createEmptyWindowCreatedError = function () {
9455        return new BrowserAuthError(BrowserAuthErrorMessage.emptyWindowError.code, BrowserAuthErrorMessage.emptyWindowError.desc);
9456    };
9457    /**
9458     * Creates an error thrown when the user closes a popup.
9459     */
9460    BrowserAuthError.createUserCancelledError = function () {
9461        return new BrowserAuthError(BrowserAuthErrorMessage.userCancelledError.code, BrowserAuthErrorMessage.userCancelledError.desc);
9462    };
9463    /**
9464     * Creates an error thrown when monitorPopupFromHash times out for a given popup.
9465     */
9466    BrowserAuthError.createMonitorPopupTimeoutError = function () {
9467        return new BrowserAuthError(BrowserAuthErrorMessage.monitorPopupTimeoutError.code, BrowserAuthErrorMessage.monitorPopupTimeoutError.desc);
9468    };
9469    /**
9470     * Creates an error thrown when monitorIframeFromHash times out for a given iframe.
9471     */
9472    BrowserAuthError.createMonitorIframeTimeoutError = function () {
9473        return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code, BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);
9474    };
9475    /**
9476     * Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.
9477     * @param windowParentCheck
9478     */
9479    BrowserAuthError.createRedirectInIframeError = function (windowParentCheck) {
9480        return new BrowserAuthError(BrowserAuthErrorMessage.redirectInIframeError.code, BrowserAuthErrorMessage.redirectInIframeError.desc + " (window.parent !== window) => " + windowParentCheck);
9481    };
9482    /**
9483     * Creates an error thrown when an auth reload is done inside an iframe.
9484     */
9485    BrowserAuthError.createBlockReloadInHiddenIframeError = function () {
9486        return new BrowserAuthError(BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.code, BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.desc);
9487    };
9488    /**
9489     * Creates an error thrown when a popup attempts to call an acquireToken API
9490     * @returns
9491     */
9492    BrowserAuthError.createBlockAcquireTokenInPopupsError = function () {
9493        return new BrowserAuthError(BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.code, BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.desc);
9494    };
9495    /**
9496     * Creates an error thrown when an iframe is found to be closed before the timeout is reached.
9497     */
9498    BrowserAuthError.createIframeClosedPrematurelyError = function () {
9499        return new BrowserAuthError(BrowserAuthErrorMessage.iframeClosedPrematurelyError.code, BrowserAuthErrorMessage.iframeClosedPrematurelyError.desc);
9500    };
9501    /**
9502     * Creates an error thrown when the logout API is called on any of the silent interaction clients
9503     */
9504    BrowserAuthError.createSilentLogoutUnsupportedError = function () {
9505        return new BrowserAuthError(BrowserAuthErrorMessage.silentLogoutUnsupportedError.code, BrowserAuthErrorMessage.silentLogoutUnsupportedError.desc);
9506    };
9507    /**
9508     * Creates an error thrown when the account object is not provided in the acquireTokenSilent API.
9509     */
9510    BrowserAuthError.createNoAccountError = function () {
9511        return new BrowserAuthError(BrowserAuthErrorMessage.noAccountError.code, BrowserAuthErrorMessage.noAccountError.desc);
9512    };
9513    /**
9514     * Creates an error thrown when a given prompt value is invalid for silent requests.
9515     */
9516    BrowserAuthError.createSilentPromptValueError = function (givenPrompt) {
9517        return new BrowserAuthError(BrowserAuthErrorMessage.silentPromptValueError.code, BrowserAuthErrorMessage.silentPromptValueError.desc + " Given value: " + givenPrompt);
9518    };
9519    /**
9520     * Creates an error thrown when the cached token request could not be retrieved from the cache
9521     */
9522    BrowserAuthError.createUnableToParseTokenRequestCacheError = function () {
9523        return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.code, BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.desc);
9524    };
9525    /**
9526     * Creates an error thrown when the token request could not be retrieved from the cache
9527     */
9528    BrowserAuthError.createNoTokenRequestCacheError = function () {
9529        return new BrowserAuthError(BrowserAuthErrorMessage.noTokenRequestCacheError.code, BrowserAuthErrorMessage.noTokenRequestCacheError.desc);
9530    };
9531    /**
9532     * Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)
9533     */
9534    BrowserAuthError.createAuthRequestNotSetError = function () {
9535        return new BrowserAuthError(BrowserAuthErrorMessage.authRequestNotSet.code, BrowserAuthErrorMessage.authRequestNotSet.desc);
9536    };
9537    /**
9538     * Creates an error thrown when the authority could not be retrieved from the cache
9539     */
9540    BrowserAuthError.createNoCachedAuthorityError = function () {
9541        return new BrowserAuthError(BrowserAuthErrorMessage.noCachedAuthorityError.code, BrowserAuthErrorMessage.noCachedAuthorityError.desc);
9542    };
9543    /**
9544     * Creates an error thrown if cache type is invalid.
9545     */
9546    BrowserAuthError.createInvalidCacheTypeError = function () {
9547        return new BrowserAuthError(BrowserAuthErrorMessage.invali
9547dCacheType.code, "" + BrowserAuthErrorMessage.invalidCacheType.desc);
9548    };
9549    /**
9550     * Create an error thrown when login and token requests are made from a non-browser environment
9551     */
9552    BrowserAuthError.createNonBrowserEnvironmentError = function () {
9553        return new BrowserAuthError(BrowserAuthErrorMessage.notInBrowserEnvironment.code, BrowserAuthErrorMessage.notInBrowserEnvironment.desc);
9554    };
9555    /**
9556     * Create an error thrown when indexDB database is not open
9557     */
9558    BrowserAuthError.createDatabaseNotOpenError = function () {
9559        return new BrowserAuthError(BrowserAuthErrorMessage.databaseNotOpen.code, BrowserAuthErrorMessage.databaseNotOpen.desc);
9560    };
9561    /**
9562     * Create an error thrown when token fetch fails due to no internet
9563     */
9564    BrowserAuthError.createNoNetworkConnectivityError = function () {
9565        return new BrowserAuthError(BrowserAuthErrorMessage.noNetworkConnectivity.code, BrowserAuthErrorMessage.noNetworkConnectivity.desc);
9566    };
9567    /**
9568     * Create an error thrown when token fetch fails due to reasons other than internet connectivity
9569     */
9570    BrowserAuthError.createPostRequestFailedError = function (errorDesc, endpoint) {
9571        return new BrowserAuthError(BrowserAuthErrorMessage.postRequestFailed.code, BrowserAuthErrorMessage.postRequestFailed.desc + " | Network client threw: " + errorDesc + " | Attempted to reach: " + endpoint.split("?")[0]);
9572    };
9573    /**
9574     * Create an error thrown when get request fails due to reasons other than internet connectivity
9575     */
9576    BrowserAuthError.createGetRequestFailedError = function (errorDesc, endpoint) {
9577        return new BrowserAuthError(BrowserAuthErrorMessage.getRequestFailed.code, BrowserAuthErrorMessage.getRequestFailed.desc + " | Network client threw: " + errorDesc + " | Attempted to reach: " + endpoint.split("?")[0]);
9578    };
9579    /**
9580     * Create an error thrown when network client fails to parse network response
9581     */
9582    BrowserAuthError.createFailedToParseNetworkResponseError = function (endpoint) {
9583        return new BrowserAuthError(BrowserAuthErrorMessage.failedToParseNetworkResponse.code, BrowserAuthErrorMessage.failedToParseNetworkResponse.desc + " | Attempted to reach: " + endpoint.split("?")[0]);
9584    };
9585    /**
9586     * Create an error thrown when the necessary information is not available to sideload tokens
9587     */
9588    BrowserAuthError.createUnableToLoadTokenError = function (errorDetail) {
9589        return new BrowserAuthError(BrowserAuthErrorMessage.unableToLoadTokenError.code, BrowserAuthErrorMessage.unableToLoadTokenError.desc + " | " + errorDetail);
9590    };
9591    /**
9592     * Create an error thrown when the queried cryptographic key is not found in IndexedDB
9593     */
9594    BrowserAuthError.createSigningKeyNotFoundInStorageError = function (keyId) {
9595        return new BrowserAuthError(BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code, BrowserAuthErrorMessage.signingKeyNotFoundInStorage.desc + " | No match found for KeyId: " + keyId);
9596    };
9597    /**
9598     * Create an error when an authorization code is required but not provided
9599     */
9600    BrowserAuthError.createAuthCodeRequiredError = function () {
9601        return new BrowserAuthError(BrowserAuthErrorMessage.authCodeRequired.code, BrowserAuthErrorMessage.authCodeRequired.desc);
9602    };
9603    /**
9604     * Create an error when an authorization code or native account ID is required but not provided
9605     */
9606    BrowserAuthError.createAuthCodeOrNativeAccountIdRequiredError = function () {
9607        return new BrowserAuthError(BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.code, BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.desc);
9608    };
9609    /**
9610     * Create an error when both authorization code and native account ID are provided
9611     */
9612    BrowserAuthError.createSpaCodeAndNativeAccountIdPresentError = function () {
9613        return new BrowserAuthError(BrowserAuthErrorMessage.spaCodeAndNativeAccountPresent.code, BrowserAuthErrorMessage.spaCodeAndNativeAccountPresent.desc);
9614    };
9615    /**
9616     * Create an error when IndexedDB is unavailable
9617     */
9618    BrowserAuthError.createDatabaseUnavailableError = function () {
9619        return new BrowserAuthError(BrowserAuthErrorMessage.databaseUnavailable.code, BrowserAuthErrorMessage.databaseUnavailable.desc);
9620    };
9621    /**
9622     * Create an error when native token acquisition is not possible
9623     */
9624    BrowserAuthError.createUnableToAcquireTokenFromNativePlatformError = function () {
9625        return new BrowserAuthError(BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.code, BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.desc);
9626    };
9627    /**
9628     * Create an error thrown when Handshake with browser extension times out
9629     */
9630    BrowserAuthError.createNativeHandshakeTimeoutError = function () {
9631        return new BrowserAuthError(BrowserAuthErrorMessage.nativeHandshakeTimeout.code, BrowserAuthErrorMessage.nativeHandshakeTimeout.desc);
9632    };
9633    /**
9634     * Create an error thrown when browser extension is not installed
9635     */
9636    BrowserAuthError.createNativeExtensionNotInstalledError = function () {
9637        return new BrowserAuthError(BrowserAuthErrorMessage.nativeExtensionNotInstalled.code, BrowserAuthErrorMessage.nativeExtensionNotInstalled.desc);
9638    };
9639    /**
9640     * Create an error when native connection has not been established
9641     * @returns
9642     */
9643    BrowserAuthError.createNativeConnectionNotEstablishedError = function () {
9644        return new BrowserAuthError(BrowserAuthErrorMessage.nativeConnectionNotEstablished.code, BrowserAuthErrorMessage.nativeConnectionNotEstablished.desc);
9645    };
9646    /**
9647     * Create an error thrown when the initialize function hasn't been called
9648     */
9649    BrowserAuthError.createNativeBrokerCalledBeforeInitialize = function () {
9650        return new BrowserAuthError(BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.code, BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.desc);
9651    };
9652    /**
9653     * Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create
9654     * These requests must go through eSTS to ensure eSTS is aware of the new account
9655     */
9656    BrowserAuthError.createNativePromptParameterNotSupportedError = function () {
9657        return new BrowserAuthError(BrowserAuthErrorMessage.nativePromptNotSupported.code, BrowserAuthErrorMessage.nativePromptNotSupported.desc);
9658    };
9659    return BrowserAuthError;
9660}(AuthError));
9661
9662/*
9663 * Copyright (c) Microsoft Corporation. All rights reserved.
9664 * Licensed under the MIT License.
9665 */
9666/**
9667 * Constants
9668 */
9669var BrowserConstants = {
9670    /**
9671     * Interaction in progress cache value
9672     */
9673    INTERACTION_IN_PROGRESS_VALUE: "interaction_in_progress",
9674    /**
9675     * Invalid grant error code
9676     */
9677    INVALID_GRANT_ERROR: "invalid_grant",
9678    /**
9679     * Default popup window width
9680     */
9681    POPUP_WIDTH: 483,
9682    /**
9683     * Default popup window height
9684     */
9685    POPUP_HEIGHT: 600,
9686    /**
9687     * Name of the popup window starts with
9688     */
9689    POPUP_NAME_PREFIX: "msal",
9690    /**
9691     * Default popup monitor poll interval in milliseconds
9692     */
9693    DEFAULT_POLL_INTERVAL_MS: 30,
9694    /**
9695     * Msal-browser SKU
9696     */
9697    MSAL_SKU: "msal.js.browser",
9698};
9699var NativeConstants = {
9700    CHANNEL_ID: "53ee284d-920a-4b59-9d30-a60315b26836",
9701    PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
9702    MATS_TELEMETRY: "MATS"
9703};
9704var NativeExtensionMethod;
9705(function (NativeExtensionMethod) {
9706    NativeExtensionMethod["HandshakeRequest"] = "Handshake";
9707    NativeExtensionMethod["HandshakeResponse"] = "HandshakeResponse";
9708    NativeExtensionMethod["GetToken"] = "GetToken";
9709    NativeExtensionMethod["Response"] = "Response";
9710})(NativeExtensionMethod || (NativeExtensionMethod = {}));
9711exports.BrowserCacheLocation = void 0;
9712(function (BrowserCacheLocation) {
9713    BrowserCacheLocation["LocalStorage"] = "localStorage";
9714    BrowserCacheLocation["SessionStorage"] = "sessionStorage";
9715    BrowserCacheLocation["MemoryStorage"] = "memoryStorage";
9716})(exports.BrowserCacheLocation || (exports.BrowserCacheLocation = {}));
9717/**
9718 * HTTP Request types supported by MSAL.
9719 */
9720var HTTP_REQUEST_TYPE;
9721(function (HTTP_REQUEST_TYPE) {
9722    HTTP_REQUEST_TYPE["GET"] = "GET";
9723    HTTP_REQUEST_TYPE["POST"] = "POST";
9724})(HTTP_REQUEST_TYPE || (HTTP_REQUEST_TYPE = {}));
9725/**
9726 * Temporary cache keys for MSAL, deleted after any request.
9727 */
9728var TemporaryCacheKeys;
9729(function (TemporaryCacheKeys) {
9730    TemporaryCacheKeys["AUTHORITY"] = "authority";
9731    TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireToken.account";
9732    TemporaryCacheKeys["SESSION_STATE"] = "session.state";
9733    TemporaryCacheKeys["REQUEST_STATE"] = "request.state";
9734    TemporaryCacheKeys["NONCE_IDTOKEN"] = "nonce.id_token";
9735    TemporaryCacheKeys["ORIGIN_URI"] = "request.origin";
9736    TemporaryCacheKeys["RENEW_STATUS"] = "token.renew.status";
9737    TemporaryCacheKeys["URL_HASH"] = "urlHash";
9738    TemporaryCacheKeys["REQUEST_PARAMS"] = "request.params";
9739    TemporaryCacheKeys["SCOPES"] = "scopes";
9740    TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
9741    TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
9742    TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
9743    TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
9744    TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
9745})(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
9746var StaticCacheKeys;
9747(function (StaticCacheKeys) {
9748    StaticCacheKeys["ACCOUNT_KEYS"] = "msal.account.keys";
9749    StaticCacheKeys["TOKEN_KEYS"] = "msal.token.keys";
9750})(StaticCacheKeys || (StaticCacheKeys = {}));
9751/**
9752 * Cache keys stored in-memory
9753 */
9754var InMemoryCacheKeys;
9755(function (InMemoryCacheKeys) {
9756    InMemoryCacheKeys["WRAPPER_SKU"] = "wrapper.sku";
9757    InMemoryCacheKeys["WRAPPER_VER"] = "wrapper.version";
9758})(InMemoryCacheKeys || (InMemoryCacheKeys = {}));
9759/**
9760 * API Codes for Telemetry purposes.
9761 * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
9762 * 0-99 Silent Flow
9763 * 800-899 Auth Code Flow
9764 */
9765exports.ApiId = void 0;
9766(function (ApiId) {
9767    ApiId[ApiId["acquireTokenRedirect"] = 861] = "acquireTokenRedirect";
9768    ApiId[ApiId["acquireTokenPopup"] = 862] = "acquireTokenPopup";
9769    ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
9770    ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
9771    ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
9772    ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
9773    ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
9774    ApiId[ApiId["logout"] = 961] = "logout";
9775    ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
9776})(exports.ApiId || (exports.ApiId = {}));
9777/*
9778 * Interaction type of the API - used for state and telemetry
9779 */
9780exports.InteractionType = void 0;
9781(function (InteractionType) {
9782    InteractionType["Redirect"] = "redirect";
9783    InteractionType["Popup"] = "popup";
9784    InteractionType["Silent"] = "silent";
9785    InteractionType["None"] = "none";
9786})(exports.InteractionType || (exports.InteractionType = {}));
9787/**
9788 * Types of interaction currently in progress.
9789 * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
9790 */
9791exports.InteractionStatus = void 0;
9792(function (InteractionStatus) {
9793    /**
9794     * Initial status before interaction occurs
9795     */
9796    InteractionStatus["Startup"] = "startup";
9797    /**
9798     * Status set when all login calls occuring
9799     */
9800    InteractionStatus["Login"] = "login";
9801    /**
9802     * Status set when logout call occuring
9803     */
9804    InteractionStatus["Logout"] = "logout";
9805    /**
9806     * Status set for acquireToken calls
9807     */
9808    InteractionStatus["AcquireToken"] = "acquireToken";
9809    /**
9810     * Status set for ssoSilent calls
9811     */
9812    InteractionStatus["SsoSilent"] = "ssoSilent";
9813    /**
9814     * Status set when handleRedirect in progress
9815     */
9816    InteractionStatus["HandleRedirect"] = "handleRedirect";
9817    /**
9818     * Status set when interaction is complete
9819     */
9820    InteractionStatus["None"] = "none";
9821})(exports.InteractionStatus || (exports.InteractionStatus = {}));
9822var DEFAULT_REQUEST = {
9823    scopes: OIDC_DEFAULT_SCOPES
9824};
9825/**
9826 * JWK Key Format string (Type MUST be defined for window crypto APIs)
9827 */
9828var KEY_FORMAT_JWK = "jwk";
9829// Supported wrapper SKUs
9830exports.WrapperSKU = void 0;
9831(function (WrapperSKU) {
9832    WrapperSKU["React"] = "@azure/msal-react";
9833    WrapperSKU["Angular"] = "@azure/msal-angular";
9834})(exports.WrapperSKU || (exports.WrapperSKU = {}));
9835// DatabaseStorage Constants
9836var DB_NAME = "msal.db";
9837var DB_VERSION = 1;
9838var DB_TABLE_NAME = DB_NAME + ".keys";
9839exports.CacheLookupPolicy = void 0;
9840(function (CacheLookupPolicy) {
9841    /*
9842     * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
9843     * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
9844     * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
9845     */
9846    CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
9847    /*
9848     * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
9849     * refresh tokens.
9850     */
9851    CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
9852    /*
9853     * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
9854     * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
9855     * will not be renewed and acquireTokenSilent will fail.
9856     */
9857    CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
9858    /*
9859     * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
9860     * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
9861     * renewed and acquireTokenSilent will fail.
9862     */
9863    CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
9864    /*
9865     * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
9866     * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
9867     * setting "forceRefresh: true".
9868     */
9869    CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
9870    /*
9871     * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
9872     * always fail if 3rd party cookies are blocked by the browser.
9873     */
9874    CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
9875})(exports.CacheLookupPolicy || (exports.CacheLookupPolicy = {}));
9876
9877/*
9878 * Copyright (c) Microsoft Corporation. All rights reserved.
9879 * Licensed under the MIT License.
9880 */
9881/**
9882 * BrowserAuthErrorMessage class containing string constants used by error codes and messages.
9883 */
9884var BrowserConfigurationAuthErrorMessage = {
9885    redirectUriNotSet: {
9886        code: "redirect_uri_empty",
9887        desc: "A redirect URI is required for all calls, and none has been set."
9888    },
9889    postLogoutUriNotSet: {
9890        code: "post_logout_uri_empty",
9891        desc: "A post logout redirect has not been set."
9892    },
9893    storageNotSupportedError: {
9894        code: "storage_not_supported",
9895        desc: "Given storage configuration option was not supported."
9896    },
9897    noRedirectCallbacksSet: {
9898        code: "no_redirect_callbacks",
9899        desc: "No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. " +
9900            "More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."
9901    },
9902    invalidCallbackObject: {
9903        code: "invalid_callback_object",
9904        desc: "The object passed for the callback was invalid. " +
9905            "More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."
9906    },
9907    stubPcaInstanceCalled: {
9908        code: "stubbed_public_client_application_called",
9909        desc: "Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"
9910    },
9911    inMemRedirectUnavailable: {
9912        code: "in_mem_redirect_unavailable",
9913        desc: "Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."
9914    },
9915    entropyNotProvided: {
9916        code: "entropy_not_provided",
9917        desc: "The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."
9918    }
9919};
9920/**
9921 * Browser library error class thrown by the MSAL.js library for SPAs
9922 */
9923var BrowserConfigurationAuthError = /** @class */ (function (_super) {
9924    __extends$1(BrowserConfigurationAuthError, _super);
9925    function BrowserConfigurationAuthError(errorCode, errorMessage) {
9926        var _this = _super.call(this, errorCode, errorMessage) || this;
9927        _this.name = "BrowserConfigurationAuthError";
9928        Object.setPrototypeOf(_this, BrowserConfigurationAuthError.prototype);
9929        return _this;
9930    }
9931    /**
9932     * Creates an error thrown when the redirect uri is empty (not set by caller)
9933     */
9934    BrowserConfigurationAuthError.createRedirectUriEmptyError = function () {
9935        return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.redirectUriNotSet.code, BrowserConfigurationAuthErrorMessage.redirectUriNotSet.desc);
9936    };
9937    /**
9938     * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)
9939     */
9940    BrowserConfigurationAuthError.createPostLogoutRedirectUriEmptyError = function () {
9941        return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.postLogoutUriNotSet.code, BrowserConfigurationAuthErrorMessage.postLogoutUriNotSet.desc);
9942    };
9943    /**
9944     * Creates error thrown when given storage location is not supported.
9945     * @param givenStorageLocation
9946     */
9947    BrowserConfigurationAuthError.createStorageNotSupportedError = function (givenStorageLocation) {
9948        return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.storageNotSupportedError.code, BrowserConfigurationAuthErrorMessage.storageNotSupportedError.desc + " Given Location: " + givenStorageLocation);
9949    };
9950    /**
9951     * Creates error thrown when redirect callbacks are not set before calling loginRedirect() or acquireTokenRedirect().
9952     */
9953    BrowserConfigurationAuthError.createRedirectCallbacksNotSetError = function () {
9954        return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.noRedirectCallbacksSet.code, BrowserConfigurationAuthErrorMessage.noRedirectCallbacksSet.desc);
9955    };
9956    /**
9957     * Creates error thrown when the stub instance of PublicClientApplication is called.
9958     */
9959    BrowserConfigurationAuthError.createStubPcaInstanceCalledError = function () {
9960        return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.stubPcaInstanceCalled.code, BrowserConfigurationAuthErrorMessage.stubPcaInstanceCalled.desc);
9961    };
9962    /*
9963     * Create an error thrown when in-memory storage is used and storeAuthStateInCookie=false.
9964     */
9965    BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError = function () {
9966        return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.inMemRedirectUnavailable.code, BrowserConfigurationAuthErrorMessage.inMemRedirectUnavailable.desc);
9967    };
9968    /**
9969     * Creates an error thrown when a crypto interface that requires entro
vendor: 5,504 bytes, lines 9969-10112
9969py is initialized without entropy
9970     */
9971    BrowserConfigurationAuthError.createEntropyNotProvided = function () {
9972        return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.entropyNotProvided.code, BrowserConfigurationAuthErrorMessage.entropyNotProvided.desc);
9973    };
9974    return BrowserConfigurationAuthError;
9975}(AuthError));
9976
9977/*
9978 * Copyright (c) Microsoft Corporation. All rights reserved.
9979 * Licensed under the MIT License.
9980 */
9981var BrowserStorage = /** @class */ (function () {
9982    function BrowserStorage(cacheLocation) {
9983        this.validateWindowStorage(cacheLocation);
9984        this.windowStorage = window[cacheLocation];
9985    }
9986    BrowserStorage.prototype.validateWindowStorage = function (cacheLocation) {
9987        if (cacheLocation !== exports.BrowserCacheLocation.LocalStorage && cacheLocation !== exports.BrowserCacheLocation.SessionStorage) {
9988            throw BrowserConfigurationAuthError.createStorageNotSupportedError(cacheLocation);
9989        }
9990        var storageSupported = !!window[cacheLocation];
9991        if (!storageSupported) {
9992            throw BrowserConfigurationAuthError.createStorageNotSupportedError(cacheLocation);
9993        }
9994    };
9995    BrowserStorage.prototype.getItem = function (key) {
9996        return this.windowStorage.getItem(key);
9997    };
9998    BrowserStorage.prototype.setItem = function (key, value) {
9999        this.windowStorage.setItem(key, value);
10000    };
10001    BrowserStorage.prototype.removeItem = function (key) {
10002        this.windowStorage.removeItem(key);
10003    };
10004    BrowserStorage.prototype.getKeys = function () {
10005        return Object.keys(this.windowStorage);
10006    };
10007    BrowserStorage.prototype.containsKey = function (key) {
10008        return this.windowStorage.hasOwnProperty(key);
10009    };
10010    return BrowserStorage;
10011}());
10012
10013/*
10014 * Copyright (c) Microsoft Corporation. All rights reserved.
10015 * Licensed under the MIT License.
10016 */
10017var MemoryStorage = /** @class */ (function () {
10018    function MemoryStorage() {
10019        this.cache = new Map();
10020    }
10021    MemoryStorage.prototype.getItem = function (key) {
10022        return this.cache.get(key) || null;
10023    };
10024    MemoryStorage.prototype.setItem = function (key, value) {
10025        this.cache.set(key, value);
10026    };
10027    MemoryStorage.prototype.removeItem = function (key) {
10028        this.cache.delete(key);
10029    };
10030    MemoryStorage.prototype.getKeys = function () {
10031        var cacheKeys = [];
10032        this.cache.forEach(function (value, key) {
10033            cacheKeys.push(key);
10034        });
10035        return cacheKeys;
10036    };
10037    MemoryStorage.prototype.containsKey = function (key) {
10038        return this.cache.has(key);
10039    };
10040    MemoryStorage.prototype.clear = function () {
10041        this.cache.clear();
10042    };
10043    return MemoryStorage;
10044}());
10045
10046/*
10047 * Copyright (c) Microsoft Corporation. All rights reserved.
10048 * Licensed under the MIT License.
10049 */
10050var BrowserProtocolUtils = /** @class */ (function () {
10051    function BrowserProtocolUtils() {
10052    }
10053    /**
10054     * Extracts the BrowserStateObject from the state string.
10055     * @param browserCrypto
10056     * @param state
10057     */
10058    BrowserProtocolUtils.extractBrowserRequestState = function (browserCrypto, state) {
10059        if (StringUtils.isEmpty(state)) {
10060            return null;
10061        }
10062        try {
10063            var requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);
10064            return requestStateObj.libraryState.meta;
10065        }
10066        catch (e) {
10067            throw ClientAuthError.createInvalidStateError(state, e);
10068        }
10069    };
10070    /**
10071     * Parses properties of server response from url hash
10072     * @param locationHash Hash from url
10073     */
10074    BrowserProtocolUtils.parseServerResponseFromHash = function (locationHash) {
10075        if (!locationHash) {
10076            return {};
10077        }
10078        var hashUrlString = new UrlString(locationHash);
10079        return UrlString.getDeserializedHash(hashUrlString.getHash());
10080    };
10081    return BrowserProtocolUtils;
10082}());
10083
10084/*
10085 * Copyright (c) Microsoft Corporation. All rights reserved.
10086 * Licensed under the MIT License.
10087 */
10088/**
10089 * This class implements the cache storage interface for MSAL through browser local or session storage.
10090 * Cookies are only used if storeAuthStateInCookie is true, and are only used for
10091 * parameters such as state and nonce, generally.
10092 */
10093var BrowserCacheManager = /** @class */ (function (_super) {
10094    __extends$1(BrowserCacheManager, _super);
10095    function BrowserCacheManager(clientId, cacheConfig, cryptoImpl, logger) {
10096        var _this = _super.call(this, clientId, cryptoImpl, logger) || this;
10097        // Cookie life calculation (hours * minutes * seconds * ms)
10098        _this.COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
10099        _this.cacheConfig = cacheConfig;
10100        _this.logger = logger;
10101        _this.internalStorage = new MemoryStorage();
10102        _this.browserStorage = _this.setupBrowserStorage(_this.cacheConfig.cacheLocation);
10103        _this.temporaryCacheStorage = _this.setupTemporaryCacheStorage(_this.cacheConfig.temporaryCacheLocation, _this.cacheConfig.cacheLocation);
10104        // Migrate cache entries from older versions of MSAL.
10105        if (cacheConfig.cacheMigrationEnabled) {
10106            _this.migrateCacheEntries();
10107            _this.createKeyMaps();
10108        }
10109        return _this;
10110    }
10111    /**
10112     * Returns a window storage class implementing the IWindowStorage interface that c
10112orresponds to the configured cacheLocation.
10113     * @param cacheLocation
10114     */
10115    BrowserCacheManager.prototype.setupBrowserStorage = function (cacheLocation) {
10116        switch (cacheLocation) {
10117            case exports.BrowserCacheLocation.LocalStorage:
10118            case exports.BrowserCacheLocation.SessionStorage:
10119                try {
10120                    return new BrowserStorage(cacheLocation);
10121                }
10122                catch (e) {
10123                    this.logger.verbose(e);
10124                    break;
10125                }
10126            case exports.BrowserCacheLocation.MemoryStorage:
10127        }
10128        this.cacheConfig.cacheLocation = exports.BrowserCacheLocation.MemoryStorage;
10129        return new MemoryStorage();
10130    };
10131    /**
10132     * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.
10133     * @param temporaryCacheLocation
10134     * @param cacheLocation
10135     */
10136    BrowserCacheManager.prototype.setupTemporaryCacheStorage = function (temporaryCacheLocation, cacheLocation) {
10137        switch (cacheLocation) {
10138            case exports.BrowserCacheLocation.LocalStorage:
10139            case exports.BrowserCacheLocation.SessionStorage:
10140                try {
10141                    /*
10142                     * When users do not explicitly choose their own temporaryCacheLocation,
10143                     * temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs
10144                     */
10145                    return new BrowserStorage(temporaryCacheLocation || exports.BrowserCacheLocation.SessionStorage);
10146                }
10147                catch (e) {
10148                    this.logger.verbose(e);
10149                    return this.internalStorage;
10150                }
10151            case exports.BrowserCacheLocation.MemoryStorage:
10152            default:
10153                return this.internalStorage;
10154        }
10155    };
10156    /**
10157     * Migrate all old cache entries to new schema. No rollback supported.
10158     * @param storeAuthStateInCookie
10159     */
10160    BrowserCacheManager.prototype.migrateCacheEntries = function () {
10161        var _this = this;
10162        var idTokenKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.ID_TOKEN;
10163        var clientInfoKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.CLIENT_INFO;
10164        var errorKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.ERROR;
10165        var errorDescKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.ERROR_DESC;
10166        var idTokenValue = this.browserStorage.getItem(idTokenKey);
10167        var clientInfoValue = this.browserStorage.getItem(clientInfoKey);
10168        var errorValue = this.browserStorage.getItem(errorKey);
10169        var errorDescValue = this.browserStorage.getItem(errorDescKey);
10170        var values = [idTokenValue, clientInfoValue, errorValue, errorDescValue];
10171        var keysToMigrate = [PersistentCacheKeys.ID_TOKEN, PersistentCacheKeys.CLIENT_INFO, PersistentCacheKeys.ERROR, PersistentCacheKeys.ERROR_DESC];
10172        keysToMigrate.forEach(function (cacheKey, index) { return _this.migrateCacheEntry(cacheKey, values[index]); });
10173    };
10174    /**
10175     * Utility function to help with migration.
10176     * @param newKey
10177     * @param value
10178     * @param storeAuthStateInCookie
10179     */
10180    BrowserCacheManager.prototype.migrateCacheEntry = function (newKey, value) {
10181        if (value) {
10182            this.setTemporaryCache(newKey, value, true);
10183        }
10184    };
10185    /**
10186     * Searches all cache entries for MSAL accounts and creates the account key map
10187     * This is used to migrate users from older versions of MSAL which did not create the map.
10188     * @returns
10189     */
10190    BrowserCacheManager.prototype.createKeyMaps = function () {
10191        var _this = this;
10192        this.logger.trace("BrowserCacheManager - createKeyMaps called.");
10193        var accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);
10194        var tokenKeys = this.getItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId);
10195        if (accountKeys && tokenKeys) {
10196            this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");
10197            // Key maps already exist, no need to iterate through cache
10198            return;
10199        }
10200        var allKeys = this.browserStorage.getKeys();
10201        allKeys.forEach(function (key) {
10202            if (_this.isCredentialKey(key)) {
10203                // Get item, parse, validate and write key to map
10204                var value = _this.getItem(key);
10205                if (value) {
10206                    var credObj = _this.validateAndParseJson(value);
10207                    if (credObj && credObj.hasOwnProperty("credentialType")) {
10208                        switch (credObj["credentialType"]) {
10209                            case CredentialType.ID_TOKEN:
10210                                if (IdTokenEntity.isIdTokenEntity(credObj
vendor: 41,126 bytes, lines 10210-11043
10210)) {
10211                                    _this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map");
10212                                    _this.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: " + key + " found, saving key to token key map");
10213                                    var idTokenEntity = CacheManager.toObject(new IdTokenEntity(), credObj);
10214                                    var newKey = _this.updateCredentialCacheKey(key, idTokenEntity);
10215                                    _this.addTokenKey(newKey, CredentialType.ID_TOKEN);
10216                                    return;
10217                                }
10218                                else {
10219                                    _this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping.");
10220                                    _this.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: " + key);
10221                                }
10222                                break;
10223                            case CredentialType.ACCESS_TOKEN:
10224                            case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
10225                                if (AccessTokenEntity.isAccessTokenEntity(credObj)) {
10226                                    _this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map");
10227                                    _this.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: " + key + " found, saving key to token key map");
10228                                    var accessTokenEntity = CacheManager.toObject(new AccessTokenEntity(), credObj);
10229                                    var newKey = _this.updateCredentialCacheKey(key, accessTokenEntity);
10230                                    _this.addTokenKey(newKey, CredentialType.ACCESS_TOKEN);
10231                                    return;
10232                                }
10233                                else {
10234                                    _this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping.");
10235                                    _this.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: " + key);
10236                                }
10237                                break;
10238                            case CredentialType.REFRESH_TOKEN:
10239                                if (RefreshTokenEntity.isRefreshTokenEntity(credObj)) {
10240                                    _this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map");
10241                                    _this.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: " + key + " found, saving key to token key map");
10242                                    var refreshTokenEntity = CacheManager.toObject(new RefreshTokenEntity(), credObj);
10243                                    var newKey = _this.updateCredentialCacheKey(key, refreshTokenEntity);
10244                                    _this.addTokenKey(newKey, CredentialType.REFRESH_TOKEN);
10245                                    return;
10246                                }
10247                                else {
10248                                    _this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping.");
10249                                    _this.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: " + key);
10250                                }
10251                                break;
10252                            // If credentialType isn't one of our predefined ones, it may not be an MSAL cache value. Ignore.
10253                        }
10254                    }
10255                }
10256            }
10257            if (_this.isAccountKey(key)) {
10258                var value = _this.getItem(key);
10259                if (value) {
10260                    var accountObj = _this.validateAndParseJson(value);
10261                    if (accountObj && AccountEntity.isAccountEntity(accountObj)) {
10262                        _this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map");
10263                        _this.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: " + key + " found, saving key to account key map");
10264                        _this.addAccountKeyToMap(key);
10265                    }
10266                }
10267            }
10268        });
10269    };
10270    /**
10271     * Parses passed value as JSON object, JSON.parse() will throw an error.
10272     * @param input
10273     */
10274    BrowserCacheManager.prototype.validateAndParseJson = function (jsonValue) {
10275        try {
10276            var parsedJson = JSON.parse(jsonValue);
10277            /**
10278             * There are edge cases in which JSON.parse will successfully parse a non-valid JSON object
10279             * (e.g. JSON.parse will parse an escaped string into an unescaped string), so adding a type check
10280             * of the parsed value is necessary in order to be certain that the string represents a valid JSON object.
10281             *
10282             */
10283            return (parsedJson && typeof parsedJson === "object") ? parsedJson : null;
10284        }
10285        catch (error) {
10286            return null;
10287        }
10288    };
10289    /**
10290     * fetches the entry from the browser storage based off the key
10291     * @param key
10292     */
10293    BrowserCacheManager.prototype.getItem = function (key) {
10294        return this.browserStorage.getItem(key);
10295    };
10296    /**
10297     * sets the entry in the browser storage
10298     * @param key
10299     * @param value
10300     */
10301    BrowserCacheManager.prototype.setItem = function (key, value) {
10302        this.browserStorage.setItem(key, value);
10303    };
10304    /**
10305     * fetch the account entity from the platform cache
10306     * @param accountKey
10307     */
10308    BrowserCacheManager.prototype.getAccount = function (accountKey) {
10309        this.logger.trace("BrowserCacheManager.getAccount called");
10310        var account = this.getItem(accountKey);
10311        if (!account) {
10312            this.removeAccountKeyFromMap(accountKey);
10313            return null;
10314        }
10315        var parsedAccount = this.validateAndParseJson(account);
10316        if (!parsedAccount || !AccountEntity.isAccountEntity(parsedAccount)) {
10317            this.removeAccountKeyFromMap(accountKey);
10318            return null;
10319        }
10320        return CacheManager.toObject(new AccountEntity(), parsedAccount);
10321    };
10322    /**
10323     * set account entity in the platform cache
10324     * @param key
10325     * @param value
10326     */
10327    BrowserCacheManager.prototype.setAccount = function (account) {
10328        this.logger.trace("BrowserCacheManager.setAccount called");
10329        var key = account.generateAccountKey();
10330        this.setItem(key, JSON.stringify(account));
10331        this.addAccountKeyToMap(key);
10332    };
10333    /**
10334     * Returns the array of account keys currently cached
10335     * @returns
10336     */
10337    BrowserCacheManager.prototype.getAccountKeys = function () {
10338        this.logger.trace("BrowserCacheManager.getAccountKeys called");
10339        var accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);
10340        if (accountKeys) {
10341            return JSON.parse(accountKeys);
10342        }
10343        this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found");
10344        return [];
10345    };
10346    /**
10347     * Add a new account to the key map
10348     * @param key
10349     */
10350    BrowserCacheManager.prototype.addAccountKeyToMap = function (key) {
10351        this.logger.trace("BrowserCacheManager.addAccountKeyToMap called");
10352        this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: " + key);
10353        var accountKeys = this.getAccountKeys();
10354        if (accountKeys.indexOf(key) === -1) {
10355            // Only add key if it does not already exist in the map
10356            accountKeys.push(key);
10357            this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
10358            this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added");
10359        }
10360        else {
10361            this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map");
10362        }
10363    };
10364    /**
10365     * Remove an account from the key map
10366     * @param key
10367     */
10368    BrowserCacheManager.prototype.removeAccountKeyFromMap = function (key) {
10369        this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called");
10370        this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: " + key);
10371        var accountKeys = this.getAccountKeys();
10372        var removalIndex = accountKeys.indexOf(key);
10373        if (removalIndex > -1) {
10374            accountKeys.splice(removalIndex, 1);
10375            this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
10376            this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed");
10377        }
10378        else {
10379            this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map");
10380        }
10381    };
10382    /**
10383     * Extends inherited removeAccount function to include removal of the account key from the map
10384     * @param key
10385     */
10386    BrowserCacheManager.prototype.removeAccount = function (key) {
10387        return __awaiter$1(this, void 0, void 0, function () {
10388            return __generator$1(this, function (_a) {
10389                _super.prototype.removeAccount.call(this, key);
10390                this.removeAccountKeyFromMap(key);
10391                return [2 /*return*/];
10392            });
10393        });
10394    };
10395    /**
10396     * Removes given idToken from the cache and from the key map
10397     * @param key
10398     */
10399    BrowserCacheManager.prototype.removeIdToken = function (key) {
10400        _super.prototype.removeIdToken.call(this, key);
10401        this.removeTokenKey(key, CredentialType.ID_TOKEN);
10402    };
10403    /**
10404     * Removes given accessToken from the cache and from the key map
10405     * @param key
10406     */
10407    BrowserCacheManager.prototype.removeAccessToken = function (key) {
10408        return __awaiter$1(this, void 0, void 0, function () {
10409            return __generator$1(this, function (_a) {
10410                _super.prototype.removeAccessToken.call(this, key);
10411                this.removeTokenKey(key, CredentialType.ACCESS_TOKEN);
10412                return [2 /*return*/];
10413            });
10414        });
10415    };
10416    /**
10417     * Removes given refreshToken from the cache and from the key map
10418     * @param key
10419     */
10420    BrowserCacheManager.prototype.removeRefreshToken = function (key) {
10421        _super.prototype.removeRefreshToken.call(this, key);
10422        this.removeTokenKey(key, CredentialType.REFRESH_TOKEN);
10423    };
10424    /**
10425     * Gets the keys for the cached tokens associated with this clientId
10426     * @returns
10427     */
10428    BrowserCacheManager.prototype.getTokenKeys = function () {
10429        this.logger.trace("BrowserCacheManager.getTokenKeys called");
10430        var item = this.getItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId);
10431        if (item) {
10432            var tokenKeys = this.validateAndParseJson(item);
10433            if (tokenKeys &&
10434                tokenKeys.hasOwnProperty("idToken") &&
10435                tokenKeys.hasOwnProperty("accessToken") &&
10436                tokenKeys.hasOwnProperty("refreshToken")) {
10437                return tokenKeys;
10438            }
10439            else {
10440                this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.");
10441            }
10442        }
10443        else {
10444            this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");
10445        }
10446        return {
10447            idToken: [],
10448            accessToken: [],
10449            refreshToken: []
10450        };
10451    };
10452    /**
10453     * Adds the given key to the token key map
10454     * @param key
10455     * @param type
10456     */
10457    BrowserCacheManager.prototype.addTokenKey = function (key, type) {
10458        this.logger.trace("BrowserCacheManager addTokenKey called");
10459        var tokenKeys = this.getTokenKeys();
10460        switch (type) {
10461            case CredentialType.ID_TOKEN:
10462                if (tokenKeys.idToken.indexOf(key) === -1) {
10463                    this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map");
10464                    tokenKeys.idToken.push(key);
10465                }
10466                break;
10467            case CredentialType.ACCESS_TOKEN:
10468                if (tokenKeys.accessToken.indexOf(key) === -1) {
10469                    this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map");
10470                    tokenKeys.accessToken.push(key);
10471                }
10472                break;
10473            case CredentialType.REFRESH_TOKEN:
10474                if (tokenKeys.refreshToken.indexOf(key) === -1) {
10475                    this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map");
10476                    tokenKeys.refreshToken.push(key);
10477                }
10478                break;
10479            default:
10480                this.logger.error("BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: " + type);
10481                ClientAuthError.createUnexpectedCredentialTypeError();
10482        }
10483        this.setItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId, JSON.stringify(tokenKeys));
10484    };
10485    /**
10486     * Removes the given key from the token key map
10487     * @param key
10488     * @param type
10489     */
10490    BrowserCacheManager.prototype.removeTokenKey = function (key, type) {
10491        this.logger.trace("BrowserCacheManager removeTokenKey called");
10492        var tokenKeys = this.getTokenKeys();
10493        switch (type) {
10494            case CredentialType.ID_TOKEN:
10495                this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: " + key + " from map");
10496                var idRemoval = tokenKeys.idToken.indexOf(key);
10497                if (idRemoval > -1) {
10498                    this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map");
10499                    tokenKeys.idToken.splice(idRemoval, 1);
10500                }
10501                else {
10502                    this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");
10503                }
10504                break;
10505            case CredentialType.ACCESS_TOKEN:
10506                this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: " + key + " from map");
10507                var accessRemoval = tokenKeys.accessToken.indexOf(key);
10508                if (accessRemoval > -1) {
10509                    this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map");
10510                    tokenKeys.accessToken.splice(accessRemoval, 1);
10511                }
10512                else {
10513                    this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");
10514                }
10515                break;
10516            case CredentialType.REFRESH_TOKEN:
10517                this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: " + key + " from map");
10518                var refreshRemoval = tokenKeys.refreshToken.indexOf(key);
10519                if (refreshRemoval > -1) {
10520                    this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map");
10521                    tokenKeys.refreshToken.splice(refreshRemoval, 1);
10522                }
10523                else {
10524                    this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");
10525                }
10526                break;
10527            default:
10528                this.logger.error("BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: " + type);
10529                ClientAuthError.createUnexpectedCredentialTypeError();
10530        }
10531        this.setItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId, JSON.stringify(tokenKeys));
10532    };
10533    /**
10534     * generates idToken entity from a string
10535     * @param idTokenKey
10536     */
10537    BrowserCacheManager.prototype.getIdTokenCredential = function (idTokenKey) {
10538        var value = this.getItem(idTokenKey);
10539        if (!value) {
10540            this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit");
10541            this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);
10542            return null;
10543        }
10544        var parsedIdToken = this.validateAndParseJson(value);
10545        if (!parsedIdToken || !IdTokenEntity.isIdTokenEntity(parsedIdToken)) {
10546            this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit");
10547            this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);
10548            return null;
10549        }
10550        this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit");
10551        return CacheManager.toObject(new IdTokenEntity(), parsedIdToken);
10552    };
10553    /**
10554     * set IdToken credential to the platform cache
10555     * @param idToken
10556     */
10557    BrowserCacheManager.prototype.setIdTokenCredential = function (idToken) {
10558        this.logger.trace("BrowserCacheManager.setIdTokenCredential called");
10559        var idTokenKey = idToken.generateCredentialKey();
10560        this.setItem(idTokenKey, JSON.stringify(idToken));
10561        this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);
10562    };
10563    /**
10564     * generates accessToken entity from a string
10565     * @param key
10566     */
10567    BrowserCacheManager.prototype.getAccessTokenCredential = function (accessTokenKey) {
10568        var value = this.getItem(accessTokenKey);
10569        if (!value) {
10570            this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit");
10571            this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
10572            return null;
10573        }
10574        var parsedAccessToken = this.validateAndParseJson(value);
10575        if (!parsedAccessToken || !AccessTokenEntity.isAccessTokenEntity(parsedAccessToken)) {
10576            this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit");
10577            this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
10578            return null;
10579        }
10580        this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit");
10581        return CacheManager.toObject(new AccessTokenEntity(), parsedAccessToken);
10582    };
10583    /**
10584     * set accessToken credential to the platform cache
10585     * @param accessToken
10586     */
10587    BrowserCacheManager.prototype.setAccessTokenCredential = function (accessToken) {
10588        this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");
10589        var accessTokenKey = accessToken.generateCredentialKey();
10590        this.setItem(accessTokenKey, JSON.stringify(accessToken));
10591        this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
10592    };
10593    /**
10594     * generates refreshToken entity from a string
10595     * @param refreshTokenKey
10596     */
10597    BrowserCacheManager.prototype.getRefreshTokenCredential = function (refreshTokenKey) {
10598        var value = this.getItem(refreshTokenKey);
10599        if (!value) {
10600            this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit");
10601            this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
10602            return null;
10603        }
10604        var parsedRefreshToken = this.validateAndParseJson(value);
10605        if (!parsedRefreshToken || !RefreshTokenEntity.isRefreshTokenEntity(parsedRefreshToken)) {
10606            this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit");
10607            this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
10608            return null;
10609        }
10610        this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit");
10611        return CacheManager.toObject(new RefreshTokenEntity(), parsedRefreshToken);
10612    };
10613    /**
10614     * set refreshToken credential to the platform cache
10615     * @param refreshToken
10616     */
10617    BrowserCacheManager.prototype.setRefreshTokenCredential = function (refreshToken) {
10618        this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");
10619        var refreshTokenKey = refreshToken.generateCredentialKey();
10620        this.setItem(refreshTokenKey, JSON.stringify(refreshToken));
10621        this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
10622    };
10623    /**
10624     * fetch appMetadata entity from the platform cache
10625     * @param appMetadataKey
10626     */
10627    BrowserCacheManager.prototype.getAppMetadata = function (appMetadataKey) {
10628        var value = this.getItem(appMetadataKey);
10629        if (!value) {
10630            this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit");
10631            return null;
10632        }
10633        var parsedMetadata = this.validateAndParseJson(value);
10634        if (!parsedMetadata || !AppMetadataEntity.isAppMetadataEntity(appMetadataKey, parsedMetadata)) {
10635            this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit");
10636            return null;
10637        }
10638        this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit");
10639        return CacheManager.toObject(new AppMetadataEntity(), parsedMetadata);
10640    };
10641    /**
10642     * set appMetadata entity to the platform cache
10643     * @param appMetadata
10644     */
10645    BrowserCacheManager.prototype.setAppMetadata = function (appMetadata) {
10646        this.logger.trace("BrowserCacheManager.setAppMetadata called");
10647        var appMetadataKey = appMetadata.generateAppMetadataKey();
10648        this.setItem(appMetadataKey, JSON.stringify(appMetadata));
10649    };
10650    /**
10651     * fetch server telemetry entity from the platform cache
10652     * @param serverTelemetryKey
10653     */
10654    BrowserCacheManager.prototype.getServerTelemetry = function (serverTelemetryKey) {
10655        var value = this.getItem(serverTelemetryKey);
10656        if (!value) {
10657            this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit");
10658            return null;
10659        }
10660        var parsedMetadata = this.validateAndParseJson(value);
10661        if (!parsedMetadata || !ServerTelemetryEntity.isServerTelemetryEntity(serverTelemetryKey, parsedMetadata)) {
10662            this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit");
10663            return null;
10664        }
10665        this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit");
10666        return CacheManager.toObject(new ServerTelemetryEntity(), parsedMetadata);
10667    };
10668    /**
10669     * set server telemetry entity to the platform cache
10670     * @param serverTelemetryKey
10671     * @param serverTelemetry
10672     */
10673    BrowserCacheManager.prototype.setServerTelemetry = function (serverTelemetryKey, serverTelemetry) {
10674        this.logger.trace("BrowserCacheManager.setServerTelemetry called");
10675        this.setItem(serverTelemetryKey, JSON.stringify(serverTelemetry));
10676    };
10677    /**
10678     *
10679     */
10680    BrowserCacheManager.prototype.getAuthorityMetadata = function (key) {
10681        var value = this.internalStorage.getItem(key);
10682        if (!value) {
10683            this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit");
10684            return null;
10685        }
10686        var parsedMetadata = this.validateAndParseJson(value);
10687        if (parsedMetadata && AuthorityMetadataEntity.isAuthorityMetadataEntity(key, parsedMetadata)) {
10688            this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit");
10689            return CacheManager.toObject(new AuthorityMetadataEntity(), parsedMetadata);
10690        }
10691        return null;
10692    };
10693    /**
10694     *
10695     */
10696    BrowserCacheManager.prototype.getAuthorityMetadataKeys = function () {
10697        var _this = this;
10698        var allKeys = this.internalStorage.getKeys();
10699        return allKeys.filter(function (key) {
10700            return _this.isAuthorityMetadata(key);
10701        });
10702    };
10703    /**
10704     * Sets wrapper metadata in memory
10705     * @param wrapperSKU
10706     * @param wrapperVersion
10707     */
10708    BrowserCacheManager.prototype.setWrapperMetadata = function (wrapperSKU, wrapperVersion) {
10709        this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_SKU, wrapperSKU);
10710        this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_VER, wrapperVersion);
10711    };
10712    /**
10713     * Returns wrapper metadata from in-memory storage
10714     */
10715    BrowserCacheManager.prototype.getWrapperMetadata = function () {
10716        var sku = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_SKU) || Constants.EMPTY_STRING;
10717        var version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) || Constants.EMPTY_STRING;
10718        return [sku, version];
10719    };
10720    /**
10721     *
10722     * @param entity
10723     */
10724    BrowserCacheManager.prototype.setAuthorityMetadata = function (key, entity) {
10725        this.logger.trace("BrowserCacheManager.setAuthorityMetadata called");
10726        this.internalStorage.setItem(key, JSON.stringify(entity));
10727    };
10728    /**
10729     * Gets the active account
10730     */
10731    BrowserCacheManager.prototype.getActiveAccount = function () {
10732        var activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
10733        var activeAccountValueFilters = this.getItem(activeAccountKeyFilters);
10734        if (!activeAccountValueFilters) {
10735            // if new active account cache type isn't found, it's an old version, so look for that instead
10736            this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");
10737            var activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
10738            var activeAccountValueLocal = this.getItem(activeAccountKeyLocal);
10739            if (!activeAccountValueLocal) {
10740                this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
10741                return null;
10742            }
10743            var activeAccount = this.getAccountInfoByFilter({ localAccountId: activeAccountValueLocal })[0] || null;
10744            if (activeAccount) {
10745                this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found");
10746                this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema");
10747                this.setActiveAccount(activeAccount);
10748                return activeAccount;
10749            }
10750            return null;
10751        }
10752        var activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);
10753        if (activeAccountValueObj) {
10754            this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found");
10755            return this.getAccountInfoByFilter({
10756                homeAccountId: activeAccountValueObj.homeAccountId,
10757                localAccountId: activeAccountValueObj.localAccountId
10758            })[0] || null;
10759        }
10760        this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
10761        return null;
10762    };
10763    /**
10764     * Sets the active account's localAccountId in cache
10765     * @param account
10766     */
10767    BrowserCacheManager.prototype.setActiveAccount = function (account) {
10768        var activeAccountKey = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
10769        var activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
10770        if (account) {
10771            this.logger.verbose("setActiveAccount: Active account set");
10772            var activeAccountValue = {
10773                homeAccountId: account.homeAccountId,
10774                localAccountId: account.localAccountId
10775            };
10776            this.browserStorage.setItem(activeAccountKey, JSON.stringify(activeAccountValue));
10777            this.browserStorage.setItem(activeAccountKeyLocal, account.localAccountId);
10778        }
10779        else {
10780            this.logger.verbose("setActiveAccount: No account passed, active account not set");
10781            this.browserStorage.removeItem(activeAccountKey);
10782            this.browserStorage.removeItem(activeAccountKeyLocal);
10783        }
10784    };
10785    /**
10786     * Gets a list of accounts that match all of the filters provided
10787     * @param account
10788     */
10789    BrowserCacheManager.prototype.getAccountInfoByFilter = function (accountFilter) {
10790        var allAccounts = this.getAllAccounts();
10791        this.logger.trace("BrowserCacheManager.getAccountInfoByFilter: total " + allAccounts.length + " accounts found");
10792        return allAccounts.filter(function (accountObj) {
10793            if (accountFilter.username && accountFilter.username.toLowerCase() !== accountObj.username.toLowerCase()) {
10794                return false;
10795            }
10796            if (accountFilter.homeAccountId && accountFilter.homeAccountId !== accountObj.homeAccountId) {
10797                return false;
10798            }
10799            if (accountFilter.localAccountId && accountFilter.localAccountId !== accountObj.localAccountId) {
10800                return false;
10801            }
10802            if (accountFilter.tenantId && accountFilter.tenantId !== accountObj.tenantId) {
10803                return false;
10804            }
10805            if (accountFilter.environment && accountFilter.environment !== accountObj.environment) {
10806                return false;
10807            }
10808            return true;
10809        });
10810    };
10811    /**
10812     * Checks the cache for accounts matching loginHint or SID
10813     * @param loginHint
10814     * @param sid
10815     */
10816    BrowserCacheManager.prototype.getAccountInfoByHints = function (loginHint, sid) {
10817        var matchingAccounts = this.getAllAccounts().filter(function (accountInfo) {
10818            if (sid) {
10819                var accountSid = accountInfo.idTokenClaims && accountInfo.idTokenClaims["sid"];
10820                return sid === accountSid;
10821            }
10822            if (loginHint) {
10823                return loginHint === accountInfo.username;
10824            }
10825            return false;
10826        });
10827        if (matchingAccounts.length === 1) {
10828            return matchingAccounts[0];
10829        }
10830        else if (matchingAccounts.length > 1) {
10831            throw ClientAuthError.createMultipleMatchingAccountsInCacheError();
10832        }
10833        return null;
10834    };
10835    /**
10836     * fetch throttling entity from the platform cache
10837     * @param throttlingCacheKey
10838     */
10839    BrowserCacheManager.prototype.getThrottlingCache = function (throttlingCacheKey) {
10840        var value = this.getItem(throttlingCacheKey);
10841        if (!value) {
10842            this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit");
10843            return null;
10844        }
10845        var parsedThrottlingCache = this.validateAndParseJson(value);
10846        if (!parsedThrottlingCache || !ThrottlingEntity.isThrottlingEntity(throttlingCacheKey, parsedThrottlingCache)) {
10847            this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit");
10848            return null;
10849        }
10850        this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit");
10851        return CacheManager.toObject(new ThrottlingEntity(), parsedThrottlingCache);
10852    };
10853    /**
10854     * set throttling entity to the platform cache
10855     * @param throttlingCacheKey
10856     * @param throttlingCache
10857     */
10858    BrowserCacheManager.prototype.setThrottlingCache = function (throttlingCacheKey, throttlingCache) {
10859        this.logger.trace("BrowserCacheManager.setThrottlingCache called");
10860        this.setItem(throttlingCacheKey, JSON.stringify(throttlingCache));
10861    };
10862    /**
10863     * Gets cache item with given key.
10864     * Will retrieve from cookies if storeAuthStateInCookie is set to true.
10865     * @param key
10866     */
10867    BrowserCacheManager.prototype.getTemporaryCache = function (cacheKey, generateKey) {
10868        var key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
10869        if (this.cacheConfig.storeAuthStateInCookie) {
10870            var itemCookie = this.getItemCookie(key);
10871            if (itemCookie) {
10872                this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies");
10873                return itemCookie;
10874            }
10875        }
10876        var value = this.temporaryCacheStorage.getItem(key);
10877        if (!value) {
10878            // If temp cache item not found in session/memory, check local storage for items set by old versions
10879            if (this.cacheConfig.cacheLocation === exports.BrowserCacheLocation.LocalStorage) {
10880                var item = this.browserStorage.getItem(key);
10881                if (item) {
10882                    this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage");
10883                    return item;
10884                }
10885            }
10886            this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage");
10887            return null;
10888        }
10889        this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned");
10890        return value;
10891    };
10892    /**
10893     * Sets the cache item with the key and value given.
10894     * Stores in cookie if storeAuthStateInCookie is set to true.
10895     * This can cause cookie overflow if used incorrectly.
10896     * @param key
10897     * @param value
10898     */
10899    BrowserCacheManager.prototype.setTemporaryCache = function (cacheKey, value, generateKey) {
10900        var key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
10901        this.temporaryCacheStorage.setItem(key, value);
10902        if (this.cacheConfig.storeAuthStateInCookie) {
10903            this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie");
10904            this.setItemCookie(key, value);
10905        }
10906    };
10907    /**
10908     * Removes the cache item with the given key.
10909     * Will also clear the cookie item if storeAuthStateInCookie is set to true.
10910     * @param key
10911     */
10912    BrowserCacheManager.prototype.removeItem = function (key) {
10913        this.browserStorage.removeItem(key);
10914        this.temporaryCacheStorage.removeItem(key);
10915        if (this.cacheConfig.storeAuthStateInCookie) {
10916            this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie");
10917            this.clearItemCookie(key);
10918        }
10919    };
10920    /**
10921     * Checks whether key is in cache.
10922     * @param key
10923     */
10924    BrowserCacheManager.prototype.containsKey = function (key) {
10925        return this.browserStorage.containsKey(key) || this.temporaryCacheStorage.containsKey(key);
10926    };
10927    /**
10928     * Gets all keys in window.
10929     */
10930    BrowserCacheManager.prototype.getKeys = function () {
10931        return __spread(this.browserStorage.getKeys(), this.temporaryCacheStorage.getKeys());
10932    };
10933    /**
10934     * Clears all cache entries created by MSAL.
10935     */
10936    BrowserCacheManager.prototype.clear = function () {
10937        return __awaiter$1(this, void 0, void 0, function () {
10938            var _this = this;
10939            return __generator$1(this, function (_a) {
10940                switch (_a.label) {
10941                    case 0: 
10942                    // Removes all accounts and their credentials
10943                    return [4 /*yield*/, this.removeAllAccounts()];
10944                    case 1:
10945                        // Removes all accounts and their credentials
10946                        _a.sent();
10947                        this.removeAppMetadata();
10948                        // Removes all remaining MSAL cache items
10949                        this.getKeys().forEach(function (cacheKey) {
10950                            // Check if key contains msal prefix; For now, we are clearing all the cache items created by MSAL.js
10951                            if ((_this.browserStorage.containsKey(cacheKey) || _this.temporaryCacheStorage.containsKey(cacheKey)) && ((cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1) || (cacheKey.indexOf(_this.clientId) !== -1))) {
10952                                _this.removeItem(cacheKey);
10953                            }
10954                        });
10955                        this.internalStorage.clear();
10956                        return [2 /*return*/];
10957                }
10958            });
10959        });
10960    };
10961    /**
10962     * Clears all access tokes that have claims prior to saving the current one
10963     * @param credential
10964     * @returns
10965     */
10966    BrowserCacheManager.prototype.clearTokensAndKeysWithClaims = function () {
10967        return __awaiter$1(this, void 0, void 0, function () {
10968            var tokenKeys, removedAccessTokens;
10969            var _this = this;
10970            return __generator$1(this, function (_a) {
10971                switch (_a.label) {
10972                    case 0:
10973                        this.logger.trace("BrowserCacheManager.clearTokensAndKeysWithClaims called");
10974                        tokenKeys = this.getTokenKeys();
10975                        removedAccessTokens = [];
10976                        tokenKeys.accessToken.forEach(function (key) {
10977                            // if the access token has claims in its key, remove the token key and the token
10978                            var credential = _this.getAccessTokenCredential(key);
10979                            if ((credential === null || credential === void 0 ? void 0 : credential.requestedClaimsHash) && key.includes(credential.requestedClaimsHash.toLowerCase())) {
10980                                removedAccessTokens.push(_this.removeAccessToken(key));
10981                            }
10982                        });
10983                        return [4 /*yield*/, Promise.all(removedAccessTokens)];
10984                    case 1:
10985                        _a.sent();
10986                        // warn if any access tokens are removed
10987                        if (removedAccessTokens.length > 0) {
10988                            this.logger.warning(removedAccessTokens.length + " access tokens with claims in the cache keys have been removed from the cache.");
10989                        }
10990                        return [2 /*return*/];
10991                }
10992            });
10993        });
10994    };
10995    /**
10996     * Add value to cookies
10997     * @param cookieName
10998     * @param cookieValue
10999     * @param expires
11000     */
11001    BrowserCacheManager.prototype.setItemCookie = function (cookieName, cookieValue, expires) {
11002        var cookieStr = encodeURIComponent(cookieName) + "=" + encodeURIComponent(cookieValue) + ";path=/;SameSite=Lax;";
11003        if (expires) {
11004            var expireTime = this.getCookieExpirationTime(expires);
11005            cookieStr += "expires=" + expireTime + ";";
11006        }
11007        if (this.cacheConfig.secureCookies) {
11008            cookieStr += "Secure;";
11009        }
11010        document.cookie = cookieStr;
11011    };
11012    /**
11013     * Get one item by key from cookies
11014     * @param cookieName
11015     */
11016    BrowserCacheManager.prototype.getItemCookie = function (cookieName) {
11017        var name = encodeURIComponent(cookieName) + "=";
11018        var cookieList = document.cookie.split(";");
11019        for (var i = 0; i < cookieList.length; i++) {
11020            var cookie = cookieList[i];
11021            while (cookie.charAt(0) === " ") {
11022                cookie = cookie.substring(1);
11023            }
11024            if (cookie.indexOf(name) === 0) {
11025                return decodeURIComponent(cookie.substring(name.length, cookie.length));
11026            }
11027        }
11028        return Constants.EMPTY_STRING;
11029    };
11030    /**
11031     * Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.
11032     */
11033    BrowserCacheManager.prototype.clearMsalCookies = function () {
11034        var _this = this;
11035        var cookiePrefix = Constants.CACHE_PREFIX + "." + this.clientId;
11036        var cookieList = document.cookie.split(";");
11037        cookieList.forEach(function (cookie) {
11038            while (cookie.charAt(0) === " ") {
11039                // eslint-disable-next-line no-param-reassign
11040                cookie = cookie.substring(1);
11041            }
11042            if (cookie.indexOf(cookiePrefix) === 0) {
11043                var cookieKey = cookie.split("=")[0];
vendor: 13,612 bytes, lines 11044-11327
11044                _this.clearItemCookie(cookieKey);
11045            }
11046        });
11047    };
11048    /**
11049     * Clear an item in the cookies by key
11050     * @param cookieName
11051     */
11052    BrowserCacheManager.prototype.clearItemCookie = function (cookieName) {
11053        this.setItemCookie(cookieName, Constants.EMPTY_STRING, -1);
11054    };
11055    /**
11056     * Get cookie expiration time
11057     * @param cookieLifeDays
11058     */
11059    BrowserCacheManager.prototype.getCookieExpirationTime = function (cookieLifeDays) {
11060        var today = new Date();
11061        var expr = new Date(today.getTime() + cookieLifeDays * this.COOKIE_LIFE_MULTIPLIER);
11062        return expr.toUTCString();
11063    };
11064    /**
11065     * Gets the cache object referenced by the browser
11066     */
11067    BrowserCacheManager.prototype.getCache = function () {
11068        return this.browserStorage;
11069    };
11070    /**
11071     * interface compat, we cannot overwrite browser cache; Functionality is supported by individual entities in browser
11072     */
11073    BrowserCacheManager.prototype.setCache = function () {
11074        // sets nothing
11075    };
11076    /**
11077     * Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
11078     * @param key
11079     * @param addInstanceId
11080     */
11081    BrowserCacheManager.prototype.generateCacheKey = function (key) {
11082        var generatedKey = this.validateAndParseJson(key);
11083        if (!generatedKey) {
11084            if (StringUtils.startsWith(key, Constants.CACHE_PREFIX) || StringUtils.startsWith(key, PersistentCacheKeys.ADAL_ID_TOKEN)) {
11085                return key;
11086            }
11087            return Constants.CACHE_PREFIX + "." + this.clientId + "." + key;
11088        }
11089        return JSON.stringify(key);
11090    };
11091    /**
11092     * Create authorityKey to cache authority
11093     * @param state
11094     */
11095    BrowserCacheManager.prototype.generateAuthorityKey = function (stateString) {
11096        var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
11097        return this.generateCacheKey(TemporaryCacheKeys.AUTHORITY + "." + stateId);
11098    };
11099    /**
11100     * Create Nonce key to cache nonce
11101     * @param state
11102     */
11103    BrowserCacheManager.prototype.generateNonceKey = function (stateString) {
11104        var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
11105        return this.generateCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN + "." + stateId);
11106    };
11107    /**
11108     * Creates full cache key for the request state
11109     * @param stateString State string for the request
11110     */
11111    BrowserCacheManager.prototype.generateStateKey = function (stateString) {
11112        // Use the library state id to key temp storage for uniqueness for multiple concurrent requests
11113        var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
11114        return this.generateCacheKey(TemporaryCacheKeys.REQUEST_STATE + "." + stateId);
11115    };
11116    /**
11117     * Gets the cached authority based on the cached state. Returns empty if no cached state found.
11118     */
11119    BrowserCacheManager.prototype.getCachedAuthority = function (cachedState) {
11120        var stateCacheKey = this.generateStateKey(cachedState);
11121        var state = this.getTemporaryCache(stateCacheKey);
11122        if (!state) {
11123            return null;
11124        }
11125        var authorityCacheKey = this.generateAuthorityKey(state);
11126        return this.getTemporaryCache(authorityCacheKey);
11127    };
11128    /**
11129     * Updates account, authority, and state in cache
11130     * @param serverAuthenticationRequest
11131     * @param account
11132     */
11133    BrowserCacheManager.prototype.updateCacheEntries = function (state, nonce, authorityInstance, loginHint, account) {
11134        this.logger.trace("BrowserCacheManager.updateCacheEntries called");
11135        // Cache the request state
11136        var stateCacheKey = this.generateStateKey(state);
11137        this.setTemporaryCache(stateCacheKey, state, false);
11138        // Cache the nonce
11139        var nonceCacheKey = this.generateNonceKey(state);
11140        this.setTemporaryCache(nonceCacheKey, nonce, false);
11141        // Cache authorityKey
11142        var authorityCacheKey = this.generateAuthorityKey(state);
11143        this.setTemporaryCache(authorityCacheKey, authorityInstance, false);
11144        if (account) {
11145            var ccsCredential = {
11146                credential: account.homeAccountId,
11147                type: CcsCredentialType.HOME_ACCOUNT_ID
11148            };
11149            this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
11150        }
11151        else if (!StringUtils.isEmpty(loginHint)) {
11152            var ccsCredential = {
11153                credential: loginHint,
11154                type: CcsCredentialType.UPN
11155            };
11156            this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
11157        }
11158    };
11159    /**
11160     * Reset all temporary cache items
11161     * @param state
11162     */
11163    BrowserCacheManager.prototype.resetRequestCache = function (state) {
11164        var _this = this;
11165        this.logger.trace("BrowserCacheManager.resetRequestCache called");
11166        // check state and remove associated cache items
11167        if (!StringUtils.isEmpty(state)) {
11168            this.getKeys().forEach(function (key) {
11169                if (key.indexOf(state) !== -1) {
11170                    _this.removeItem(key);
11171                }
11172            });
11173        }
11174        // delete generic interactive request parameters
11175        if (state) {
11176            this.removeItem(this.generateStateKey(state));
11177            this.removeItem(this.generateNonceKey(state));
11178            this.removeItem(this.generateAuthorityKey(state));
11179        }
11180        this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
11181        this.removeItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));
11182        this.removeItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));
11183        this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));
11184        this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));
11185        this.removeItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
11186        this.setInteractionInProgress(false);
11187    };
11188    /**
11189     * Removes temporary cache for the provided state
11190     * @param stateString
11191     */
11192    BrowserCacheManager.prototype.cleanRequestByState = function (stateString) {
11193        this.logger.trace("BrowserCacheManager.cleanRequestByState called");
11194        // Interaction is completed - remove interaction status.
11195        if (stateString) {
11196            var stateKey = this.generateStateKey(stateString);
11197            var cachedState = this.temporaryCacheStorage.getItem(stateKey);
11198            this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: " + cachedState);
11199            this.resetRequestCache(cachedState || Constants.EMPTY_STRING);
11200        }
11201        this.clearMsalCookies();
11202    };
11203    /**
11204     * Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state
11205     * Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.
11206     * @param interactionType
11207     */
11208    BrowserCacheManager.prototype.cleanRequestByInteractionType = function (interactionType) {
11209        var _this = this;
11210        this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called");
11211        // Loop through all keys to find state key
11212        this.getKeys().forEach(function (key) {
11213            // If this key is not the state key, move on
11214            if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {
11215                return;
11216            }
11217            // Retrieve state value, return if not a valid value
11218            var stateValue = _this.temporaryCacheStorage.getItem(key);
11219            if (!stateValue) {
11220                return;
11221            }
11222            // Extract state and ensure it matches given InteractionType, then clean request cache
11223            var parsedState = BrowserProtocolUtils.extractBrowserRequestState(_this.cryptoImpl, stateValue);
11224            if (parsedState && parsedState.interactionType === interactionType) {
11225                _this.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: " + stateValue);
11226                _this.resetRequestCache(stateValue);
11227            }
11228        });
11229        this.clearMsalCookies();
11230        this.setInteractionInProgress(false);
11231    };
11232    BrowserCacheManager.prototype.cacheCodeRequest = function (authCodeRequest, browserCrypto) {
11233        this.logger.trace("BrowserCacheManager.cacheCodeRequest called");
11234        var encodedValue = browserCrypto.base64Encode(JSON.stringify(authCodeRequest));
11235        this.setTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);
11236    };
11237    /**
11238     * Gets the token exchange parameters from the cache. Throws an error if nothing is found.
11239     */
11240    BrowserCacheManager.prototype.getCachedRequest = function (state, browserCrypto) {
11241        this.logger.trace("BrowserCacheManager.getCachedRequest called");
11242        // Get token request from cache and parse as TokenExchangeParameters.
11243        var encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);
11244        if (!encodedTokenRequest) {
11245            throw BrowserAuthError.createNoTokenRequestCacheError();
11246        }
11247        var parsedRequest = this.validateAndParseJson(browserCrypto.base64Decode(encodedTokenRequest));
11248        if (!parsedRequest) {
11249            throw BrowserAuthError.createUnableToParseTokenRequestCacheError();
11250        }
11251        this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
11252        // Get cached authority and use if no authority is cached with request.
11253        if (StringUtils.isEmpty(parsedRequest.authority)) {
11254            var authorityCacheKey = this.generateAuthorityKey(state);
11255            var cachedAuthority = this.getTemporaryCache(authorityCacheKey);
11256            if (!cachedAuthority) {
11257                throw BrowserAuthError.createNoCachedAuthorityError();
11258            }
11259            parsedRequest.authority = cachedAuthority;
11260        }
11261        return parsedRequest;
11262    };
11263    /**
11264     * Gets cached native request for redirect flows
11265     */
11266    BrowserCacheManager.prototype.getCachedNativeRequest = function () {
11267        this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");
11268        var cachedRequest = this.getTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, true);
11269        if (!cachedRequest) {
11270            this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found");
11271            return null;
11272        }
11273        var parsedRequest = this.validateAndParseJson(cachedRequest);
11274        if (!parsedRequest) {
11275            this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request");
11276            return null;
11277        }
11278        return parsedRequest;
11279    };
11280    BrowserCacheManager.prototype.isInteractionInProgress = function (matchClientId) {
11281        var clientId = this.getInteractionInProgress();
11282        if (matchClientId) {
11283            return clientId === this.clientId;
11284        }
11285        else {
11286            return !!clientId;
11287        }
11288    };
11289    BrowserCacheManager.prototype.getInteractionInProgress = function () {
11290        var key = Constants.CACHE_PREFIX + "." + TemporaryCacheKeys.INTERACTION_STATUS_KEY;
11291        return this.getTemporaryCache(key, false);
11292    };
11293    BrowserCacheManager.prototype.setInteractionInProgress = function (inProgress) {
11294        // Ensure we don't overwrite interaction in progress for a different clientId
11295        var key = Constants.CACHE_PREFIX + "." + TemporaryCacheKeys.INTERACTION_STATUS_KEY;
11296        if (inProgress) {
11297            if (this.getInteractionInProgress()) {
11298                throw BrowserAuthError.createInteractionInProgressError();
11299            }
11300            else {
11301                // No interaction is in progress
11302                this.setTemporaryCache(key, this.clientId, false);
11303            }
11304        }
11305        else if (!inProgress && this.getInteractionInProgress() === this.clientId) {
11306            this.removeItem(key);
11307        }
11308    };
11309    /**
11310     * Returns username retrieved from ADAL or MSAL v1 idToken
11311     */
11312    BrowserCacheManager.prototype.getLegacyLoginHint = function () {
11313        // Only check for adal/msal token if no SSO params are being used
11314        var adalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ADAL_ID_TOKEN);
11315        if (adalIdTokenString) {
11316            this.browserStorage.removeItem(PersistentCacheKeys.ADAL_ID_TOKEN);
11317            this.logger.verbose("Cached ADAL id token retrieved.");
11318        }
11319        // Check for cached MSAL v1 id token
11320        var msalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ID_TOKEN, true);
11321        if (msalIdTokenString) {
11322            this.removeItem(this.generateCacheKey(PersistentCacheKeys.ID_TOKEN));
11323            this.logger.verbose("Cached MSAL.js v1 id token retrieved");
11324        }
11325        var cachedIdTokenString = msalIdTokenString || adalIdTokenString;
11326        if (cachedIdTokenString) {
11327            var cachedIdToken = new AuthToken(cachedIdTokenString, this.cryptoImpl);
11328            if (cachedIdToken.claims && cachedIdToken.claims.preferred_username) {
11329                this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint");
11330                return cachedIdToken.claims.preferred_username;
11331            }
11332            else if (cachedIdToken.claims && cachedIdToken.claims.upn) {
11333                this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint");
11334                return cachedIdToken.claims.upn;
11335            }
11336            else {
11337                this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.");
11338            }
11339        }
11340        return null;
11341    };
11342    /**
11343     * Updates a credential's cache key if the current cache key is outdated
11344     */
11345    BrowserCacheManager.prototype.updateCredentialCacheKey = function (currentCacheKey, credential) {
11346        var updatedCacheKey = credential.generateCredentialKey();
11347        if (currentCacheKey !== updatedCacheKey) {
11348            var cacheItem = this.getItem(currentCacheKey);
11349            if (cacheItem) {
11350                this.removeItem(currentCacheKey);
11351                this.setItem(updatedCacheKey, cacheItem);
11352                this.logger.verbose("Updated an outdated " + credential.credentialType + " cache key");
11353                return updatedCacheKey;
11354            }
11355            else {
11356                this.logger.error("Attempted to update an outdated " + credential.credentialType + " cache key but no item matching the outdated key was found in storage");
11357            }
11358        }
11359        return currentCacheKey;
11360    };
11361    /**
11362     * Returns application id as redirect context during AcquireTokenRedirect flow.
11363     */
11364    BrowserCacheManager.prototype.getRedirectRequestContext = function () {
11365        return this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, true);
11366    };
11367    /**
11368     * Sets application id as the redirect context during AcquireTokenRedirect flow.
11369     * @param value
11370     */
11371    BrowserCacheManager.prototype.setRedirectRequestContext = function (value) {
11372        this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);
11373    };
11374    /**
11375     * Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache
11376     * @param result
11377     * @param request
11378     */
11379    BrowserCacheManager.prototype.hydrateCache = function (result, request) {
11380        var _a, _b, _c, _d, _e, _f;
11381        return __awaiter$1(this, void 0, void 0, function () {
11382            var idTokenEntity, claimsHash, accessTokenEntity, cacheRecord;
11383            return __generator$1(this, function (_g) {
11384                switch (_g.label) {
11385                    case 0:
11386                        idTokenEntity = IdTokenEntity.createIdTokenEntity(((_a = result.account) === null || _a === void 0 ? void 0 : _a.homeAccountId) || "", ((_b = result.account) === null || _b === void 0 ? void 0 : _b.environment) || "", result.idToken, this.clientId, result.tenantId);
11387                        if (!request.claims) return [3 /*break*/, 2];
11388                        return [4 /*yield*/, this.cryptoImpl.hashString(request.claims)];
11389                    case 1:
11390                        claimsHash = _g.sent();
11391                        _g.label = 2;
11392                    case 2:
11393                        accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(((_c = result.account) === null || _c === void 0 ? void 0 : _c.homeAccountId) || "", ((_d = result.account) === null || _d === void 0 ? void 0 : _d.environment) || "", result.accessToken, this.clientId, result.tenantId, result.scopes.join(" "), ((_e = result.expiresOn) === null || _e === void 0 ? void 0 : _e.getTime()) || 0, ((_f = result.extExpiresOn) === null || _f === void 0 ? void 0 : _f.getTime()) || 0, this.cryptoImpl, undefined, // refreshOn
11394                        result.tokenType, undefined, // userAssertionHash
11395                        request.sshKid, request.claims, claimsHash);
11396                        cacheRecord = new CacheRecord(undefined, idTokenEntity, accessTokenEntity);
vendor: 95,445 bytes, lines 11397-13239
11397                        return [2 /*return*/, this.saveCacheRecord(cacheRecord)];
11398                }
11399            });
11400        });
11401    };
11402    return BrowserCacheManager;
11403}(CacheManager));
11404var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
11405    var cacheOptions = {
11406        cacheLocation: exports.BrowserCacheLocation.MemoryStorage,
11407        temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
11408        storeAuthStateInCookie: false,
11409        secureCookies: false,
11410        cacheMigrationEnabled: false,
11411        claimsBasedCachingEnabled: true
11412    };
11413    return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);
11414};
11415
11416/* eslint-disable header/header */
11417var name = "@azure/msal-browser";
11418var version = "2.39.0";
11419
11420/*
11421 * Copyright (c) Microsoft Corporation. All rights reserved.
11422 * Licensed under the MIT License.
11423 */
11424/**
11425 * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
11426 */
11427var FetchClient = /** @class */ (function () {
11428    function FetchClient() {
11429    }
11430    /**
11431     * Fetch Client for REST endpoints - Get request
11432     * @param url
11433     * @param headers
11434     * @param body
11435     */
11436    FetchClient.prototype.sendGetRequestAsync = function (url, options) {
11437        return __awaiter$1(this, void 0, void 0, function () {
11438            var response, e_1, _a;
11439            return __generator$1(this, function (_b) {
11440                switch (_b.label) {
11441                    case 0:
11442                        _b.trys.push([0, 2, , 3]);
11443                        return [4 /*yield*/, fetch(url, {
11444                                method: HTTP_REQUEST_TYPE.GET,
11445                                headers: this.getFetchHeaders(options)
11446                            })];
11447                    case 1:
11448                        response = _b.sent();
11449                        return [3 /*break*/, 3];
11450                    case 2:
11451                        e_1 = _b.sent();
11452                        if (window.navigator.onLine) {
11453                            throw BrowserAuthError.createGetRequestFailedError(e_1, url);
11454                        }
11455                        else {
11456                            throw BrowserAuthError.createNoNetworkConnectivityError();
11457                        }
11458                    case 3:
11459                        _b.trys.push([3, 5, , 6]);
11460                        _a = {
11461                            headers: this.getHeaderDict(response.headers)
11462                        };
11463                        return [4 /*yield*/, response.json()];
11464                    case 4: return [2 /*return*/, (_a.body = (_b.sent()),
11465                            _a.status = response.status,
11466                            _a)];
11467                    case 5:
11468                        _b.sent();
11469                        throw BrowserAuthError.createFailedToParseNetworkResponseError(url);
11470                    case 6: return [2 /*return*/];
11471                }
11472            });
11473        });
11474    };
11475    /**
11476     * Fetch Client for REST endpoints - Post request
11477     * @param url
11478     * @param headers
11479     * @param body
11480     */
11481    FetchClient.prototype.sendPostRequestAsync = function (url, options) {
11482        return __awaiter$1(this, void 0, void 0, function () {
11483            var reqBody, response, e_3, _a;
11484            return __generator$1(this, function (_b) {
11485                switch (_b.label) {
11486                    case 0:
11487                        reqBody = (options && options.body) || Constants.EMPTY_STRING;
11488                        _b.label = 1;
11489                    case 1:
11490                        _b.trys.push([1, 3, , 4]);
11491                        return [4 /*yield*/, fetch(url, {
11492                                method: HTTP_REQUEST_TYPE.POST,
11493                                headers: this.getFetchHeaders(options),
11494                                body: reqBody
11495                            })];
11496                    case 2:
11497                        response = _b.sent();
11498                        return [3 /*break*/, 4];
11499                    case 3:
11500                        e_3 = _b.sent();
11501                        if (window.navigator.onLine) {
11502                            throw BrowserAuthError.createPostRequestFailedError(e_3, url);
11503                        }
11504                        else {
11505                            throw BrowserAuthError.createNoNetworkConnectivityError();
11506                        }
11507                    case 4:
11508                        _b.trys.push([4, 6, , 7]);
11509                        _a = {
11510                            headers: this.getHeaderDict(response.headers)
11511                        };
11512                        return [4 /*yield*/, response.json()];
11513                    case 5: return [2 /*return*/, (_a.body = (_b.sent()),
11514                            _a.status = response.status,
11515                            _a)];
11516                    case 6:
11517                        _b.sent();
11518                        throw BrowserAuthError.createFailedToParseNetworkResponseError(url);
11519                    case 7: return [2 /*return*/];
11520                }
11521            });
11522        });
11523    };
11524    /**
11525     * Get Fetch API Headers object from string map
11526     * @param inputHeaders
11527     */
11528    FetchClient.prototype.getFetchHeaders = function (options) {
11529        var headers = new Headers();
11530        if (!(options && options.headers)) {
11531            return headers;
11532        }
11533        var optionsHeaders = options.headers;
11534        Object.keys(optionsHeaders).forEach(function (key) {
11535            headers.append(key, optionsHeaders[key]);
11536        });
11537        return headers;
11538    };
11539    FetchClient.prototype.getHeaderDict = function (headers) {
11540        var headerDict = {};
11541        headers.forEach(function (value, key) {
11542            headerDict[key] = value;
11543        });
11544        return headerDict;
11545    };
11546    return FetchClient;
11547}());
11548
11549/*
11550 * Copyright (c) Microsoft Corporation. All rights reserved.
11551 * Licensed under the MIT License.
11552 */
11553/**
11554 * This client implements the XMLHttpRequest class to send GET and POST requests.
11555 */
11556var XhrClient = /** @class */ (function () {
11557    function XhrClient() {
11558    }
11559    /**
11560     * XhrClient for REST endpoints - Get request
11561     * @param url
11562     * @param headers
11563     * @param body
11564     */
11565    XhrClient.prototype.sendGetRequestAsync = function (url, options) {
11566        return __awaiter$1(this, void 0, void 0, function () {
11567            return __generator$1(this, function (_a) {
11568                return [2 /*return*/, this.sendRequestAsync(url, HTTP_REQUEST_TYPE.GET, options)];
11569            });
11570        });
11571    };
11572    /**
11573     * XhrClient for REST endpoints - Post request
11574     * @param url
11575     * @param headers
11576     * @param body
11577     */
11578    XhrClient.prototype.sendPostRequestAsync = function (url, options) {
11579        return __awaiter$1(this, void 0, void 0, function () {
11580            return __generator$1(this, function (_a) {
11581                return [2 /*return*/, this.sendRequestAsync(url, HTTP_REQUEST_TYPE.POST, options)];
11582            });
11583        });
11584    };
11585    /**
11586     * Helper for XhrClient requests.
11587     * @param url
11588     * @param method
11589     * @param options
11590     */
11591    XhrClient.prototype.sendRequestAsync = function (url, method, options) {
11592        var _this = this;
11593        return new Promise(function (resolve, reject) {
11594            var xhr = new XMLHttpRequest();
11595            xhr.open(method, url, /* async: */ true);
11596            _this.setXhrHeaders(xhr, options);
11597            xhr.onload = function () {
11598                if (xhr.status < 200 || xhr.status >= 300) {
11599                    if (method === HTTP_REQUEST_TYPE.POST) {
11600                        reject(BrowserAuthError.createPostRequestFailedError("Failed with status " + xhr.status, url));
11601                    }
11602                    else {
11603                        reject(BrowserAuthError.createGetRequestFailedError("Failed with status " + xhr.status, url));
11604                    }
11605                }
11606                try {
11607                    var jsonResponse = JSON.parse(xhr.responseText);
11608                    var networkResponse = {
11609                        headers: _this.getHeaderDict(xhr),
11610                        body: jsonResponse,
11611                        status: xhr.status
11612                    };
11613                    resolve(networkResponse);
11614                }
11615                catch (e) {
11616                    reject(BrowserAuthError.createFailedToParseNetworkResponseError(url));
11617                }
11618            };
11619            xhr.onerror = function () {
11620                if (window.navigator.onLine) {
11621                    if (method === HTTP_REQUEST_TYPE.POST) {
11622                        reject(BrowserAuthError.createPostRequestFailedError("Failed with status " + xhr.status, url));
11623                    }
11624                    else {
11625                        reject(BrowserAuthError.createGetRequestFailedError("Failed with status " + xhr.status, url));
11626                    }
11627                }
11628                else {
11629                    reject(BrowserAuthError.createNoNetworkConnectivityError());
11630                }
11631            };
11632            if (method === HTTP_REQUEST_TYPE.POST && options && options.body) {
11633                xhr.send(options.body);
11634            }
11635            else if (method === HTTP_REQUEST_TYPE.GET) {
11636                xhr.send();
11637            }
11638            else {
11639                throw BrowserAuthError.createHttpMethodNotImplementedError(method);
11640            }
11641        });
11642    };
11643    /**
11644     * Helper to set XHR headers for request.
11645     * @param xhr
11646     * @param options
11647     */
11648    XhrClient.prototype.setXhrHeaders = function (xhr, options) {
11649        if (options && options.headers) {
11650            var headers_1 = options.headers;
11651            Object.keys(headers_1).forEach(function (key) {
11652                xhr.setRequestHeader(key, headers_1[key]);
11653            });
11654        }
11655    };
11656    /**
11657     * Gets a string map of the headers received in the response.
11658     *
11659     * Algorithm comes from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders
11660     * @param xhr
11661     */
11662    XhrClient.prototype.getHeaderDict = function (xhr) {
11663        var headerString = xhr.getAllResponseHeaders();
11664        var headerArr = headerString.trim().split(/[\r\n]+/);
11665        var headerDict = {};
11666        headerArr.forEach(function (value) {
11667            var parts = value.split(": ");
11668            var headerName = parts.shift();
11669            var headerVal = parts.join(": ");
11670            if (headerName && headerVal) {
11671                headerDict[headerName] = headerVal;
11672            }
11673        });
11674        return headerDict;
11675    };
11676    return XhrClient;
11677}());
11678
11679/*
11680 * Copyright (c) Microsoft Corporation. All rights reserved.
11681 * Licensed under the MIT License.
11682 */
11683/**
11684 * Utility class for browser specific functions
11685 */
11686var BrowserUtils = /** @class */ (function () {
11687    function BrowserUtils() {
11688    }
11689    // #region Window Navigation and URL management
11690    /**
11691     * Clears hash from window url.
11692     */
11693    BrowserUtils.clearHash = function (contentWindow) {
11694        // Office.js sets history.replaceState to null
11695        contentWindow.location.hash = Constants.EMPTY_STRING;
11696        if (typeof contentWindow.history.replaceState === "function") {
11697            // Full removes "#" from url
11698            contentWindow.history.replaceState(null, Constants.EMPTY_STRING, "" + contentWindow.location.origin + contentWindow.location.pathname + contentWindow.location.search);
11699        }
11700    };
11701    /**
11702     * Replaces current hash with hash from provided url
11703     */
11704    BrowserUtils.replaceHash = function (url) {
11705        var urlParts = url.split("#");
11706        urlParts.shift(); // Remove part before the hash
11707        window.location.hash = urlParts.length > 0 ? urlParts.join("#") : Constants.EMPTY_STRING;
11708    };
11709    /**
11710     * Returns boolean of whether the current window is in an iframe or not.
11711     */
11712    BrowserUtils.isInIframe = function () {
11713        return window.parent !== window;
11714    };
11715    /**
11716     * Returns boolean of whether or not the current window is a popup opened by msal
11717     */
11718    BrowserUtils.isInPopup = function () {
11719        return typeof window !== "undefined" && !!window.opener &&
11720            window.opener !== window &&
11721            typeof window.name === "string" &&
11722            window.name.indexOf(BrowserConstants.POPUP_NAME_PREFIX + ".") === 0;
11723    };
11724    // #endregion
11725    /**
11726     * Returns current window URL as redirect uri
11727     */
11728    BrowserUtils.getCurrentUri = function () {
11729        return window.location.href.split("?")[0].split("#")[0];
11730    };
11731    /**
11732     * Gets the homepage url for the current window location.
11733     */
11734    BrowserUtils.getHomepage = function () {
11735        var currentUrl = new UrlString(window.location.href);
11736        var urlComponents = currentUrl.getUrlComponents();
11737        return urlComponents.Protocol + "//" + urlComponents.HostNameAndPort + "/";
11738    };
11739    /**
11740     * Returns best compatible network client object.
11741     */
11742    BrowserUtils.getBrowserNetworkClient = function () {
11743        if (window.fetch && window.Headers) {
11744            return new FetchClient();
11745        }
11746        else {
11747            return new XhrClient();
11748        }
11749    };
11750    /**
11751     * Throws error if we have completed an auth and are
11752     * attempting another auth request inside an iframe.
11753     */
11754    BrowserUtils.blockReloadInHiddenIframes = function () {
11755        var isResponseHash = UrlString.hashContainsKnownProperties(window.location.hash);
11756        // return an error if called from the hidden iframe created by the msal js silent calls
11757        if (isResponseHash && BrowserUtils.isInIframe()) {
11758            throw BrowserAuthError.createBlockReloadInHiddenIframeError();
11759        }
11760    };
11761    /**
11762     * Block redirect operations in iframes unless explicitly allowed
11763     * @param interactionType Interaction type for the request
11764     * @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe
11765     */
11766    BrowserUtils.blockRedirectInIframe = function (interactionType, allowRedirectInIframe) {
11767        var isIframedApp = BrowserUtils.isInIframe();
11768        if (interactionType === exports.InteractionType.Redirect && isIframedApp && !allowRedirectInIframe) {
11769            // If we are not in top frame, we shouldn't redirect. This is also handled by the service.
11770            throw BrowserAuthError.createRedirectInIframeError(isIframedApp);
11771        }
11772    };
11773    /**
11774     * Block redirectUri loaded in popup from calling AcquireToken APIs
11775     */
11776    BrowserUtils.blockAcquireTokenInPopups = function () {
11777        // Popups opened by msal popup APIs are given a name that starts with "msal."
11778        if (BrowserUtils.isInPopup()) {
11779            throw BrowserAuthError.createBlockAcquireTokenInPopupsError();
11780        }
11781    };
11782    /**
11783     * Throws error if token requests are made in non-browser environment
11784     * @param isBrowserEnvironment Flag indicating if environment is a browser.
11785     */
11786    BrowserUtils.blockNonBrowserEnvironment = function (isBrowserEnvironment) {
11787        if (!isBrowserEnvironment) {
11788            throw BrowserAuthError.createNonBrowserEnvironmentError();
11789        }
11790    };
11791    /**
11792     * Throws error if native brokering is enabled but initialize hasn't been called
11793     * @param allowNativeBroker
11794     * @param initialized
11795     */
11796    BrowserUtils.blockNativeBrokerCalledBeforeInitialized = function (allowNativeBroker, initialized) {
11797        if (allowNativeBroker && !initialized) {
11798            throw BrowserAuthError.createNativeBrokerCalledBeforeInitialize();
11799        }
11800    };
11801    /**
11802     * Returns boolean of whether current browser is an Internet Explorer or Edge browser.
11803     */
11804    BrowserUtils.detectIEOrEdge = function () {
11805        var ua = window.navigator.userAgent;
11806        var msie = ua.indexOf("MSIE ");
11807        var msie11 = ua.indexOf("Trident/");
11808        var msedge = ua.indexOf("Edge/");
11809        var isIE = msie > 0 || msie11 > 0;
11810        var isEdge = msedge > 0;
11811        return isIE || isEdge;
11812    };
11813    return BrowserUtils;
11814}());
11815
11816/*
11817 * Copyright (c) Microsoft Corporation. All rights reserved.
11818 * Licensed under the MIT License.
11819 */
11820var BaseInteractionClient = /** @class */ (function () {
11821    function BaseInteractionClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) {
11822        this.config = config;
11823        this.browserStorage = storageImpl;
11824        this.browserCrypto = browserCrypto;
11825        this.networkClient = this.config.system.networkClient;
11826        this.eventHandler = eventHandler;
11827        this.navigationClient = navigationClient;
11828        this.nativeMessageHandler = nativeMessageHandler;
11829        this.correlationId = correlationId || this.browserCrypto.createNewGuid();
11830        this.logger = logger.clone(BrowserConstants.MSAL_SKU, version, this.correlationId);
11831        this.performanceClient = performanceClient;
11832    }
11833    BaseInteractionClient.prototype.clearCacheOnLogout = function (account) {
11834        return __awaiter$1(this, void 0, void 0, function () {
11835            return __generator$1(this, function (_a) {
11836                switch (_a.label) {
11837                    case 0:
11838                        if (!account) return [3 /*break*/, 5];
11839                        if (AccountEntity.accountInfoIsEqual(account, this.browserStorage.getActiveAccount(), false)) {
11840                            this.logger.verbose("Setting active account to null");
11841                            this.browserStorage.setActiveAccount(null);
11842                        }
11843                        _a.label = 1;
11844                    case 1:
11845                        _a.trys.push([1, 3, , 4]);
11846                        return [4 /*yield*/, this.browserStorage.removeAccount(AccountEntity.generateAccountCacheKey(account))];
11847                    case 2:
11848                        _a.sent();
11849                        this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.");
11850                        return [3 /*break*/, 4];
11851                    case 3:
11852                        _a.sent();
11853                        this.logger.error("Account provided in logout request was not found. Local cache unchanged.");
11854                        return [3 /*break*/, 4];
11855                    case 4: return [3 /*break*/, 9];
11856                    case 5:
11857                        _a.trys.push([5, 8, , 9]);
11858                        this.logger.verbose("No account provided in logout request, clearing all cache items.", this.correlationId);
11859                        // Clear all accounts and tokens
11860                        return [4 /*yield*/, this.browserStorage.clear()];
11861                    case 6:
11862                        // Clear all accounts and tokens
11863                        _a.sent();
11864                        // Clear any stray keys from IndexedDB
11865                        return [4 /*yield*/, this.browserCrypto.clearKeystore()];
11866                    case 7:
11867                        // Clear any stray keys from IndexedDB
11868                        _a.sent();
11869                        return [3 /*break*/, 9];
11870                    case 8:
11871                        _a.sent();
11872                        this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.");
11873                        return [3 /*break*/, 9];
11874                    case 9: return [2 /*return*/];
11875                }
11876            });
11877        });
11878    };
11879    /**
11880     * Initializer function for all request APIs
11881     * @param request
11882     */
11883    BaseInteractionClient.prototype.initializeBaseRequest = function (request, account) {
11884        return __awaiter$1(this, void 0, void 0, function () {
11885            var authority, scopes, validatedRequest, _a;
11886            return __generator$1(this, function (_b) {
11887                switch (_b.label) {
11888                    case 0:
11889                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
11890                        this.logger.verbose("Initializing BaseAuthRequest");
11891                        authority = request.authority || this.config.auth.authority;
11892                        if (!account) return [3 /*break*/, 2];
11893                        return [4 /*yield*/, this.validateRequestAuthority(authority, account)];
11894                    case 1:
11895                        _b.sent();
11896                        _b.label = 2;
11897                    case 2:
11898                        scopes = __spread(((request && request.scopes) || []));
11899                        validatedRequest = __assign$1(__assign$1({}, request), { correlationId: this.correlationId, authority: authority,
11900                            scopes: scopes });
11901                        // Set authenticationScheme to BEARER if not explicitly set in the request
11902                        if (!validatedRequest.authenticationScheme) {
11903                            validatedRequest.authenticationScheme = exports.AuthenticationScheme.BEARER;
11904                            this.logger.verbose("Authentication Scheme wasn't explicitly set in request, defaulting to \"Bearer\" request");
11905                        }
11906                        else {
11907                            if (validatedRequest.authenticationScheme === exports.AuthenticationScheme.SSH) {
11908                                if (!request.sshJwk) {
11909                                    throw ClientConfigurationError.createMissingSshJwkError();
11910                                }
11911                                if (!request.sshKid) {
11912                                    throw ClientConfigurationError.createMissingSshKidError();
11913                                }
11914                            }
11915                            this.logger.verbose("Authentication Scheme set to \"" + validatedRequest.authenticationScheme + "\" as configured in Auth request");
11916                        }
11917                        if (!(this.config.cache.claimsBasedCachingEnabled && request.claims && !StringUtils.isEmptyObj(request.claims))) return [3 /*break*/, 4];
11918                        _a = validatedRequest;
11919                        return [4 /*yield*/, this.browserCrypto.hashString(request.claims)];
11920                    case 3:
11921                        _a.requestedClaimsHash = _b.sent();
11922                        _b.label = 4;
11923                    case 4: return [2 /*return*/, validatedRequest];
11924                }
11925            });
11926        });
11927    };
11928    /**
11929     *
11930     * Use to get the redirect uri configured in MSAL or null.
11931     * @param requestRedirectUri
11932     * @returns Redirect URL
11933     *
11934     */
11935    BaseInteractionClient.prototype.getRedirectUri = function (requestRedirectUri) {
11936        this.logger.verbose("getRedirectUri called");
11937        var redirectUri = requestRedirectUri || this.config.auth.redirectUri || BrowserUtils.getCurrentUri();
11938        return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());
11939    };
11940    /*
11941     * If authority provided in the request does not match environment/authority specified
11942     * in the account or MSAL config, we throw an error.
11943     */
11944    BaseInteractionClient.prototype.validateRequestAuthority = function (authority, account) {
11945        return __awaiter$1(this, void 0, void 0, function () {
11946            var discoveredAuthority;
11947            return __generator$1(this, function (_a) {
11948                switch (_a.label) {
11949                    case 0: return [4 /*yield*/, this.getDiscoveredAuthority(authority)];
11950                    case 1:
11951                        discoveredAuthority = _a.sent();
11952                        if (!discoveredAuthority.isAlias(account.environment)) {
11953                            throw ClientConfigurationError.createAuthorityMismatchError();
11954                        }
11955                        return [2 /*return*/];
11956                }
11957            });
11958        });
11959    };
11960    /**
11961     *
11962     * @param apiId
11963     * @param correlationId
11964     * @param forceRefresh
11965     */
11966    BaseInteractionClient.prototype.initializeServerTelemetryManager = function (apiId, forceRefresh) {
11967        this.logger.verbose("initializeServerTelemetryManager called");
11968        var telemetryPayload = {
11969            clientId: this.config.auth.clientId,
11970            correlationId: this.correlationId,
11971            apiId: apiId,
11972            forceRefresh: forceRefresh || false,
11973            wrapperSKU: this.browserStorage.getWrapperMetadata()[0],
11974            wrapperVer: this.browserStorage.getWrapperMetadata()[1]
11975        };
11976        return new ServerTelemetryManager(telemetryPayload, this.browserStorage);
11977    };
11978    /**
11979     * Used to get a discovered version of the default authority.
11980     * @param requestAuthority
11981     * @param requestCorrelationId
11982     */
11983    BaseInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority) {
11984        return __awaiter$1(this, void 0, void 0, function () {
11985            var authorityOptions;
11986            return __generator$1(this, function (_a) {
11987                switch (_a.label) {
11988                    case 0:
11989                        this.logger.verbose("getDiscoveredAuthority called");
11990                        authorityOptions = {
11991                            protocolMode: this.config.auth.protocolMode,
11992                            knownAuthorities: this.config.auth.knownAuthorities,
11993                            cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
11994                            authorityMetadata: this.config.auth.authorityMetadata
11995                        };
11996                        if (!requestAuthority) return [3 /*break*/, 2];
11997                        this.logger.verbose("Creating discovered authority with request authority");
11998                        return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];
11999                    case 1: return [2 /*return*/, _a.sent()];
12000                    case 2:
12001                        this.logger.verbose("Creating discovered authority with configured authority");
12002                        return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];
12003                    case 3: return [2 /*return*/, _a.sent()];
12004                }
12005            });
12006        });
12007    };
12008    return BaseInteractionClient;
12009}());
12010
12011/*
12012 * Copyright (c) Microsoft Corporation. All rights reserved.
12013 * Licensed under the MIT License.
12014 */
12015/**
12016 * Defines the class structure and helper functions used by the "standard", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))
12017 */
12018var StandardInteractionClient = /** @class */ (function (_super) {
12019    __extends$1(StandardInteractionClient, _super);
12020    function StandardInteractionClient() {
12021        return _super !== null && _super.apply(this, arguments) || this;
12022    }
12023    /**
12024     * Generates an auth code request tied to the url request.
12025     * @param request
12026     */
12027    StandardInteractionClient.prototype.initializeAuthorizationCodeRequest = function (request) {
12028        return __awaiter$1(this, void 0, void 0, function () {
12029            var generatedPkceParams, authCodeRequest;
12030            return __generator$1(this, function (_a) {
12031                switch (_a.label) {
12032                    case 0:
12033                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
12034                        this.logger.verbose("initializeAuthorizationRequest called", request.correlationId);
12035                        return [4 /*yield*/, this.browserCrypto.generatePkceCodes()];
12036                    case 1:
12037                        generatedPkceParams = _a.sent();
12038                        authCodeRequest = __assign$1(__assign$1({}, request), { redirectUri: request.redirectUri, code: Constants.EMPTY_STRING, codeVerifier: generatedPkceParams.verifier });
12039                        request.codeChallenge = generatedPkceParams.challenge;
12040                        request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;
12041                        return [2 /*return*/, authCodeRequest];
12042                }
12043            });
12044        });
12045    };
12046    /**
12047     * Initializer for the logout request.
12048     * @param logoutRequest
12049     */
12050    StandardInteractionClient.prototype.initializeLogoutRequest = function (logoutRequest) {
12051        this.logger.verbose("initializeLogoutRequest called", logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.correlationId);
12052        var validLogoutRequest = __assign$1({ correlationId: this.correlationId || this.browserCrypto.createNewGuid() }, logoutRequest);
12053        /**
12054         * Set logout_hint to be login_hint from ID Token Claims if present
12055         * and logoutHint attribute wasn't manually set in logout request
12056         */
12057        if (logoutRequest) {
12058            // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims
12059            if (!logoutRequest.logoutHint) {
12060                if (logoutRequest.account) {
12061                    var logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);
12062                    if (logoutHint) {
12063                        this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided");
12064                        validLogoutRequest.logoutHint = logoutHint;
12065                    }
12066                }
12067                else {
12068                    this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");
12069                }
12070            }
12071            else {
12072                this.logger.verbose("logoutHint has already been set in logoutRequest");
12073            }
12074        }
12075        else {
12076            this.logger.verbose("logoutHint will not be set since no logout request was configured");
12077        }
12078        /*
12079         * Only set redirect uri if logout request isn't provided or the set uri isn't null.
12080         * Otherwise, use passed uri, config, or current page.
12081         */
12082        if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {
12083            if (logoutRequest && logoutRequest.postLogoutRedirectUri) {
12084                this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request", validLogoutRequest.correlationId);
12085                validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, BrowserUtils.getCurrentUri());
12086            }
12087            else if (this.config.auth.postLogoutRedirectUri === null) {
12088                this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect", validLogoutRequest.correlationId);
12089            }
12090            else if (this.config.auth.postLogoutRedirectUri) {
12091                this.logger.verbose("Setting postLogoutRedirectUri to configured uri", validLogoutRequest.correlationId);
12092                validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, BrowserUtils.getCurrentUri());
12093            }
12094            else {
12095                this.logger.verbose("Setting postLogoutRedirectUri to current page", validLogoutRequest.correlationId);
12096                validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(BrowserUtils.getCurrentUri(), BrowserUtils.getCurrentUri());
12097            }
12098        }
12099        else {
12100            this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri", validLogoutRequest.correlationId);
12101        }
12102        return validLogoutRequest;
12103    };
12104    /**
12105     * Parses login_hint ID Token Claim out of AccountInfo object to be used as
12106     * logout_hint in end session request.
12107     * @param account
12108     */
12109    StandardInteractionClient.prototype.getLogoutHintFromIdTokenClaims = function (account) {
12110        var idTokenClaims = account.idTokenClaims;
12111        if (idTokenClaims) {
12112            if (idTokenClaims.login_hint) {
12113                return idTokenClaims.login_hint;
12114            }
12115            else {
12116                this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request");
12117            }
12118        }
12119        else {
12120            this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");
12121        }
12122        return null;
12123    };
12124    /**
12125     * Creates an Authorization Code Client with the given authority, or the default authority.
12126     * @param serverTelemetryManager
12127     * @param authorityUrl
12128     */
12129    StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {
12130        return __awaiter$1(this, void 0, void 0, function () {
12131            var clientConfig;
12132            return __generator$1(this, function (_a) {
12133                switch (_a.label) {
12134                    case 0:
12135                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);
12136                        // Create auth module.
12137                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
12138                        return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions)];
12139                    case 1:
12140                        clientConfig = _a.sent();
12141                        return [2 /*return*/, new AuthorizationCodeClient(clientConfig, this.performanceClient)];
12142                }
12143            });
12144        });
12145    };
12146    /**
12147     * Creates a Client Configuration object with the given request authority, or the default authority.
12148     * @param serverTelemetryManager
12149     * @param requestAuthority
12150     * @param requestCorrelationId
12151     */
12152    StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
12153        return __awaiter$1(this, void 0, void 0, function () {
12154            var discoveredAuthority, logger;
12155            return __generator$1(this, function (_a) {
12156                switch (_a.label) {
12157                    case 0:
12158                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
12159                        this.logger.verbose("getClientConfiguration called", this.correlationId);
12160                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
12161                        return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions)];
12162                    case 1:
12163                        discoveredAuthority = _a.sent();
12164                        logger = this.config.system.loggerOptions;
12165                        return [2 /*return*/, {
12166                                authOptions: {
12167                                    clientId: this.config.auth.clientId,
12168                                    authority: discoveredAuthority,
12169                                    clientCapabilities: this.config.auth.clientCapabilities
12170                                },
12171                                systemOptions: {
12172                                    tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,
12173                                    preventCorsPreflight: true
12174                                },
12175                                loggerOptions: {
12176                                    loggerCallback: logger.loggerCallback,
12177                                    piiLoggingEnabled: logger.piiLoggingEnabled,
12178                                    logLevel: logger.logLevel,
12179                                    correlationId: this.correlationId
12180                                },
12181                                cacheOptions: {
12182                                    claimsBasedCachingEnabled: this.config.cache.claimsBasedCachingEnabled
12183                                },
12184                                cryptoInterface: this.browserCrypto,
12185                                networkInterface: this.networkClient,
12186                                storageInterface: this.browserStorage,
12187                                serverTelemetryManager: serverTelemetryManager,
12188                                libraryInfo: {
12189                                    sku: BrowserConstants.MSAL_SKU,
12190                                    version: version,
12191                                    cpu: Constants.EMPTY_STRING,
12192                                    os: Constants.EMPTY_STRING
12193                                },
12194                                telemetry: this.config.telemetry
12195                            }];
12196                }
12197            });
12198        });
12199    };
12200    /**
12201     * @param hash
12202     * @param interactionType
12203     */
12204    StandardInteractionClient.prototype.validateAndExtractStateFromHash = function (serverParams, interactionType, requestCorrelationId) {
12205        this.logger.verbose("validateAndExtractStateFromHash called", requestCorrelationId);
12206        if (!serverParams.state) {
12207            throw BrowserAuthError.createHashDoesNotContainStateError();
12208        }
12209        var platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);
12210        if (!platformStateObj) {
12211            throw BrowserAuthError.createUnableToParseStateError();
12212        }
12213        if (platformStateObj.interactionType !== interactionType) {
12214            throw BrowserAuthError.createStateInteractionTypeMismatchError();
12215        }
12216        this.logger.verbose("Returning state from hash", requestCorrelationId);
12217        return serverParams.state;
12218    };
12219    /**
12220     * Used to get a discovered version of the default authority.
12221     * @param requestAuthority
12222     * @param requestCorrelationId
12223     */
12224    StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority, requestAzureCloudOptions) {
12225        var _a;
12226        return __awaiter$1(this, void 0, void 0, function () {
12227            var getAuthorityMeasurement, authorityOptions, userAuthority, builtAuthority;
12228            return __generator$1(this, function (_b) {
12229                switch (_b.label) {
12230                    case 0:
12231                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
12232                        this.logger.verbose("getDiscoveredAuthority called", this.correlationId);
12233                        getAuthorityMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
12234                        authorityOptions = {
12235                            protocolMode: this.config.auth.protocolMode,
12236                            knownAuthorities: this.config.auth.knownAuthorities,
12237                            cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
12238                            authorityMetadata: this.config.auth.authorityMetadata,
12239                            skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache
12240                        };
12241                        userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;
12242                        builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
12243                        this.logger.verbose("Creating discovered authority with configured authority", this.correlationId);
12244                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);
12245                        return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.performanceClient, this.correlationId)
12246                                .then(function (result) {
12247                                getAuthorityMeasurement.endMeasurement({
12248                                    success: true,
12249                                });
12250                                return result;
12251                            })
12252                                .catch(function (error) {
12253                                getAuthorityMeasurement.endMeasurement({
12254                                    errorCode: error.errorCode,
12255                                    subErrorCode: error.subError,
12256                                    success: false
12257                                });
12258                                throw error;
12259                            })];
12260                    case 1: return [2 /*return*/, _b.sent()];
12261                }
12262            });
12263        });
12264    };
12265    /**
12266     * Helper to initialize required request parameters for interactive APIs and ssoSilent()
12267     * @param request
12268     * @param interactionType
12269     */
12270    StandardInteractionClient.prototype.initializeAuthorizationRequest = function (request, interactionType) {
12271        return __awaiter$1(this, void 0, void 0, function () {
12272            var redirectUri, browserState, state, validatedRequest, _a, account, legacyLoginHint;
12273            return __generator$1(this, function (_b) {
12274                switch (_b.label) {
12275                    case 0:
12276                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);
12277                        this.logger.verbose("initializeAuthorizationRequest called", this.correlationId);
12278                        redirectUri = this.getRedirectUri(request.redirectUri);
12279                        browserState = {
12280                            interactionType: interactionType
12281                        };
12282                        state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
12283                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
12284                        _a = [{}];
12285                        return [4 /*yield*/, this.initializeBaseRequest(request)];
12286                    case 1:
12287                        validatedRequest = __assign$1.apply(void 0, [__assign$1.apply(void 0, _a.concat([_b.sent()])), { redirectUri: redirectUri, state: state, nonce: request.nonce || this.browserCrypto.createNewGuid(), responseMode: ResponseMode.FRAGMENT }]);
12288                        account = request.account || this.browserStorage.getActiveAccount();
12289                        if (account) {
12290                            this.logger.verbose("Setting validated request account", this.correlationId);
12291                            this.logger.verbosePii("Setting validated request account: " + account.homeAccountId, this.correlationId);
12292                            validatedRequest.account = account;
12293                        }
12294                        // Check for ADAL/MSAL v1 SSO
12295                        if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {
12296                            legacyLoginHint = this.browserStorage.getLegacyLoginHint();
12297                            if (legacyLoginHint) {
12298                                validatedRequest.loginHint = legacyLoginHint;
12299                            }
12300                        }
12301                        return [2 /*return*/, validatedRequest];
12302                }
12303            });
12304        });
12305    };
12306    return StandardInteractionClient;
12307}(BaseInteractionClient));
12308
12309/*
12310 * Copyright (c) Microsoft Corporation. All rights reserved.
12311 * Licensed under the MIT License.
12312 */
12313/**
12314 * Abstract class which defines operations for a browser interaction handling class.
12315 */
12316var InteractionHandler = /** @class */ (function () {
12317    function InteractionHandler(authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) {
12318        this.authModule = authCodeModule;
12319        this.browserStorage = storageImpl;
12320        this.authCodeRequest = authCodeRequest;
12321        this.logger = logger;
12322        this.performanceClient = performanceClient;
12323    }
12324    /**
12325     * Function to handle response parameters from hash.
12326     * @param locationHash
12327     */
12328    InteractionHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {
12329        return __awaiter$1(this, void 0, void 0, function () {
12330            var stateKey, requestState, authCodeResponse;
12331            return __generator$1(this, function (_a) {
12332                this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.HandleCodeResponseFromHash, this.authCodeRequest.correlationId);
12333                this.logger.verbose("InteractionHandler.handleCodeResponse called");
12334                // Check that location hash isn't empty.
12335                if (StringUtils.isEmpty(locationHash)) {
12336                    throw BrowserAuthError.createEmptyHashError(locationHash);
12337                }
12338                stateKey = this.browserStorage.generateStateKey(state);
12339                requestState = this.browserStorage.getTemporaryCache(stateKey);
12340                if (!requestState) {
12341                    throw ClientAuthError.createStateNotFoundError("Cached State");
12342                }
12343                try {
12344                    authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
12345                }
12346                catch (e) {
12347                    if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {
12348                        // Translate server error caused by user closing native prompt to corresponding first class MSAL error
12349                        throw BrowserAuthError.createUserCancelledError();
12350                    }
12351                    else {
12352                        throw e;
12353                    }
12354                }
12355                this.performanceClient.setPreQueueTime(exports.PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12356                return [2 /*return*/, this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule)];
12357            });
12358        });
12359    };
12360    /**
12361     * Process auth code response from AAD
12362     * @param authCodeResponse
12363     * @param state
12364     * @param authority
12365     * @param networkModule
12366     * @returns
12367     */
12368    InteractionHandler.prototype.handleCodeResponseFromServer = function (authCodeResponse, state, authority, networkModule, validateNonce) {
12369        if (validateNonce === void 0) { validateNonce = true; }
12370        return __awaiter$1(this, void 0, void 0, function () {
12371            var stateKey, requestState, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
12372            return __generator$1(this, function (_a) {
12373                switch (_a.label) {
12374                    case 0:
12375                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12376                        this.logger.trace("InteractionHandler.handleCodeResponseFromServer called");
12377                        stateKey = this.browserStorage.generateStateKey(state);
12378                        requestState = this.browserStorage.getTemporaryCache(stateKey);
12379                        if (!requestState) {
12380                            throw ClientAuthError.createStateNotFoundError("Cached State");
12381                        }
12382                        nonceKey = this.browserStorage.generateNonceKey(requestState);
12383                        cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);
12384                        // Assign code to request
12385                        this.authCodeRequest.code = authCodeResponse.code;
12386                        if (!authCodeResponse.cloud_instance_host_name) return [3 /*break*/, 2];
12387                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12388                        return [4 /*yield*/, this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule)];
12389                    case 1:
12390                        _a.sent();
12391                        _a.label = 2;
12392                    case 2:
12393                        // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)
12394                        if (validateNonce) {
12395                            authCodeResponse.nonce = cachedNonce || undefined;
12396                        }
12397                        authCodeResponse.state = requestState;
12398                        // Add CCS parameters if available
12399                        if (authCodeResponse.client_info) {
12400                            this.authCodeRequest.clientInfo = authCodeResponse.client_info;
12401                        }
12402                        else {
12403                            cachedCcsCred = this.checkCcsCredentials();
12404                            if (cachedCcsCred) {
12405                                this.authCodeRequest.ccsCredential = cachedCcsCred;
12406                            }
12407                        }
12408                        // Acquire token with retrieved code.
12409                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AuthClientAcquireToken, this.authCodeRequest.correlationId);
12410                        return [4 /*yield*/, this.authModule.acquireToken(this.authCodeRequest, authCodeResponse)];
12411                    case 3:
12412                        tokenResponse = _a.sent();
12413                        this.browserStorage.cleanRequestByState(state);
12414                        return [2 /*return*/, tokenResponse];
12415                }
12416            });
12417        });
12418    };
12419    /**
12420     * Updates authority based on cloudInstanceHostname
12421     * @param cloudInstanceHostname
12422     * @param authority
12423     * @param networkModule
12424     */
12425    InteractionHandler.prototype.updateTokenEndpointAuthority = function (cloudInstanceHostname, authority, networkModule) {
12426        return __awaiter$1(this, void 0, void 0, function () {
12427            var cloudInstanceAuthorityUri, cloudInstanceAuthority;
12428            return __generator$1(this, function (_a) {
12429                switch (_a.label) {
12430                    case 0:
12431                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12432                        cloudInstanceAuthorityUri = "https://" + cloudInstanceHostname + "/" + authority.tenant + "/";
12433                        return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options, this.logger, this.performanceClient, this.authCodeRequest.correlationId)];
12434                    case 1:
12435                        cloudInstanceAuthority = _a.sent();
12436                        this.authModule.updateAuthority(cloudInstanceAuthority);
12437                        return [2 /*return*/];
12438                }
12439            });
12440        });
12441    };
12442    /**
12443     * Looks up ccs creds in the cache
12444     */
12445    InteractionHandler.prototype.checkCcsCredentials = function () {
12446        // Look up ccs credential in temp cache
12447        var cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);
12448        if (cachedCcsCred) {
12449            try {
12450                return JSON.parse(cachedCcsCred);
12451            }
12452            catch (e) {
12453                this.authModule.logger.error("Cache credential could not be parsed");
12454                this.authModule.logger.errorPii("Cache credential could not be parsed: " + cachedCcsCred);
12455            }
12456        }
12457        return null;
12458    };
12459    return InteractionHandler;
12460}());
12461
12462/*
12463 * Copyright (c) Microsoft Corporation. All rights reserved.
12464 * Licensed under the MIT License.
12465 */
12466var RedirectHandler = /** @class */ (function (_super) {
12467    __extends$1(RedirectHandler, _super);
12468    function RedirectHandler(authCodeModule, storageImpl, authCodeRequest, logger, browserCrypto, performanceClient) {
12469        var _this = _super.call(this, authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) || this;
12470        _this.browserCrypto = browserCrypto;
12471        return _this;
12472    }
12473    /**
12474     * Redirects window to given URL.
12475     * @param urlNavigate
12476     */
12477    RedirectHandler.prototype.initiateAuthRequest = function (requestUrl, params) {
12478        return __awaiter$1(this, void 0, void 0, function () {
12479            var navigationOptions, navigate;
12480            return __generator$1(this, function (_a) {
12481                switch (_a.label) {
12482                    case 0:
12483                        this.logger.verbose("RedirectHandler.initiateAuthRequest called");
12484                        if (!!StringUtils.isEmpty(requestUrl)) return [3 /*break*/, 7];
12485                        // Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true
12486                        if (params.redirectStartPage) {
12487                            this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page");
12488                            this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);
12489                        }
12490                        // Set interaction status in the library.
12491                        this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);
12492                        this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);
12493                        this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: " + requestUrl);
12494                        navigationOptions = {
12495                            apiId: exports.ApiId.acquireTokenRedirect,
12496                            timeout: params.redirectTimeout,
12497                            noHistory: false
12498                        };
12499                        if (!(typeof params.onRedirectNavigate === "function")) return [3 /*break*/, 4];
12500                        this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback");
12501                        navigate = params.onRedirectNavigate(requestUrl);
12502                        if (!(navigate !== false)) return [3 /*break*/, 2];
12503                        this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating");
12504                        return [4 /*yield*/, params.navigationClient.navigateExternal(requestUrl, navigationOptions)];
12505                    case 1:
12506                        _a.sent();
12507                        return [2 /*return*/];
12508                    case 2:
12509                        this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");
12510                        return [2 /*return*/];
12511                    case 3: return [3 /*break*/, 6];
12512                    case 4:
12513                        // Navigate window to request URL
12514                        this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url");
12515                        return [4 /*yield*/, params.navigationClient.navigateExternal(requestUrl, navigationOptions)];
12516                    case 5:
12517                        _a.sent();
12518                        return [2 /*return*/];
12519                    case 6: return [3 /*break*/, 8];
12520                    case 7:
12521                        // Throw error if request URL is empty.
12522                        this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty");
12523                        throw BrowserAuthError.createEmptyNavigationUriError();
12524                    case 8: return [2 /*return*/];
12525                }
12526            });
12527        });
12528    };
12529    /**
12530     * Handle authorization code response in the window.
12531     * @param hash
12532     */
12533    RedirectHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {
12534        return __awaiter$1(this, void 0, void 0, function () {
12535            var stateKey, requestState, authCodeResponse, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
12536            return __generator$1(this, function (_a) {
12537                switch (_a.label) {
12538                    case 0:
12539                        this.logger.verbose("RedirectHandler.handleCodeResponse called");
12540                        // Check that location hash isn't empty.
12541                        if (StringUtils.isEmpty(locationHash)) {
12542                            throw BrowserAuthError.createEmptyHashError(locationHash);
12543                        }
12544                        // Interaction is completed - remove interaction status.
12545                        this.browserStorage.setInteractionInProgress(false);
12546                        stateKey = this.browserStorage.generateStateKey(state);
12547                        requestState = this.browserStorage.getTemporaryCache(stateKey);
12548                        if (!requestState) {
12549                            throw ClientAuthError.createStateNotFoundError("Cached State");
12550                        }
12551                        try {
12552                            authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
12553                        }
12554                        catch (e) {
12555                            if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {
12556                                // Translate server error caused by user closing native prompt to corresponding first class MSAL error
12557                                throw BrowserAuthError.createUserCancelledError();
12558                            }
12559                            else {
12560                                throw e;
12561                            }
12562                        }
12563                        nonceKey = this.browserStorage.generateNonceKey(requestState);
12564                        cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);
12565                        // Assign code to request
12566                        this.authCodeRequest.code = authCodeResponse.code;
12567                        if (!authCodeResponse.cloud_instance_host_name) return [3 /*break*/, 2];
12568                        return [4 /*yield*/, this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule)];
12569                    case 1:
12570                        _a.sent();
12571                        _a.label = 2;
12572                    case 2:
12573                        authCodeResponse.nonce = cachedNonce || undefined;
12574                        authCodeResponse.state = requestState;
12575                        // Add CCS parameters if available
12576                        if (authCodeResponse.client_info) {
12577                            this.authCodeRequest.clientInfo = authCodeResponse.client_info;
12578                        }
12579                        else {
12580                            cachedCcsCred = this.checkCcsCredentials();
12581                            if (cachedCcsCred) {
12582                                this.authCodeRequest.ccsCredential = cachedCcsCred;
12583                            }
12584                        }
12585                        return [4 /*yield*/, this.authModule.acquireToken(this.authCodeRequest, authCodeResponse)];
12586                    case 3:
12587                        tokenResponse = _a.sent();
12588                        this.browserStorage.cleanRequestByState(state);
12589                        return [2 /*return*/, tokenResponse];
12590                }
12591            });
12592        });
12593    };
12594    return RedirectHandler;
12595}(InteractionHandler));
12596
12597/*
12598 * Copyright (c) Microsoft Corporation. All rights reserved.
12599 * Licensed under the MIT License.
12600 */
12601exports.EventType = void 0;
12602(function (EventType) {
12603    EventType["INITIALIZE_START"] = "msal:initializeStart";
12604    EventType["INITIALIZE_END"] = "msal:initializeEnd";
12605    EventType["ACCOUNT_ADDED"] = "msal:accountAdded";
12606    EventType["ACCOUNT_REMOVED"] = "msal:accountRemoved";
12607    EventType["LOGIN_START"] = "msal:loginStart";
12608    EventType["LOGIN_SUCCESS"] = "msal:loginSuccess";
12609    EventType["LOGIN_FAILURE"] = "msal:loginFailure";
12610    EventType["ACQUIRE_TOKEN_START"] = "msal:acquireTokenStart";
12611    EventType["ACQUIRE_TOKEN_SUCCESS"] = "msal:acquireTokenSuccess";
12612    EventType["ACQUIRE_TOKEN_FAILURE"] = "msal:acquireTokenFailure";
12613    EventType["ACQUIRE_TOKEN_NETWORK_START"] = "msal:acquireTokenFromNetworkStart";
12614    EventType["SSO_SILENT_START"] = "msal:ssoSilentStart";
12615    EventType["SSO_SILENT_SUCCESS"] = "msal:ssoSilentSuccess";
12616    EventType["SSO_SILENT_FAILURE"] = "msal:ssoSilentFailure";
12617    EventType["ACQUIRE_TOKEN_BY_CODE_START"] = "msal:acquireTokenByCodeStart";
12618    EventType["ACQUIRE_TOKEN_BY_CODE_SUCCESS"] = "msal:acquireTokenByCodeSuccess";
12619    EventType["ACQUIRE_TOKEN_BY_CODE_FAILURE"] = "msal:acquireTokenByCodeFailure";
12620    EventType["HANDLE_REDIRECT_START"] = "msal:handleRedirectStart";
12621    EventType["HANDLE_REDIRECT_END"] = "msal:handleRedirectEnd";
12622    EventType["POPUP_OPENED"] = "msal:popupOpened";
12623    EventType["LOGOUT_START"] = "msal:logoutStart";
12624    EventType["LOGOUT_SUCCESS"] = "msal:logoutSuccess";
12625    EventType["LOGOUT_FAILURE"] = "msal:logoutFailure";
12626    EventType["LOGOUT_END"] = "msal:logoutEnd";
12627    EventType["RESTORE_FROM_BFCACHE"] = "msal:restoreFromBFCache";
12628})(exports.EventType || (exports.EventType = {}));
12629
12630/*
12631 * Copyright (c) Microsoft Corporation. All rights reserved.
12632 * Licensed under the MIT License.
12633 */
12634var NativeStatusCode;
12635(function (NativeStatusCode) {
12636    NativeStatusCode["USER_INTERACTION_REQUIRED"] = "USER_INTERACTION_REQUIRED";
12637    NativeStatusCode["USER_CANCEL"] = "USER_CANCEL";
12638    NativeStatusCode["NO_NETWORK"] = "NO_NETWORK";
12639    NativeStatusCode["TRANSIENT_ERROR"] = "TRANSIENT_ERROR";
12640    NativeStatusCode["PERSISTENT_ERROR"] = "PERSISTENT_ERROR";
12641    NativeStatusCode["DISABLED"] = "DISABLED";
12642    NativeStatusCode["ACCOUNT_UNAVAILABLE"] = "ACCOUNT_UNAVAILABLE";
12643})(NativeStatusCode || (NativeStatusCode = {}));
12644var NativeAuthErrorMessage = {
12645    extensionError: {
12646        code: "ContentError"
12647    },
12648    userSwitch: {
12649        code: "user_switch",
12650        desc: "User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."
12651    },
12652    tokensNotFoundInCache: {
12653        code: "tokens_not_found_in_internal_memory_cache",
12654        desc: "Tokens not cached in MSAL JS internal memory, please make the WAM request"
12655    }
12656};
12657var NativeAuthError = /** @class */ (function (_super) {
12658    __extends$1(NativeAuthError, _super);
12659    function NativeAuthError(errorCode, description, ext) {
12660        var _this = _super.call(this, errorCode, description) || this;
12661        Object.setPrototypeOf(_this, NativeAuthError.prototype);
12662        _this.name = "NativeAuthError";
12663        _this.ext = ext;
12664        return _this;
12665    }
12666    /**
12667     * These errors should result in a fallback to the 'standard' browser based auth flow.
12668     */
12669    NativeAuthError.prototype.isFatal = function () {
12670        if (this.ext && this.ext.status && (this.ext.status === NativeStatusCode.PERSISTENT_ERROR || this.ext.status === NativeStatusCode.DISABLED)) {
12671            return true;
12672        }
12673        switch (this.errorCode) {
12674            case NativeAuthErrorMessage.extensionError.code:
12675                return true;
12676            default:
12677                return false;
12678        }
12679    };
12680    /**
12681     * Create the appropriate error object based on the WAM status code.
12682     * @param code
12683     * @param description
12684     * @param ext
12685     * @returns
12686     */
12687    NativeAuthError.createError = function (code, description, ext) {
12688        if (ext && ext.status) {
12689            switch (ext.status) {
12690                case NativeStatusCode.ACCOUNT_UNAVAILABLE:
12691                    return InteractionRequiredAuthError.createNativeAccountUnavailableError();
12692                case NativeStatusCode.USER_INTERACTION_REQUIRED:
12693                    return new InteractionRequiredAuthError(code, description);
12694                case NativeStatusCode.USER_CANCEL:
12695                    return BrowserAuthError.createUserCancelledError();
12696                case NativeStatusCode.NO_NETWORK:
12697                    return BrowserAuthError.createNoNetworkConnectivityError();
12698            }
12699        }
12700        return new NativeAuthError(code, description, ext);
12701    };
12702    /**
12703     * Creates user switch error when the user chooses a different account in the native broker prompt
12704     * @returns
12705     */
12706    NativeAuthError.createUserSwitchError = function () {
12707        return new NativeAuthError(NativeAuthErrorMessage.userSwitch.code, NativeAuthErrorMessage.userSwitch.desc);
12708    };
12709    /**
12710     * Creates a tokens not found error when the internal cache look up fails
12711     * @returns NativeAuthError: tokensNotFoundInCache
12712     */
12713    NativeAuthError.createTokensNotFoundInCacheError = function () {
12714        return new NativeAuthError(NativeAuthErrorMessage.tokensNotFoundInCache.code, NativeAuthErrorMessage.tokensNotFoundInCache.desc);
12715    };
12716    return NativeAuthError;
12717}(AuthError));
12718
12719/*
12720 * Copyright (c) Microsoft Corporation. All rights reserved.
12721 * Licensed under the MIT License.
12722 */
12723var SilentCacheClient = /** @class */ (function (_super) {
12724    __extends$1(SilentCacheClient, _super);
12725    function SilentCacheClient() {
12726        return _super !== null && _super.apply(this, arguments) || this;
12727    }
12728    /**
12729     * Returns unexpired tokens from the cache, if available
12730     * @param silentRequest
12731     */
12732    SilentCacheClient.prototype.acquireToken = function (silentRequest) {
12733        return __awaiter$1(this, void 0, void 0, function () {
12734            var acquireTokenMeasurement, serverTelemetryManager, silentAuthClient, cachedToken, error_1;
12735            return __generator$1(this, function (_a) {
12736                switch (_a.label) {
12737                    case 0:
12738                        acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
12739                        serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
12740                        return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
12741                    case 1:
12742                        silentAuthClient = _a.sent();
12743                        this.logger.verbose("Silent auth client created");
12744                        _a.label = 2;
12745                    case 2:
12746                        _a.trys.push([2, 4, , 5]);
12747                        return [4 /*yield*/, silentAuthClient.acquireCachedToken(silentRequest)];
12748                    case 3:
12749                        cachedToken = _a.sent();
12750                        acquireTokenMeasurement.endMeasurement({
12751                            success: true,
12752                            fromCache: true
12753                        });
12754                        return [2 /*return*/, cachedToken];
12755                    case 4:
12756                        error_1 = _a.sent();
12757                        if (error_1 instanceof BrowserAuthError && error_1.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {
12758                            this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.");
12759                        }
12760                        acquireTokenMeasurement.endMeasurement({
12761                            errorCode: error_1 instanceof AuthError && error_1.errorCode || undefined,
12762                            subErrorCode: error_1 instanceof AuthError && error_1.subError || undefined,
12763                            success: false
12764                        });
12765                        throw error_1;
12766                    case 5: return [2 /*return*/];
12767                }
12768            });
12769        });
12770    };
12771    /**
12772     * Currently Unsupported
12773     */
12774    SilentCacheClient.prototype.logout = function () {
12775        // Synchronous so we must reject
12776        return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());
12777    };
12778    /**
12779     * Creates an Silent Flow Client with the given authority, or the default authority.
12780     * @param serverTelemetryManager
12781     * @param authorityUrl
12782     */
12783    SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
12784        return __awaiter$1(this, void 0, void 0, function () {
12785            var clientConfig;
12786            return __generator$1(this, function (_a) {
12787                switch (_a.label) {
12788                    case 0:
12789                        // Create auth module.
12790                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
12791                        return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
12792                    case 1:
12793                        clientConfig = _a.sent();
12794                        return [2 /*return*/, new SilentFlowClient(clientConfig, this.performanceClient)];
12795                }
12796            });
12797        });
12798    };
12799    SilentCacheClient.prototype.initializeSilentRequest = function (request, account) {
12800        return __awaiter$1(this, void 0, void 0, function () {
12801            var _a;
12802            return __generator$1(this, function (_b) {
12803                switch (_b.label) {
12804                    case 0:
12805                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeSilentRequest, this.correlationId);
12806                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
12807                        _a = [__assign$1({}, request)];
12808                        return [4 /*yield*/, this.initializeBaseRequest(request, account)];
12809                    case 1: return [2 /*return*/, __assign$1.apply(void 0, [__assign$1.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];
12810                }
12811            });
12812        });
12813    };
12814    return SilentCacheClient;
12815}(StandardInteractionClient));
12816
12817/*
12818 * Copyright (c) Microsoft Corporation. All rights reserved.
12819 * Licensed under the MIT License.
12820 */
12821var NativeInteractionClient = /** @class */ (function (_super) {
12822    __extends$1(NativeInteractionClient, _super);
12823    function NativeInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
12824        var _this = _super.call(this, config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId) || this;
12825        _this.apiId = apiId;
12826        _this.accountId = accountId;
12827        _this.nativeMessageHandler = provider;
12828        _this.nativeStorageManager = nativeStorageImpl;
12829        _this.silentCacheClient = new SilentCacheClient(config, _this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
12830        return _this;
12831    }
12832    /**
12833     * Acquire token from native platform via browser extension
12834     * @param request
12835     */
12836    NativeInteractionClient.prototype.acquireToken = function (request) {
12837        return __awaiter$1(this, void 0, void 0, function () {
12838            var nativeATMeasurement, reqTimestamp, nativeRequest, result, messageBody, response, validatedResponse;
12839            return __generator$1(this, function (_a) {
12840                switch (_a.label) {
12841                    case 0:
12842                        this.logger.trace("NativeInteractionClient - acquireToken called.");
12843                        nativeATMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
12844                        reqTimestamp = TimeUtils.nowSeconds();
12845                        return [4 /*yield*/, this.initializeNativeRequest(request)];
12846                    case 1:
12847                        nativeRequest = _a.sent();
12848                        _a.label = 2;
12849                    case 2:
12850                        _a.trys.push([2, 4, , 5]);
12851                        return [4 /*yield*/, this.acquireTokensFromCache(this.accountId, nativeRequest)];
12852                    case 3:
12853                        result = _a.sent();
12854                        nativeATMeasurement.endMeasurement({
12855                            success: true,
12856                            isNativeBroker: false,
12857                            fromCache: true
12858                        });
12859                        return [2 /*return*/, result];
12860                    case 4:
12861                        _a.sent();
12862                        // continue with a native call for any and all errors
12863                        this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call");
12864                        return [3 /*break*/, 5];
12865                    case 5:
12866                        messageBody = {
12867                            method: NativeExtensionMethod.GetToken,
12868                            request: nativeRequest
12869                        };
12870                        return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];
12871                    case 6:
12872                        response = _a.sent();
12873                        validatedResponse = this.validateNativeResponse(response);
12874                        return [2 /*return*/, this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
12875                                .then(function (result) {
12876                                nativeATMeasurement.endMeasurement({
12877                                    success: true,
12878                                    isNativeBroker: true,
12879                                    requestId: result.requestId
12880                                });
12881                                return result;
12882                            })
12883                                .catch(function (error) {
12884                                nativeATMeasurement.endMeasurement({
12885                                    success: false,
12886                                    errorCode: error.errorCode,
12887                                    subErrorCode: error.subError,
12888                                    isNativeBroker: true
12889                                });
12890                                throw error;
12891                            })];
12892                }
12893            });
12894        });
12895    };
12896    /**
12897     * Creates silent flow request
12898     * @param request
12899     * @param cachedAccount
12900     * @returns CommonSilentFlowRequest
12901     */
12902    NativeInteractionClient.prototype.createSilentCacheRequest = function (request, cachedAccount) {
12903        return {
12904            authority: request.authority,
12905            correlationId: this.correlationId,
12906            scopes: ScopeSet.fromString(request.scope).asArray(),
12907            account: cachedAccount,
12908            forceRefresh: false,
12909        };
12910    };
12911    /**
12912     * Fetches the tokens from the cache if un-expired
12913     * @param nativeAccountId
12914     * @param request
12915     * @returns authenticationResult
12916     */
12917    NativeInteractionClient.prototype.acquireTokensFromCache = function (nativeAccountId, request) {
12918        return __awaiter$1(this, void 0, void 0, function () {
12919            var account, silentRequest, result, fullAccount, e_2;
12920            return __generator$1(this, function (_a) {
12921                switch (_a.label) {
12922                    case 0:
12923                        if (!nativeAccountId) {
12924                            this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided");
12925                            throw ClientAuthError.createNoAccountFoundError();
12926                        }
12927                        account = this.browserStorage.getAccountInfoFilteredBy({ nativeAccountId: nativeAccountId });
12928                        if (!account) {
12929                            throw ClientAuthError.createNoAccountFoundError();
12930                        }
12931                        _a.label = 1;
12932                    case 1:
12933                        _a.trys.push([1, 3, , 4]);
12934                        silentRequest = this.createSilentCacheRequest(request, account);
12935                        return [4 /*yield*/, this.silentCacheClient.acquireToken(silentRequest)];
12936                    case 2:
12937                        result = _a.sent();
12938                        fullAccount = __assign$1(__assign$1({}, account), { idTokenClaims: result.idTokenClaims });
12939                        return [2 /*return*/, __assign$1(__assign$1({}, result), { account: fullAccount })];
12940                    case 3:
12941                        e_2 = _a.sent();
12942                        throw e_2;
12943                    case 4: return [2 /*return*/];
12944                }
12945            });
12946        });
12947    };
12948    /**
12949     * Acquires a token from native platform then redirects to the redirectUri instead of returning the response
12950     * @param request
12951     */
12952    NativeInteractionClient.prototype.acquireTokenRedirect = function (request) {
12953        return __awaiter$1(this, void 0, void 0, function () {
12954            var nativeRequest, messageBody, response, e_3, navigationOptions, redirectUri;
12955            return __generator$1(this, function (_a) {
12956                switch (_a.label) {
12957                    case 0:
12958                        this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");
12959                        return [4 /*yield*/, this.initializeNativeRequest(request)];
12960                    case 1:
12961                        nativeRequest = _a.sent();
12962                        messageBody = {
12963                            method: NativeExtensionMethod.GetToken,
12964                            request: nativeRequest
12965                        };
12966                        _a.label = 2;
12967                    case 2:
12968                        _a.trys.push([2, 4, , 5]);
12969                        return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];
12970                    case 3:
12971                        response = _a.sent();
12972                        this.validateNativeResponse(response);
12973                        return [3 /*break*/, 5];
12974                    case 4:
12975                        e_3 = _a.sent();
12976                        // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
12977                        if (e_3 instanceof NativeAuthError && e_3.isFatal()) {
12978                            throw e_3;
12979                        }
12980                        return [3 /*break*/, 5];
12981                    case 5:
12982                        this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
12983                        navigationOptions = {
12984                            apiId: exports.ApiId.acquireTokenRedirect,
12985                            timeout: this.config.system.redirectNavigationTimeout,
12986                            noHistory: false
12987                        };
12988                        redirectUri = this.config.auth.navigateToLoginRequestUrl ? window.location.href : this.getRedirectUri(request.redirectUri);
12989                        return [4 /*yield*/, this.navigationClient.navigateExternal(redirectUri, navigationOptions)];
12990                    case 6:
12991                        _a.sent(); // Need to treat this as external to ensure handleRedirectPromise is run again
12992                        return [2 /*return*/];
12993                }
12994            });
12995        });
12996    };
12997    /**
12998     * If the previous page called native platform for a token using redirect APIs, send the same request again and return the response
12999     */
13000    NativeInteractionClient.prototype.handleRedirectPromise = function () {
13001        return __awaiter$1(this, void 0, void 0, function () {
13002            var cachedRequest, prompt, request, messageBody, reqTimestamp, response, result, e_4;
13003            return __generator$1(this, function (_a) {
13004                switch (_a.label) {
13005                    case 0:
13006                        this.logger.trace("NativeInteractionClient - handleRedirectPromise called.");
13007                        if (!this.browserStorage.isInteractionInProgress(true)) {
13008                            this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.");
13009                            return [2 /*return*/, null];
13010                        }
13011                        cachedRequest = this.browserStorage.getCachedNativeRequest();
13012                        if (!cachedRequest) {
13013                            this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.");
13014                            return [2 /*return*/, null];
13015                        }
13016                        prompt = cachedRequest.prompt, request = __rest(cachedRequest, ["prompt"]);
13017                        if (prompt) {
13018                            this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.");
13019                        }
13020                        this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
13021                        messageBody = {
13022                            method: NativeExtensionMethod.GetToken,
13023                            request: request
13024                        };
13025                        reqTimestamp = TimeUtils.nowSeconds();
13026                        _a.label = 1;
13027                    case 1:
13028                        _a.trys.push([1, 3, , 4]);
13029                        this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");
13030                        return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];
13031                    case 2:
13032                        response = _a.sent();
13033                        this.validateNativeResponse(response);
13034                        result = this.handleNativeResponse(response, request, reqTimestamp);
13035                        this.browserStorage.setInteractionInProgress(false);
13036                        return [2 /*return*/, result];
13037                    case 3:
13038                        e_4 = _a.sent();
13039                        this.browserStorage.setInteractionInProgress(false);
13040                        throw e_4;
13041                    case 4: return [2 /*return*/];
13042                }
13043            });
13044        });
13045    };
13046    /**
13047     * Logout from native platform via browser extension
13048     * @param request
13049     */
13050    NativeInteractionClient.prototype.logout = function () {
13051        this.logger.trace("NativeInteractionClient - logout called.");
13052        return Promise.reject("Logout not implemented yet");
13053    };
13054    /**
13055     * Transform response from native platform into AuthenticationResult object which will be returned to the end user
13056     * @param response
13057     * @param request
13058     * @param reqTimestamp
13059     */
13060    NativeInteractionClient.prototype.handleNativeResponse = function (response, request, reqTimestamp) {
13061        return __awaiter$1(this, void 0, void 0, function () {
13062            var authority, idTokenObj, homeAccountIdentifier, accountEntity, result;
13063            return __generator$1(this, function (_a) {
13064                switch (_a.label) {
13065                    case 0:
13066                        this.logger.trace("NativeInteractionClient - handleNativeResponse called.");
13067                        if (response.account.id !== request.accountId) {
13068                            // User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync
13069                            throw NativeAuthError.createUserSwitchError();
13070                        }
13071                        return [4 /*yield*/, this.getDiscoveredAuthority(request.authority)];
13072                    case 1:
13073                        authority = _a.sent();
13074                        idTokenObj = this.createIdTokenObj(response);
13075                        homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenObj);
13076                        accountEntity = AccountEntity.createAccount({
13077                            homeAccountId: homeAccountIdentifier,
13078                            idTokenClaims: idTokenObj.claims,
13079                            clientInfo: response.client_info,
13080                            nativeAccountId: response.account.id,
13081                        }, authority);
13082                        return [4 /*yield*/, this.generateAuthenticationResult(response, request, idTokenObj, accountEntity, authority.canonicalAuthority, reqTimestamp)];
13083                    case 2:
13084                        result = _a.sent();
13085                        // cache accounts and tokens in the appropriate storage
13086                        this.cacheAccount(accountEntity);
13087                        this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
13088                        return [2 /*return*/, result];
13089                }
13090            });
13091        });
13092    };
13093    /**
13094     * Create an idToken Object (not entity)
13095     * @param response
13096     * @returns
13097     */
13098    NativeInteractionClient.prototype.createIdTokenObj = function (response) {
13099        return new AuthToken(response.id_token || Constants.EMPTY_STRING, this.browserCrypto);
13100    };
13101    /**
13102     * creates an homeAccountIdentifier for the account
13103     * @param response
13104     * @param idTokenObj
13105     * @returns
13106     */
13107    NativeInteractionClient.prototype.createHomeAccountIdentifier = function (response, idTokenObj) {
13108        // Save account in browser storage
13109        var homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj.claims);
13110        return homeAccountIdentifier;
13111    };
13112    /**
13113     * Helper to generate scopes
13114     * @param response
13115     * @param request
13116     * @returns
13117     */
13118    NativeInteractionClient.prototype.generateScopes = function (response, request) {
13119        return response.scope ? ScopeSet.fromString(response.scope) : ScopeSet.fromString(request.scope);
13120    };
13121    /**
13122     * If PoP token is requesred, records the PoP token if returned from the WAM, else generates one in the browser
13123     * @param request
13124     * @param response
13125     */
13126    NativeInteractionClient.prototype.generatePopAccessToken = function (response, request) {
13127        return __awaiter$1(this, void 0, void 0, function () {
13128            var popTokenGenerator, shrParameters;
13129            return __generator$1(this, function (_a) {
13130                switch (_a.label) {
13131                    case 0:
13132                        if (!(request.tokenType === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
13133                        /**
13134                         * This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT
13135                         * is still received, SHR is calculated locally
13136                         */
13137                        // Check if native layer returned an SHR token
13138                        if (response.shr) {
13139                            this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer");
13140                            return [2 /*return*/, response.shr];
13141                        }
13142                        popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
13143                        shrParameters = {
13144                            resourceRequestMethod: request.resourceRequestMethod,
13145                            resourceRequestUri: request.resourceRequestUri,
13146                            shrClaims: request.shrClaims,
13147                            shrNonce: request.shrNonce
13148                        };
13149                        /**
13150                         * KeyID must be present in the native request from when the PoP key was generated in order for
13151                         * PopTokenGenerator to query the full key for signing
13152                         */
13153                        if (!request.keyId) {
13154                            throw ClientAuthError.createKeyIdMissingError();
13155                        }
13156                        return [4 /*yield*/, popTokenGenerator.signPopToken(response.access_token, request.keyId, shrParameters)];
13157                    case 1: return [2 /*return*/, _a.sent()];
13158                    case 2: return [2 /*return*/, response.access_token];
13159                }
13160            });
13161        });
13162    };
13163    /**
13164     * Generates authentication result
13165     * @param response
13166     * @param request
13167     * @param idTokenObj
13168     * @param accountEntity
13169     * @param authority
13170     * @param reqTimestamp
13171     * @returns
13172     */
13173    NativeInteractionClient.prototype.generateAuthenticationResult = function (response, request, idTokenObj, accountEntity, authority, reqTimestamp) {
13174        return __awaiter$1(this, void 0, void 0, function () {
13175            var mats, responseScopes, accountProperties, uid, tid, responseAccessToken, tokenType, result;
13176            return __generator$1(this, function (_a) {
13177                switch (_a.label) {
13178                    case 0:
13179                        mats = this.addTelemetryFromNativeResponse(response);
13180                        responseScopes = response.scope ? ScopeSet.fromString(response.scope) : ScopeSet.fromString(request.scope);
13181                        accountProperties = response.account.properties || {};
13182                        uid = accountProperties["UID"] || idTokenObj.claims.oid || idTokenObj.claims.sub || Constants.EMPTY_STRING;
13183                        tid = accountProperties["TenantId"] || idTokenObj.claims.tid || Constants.EMPTY_STRING;
13184                        return [4 /*yield*/, this.generatePopAccessToken(response, request)];
13185                    case 1:
13186                        responseAccessToken = _a.sent();
13187                        tokenType = (request.tokenType === exports.AuthenticationScheme.POP) ? exports.AuthenticationScheme.POP : exports.AuthenticationScheme.BEARER;
13188                        result = {
13189                            authority: authority,
13190                            uniqueId: uid,
13191                            tenantId: tid,
13192                            scopes: responseScopes.asArray(),
13193                            account: accountEntity.getAccountInfo(),
13194                            idToken: response.id_token,
13195                            idTokenClaims: idTokenObj.claims,
13196                            accessToken: responseAccessToken,
13197                            fromCache: mats ? this.isResponseFromCache(mats) : false,
13198                            expiresOn: new Date(Number(reqTimestamp + response.expires_in) * 1000),
13199                            tokenType: tokenType,
13200                            correlationId: this.correlationId,
13201                            state: response.state,
13202                            fromNativeBroker: true
13203                        };
13204                        return [2 /*return*/, result];
13205                }
13206            });
13207        });
13208    };
13209    /**
13210     * cache the account entity in browser storage
13211     * @param accountEntity
13212     */
13213    NativeInteractionClient.prototype.cacheAccount = function (accountEntity) {
13214        var _this = this;
13215        // Store the account info and hence `nativeAccountId` in browser cache
13216        this.browserStorage.setAccount(accountEntity);
13217        // Remove any existing cached tokens for this account in browser storage
13218        this.browserStorage.removeAccountContext(accountEntity).catch(function (e) {
13219            _this.logger.error("Error occurred while removing account context from browser storage. " + e);
13220        });
13221    };
13222    /**
13223     * Stores the access_token and id_token in inmemory storage
13224     * @param response
13225     * @param request
13226     * @param homeAccountIdentifier
13227     * @param idTokenObj
13228     * @param responseAccessToken
13229     * @param tenantId
13230     * @param reqTimestamp
13231     */
13232    NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
13233        var cachedIdToken = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
13234        // cache accessToken in inmemory storage
13235        var expiresIn = (request.tokenType === exports.AuthenticationScheme.POP)
13236            ? Constants.SHR_NONCE_VALIDITY
13237            : (typeof response.expires_in === "string"
13238                ? parseInt(response.expires_in, 10)
13239                : response.expires_in) || 0;
13240        var tokenExpirationSeconds = reqTimestamp + expiresIn;
13241        var responseScopes = this.generateScopes(response, request);
13242        var cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenObj
13243            ? idTokenObj.claims.tid || Constants.EMPTY_STRING
13244            : tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
13245        var nativeCacheRecord = new CacheRecord(undefined, cachedIdToken, cachedAccessToken);
13246        this.nativeStorageManager.saveCacheRecord(nativeCacheRecord);
13247    };
13248    NativeInteractionClient.prototype.addTelemetryFromNativeResponse = function (response) {
13249        var mats = this.getMATSFromResponse(response);
13250        if (!mats) {
13251            return null;
13252        }
13253        this.performanceClient.addStaticFields({
13254            extensionId: this.nativeMessageHandler.getExtensionId(),
13255            extensionVersion: this.nativeMessageHandler.getExtensionVersion(),
13256            matsBrokerVersion: mats.broker_version,
13257            matsAccountJoinOnStart: mats.account_join_on_start,
13258            matsAccountJoinOnEnd: mats.account_join_on_end,
13259            matsDeviceJoin: mats.device_join,
13260            matsPromptBehavior: mats.prompt_behavior,
13261            matsApiErrorCode: mats.api_error_code,
13262            matsUiVisible: mats.ui_visible,
13263            matsSilentCode: mats.silent_code,
13264            matsSilentBiSubCode: mats.silent_bi_sub_code,
13265            matsSilentMessage: mats.silent_message,
13266            matsSilentStatus: mats.silent_status,
13267            matsHttpStatus: mats.http_status,
13268            matsHttpEventCount: mats.http_event_count
13269        }, this.correlationId);
13270        return mats;
13271    };
13272    /**
13273     * Validates native platform response before processing
13274     * @param response
13275     */
13276    NativeInteractionClient.prototype.validateNativeResponse = function (response) {
13277        if (response.hasOwnProperty("access_token") &&
13278            response.hasOwnProperty("id_token") &&
13279            response.hasOwnProperty("client_info") &&
13280            response.hasOwnProperty("account") &&
13281            response.hasOwnProperty("scope") &&
13282            response.hasOwnProperty("expires_in")) {
13283            return response;
13284        }
13285        else {
13286            throw NativeAuthError.createUnexpectedError("Response missing expected properties.");
13287        }
13288    };
13289    /**
13290     * Gets MATS telemetry from native response
13291     * @param response
13292     * @returns
13293     */
13294    NativeInteractionClient.prototype.getMATSFromResponse = function (response) {
13295        if (response.properties.MATS) {
13296            try {
13297                return JSON.parse(response.properties.MATS);
13298            }
13299            catch (e) {
13300                this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead");
13301            }
13302        }
13303        return null;
13304    };
13305    /**
13306     * Returns whether or not response came from native cache
13307     * @param response
13308     * @returns
13309     */
13310    NativeInteractionClient.prototype.isResponseFromCache = function (mats) {
13311        if (typeof mats.is_cached === "undefined") {
13312            this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.");
13313            return false;
13314        }
13315        return !!mats.is_cached;
13316    };
13317    /**
13318     * Translates developer provided request object into NativeRequest object
13319     * @param request
13320     */
13321    NativeInteractionClient.prototype.initializeNativeRequest = function (request) {
13322        return __awaiter$1(this, void 0, void 0, function () {
vendor: 150,616 bytes, lines 13323-16198
13323            var authority, canonicalAuthority, scopes, remainingProperties, scopeSet, getPrompt, validatedRequest, shrParameters, popTokenGenerator, reqCnfData;
13324            var _this = this;
13325            return __generator$1(this, function (_a) {
13326                switch (_a.label) {
13327                    case 0:
13328                        this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
13329                        authority = request.authority || this.config.auth.authority;
13330                        if (!request.account) return [3 /*break*/, 2];
13331                        return [4 /*yield*/, this.validateRequestAuthority(authority, request.account)];
13332                    case 1:
13333                        _a.sent();
13334                        _a.label = 2;
13335                    case 2:
13336                        canonicalAuthority = new UrlString(authority);
13337                        canonicalAuthority.validateAsUri();
13338                        scopes = request.scopes, remainingProperties = __rest(request, ["scopes"]);
13339                        scopeSet = new ScopeSet(scopes || []);
13340                        scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
13341                        getPrompt = function () {
13342                            // If request is silent, prompt is always none
13343                            switch (_this.apiId) {
13344                                case exports.ApiId.ssoSilent:
13345                                case exports.ApiId.acquireTokenSilent_silentFlow:
13346                                    _this.logger.trace("initializeNativeRequest: silent request sets prompt to none");
13347                                    return PromptValue.NONE;
13348                            }
13349                            // Prompt not provided, request may proceed and native broker decides if it needs to prompt
13350                            if (!request.prompt) {
13351                                _this.logger.trace("initializeNativeRequest: prompt was not provided");
13352                                return undefined;
13353                            }
13354                            // If request is interactive, check if prompt provided is allowed to go directly to native broker
13355                            switch (request.prompt) {
13356                                case PromptValue.NONE:
13357                                case PromptValue.CONSENT:
13358                                case PromptValue.LOGIN:
13359                                    _this.logger.trace("initializeNativeRequest: prompt is compatible with native flow");
13360                                    return request.prompt;
13361                                default:
13362                                    _this.logger.trace("initializeNativeRequest: prompt = " + request.prompt + " is not compatible with native flow");
13363                                    throw BrowserAuthError.createNativePromptParameterNotSupportedError();
13364                            }
13365                        };
13366                        validatedRequest = __assign$1(__assign$1({}, remainingProperties), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scope: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), prompt: getPrompt(), correlationId: this.correlationId, tokenType: request.authenticationScheme, windowTitleSubstring: document.title, extraParameters: __assign$1(__assign$1(__assign$1({}, request.extraQueryParameters), request.tokenQueryParameters), { telemetry: NativeConstants.MATS_TELEMETRY }), extendedExpiryToken: false // Make this configurable?
13367                         });
13368                        if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 4];
13369                        shrParameters = {
13370                            resourceRequestUri: request.resourceRequestUri,
13371                            resourceRequestMethod: request.resourceRequestMethod,
13372                            shrClaims: request.shrClaims,
13373                            shrNonce: request.shrNonce
13374                        };
13375                        popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
13376                        return [4 /*yield*/, popTokenGenerator.generateCnf(shrParameters)];
13377                    case 3:
13378                        reqCnfData = _a.sent();
13379                        // to reduce the URL length, it is recommended to send the short form of the req_cnf 
13380                        validatedRequest.reqCnf = reqCnfData.reqCnfString;
13381                        validatedRequest.keyId = reqCnfData.kid;
13382                        _a.label = 4;
13383                    case 4: return [2 /*return*/, validatedRequest];
13384                }
13385            });
13386        });
13387    };
13388    return NativeInteractionClient;
13389}(BaseInteractionClient));
13390
13391/*
13392 * Copyright (c) Microsoft Corporation. All rights reserved.
13393 * Licensed under the MIT License.
13394 */
13395var NativeMessageHandler = /** @class */ (function () {
13396    function NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient, extensionId) {
13397        this.logger = logger;
13398        this.handshakeTimeoutMs = handshakeTimeoutMs;
13399        this.extensionId = extensionId;
13400        this.resolvers = new Map(); // Used for non-handshake messages
13401        this.handshakeResolvers = new Map(); // Used for handshake messages
13402        this.responseId = 0;
13403        this.messageChannel = new MessageChannel();
13404        this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound
13405        this.performanceClient = performanceClient;
13406        this.handshakeEvent = performanceClient.startMeasurement(exports.PerformanceEvents.NativeMessageHandlerHandshake);
13407    }
13408    /**
13409     * Sends a given message to the extension and resolves with the extension response
13410     * @param body
13411     */
13412    NativeMessageHandler.prototype.sendMessage = function (body) {
13413        return __awaiter$1(this, void 0, void 0, function () {
13414            var req;
13415            var _this = this;
13416            return __generator$1(this, function (_a) {
13417                this.logger.trace("NativeMessageHandler - sendMessage called.");
13418                req = {
13419                    channel: NativeConstants.CHANNEL_ID,
13420                    extensionId: this.extensionId,
13421                    responseId: this.responseId++,
13422                    body: body
13423                };
13424                this.logger.trace("NativeMessageHandler - Sending request to browser extension");
13425                this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: " + JSON.stringify(req));
13426                this.messageChannel.port1.postMessage(req);
13427                return [2 /*return*/, new Promise(function (resolve, reject) {
13428                        _this.resolvers.set(req.responseId, { resolve: resolve, reject: reject });
13429                    })];
13430            });
13431        });
13432    };
13433    /**
13434     * Returns an instance of the MessageHandler that has successfully established a connection with an extension
13435     * @param {Logger} logger
13436     * @param {number} handshakeTimeoutMs
13437     * @param {IPerformanceClient} performanceClient
13438     */
13439    NativeMessageHandler.createProvider = function (logger, handshakeTimeoutMs, performanceClient) {
13440        return __awaiter$1(this, void 0, void 0, function () {
13441            var preferredProvider, backupProvider;
13442            return __generator$1(this, function (_a) {
13443                switch (_a.label) {
13444                    case 0:
13445                        logger.trace("NativeMessageHandler - createProvider called.");
13446                        _a.label = 1;
13447                    case 1:
13448                        _a.trys.push([1, 3, , 5]);
13449                        preferredProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient, NativeConstants.PREFERRED_EXTENSION_ID);
13450                        return [4 /*yield*/, preferredProvider.sendHandshakeRequest()];
13451                    case 2:
13452                        _a.sent();
13453                        return [2 /*return*/, preferredProvider];
13454                    case 3:
13455                        _a.sent();
13456                        backupProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient);
13457                        return [4 /*yield*/, backupProvider.sendHandshakeRequest()];
13458                    case 4:
13459                        _a.sent();
13460                        return [2 /*return*/, backupProvider];
13461                    case 5: return [2 /*return*/];
13462                }
13463            });
13464        });
13465    };
13466    /**
13467     * Send handshake request helper.
13468     */
13469    NativeMessageHandler.prototype.sendHandshakeRequest = function () {
13470        return __awaiter$1(this, void 0, void 0, function () {
13471            var req;
13472            var _this = this;
13473            return __generator$1(this, function (_a) {
13474                this.logger.trace("NativeMessageHandler - sendHandshakeRequest called.");
13475                // Register this event listener before sending handshake
13476                window.addEventListener("message", this.windowListener, false); // false is important, because content script message processing should work first
13477                req = {
13478                    channel: NativeConstants.CHANNEL_ID,
13479                    extensionId: this.extensionId,
13480                    responseId: this.responseId++,
13481                    body: {
13482                        method: NativeExtensionMethod.HandshakeRequest
13483                    }
13484                };
13485                this.handshakeEvent.addStaticFields({
13486                    extensionId: this.extensionId,
13487                    extensionHandshakeTimeoutMs: this.handshakeTimeoutMs
13488                });
13489                this.messageChannel.port1.onmessage = function (event) {
13490                    _this.onChannelMessage(event);
13491                };
13492                window.postMessage(req, window.origin, [this.messageChannel.port2]);
13493                return [2 /*return*/, new Promise(function (resolve, reject) {
13494                        _this.handshakeResolvers.set(req.responseId, { resolve: resolve, reject: reject });
13495                        _this.timeoutId = window.setTimeout(function () {
13496                            /*
13497                             * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.
13498                             * This typically suggests an event handler stopped propagation of the Handshake request but did not respond to it on the MessageChannel port
13499                             */
13500                            window.removeEventListener("message", _this.windowListener, false);
13501                            _this.messageChannel.port1.close();
13502                            _this.messageChannel.port2.close();
13503                            _this.handshakeEvent.endMeasurement({ extensionHandshakeTimedOut: true, success: false });
13504                            reject(BrowserAuthError.createNativeHandshakeTimeoutError());
13505                            _this.handshakeResolvers.delete(req.responseId);
13506                        }, _this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here
13507                    })];
13508            });
13509        });
13510    };
13511    /**
13512     * Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.
13513     * @param event
13514     */
13515    NativeMessageHandler.prototype.onWindowMessage = function (event) {
13516        this.logger.trace("NativeMessageHandler - onWindowMessage called");
13517        // We only accept messages from ourselves
13518        if (event.source !== window) {
13519            return;
13520        }
13521        var request = event.data;
13522        if (!request.channel || request.channel !== NativeConstants.CHANNEL_ID) {
13523            return;
13524        }
13525        if (request.extensionId && request.extensionId !== this.extensionId) {
13526            return;
13527        }
13528        if (request.body.method === NativeExtensionMethod.HandshakeRequest) {
13529            // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed
13530            this.logger.verbose(request.extensionId ? "Extension with id: " + request.extensionId + " not installed" : "No extension installed");
13531            clearTimeout(this.timeoutId);
13532            this.messageChannel.port1.close();
13533            this.messageChannel.port2.close();
13534            window.removeEventListener("message", this.windowListener, false);
13535            var handshakeResolver = this.handshakeResolvers.get(request.responseId);
13536            if (handshakeResolver) {
13537                this.handshakeEvent.endMeasurement({ success: false, extensionInstalled: false });
13538                handshakeResolver.reject(BrowserAuthError.createNativeExtensionNotInstalledError());
13539            }
13540        }
13541    };
13542    /**
13543     * Invoked when a message is received from the extension on the MessageChannel port
13544     * @param event
13545     */
13546    NativeMessageHandler.prototype.onChannelMessage = function (event) {
13547        this.logger.trace("NativeMessageHandler - onChannelMessage called.");
13548        var request = event.data;
13549        var resolver = this.resolvers.get(request.responseId);
13550        var handshakeResolver = this.handshakeResolvers.get(request.responseId);
13551        try {
13552            var method = request.body.method;
13553            if (method === NativeExtensionMethod.Response) {
13554                if (!resolver) {
13555                    return;
13556                }
13557                var response = request.body.response;
13558                this.logger.trace("NativeMessageHandler - Received response from browser extension");
13559                this.logger.tracePii("NativeMessageHandler - Received response from browser extension: " + JSON.stringify(response));
13560                if (response.status !== "Success") {
13561                    resolver.reject(NativeAuthError.createError(response.code, response.description, response.ext));
13562                }
13563                else if (response.result) {
13564                    if (response.result["code"] && response.result["description"]) {
13565                        resolver.reject(NativeAuthError.createError(response.result["code"], response.result["description"], response.result["ext"]));
13566                    }
13567                    else {
13568                        resolver.resolve(response.result);
13569                    }
13570                }
13571                else {
13572                    throw AuthError.createUnexpectedError("Event does not contain result.");
13573                }
13574                this.resolvers.delete(request.responseId);
13575            }
13576            else if (method === NativeExtensionMethod.HandshakeResponse) {
13577                if (!handshakeResolver) {
13578                    return;
13579                }
13580                clearTimeout(this.timeoutId); // Clear setTimeout
13581                window.removeEventListener("message", this.windowListener, false); // Remove 'No extension' listener
13582                this.extensionId = request.extensionId;
13583                this.extensionVersion = request.body.version;
13584                this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: " + this.extensionId);
13585                this.handshakeEvent.endMeasurement({ extensionInstalled: true, success: true });
13586                handshakeResolver.resolve();
13587                this.handshakeResolvers.delete(request.responseId);
13588            }
13589            // Do nothing if method is not Response or HandshakeResponse
13590        }
13591        catch (err) {
13592            this.logger.error("Error parsing response from WAM Extension");
13593            this.logger.errorPii("Error parsing response from WAM Extension: " + err.toString());
13594            this.logger.errorPii("Unable to parse " + event);
13595            if (resolver) {
13596                resolver.reject(err);
13597            }
13598            else if (handshakeResolver) {
13599                handshakeResolver.reject(err);
13600            }
13601        }
13602    };
13603    /**
13604     * Returns the Id for the browser extension this handler is communicating with
13605     * @returns
13606     */
13607    NativeMessageHandler.prototype.getExtensionId = function () {
13608        return this.extensionId;
13609    };
13610    /**
13611     * Returns the version for the browser extension this handler is communicating with
13612     * @returns
13613     */
13614    NativeMessageHandler.prototype.getExtensionVersion = function () {
13615        return this.extensionVersion;
13616    };
13617    /**
13618     * Returns boolean indicating whether or not the request should attempt to use native broker
13619     * @param logger
13620     * @param config
13621     * @param nativeExtensionProvider
13622     * @param authenticationScheme
13623     */
13624    NativeMessageHandler.isNativeAvailable = function (config, logger, nativeExtensionProvider, authenticationScheme) {
13625        logger.trace("isNativeAvailable called");
13626        if (!config.system.allowNativeBroker) {
13627            logger.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false");
13628            // Developer disabled WAM
13629            return false;
13630        }
13631        if (!nativeExtensionProvider) {
13632            logger.trace("isNativeAvailable: WAM extension provider is not initialized, returning false");
13633            // Extension is not available
13634            return false;
13635        }
13636        if (authenticationScheme) {
13637            switch (authenticationScheme) {
13638                case exports.AuthenticationScheme.BEARER:
13639                case exports.AuthenticationScheme.POP:
13640                    logger.trace("isNativeAvailable: authenticationScheme is supported, returning true");
13641                    return true;
13642                default:
13643                    logger.trace("isNativeAvailable: authenticationScheme is not supported, returning false");
13644                    return false;
13645            }
13646        }
13647        return true;
13648    };
13649    return NativeMessageHandler;
13650}());
13651
13652/*
13653 * Copyright (c) Microsoft Corporation. All rights reserved.
13654 * Licensed under the MIT License.
13655 */
13656var RedirectClient = /** @class */ (function (_super) {
13657    __extends$1(RedirectClient, _super);
13658    function RedirectClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {
13659        var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;
13660        _this.nativeStorage = nativeStorageImpl;
13661        return _this;
13662    }
13663    /**
13664     * Redirects the page to the /authorize endpoint of the IDP
13665     * @param request
13666     */
13667    RedirectClient.prototype.acquireToken = function (request) {
13668        return __awaiter$1(this, void 0, void 0, function () {
13669            var validRequest, serverTelemetryManager, handleBackButton, authCodeRequest, authClient, interactionHandler, navigateUrl, redirectStartPage, e_1;
13670            var _this = this;
13671            return __generator$1(this, function (_a) {
13672                switch (_a.label) {
13673                    case 0:
13674                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13675                        return [4 /*yield*/, this.initializeAuthorizationRequest(request, exports.InteractionType.Redirect)];
13676                    case 1:
13677                        validRequest = _a.sent();
13678                        this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
13679                        serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenRedirect);
13680                        handleBackButton = function (event) {
13681                            // Clear temporary cache if the back button is clicked during the redirect flow.
13682                            if (event.persisted) {
13683                                _this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache.");
13684                                _this.browserStorage.cleanRequestByState(validRequest.state);
13685                                _this.eventHandler.emitEvent(exports.EventType.RESTORE_FROM_BFCACHE, exports.InteractionType.Redirect);
13686                            }
13687                        };
13688                        _a.label = 2;
13689                    case 2:
13690                        _a.trys.push([2, 7, , 8]);
13691                        // Create auth code request and generate PKCE params
13692                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13693                        return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
13694                    case 3:
13695                        authCodeRequest = _a.sent();
13696                        // Initialize the client
13697                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13698                        return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
13699                    case 4:
13700                        authClient = _a.sent();
13701                        this.logger.verbose("Auth code client created");
13702                        interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto, this.performanceClient);
13703                        return [4 /*yield*/, authClient.getAuthCodeUrl(__assign$1(__assign$1({}, validRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme) }))];
13704                    case 5:
13705                        navigateUrl = _a.sent();
13706                        redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);
13707                        this.logger.verbosePii("Redirect start page: " + redirectStartPage);
13708                        // Clear temporary cache if the back button is clicked during the redirect flow.
13709                        window.addEventListener("pageshow", handleBackButton);
13710                        return [4 /*yield*/, interactionHandler.initiateAuthRequest(navigateUrl, {
13711                                navigationClient: this.navigationClient,
13712                                redirectTimeout: this.config.system.redirectNavigationTimeout,
13713                                redirectStartPage: redirectStartPage,
13714                                onRedirectNavigate: request.onRedirectNavigate
13715                            })];
13716                    case 6: 
13717                    // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.
13718                    return [2 /*return*/, _a.sent()];
13719                    case 7:
13720                        e_1 = _a.sent();
13721                        if (e_1 instanceof AuthError) {
13722                            e_1.setCorrelationId(this.correlationId);
13723                        }
13724                        window.removeEventListener("pageshow", handleBackButton);
13725                        serverTelemetryManager.cacheFailedRequest(e_1);
13726                        this.browserStorage.cleanRequestByState(validRequest.state);
13727                        throw e_1;
13728                    case 8: return [2 /*return*/];
13729                }
13730            });
13731        });
13732    };
13733    /**
13734     * Checks if navigateToLoginRequestUrl is set, and:
13735     * - if true, performs logic to cache and navigate
13736     * - if false, handles hash string and parses response
13737     * @param hash
13738     */
13739    RedirectClient.prototype.handleRedirectPromise = function (hash) {
13740        return __awaiter$1(this, void 0, void 0, function () {
13741            var serverTelemetryManager, responseHash, state, serverParams, loginRequestUrl, loginRequestUrlNormalized, currentUrlNormalized, handleHashResult, navigationOptions, processHashOnRedirect, homepage, e_2;
13742            return __generator$1(this, function (_a) {
13743                switch (_a.label) {
13744                    case 0:
13745                        serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.handleRedirectPromise);
13746                        _a.label = 1;
13747                    case 1:
13748                        _a.trys.push([1, 10, , 11]);
13749                        if (!this.browserStorage.isInteractionInProgress(true)) {
13750                            this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.");
13751                            return [2 /*return*/, null];
13752                        }
13753                        responseHash = this.getRedirectResponseHash(hash || window.location.hash);
13754                        if (!responseHash) {
13755                            // Not a recognized server response hash or hash not associated with a redirect request
13756                            this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache.");
13757                            this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Redirect);
13758                            return [2 /*return*/, null];
13759                        }
13760                        state = void 0;
13761                        try {
13762                            serverParams = UrlString.getDeserializedHash(responseHash);
13763                            state = this.validateAndExtractStateFromHash(serverParams, exports.InteractionType.Redirect);
13764                            this.logger.verbose("State extracted from hash");
13765                        }
13766                        catch (e) {
13767                            this.logger.info("handleRedirectPromise was unable to extract state due to: " + e);
13768                            this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Redirect);
13769                            return [2 /*return*/, null];
13770                        }
13771                        loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || Constants.EMPTY_STRING;
13772                        loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);
13773                        currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);
13774                        if (!(loginRequestUrlNormalized === currentUrlNormalized && this.config.auth.navigateToLoginRequestUrl)) return [3 /*break*/, 3];
13775                        // We are on the page we need to navigate to - handle hash
13776                        this.logger.verbose("Current page is loginRequestUrl, handling hash");
13777                        return [4 /*yield*/, this.handleHash(responseHash, state, serverTelemetryManager)];
13778                    case 2:
13779                        handleHashResult = _a.sent();
13780                        if (loginRequestUrl.indexOf("#") > -1) {
13781                            // Replace current hash with non-msal hash, if present
13782                            BrowserUtils.replaceHash(loginRequestUrl);
13783                        }
13784                        return [2 /*return*/, handleHashResult];
13785                    case 3:
13786                        if (!!this.config.auth.navigateToLoginRequestUrl) return [3 /*break*/, 4];
13787                        this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash");
13788                        return [2 /*return*/, this.handleHash(responseHash, state, serverTelemetryManager)];
13789                    case 4:
13790                        if (!(!BrowserUtils.isInIframe() || this.config.system.allowRedirectInIframe)) return [3 /*break*/, 9];
13791                        /*
13792                         * Returned from authority using redirect - need to perform navigation before processing response
13793                         * Cache the hash to be retrieved after the next redirect
13794                         */
13795                        this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);
13796                        navigationOptions = {
13797                            apiId: exports.ApiId.handleRedirectPromise,
13798                            timeout: this.config.system.redirectNavigationTimeout,
13799                            noHistory: true
13800                        };
13801                        processHashOnRedirect = true;
13802                        if (!(!loginRequestUrl || loginRequestUrl === "null")) return [3 /*break*/, 6];
13803                        homepage = BrowserUtils.getHomepage();
13804                        // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage
13805                        this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);
13806                        this.logger.warning("Unable to get valid login request url from cache, redirecting to home page");
13807                        return [4 /*yield*/, this.navigationClient.navigateInternal(homepage, navigationOptions)];
13808                    case 5:
13809                        processHashOnRedirect = _a.sent();
13810                        return [3 /*break*/, 8];
13811                    case 6:
13812                        // Navigate to page that initiated the redirect request
13813                        this.logger.verbose("Navigating to loginRequestUrl: " + loginRequestUrl);
13814                        return [4 /*yield*/, this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions)];
13815                    case 7:
13816                        processHashOnRedirect = _a.sent();
13817                        _a.label = 8;
13818                    case 8:
13819                        // If navigateInternal implementation returns false, handle the hash now
13820                        if (!processHashOnRedirect) {
13821                            return [2 /*return*/, this.handleHash(responseHash, state, serverTelemetryManager)];
13822                        }
13823                        _a.label = 9;
13824                    case 9: return [2 /*return*/, null];
13825                    case 10:
13826                        e_2 = _a.sent();
13827                        if (e_2 instanceof AuthError) {
13828                            e_2.setCorrelationId(this.correlationId);
13829                        }
13830                        serverTelemetryManager.cacheFailedRequest(e_2);
13831                        this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Redirect);
13832                        throw e_2;
13833                    case 11: return [2 /*return*/];
13834                }
13835            });
13836        });
13837    };
13838    /**
13839     * Gets the response hash for a redirect request
13840     * Returns null if interactionType in the state value is not "redirect" or the hash does not contain known properties
13841     * @param hash
13842     */
13843    RedirectClient.prototype.getRedirectResponseHash = function (hash) {
13844        this.logger.verbose("getRedirectResponseHash called");
13845        // Get current location hash from window or cache.
13846        var isResponseHash = UrlString.hashContainsKnownProperties(hash);
13847        if (isResponseHash) {
13848            BrowserUtils.clearHash(window);
13849            this.logger.verbose("Hash contains known properties, returning response hash");
13850            return hash;
13851        }
13852        var cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);
13853        this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));
13854        this.logger.verbose("Hash does not contain known properties, returning cached hash");
13855        return cachedHash;
13856    };
13857    /**
13858     * Checks if hash exists and handles in window.
13859     * @param hash
13860     * @param state
13861     */
13862    RedirectClient.prototype.handleHash = function (hash, state, serverTelemetryManager) {
13863        return __awaiter$1(this, void 0, void 0, function () {
13864            var cachedRequest, serverParams, nativeInteractionClient, userRequestState, currentAuthority, authClient, interactionHandler;
13865            var _this = this;
13866            return __generator$1(this, function (_a) {
13867                switch (_a.label) {
13868                    case 0:
13869                        cachedRequest = this.browserStorage.getCachedRequest(state, this.browserCrypto);
13870                        this.logger.verbose("handleHash called, retrieved cached request");
13871                        serverParams = UrlString.getDeserializedHash(hash);
13872                        if (serverParams.accountId) {
13873                            this.logger.verbose("Account id found in hash, calling WAM for token");
13874                            if (!this.nativeMessageHandler) {
13875                                throw BrowserAuthError.createNativeConnectionNotEstablishedError();
13876                            }
13877                            nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);
13878                            userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state).userRequestState;
13879                            return [2 /*return*/, nativeInteractionClient.acquireToken(__assign$1(__assign$1({}, cachedRequest), { state: userRequestState, prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently
13880                                 })).finally(function () {
13881                                    _this.browserStorage.cleanRequestByState(state);
13882                                })];
13883                        }
13884                        currentAuthority = this.browserStorage.getCachedAuthority(state);
13885                        if (!currentAuthority) {
13886                            throw BrowserAuthError.createNoCachedAuthorityError();
13887                        }
13888                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);
13889                        return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, currentAuthority)];
13890                    case 1:
13891                        authClient = _a.sent();
13892                        this.logger.verbose("Auth code client created");
13893                        ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);
13894                        interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto, this.performanceClient);
13895                        return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
13896                    case 2: return [2 /*return*/, _a.sent()];
13897                }
13898            });
13899        });
13900    };
13901    /**
13902     * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
13903     * Default behaviour is to redirect the user to `window.location.href`.
13904     * @param logoutRequest
13905     */
13906    RedirectClient.prototype.logout = function (logoutRequest) {
13907        return __awaiter$1(this, void 0, void 0, function () {
13908            var validLogoutRequest, serverTelemetryManager, navigationOptions, authClient, logoutUri, navigate, e_3;
13909            return __generator$1(this, function (_a) {
13910                switch (_a.label) {
13911                    case 0:
13912                        this.logger.verbose("logoutRedirect called");
13913                        validLogoutRequest = this.initializeLogoutRequest(logoutRequest);
13914                        serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.logout);
13915                        _a.label = 1;
13916                    case 1:
13917                        _a.trys.push([1, 10, , 11]);
13918                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_START, exports.InteractionType.Redirect, logoutRequest);
13919                        // Clear cache on logout
13920                        return [4 /*yield*/, this.clearCacheOnLogout(validLogoutRequest.account)];
13921                    case 2:
13922                        // Clear cache on logout
13923                        _a.sent();
13924                        navigationOptions = {
13925                            apiId: exports.ApiId.logout,
13926                            timeout: this.config.system.redirectNavigationTimeout,
13927                            noHistory: false
13928                        };
13929                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);
13930                        return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority)];
13931                    case 3:
13932                        authClient = _a.sent();
13933                        this.logger.verbose("Auth code client created");
13934                        logoutUri = authClient.getLogoutUri(validLogoutRequest);
13935                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_SUCCESS, exports.InteractionType.Redirect, validLogoutRequest);
13936                        if (!(logoutRequest && typeof logoutRequest.onRedirectNavigate === "function")) return [3 /*break*/, 7];
13937                        navigate = logoutRequest.onRedirectNavigate(logoutUri);
13938                        if (!(navigate !== false)) return [3 /*break*/, 5];
13939                        this.logger.verbose("Logout onRedirectNavigate did not return false, navigating");
13940                        // Ensure interaction is in progress
13941                        if (!this.browserStorage.getInteractionInProgress()) {
13942                            this.browserStorage.setInteractionInProgress(true);
13943                        }
13944                        return [4 /*yield*/, this.navigationClient.navigateExternal(logoutUri, navigationOptions)];
13945                    case 4:
13946                        _a.sent();
13947                        return [2 /*return*/];
13948                    case 5:
13949                        // Ensure interaction is not in progress
13950                        this.browserStorage.setInteractionInProgress(false);
13951                        this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");
13952                        _a.label = 6;
13953                    case 6: return [3 /*break*/, 9];
13954                    case 7:
13955                        // Ensure interaction is in progress
13956                        if (!this.browserStorage.getInteractionInProgress()) {
13957                            this.browserStorage.setInteractionInProgress(true);
13958                        }
13959                        return [4 /*yield*/, this.navigationClient.navigateExternal(logoutUri, navigationOptions)];
13960                    case 8:
13961                        _a.sent();
13962                        return [2 /*return*/];
13963                    case 9: return [3 /*break*/, 11];
13964                    case 10:
13965                        e_3 = _a.sent();
13966                        if (e_3 instanceof AuthError) {
13967                            e_3.setCorrelationId(this.correlationId);
13968                        }
13969                        serverTelemetryManager.cacheFailedRequest(e_3);
13970                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Redirect, null, e_3);
13971                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Redirect);
13972                        throw e_3;
13973                    case 11:
13974                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Redirect);
13975                        return [2 /*return*/];
13976                }
13977            });
13978        });
13979    };
13980    /**
13981     * Use to get the redirectStartPage either from request or use current window
13982     * @param requestStartPage
13983     */
13984    RedirectClient.prototype.getRedirectStartPage = function (requestStartPage) {
13985        var redirectStartPage = requestStartPage || window.location.href;
13986        return UrlString.getAbsoluteUrl(redirectStartPage, BrowserUtils.getCurrentUri());
13987    };
13988    return RedirectClient;
13989}(StandardInteractionClient));
13990
13991/*
13992 * Copyright (c) Microsoft Corporation. All rights reserved.
13993 * Licensed under the MIT License.
13994 */
13995var PopupClient = /** @class */ (function (_super) {
13996    __extends$1(PopupClient, _super);
13997    function PopupClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {
13998        var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;
13999        // Properly sets this reference for the unload event.
14000        _this.unloadWindow = _this.unloadWindow.bind(_this);
14001        _this.nativeStorage = nativeStorageImpl;
14002        return _this;
14003    }
14004    /**
14005     * Acquires tokens by opening a popup window to the /authorize endpoint of the authority
14006     * @param request
14007     */
14008    PopupClient.prototype.acquireToken = function (request) {
14009        try {
14010            var popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);
14011            var popupWindowAttributes = request.popupWindowAttributes || {};
14012            // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
14013            if (this.config.system.asyncPopups) {
14014                this.logger.verbose("asyncPopups set to true, acquiring token");
14015                // Passes on popup position and dimensions if in request
14016                return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);
14017            }
14018            else {
14019                // asyncPopups flag is set to false. Opens popup before acquiring token.
14020                this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");
14021                var popup = this.openSizedPopup("about:blank", popupName, popupWindowAttributes);
14022                return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);
14023            }
14024        }
14025        catch (e) {
14026            return Promise.reject(e);
14027        }
14028    };
14029    /**
14030     * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
14031     * @param logoutRequest
14032     */
14033    PopupClient.prototype.logout = function (logoutRequest) {
14034        try {
14035            this.logger.verbose("logoutPopup called");
14036            var validLogoutRequest = this.initializeLogoutRequest(logoutRequest);
14037            var popupName = this.generateLogoutPopupName(validLogoutRequest);
14038            var authority = logoutRequest && logoutRequest.authority;
14039            var mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;
14040            var popupWindowAttributes = (logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.popupWindowAttributes) || {};
14041            // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
14042            if (this.config.system.asyncPopups) {
14043                this.logger.verbose("asyncPopups set to true");
14044                // Passes on popup position and dimensions if in request
14045                return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);
14046            }
14047            else {
14048                // asyncPopups flag is set to false. Opens popup before logging out.
14049                this.logger.verbose("asyncPopup set to false, opening popup");
14050                var popup = this.openSizedPopup("about:blank", popupName, popupWindowAttributes);
14051                return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);
14052            }
14053        }
14054        catch (e) {
14055            // Since this function is synchronous we need to reject
14056            return Promise.reject(e);
14057        }
14058    };
14059    /**
14060     * Helper which obtains an access_token for your API via opening a popup window in the user's browser
14061     * @param validRequest
14062     * @param popupName
14063     * @param popup
14064     * @param popupWindowAttributes
14065     *
14066     * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
14067     */
14068    PopupClient.prototype.acquireTokenPopupAsync = function (request, popupName, popupWindowAttributes, popup) {
14069        return __awaiter$1(this, void 0, void 0, function () {
14070            var serverTelemetryManager, validRequest, authCodeRequest, authClient, isNativeBroker, fetchNativeAccountIdMeasurement, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, serverParams, state_1, nativeInteractionClient, userRequestState, result, e_1;
14071            var _this = this;
14072            return __generator$1(this, function (_a) {
14073                switch (_a.label) {
14074                    case 0:
14075                        this.logger.verbose("acquireTokenPopupAsync called");
14076                        serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenPopup);
14077                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
14078                        return [4 /*yield*/, this.initializeAuthorizationRequest(request, exports.InteractionType.Popup)];
14079                    case 1:
14080                        validRequest = _a.sent();
14081                        this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
14082                        _a.label = 2;
14083                    case 2:
14084                        _a.trys.push([2, 8, , 9]);
14085                        // Create auth code request and generate PKCE params
14086                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
14087                        return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
14088                    case 3:
14089                        authCodeRequest = _a.sent();
14090                        // Initialize the client
14091                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
14092                        return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
14093                    case 4:
14094                        authClient = _a.sent();
14095                        this.logger.verbose("Auth code client created");
14096                        isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
14097                        fetchNativeAccountIdMeasurement = void 0;
14098                        if (isNativeBroker) {
14099                            fetchNativeAccountIdMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
14100                        }
14101                        return [4 /*yield*/, authClient.getAuthCodeUrl(__assign$1(__assign$1({}, validRequest), { nativeBroker: isNativeBroker }))];
14102                    case 5:
14103                        navigateUrl = _a.sent();
14104                        interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
14105                        popupParameters = {
14106                            popup: popup,
14107                            popupName: popupName,
14108                            popupWindowAttributes: popupWindowAttributes
14109                        };
14110                        popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);
14111                        this.eventHandler.emitEvent(exports.EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow: popupWindow }, null);
14112                        return [4 /*yield*/, this.monitorPopupForHash(popupWindow)];
14113                    case 6:
14114                        hash = _a.sent();
14115                        serverParams = UrlString.getDeserializedHash(hash);
14116                        state_1 = this.validateAndExtractStateFromHash(serverParams, exports.InteractionType.Popup, validRequest.correlationId);
14117                        // Remove throttle if it exists
14118                        ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);
14119                        if (serverParams.accountId) {
14120                            this.logger.verbose("Account id found in hash, calling WAM for token");
14121                            // end measurement for server call with native brokering enabled
14122                            if (fetchNativeAccountIdMeasurement) {
14123                                fetchNativeAccountIdMeasurement.endMeasurement({
14124                                    success: true,
14125                                    isNativeBroker: true
14126                                });
14127                            }
14128                            if (!this.nativeMessageHandler) {
14129                                throw BrowserAuthError.createNativeConnectionNotEstablishedError();
14130                            }
14131                            nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);
14132                            userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state_1).userRequestState;
14133                            return [2 /*return*/, nativeInteractionClient.acquireToken(__assign$1(__assign$1({}, validRequest), { state: userRequestState, prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently
14134                                 })).finally(function () {
14135                                    _this.browserStorage.cleanRequestByState(state_1);
14136                                })];
14137                        }
14138                        return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state_1, authClient.authority, this.networkClient)];
14139                    case 7:
14140                        result = _a.sent();
14141                        return [2 /*return*/, result];
14142                    case 8:
14143                        e_1 = _a.sent();
14144                        if (popup) {
14145                            // Close the synchronous popup if an error is thrown before the window unload event is registered
14146                            popup.close();
14147                        }
14148                        if (e_1 instanceof AuthError) {
14149                            e_1.setCorrelationId(this.correlationId);
14150                        }
14151                        serverTelemetryManager.cacheFailedRequest(e_1);
14152                        this.browserStorage.cleanRequestByState(validRequest.state);
14153                        throw e_1;
14154                    case 9: return [2 /*return*/];
14155                }
14156            });
14157        });
14158    };
14159    /**
14160     *
14161     * @param validRequest
14162     * @param popupName
14163     * @param requestAuthority
14164     * @param popup
14165     * @param mainWindowRedirectUri
14166     * @param popupWindowAttributes
14167     */
14168    PopupClient.prototype.logoutPopupAsync = function (validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {
14169        return __awaiter$1(this, void 0, void 0, function () {
14170            var serverTelemetryManager, authClient, logoutUri, popupWindow, navigationOptions, absoluteUrl, e_2;
14171            return __generator$1(this, function (_a) {
14172                switch (_a.label) {
14173                    case 0:
14174                        this.logger.verbose("logoutPopupAsync called");
14175                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_START, exports.InteractionType.Popup, validRequest);
14176                        serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.logoutPopup);
14177                        _a.label = 1;
14178                    case 1:
14179                        _a.trys.push([1, 5, , 6]);
14180                        // Clear cache on logout
14181                        return [4 /*yield*/, this.clearCacheOnLogout(validRequest.account)];
14182                    case 2:
14183                        // Clear cache on logout
14184                        _a.sent();
14185                        // Initialize the client
14186                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);
14187                        return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, requestAuthority)];
14188                    case 3:
14189                        authClient = _a.sent();
14190                        this.logger.verbose("Auth code client created");
14191                        logoutUri = authClient.getLogoutUri(validRequest);
14192                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_SUCCESS, exports.InteractionType.Popup, validRequest);
14193                        popupWindow = this.openPopup(logoutUri, { popupName: popupName, popupWindowAttributes: popupWindowAttributes, popup: popup });
14194                        this.eventHandler.emitEvent(exports.EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow: popupWindow }, null);
14195                        return [4 /*yield*/, this.waitForLogoutPopup(popupWindow)];
14196                    case 4:
14197                        _a.sent();
14198                        if (mainWindowRedirectUri) {
14199                            navigationOptions = {
14200                                apiId: exports.ApiId.logoutPopup,
14201                                timeout: this.config.system.redirectNavigationTimeout,
14202                                noHistory: false
14203                            };
14204                            absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());
14205                            this.logger.verbose("Redirecting main window to url specified in the request");
14206                            this.logger.verbosePii("Redirecting main window to: " + absoluteUrl);
14207                            this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);
14208                        }
14209                        else {
14210                            this.logger.verbose("No main window navigation requested");
14211                        }
14212                        return [3 /*break*/, 6];
14213                    case 5:
14214                        e_2 = _a.sent();
14215                        if (popup) {
14216                            // Close the synchronous popup if an error is thrown before the window unload event is registered
14217                            popup.close();
14218                        }
14219                        if (e_2 instanceof AuthError) {
14220                            e_2.setCorrelationId(this.correlationId);
14221                        }
14222                        this.browserStorage.setInteractionInProgress(false);
14223                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e_2);
14224                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
14225                        serverTelemetryManager.cacheFailedRequest(e_2);
14226                        throw e_2;
14227                    case 6:
14228                        this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
14229                        return [2 /*return*/];
14230                }
14231            });
14232        });
14233    };
14234    /**
14235     * Opens a popup window with given request Url.
14236     * @param requestUrl
14237     */
14238    PopupClient.prototype.initiateAuthRequest = function (requestUrl, params) {
14239        // Check that request url is not empty.
14240        if (!StringUtils.isEmpty(requestUrl)) {
14241            this.logger.infoPii("Navigate to: " + requestUrl);
14242            // Open the popup window to requestUrl.
14243            return this.openPopup(requestUrl, params);
14244        }
14245        else {
14246            // Throw error if request URL is empty.
14247            this.logger.error("Navigate url is empty");
14248            throw BrowserAuthError.createEmptyNavigationUriError();
14249        }
14250    };
14251    /**
14252     * Monitors a window until it loads a url with the same origin.
14253     * @param popupWindow - window that is being monitored
14254     * @param timeout - timeout for processing hash once popup is redirected back to application
14255     */
14256    PopupClient.prototype.monitorPopupForHash = function (popupWindow) {
14257        var _this = this;
14258        return new Promise(function (resolve, reject) {
14259            /*
14260             * Polling for popups needs to be tick-based,
14261             * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).
14262             */
14263            var maxTicks = _this.config.system.windowHashTimeout / _this.config.system.pollIntervalMilliseconds;
14264            var ticks = 0;
14265            _this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");
14266            var intervalId = setInterval(function () {
14267                // Window is closed
14268                if (popupWindow.closed) {
14269                    _this.logger.error("PopupHandler.monitorPopupForHash - window closed");
14270                    _this.cleanPopup();
14271                    clearInterval(intervalId);
14272                    reject(BrowserAuthError.createUserCancelledError());
14273                    return;
14274                }
14275                var href = Constants.EMPTY_STRING;
14276                var hash = Constants.EMPTY_STRING;
14277                try {
14278                    /*
14279                     * Will throw if cross origin,
14280                     * which should be caught and ignored
14281                     * since we need the interval to keep running while on STS UI.
14282                     */
14283                    href = popupWindow.location.href;
14284                    hash = popupWindow.location.hash;
14285                }
14286                catch (e) { }
14287                // Don't process blank pages or cross domain
14288                if (StringUtils.isEmpty(href) || href === "about:blank") {
14289                    return;
14290                }
14291                _this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller");
14292                /*
14293                 * Only run clock when we are on same domain for popups
14294                 * as popup operations can take a long time.
14295                 */
14296                ticks++;
14297                if (hash) {
14298                    _this.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url");
14299                    clearInterval(intervalId);
14300                    _this.cleanPopup(popupWindow);
14301                    if (UrlString.hashContainsKnownProperties(hash)) {
14302                        _this.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning.");
14303                        resolve(hash);
14304                    }
14305                    else {
14306                        _this.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely.");
14307                        _this.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: " + hash);
14308                        reject(BrowserAuthError.createHashDoesNotContainKnownPropertiesError());
14309                    }
14310                }
14311                else if (ticks > maxTicks) {
14312                    _this.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out");
14313                    clearInterval(intervalId);
14314                    reject(BrowserAuthError.createMonitorPopupTimeoutError());
14315                }
14316            }, _this.config.system.pollIntervalMilliseconds);
14317        });
14318    };
14319    /**
14320     * Waits for user interaction in logout popup window
14321     * @param popupWindow
14322     * @returns
14323     */
14324    PopupClient.prototype.waitForLogoutPopup = function (popupWindow) {
14325        var _this = this;
14326        return new Promise(function (resolve) {
14327            _this.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");
14328            var intervalId = setInterval(function () {
14329                // Window is closed
14330                if (popupWindow.closed) {
14331                    _this.logger.error("PopupHandler.waitForLogoutPopup - window closed");
14332                    _this.cleanPopup();
14333                    clearInterval(intervalId);
14334                    resolve();
14335                }
14336                var href = Constants.EMPTY_STRING;
14337                try {
14338                    /*
14339                     * Will throw if cross origin,
14340                     * which should be caught and ignored
14341                     * since we need the interval to keep running while on STS UI.
14342                     */
14343                    href = popupWindow.location.href;
14344                }
14345                catch (e) { }
14346                // Don't process blank pages or cross domain
14347                if (StringUtils.isEmpty(href) || href === "about:blank") {
14348                    return;
14349                }
14350                _this.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing.");
14351                clearInterval(intervalId);
14352                _this.cleanPopup(popupWindow);
14353                resolve();
14354            }, _this.config.system.pollIntervalMilliseconds);
14355        });
14356    };
14357    /**
14358     * @hidden
14359     *
14360     * Configures popup window for login.
14361     *
14362     * @param urlNavigate
14363     * @param title
14364     * @param popUpWidth
14365     * @param popUpHeight
14366     * @param popupWindowAttributes
14367     * @ignore
14368     * @hidden
14369     */
14370    PopupClient.prototype.openPopup = function (urlNavigate, popupParams) {
14371        try {
14372            var popupWindow = void 0;
14373            // Popup window passed in, setting url to navigate to
14374            if (popupParams.popup) {
14375                popupWindow = popupParams.popup;
14376                this.logger.verbosePii("Navigating popup window to: " + urlNavigate);
14377                popupWindow.location.assign(urlNavigate);
14378            }
14379            else if (typeof popupParams.popup === "undefined") {
14380                // Popup will be undefined if it was not passed in
14381                this.logger.verbosePii("Opening popup window to: " + urlNavigate);
14382                popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);
14383            }
14384            // Popup will be null if popups are blocked
14385            if (!popupWindow) {
14386                throw BrowserAuthError.createEmptyWindowCreatedError();
14387            }
14388            if (popupWindow.focus) {
14389                popupWindow.focus();
14390            }
14391            this.currentWindow = popupWindow;
14392            window.addEventListener("beforeunload", this.unloadWindow);
14393            return popupWindow;
14394        }
14395        catch (e) {
14396            this.logger.error("error opening popup " + e.message);
14397            this.browserStorage.setInteractionInProgress(false);
14398            throw BrowserAuthError.createPopupWindowError(e.toString());
14399        }
14400    };
14401    /**
14402     * Helper function to set popup window dimensions and position
14403     * @param urlNavigate
14404     * @param popupName
14405     * @param popupWindowAttributes
14406     * @returns
14407     */
14408    PopupClient.prototype.openSizedPopup = function (urlNavigate, popupName, popupWindowAttributes) {
14409        var _a, _b, _c, _d;
14410        /**
14411         * adding winLeft and winTop to account for dual monitor
14412         * using screenLeft and screenTop for IE8 and earlier
14413         */
14414        var winLeft = window.screenLeft ? window.screenLeft : window.screenX;
14415        var winTop = window.screenTop ? window.screenTop : window.screenY;
14416        /**
14417         * window.innerWidth displays browser window"s height and width excluding toolbars
14418         * using document.documentElement.clientWidth for IE8 and earlier
14419         */
14420        var winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
14421        var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
14422        var width = (_a = popupWindowAttributes.popupSize) === null || _a === void 0 ? void 0 : _a.width;
14423        var height = (_b = popupWindowAttributes.popupSize) === null || _b === void 0 ? void 0 : _b.height;
14424        var top = (_c = popupWindowAttributes.popupPosition) === null || _c === void 0 ? void 0 : _c.top;
14425        var left = (_d = popupWindowAttributes.popupPosition) === null || _d === void 0 ? void 0 : _d.left;
14426        if (!width || width < 0 || width > winWidth) {
14427            this.logger.verbose("Default popup window width used. Window width not configured or invalid.");
14428            width = BrowserConstants.POPUP_WIDTH;
14429        }
14430        if (!height || height < 0 || height > winHeight) {
14431            this.logger.verbose("Default popup window height used. Window height not configured or invalid.");
14432            height = BrowserConstants.POPUP_HEIGHT;
14433        }
14434        if (!top || top < 0 || top > winHeight) {
14435            this.logger.verbose("Default popup window top position used. Window top not configured or invalid.");
14436            top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);
14437        }
14438        if (!left || left < 0 || left > winWidth) {
14439            this.logger.verbose("Default popup window left position used. Window left not configured or invalid.");
14440            left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);
14441        }
14442        return window.open(urlNavigate, popupName, "width=" + width + ", height=" + height + ", top=" + top + ", left=" + left + ", scrollbars=yes");
14443    };
14444    /**
14445     * Event callback to unload main window.
14446     */
14447    PopupClient.prototype.unloadWindow = function (e) {
14448        this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Popup);
14449        if (this.currentWindow) {
14450            this.currentWindow.close();
14451        }
14452        // Guarantees browser unload will happen, so no other errors will be thrown.
14453        e.preventDefault();
14454    };
14455    /**
14456     * Closes popup, removes any state vars created during popup calls.
14457     * @param popupWindow
14458     */
14459    PopupClient.prototype.cleanPopup = function (popupWindow) {
14460        if (popupWindow) {
14461            // Close window.
14462            popupWindow.close();
14463        }
14464        // Remove window unload function
14465        window.removeEventListener("beforeunload", this.unloadWindow);
14466        // Interaction is completed - remove interaction status.
14467        this.browserStorage.setInteractionInProgress(false);
14468    };
14469    /**
14470     * Generates the name for the popup based on the client id and request
14471     * @param clientId
14472     * @param request
14473     */
14474    PopupClient.prototype.generatePopupName = function (scopes, authority) {
14475        return BrowserConstants.POPUP_NAME_PREFIX + "." + this.config.auth.clientId + "." + scopes.join("-") + "." + authority + "." + this.correlationId;
14476    };
14477    /**
14478     * Generates the name for the popup based on the client id and request for logouts
14479     * @param clientId
14480     * @param request
14481     */
14482    PopupClient.prototype.generateLogoutPopupName = function (request) {
14483        var homeAccountId = request.account && request.account.homeAccountId;
14484        return BrowserConstants.POPUP_NAME_PREFIX + "." + this.config.auth.clientId + "." + homeAccountId + "." + this.correlationId;
14485    };
14486    return PopupClient;
14487}(StandardInteractionClient));
14488
14489/*
14490 * Copyright (c) Microsoft Corporation. All rights reserved.
14491 * Licensed under the MIT License.
14492 */
14493var NavigationClient = /** @class */ (function () {
14494    function NavigationClient() {
14495    }
14496    /**
14497     * Navigates to other pages within the same web application
14498     * @param url
14499     * @param options
14500     */
14501    NavigationClient.prototype.navigateInternal = function (url, options) {
14502        return NavigationClient.defaultNavigateWindow(url, options);
14503    };
14504    /**
14505     * Navigates to other pages outside the web application i.e. the Identity Provider
14506     * @param url
14507     * @param options
14508     */
14509    NavigationClient.prototype.navigateExternal = function (url, options) {
14510        return NavigationClient.defaultNavigateWindow(url, options);
14511    };
14512    /**
14513     * Default navigation implementation invoked by the internal and external functions
14514     * @param url
14515     * @param options
14516     */
14517    NavigationClient.defaultNavigateWindow = function (url, options) {
14518        if (options.noHistory) {
14519            window.location.replace(url);
14520        }
14521        else {
14522            window.location.assign(url);
14523        }
14524        return new Promise(function (resolve) {
14525            setTimeout(function () {
14526                resolve(true);
14527            }, options.timeout);
14528        });
14529    };
14530    return NavigationClient;
14531}());
14532
14533/*
14534 * Copyright (c) Microsoft Corporation. All rights reserved.
14535 * Licensed under the MIT License.
14536 */
14537// Default timeout for popup windows and iframes in milliseconds
14538var DEFAULT_POPUP_TIMEOUT_MS = 60000;
14539var DEFAULT_IFRAME_TIMEOUT_MS = 6000;
14540var DEFAULT_REDIRECT_TIMEOUT_MS = 30000;
14541var DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;
14542/**
14543 * MSAL function that sets the default options when not explicitly configured from app developer
14544 *
14545 * @param auth
14546 * @param cache
14547 * @param system
14548 *
14549 * @returns Configuration object
14550 */
14551function buildConfiguration(_a, isBrowserEnvironment) {
14552    var userInputAuth = _a.auth, userInputCache = _a.cache, userInputSystem = _a.system, userInputTelemetry = _a.telemetry;
14553    // Default auth options for browser
14554    var DEFAULT_AUTH_OPTIONS = {
14555        clientId: Constants.EMPTY_STRING,
14556        authority: "" + Constants.DEFAULT_AUTHORITY,
14557        knownAuthorities: [],
14558        cloudDiscoveryMetadata: Constants.EMPTY_STRING,
14559        authorityMetadata: Constants.EMPTY_STRING,
14560        redirectUri: Constants.EMPTY_STRING,
14561        postLogoutRedirectUri: Constants.EMPTY_STRING,
14562        navigateToLoginRequestUrl: true,
14563        clientCapabilities: [],
14564        protocolMode: exports.ProtocolMode.AAD,
14565        azureCloudOptions: {
14566            azureCloudInstance: exports.AzureCloudInstance.None,
14567            tenant: Constants.EMPTY_STRING
14568        },
14569        skipAuthorityMetadataCache: false,
14570    };
14571    // Default cache options for browser
14572    var DEFAULT_CACHE_OPTIONS = {
14573        cacheLocation: exports.BrowserCacheLocation.SessionStorage,
14574        temporaryCacheLocation: exports.BrowserCacheLocation.SessionStorage,
14575        storeAuthStateInCookie: false,
14576        secureCookies: false,
14577        // Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage
14578        cacheMigrationEnabled: userInputCache && userInputCache.cacheLocation === exports.BrowserCacheLocation.LocalStorage ? true : false,
14579        claimsBasedCachingEnabled: true
14580    };
14581    // Default logger options for browser
14582    var DEFAULT_LOGGER_OPTIONS = {
14583        // eslint-disable-next-line @typescript-eslint/no-empty-function
14584        loggerCallback: function () {
14585            // allow users to not set logger call back 
14586        },
14587        logLevel: exports.LogLevel.Info,
14588        piiLoggingEnabled: false
14589    };
14590    // Default system options for browser
14591    var DEFAULT_BROWSER_SYSTEM_OPTIONS = __assign$1(__assign$1({}, DEFAULT_SYSTEM_OPTIONS), { loggerOptions: DEFAULT_LOGGER_OPTIONS, networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule, navigationClient: new NavigationClient(), loadFrameTimeout: 0, 
14592        // If loadFrameTimeout is provided, use that as default.
14593        windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS, cryptoOptions: {
14594            useMsrCrypto: false,
14595            entropy: undefined
14596        } });
14597    var providedSystemOptions = __assign$1(__assign$1({}, userInputSystem), { loggerOptions: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loggerOptions) || DEFAULT_LOGGER_OPTIONS });
14598    var DEFAULT_TELEMETRY_OPTIONS = {
14599        application: {
14600            appName: Constants.EMPTY_STRING,
14601            appVersion: Constants.EMPTY_STRING
14602        }
14603    };
14604    var overlayedConfig = {
14605        auth: __assign$1(__assign$1({}, DEFAULT_AUTH_OPTIONS), userInputAuth),
14606        cache: __assign$1(__assign$1({}, DEFAULT_CACHE_OPTIONS), userInputCache),
14607        system: __assign$1(__assign$1({}, DEFAULT_BROWSER_SYSTEM_OPTIONS), providedSystemOptions),
14608        telemetry: __assign$1(__assign$1({}, DEFAULT_TELEMETRY_OPTIONS), userInputTelemetry)
14609    };
14610    return overlayedConfig;
14611}
14612
14613/*
14614 * Copyright (c) Microsoft Corporation. All rights reserved.
14615 * Licensed under the MIT License.
14616 */
14617var SilentHandler = /** @class */ (function (_super) {
14618    __extends$1(SilentHandler, _super);
14619    function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger, systemOptions, performanceClient) {
14620        var _this = _super.call(this, authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) || this;
14621        _this.navigateFrameWait = systemOptions.navigateFrameWait;
14622        _this.pollIntervalMilliseconds = systemOptions.pollIntervalMilliseconds;
14623        return _this;
14624    }
14625    /**
14626     * Creates a hidden iframe to given URL using user-requested scopes as an id.
14627     * @param urlNavigate
14628     * @param userRequestScopes
14629     */
14630    SilentHandler.prototype.initiateAuthRequest = function (requestUrl) {
14631        return __awaiter$1(this, void 0, void 0, function () {
14632            return __generator$1(this, function (_a) {
14633                switch (_a.label) {
14634                    case 0:
14635                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerInitiateAuthRequest, this.authCodeRequest.correlationId);
14636                        if (StringUtils.isEmpty(requestUrl)) {
14637                            // Throw error if request URL is empty.
14638                            this.logger.info("Navigate url is empty");
14639                            throw BrowserAuthError.createEmptyNavigationUriError();
14640                        }
14641                        if (!this.navigateFrameWait) return [3 /*break*/, 2];
14642                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14643                        return [4 /*yield*/, this.loadFrame(requestUrl)];
14644                    case 1: return [2 /*return*/, _a.sent()];
14645                    case 2: return [2 /*return*/, this.loadFrameSync(requestUrl)];
14646                }
14647            });
14648        });
14649    };
14650    /**
14651     * Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.
14652     * @param iframe
14653     * @param timeout
14654     */
14655    SilentHandler.prototype.monitorIframeForHash = function (iframe, timeout) {
14656        var _this = this;
14657        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerMonitorIframeForHash, this.authCodeRequest.correlationId);
14658        return new Promise(function (resolve, reject) {
14659            if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {
14660                _this.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower (" + timeout + "ms) than the default (" + DEFAULT_IFRAME_TIMEOUT_MS + "ms). This may result in timeouts.");
14661            }
14662            /*
14663             * Polling for iframes can be purely timing based,
14664             * since we don't need to account for interaction.
14665             */
14666            var nowMark = window.performance.now();
14667            var timeoutMark = nowMark + timeout;
14668            var intervalId = setInterval(function () {
14669                if (window.performance.now() > timeoutMark) {
14670                    _this.removeHiddenIframe(iframe);
14671                    clearInterval(intervalId);
14672                    reject(BrowserAuthError.createMonitorIframeTimeoutError());
14673                    return;
14674                }
14675                var href = Constants.EMPTY_STRING;
14676                var contentWindow = iframe.contentWindow;
14677                try {
14678                    /*
14679                     * Will throw if cross origin,
14680                     * which should be caught and ignored
14681                     * since we need the interval to keep running while on STS UI.
14682                     */
14683                    href = contentWindow ? contentWindow.location.href : Constants.EMPTY_STRING;
14684                }
14685                catch (e) { }
14686                if (StringUtils.isEmpty(href)) {
14687                    return;
14688                }
14689                var contentHash = contentWindow ? contentWindow.location.hash : Constants.EMPTY_STRING;
14690                if (UrlString.hashContainsKnownProperties(contentHash)) {
14691                    // Success case
14692                    _this.removeHiddenIframe(iframe);
14693                    clearInterval(intervalId);
14694                    resolve(contentHash);
14695                    return;
14696                }
14697            }, _this.pollIntervalMilliseconds);
14698        });
14699    };
14700    /**
14701     * @hidden
14702     * Loads iframe with authorization endpoint URL
14703     * @ignore
14704     */
14705    SilentHandler.prototype.loadFrame = function (urlNavigate) {
14706        var _this = this;
14707        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14708        /*
14709         * This trick overcomes iframe navigation in IE
14710         * IE does not load the page consistently in iframe
14711         */
14712        return new Promise(function (resolve, reject) {
14713            var frameHandle = _this.createHiddenIframe();
14714            setTimeout(function () {
14715                if (!frameHandle) {
14716                    reject("Unable to load iframe");
14717                    return;
14718                }
14719                frameHandle.src = urlNavigate;
14720                resolve(frameHandle);
14721            }, _this.navigateFrameWait);
14722        });
14723    };
14724    /**
14725     * @hidden
14726     * Loads the iframe synchronously when the navigateTimeFrame is set to `0`
14727     * @param urlNavigate
14728     * @param frameName
14729     * @param logger
14730     */
14731    SilentHandler.prototype.loadFrameSync = function (urlNavigate) {
14732        var frameHandle = this.createHiddenIframe();
14733        frameHandle.src = urlNavigate;
14734        return frameHandle;
14735    };
14736    /**
14737     * @hidden
14738     * Creates a new hidden iframe or gets an existing one for silent token renewal.
14739     * @ignore
14740     */
14741    SilentHandler.prototype.createHiddenIframe = function () {
14742        var authFrame = document.createElement("iframe");
14743        authFrame.className = "msalSilentIframe";
14744        authFrame.style.visibility = "hidden";
14745        authFrame.style.position = "absolute";
14746        authFrame.style.width = authFrame.style.height = "0";
14747        authFrame.style.border = "0";
14748        authFrame.setAttribute("sandbox", "allow-scripts allow-same-origin allow-forms");
14749        document.getElementsByTagName("body")[0].appendChild(authFrame);
14750        return authFrame;
14751    };
14752    /**
14753     * @hidden
14754     * Removes a hidden iframe from the page.
14755     * @ignore
14756     */
14757    SilentHandler.prototype.removeHiddenIframe = function (iframe) {
14758        if (document.body === iframe.parentNode) {
14759            document.body.removeChild(iframe);
14760        }
14761    };
14762    return SilentHandler;
14763}(InteractionHandler));
14764
14765/*
14766 * Copyright (c) Microsoft Corporation. All rights reserved.
14767 * Licensed under the MIT License.
14768 */
14769var SilentIframeClient = /** @class */ (function (_super) {
14770    __extends$1(SilentIframeClient, _super);
14771    function SilentIframeClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {
14772        var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;
14773        _this.apiId = apiId;
14774        _this.nativeStorage = nativeStorageImpl;
14775        return _this;
14776    }
14777    /**
14778     * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session
14779     * @param request
14780     */
14781    SilentIframeClient.prototype.acquireToken = function (request) {
14782        return __awaiter$1(this, void 0, void 0, function () {
14783            var acquireTokenMeasurement, silentRequest, serverTelemetryManager, authClient, e_1;
14784            return __generator$1(this, function (_a) {
14785                switch (_a.label) {
14786                    case 0:
14787                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14788                        this.logger.verbose("acquireTokenByIframe called");
14789                        acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14790                        // Check that we have some SSO data
14791                        if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {
14792                            this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");
14793                        }
14794                        // Check that prompt is set to none or no_session, throw error if it is set to anything else.
14795                        if (request.prompt && (request.prompt !== PromptValue.NONE) && (request.prompt !== PromptValue.NO_SESSION)) {
14796                            acquireTokenMeasurement.endMeasurement({
14797                                success: false
14798                            });
14799                            throw BrowserAuthError.createSilentPromptValueError(request.prompt);
14800                        }
14801                        // Create silent request
14802                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
14803                        return [4 /*yield*/, this.initializeAuthorizationRequest(__assign$1(__assign$1({}, request), { prompt: request.prompt || PromptValue.NONE }), exports.InteractionType.Silent)];
14804                    case 1:
14805                        silentRequest = _a.sent();
14806                        this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);
14807                        serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
14808                        _a.label = 2;
14809                    case 2:
14810                        _a.trys.push([2, 5, , 6]);
14811                        // Initialize the client
14812                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
14813                        return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
14814                    case 3:
14815                        authClient = _a.sent();
14816                        this.logger.verbose("Auth code client created");
14817                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);
14818                        return [4 /*yield*/, this.silentTokenHelper(authClient, silentRequest).then(function (result) {
14819                                acquireTokenMeasurement.endMeasurement({
14820                                    success: true,
14821                                    fromCache: false,
14822                                    requestId: result.requestId
14823                                });
14824                                return result;
14825                            })];
14826                    case 4: return [2 /*return*/, _a.sent()];
14827                    case 5:
14828                        e_1 = _a.sent();
14829                        if (e_1 instanceof AuthError) {
14830                            e_1.setCorrelationId(this.correlationId);
14831                        }
14832                        serverTelemetryManager.cacheFailedRequest(e_1);
14833                        this.browserStorage.cleanRequestByState(silentRequest.state);
14834                        acquireTokenMeasurement.endMeasurement({
14835                            errorCode: e_1 instanceof AuthError && e_1.errorCode || undefined,
14836                            subErrorCode: e_1 instanceof AuthError && e_1.subError || undefined,
14837                            success: false
14838                        });
14839                        throw e_1;
14840                    case 6: return [2 /*return*/];
14841                }
14842            });
14843        });
14844    };
14845    /**
14846     * Currently Unsupported
14847     */
14848    SilentIframeClient.prototype.logout = function () {
14849        // Synchronous so we must reject
14850        return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());
14851    };
14852    /**
14853     * Helper which acquires an authorization code silently using a hidden iframe from given url
14854     * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.
14855     * @param navigateUrl
14856     * @param userRequestScopes
14857     */
14858    SilentIframeClient.prototype.silentTokenHelper = function (authClient, silentRequest) {
14859        return __awaiter$1(this, void 0, void 0, function () {
14860            var authCodeRequest, navigateUrl, silentHandler, msalFrame, hash, serverParams, state, nativeInteractionClient, userRequestState;
14861            var _this = this;
14862            return __generator$1(this, function (_a) {
14863                switch (_a.label) {
14864                    case 0:
14865                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);
14866                        // Create auth code request and generate PKCE params
14867                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);
14868                        return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];
14869                    case 1:
14870                        authCodeRequest = _a.sent();
14871                        // Create authorize request url
14872                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);
14873                        return [4 /*yield*/, authClient.getAuthCodeUrl(__assign$1(__assign$1({}, silentRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme) }))];
14874                    case 2:
14875                        navigateUrl = _a.sent();
14876                        silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);
14877                        // Get the frame handle for the silent request
14878                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);
14879                        return [4 /*yield*/, silentHandler.initiateAuthRequest(navigateUrl)];
14880                    case 3:
14881                        msalFrame = _a.sent();
14882                        // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
14883                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);
14884                        return [4 /*yield*/, silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout)];
14885                    case 4:
14886                        hash = _a.sent();
14887                        serverParams = UrlString.getDeserializedHash(hash);
14888                        state = this.validateAndExtractStateFromHash(serverParams, exports.InteractionType.Silent, authCodeRequest.correlationId);
14889                        if (serverParams.accountId) {
14890                            this.logger.verbose("Account id found in hash, calling WAM for token");
14891                            if (!this.nativeMessageHandler) {
14892                                throw BrowserAuthError.createNativeConnectionNotEstablishedError();
14893                            }
14894                            nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.apiId, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, this.correlationId);
14895                            userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state).userRequestState;
14896                            return [2 /*return*/, nativeInteractionClient.acquireToken(__assign$1(__assign$1({}, silentRequest), { state: userRequestState, prompt: silentRequest.prompt || PromptValue.NONE })).finally(function () {
14897                                    _this.browserStorage.cleanRequestByState(state);
14898                                })];
14899                        }
14900                        // Handle response from hash string
14901                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);
14902                        return [2 /*return*/, silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
14903                }
14904            });
14905        });
14906    };
14907    return SilentIframeClient;
14908}(StandardInteractionClient));
14909
14910/*
14911 * Copyright (c) Microsoft Corporation. All rights reserved.
14912 * Licensed under the MIT License.
14913 */
14914var SilentRefreshClient = /** @class */ (function (_super) {
14915    __extends$1(SilentRefreshClient, _super);
14916    function SilentRefreshClient() {
14917        return _super !== null && _super.apply(this, arguments) || this;
14918    }
14919    /**
14920     * Exchanges the refresh token for new tokens
14921     * @param request
14922     */
14923    SilentRefreshClient.prototype.acquireToken = function (request) {
14924        return __awaiter$1(this, void 0, void 0, function () {
14925            var silentRequest, _a, acquireTokenMeasurement, serverTelemetryManager, refreshTokenClient;
14926            var _this = this;
14927            return __generator$1(this, function (_b) {
14928                switch (_b.label) {
14929                    case 0:
14930                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14931                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
14932                        _a = [__assign$1({}, request)];
14933                        return [4 /*yield*/, this.initializeBaseRequest(request, request.account)];
14934                    case 1:
14935                        silentRequest = __assign$1.apply(void 0, _a.concat([_b.sent()]));
14936                        acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);
14937                        serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
14938                        return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
14939                    case 2:
14940                        refreshTokenClient = _b.sent();
14941                        this.logger.verbose("Refresh token client created");
14942                        // Send request to renew token. Auth module will throw errors if token cannot be renewed.
14943                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
14944                        return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(silentRequest)
14945                                .then(function (result) {
14946                                acquireTokenMeasurement.endMeasurement({
14947                                    success: true,
14948                                    fromCache: result.fromCache,
14949                                    requestId: result.requestId
14950                                });
14951                                return result;
14952                            })
14953                                .catch(function (e) {
14954                                if (e instanceof AuthError) {
14955                                    e.setCorrelationId(_this.correlationId);
14956                                }
14957                                serverTelemetryManager.cacheFailedRequest(e);
14958                                acquireTokenMeasurement.endMeasurement({
14959                                    errorCode: e.errorCode,
14960                                    subErrorCode: e.subError,
14961                                    success: false
14962                                });
14963                                throw e;
14964                            })];
14965                }
14966            });
14967        });
14968    };
14969    /**
14970     * Currently Unsupported
14971     */
14972    SilentRefreshClient.prototype.logout = function () {
14973        // Synchronous so we must reject
14974        return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());
14975    };
14976    /**
14977     * Creates a Refresh Client with the given authority, or the default authority.
14978     * @param serverTelemetryManager
14979     * @param authorityUrl
14980     */
14981    SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
14982        return __awaiter$1(this, void 0, void 0, function () {
14983            var clientConfig;
14984            return __generator$1(this, function (_a) {
14985                switch (_a.label) {
14986                    case 0:
14987                        // Create auth module.
14988                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
14989                        return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
14990                    case 1:
14991                        clientConfig = _a.sent();
14992                        return [2 /*return*/, new RefreshTokenClient(clientConfig, this.performanceClient)];
14993                }
14994            });
14995        });
14996    };
14997    return SilentRefreshClient;
14998}(StandardInteractionClient));
14999
15000/*
15001 * Copyright (c) Microsoft Corporation. All rights reserved.
15002 * Licensed under the MIT License.
15003 */
15004var EventHandler = /** @class */ (function () {
15005    function EventHandler(logger, browserCrypto) {
15006        this.eventCallbacks = new Map();
15007        this.logger = logger;
15008        this.browserCrypto = browserCrypto;
15009        this.listeningToStorageEvents = false;
15010        this.handleAccountCacheChange = this.handleAccountCacheChange.bind(this);
15011    }
15012    /**
15013     * Adds event callbacks to array
15014     * @param callback
15015     */
15016    EventHandler.prototype.addEventCallback = function (callback) {
15017        if (typeof window !== "undefined") {
15018            var callbackId = this.browserCrypto.createNewGuid();
15019            this.eventCallbacks.set(callbackId, callback);
15020            this.logger.verbose("Event callback registered with id: " + callbackId);
15021            return callbackId;
15022        }
15023        return null;
15024    };
15025    /**
15026     * Removes callback with provided id from callback array
15027     * @param callbackId
15028     */
15029    EventHandler.prototype.removeEventCallback = function (callbackId) {
15030        this.eventCallbacks.delete(callbackId);
15031        this.logger.verbose("Event callback " + callbackId + " removed.");
15032    };
15033    /**
15034     * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
15035     */
15036    EventHandler.prototype.enableAccountStorageEvents = function () {
15037        if (typeof window === "undefined") {
15038            return;
15039        }
15040        if (!this.listeningToStorageEvents) {
15041            this.logger.verbose("Adding account storage listener.");
15042            this.listeningToStorageEvents = true;
15043            window.addEventListener("storage", this.handleAccountCacheChange);
15044        }
15045        else {
15046            this.logger.verbose("Account storage listener already registered.");
15047        }
15048    };
15049    /**
15050     * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
15051     */
15052    EventHandler.prototype.disableAccountStorageEvents = function () {
15053        if (typeof window === "undefined") {
15054            return;
15055        }
15056        if (this.listeningToStorageEvents) {
15057            this.logger.verbose("Removing account storage listener.");
15058            window.removeEventListener("storage", this.handleAccountCacheChange);
15059            this.listeningToStorageEvents = false;
15060        }
15061        else {
15062            this.logger.verbose("No account storage listener registered.");
15063        }
15064    };
15065    /**
15066     * Emits events by calling callback with event message
15067     * @param eventType
15068     * @param interactionType
15069     * @param payload
15070     * @param error
15071     */
15072    EventHandler.prototype.emitEvent = function (eventType, interactionType, payload, error) {
15073        var _this = this;
15074        if (typeof window !== "undefined") {
15075            var message_1 = {
15076                eventType: eventType,
15077                interactionType: interactionType || null,
15078                payload: payload || null,
15079                error: error || null,
15080                timestamp: Date.now()
15081            };
15082            this.logger.info("Emitting event: " + eventType);
15083            this.eventCallbacks.forEach(function (callback, callbackId) {
15084                _this.logger.verbose("Emitting event to callback " + callbackId + ": " + eventType);
15085                callback.apply(null, [message_1]);
15086            });
15087        }
15088    };
15089    /**
15090     * Emit account added/removed events when cached accounts are changed in a different tab or frame
15091     */
15092    EventHandler.prototype.handleAccountCacheChange = function (e) {
15093        try {
15094            var cacheValue = e.newValue || e.oldValue;
15095            if (!cacheValue) {
15096                return;
15097            }
15098            var parsedValue = JSON.parse(cacheValue);
15099            if (typeof parsedValue !== "object" || !AccountEntity.isAccountEntity(parsedValue)) {
15100                return;
15101            }
15102            var accountEntity = CacheManager.toObject(new AccountEntity(), parsedValue);
15103            var accountInfo = accountEntity.getAccountInfo();
15104            if (!e.oldValue && e.newValue) {
15105                this.logger.info("Account was added to cache in a different window");
15106                this.emitEvent(exports.EventType.ACCOUNT_ADDED, undefined, accountInfo);
15107            }
15108            else if (!e.newValue && e.oldValue) {
15109                this.logger.info("Account was removed from cache in a different window");
15110                this.emitEvent(exports.EventType.ACCOUNT_REMOVED, undefined, accountInfo);
15111            }
15112        }
15113        catch (e) {
15114            return;
15115        }
15116    };
15117    return EventHandler;
15118}());
15119
15120/*
15121 * Copyright (c) Microsoft Corporation. All rights reserved.
15122 * Licensed under the MIT License.
15123 */
15124/**
15125 * Utility class for math specific functions in browser.
15126 */
15127var MathUtils = /** @class */ (function () {
15128    function MathUtils() {
15129    }
15130    /**
15131     * Decimal to Hex
15132     *
15133     * @param num
15134     */
15135    MathUtils.decimalToHex = function (num) {
15136        var hex = num.toString(16);
15137        while (hex.length < 2) {
15138            hex = "0" + hex;
15139        }
15140        return hex;
15141    };
15142    return MathUtils;
15143}());
15144
15145/*
15146 * Copyright (c) Microsoft Corporation. All rights reserved.
15147 * Licensed under the MIT License.
15148 */
15149var GuidGenerator = /** @class */ (function () {
15150    function GuidGenerator(cryptoObj) {
15151        this.cryptoObj = cryptoObj;
15152    }
15153    /*
15154     * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or
15155     * pseudo-random numbers.
15156     * The algorithm is as follows:
15157     *     Set the two most significant bits (bits 6 and 7) of the
15158     *        clock_seq_hi_and_reserved to zero and one, respectively.
15159     *     Set the four most significant bits (bits 12 through 15) of the
15160     *        time_hi_and_version field to the 4-bit version number from
15161     *        Section 4.1.3. Version4
15162     *     Set all the other bits to randomly (or pseudo-randomly) chosen
15163     *     values.
15164     * UUID                   = time-low "-" time-mid "-"time-high-and-version "-"clock-seq-reserved and low(2hexOctet)"-" node
15165     * time-low               = 4hexOctet
15166     * time-mid               = 2hexOctet
15167     * time-high-and-version  = 2hexOctet
15168     * clock-seq-and-reserved = hexOctet:
15169     * clock-seq-low          = hexOctet
15170     * node                   = 6hexOctet
15171     * Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
15172     * y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10
15173     * y values are 8, 9, A, B
15174     */
15175    GuidGenerator.prototype.generateGuid = function () {
15176        try {
15177            var buffer = new Uint8Array(16);
15178            this.cryptoObj.getRandomValues(buffer);
15179            // buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).
15180            buffer[6] |= 0x40; // buffer[6] | 01000000 will set the 6 bit to 1.
15181            buffer[6] &= 0x4f; // buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = "4".
15182            // buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.
15183            buffer[8] |= 0x80; // buffer[8] | 10000000 will set the 7 bit to 1.
15184            buffer[8] &= 0xbf; // buffer[8] & 10111111 will set the 6 bit to 0.
15185            return MathUtils.decimalToHex(buffer[0]) + MathUtils.decimalToHex(buffer[1])
15186                + MathUtils.decimalToHex(buffer[2]) + MathUtils.decimalToHex(buffer[3])
15187                + "-" + MathUtils.decimalToHex(buffer[4]) + MathUtils.decimalToHex(buffer[5])
15188                + "-" + MathUtils.decimalToHex(buffer[6]) + MathUtils.decimalToHex(buffer[7])
15189                + "-" + MathUtils.decimalToHex(buffer[8]) + MathUtils.decimalToHex(buffer[9])
15190                + "-" + MathUtils.decimalToHex(buffer[10]) + MathUtils.decimalToHex(buffer[11])
15191                + MathUtils.decimalToHex(buffer[12]) + MathUtils.decimalToHex(buffer[13])
15192                + MathUtils.decimalToHex(buffer[14]) + MathUtils.decimalToHex(buffer[15]);
15193        }
15194        catch (err) {
15195            var guidHolder = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
15196            var hex = "0123456789abcdef";
15197            var r = 0;
15198            var guidResponse = Constants.EMPTY_STRING;
15199            for (var i = 0; i < 36; i++) {
15200                if (guidHolder[i] !== "-" && guidHolder[i] !== "4") {
15201                    // each x and y needs to be random
15202                    r = Math.random() * 16 | 0;
15203                }
15204                if (guidHolder[i] === "x") {
15205                    guidResponse += hex[r];
15206                }
15207                else if (guidHolder[i] === "y") {
15208                    // clock-seq-and-reserved first hex is filtered and remaining hex values are random
15209                    r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??
15210                    r |= 0x8; // set pos 3 to 1 as 1???
15211                    guidResponse += hex[r];
15212                }
15213                else {
15214                    guidResponse += guidHolder[i];
15215                }
15216            }
15217            return guidResponse;
15218        }
15219    };
15220    /**
15221     * verifies if a string is  GUID
15222     * @param guid
15223     */
15224    GuidGenerator.prototype.isGuid = function (guid) {
15225        var regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
15226        return regexGuid.test(guid);
15227    };
15228    return GuidGenerator;
15229}());
15230
15231/*
15232 * Copyright (c) Microsoft Corporation. All rights reserved.
15233 * Licensed under the MIT License.
15234 */
15235/**
15236 * Utility functions for strings in a browser. See here for implementation details:
15237 * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
15238 */
15239var BrowserStringUtils = /** @class */ (function () {
15240    function BrowserStringUtils() {
15241    }
15242    /**
15243     * Converts string to Uint8Array
15244     * @param sDOMStr
15245     */
15246    BrowserStringUtils.stringToUtf8Arr = function (sDOMStr) {
15247        var nChr;
15248        var nArrLen = 0;
15249        var nStrLen = sDOMStr.length;
15250        /* mapping... */
15251        for (var nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {
15252            nChr = sDOMStr.charCodeAt(nMapIdx);
15253            nArrLen += nChr < 0x80 ? 1 : nChr < 0x800 ? 2 : nChr < 0x10000 ? 3 : nChr < 0x200000 ? 4 : nChr < 0x4000000 ? 5 : 6;
15254        }
15255        var aBytes = new Uint8Array(nArrLen);
15256        /* transcription... */
15257        for (var nIdx = 0, nChrIdx = 0; nIdx < nArrLen; nChrIdx++) {
15258            nChr = sDOMStr.charCodeAt(nChrIdx);
15259            if (nChr < 128) {
15260                /* one byte */
15261                aBytes[nIdx++] = nChr;
15262            }
15263            else if (nChr < 0x800) {
15264                /* two bytes */
15265                aBytes[nIdx++] = 192 + (nChr >>> 6);
15266                aBytes[nIdx++] = 128 + (nChr & 63);
15267            }
15268            else if (nChr < 0x10000) {
15269                /* three bytes */
15270                aBytes[nIdx++] = 224 + (nChr >>> 12);
15271                aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
15272                aBytes[nIdx++] = 128 + (nChr & 63);
15273            }
15274            else if (nChr < 0x200000) {
15275                /* four bytes */
15276                aBytes[nIdx++] = 240 + (nChr >>> 18);
15277                aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
15278                aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
15279                aBytes[nIdx++] = 128 + (nChr & 63);
15280            }
15281            else if (nChr < 0x4000000) {
15282                /* five bytes */
15283                aBytes[nIdx++] = 248 + (nChr >>> 24);
15284                aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);
15285                aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
15286                aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
15287                aBytes[nIdx++] = 128 + (nChr & 63);
15288            }
15289            else /* if (nChr <= 0x7fffffff) */ {
15290                /* six bytes */
15291                aBytes[nIdx++] = 252 + (nChr >>> 30);
15292                aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);
15293                aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);
15294                aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
15295                aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
15296                aBytes[nIdx++] = 128 + (nChr & 63);
15297            }
15298        }
15299        return aBytes;
15300    };
15301    /**
15302     * Converst string to ArrayBuffer
15303     * @param dataString
15304     */
15305    BrowserStringUtils.stringToArrayBuffer = function (dataString) {
15306        var data = new ArrayBuffer(dataString.length);
15307        var dataView = new Uint8Array(data);
15308        for (var i = 0; i < dataString.length; i++) {
15309            dataView[i] = dataString.charCodeAt(i);
15310        }
15311        return data;
15312    };
15313    /**
15314     * Converts Uint8Array to a string
15315     * @param aBytes
15316     */
15317    BrowserStringUtils.utf8ArrToString = function (aBytes) {
15318        var sView = Constants.EMPTY_STRING;
15319        for (var nPart = void 0, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {
15320            nPart = aBytes[nIdx];
15321            sView += String.fromCharCode(nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */
15322                /* (nPart - 252 << 30) may be not so safe in ECMAScript! So...: */
15323                (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
15324                : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */
15325                    (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
15326                    : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */
15327                        (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
15328                        : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */
15329                            (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
15330                            : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */
15331                                (nPart - 192 << 6) + aBytes[++nIdx] - 128
15332                                : /* nPart < 127 ? */ /* one byte */
15333                                    nPart);
15334        }
15335        return sView;
15336    };
15337    /**
15338     * Returns stringified jwk.
15339     * @param jwk
15340     */
15341    BrowserStringUtils.getSortedObjectString = function (obj) {
15342        return JSON.stringify(obj, Object.keys(obj).sort());
15343    };
15344    return BrowserStringUtils;
15345}());
15346
15347/*
15348 * Copyright (c) Microsoft Corporation. All rights reserved.
15349 * Licensed under the MIT License.
15350 */
15351/**
15352 * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:
15353 * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
15354 */
15355var Base64Encode = /** @class */ (function () {
15356    function Base64Encode() {
15357    }
15358    /**
15359     * Returns URL Safe b64 encoded string from a plaintext string.
15360     * @param input
15361     */
15362    Base64Encode.prototype.urlEncode = function (input) {
15363        return encodeURIComponent(this.encode(input)
15364            .replace(/=/g, Constants.EMPTY_STRING)
15365            .replace(/\+/g, "-")
15366            .replace(/\//g, "_"));
15367    };
15368    /**
15369     * Returns URL Safe b64 encoded string from an int8Array.
15370     * @param inputArr
15371     */
15372    Base64Encode.prototype.urlEncodeArr = function (inputArr) {
15373        return this.base64EncArr(inputArr)
15374            .replace(/=/g, Constants.EMPTY_STRING)
15375            .replace(/\+/g, "-")
15376            .replace(/\//g, "_");
15377    };
15378    /**
15379     * Returns b64 encoded string from plaintext string.
15380     * @param input
15381     */
15382    Base64Encode.prototype.encode = function (input) {
15383        var inputUtf8Arr = BrowserStringUtils.stringToUtf8Arr(input);
15384        return this.base64EncArr(inputUtf8Arr);
15385    };
15386    /**
15387     * Base64 encode byte array
15388     * @param aBytes
15389     */
15390    Base64Encode.prototype.base64EncArr = function (aBytes) {
15391        var eqLen = (3 - (aBytes.length % 3)) % 3;
15392        var sB64Enc = Constants.EMPTY_STRING;
15393        for (var nMod3 = void 0, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {
15394            nMod3 = nIdx % 3;
15395            /* Uncomment the following line in order to split the output in lines 76-character long: */
15396            /*
15397             *if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += "\r\n"; }
15398             */
15399            nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24);
15400            if (nMod3 === 2 || aBytes.length - nIdx === 1) {
15401                sB64Enc += String.fromCharCode(this.uint6ToB64(nUint24 >>> 18 & 63), this.uint6ToB64(nUint24 >>> 12 & 63), this.uint6ToB64(nUint24 >>> 6 & 63), this.uint6ToB64(nUint24 & 63));
15402                nUint24 = 0;
15403            }
15404        }
15405        return eqLen === 0 ? sB64Enc : sB64Enc.substring(0, sB64Enc.length - eqLen) + (eqLen === 1 ? "=" : "==");
15406    };
15407    /**
15408     * Base64 string to array encoding helper
15409     * @param nUint6
15410     */
15411    Base64Encode.prototype.uint6ToB64 = function (nUint6) {
15412        return nUint6 < 26 ?
15413            nUint6 + 65
15414            : nUint6 < 52 ?
15415                nUint6 + 71
15416                : nUint6 < 62 ?
15417                    nUint6 - 4
15418                    : nUint6 === 62 ?
15419                        43
15420                        : nUint6 === 63 ?
15421                            47
15422                            :
15423                                65;
15424    };
15425    return Base64Encode;
15426}());
15427
15428/*
15429 * Copyright (c) Microsoft Corporation. All rights reserved.
15430 * Licensed under the MIT License.
15431 */
15432/**
15433 * Class which exposes APIs to decode base64 strings to plaintext. See here for implementation details:
15434 * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
15435 */
15436var Base64Decode = /** @class */ (function () {
15437    function Base64Decode() {
15438    }
15439    /**
15440     * Returns a URL-safe plaintext decoded string from b64 encoded input.
15441     * @param input
15442     */
15443    Base64Decode.prototype.decode = function (input) {
15444        var encodedString = input.replace(/-/g, "+").replace(/_/g, "/");
15445        switch (encodedString.length % 4) {
15446            case 0:
15447                break;
15448            case 2:
15449                encodedString += "==";
15450                break;
15451            case 3:
15452                encodedString += "=";
15453                break;
15454            default:
15455                throw new Error("Invalid base64 string");
15456        }
15457        var inputUtf8Arr = this.base64DecToArr(encodedString);
15458        return BrowserStringUtils.utf8ArrToString(inputUtf8Arr);
15459    };
15460    /**
15461     * Decodes base64 into Uint8Array
15462     * @param base64String
15463     * @param nBlockSize
15464     */
15465    Base64Decode.prototype.base64DecToArr = function (base64String, nBlockSize) {
15466        var sB64Enc = base64String.replace(/[^A-Za-z0-9\+\/]/g, Constants.EMPTY_STRING);
15467        var nInLen = sB64Enc.length;
15468        var nOutLen = nBlockSize ? Math.ceil((nInLen * 3 + 1 >>> 2) / nBlockSize) * nBlockSize : nInLen * 3 + 1 >>> 2;
15469        var aBytes = new Uint8Array(nOutLen);
15470        for (var nMod3 = void 0, nMod4 = void 0, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {
15471            nMod4 = nInIdx & 3;
15472            nUint24 |= this.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;
15473            if (nMod4 === 3 || nInLen - nInIdx === 1) {
15474                for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {
15475                    aBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;
15476                }
15477                nUint24 = 0;
15478            }
15479        }
15480        return aBytes;
15481    };
15482    /**
15483     * Base64 string to array decoding helper
15484     * @param charNum
15485     */
15486    Base64Decode.prototype.b64ToUint6 = function (charNum) {
15487        return charNum > 64 && charNum < 91 ?
15488            charNum - 65
15489            : charNum > 96 && charNum < 123 ?
15490                charNum - 71
15491                : charNum > 47 && charNum < 58 ?
15492                    charNum + 4
15493                    : charNum === 43 ?
15494                        62
15495                        : charNum === 47 ?
15496                            63
15497                            :
15498                                0;
15499    };
15500    return Base64Decode;
15501}());
15502
15503/*
15504 * Copyright (c) Microsoft Corporation. All rights reserved.
15505 * Licensed under the MIT License.
15506 */
15507// Constant byte array length
15508var RANDOM_BYTE_ARR_LENGTH = 32;
15509/**
15510 * Class which exposes APIs to generate PKCE codes and code verifiers.
15511 */
15512var PkceGenerator = /** @class */ (function () {
15513    function PkceGenerator(cryptoObj) {
15514        this.base64Encode = new Base64Encode();
15515        this.cryptoObj = cryptoObj;
15516    }
15517    /**
15518     * Generates PKCE Codes. See the RFC for more information: https://tools.ietf.org/html/rfc7636
15519     */
15520    PkceGenerator.prototype.generateCodes = function () {
15521        return __awaiter$1(this, void 0, void 0, function () {
15522            var codeVerifier, codeChallenge;
15523            return __generator$1(this, function (_a) {
15524                switch (_a.label) {
15525                    case 0:
15526                        codeVerifier = this.generateCodeVerifier();
15527                        return [4 /*yield*/, this.generateCodeChallengeFromVerifier(codeVerifier)];
15528                    case 1:
15529                        codeChallenge = _a.sent();
15530                        return [2 /*return*/, {
15531                                verifier: codeVerifier,
15532                                challenge: codeChallenge
15533                            }];
15534                }
15535            });
15536        });
15537    };
15538    /**
15539     * Generates a random 32 byte buffer and returns the base64
15540     * encoded string to be used as a PKCE Code Verifier
15541     */
15542    PkceGenerator.prototype.generateCodeVerifier = function () {
15543        try {
15544            // Generate random values as utf-8
15545            var buffer = new Uint8Array(RANDOM_BYTE_ARR_LENGTH);
15546            this.cryptoObj.getRandomValues(buffer);
15547            // encode verifier as base64
15548            var pkceCodeVerifierB64 = this.base64Encode.urlEncodeArr(buffer);
15549            return pkceCodeVerifierB64;
15550        }
15551        catch (e) {
15552            throw BrowserAuthError.createPkceNotGeneratedError(e);
15553        }
15554    };
15555    /**
15556     * Creates a base64 encoded PKCE Code Challenge string from the
15557     * hash created from the PKCE Code Verifier supplied
15558     */
15559    PkceGenerator.prototype.generateCodeChallengeFromVerifier = function (pkceCodeVerifier) {
15560        return __awaiter$1(this, void 0, void 0, function () {
15561            var pkceHashedCodeVerifier, e_1;
15562            return __generator$1(this, function (_a) {
15563                switch (_a.label) {
15564                    case 0:
15565                        _a.trys.push([0, 2, , 3]);
15566                        return [4 /*yield*/, this.cryptoObj.sha256Digest(pkceCodeVerifier)];
15567                    case 1:
15568                        pkceHashedCodeVerifier = _a.sent();
15569                        // encode hash as base64
15570                        return [2 /*return*/, this.base64Encode.urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier))];
15571                    case 2:
15572                        e_1 = _a.sent();
15573                        throw BrowserAuthError.createPkceNotGeneratedError(e_1);
15574                    case 3: return [2 /*return*/];
15575                }
15576            });
15577        });
15578    };
15579    return PkceGenerator;
15580}());
15581
15582/*
15583 * Copyright (c) Microsoft Corporation. All rights reserved.
15584 * Licensed under the MIT License.
15585 */
15586var ModernBrowserCrypto = /** @class */ (function () {
15587    function ModernBrowserCrypto() {
15588    }
15589    ModernBrowserCrypto.prototype.getRandomValues = function (dataBuffer) {
15590        return window.crypto.getRandomValues(dataBuffer);
15591    };
15592    ModernBrowserCrypto.prototype.generateKey = function (algorithm, extractable, keyUsages) {
15593        return __awaiter$1(this, void 0, void 0, function () {
15594            return __generator$1(this, function (_a) {
15595                return [2 /*return*/, window.crypto.subtle.generateKey(algorithm, extractable, keyUsages)];
15596            });
15597        });
15598    };
15599    ModernBrowserCrypto.prototype.exportKey = function (key) {
15600        return __awaiter$1(this, void 0, void 0, function () {
15601            return __generator$1(this, function (_a) {
15602                return [2 /*return*/, window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key)];
15603            });
15604        });
15605    };
15606    ModernBrowserCrypto.prototype.importKey = function (keyData, algorithm, extractable, keyUsages) {
15607        return __awaiter$1(this, void 0, void 0, function () {
15608            return __generator$1(this, function (_a) {
15609                return [2 /*return*/, window.crypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages)];
15610            });
15611        });
15612    };
15613    ModernBrowserCrypto.prototype.sign = function (algorithm, key, data) {
15614        return __awaiter$1(this, void 0, void 0, function () {
15615            return __generator$1(this, function (_a) {
15616                return [2 /*return*/, window.crypto.subtle.sign(algorithm, key, data)];
15617            });
15618        });
15619    };
15620    ModernBrowserCrypto.prototype.digest = function (algorithm, data) {
15621        return __awaiter$1(this, void 0, void 0, function () {
15622            return __generator$1(this, function (_a) {
15623                return [2 /*return*/, window.crypto.subtle.digest(algorithm, data)];
15624            });
15625        });
15626    };
15627    return ModernBrowserCrypto;
15628}());
15629
15630/*
15631 * Copyright (c) Microsoft Corporation. All rights reserved.
15632 * Licensed under the MIT License.
15633 */
15634var MsrBrowserCrypto = /** @class */ (function () {
15635    function MsrBrowserCrypto() {
15636    }
15637    MsrBrowserCrypto.prototype.initPrng = function (entropy) {
15638        // Turn into array, as initPrng seems to not always like Uint8Array (even though it should support both)
15639        return window.msrCrypto.initPrng(__spread(entropy));
15640    };
15641    MsrBrowserCrypto.prototype.getRandomValues = function (dataBuffer) {
15642        return window.msrCrypto.getRandomValues(dataBuffer);
15643    };
15644    MsrBrowserCrypto.prototype.generateKey = function (algorithm, extractable, keyUsages) {
15645        return __awaiter$1(this, void 0, void 0, function () {
15646            return __generator$1(this, function (_a) {
15647                return [2 /*return*/, window.msrCrypto.subtle.generateKey(algorithm, extractable, keyUsages)];
15648            });
15649        });
15650    };
15651    MsrBrowserCrypto.prototype.exportKey = function (key) {
15652        return __awaiter$1(this, void 0, void 0, function () {
15653            return __generator$1(this, function (_a) {
15654                return [2 /*return*/, window.msrCrypto.subtle.exportKey(KEY_FORMAT_JWK, key)];
15655            });
15656        });
15657    };
15658    MsrBrowserCrypto.prototype.importKey = function (keyData, algorithm, extractable, keyUsages) {
15659        return __awaiter$1(this, void 0, void 0, function () {
15660            return __generator$1(this, function (_a) {
15661                return [2 /*return*/, window.msrCrypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages)];
15662            });
15663        });
15664    };
15665    MsrBrowserCrypto.prototype.sign = function (algorithm, key, data) {
15666        return __awaiter$1(this, void 0, void 0, function () {
15667            return __generator$1(this, function (_a) {
15668                return [2 /*return*/, window.msrCrypto.subtle.sign(algorithm, key, data)];
15669            });
15670        });
15671    };
15672    MsrBrowserCrypto.prototype.digest = function (algorithm, data) {
15673        return __awaiter$1(this, void 0, void 0, function () {
15674            return __generator$1(this, function (_a) {
15675                return [2 /*return*/, window.msrCrypto.subtle.digest(algorithm, data)];
15676            });
15677        });
15678    };
15679    return MsrBrowserCrypto;
15680}());
15681
15682/*
15683 * Copyright (c) Microsoft Corporation. All rights reserved.
15684 * Licensed under the MIT License.
15685 */
15686var MsBrowserCrypto = /** @class */ (function () {
15687    function MsBrowserCrypto() {
15688    }
15689    MsBrowserCrypto.prototype.getRandomValues = function (dataBuffer) {
15690        return window["msCrypto"].getRandomValues(dataBuffer);
15691    };
15692    MsBrowserCrypto.prototype.generateKey = function (algorithm, extractable, keyUsages) {
15693        return __awaiter$1(this, void 0, void 0, function () {
15694            return __generator$1(this, function (_a) {
15695                return [2 /*return*/, new Promise(function (resolve, reject) {
15696                        var msGenerateKey = window["msCrypto"].subtle.generateKey(algorithm, extractable, keyUsages);
15697                        msGenerateKey.addEventListener("complete", function (e) {
15698                            resolve(e.target.result);
15699                        });
15700                        msGenerateKey.addEventListener("error", function (error) {
15701                            reject(error);
15702                        });
15703                    })];
15704            });
15705        });
15706    };
15707    MsBrowserCrypto.prototype.exportKey = function (key) {
15708        return __awaiter$1(this, void 0, void 0, function () {
15709            return __generator$1(this, function (_a) {
15710                return [2 /*return*/, new Promise(function (resolve, reject) {
15711                        var msExportKey = window["msCrypto"].subtle.exportKey(KEY_FORMAT_JWK, key);
15712                        msExportKey.addEventListener("complete", function (e) {
15713                            var resultBuffer = e.target.result;
15714                            var resultString = BrowserStringUtils.utf8ArrToString(new Uint8Array(resultBuffer))
15715                                .replace(/\r/g, Constants.EMPTY_STRING)
15716                                .replace(/\n/g, Constants.EMPTY_STRING)
15717                                .replace(/\t/g, Constants.EMPTY_STRING)
15718                                .split(" ").join(Constants.EMPTY_STRING)
15719                                .replace("\u0000", Constants.EMPTY_STRING);
15720                            try {
15721                                resolve(JSON.parse(resultString));
15722                            }
15723                            catch (e) {
15724                                reject(e);
15725                            }
15726                        });
15727                        msExportKey.addEventListener("error", function (error) {
15728                            reject(error);
15729                        });
15730                    })];
15731            });
15732        });
15733    };
15734    MsBrowserCrypto.prototype.importKey = function (keyData, algorithm, extractable, keyUsages) {
15735        return __awaiter$1(this, void 0, void 0, function () {
15736            var keyString, keyBuffer;
15737            return __generator$1(this, function (_a) {
15738                keyString = BrowserStringUtils.getSortedObjectString(keyData);
15739                keyBuffer = BrowserStringUtils.stringToArrayBuffer(keyString);
15740                return [2 /*return*/, new Promise(function (resolve, reject) {
15741                        var msImportKey = window["msCrypto"].subtle.importKey(KEY_FORMAT_JWK, keyBuffer, algorithm, extractable, keyUsages);
15742                        msImportKey.addEventListener("complete", function (e) {
15743                            resolve(e.target.result);
15744                        });
15745                        msImportKey.addEventListener("error", function (error) {
15746                            reject(error);
15747                        });
15748                    })];
15749            });
15750        });
15751    };
15752    MsBrowserCrypto.prototype.sign = function (algorithm, key, data) {
15753        return __awaiter$1(this, void 0, void 0, function () {
15754            return __generator$1(this, function (_a) {
15755                return [2 /*return*/, new Promise(function (resolve, reject) {
15756                        var msSign = window["msCrypto"].subtle.sign(algorithm, key, data);
15757                        msSign.addEventListener("complete", function (e) {
15758                            resolve(e.target.result);
15759                        });
15760                        msSign.addEventListener("error", function (error) {
15761                            reject(error);
15762                        });
15763                    })];
15764            });
15765        });
15766    };
15767    MsBrowserCrypto.prototype.digest = function (algorithm, data) {
15768        return __awaiter$1(this, void 0, void 0, function () {
15769            return __generator$1(this, function (_a) {
15770                return [2 /*return*/, new Promise(function (resolve, reject) {
15771                        var digestOperation = window["msCrypto"].subtle.digest(algorithm, data.buffer);
15772                        digestOperation.addEventListener("complete", function (e) {
15773                            resolve(e.target.result);
15774                        });
15775                        digestOperation.addEventListener("error", function (error) {
15776                            reject(error);
15777                        });
15778                    })];
15779            });
15780        });
15781    };
15782    return MsBrowserCrypto;
15783}());
15784
15785/*
15786 * Copyright (c) Microsoft Corporation. All rights reserved.
15787 * Licensed under the MIT License.
15788 */
15789/**
15790 * See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams
15791 */
15792// RSA KeyGen Algorithm
15793var PKCS1_V15_KEYGEN_ALG = "RSASSA-PKCS1-v1_5";
15794// SHA-256 hashing algorithm
15795var S256_HASH_ALG = "SHA-256";
15796// MOD length for PoP tokens
15797var MODULUS_LENGTH = 2048;
15798// Public Exponent
15799var PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
15800/**
15801 * This class implements functions used by the browser library to perform cryptography operations such as
15802 * hashing and encoding. It also has helper functions to validate the availability of specific APIs.
15803 */
15804var BrowserCrypto = /** @class */ (function () {
15805    function BrowserCrypto(logger, cryptoOptions) {
15806        var _a, _b;
15807        this.logger = logger;
15808        this.cryptoOptions = cryptoOptions;
15809        if (this.hasBrowserCrypto()) {
15810            // Use standard modern web crypto if available
15811            this.logger.verbose("BrowserCrypto: modern crypto interface available");
15812            this.subtleCrypto = new ModernBrowserCrypto();
15813        }
15814        else if (this.hasIECrypto()) {
15815            // For IE11, use msCrypto interface
15816            this.logger.verbose("BrowserCrypto: MS crypto interface available");
15817            this.subtleCrypto = new MsBrowserCrypto();
15818        }
15819        else if (this.hasMsrCrypto() && ((_a = this.cryptoOptions) === null || _a === void 0 ? void 0 : _a.useMsrCrypto)) {
15820            // For other browsers, use MSR Crypto if found
15821            this.logger.verbose("BrowserCrypto: MSR crypto interface available");
15822            this.subtleCrypto = new MsrBrowserCrypto();
15823        }
15824        else {
15825            if (this.hasMsrCrypto()) {
15826                this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled");
15827            }
15828            this.logger.error("BrowserCrypto: No crypto interfaces available.");
15829            throw BrowserAuthError.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");
15830        }
15831        // Mainly needed for MSR Crypto: https://github.com/microsoft/MSR-JavaScript-Crypto#random-number-generator-prng
15832        if (this.subtleCrypto.initPrng) {
15833            this.logger.verbose("BrowserCrypto: Interface requires entropy");
15834            if (!((_b = this.cryptoOptions) === null || _b === void 0 ? void 0 : _b.entropy)) {
15835                this.logger.error("BrowserCrypto: Interface requires entropy but none provided.");
15836                throw BrowserConfigurationAuthError.createEntropyNotProvided();
15837            }
15838            this.logger.verbose("BrowserCrypto: Entropy provided");
15839            this.subtleCrypto.initPrng(this.cryptoOptions.entropy);
15840        }
15841        this.keygenAlgorithmOptions = {
15842            name: PKCS1_V15_KEYGEN_ALG,
15843            hash: S256_HASH_ALG,
15844            modulusLength: MODULUS_LENGTH,
15845            publicExponent: PUBLIC_EXPONENT
15846        };
15847    }
15848    /**
15849     * Check whether IE crypto or other browser cryptography is available.
15850     */
15851    BrowserCrypto.prototype.hasIECrypto = function () {
15852        return "msCrypto" in window;
15853    };
15854    /**
15855     * Check whether browser crypto is available.
15856     */
15857    BrowserCrypto.prototype.hasBrowserCrypto = function () {
15858        return "crypto" in window;
15859    };
15860    /**
15861     * Check whether MSR crypto polyfill is available
15862     */
15863    BrowserCrypto.prototype.hasMsrCrypto = function () {
15864        return "msrCrypto" in window;
15865    };
15866    /**
15867     * Returns a sha-256 hash of the given dataString as an ArrayBuffer.
15868     * @param dataString
15869     */
15870    BrowserCrypto.prototype.sha256Digest = function (dataString) {
15871        return __awaiter$1(this, void 0, void 0, function () {
15872            var data;
15873            return __generator$1(this, function (_a) {
15874                data = BrowserStringUtils.stringToUtf8Arr(dataString);
15875                // MSR Crypto wants object with name property, instead of string
15876                return [2 /*return*/, this.subtleCrypto.digest({ name: S256_HASH_ALG }, data)];
15877            });
15878        });
15879    };
15880    /**
15881     * Populates buffer with cryptographically random values.
15882     * @param dataBuffer
15883     */
15884    BrowserCrypto.prototype.getRandomValues = function (dataBuffer) {
15885        return this.subtleCrypto.getRandomValues(dataBuffer);
15886    };
15887    /**
15888     * Generates a keypair based on current keygen algorithm config.
15889     * @param extractable
15890     * @param usages
15891     */
15892    BrowserCrypto.prototype.generateKeyPair = function (extractable, usages) {
15893        return __awaiter$1(this, void 0, void 0, function () {
15894            return __generator$1(this, function (_a) {
15895                return [2 /*return*/, this.subtleCrypto.generateKey(this.keygenAlgorithmOptions, extractable, usages)];
15896            });
15897        });
15898    };
15899    /**
15900     * Export key as Json Web Key (JWK)
15901     * @param key
15902     * @param format
15903     */
15904    BrowserCrypto.prototype.exportJwk = function (key) {
15905        return __awaiter$1(this, void 0, void 0, function () {
15906            return __generator$1(this, function (_a) {
15907                return [2 /*return*/, this.subtleCrypto.exportKey(key)];
15908            });
15909        });
15910    };
15911    /**
15912     * Imports key as Json Web Key (JWK), can set extractable and usages.
15913     * @param key
15914     * @param format
15915     * @param extractable
15916     * @param usages
15917     */
15918    BrowserCrypto.prototype.importJwk = function (key, extractable, usages) {
15919        return __awaiter$1(this, void 0, void 0, function () {
15920            return __generator$1(this, function (_a) {
15921                return [2 /*return*/, this.subtleCrypto.importKey(key, this.keygenAlgorithmOptions, extractable, usages)];
15922            });
15923        });
15924    };
15925    /**
15926     * Signs given data with given key
15927     * @param key
15928     * @param data
15929     */
15930    BrowserCrypto.prototype.sign = function (key, data) {
15931        return __awaiter$1(this, void 0, void 0, function () {
15932            return __generator$1(this, function (_a) {
15933                return [2 /*return*/, this.subtleCrypto.sign(this.keygenAlgorithmOptions, key, data)];
15934            });
15935        });
15936    };
15937    return BrowserCrypto;
15938}());
15939
15940/*
15941 * Copyright (c) Microsoft Corporation. All rights reserved.
15942 * Licensed under the MIT License.
15943 */
15944/**
15945 * Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
15946 */
15947var DatabaseStorage = /** @class */ (function () {
15948    function DatabaseStorage() {
15949        this.dbName = DB_NAME;
15950        this.version = DB_VERSION;
15951        this.tableName = DB_TABLE_NAME;
15952        this.dbOpen = false;
15953    }
15954    /**
15955     * Opens IndexedDB instance.
15956     */
15957    DatabaseStorage.prototype.open = function () {
15958        return __awaiter$1(this, void 0, void 0, function () {
15959            var _this = this;
15960            return __generator$1(this, function (_a) {
15961                return [2 /*return*/, new Promise(function (resolve, reject) {
15962                        var openDB = window.indexedDB.open(_this.dbName, _this.version);
15963                        openDB.addEventListener("upgradeneeded", function (e) {
15964                            var event = e;
15965                            event.target.result.createObjectStore(_this.tableName);
15966                        });
15967                        openDB.addEventListener("success", function (e) {
15968                            var event = e;
15969                            _this.db = event.target.result;
15970                            _this.dbOpen = true;
15971                            resolve();
15972                        });
15973                        openDB.addEventListener("error", function () { return reject(BrowserAuthError.createDatabaseUnavailableError()); });
15974                    })];
15975            });
15976        });
15977    };
15978    /**
15979     * Closes the connection to IndexedDB database when all pending transactions
15980     * complete.
15981     */
15982    DatabaseStorage.prototype.closeConnection = function () {
15983        var db = this.db;
15984        if (db && this.dbOpen) {
15985            db.close();
15986            this.dbOpen = false;
15987        }
15988    };
15989    /**
15990     * Opens database if it's not already open
15991     */
15992    DatabaseStorage.prototype.validateDbIsOpen = function () {
15993        return __awaiter$1(this, void 0, void 0, function () {
15994            return __generator$1(this, function (_a) {
15995                switch (_a.label) {
15996                    case 0:
15997                        if (!!this.dbOpen) return [3 /*break*/, 2];
15998                        return [4 /*yield*/, this.open()];
15999                    case 1: return [2 /*return*/, _a.sent()];
16000                    case 2: return [2 /*return*/];
16001                }
16002            });
16003        });
16004    };
16005    /**
16006     * Retrieves item from IndexedDB instance.
16007     * @param key
16008     */
16009    DatabaseStorage.prototype.getItem = function (key) {
16010        return __awaiter$1(this, void 0, void 0, function () {
16011            var _this = this;
16012            return __generator$1(this, function (_a) {
16013                switch (_a.label) {
16014                    case 0: return [4 /*yield*/, this.validateDbIsOpen()];
16015                    case 1:
16016                        _a.sent();
16017                        return [2 /*return*/, new Promise(function (resolve, reject) {
16018                                // TODO: Add timeouts?
16019                                if (!_this.db) {
16020                                    return reject(BrowserAuthError.createDatabaseNotOpenError());
16021                                }
16022                                var transaction = _this.db.transaction([_this.tableName], "readonly");
16023                                var objectStore = transaction.objectStore(_this.tableName);
16024                                var dbGet = objectStore.get(key);
16025                                dbGet.addEventListener("success", function (e) {
16026                                    var event = e;
16027                                    _this.closeConnection();
16028                                    resolve(event.target.result);
16029                                });
16030                                dbGet.addEventListener("error", function (e) {
16031                                    _this.closeConnection();
16032                                    reject(e);
16033                                });
16034                            })];
16035                }
16036            });
16037        });
16038    };
16039    /**
16040     * Adds item to IndexedDB under given key
16041     * @param key
16042     * @param payload
16043     */
16044    DatabaseStorage.prototype.setItem = function (key, payload) {
16045        return __awaiter$1(this, void 0, void 0, function () {
16046            var _this = this;
16047            return __generator$1(this, function (_a) {
16048                switch (_a.label) {
16049                    case 0: return [4 /*yield*/, this.validateDbIsOpen()];
16050                    case 1:
16051                        _a.sent();
16052                        return [2 /*return*/, new Promise(function (resolve, reject) {
16053                                // TODO: Add timeouts?
16054                                if (!_this.db) {
16055                                    return reject(BrowserAuthError.createDatabaseNotOpenError());
16056                                }
16057                                var transaction = _this.db.transaction([_this.tableName], "readwrite");
16058                                var objectStore = transaction.objectStore(_this.tableName);
16059                                var dbPut = objectStore.put(payload, key);
16060                                dbPut.addEventListener("success", function () {
16061                                    _this.closeConnection();
16062                                    resolve();
16063                                });
16064                                dbPut.addEventListener("error", function (e) {
16065                                    _this.closeConnection();
16066                                    reject(e);
16067                                });
16068                            })];
16069                }
16070            });
16071        });
16072    };
16073    /**
16074     * Removes item from IndexedDB under given key
16075     * @param key
16076     */
16077    DatabaseStorage.prototype.removeItem = function (key) {
16078        return __awaiter$1(this, void 0, void 0, function () {
16079            var _this = this;
16080            return __generator$1(this, function (_a) {
16081                switch (_a.label) {
16082                    case 0: return [4 /*yield*/, this.validateDbIsOpen()];
16083                    case 1:
16084                        _a.sent();
16085                        return [2 /*return*/, new Promise(function (resolve, reject) {
16086                                if (!_this.db) {
16087                                    return reject(BrowserAuthError.createDatabaseNotOpenError());
16088                                }
16089                                var transaction = _this.db.transaction([_this.tableName], "readwrite");
16090                                var objectStore = transaction.objectStore(_this.tableName);
16091                                var dbDelete = objectStore.delete(key);
16092                                dbDelete.addEventListener("success", function () {
16093                                    _this.closeConnection();
16094                                    resolve();
16095                                });
16096                                dbDelete.addEventListener("error", function (e) {
16097                                    _this.closeConnection();
16098                                    reject(e);
16099                                });
16100                            })];
16101                }
16102            });
16103        });
16104    };
16105    /**
16106     * Get all the keys from the storage object as an iterable array of strings.
16107     */
16108    DatabaseStorage.prototype.getKeys = function () {
16109        return __awaiter$1(this, void 0, void 0, function () {
16110            var _this = this;
16111            return __generator$1(this, function (_a) {
16112                switch (_a.label) {
16113                    case 0: return [4 /*yield*/, this.validateDbIsOpen()];
16114                    case 1:
16115                        _a.sent();
16116                        return [2 /*return*/, new Promise(function (resolve, reject) {
16117                                if (!_this.db) {
16118                                    return reject(BrowserAuthError.createDatabaseNotOpenError());
16119                                }
16120                                var transaction = _this.db.transaction([_this.tableName], "readonly");
16121                                var objectStore = transaction.objectStore(_this.tableName);
16122                                var dbGetKeys = objectStore.getAllKeys();
16123                                dbGetKeys.addEventListener("success", function (e) {
16124                                    var event = e;
16125                                    _this.closeConnection();
16126                                    resolve(event.target.result);
16127                                });
16128                                dbGetKeys.addEventListener("error", function (e) {
16129                                    _this.closeConnection();
16130                                    reject(e);
16131                                });
16132                            })];
16133                }
16134            });
16135        });
16136    };
16137    /**
16138     *
16139     * Checks whether there is an object under the search key in the object store
16140     */
16141    DatabaseStorage.prototype.containsKey = function (key) {
16142        return __awaiter$1(this, void 0, void 0, function () {
16143            var _this = this;
16144            return __generator$1(this, function (_a) {
16145                switch (_a.label) {
16146                    case 0: return [4 /*yield*/, this.validateDbIsOpen()];
16147                    case 1:
16148                        _a.sent();
16149                        return [2 /*return*/, new Promise(function (resolve, reject) {
16150                                if (!_this.db) {
16151                                    return reject(BrowserAuthError.createDatabaseNotOpenError());
16152                                }
16153                                var transaction = _this.db.transaction([_this.tableName], "readonly");
16154                                var objectStore = transaction.objectStore(_this.tableName);
16155                                var dbContainsKey = objectStore.count(key);
16156                                dbContainsKey.addEventListener("success", function (e) {
16157                                    var event = e;
16158                                    _this.closeConnection();
16159                                    resolve(event.target.result === 1);
16160                                });
16161                                dbContainsKey.addEventListener("error", function (e) {
16162                                    _this.closeConnection();
16163                                    reject(e);
16164                                });
16165                            })];
16166                }
16167            });
16168        });
16169    };
16170    /**
16171     * Deletes the MSAL database. The database is deleted rather than cleared to make it possible
16172     * for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues
16173     * with IndexedDB database versions.
16174     */
16175    DatabaseStorage.prototype.deleteDatabase = function () {
16176        return __awaiter$1(this, void 0, void 0, function () {
16177            return __generator$1(this, function (_a) {
16178                // Check if database being deleted exists
16179                if (this.db && this.dbOpen) {
16180                    this.closeConnection();
16181                }
16182                return [2 /*return*/, new Promise(function (resolve, reject) {
16183                        var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
16184                        deleteDbRequest.addEventListener("success", function () { return resolve(true); });
16185                        deleteDbRequest.addEventListener("blocked", function () { return resolve(true); });
16186                        deleteDbRequest.addEventListener("error", function () { return reject(false); });
16187                    })];
16188            });
16189        });
16190    };
16191    return DatabaseStorage;
16192}());
16193
16194/*
16195 * Copyright (c) Microsoft Corporation. All rights reserved.
16196 * Licensed under the MIT License.
16197 */
16198/**
16199 * This class allows MSAL to store artifacts asynchronously using the DatabaseStorage IndexedDB wrapper,
16200 * backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.
16201 */
16202var AsyncMemoryStorage = /** @class */ (function () {
16203    function AsyncMemoryStorage(logger, storeName) {
16204        this.inMemoryCache = new MemoryStorage();
16205        this.indexedDBCache = new DatabaseStorage();
16206        this.logger = logger;
16207        this.storeName = storeName;
16208    }
16209    AsyncMemoryStorage.prototype.handleDatabaseAccessError = function (error) {
16210        if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.databaseUnavailable.code) {
16211            this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");
16212        }
16213        else {
16214            throw error;
16215        }
16216    };
16217    /**
16218     * Get the item matching the given key. Tries in-memory cache first, then in the asynchronous
16219     * storage object if item isn't found in-memory.
16220     * @param key
16221     */
16222    AsyncMemoryStorage.prototype.getItem = function (key) {
16223        return __awaiter$1(this, void 0, void 0, function () {
16224            var item, e_1;
16225            return __generator$1(this, function (_a) {
16226                switch (_a.label) {
16227                    case 0:
16228                        item = this.inMemoryCache.getItem(key);
16229                        if (!!item) return [3 /*break*/, 4];
16230                        _a.label = 1;
16231                    case 1:
16232                        _a.trys.push([1, 3, , 4]);
16233                        this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage.");
16234                        return [4 /*yield*/, this.indexedDBCache.getItem(key)];
16235                    case 2: return [2 /*return*/, _a.sent()];
16236                    case 3:
16237                        e_1 = _a.sent();
16238                        this.handleDatabaseAccessError(e_1);
16239                        return [3 /*break*/, 4];
16240                    case 4: return [2 /*return*/, item];
16241                }
16242            });
16243        });
16244    };
16245    /**
16246     * Sets the item in the in-memory cache and then tries to set it in the asynchronous
16247     * storage object with the given key.
16248     * @param key
16249     * @param value
16250     */
16251    AsyncMemoryStorage.prototype.setItem = function (key, value) {
16252        return __awaiter$1(this, void 0, void 0, function () {
16253            var e_2;
16254            return __generator$1(this, function (_a) {
16255                switch (_a.label) {
16256                    case 0:
16257                        this.inMemoryCache.setItem(key, value);
16258                        _a.label = 1;
16259                    case 1:
16260                        _a.trys.push([1, 3, , 4]);
16261                        return [4 /*yield*/, this.indexedDBCache.setItem(key, value)];
16262                    case 2:
16263                        _a.sent();
16264                        return [3 /*break*/, 4];
16265                    case 3:
16266                        e_2 = _a.sent();
16267                        this.handleDatabaseAccessError(e_2);
16268                        return [3 /*break*/, 4];
16269                    case 4: return [2 /*return*/];
16270                }
16271            });
16272        });
16273    };
16274    /**
16275     * Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.
16276     * @param key
16277     */
16278    AsyncMemoryStorage.prototype.removeItem = function (key) {
16279        return __awaiter$1(this, void 0, void 0, function () {
16280            var e_3;
16281            return __generator$1(this, function (_a) {
16282                switch (_a.label) {
16283                    case 0:
16284                        this.inMemoryCache.removeItem(key);
16285                        _a.label = 1;
16286                    case 1:
16287                        _a.trys.push([1, 3, , 4]);
16288                        return [4 /*yield*/, this.indexedDBCache.removeItem(key)];
16289                    case 2:
16290                        _a.sent();
16291                        return [3 /*break*/, 4];
16292                    case 3:
16293                        e_3 = _a.sent();
16294                        this.handleDatabaseAccessError(e_3);
16295                        return [3 /*break*/, 4];
16296                    case 4: return [2 /*return*/];
16297                }
16298            });
16299        });
16300    };
16301    /**
16302     * Get all the keys from the in-memory cache as an iterable array of str
vendor: 82,307 bytes, lines 16302-17789
16302ings. If no keys are found, query the keys in the
16303     * asynchronous storage object.
16304     */
16305    AsyncMemoryStorage.prototype.getKeys = function () {
16306        return __awaiter$1(this, void 0, void 0, function () {
16307            var cacheKeys, e_4;
16308            return __generator$1(this, function (_a) {
16309                switch (_a.label) {
16310                    case 0:
16311                        cacheKeys = this.inMemoryCache.getKeys();
16312                        if (!(cacheKeys.length === 0)) return [3 /*break*/, 4];
16313                        _a.label = 1;
16314                    case 1:
16315                        _a.trys.push([1, 3, , 4]);
16316                        this.logger.verbose("In-memory cache is empty, now querying persistent storage.");
16317                        return [4 /*yield*/, this.indexedDBCache.getKeys()];
16318                    case 2: return [2 /*return*/, _a.sent()];
16319                    case 3:
16320                        e_4 = _a.sent();
16321                        this.handleDatabaseAccessError(e_4);
16322                        return [3 /*break*/, 4];
16323                    case 4: return [2 /*return*/, cacheKeys];
16324                }
16325            });
16326        });
16327    };
16328    /**
16329     * Returns true or false if the given key is present in the cache.
16330     * @param key
16331     */
16332    AsyncMemoryStorage.prototype.containsKey = function (key) {
16333        return __awaiter$1(this, void 0, void 0, function () {
16334            var containsKey, e_5;
16335            return __generator$1(this, function (_a) {
16336                switch (_a.label) {
16337                    case 0:
16338                        containsKey = this.inMemoryCache.containsKey(key);
16339                        if (!!containsKey) return [3 /*break*/, 4];
16340                        _a.label = 1;
16341                    case 1:
16342                        _a.trys.push([1, 3, , 4]);
16343                        this.logger.verbose("Key not found in in-memory cache, now querying persistent storage.");
16344                        return [4 /*yield*/, this.indexedDBCache.containsKey(key)];
16345                    case 2: return [2 /*return*/, _a.sent()];
16346                    case 3:
16347                        e_5 = _a.sent();
16348                        this.handleDatabaseAccessError(e_5);
16349                        return [3 /*break*/, 4];
16350                    case 4: return [2 /*return*/, containsKey];
16351                }
16352            });
16353        });
16354    };
16355    /**
16356     * Clears in-memory Map
16357     */
16358    AsyncMemoryStorage.prototype.clearInMemory = function () {
16359        // InMemory cache is a Map instance, clear is straightforward
16360        this.logger.verbose("Deleting in-memory keystore " + this.storeName);
16361        this.inMemoryCache.clear();
16362        this.logger.verbose("In-memory keystore " + this.storeName + " deleted");
16363    };
16364    /**
16365     * Tries to delete the IndexedDB database
16366     * @returns
16367     */
16368    AsyncMemoryStorage.prototype.clearPersistent = function () {
16369        return __awaiter$1(this, void 0, void 0, function () {
16370            var dbDeleted, e_6;
16371            return __generator$1(this, function (_a) {
16372                switch (_a.label) {
16373                    case 0:
16374                        _a.trys.push([0, 2, , 3]);
16375                        this.logger.verbose("Deleting persistent keystore");
16376                        return [4 /*yield*/, this.indexedDBCache.deleteDatabase()];
16377                    case 1:
16378                        dbDeleted = _a.sent();
16379                        if (dbDeleted) {
16380                            this.logger.verbose("Persistent keystore deleted");
16381                        }
16382                        return [2 /*return*/, dbDeleted];
16383                    case 2:
16384                        e_6 = _a.sent();
16385                        this.handleDatabaseAccessError(e_6);
16386                        return [2 /*return*/, false];
16387                    case 3: return [2 /*return*/];
16388                }
16389            });
16390        });
16391    };
16392    return AsyncMemoryStorage;
16393}());
16394
16395/*
16396 * Copyright (c) Microsoft Corporation. All rights reserved.
16397 * Licensed under the MIT License.
16398 */
16399var CryptoKeyStoreNames;
16400(function (CryptoKeyStoreNames) {
16401    CryptoKeyStoreNames["asymmetricKeys"] = "asymmetricKeys";
16402    CryptoKeyStoreNames["symmetricKeys"] = "symmetricKeys";
16403})(CryptoKeyStoreNames || (CryptoKeyStoreNames = {}));
16404/**
16405 * MSAL CryptoKeyStore DB Version 2
16406 */
16407var CryptoKeyStore = /** @class */ (function () {
16408    function CryptoKeyStore(logger) {
16409        this.logger = logger;
16410        this.asymmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.asymmetricKeys);
16411        this.symmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.symmetricKeys);
16412    }
16413    CryptoKeyStore.prototype.clear = function () {
16414        return __awaiter$1(this, void 0, void 0, function () {
16415            var e_1;
16416            return __generator$1(this, function (_a) {
16417                switch (_a.label) {
16418                    case 0:
16419                        // Delete in-memory keystores
16420                        this.asymmetricKeys.clearInMemory();
16421                        this.symmetricKeys.clearInMemory();
16422                        _a.label = 1;
16423                    case 1:
16424                        _a.trys.push([1, 3, , 4]);
16425                        return [4 /*yield*/, this.asymmetricKeys.clearPersistent()];
16426                    case 2:
16427                        _a.sent();
16428                        return [2 /*return*/, true];
16429                    case 3:
16430                        e_1 = _a.sent();
16431                        if (e_1 instanceof Error) {
16432                            this.logger.error("Clearing keystore failed with error: " + e_1.message);
16433                        }
16434                        else {
16435                            this.logger.error("Clearing keystore failed with unknown error");
16436                        }
16437                        return [2 /*return*/, false];
16438                    case 4: return [2 /*return*/];
16439                }
16440            });
16441        });
16442    };
16443    return CryptoKeyStore;
16444}());
16445
16446/*
16447 * Copyright (c) Microsoft Corporation. All rights reserved.
16448 * Licensed under the MIT License.
16449 */
16450/**
16451 * This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
16452 * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
16453 */
16454var CryptoOps = /** @class */ (function () {
16455    function CryptoOps(logger, performanceClient, cryptoConfig) {
16456        this.logger = logger;
16457        // Browser crypto needs to be validated first before any other classes can be set.
16458        this.browserCrypto = new BrowserCrypto(this.logger, cryptoConfig);
16459        this.b64Encode = new Base64Encode();
16460        this.b64Decode = new Base64Decode();
16461        this.guidGenerator = new GuidGenerator(this.browserCrypto);
16462        this.pkceGenerator = new PkceGenerator(this.browserCrypto);
16463        this.cache = new CryptoKeyStore(this.logger);
16464        this.performanceClient = performanceClient;
16465    }
16466    /**
16467     * Creates a new random GUID - used to populate state and nonce.
16468     * @returns string (GUID)
16469     */
16470    CryptoOps.prototype.createNewGuid = function () {
16471        return this.guidGenerator.generateGuid();
16472    };
16473    /**
16474     * Encodes input string to base64.
16475     * @param input
16476     */
16477    CryptoOps.prototype.base64Encode = function (input) {
16478        return this.b64Encode.encode(input);
16479    };
16480    /**
16481     * Decodes input string from base64.
16482     * @param input
16483     */
16484    CryptoOps.prototype.base64Decode = function (input) {
16485        return this.b64Decode.decode(input);
16486    };
16487    /**
16488     * Generates PKCE codes used in Authorization Code Flow.
16489     */
16490    CryptoOps.prototype.generatePkceCodes = function () {
16491        return __awaiter$1(this, void 0, void 0, function () {
16492            return __generator$1(this, function (_a) {
16493                return [2 /*return*/, this.pkceGenerator.generateCodes()];
16494            });
16495        });
16496    };
16497    /**
16498     * Generates a keypair, stores it and returns a thumbprint
16499     * @param request
16500     */
16501    CryptoOps.prototype.getPublicKeyThumbprint = function (request) {
16502        var _a;
16503        return __awaiter$1(this, void 0, void 0, function () {
16504            var publicKeyThumbMeasurement, keyPair, publicKeyJwk, pubKeyThumprintObj, publicJwkString, publicJwkHash, privateKeyJwk, unextractablePrivateKey;
16505            return __generator$1(this, function (_b) {
16506                switch (_b.label) {
16507                    case 0:
16508                        publicKeyThumbMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);
16509                        return [4 /*yield*/, this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES)];
16510                    case 1:
16511                        keyPair = _b.sent();
16512                        return [4 /*yield*/, this.browserCrypto.exportJwk(keyPair.publicKey)];
16513                    case 2:
16514                        publicKeyJwk = _b.sent();
16515                        pubKeyThumprintObj = {
16516                            e: publicKeyJwk.e,
16517                            kty: publicKeyJwk.kty,
16518                            n: publicKeyJwk.n
16519                        };
16520                        publicJwkString = BrowserStringUtils.getSortedObjectString(pubKeyThumprintObj);
16521                        return [4 /*yield*/, this.hashString(publicJwkString)];
16522                    case 3:
16523                        publicJwkHash = _b.sent();
16524                        return [4 /*yield*/, this.browserCrypto.exportJwk(keyPair.privateKey)];
16525                    case 4:
16526                        privateKeyJwk = _b.sent();
16527                        return [4 /*yield*/, this.browserCrypto.importJwk(privateKeyJwk, false, ["sign"])];
16528                    case 5:
16529                        unextractablePrivateKey = _b.sent();
16530                        // Store Keypair data in keystore
16531                        return [4 /*yield*/, this.cache.asymmetricKeys.setItem(publicJwkHash, {
16532                                privateKey: unextractablePrivateKey,
16533                                publicKey: keyPair.publicKey,
16534                                requestMethod: request.resourceRequestMethod,
16535                                requestUri: request.resourceRequestUri
16536                            })];
16537                    case 6:
16538                        // Store Keypair data in keystore
16539                        _b.sent();
16540                        if (publicKeyThumbMeasurement) {
16541                            publicKeyThumbMeasurement.endMeasurement({
16542                                success: true
16543                            });
16544                        }
16545                        return [2 /*return*/, publicJwkHash];
16546                }
16547            });
16548        });
16549    };
16550    /**
16551     * Removes cryptographic keypair from key store matching the keyId passed in
16552     * @param kid
16553     */
16554    CryptoOps.prototype.removeTokenBindingKey = function (kid) {
16555        return __awaiter$1(this, void 0, void 0, function () {
16556            var keyFound;
16557            return __generator$1(this, function (_a) {
16558                switch (_a.label) {
16559                    case 0: return [4 /*yield*/, this.cache.asymmetricKeys.removeItem(kid)];
16560                    case 1:
16561                        _a.sent();
16562                        return [4 /*yield*/, this.cache.asymmetricKeys.containsKey(kid)];
16563                    case 2:
16564                        keyFound = _a.sent();
16565                        return [2 /*return*/, !keyFound];
16566                }
16567            });
16568        });
16569    };
16570    /**
16571     * Removes all cryptographic keys from IndexedDB storage
16572     */
16573    CryptoOps.prototype.clearKeystore = function () {
16574        return __awaiter$1(this, void 0, void 0, function () {
16575            return __generator$1(this, function (_a) {
16576                switch (_a.label) {
16577                    case 0: return [4 /*yield*/, this.cache.clear()];
16578                    case 1: return [2 /*return*/, _a.sent()];
16579                }
16580            });
16581        });
16582    };
16583    /**
16584     * Signs the given object as a jwt payload with private key retrieved by given kid.
16585     * @param payload
16586     * @param kid
16587     */
16588    CryptoOps.prototype.signJwt = function (payload, kid, correlationId) {
16589        var _a;
16590        return __awaiter$1(this, void 0, void 0, function () {
16591            var signJwtMeasurement, cachedKeyPair, publicKeyJwk, publicKeyJwkString, encodedKeyIdThumbprint, shrHeader, encodedShrHeader, encodedPayload, tokenString, tokenBuffer, signatureBuffer, encodedSignature, signedJwt;
16592            return __generator$1(this, function (_b) {
16593                switch (_b.label) {
16594                    case 0:
16595                        signJwtMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.CryptoOptsSignJwt, correlationId);
16596                        return [4 /*yield*/, this.cache.asymmetricKeys.getItem(kid)];
16597                    case 1:
16598                        cachedKeyPair = _b.sent();
16599                        if (!cachedKeyPair) {
16600                            throw BrowserAuthError.createSigningKeyNotFoundInStorageError(kid);
16601                        }
16602                        return [4 /*yield*/, this.browserCrypto.exportJwk(cachedKeyPair.publicKey)];
16603                    case 2:
16604                        publicKeyJwk = _b.sent();
16605                        publicKeyJwkString = BrowserStringUtils.getSortedObjectString(publicKeyJwk);
16606                        encodedKeyIdThumbprint = this.b64Encode.urlEncode(JSON.stringify({ kid: kid }));
16607                        shrHeader = JoseHeader.getShrHeaderString({ kid: encodedKeyIdThumbprint, alg: publicKeyJwk.alg });
16608                        encodedShrHeader = this.b64Encode.urlEncode(shrHeader);
16609                        // Generate payload
16610                        payload.cnf = {
16611                            jwk: JSON.parse(publicKeyJwkString)
16612                        };
16613                        encodedPayload = this.b64Encode.urlEncode(JSON.stringify(payload));
16614                        tokenString = encodedShrHeader + "." + encodedPayload;
16615                        tokenBuffer = BrowserStringUtils.stringToArrayBuffer(tokenString);
16616                        return [4 /*yield*/, this.browserCrypto.sign(cachedKeyPair.privateKey, tokenBuffer)];
16617                    case 3:
16618                        signatureBuffer = _b.sent();
16619                        encodedSignature = this.b64Encode.urlEncodeArr(new Uint8Array(signatureBuffer));
16620                        signedJwt = tokenString + "." + encodedSignature;
16621                        if (signJwtMeasurement) {
16622                            signJwtMeasurement.endMeasurement({
16623                                success: true
16624                            });
16625                        }
16626                        return [2 /*return*/, signedJwt];
16627                }
16628            });
16629        });
16630    };
16631    /**
16632     * Returns the SHA-256 hash of an input string
16633     * @param plainText
16634     */
16635    CryptoOps.prototype.hashString = function (plainText) {
16636        return __awaiter$1(this, void 0, void 0, function () {
16637            var hashBuffer, hashBytes;
16638            return __generator$1(this, function (_a) {
16639                switch (_a.label) {
16640                    case 0: return [4 /*yield*/, this.browserCrypto.sha256Digest(plainText)];
16641                    case 1:
16642                        hashBuffer = _a.sent();
16643                        hashBytes = new Uint8Array(hashBuffer);
16644                        return [2 /*return*/, this.b64Encode.urlEncodeArr(hashBytes)];
16645                }
16646            });
16647        });
16648    };
16649    CryptoOps.POP_KEY_USAGES = ["sign", "verify"];
16650    CryptoOps.EXTRACTABLE = true;
16651    return CryptoOps;
16652}());
16653
16654/*
16655 * Copyright (c) Microsoft Corporation. All rights reserved.
16656 * Licensed under the MIT License.
16657 */
16658var BrowserPerformanceMeasurement = /** @class */ (function () {
16659    function BrowserPerformanceMeasurement(name, correlationId) {
16660        this.correlationId = correlationId;
16661        this.measureName = BrowserPerformanceMeasurement.makeMeasureName(name, correlationId);
16662        this.startMark = BrowserPerformanceMeasurement.makeStartMark(name, correlationId);
16663        this.endMark = BrowserPerformanceMeasurement.makeEndMark(name, correlationId);
16664    }
16665    BrowserPerformanceMeasurement.makeMeasureName = function (name, correlationId) {
16666        return "msal.measure." + name + "." + correlationId;
16667    };
16668    BrowserPerformanceMeasurement.makeStartMark = function (name, correlationId) {
16669        return "msal.start." + name + "." + correlationId;
16670    };
16671    BrowserPerformanceMeasurement.makeEndMark = function (name, correlationId) {
16672        return "msal.end." + name + "." + correlationId;
16673    };
16674    BrowserPerformanceMeasurement.supportsBrowserPerformance = function () {
16675        return typeof window !== "undefined" &&
16676            typeof window.performance !== "undefined" &&
16677            typeof window.performance.mark === "function" &&
16678            typeof window.performance.measure === "function" &&
16679            typeof window.performance.clearMarks === "function" &&
16680            typeof window.performance.clearMeasures === "function" &&
16681            typeof window.performance.getEntriesByName === "function";
16682    };
16683    /**
16684     * Flush browser marks and measurements.
16685     * @param {string} correlationId
16686     * @param {SubMeasurement} measurements
16687     */
16688    BrowserPerformanceMeasurement.flushMeasurements = function (correlationId, measurements) {
16689        if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
16690            try {
16691                measurements.forEach(function (measurement) {
16692                    var measureName = BrowserPerformanceMeasurement.makeMeasureName(measurement.name, correlationId);
16693                    var entriesForMeasurement = window.performance.getEntriesByName(measureName, "measure");
16694                    if (entriesForMeasurement.length > 0) {
16695                        window.performance.clearMeasures(measureName);
16696                        window.performance.clearMarks(BrowserPerformanceMeasurement.makeStartMark(measureName, correlationId));
16697                        window.performance.clearMarks(BrowserPerformanceMeasurement.makeEndMark(measureName, correlationId));
16698                    }
16699                });
16700            }
16701            catch (e) {
16702                // Silently catch and return null
16703            }
16704        }
16705    };
16706    BrowserPerformanceMeasurement.prototype.startMeasurement = function () {
16707        if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
16708            try {
16709                window.performance.mark(this.startMark);
16710            }
16711            catch (e) {
16712                // Silently catch
16713            }
16714        }
16715    };
16716    BrowserPerformanceMeasurement.prototype.endMeasurement = function () {
16717        if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
16718            try {
16719                window.performance.mark(this.endMark);
16720                window.performance.measure(this.measureName, this.startMark, this.endMark);
16721            }
16722            catch (e) {
16723                // Silently catch
16724            }
16725        }
16726    };
16727    BrowserPerformanceMeasurement.prototype.flushMeasurement = function () {
16728        if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
16729            try {
16730                var entriesForMeasurement = window.performance.getEntriesByName(this.measureName, "measure");
16731                if (entriesForMeasurement.length > 0) {
16732                    var durationMs = entriesForMeasurement[0].duration;
16733                    window.performance.clearMeasures(this.measureName);
16734                    window.performance.clearMarks(this.startMark);
16735                    window.performance.clearMarks(this.endMark);
16736                    return durationMs;
16737                }
16738            }
16739            catch (e) {
16740                // Silently catch and return null
16741            }
16742        }
16743        return null;
16744    };
16745    return BrowserPerformanceMeasurement;
16746}());
16747
16748/*
16749 * Copyright (c) Microsoft Corporation. All rights reserved.
16750 * Licensed under the MIT License.
16751 */
16752var BrowserPerformanceClient = /** @class */ (function (_super) {
16753    __extends$1(BrowserPerformanceClient, _super);
16754    function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, cryptoOptions) {
16755        var _this = _super.call(this, clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) || this;
16756        _this.browserCrypto = new BrowserCrypto(_this.logger, cryptoOptions);
16757        _this.guidGenerator = new GuidGenerator(_this.browserCrypto);
16758        return _this;
16759    }
16760    BrowserPerformanceClient.prototype.startPerformanceMeasuremeant = function (measureName, correlationId) {
16761        return new BrowserPerformanceMeasurement(measureName, correlationId);
16762    };
16763    BrowserPerformanceClient.prototype.generateId = function () {
16764        return this.guidGenerator.generateGuid();
16765    };
16766    BrowserPerformanceClient.prototype.getPageVisibility = function () {
16767        var _a;
16768        return ((_a = document.visibilityState) === null || _a === void 0 ? void 0 : _a.toString()) || null;
16769    };
16770    BrowserPerformanceClient.prototype.deleteIncompleteSubMeasurements = function (inProgressEvent) {
16771        var rootEvent = this.eventsByCorrelationId.get(inProgressEvent.event.correlationId);
16772        var isRootEvent = rootEvent && rootEvent.eventId === inProgressEvent.event.eventId;
16773        var incompleteMeasurements = [];
16774        if (isRootEvent && (rootEvent === null || rootEvent === void 0 ? void 0 : rootEvent.incompleteSubMeasurements)) {
16775            rootEvent.incompleteSubMeasurements.forEach(function (subMeasurement) {
16776                incompleteMeasurements.push(__assign$1({}, subMeasurement));
16777            });
16778        }
16779        // Clean up remaining marks for incomplete sub-measurements
16780        if (incompleteMeasurements.length > 0) {
16781            BrowserPerformanceMeasurement.flushMeasurements(inProgressEvent.event.correlationId, incompleteMeasurements);
16782        }
16783    };
16784    BrowserPerformanceClient.prototype.supportsBrowserPerformanceNow = function () {
16785        return typeof window !== "undefined" &&
16786            typeof window.performance !== "undefined" &&
16787            typeof window.performance.now === "function";
16788    };
16789    /**
16790     * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
16791     * Also captures browser page visibilityState.
16792     *
16793     * @param {PerformanceEvents} measureName
16794     * @param {?string} [correlationId]
16795     * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
16796     */
16797    BrowserPerformanceClient.prototype.startMeasurement = function (measureName, correlationId) {
16798        var _this = this;
16799        // Capture page visibilityState and then invoke start/end measurement
16800        var startPageVisibility = this.getPageVisibility();
16801        var inProgressEvent = _super.prototype.startMeasurement.call(this, measureName, correlationId);
16802        return __assign$1(__assign$1({}, inProgressEvent), { endMeasurement: function (event) {
16803                var res = inProgressEvent.endMeasurement(__assign$1({ startPageVisibility: startPageVisibility, endPageVisibility: _this.getPageVisibility() }, event));
16804                _this.deleteIncompleteSubMeasurements(inProgressEvent);
16805                return res;
16806            }, discardMeasurement: function () {
16807                inProgressEvent.discardMeasurement();
16808                _this.deleteIncompleteSubMeasurements(inProgressEvent);
16809                inProgressEvent.measurement.flushMeasurement();
16810            } });
16811    };
16812    /**
16813     * Adds pre-queue time to preQueueTimeByCorrelationId map.
16814     * @param {PerformanceEvents} eventName
16815     * @param {?string} correlationId
16816     * @returns
16817     */
16818    BrowserPerformanceClient.prototype.setPreQueueTime = function (eventName, correlationId) {
16819        if (!this.supportsBrowserPerformanceNow()) {
16820            this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for " + eventName);
16821            return;
16822        }
16823        if (!correlationId) {
16824            this.logger.trace("BrowserPerformanceClient: correlationId for " + eventName + " not provided, unable to set telemetry queue time");
16825            return;
16826        }
16827        var preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);
16828        /**
16829         * Manually complete queue measurement if there is an incomplete pre-queue event.
16830         * Incomplete pre-queue events are instrumentation bugs that should be fixed.
16831         */
16832        if (preQueueEvent) {
16833            this.logger.trace("BrowserPerformanceClient: Incomplete pre-queue " + preQueueEvent.name + " found", correlationId);
16834            this.addQueueMeasurement(preQueueEvent.name, correlationId, undefined, true);
16835        }
16836        this.preQueueTimeByCorrelationId.set(correlationId, { name: eventName, time: window.performance.now() });
16837    };
16838    /**
16839     * Calculates and adds queue time measurement for given performance event.
16840     *
16841     * @param {PerformanceEvents} eventName
16842     * @param {?string} correlationId
16843     * @param {?number} queueTime
16844     * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
16845     * @returns
16846     */
16847    BrowserPerformanceClient.prototype.addQueueMeasurement = function (eventName, correlationId, queueTime, manuallyCompleted) {
16848        if (!this.supportsBrowserPerformanceNow()) {
16849            this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to add queue measurement for " + eventName);
16850            return;
16851        }
16852        if (!correlationId) {
16853            this.logger.trace("BrowserPerformanceClient: correlationId for " + eventName + " not provided, unable to add queue measurement");
16854            return;
16855        }
16856        var preQueueTime = _super.prototype.getPreQueueTime.call(this, eventName, correlationId);
16857        if (!preQueueTime) {
16858            return;
16859        }
16860        var currentTime = window.performance.now();
16861        var resQueueTime = queueTime || _super.prototype.calculateQueuedTime.call(this, preQueueTime, currentTime);
16862        return _super.prototype.addQueueMeasurement.call(this, eventName, correlationId, resQueueTime, manuallyCompleted);
16863    };
16864    return BrowserPerformanceClient;
16865}(PerformanceClient));
16866
16867/*
16868 * Copyright (c) Microsoft Corporation. All rights reserved.
16869 * Licensed under the MIT License.
16870 */
16871
16872var internals = /*#__PURE__*/Object.freeze({
16873    __proto__: null,
16874    BrowserCacheManager: BrowserCacheManager,
16875    StandardInteractionClient: StandardInteractionClient,
16876    RedirectClient: RedirectClient,
16877    PopupClient: PopupClient,
16878    SilentIframeClient: SilentIframeClient,
16879    SilentCacheClient: SilentCacheClient,
16880    SilentRefreshClient: SilentRefreshClient,
16881    NativeInteractionClient: NativeInteractionClient,
16882    RedirectHandler: RedirectHandler,
16883    EventHandler: EventHandler,
16884    NativeMessageHandler: NativeMessageHandler,
16885    BrowserConstants: BrowserConstants,
16886    get TemporaryCacheKeys () { return TemporaryCacheKeys; },
16887    CryptoOps: CryptoOps,
16888    NativeAuthError: NativeAuthError,
16889    BrowserPerformanceClient: BrowserPerformanceClient,
16890    BrowserPerformanceMeasurement: BrowserPerformanceMeasurement
16891});
16892
16893/*
16894 * Copyright (c) Microsoft Corporation. All rights reserved.
16895 * Licensed under the MIT License.
16896 */
16897/**
16898 * Token cache manager
16899 */
16900var TokenCache = /** @class */ (function () {
16901    function TokenCache(configuration, storage, logger, cryptoObj) {
16902        this.isBrowserEnvironment = typeof window !== "undefined";
16903        this.config = configuration;
16904        this.storage = storage;
16905        this.logger = logger;
16906        this.cryptoObj = cryptoObj;
16907    }
16908    // Move getAllAccounts here and cache utility APIs
16909    /**
16910     * API to load tokens to msal-browser cache.
16911     * @param request
16912     * @param response
16913     * @param options
16914     * @returns `AuthenticationResult` for the response that was loaded.
16915     */
16916    TokenCache.prototype.loadExternalTokens = function (request, response, options) {
16917        this.logger.info("TokenCache - loadExternalTokens called");
16918        if (!response.id_token) {
16919            throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes id token.");
16920        }
16921        var idToken = new AuthToken(response.id_token, this.cryptoObj);
16922        var cacheRecord;
16923        var authority;
16924        var cacheRecordAccount;
16925        if (request.account) {
16926            cacheRecordAccount = AccountEntity.createFromAccountInfo(request.account);
16927            cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment));
16928        }
16929        else if (request.authority) {
16930            var authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);
16931            var authorityOptions = {
16932                protocolMode: this.config.auth.protocolMode,
16933                knownAuthorities: this.config.auth.knownAuthorities,
16934                cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
16935                authorityMetadata: this.config.auth.authorityMetadata,
16936                skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
16937            };
16938            authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.logger);
16939            // "clientInfo" from options takes precedence over "clientInfo" in response
16940            if (options.clientInfo) {
16941                this.logger.trace("TokenCache - homeAccountId from options");
16942                cacheRecordAccount = this.loadAccount(idToken, authority, options.clientInfo);
16943                cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
16944            }
16945            else if (response.client_info) {
16946                this.logger.trace("TokenCache - homeAccountId from response");
16947                cacheRecordAccount = this.loadAccount(idToken, authority, response.client_info);
16948                cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
16949            }
16950            else {
16951                throw BrowserAuthError.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");
16952            }
16953        }
16954        else {
16955            throw BrowserAuthError.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");
16956        }
16957        return this.generateAuthenticationResult(request, idToken, cacheRecord, cacheRecordAccount, authority);
16958    };
16959    /**
16960     * Helper function to load account to msal-browser cache
16961     * @param idToken
16962     * @param environment
16963     * @param clientInfo
16964     * @param authorityType
16965     * @param requestHomeAccountId
16966     * @returns `AccountEntity`
16967     */
16968    TokenCache.prototype.loadAccount = function (idToken, authority, clientInfo, requestHomeAccountId) {
16969        var homeAccountId;
16970        if (requestHomeAccountId) {
16971            homeAccountId = requestHomeAccountId;
16972        }
16973        else if (authority.authorityType !== undefined && clientInfo) {
16974            homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idToken.claims);
16975        }
16976        if (!homeAccountId) {
16977            throw BrowserAuthError.createUnableToLoadTokenError("Unexpected missing homeAccountId");
16978        }
16979        var accountEntity = AccountEntity.createAccount({ homeAccountId: homeAccountId, idTokenClaims: idToken.claims, clientInfo: clientInfo, environment: authority.hostnameAndPort }, authority);
16980        if (this.isBrowserEnvironment) {
16981            this.logger.verbose("TokenCache - loading account");
16982            this.storage.setAccount(accountEntity);
16983            return accountEntity;
16984        }
16985        else {
16986            throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
16987        }
16988    };
16989    /**
16990     * Helper function to load id tokens to msal-browser cache
16991     * @param idToken
16992     * @param homeAccountId
16993     * @param environment
16994     * @param tenantId
16995     * @returns `IdTokenEntity`
16996     */
16997    TokenCache.prototype.loadIdToken = function (idToken, homeAccountId, environment, tenantId) {
16998        var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken.rawToken, this.config.auth.clientId, tenantId);
16999        if (this.isBrowserEnvironment) {
17000            this.logger.verbose("TokenCache - loading id token");
17001            this.storage.setIdTokenCredential(idTokenEntity);
17002            return idTokenEntity;
17003        }
17004        else {
17005            throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
17006        }
17007    };
17008    /**
17009     * Helper function to load access tokens to msal-browser cache
17010     * @param request
17011     * @param response
17012     * @param homeAccountId
17013     * @param environment
17014     * @param tenantId
17015     * @returns `AccessTokenEntity`
17016     */
17017    TokenCache.prototype.loadAccessToken = function (request, response, homeAccountId, environment, tenantId, options) {
17018        if (!response.access_token) {
17019            this.logger.verbose("TokenCache - No access token provided for caching");
17020            return null;
17021        }
17022        if (!response.expires_in) {
17023            throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");
17024        }
17025        if (!options.extendedExpiresOn) {
17026            throw BrowserAuthError.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");
17027        }
17028        var scopes = new ScopeSet(request.scopes).printScopes();
17029        var expiresOn = options.expiresOn || (response.expires_in + new Date().getTime() / 1000);
17030        var extendedExpiresOn = options.extendedExpiresOn;
17031        var accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes, expiresOn, extendedExpiresOn, this.cryptoObj);
17032        if (this.isBrowserEnvironment) {
17033            this.logger.verbose("TokenCache - loading access token");
17034            this.storage.setAccessTokenCredential(accessTokenEntity);
17035            return accessTokenEntity;
17036        }
17037        else {
17038            throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
17039        }
17040    };
17041    /**
17042     * Helper function to load refresh tokens to msal-browser cache
17043     * @param request
17044     * @param response
17045     * @param homeAccountId
17046     * @param environment
17047     * @returns `RefreshTokenEntity`
17048     */
17049    TokenCache.prototype.loadRefreshToken = function (request, response, homeAccountId, environment) {
17050        if (!response.refresh_token) {
17051            this.logger.verbose("TokenCache - No refresh token provided for caching");
17052            return null;
17053        }
17054        var refreshTokenEntity = RefreshTokenEntity.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId);
17055        if (this.isBrowserEnvironment) {
17056            this.logger.verbose("TokenCache - loading refresh token");
17057            this.storage.setRefreshTokenCredential(refreshTokenEntity);
17058            return refreshTokenEntity;
17059        }
17060        else {
17061            throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
17062        }
17063    };
17064    /**
17065     * Helper function to generate an `AuthenticationResult` for the result.
17066     * @param request
17067     * @param idTokenObj
17068     * @param cacheRecord
17069     * @param accountEntity
17070     * @param authority
17071     * @returns `AuthenticationResult`
17072     */
17073    TokenCache.prototype.generateAuthenticationResult = function (request, idTokenObj, cacheRecord, accountEntity, authority) {
17074        var _a;
17075        var accessToken = Constants.EMPTY_STRING;
17076        var responseScopes = [];
17077        var expiresOn = null;
17078        var extExpiresOn;
17079        if (cacheRecord.accessToken) {
17080            accessToken = cacheRecord.accessToken.secret;
17081            responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
17082            expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
17083            extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
17084        }
17085        var uid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.oid) || (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.sub) || Constants.EMPTY_STRING;
17086        var tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;
17087        return {
17088            authority: authority ? authority.canonicalAuthority : Constants.EMPTY_STRING,
17089            uniqueId: uid,
17090            tenantId: tid,
17091            scopes: responseScopes,
17092            account: accountEntity ? accountEntity.getAccountInfo() : null,
17093            idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
17094            idTokenClaims: idTokenObj ? idTokenObj.claims : {},
17095            accessToken: accessToken,
17096            fromCache: true,
17097            expiresOn: expiresOn,
17098            correlationId: request.correlationId || Constants.EMPTY_STRING,
17099            requestId: Constants.EMPTY_STRING,
17100            extExpiresOn: extExpiresOn,
17101            familyId: Constants.EMPTY_STRING,
17102            tokenType: ((_a = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,
17103            state: Constants.EMPTY_STRING,
17104            cloudGraphHostName: accountEntity.cloudGraphHostName || Constants.EMPTY_STRING,
17105            msGraphHost: accountEntity.msGraphHost || Constants.EMPTY_STRING,
17106            code: undefined,
17107            fromNativeBroker: false
17108        };
17109    };
17110    return TokenCache;
17111}());
17112
17113/*
17114 * Copyright (c) Microsoft Corporation. All rights reserved.
17115 * Licensed under the MIT License.
17116 */
17117var HybridSpaAuthorizationCodeClient = /** @class */ (function (_super) {
17118    __extends$1(HybridSpaAuthorizationCodeClient, _super);
17119    function HybridSpaAuthorizationCodeClient(config) {
17120        var _this = _super.call(this, config) || this;
17121        _this.includeRedirectUri = false;
17122        return _this;
17123    }
17124    return HybridSpaAuthorizationCodeClient;
17125}(AuthorizationCodeClient));
17126
17127/*
17128 * Copyright (c) Microsoft Corporation. All rights reserved.
17129 * Licensed under the MIT License.
17130 */
17131var SilentAuthCodeClient = /** @class */ (function (_super) {
17132    __extends$1(SilentAuthCodeClient, _super);
17133    function SilentAuthCodeClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeMessageHandler, correlationId) {
17134        var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;
17135        _this.apiId = apiId;
17136        return _this;
17137    }
17138    /**
17139     * Acquires a token silently by redeeming an authorization code against the /token endpoint
17140     * @param request
17141     */
17142    SilentAuthCodeClient.prototype.acquireToken = function (request) {
17143        return __awaiter$1(this, void 0, void 0, function () {
17144            var silentRequest, serverTelemetryManager, authCodeRequest, clientConfig, authClient, silentHandler, e_1;
17145            return __generator$1(this, function (_a) {
17146                switch (_a.label) {
17147                    case 0:
17148                        this.logger.trace("SilentAuthCodeClient.acquireToken called");
17149                        // Auth code payload is required
17150                        if (!request.code) {
17151                            throw BrowserAuthError.createAuthCodeRequiredError();
17152                        }
17153                        // Create silent request
17154                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
17155                        return [4 /*yield*/, this.initializeAuthorizationRequest(request, exports.InteractionType.Silent)];
17156                    case 1:
17157                        silentRequest = _a.sent();
17158                        this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);
17159                        serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
17160                        _a.label = 2;
17161                    case 2:
17162                        _a.trys.push([2, 4, , 5]);
17163                        authCodeRequest = __assign$1(__assign$1({}, silentRequest), { code: request.code });
17164                        // Initialize the client
17165                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);
17166                        return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, silentRequest.authority)];
17167                    case 3:
17168                        clientConfig = _a.sent();
17169                        authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
17170                        this.logger.verbose("Auth code client created");
17171                        silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);
17172                        // Handle auth code parameters from request
17173                        return [2 /*return*/, silentHandler.handleCodeResponseFromServer({
17174                                code: request.code,
17175                                msgraph_host: request.msGraphHost,
17176                                cloud_graph_host_name: request.cloudGraphHostName,
17177                                cloud_instance_host_name: request.cloudInstanceHostName
17178                            }, silentRequest.state, authClient.authority, this.networkClient, false)];
17179                    case 4:
17180                        e_1 = _a.sent();
17181                        if (e_1 instanceof AuthError) {
17182                            e_1.setCorrelationId(this.correlationId);
17183                        }
17184                        serverTelemetryManager.cacheFailedRequest(e_1);
17185                        this.browserStorage.cleanRequestByState(silentRequest.state);
17186                        throw e_1;
17187                    case 5: return [2 /*return*/];
17188                }
17189            });
17190        });
17191    };
17192    /**
17193     * Currently Unsupported
17194     */
17195    SilentAuthCodeClient.prototype.logout = function () {
17196        // Synchronous so we must reject
17197        return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());
17198    };
17199    return SilentAuthCodeClient;
17200}(StandardInteractionClient));
17201
17202/*
17203 * Copyright (c) Microsoft Corporation. All rights reserved.
17204 * Licensed under the MIT License.
17205 */
17206var ClientApplication = /** @class */ (function () {
17207    /**
17208     * @constructor
17209     * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
17210     *
17211     * Important attributes in the Configuration object for auth are:
17212     * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
17213     * - authority: the authority URL for your application.
17214     * - redirect_uri: the uri of your application registered in the portal.
17215     *
17216     * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
17217     * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
17218     * If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
17219     * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
17220     * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
17221     * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
17222     *
17223     * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
17224     * Full B2C functionality will be available in this library in future versions.
17225     *
17226     * @param configuration Object for the MSAL PublicClientApplication instance
17227     */
17228    function ClientApplication(configuration) {
17229        /*
17230         * If loaded in an environment where window is not available,
17231         * set internal flag to false so that further requests fail.
17232         * This is to support server-side rendering environments.
17233         */
17234        this.isBrowserEnvironment = typeof window !== "undefined";
17235        // Set the configuration.
17236        this.config = buildConfiguration(configuration, this.isBrowserEnvironment);
17237        this.initialized = false;
17238        // Initialize logger
17239        this.logger = new Logger(this.config.system.loggerOptions, name, version);
17240        // Initialize the network module class.
17241        this.networkClient = this.config.system.networkClient;
17242        // Initialize the navigation client class.
17243        this.navigationClient = this.config.system.navigationClient;
17244        // Initialize redirectResponse Map
17245        this.redirectResponse = new Map();
17246        // Initial hybrid spa map
17247        this.hybridAuthCodeResponses = new Map();
17248        // Initialize performance client
17249        this.performanceClient = this.isBrowserEnvironment ?
17250            new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application, this.config.system.cryptoOptions) :
17251            new StubPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application);
17252        // Initialize the crypto class.
17253        this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger, this.performanceClient, this.config.system.cryptoOptions) : DEFAULT_CRYPTO_IMPLEMENTATION;
17254        this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
17255        // Initialize the browser storage class.
17256        this.browserStorage = this.isBrowserEnvironment ?
17257            new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger) :
17258            DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
17259        // initialize in memory storage for native flows
17260        var nativeCacheOptions = {
17261            cacheLocation: exports.BrowserCacheLocation.MemoryStorage,
17262            temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
17263            storeAuthStateInCookie: false,
17264            secureCookies: false,
17265            cacheMigrationEnabled: false,
17266            claimsBasedCachingEnabled: true
17267        };
17268        this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);
17269        // Initialize the token cache
17270        this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);
17271        // Register listener functions
17272        this.trackPageVisibilityWithMeasurement = this.trackPageVisibilityWithMeasurement.bind(this);
17273    }
17274    /**
17275     * Initializer function to perform async startup tasks such as connecting to WAM extension
17276     */
17277    ClientApplication.prototype.initialize = function () {
17278        return __awaiter$1(this, void 0, void 0, function () {
17279            var allowNativeBroker, initMeasurement, _a, e_1, claimsTokensRemovalMeasurement;
17280            return __generator$1(this, function (_b) {
17281                switch (_b.label) {
17282                    case 0:
17283                        this.logger.trace("initialize called");
17284                        if (this.initialized) {
17285                            this.logger.info("initialize has already been called, exiting early.");
17286                            return [2 /*return*/];
17287                        }
17288                        allowNativeBroker = this.config.system.allowNativeBroker;
17289                        initMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.InitializeClientApplication);
17290                        this.eventHandler.emitEvent(exports.EventType.INITIALIZE_START);
17291                        if (!allowNativeBroker) return [3 /*break*/, 4];
17292                        _b.label = 1;
17293                    case 1:
17294                        _b.trys.push([1, 3, , 4]);
17295                        _a = this;
17296                        return [4 /*yield*/, NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout, this.performanceClient)];
17297                    case 2:
17298                        _a.nativeExtensionProvider = _b.sent();
17299                        return [3 /*break*/, 4];
17300                    case 3:
17301                        e_1 = _b.sent();
17302                        this.logger.verbose(e_1);
17303                        return [3 /*break*/, 4];
17304                    case 4:
17305                        if (!!this.config.cache.claimsBasedCachingEnabled) return [3 /*break*/, 6];
17306                        this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims");
17307                        claimsTokensRemovalMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.ClearTokensAndKeysWithClaims);
17308                        return [4 /*yield*/, this.browserStorage.clearTokensAndKeysWithClaims()];
17309                    case 5:
17310                        _b.sent();
17311                        claimsTokensRemovalMeasurement.endMeasurement({ success: true });
17312                        _b.label = 6;
17313                    case 6:
17314                        this.initialized = true;
17315                        this.eventHandler.emitEvent(exports.EventType.INITIALIZE_END);
17316                        initMeasurement.endMeasurement({ allowNativeBroker: allowNativeBroker, success: true });
17317                        return [2 /*return*/];
17318                }
17319            });
17320        });
17321    };
17322    // #region Redirect Flow
17323    /**
17324     * Event handler function which allows users to fire events after the PublicClientApplication object
17325     * has loaded during redirect flows. This should be invoked on all page loads involved in redirect
17326     * auth flows.
17327     * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
17328     * @returns Token response or null. If the return value is null, then no auth redirect was detected.
17329     */
17330    ClientApplication.prototype.handleRedirectPromise = function (hash) {
17331        return __awaiter$1(this, void 0, void 0, function () {
17332            var loggedInAccounts, redirectResponseKey, response, request, redirectResponse, nativeClient, correlationId, redirectClient;
17333            var _this = this;
17334            return __generator$1(this, function (_a) {
17335                this.logger.verbose("handleRedirectPromise called");
17336                // Block token acquisition before initialize has been called if native brokering is enabled
17337                BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);
17338                loggedInAccounts = this.getAllAccounts();
17339                if (this.isBrowserEnvironment) {
17340                    redirectResponseKey = hash || Constants.EMPTY_STRING;
17341                    response = this.redirectResponse.get(redirectResponseKey);
17342                    if (typeof response === "undefined") {
17343                        this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_START, exports.InteractionType.Redirect);
17344                        this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise");
17345                        request = this.browserStorage.getCachedNativeRequest();
17346                        redirectResponse = void 0;
17347                        if (request && NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider) && this.nativeExtensionProvider && !hash) {
17348                            this.logger.trace("handleRedirectPromise - acquiring token from native platform");
17349                            nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, this.nativeInternalStorage, request.correlationId);
17350                            redirectResponse = nativeClient.handleRedirectPromise();
17351                        }
17352                        else {
17353                            this.logger.trace("handleRedirectPromise - acquiring token from web flow");
17354                            correlationId = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || Constants.EMPTY_STRING;
17355                            redirectClient = this.createRedirectClient(correlationId);
17356                            redirectResponse = redirectClient.handleRedirectPromise(hash);
17357                        }
17358                        response = redirectResponse.then(function (result) {
17359                            if (result) {
17360                                // Emit login event if number of accounts change
17361                                var isLoggingIn = loggedInAccounts.length < _this.getAllAccounts().length;
17362                                if (isLoggingIn) {
17363                                    _this.eventHandler.emitEvent(exports.EventType.LOGIN_SUCCESS, exports.InteractionType.Redirect, result);
17364                                    _this.logger.verbose("handleRedirectResponse returned result, login success");
17365                                }
17366                                else {
17367                                    _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Redirect, result);
17368                                    _this.logger.verbose("handleRedirectResponse returned result, acquire token success");
17369                                }
17370                            }
17371                            _this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
17372                            return result;
17373                        }).catch(function (e) {
17374                            // Emit login event if there is an account
17375                            if (loggedInAccounts.length > 0) {
17376                                _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
17377                            }
17378                            else {
17379                                _this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
17380                            }
17381                            _this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
17382                            throw e;
17383                        });
17384                        this.redirectResponse.set(redirectResponseKey, response);
17385                    }
17386                    else {
17387                        this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call");
17388                    }
17389                    return [2 /*return*/, response];
17390                }
17391                this.logger.verbose("handleRedirectPromise returns null, not browser environment");
17392                return [2 /*return*/, null];
17393            });
17394        });
17395    };
17396    /**
17397     * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
17398     * the page, so any code that follows this function will not execute.
17399     *
17400     * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
17401     * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
17402     *
17403     * @param request
17404     */
17405    ClientApplication.prototype.acquireTokenRedirect = function (request) {
17406        return __awaiter$1(this, void 0, void 0, function () {
17407            var correlationId, isLoggedIn, result, nativeClient, redirectClient;
17408            var _this = this;
17409            return __generator$1(this, function (_a) {
17410                correlationId = this.getRequestCorrelationId(request);
17411                this.logger.verbose("acquireTokenRedirect called", correlationId);
17412                this.preflightBrowserEnvironmentCheck(exports.InteractionType.Redirect);
17413                isLoggedIn = this.getAllAccounts().length > 0;
17414                if (isLoggedIn) {
17415                    this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Redirect, request);
17416                }
17417                else {
17418                    this.eventHandler.emitEvent(exports.EventType.LOGIN_START, exports.InteractionType.Redirect, request);
17419                }
17420                if (this.nativeExtensionProvider && this.canUseNative(request)) {
17421                    nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);
17422                    result = nativeClient.acquireTokenRedirect(request).catch(function (e) {
17423                        if (e instanceof NativeAuthError && e.isFatal()) {
17424                            _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
17425                            var redirectClient = _this.createRedirectClient(request.correlationId);
17426                            return redirectClient.acquireToken(request);
17427                        }
17428                        else if (e instanceof InteractionRequiredAuthError) {
17429                            _this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");
17430                            var redirectClient = _this.createRedirectClient(request.correlationId);
17431                            return redirectClient.acquireToken(request);
17432                        }
17433                        _this.browserStorage.setInteractionInProgress(false);
17434                        throw e;
17435                    });
17436                }
17437                else {
17438                    redirectClient = this.createRedirectClient(request.correlationId);
17439                    result = redirectClient.acquireToken(request);
17440                }
17441                return [2 /*return*/, result.catch(function (e) {
17442                        // If logged in, emit acquire token events
17443                        if (isLoggedIn) {
17444                            _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
17445                        }
17446                        else {
17447                            _this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
17448                        }
17449                        throw e;
17450                    })];
17451            });
17452        });
17453    };
17454    // #endregion
17455    // #region Popup Flow
17456    /**
17457     * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
17458     *
17459     * @param request
17460     *
17461     * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
17462     */
17463    ClientApplication.prototype.acquireTokenPopup = function (request) {
17464        var _this = this;
17465        var correlationId = this.getRequestCorrelationId(request);
17466        var atPopupMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenPopup, correlationId);
17467        try {
17468            this.logger.verbose("acquireTokenPopup called", correlationId);
17469            this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
17470        }
17471        catch (e) {
17472            // Since this function is syncronous we need to reject
17473            return Promise.reject(e);
17474        }
17475        // If logged in, emit acquire token events
17476        var loggedInAccounts = this.getAllAccounts();
17477        if (loggedInAccounts.length > 0) {
17478            this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Popup, request);
17479        }
17480        else {
17481            this.eventHandler.emitEvent(exports.EventType.LOGIN_START, exports.InteractionType.Popup, request);
17482        }
17483        var result;
17484        if (this.canUseNative(request)) {
17485            result = this.acquireTokenNative(request, exports.ApiId.acquireTokenPopup).then(function (response) {
17486                _this.browserStorage.setInteractionInProgress(false);
17487                atPopupMeasurement.endMeasurement({
17488                    success: true,
17489                    isNativeBroker: true,
17490                    requestId: response.requestId
17491                });
17492                return response;
17493            }).catch(function (e) {
17494                if (e instanceof NativeAuthError && e.isFatal()) {
17495                    _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
17496                    var popupClient = _this.createPopupClient(request.correlationId);
17497                    return popupClient.acquireToken(request);
17498                }
17499                else if (e instanceof InteractionRequiredAuthError) {
17500                    _this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");
17501                    var popupClient = _this.createPopupClient(request.correlationId);
17502                    return popupClient.acquireToken(request);
17503                }
17504                _this.browserStorage.setInteractionInProgress(false);
17505                throw e;
17506            });
17507        }
17508        else {
17509            var popupClient = this.createPopupClient(request.correlationId);
17510            result = popupClient.acquireToken(request);
17511        }
17512        return result.then(function (result) {
17513            /*
17514             *  If logged in, emit acquire token events
17515             */
17516            var isLoggingIn = loggedInAccounts.length < _this.getAllAccounts().length;
17517            if (isLoggingIn) {
17518                _this.eventHandler.emitEvent(exports.EventType.LOGIN_SUCCESS, exports.InteractionType.Popup, result);
17519            }
17520            else {
17521                _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
17522            }
17523            atPopupMeasurement.addStaticFields({
17524                accessTokenSize: result.accessToken.length,
17525                idTokenSize: result.idToken.length
17526            });
17527            atPopupMeasurement.endMeasurement({
17528                success: true,
17529                requestId: result.requestId
17530            });
17531            return result;
17532        }).catch(function (e) {
17533            if (loggedInAccounts.length > 0) {
17534                _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Popup, null, e);
17535            }
17536            else {
17537                _this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Popup, null, e);
17538            }
17539            atPopupMeasurement.endMeasurement({
17540                errorCode: e.errorCode,
17541                subErrorCode: e.subError,
17542                success: false
17543            });
17544            // Since this function is syncronous we need to reject
17545            return Promise.reject(e);
17546        });
17547    };
17548    ClientApplication.prototype.trackPageVisibilityWithMeasurement = function () {
17549        var measurement = this.ssoSilentMeasurement || this.acquireTokenByCodeAsyncMeasurement;
17550        if (!measurement) {
17551            return;
17552        }
17553        this.logger.info("Perf: Visibility change detected in ", measurement.event.name);
17554        measurement.increment({
17555            visibilityChangeCount: 1,
17556        });
17557    };
17558    // #endregion
17559    // #region Silent Flow
17560    /**
17561     * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
17562     * - Any browser using a form of Intelligent Tracking Prevention
17563     * - If there is not an established session with the service
17564     *
17565     * In these cases, the request must be done inside a popup or full frame redirect.
17566     *
17567     * For the cases where interaction is required, you cannot send a request with prompt=none.
17568     *
17569     * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
17570     * you session on the server still exists.
17571     * @param request {@link SsoSilentRequest}
17572     *
17573     * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
17574     */
17575    ClientApplication.prototype.ssoSilent = function (request) {
17576        var _a;
17577        return __awaiter$1(this, void 0, void 0, function () {
17578            var correlationId, validRequest, result, silentIframeClient;
17579            var _this = this;
17580            return __generator$1(this, function (_b) {
17581                correlationId = this.getRequestCorrelationId(request);
17582                validRequest = __assign$1(__assign$1({}, request), { 
17583                    // will be PromptValue.NONE or PromptValue.NO_SESSION
17584                    prompt: request.prompt, correlationId: correlationId });
17585                this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
17586                this.ssoSilentMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SsoSilent, correlationId);
17587                (_a = this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.increment({
17588                    visibilityChangeCount: 0
17589                });
17590                document.addEventListener("visibilitychange", this.trackPageVisibilityWithMeasurement);
17591                this.logger.verbose("ssoSilent called", correlationId);
17592                this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
17593                if (this.canUseNative(validRequest)) {
17594                    result = this.acquireTokenNative(validRequest, exports.ApiId.ssoSilent).catch(function (e) {
17595                        // If native token acquisition fails for availability reasons fallback to standard flow
17596                        if (e instanceof NativeAuthError && e.isFatal()) {
17597                            _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
17598                            var silentIframeClient = _this.createSilentIframeClient(validRequest.correlationId);
17599                            return silentIframeClient.acquireToken(validRequest);
17600                        }
17601                        throw e;
17602                    });
17603                }
17604                else {
17605                    silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);
17606                    result = silentIframeClient.acquireToken(validRequest);
17607                }
17608                return [2 /*return*/, result.then(function (response) {
17609                        var _a, _b;
17610                        _this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
17611                        (_a = _this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.addStaticFields({
17612                            accessTokenSize: response.accessToken.length,
17613                            idTokenSize: response.idToken.length
17614                        });
17615                        (_b = _this.ssoSilentMeasurement) === null || _b === void 0 ? void 0 : _b.endMeasurement({
17616                            success: true,
17617                            isNativeBroker: response.fromNativeBroker,
17618                            requestId: response.requestId
17619                        });
17620                        return response;
17621                    }).catch(function (e) {
17622                        var _a;
17623                        _this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_FAILURE, exports.InteractionType.Silent, null, e);
17624                        (_a = _this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({
17625                            errorCode: e.errorCode,
17626                            subErrorCode: e.subError,
17627                            success: false
17628                        });
17629                        throw e;
17630                    }).finally(function () {
17631                        document.removeEventListener("visibilitychange", _this.trackPageVisibilityWithMeasurement);
17632                    })];
17633            });
17634        });
17635    };
17636    /**
17637     * This function redeems an authorization code (passed as code) from the eSTS token endpoint.
17638     * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
17639     * This API is not indended for normal authorization code acquisition and redemption.
17640     *
17641     * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
17642     *
17643     * @param request {@link AuthorizationCodeRequest}
17644     * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
17645     */
17646    ClientApplication.prototype.acquireTokenByCode = function (request) {
17647        return __awaiter$1(this, void 0, void 0, function () {
17648            var correlationId, atbcMeasurement, hybridAuthCode_1, response;
17649            var _this = this;
17650            return __generator$1(this, function (_a) {
17651                correlationId = this.getRequestCorrelationId(request);
17652                this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
17653                this.logger.trace("acquireTokenByCode called", correlationId);
17654                this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
17655                atbcMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenByCode, request.correlationId);
17656                try {
17657                    if (request.code && request.nativeAccountId) {
17658                        // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.
17659                        throw BrowserAuthError.createSpaCodeAndNativeAccountIdPresentError();
17660                    }
17661                    else if (request.code) {
17662                        hybridAuthCode_1 = request.code;
17663                        response = this.hybridAuthCodeResponses.get(hybridAuthCode_1);
17664                        if (!response) {
17665                            this.logger.verbose("Initiating new acquireTokenByCode request", correlationId);
17666                            response = this.acquireTokenByCodeAsync(__assign$1(__assign$1({}, request), { correlationId: correlationId }))
17667                                .then(function (result) {
17668                                _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
17669                                _this.hybridAuthCodeResponses.delete(hybridAuthCode_1);
17670                                atbcMeasurement.addStaticFields({
17671                                    accessTokenSize: result.accessToken.length,
17672                                    idTokenSize: result.idToken.length
17673                                });
17674                                atbcMeasurement.endMeasurement({
17675                                    success: true,
17676                                    isNativeBroker: result.fromNativeBroker,
17677                                    requestId: result.requestId
17678                                });
17679                                return result;
17680                            })
17681                                .catch(function (error) {
17682                                _this.hybridAuthCodeResponses.delete(hybridAuthCode_1);
17683                                _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, error);
17684                                atbcMeasurement.endMeasurement({
17685                                    errorCode: error.errorCode,
17686                                    subErrorCode: error.subError,
17687                                    success: false
17688                                });
17689                                throw error;
17690                            });
17691                            this.hybridAuthCodeResponses.set(hybridAuthCode_1, response);
17692                        }
17693                        else {
17694                            this.logger.verbose("Existing acquireTokenByCode request found", request.correlationId);
17695                            atbcMeasurement.discardMeasurement();
17696                        }
17697                        return [2 /*return*/, response];
17698                    }
17699                    else if (request.nativeAccountId) {
17700                        if (this.canUseNative(request, request.nativeAccountId)) {
17701                            return [2 /*return*/, this.acquireTokenNative(request, exports.ApiId.acquireTokenByCode, request.nativeAccountId).catch(function (e) {
17702                                    // If native token acquisition fails for availability reasons fallback to standard flow
17703                                    if (e instanceof NativeAuthError && e.isFatal()) {
17704                                        _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
17705                                    }
17706                                    throw e;
17707                                })];
17708                        }
17709                        else {
17710                            throw BrowserAuthError.createUnableToAcquireTokenFromNativePlatformError();
17711                        }
17712                    }
17713                    else {
17714                        throw BrowserAuthError.createAuthCodeOrNativeAccountIdRequiredError();
17715                    }
17716                }
17717                catch (e) {
17718                    this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, e);
17719                    atbcMeasurement.endMeasurement({
17720                        errorCode: e instanceof AuthError && e.errorCode || undefined,
17721                        subErrorCode: e instanceof AuthError && e.subError || undefined,
17722                        success: false
17723                    });
17724                    throw e;
17725                }
17726                return [2 /*return*/];
17727            });
17728        });
17729    };
17730    /**
17731     * Creates a SilentAuthCodeClient to redeem an authorization code.
17732     * @param request
17733     * @returns Result of the operation to redeem the authorization code
17734     */
17735    ClientApplication.prototype.acquireTokenByCodeAsync = function (request) {
17736        var _a;
17737        return __awaiter$1(this, void 0, void 0, function () {
17738            var silentAuthCodeClient, silentTokenResult;
17739            var _this = this;
17740            return __generator$1(this, function (_b) {
17741                switch (_b.label) {
17742                    case 0:
17743                        this.logger.trace("acquireTokenByCodeAsync called", request.correlationId);
17744                        this.acquireTokenByCodeAsyncMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);
17745                        (_a = this.acquireTokenByCodeAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.increment({
17746                            visibilityChangeCount: 0
17747                        });
17748                        document.addEventListener("visibilitychange", this.trackPageVisibilityWithMeasurement);
17749                        silentAuthCodeClient = this.createSilentAuthCodeClient(request.correlationId);
17750                        return [4 /*yield*/, silentAuthCodeClient.acquireToken(request).then(function (response) {
17751                                var _a;
17752                                (_a = _this.acquireTokenByCodeAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({
17753                                    success: true,
17754                                    fromCache: response.fromCache,
17755                                    isNativeBroker: response.fromNativeBroker,
17756                                    requestId: response.requestId
17757                                });
17758                                return response;
17759                            }).catch(function (tokenRenewalError) {
17760                                var _a;
17761                                (_a = _this.acquireTokenByCodeAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({
17762                                    errorCode: tokenRenewalError.errorCode,
17763                                    subErrorCode: tokenRenewalError.subError,
17764                                    success: false
17765                                });
17766                                throw tokenRenewalError;
17767                            }).finally(function () {
17768                                document.removeEventListener("visibilitychange", _this.trackPageVisibilityWithMeasurement);
17769                            })];
17770                    case 1:
17771                        silentTokenResult = _b.sent();
17772                        return [2 /*return*/, silentTokenResult];
17773                }
17774            });
17775        });
17776    };
17777    /**
17778     * Attempt to acquire an access token from the cache
17779     * @param silentCacheClient SilentCacheClient
17780     * @param commonRequest CommonSilentFlowRequest
17781     * @param silentRequest SilentRequest
17782     * @returns A promise that, when resolved, returns the access token
17783     */
17784    ClientApplication.prototype.acquireTokenFromCache = function (silentCacheClient, commonRequest, silentRequest) {
17785        return __awaiter$1(this, void 0, void 0, function () {
17786            return __generator$1(this, function (_a) {
17787                this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);
17788                switch (silentRequest.cacheLookupPolicy) {
17789                    case exports.CacheLookupPolicy.Default:
17790                    case exports.CacheLookupPolicy.AccessToken:
17791                    case exports.CacheLookupPolicy.AccessTokenAndRefreshToken:
17792                        return [2 /*return*/, silentCacheClient.acquireToken(commonRequest)];
17793                    default:
17794                        throw ClientAuthError.createRefreshRequiredError();
17795                }
17796                return [2 /*return*/];
17797            });
17798        });
17799    };
17800    /**
17801     * Attempt to acquire an access token via a refresh token
17802     * @param commonRequest CommonSilentFlowRequest
17803     * @param silentRequest SilentRequest
17804     * @returns A promise that, when resolved, returns the access token
17805     */
17806    ClientApplication.prototype.acquireTokenByRefreshToken = function (commonRequest, silentRequest) {
17807        return __awaiter$1(this, void 0, void 0, function () {
17808            var silentRefreshClient;
17809            return __generator$1(this, function (_a) {
17810                this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);
17811                switch (silentRequest.cacheLookupPolicy) {
17812                    case exports.CacheLookupPolicy.Default:
17813                    case exports.CacheLookupPolicy.AccessTokenAndRefreshToken:
17814                    case exports.CacheLookupPolicy.RefreshToken:
17815                    case exports.CacheLookupPolicy.RefreshTokenAndNetwork:
17816                        silentRefreshClient = this.createSilentRefreshClient(commonRequest.correlationId);
17817                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentRefreshClientAcquireToken, commonRequest.correlationId);
17818                        return [2 /*return*/, silentRefreshClient.acquireToken(commonRequest)];
17819                    default:
17820                        throw ClientAuthError.createRefreshRequiredError();
17821                }
17822                return [2 /*return*/];
17823            });
17824        });
17825    };
17826    /**
17827     * Attempt to acquire an access token via an iframe
17828     * @param request CommonSilentFlowRequest
17829     * @returns A promise that, when resolved, returns the access token
17830     */
17831    ClientApplication.prototype.acquireTokenBySilentIframe = function (request) {
17832        return __awaiter$1(this, void 0, void 0, function () {
17833            var silentIframeClient;
17834            return __generator$1(this, function (_a) {
17835                this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);
17836                silentIframeClient = this.createSilentIframeClient(request.correlationId);
17837                this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
17838                return [2 /*return*/, silentIframeClient.acquireToken(request)];
17839            });
17840        });
17841    };
17842    // #endregion
17843    // #region Logout
17844    /**
17845     * Deprecated logout function. Use logoutRedirect or logoutPopup instead
17846     * @param logoutRequest
17847     * @deprecated
17848     */
17849    ClientApplication.prototype.logout = function (logoutRequest) {
17850        return __awaiter$1(this, void 0, void 0, function () {
17851            var correlationId;
17852            return __generator$1(this, function (_a) {
17853                correlationId = this.getRequestCorrelationId(logoutRequest);
17854                this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.", correlationId);
17855                return [2 /*return*/, this.logoutRedirect(__assign$1({ correlationId: correlationId }, logoutRequest))];
17856            });
17857        });
17858    };
17859    /**
17860     * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
17861     * Default behaviour is to redirect the user to `window.location.href`.
17862     * @param logoutRequest
17863     */
17864    ClientApplication.prototype.logoutRedirect = function (logoutRequest) {
17865        return __awaiter$1(this, void 0, void 0, function () {
17866            var correlationId, redirectClient;
17867            return __generator$1(this, function (_a) {
17868                correlationId = this.getRequestCorrelationId(logoutRequest);
17869                this.preflightBrowserEnvironmentCheck(exports.InteractionType.Redirect);
17870                redirectClient = this.createRedirectClient(correlationId);
17871                return [2 /*return*/, redirectClient.logout(logoutRequest)];
17872            });
17873        });
17874    };
17875    /**
17876     * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
17877     * @param logoutRequest
17878     */
17879    ClientApplication.prototype.logoutPopup = function (logoutRequest) {
17880        try {
17881            var correlationId = this.getRequestCorrelationId(logoutRequest);
17882            this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
17883            var popupClient = this.createPopupClient(correlationId);
17884            return popupClient.logout(logoutRequest);
17885        }
17886        catch (e) {
17887            // Since this function is syncronous we need to reject
17888            return Promise.reject(e);
17889        }
17890    };
17891    // #endregion
17892    // #region Account APIs
17893    /**
17894     * Returns all accounts that MSAL currently has data for.
17895     * (the account object is created at the time of successful login)
17896     * or empty array when no accounts are found
17897     * @returns Array of account objects in cache
17898     */
17899    ClientApplication.prototype.getAllAccounts = function () {
17900        this.logger.verbose("getAllAccounts called");
17901        return this.isBrowserEnvironment ? this.browserStorage.getAllAccounts() : [];
17902    };
17903    /**
17904     * Returns the signed in account matching username.
17905     * (the account object is created at the time of successful login)
17906     * or null when no matching account is found.
17907     * This API is provided for convenience but getAccountById should be used for best reliability
17908     * @param username
17909     * @returns The account object stored in MSAL
17910     */
17911    ClientApplication.prototype.getAccountByUsername = function (username) {
17912        this.logger.trace("getAccountByUsername called");
17913        if (!username) {
17914            this.logger.warning("getAccountByUsername: No username provided");
17915            return null;
17916        }
17917        var account = this.browserStorage.getAccountInfoFilteredBy({ username: username });
17918        if (account) {
17919            this.logger.verbose("getAccountByUsername: Account matching username found, returning");
17920            this.logger.verbosePii("getAccountByUsername: Returning signed-in accounts matching username: " + username);
17921            return account;
17922        }
17923        else {
17924            this.logger.verbose("getAccountByUsername: No matching account found, returning null");
17925            return null;
17926        }
17927    };
17928    /**
17929     * Returns the signed in account matching homeAccountId.
17930     * (the account object is created at the time of successful login)
17931     * or null when no matching account is found
17932     * @param homeAccountId
17933     * @returns The account object stored in MSAL
17934     */
17935    ClientApplication.prototype.getAccountByHomeId = function (homeAccountId) {
17936        this.logger.trace("getAccountByHomeId called");
17937        if (!homeAccountId) {
17938            this.logger.warning("getAccountByHomeId: No homeAccountId provided");
17939            return null;
17940        }
17941        var account = this.browserStorage.getAccountInfoFilteredBy({ homeAccountId: homeAccountId });
17942        if (account) {
17943            this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning");
17944            this.logger.verbosePii("getAccountByHomeId: Returning signed-in accounts matching homeAccountId: " + homeAccountId);
17945            return account;
17946        }
17947        else {
17948            this.logger.verbose("getAccountByHomeId: No matching account found, returning null");
17949            return null;
17950        }
17951    };
17952    /**
17953     * Returns the signed in account matching localAccountId.
17954     * (the account object is created at the time of successful login)
17955     * or null when no matching account is found
17956     * @param localAccountId
17957     * @returns The account object stored in MSAL
17958     */
17959    ClientApplication.prototype.getAccountByLocalId = function (localAccountId) {
17960        this.logger.trace("getAccountByLocalId called");
17961        if (!localAccountId) {
17962            this.logger.warning("getAccountByLocalId: No localAccountId provided");
17963            return null;
17964        }
17965        var account = this.browserStorage.getAccountInfoFilteredBy({ localAccountId: localAccountId });
17966        if (account) {
17967            this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning");
17968            this.logger.verbosePii("getAccountByLocalId: Returning signed-in accounts matching localAccountId: " + localAccountId);
17969            return account;
17970        }
17971        else {
17972            this.logger.verbose("getAccountByLocalId: No matching account found, returning null");
17973            return null;
17974        }
17975    };
17976    /**
17977     * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
17978     * @param account
17979     */
17980    ClientApplication.prototype.setActiveAccount = function (account) {
17981        this.browserStorage.setActiveAccount(account);
17982    };
17983    /**
17984     * Gets the currently active account
17985     */
17986    ClientApplication.prototype.getActiveAccount = function () {
17987        return this.browserStorage.getActiveAccount();
17988    };
17989    // #endregion
17990    // #region Helpers
17991    /**
17992     * Helper to validate app environment before making an auth request
17993     *
17994     * @protected
17995     * @param {InteractionType} interactionType What kind of interaction is being used
17996     * @param {boolean} [setInteractionInProgress=true] Whether to set interaction in progress temp cache flag
17997     */
17998    ClientApplication.prototype.preflightBrowserEnvironmentCheck = function (interactionType, setInteractionInProgress) {
17999        if (setInteractionInProgress === void 0) { setInteractionInProgress = true; }
18000        this.logger.verbose("preflightBrowserEnvironmentCheck started");
18001        // Block request if not in browser environment
18002        BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);
18003        // Block redirects if in an iframe
18004        BrowserUtils.blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);
18005        // Block auth requests inside a hidden iframe
18006        BrowserUtils.blockReloadInHiddenIframes();
18007        // Block redirectUri opened in a popup from calling MSAL APIs
18008        BrowserUtils.blockAcquireTokenInPopups();
18009        // Block token acquisition before initialize has been called 
vendor: 15,594 bytes, lines 18009-18315
18009if native brokering is enabled
18010        BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);
18011        // Block redirects if memory storage is enabled but storeAuthStateInCookie is not
18012        if (interactionType === exports.InteractionType.Redirect &&
18013            this.config.cache.cacheLocation === exports.BrowserCacheLocation.MemoryStorage &&
18014            !this.config.cache.storeAuthStateInCookie) {
18015            throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();
18016        }
18017        if (interactionType === exports.InteractionType.Redirect || interactionType === exports.InteractionType.Popup) {
18018            this.preflightInteractiveRequest(setInteractionInProgress);
18019        }
18020    };
18021    /**
18022     * Preflight check for interactive requests
18023     *
18024     * @protected
18025     * @param {boolean} setInteractionInProgress Whether to set interaction in progress temp cache flag
18026     */
18027    ClientApplication.prototype.preflightInteractiveRequest = function (setInteractionInProgress) {
18028        this.logger.verbose("preflightInteractiveRequest called, validating app environment");
18029        // block the reload if it occurred inside a hidden iframe
18030        BrowserUtils.blockReloadInHiddenIframes();
18031        // Set interaction in progress temporary cache or throw if alread set.
18032        if (setInteractionInProgress) {
18033            this.browserStorage.setInteractionInProgress(true);
18034        }
18035    };
18036    /**
18037     * Acquire a token from native device (e.g. WAM)
18038     * @param request
18039     */
18040    ClientApplication.prototype.acquireTokenNative = function (request, apiId, accountId) {
18041        return __awaiter$1(this, void 0, void 0, function () {
18042            var nativeClient;
18043            return __generator$1(this, function (_a) {
18044                this.logger.trace("acquireTokenNative called");
18045                if (!this.nativeExtensionProvider) {
18046                    throw BrowserAuthError.createNativeConnectionNotEstablishedError();
18047                }
18048                nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.nativeExtensionProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);
18049                return [2 /*return*/, nativeClient.acquireToken(request)];
18050            });
18051        });
18052    };
18053    /**
18054     * Returns boolean indicating if this request can use the native broker
18055     * @param request
18056     */
18057    ClientApplication.prototype.canUseNative = function (request, accountId) {
18058        this.logger.trace("canUseNative called");
18059        if (!NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {
18060            this.logger.trace("canUseNative: isNativeAvailable returned false, returning false");
18061            return false;
18062        }
18063        if (request.prompt) {
18064            switch (request.prompt) {
18065                case PromptValue.NONE:
18066                case PromptValue.CONSENT:
18067                case PromptValue.LOGIN:
18068                    this.logger.trace("canUseNative: prompt is compatible with native flow");
18069                    break;
18070                default:
18071                    this.logger.trace("canUseNative: prompt = " + request.prompt + " is not compatible with native flow, returning false");
18072                    return false;
18073            }
18074        }
18075        if (!accountId && !this.getNativeAccountId(request)) {
18076            this.logger.trace("canUseNative: nativeAccountId is not available, returning false");
18077            return false;
18078        }
18079        return true;
18080    };
18081    /**
18082     * Get the native accountId from the account
18083     * @param request
18084     * @returns
18085     */
18086    ClientApplication.prototype.getNativeAccountId = function (request) {
18087        var account = request.account || this.browserStorage.getAccountInfoByHints(request.loginHint, request.sid) || this.getActiveAccount();
18088        return account && account.nativeAccountId || "";
18089    };
18090    /**
18091     * Returns new instance of the Popup Interaction Client
18092     * @param correlationId
18093     */
18094    ClientApplication.prototype.createPopupClient = function (correlationId) {
18095        return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
18096    };
18097    /**
18098     * Returns new instance of the Redirect Interaction Client
18099     * @param correlationId
18100     */
18101    ClientApplication.prototype.createRedirectClient = function (correlationId) {
18102        return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
18103    };
18104    /**
18105     * Returns new instance of the Silent Iframe Interaction Client
18106     * @param correlationId
18107     */
18108    ClientApplication.prototype.createSilentIframeClient = function (correlationId) {
18109        return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
18110    };
18111    /**
18112     * Returns new instance of the Silent Cache Interaction Client
18113     */
18114    ClientApplication.prototype.createSilentCacheClient = function (correlationId) {
18115        return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);
18116    };
18117    /**
18118     * Returns new instance of the Silent Refresh Interaction Client
18119     */
18120    ClientApplication.prototype.createSilentRefreshClient = function (correlationId) {
18121        return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);
18122    };
18123    /**
18124     * Returns new instance of the Silent AuthCode Interaction Client
18125     */
18126    ClientApplication.prototype.createSilentAuthCodeClient = function (correlationId) {
18127        return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);
18128    };
18129    /**
18130     * Adds event callbacks to array
18131     * @param callback
18132     */
18133    ClientApplication.prototype.addEventCallback = function (callback) {
18134        return this.eventHandler.addEventCallback(callback);
18135    };
18136    /**
18137     * Removes callback with provided id from callback array
18138     * @param callbackId
18139     */
18140    ClientApplication.prototype.removeEventCallback = function (callbackId) {
18141        this.eventHandler.removeEventCallback(callbackId);
18142    };
18143    /**
18144     * Registers a callback to receive performance events.
18145     *
18146     * @param {PerformanceCallbackFunction} callback
18147     * @returns {string}
18148     */
18149    ClientApplication.prototype.addPerformanceCallback = function (callback) {
18150        return this.performanceClient.addPerformanceCallback(callback);
18151    };
18152    /**
18153     * Removes a callback registered with addPerformanceCallback.
18154     *
18155     * @param {string} callbackId
18156     * @returns {boolean}
18157     */
18158    ClientApplication.prototype.removePerformanceCallback = function (callbackId) {
18159        return this.performanceClient.removePerformanceCallback(callbackId);
18160    };
18161    /**
18162     * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
18163     */
18164    ClientApplication.prototype.enableAccountStorageEvents = function () {
18165        this.eventHandler.enableAccountStorageEvents();
18166    };
18167    /**
18168     * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
18169     */
18170    ClientApplication.prototype.disableAccountStorageEvents = function () {
18171        this.eventHandler.disableAccountStorageEvents();
18172    };
18173    /**
18174     * Gets the token cache for the application.
18175     */
18176    ClientApplication.prototype.getTokenCache = function () {
18177        return this.tokenCache;
18178    };
18179    /**
18180     * Returns the logger instance
18181     */
18182    ClientApplication.prototype.getLogger = function () {
18183        return this.logger;
18184    };
18185    /**
18186     * Replaces the default logger set in configurations with new Logger with new configurations
18187     * @param logger Logger instance
18188     */
18189    ClientApplication.prototype.setLogger = function (logger) {
18190        this.logger = logger;
18191    };
18192    /**
18193     * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
18194     * @param sku
18195     * @param version
18196     */
18197    ClientApplication.prototype.initializeWrapperLibrary = function (sku, version) {
18198        // Validate the SKU passed in is one we expect
18199        this.browserStorage.setWrapperMetadata(sku, version);
18200    };
18201    /**
18202     * Sets navigation client
18203     * @param navigationClient
18204     */
18205    ClientApplication.prototype.setNavigationClient = function (navigationClient) {
18206        this.navigationClient = navigationClient;
18207    };
18208    /**
18209     * Returns the configuration object
18210     */
18211    ClientApplication.prototype.getConfiguration = function () {
18212        return this.config;
18213    };
18214    /**
18215     * Generates a correlation id for a request if none is provided.
18216     *
18217     * @protected
18218     * @param {?Partial<BaseAuthRequest>} [request]
18219     * @returns {string}
18220     */
18221    ClientApplication.prototype.getRequestCorrelationId = function (request) {
18222        if (request === null || request === void 0 ? void 0 : request.correlationId) {
18223            return request.correlationId;
18224        }
18225        if (this.isBrowserEnvironment) {
18226            return this.browserCrypto.createNewGuid();
18227        }
18228        /*
18229         * Included for fallback for non-browser environments,
18230         * and to ensure this method always returns a string.
18231         */
18232        return Constants.EMPTY_STRING;
18233    };
18234    return ClientApplication;
18235}());
18236
18237/*
18238 * Copyright (c) Microsoft Corporation. All rights reserved.
18239 * Licensed under the MIT License.
18240 */
18241/**
18242 * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications
18243 * to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.
18244 */
18245var PublicClientApplication = /** @class */ (function (_super) {
18246    __extends$1(PublicClientApplication, _super);
18247    /**
18248     * @constructor
18249     * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
18250     *
18251     * Important attributes in the Configuration object for auth are:
18252     * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
18253     * - authority: the authority URL for your application.
18254     * - redirect_uri: the uri of your application registered in the portal.
18255     *
18256     * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
18257     * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
18258     * If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
18259     * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
18260     * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
18261     * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
18262     *
18263     * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
18264     * Full B2C functionality will be available in this library in future versions.
18265     *
18266     * @param configuration object for the MSAL PublicClientApplication instance
18267     */
18268    function PublicClientApplication(configuration) {
18269        var _this = _super.call(this, configuration) || this;
18270        _this.astsAsyncMeasurement = undefined;
18271        _this.activeSilentTokenRequests = new Map();
18272        // Register listener functions
18273        _this.trackPageVisibility = _this.trackPageVisibility.bind(_this);
18274        return _this;
18275    }
18276    /**
18277     * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
18278     * any code that follows this function will not execute.
18279     *
18280     * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
18281     * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
18282     *
18283     * @param request
18284     */
18285    PublicClientApplication.prototype.loginRedirect = function (request) {
18286        return __awaiter$1(this, void 0, void 0, function () {
18287            var correlationId;
18288            return __generator$1(this, function (_a) {
18289                correlationId = this.getRequestCorrelationId(request);
18290                this.logger.verbose("loginRedirect called", correlationId);
18291                return [2 /*return*/, this.acquireTokenRedirect(__assign$1({ correlationId: correlationId }, (request || DEFAULT_REQUEST)))];
18292            });
18293        });
18294    };
18295    /**
18296     * Use when initiating the login process via opening a popup window in the user's browser
18297     *
18298     * @param request
18299     *
18300     * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
18301     */
18302    PublicClientApplication.prototype.loginPopup = function (request) {
18303        var correlationId = this.getRequestCorrelationId(request);
18304        this.logger.verbose("loginPopup called", correlationId);
18305        return this.acquireTokenPopup(__assign$1({ correlationId: correlationId }, (request || DEFAULT_REQUEST)));
18306    };
18307    /**
18308     * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
18309     *
18310     * @param {@link (SilentRequest:type)}
18311     * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object
18312     */
18313    PublicClientApplication.prototype.acquireTokenSilent = function (request) {
18314        return __awaiter$1(this, void 0, void 0, function () {
18315            var correlationId, atsMeasurement, account, thumbprint, silentRequestKe
18315y, cachedResponse, response;
18316            var _this = this;
18317            return __generator$1(this, function (_a) {
18318                correlationId = this.getRequestCorrelationId(request);
18319                atsMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilent, correlationId);
18320                atsMeasurement.addStaticFields({
18321                    cacheLookupPolicy: request.cacheLookupPolicy
18322                });
18323                this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
18324                this.logger.verbose("acquireTokenSilent called", correlationId);
18325                account = request.account || this.getActiveAccount();
18326                if (!account) {
18327                    throw BrowserAuthError.createNoAccountError();
18328                }
18329                thumbprint = {
18330                    clientId: this.config.auth.clientId,
18331                    authority: request.authority || Constants.EMPTY_STRING,
18332                    scopes: request.scopes,
18333                    homeAccountIdentifier: account.homeAccountId,
18334                    claims: request.claims,
18335                    authenticationScheme: request.authenticationScheme,
18336                    resourceRequestMethod: request.resourceRequestMethod,
18337                    resourceRequestUri: request.resourceRequestUri,
18338                    shrClaims: request.shrClaims,
18339                    sshKid: request.sshKid
18340                };
18341                silentRequestKey = JSON.stringify(thumbprint);
18342                cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);
18343                if (typeof cachedResponse === "undefined") {
18344                    this.logger.verbose("acquireTokenSilent called for the first time, storing active request", correlationId);
18345                    this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenSilentAsync, correlationId);
18346                    response = this.acquireTokenSilentAsync(__assign$1(__assign$1({}, request), { correlationId: correlationId }), account)
18347                        .then(function (result) {
18348                        _this.activeSilentTokenRequests.delete(silentRequestKey);
18349                        atsMeasurement.addStaticFields({
18350                            accessTokenSize: result.accessToken.length,
18351                            idTokenSize: result.idToken.length
18352                        });
18353                        atsMeasurement.endMeasurement({
18354                            success: true,
18355                            fromCache: result.fromCache,
18356                            isNativeBroker: result.fromNativeBroker,
18357                            cacheLookupPolicy: request.cacheLookupPolicy,
18358                            requestId: result.requestId,
18359                        });
18360                        return result;
18361                    })
18362                        .catch(function (error) {
18363                        _this.activeSilentTokenRequests.delete(silentRequestKe
vendor: 5,811 bytes, lines 18363-18442
18363y);
18364                        atsMeasurement.endMeasurement({
18365                            errorCode: error.errorCode,
18366                            subErrorCode: error.subError,
18367                            success: false
18368                        });
18369                        throw error;
18370                    });
18371                    this.activeSilentTokenRequests.set(silentRequestKey, response);
18372                    return [2 /*return*/, response];
18373                }
18374                else {
18375                    this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call", correlationId);
18376                    // Discard measurements for memoized calls, as they are usually only a couple of ms and will artificially deflate metrics
18377                    atsMeasurement.discardMeasurement();
18378                    return [2 /*return*/, cachedResponse];
18379                }
18380            });
18381        });
18382    };
18383    PublicClientApplication.prototype.trackPageVisibility = function () {
18384        if (!this.astsAsyncMeasurement) {
18385            return;
18386        }
18387        this.logger.info("Perf: Visibility change detected");
18388        this.astsAsyncMeasurement.increment({
18389            visibilityChangeCount: 1,
18390        });
18391    };
18392    /**
18393     * Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.
18394     * @param {@link (SilentRequest:type)}
18395     * @param {@link (AccountInfo:type)}
18396     * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}
18397     */
18398    PublicClientApplication.prototype.acquireTokenSilentAsync = function (request, account) {
18399        var _a;
18400        return __awaiter$1(this, void 0, void 0, function () {
18401            var result, silentRequest, silentCacheClient, silentRequest_1, requestWithCLP_1;
18402            var _this = this;
18403            return __generator$1(this, function (_b) {
18404                switch (_b.label) {
18405                    case 0:
18406                        this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
18407                        this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
18408                        this.astsAsyncMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
18409                        (_a = this.astsAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.increment({
18410                            visibilityChangeCount: 0
18411                        });
18412                        document.addEventListener("visibilitychange", this.trackPageVisibility);
18413                        if (!(NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId)) return [3 /*break*/, 1];
18414                        this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform");
18415                        silentRequest = __assign$1(__assign$1({}, request), { account: account });
18416                        result = this.acquireTokenNative(silentRequest, exports.ApiId.acquireTokenSilent_silentFlow).catch(function (e) { return __awaiter$1(_this, void 0, void 0, function () {
18417                            var silentIframeClient;
18418                            return __generator$1(this, function (_a) {
18419                                // If native token acquisition fails for availability reasons fallback to web flow
18420                                if (e instanceof NativeAuthError && e.isFatal()) {
18421                                    this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow");
18422                                    this.nativeExtensionProvider = undefined; // Prevent future requests from continuing to attempt
18423                                    silentIframeClient = this.createSilentIframeClient(request.correlationId);
18424                                    return [2 /*return*/, silentIframeClient.acquireToken(request)];
18425                                }
18426                                throw e;
18427                            });
18428                        }); });
18429                        return [3 /*break*/, 3];
18430                    case 1:
18431                        this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow");
18432                        silentCacheClient = this.createSilentCacheClient(request.correlationId);
18433                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeSilentRequest, request.correlationId);
18434                        return [4 /*yield*/, silentCacheClient.initializeSilentRequest(request, account)];
18435                    case 2:
18436                        silentRequest_1 = _b.sent();
18437                        requestWithCLP_1 = __assign$1(__assign$1({}, request), { 
18438                            // set the request's CacheLookupPolicy to Default if it was not optionally passed in
18439                            cacheLookupPolicy: request.cacheLookupPolicy || exports.CacheLookupPolicy.Default });
18440                        this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenFromCache, silentRequest_1.correlationId);
18441                        result = this.acquireTokenFromCache(silentCacheClient, silentRequest_1, requestWithCLP_1).catch(function (cacheError) {
18442                            if (requestWithCLP_1.cacheLookupPolicy === exports.CacheLookupPolicy.Acce
18442ssToken) {
18443                                throw cacheError;
18444                            }
18445                            // block the reload if it occurred inside a hidden iframe
18446                            BrowserUtils.blockReloadInHiddenIframes();
18447                            _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_NETWORK_START, exports.InteractionType.Silent, silentRequest_1);
18448                            _this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenByRefreshToken, silentRequest_1.correlationId);
18449                            return _this.acquireTokenByRefreshToken(silentRequest_1, requestWithCLP_1).catch(function (refreshTokenError) {
18450                                var isServerError = refreshTokenError instanceof ServerError;
18451                                var isInteractionRequiredError = refreshTokenError instanceof InteractionRequiredAuthError;
18452                                var rtNotFound = (refreshTokenError.errorCode === InteractionRequiredAuthErrorMessage.noTokensFoundError.code);
18453                                var isInvalidGrantError = (refreshTokenError.errorCode === BrowserConstants.INVALID_GRANT_ERROR);
18454                                if ((!isServerError ||
18455                                    !isInvalidGrantError ||
18456                                    isInteractionRequiredError ||
18457                                    requestWithCLP_1.cacheLookupPolicy === exports.CacheLookupPolicy.AccessTokenAndRefreshToken ||
18458                                    requestWithCLP_1.cacheLookupPolicy === exports.CacheLookupPolicy.RefreshToken)
18459                                    && (requestWithCLP_1.cacheLookupPolicy !== exports.CacheLookupPolicy.Skip)
18460                                    && !rtNotFound) {
18461                                    throw refreshTokenError;
18462                                }
18463                                _this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.", request.correlationId);
18464                                _this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenBySilentIframe, silentRequest_1.correlationId);
18465                                return _this.acquireTokenBySilentIframe(silentRequest_1);
18466                            });
18467                        });
18468                        _b.label = 3;
18469                    case 3: return [2 /*return*/, result.then(function (response) {
18470                            var _a;
18471                            _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
18472                            (_a = _this.astsAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({
18473                                success: true,
18474                                fromCache: response.fromCache,
18475                                isNativeBroker: response.fromNativeBroker,
18476                                requestId: response.requestId
18477                            });
18478                            return response;
18479                        }).catch(function (tokenRenewalError) {
18480                            var _a;
18481                            _this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
18482                            (_a = _this.astsAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({
18483                                errorCode: tokenRenewalError.errorCode,
18484                                subErrorCode: tokenRenewalError.subError,
18485                                success: false
18486                            });
18487                            throw tokenRenewalError;
18488                        }).finally(function () {
18489                            document.removeEventListener("visibilitychange", _this.trackPageVisibility);
18490                        })];
18491                }
18492            });
18493        });
18494    };
18495    /**
18496     * Hydrates cache with the tokens and account in the AuthenticationResult object
18497     * @param result
18498     * @param request - The request object that was used to obtain the AuthenticationResult
18499     * @returns
18500     */
18501    PublicClientApplication.prototype.hydrateCache = function (result, request) {
18502        return __awaiter$1(this, void 0, void 0, function () {
18503            var accountEntity;
18504            return __generator$1(this, function (_a) {
18505                this.logger.verbose("hydrateCache called");
18506                if (result.account) {
18507                    accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
18508                    this.browserStorage.setAccount(accountEntity);
18509                    if (result.fromNativeBroker) {
18510                        this.logger.verbose("Response was from native broker, storing in-memory");
18511                        // Tokens from native broker are stored in-memory
18512                        return [2 /*return*/, this.nativeInternalStorage.hydrateCache(result, request)];
18513                    }
18514                    else {
18515                        return [2 /*return*/, this.browserStorage.hydrateCache(result, request)];
18516                    }
18517                }
18518                return [2 /*return*/];
18519            });
18520        });
18521    };
18522    return PublicClientApplication;
18523}(ClientApplication));
18524
18525/*
18526 * Copyright (c) Microsoft Corporation. All rights reserved.
18527 * Licensed under the MIT License.
18528 */
18529var stubbedPublicClientApplication = {
18530    initialize: function () {
18531        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18532    },
18533    acquireTokenPopup: function () {
18534        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18535    },
18536    acquireTokenRedirect: function () {
18537        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18538    },
18539    acquireTokenSilent: function () {
18540        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18541    },
18542    acquireTokenByCode: function () {
18543        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18544    },
18545    getAllAccounts: function () {
18546        return [];
18547    },
18548    getAccountByHomeId: function () {
18549        return null;
18550    },
18551    getAccountByUsername: function () {
18552        return null;
18553    },
18554    getAccountByLocalId: function () {
18555        return null;
18556    },
18557    handleRedirectPromise: function () {
18558        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18559    },
18560    loginPopup: function () {
18561        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18562    },
18563    loginRedirect: function () {
18564        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18565    },
18566    logout: function () {
18567        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18568    },
18569    logoutRedirect: function () {
18570        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18571    },
18572    logoutPopup: function () {
18573        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18574    },
18575    ssoSilent: function () {
18576        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18577    },
18578    addEventCallback: function () {
18579        return null;
18580    },
18581    removeEventCallback: function () {
18582        return;
18583    },
18584    addPerformanceCallback: function () {
18585        return "";
18586    },
18587    removePerformanceCallback: function () {
18588        return false;
18589    },
18590    enableAccountStorageEvents: function () {
18591        return;
18592    },
18593    disableAccountStorageEvents: function () {
18594        return;
18595    },
18596    getTokenCache: function () {
18597        throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();
18598    },
18599    getLogger: function () {
18600        throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();
18601    },
18602    setLogger: function () {
18603        return;
18604    },
18605    setActiveAccount: function () {
18606        return;
18607    },
18608    getActiveAccount: function () {
18609        return null;
18610    },
18611    initializeWrapperLibrary: function () {
18612        return;
18613    },
18614    setNavigationClient: function () {
18615        return;
18616    },
18617    getConfiguration: function () {
18618        throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();
18619    },
18620    hydrateCache: function () {
18621        return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
18622    },
18623};
18624
18625/*
18626 * Copyright (c) Microsoft Corporation. All rights reserved.
18627 * Licensed under the MIT License.
18628 */
18629var EventMessageUtils = /** @class */ (function () {
18630    function EventMessageUtils() {
18631    }
18632    /**
18633     * Gets interaction status from event message
18634     * @param message
18635     * @param currentStatus
18636     */
18637    EventMessageUtils.getInteractionStatusFromEvent = function (message, currentStatus) {
18638        switch (message.eventType) {
18639            case exports.EventType.LOGIN_START:
18640                return exports.InteractionStatus.Login;
18641            case exports.EventType.SSO_SILENT_START:
18642                return exports.InteractionStatus.SsoSilent;
18643            case exports.EventType.ACQUIRE_TOKEN_START:
18644                if (message.interactionType === exports.InteractionType.Redirect || message.interactionType === exports.InteractionType.Popup) {
18645                    return exports.InteractionStatus.AcquireToken;
18646                }
18647                break;
18648            case exports.EventType.HANDLE_REDIRECT_START:
18649                return exports.InteractionStatus.HandleRedirect;
18650            case exports.EventType.LOGOUT_START:
18651                return exports.InteractionStatus.Logout;
18652            case exports.EventType.SSO_SILENT_SUCCESS:
18653            case exports.EventType.SSO_SILENT_FAILURE:
18654                if (currentStatus && currentStatus !== exports.InteractionStatus.SsoSilent) {
18655                    // Prevent this event from clearing any status other than ssoSilent
18656                    break;
18657                }
18658                return exports.InteractionStatus.None;
18659            case exports.EventType.LOGOUT_END:
18660                if (currentStatus && currentStatus !== exports.InteractionStatus.Logout) {
18661                    // Prevent this event from clearing any status other than logout
18662                    break;
18663                }
18664                return exports.InteractionStatus.None;
18665            case exports.EventType.HANDLE_REDIRECT_END:
18666                if (currentStatus && currentStatus !== exports.InteractionStatus.HandleRedirect) {
18667                    // Prevent this event from clearing any status other than handleRedirect
18668                    break;
18669                }
18670                return exports.InteractionStatus.None;
18671            case exports.EventType.LOGIN_SUCCESS:
18672            case exports.EventType.LOGIN_FAILURE:
18673            case exports.EventType.ACQUIRE_TOKEN_SUCCESS:
18674            case exports.EventType.ACQUIRE_TOKEN_FAILURE:
18675            case exports.EventType.RESTORE_FROM_BFCACHE:
18676                if (message.interactionType === exports.InteractionType.Redirect || message.interactionType === exports.InteractionType.Popup) {
18677                    if (currentStatus && currentStatus !== exports.InteractionStatus.Login && currentStatus !== exports.InteractionStatus.AcquireToken) {
18678                        // Prevent this event from clearing any status other than login or acquireToken
18679                        break;
18680                    }
18681                    return exports.InteractionStatus.None;
18682                }
18683                break;
18684        }
18685        return null;
18686    };
18687    return EventMessageUtils;
18688}());
18689
18690/*
18691 * Copyright (c) Microsoft Corporation. All rights reserved.
18692 * Licensed under the MIT License.
18693 */
18694var SignedHttpRequest = /** @class */ (function () {
18695    function SignedHttpRequest(shrParameters, shrOptions) {
18696        var loggerOptions = (shrOptions && shrOptions.loggerOptions) || {};
18697        this.logger = new Logger(loggerOptions, name, version);
18698        this.cryptoOps = new CryptoOps(this.logger);
18699        this.popTokenGenerator = new PopTokenGenerator(this.cryptoOps);
18700        this.shrParameters = shrParameters;
18701    }
18702    /**
18703     * Generates and caches a keypair for the given request options.
18704     * @returns Public key digest, which should be sent to the token issuer.
18705     */
18706    SignedHttpRequest.prototype.generatePublicKeyThumbprint = function () {
18707        return __awaiter$1(this, void 0, void 0, function () {
18708            var kid;
18709            return __generator$1(this, function (_a) {
18710                switch (_a.label) {
18711                    case 0: return [4 /*yield*/, this.popTokenGenerator.generateKid(this.shrParameters)];
18712                    case 1:
18713                        kid = (_a.sent()).kid;
18714                        return [2 /*return*/, kid];
18715                }
18716            });
18717        });
18718    };
18719    /**
18720     * Generates a signed http request for the given payload with the given key.
18721     * @param payload Payload to sign (e.g. access token)
18722     * @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)
18723     * @param claims Additional claims to include/override in the signed JWT
18724     * @returns Pop token signed with the corresponding private key
18725     */
18726    SignedHttpRequest.prototype.signRequest = function (payload, publicKeyThumbprint, claims) {
18727        return __awaiter$1(this, void 0, void 0, function () {
18728            return __generator$1(this, function (_a) {
18729                return [2 /*return*/, this.popTokenGenerator.signPayload(payload, publicKeyThumbprint, this.shrParameters, claims)];
18730            });
18731        });
18732    };
18733    /**
18734     * Removes cached keys from browser for given public key thumbprint
18735     * @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)
18736     * @returns If keys are properly deleted
18737     */
18738    SignedHttpRequest.prototype.removeKeys = function (publicKeyThumbprint) {
18739        return __awaiter$1(this, void 0, void 0, function () {
18740            return __generator$1(this, function (_a) {
18741                switch (_a.label) {
18742                    case 0: return [4 /*yield*/, this.cryptoOps.removeTokenBindingKey(publicKeyThumbprint)];
18743                    case 1: return [2 /*return*/, _a.sent()];
18744                }
18745            });
18746        });
18747    };
18748    return SignedHttpRequest;
18749}());
18750
18751exports.AccountEntity = AccountEntity;
18752exports.AuthError = AuthError;
18753exports.AuthErrorMessage = AuthErrorMessage;
18754exports.AuthenticationHeaderParser = AuthenticationHeaderParser;
18755exports.BrowserAuthError = BrowserAuthError;
18756exports.BrowserAuthErrorMessage = BrowserAuthErrorMessage;
18757exports.BrowserConfigurationAuthError = BrowserConfigurationAuthError;
18758exports.BrowserConfigurationAuthErrorMessage = BrowserConfigurationAuthErrorMessage;
18759exports.BrowserUtils = BrowserUtils;
18760exports.ClientAuthError = ClientAuthError;
18761exports.ClientAuthErrorMessage = ClientAuthErrorMessage;
18762exports.ClientConfigurationError = ClientConfigurationError;
18763exports.ClientConfigurationErrorMessage = ClientConfigurationErrorMessage;
18764exports.DEFAULT_IFRAME_TIMEOUT_MS = DEFAULT_IFRAME_TIMEOUT_MS;
18765exports.EventMessageUtils = EventMessageUtils;
18766exports.InteractionRequiredAuthError = InteractionRequiredAuthError;
18767exports.InteractionRequiredAuthErrorMessage = InteractionRequiredAuthErrorMessage;
18768exports.Logger = Logger;
18769exports.NavigationClient = NavigationClient;
18770exports.OIDC_DEFAULT_SCOPES = OIDC_DEFAULT_SCOPES;
18771exports.PublicClientApplication = PublicClientApplication;
18772exports.ServerError = ServerError;
18773exports.SignedHttpRequest = SignedHttpRequest;
18774exports.StringUtils = StringUtils;
18775exports.UrlString = UrlString;
18776exports.internals = internals;
18777exports.stubbedPublicClientApplication = stubbedPublicClientApplication;
18778exports.version = version;
18779
18780
18781},{}]},{},[129]);

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