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KAAE,MAAO,CAAEC,IAAK,2CAA4CC,MAAO,eAAa,EAChFF,KAAE,MAAO,CAAEC,IAAK,2CAA4CC,MAAO,oCAAkC,EAAGF,KAAE,MAAO,CAAEC,IAAK,2CAA4CC,MAAO,aAAW,EAAGF,KAAE,6BAA8B,CAAEC,IAAK,2CAA4CnH,MAAON,KAAKM,MAAO4H,UAAU,EAAMF,kBAAmBhI,KAAKgI,qBAAmB,EAAGR,KAAE,SAAU,CAAEC,IAAK,2CAA4C9C,KAAM,SAAUnF,GAAI,wBAAyBkI,MAAO,kBAAmBS,QAASA,IAAM7I,EAAuBC,SAASS,KAAK8H,gBAAiB,0BAA2B9H,KAAK+H,oBAAqBK,UAAWpI,KAAK8H,iBAAmB,cAAYN,KAAE,OAAQ,CAAEC,IAAK,2CAA4CjI,GAAI,yBAA0BkI,MAAO,WAAS,EAAGF,KAAE,OAAQ,CAAEC,IAAK,2CAA4CC,MAAO,oCAAkC,EACh2BF,KAAE,MAAO,CAAEC,IAAK,2CAA4CC,MAAO,2BAAyB,EAAGF,KAAE,IAAK,CAAEC,IAAK,2CAA4CG,MAAO,CAAE,YAAa,UAAa,4BAAyB,EAAGJ,KAAE,SAAU,CAAEC,IAAK,4CAA8C,qBAAkB,EAAGD,KAAE,IAAK,CAAEC,IAAK,6CAA2C,EAAGD,KAAE,OAAQ,CAAEC,IAAK,2CAA4CjI,GAAI,QAASkI,MAAO,sCAAwC1H,KAAKiI,kBAAgB5B,KAAcmB,KAAE,IAAK,CAAEF,KAAM,IAAKI,MAAO,mBAAqB,eAE9jB,GAEJG,EAA0BD,MApBW","names":["TokenActivationKind","Unknown","Append","AppendOrNow","Now","Exact","TokenActivationHelpers","activate","id","contrId","controllerAction","workerType","hideActivateTokenBtn","hideWizardActivateToken","hideWizardActivateToken2","hideActivateThroughConfig","this","disableActivationButtons","showLoadingIndicators","clearAlerts","control","getControl","token","value","trim","isValidGuid","showInvalidTokenError","enableActivationButtons","hideLoadingIndicators","data","createTokenActivationModel","isOverlapPromptVisible","setActivationKindAndDate","$","response","tokenActivation_completed","fail","handleActivationError","prop","removeClass","addClass","remove","length","RegExp","test","append","ConfigurationId","Token","ActivationKind","ActivationDate","WorkerType","is","tokenActivationKind","val","activationDate","jqXHR","_textStatus","errorThrown","console","error","status","errorMsg","responseJSON","message","detailsLink","errorDiv","find","click","e","preventDefault","detailsDiv","toggle","text","success","showSuccessMessage","hideActivationButtons","handleWizardActivation","dispatchTokenActivationCompletedEvent","userPrompt","showUserPrompt","appendDate","StartDate","showErrorMessage","hideOverlapPrompt","resetActivationUI","window","tokenJustActivated","hide","url","location","origin","type","event","Event","document","dispatchEvent","startDate","formattedDate","Date","toLocaleDateString","formattedStartDate","updatePromptMessages","setPromptControlsReadOnly","show","formattedEndDate","defaultMessage","defaultMessageStartDate","updatedMessageHtml","html","validFromHtml","replace","CosoTokenActivation","constructor","hostRef","registerInstance","tokenActivationSuccess","closeModalRedirectPath","undefined","componentWillLoad","ready","on","hasClass","reload","button","relatedTarget","attr","_token","Number","off","activeFocusTrap","createFocusTrap","deactivate","addEventListener","componentDidLoad","href","render","h","key","class","role","style","CosoTokenActivationWizard","configurationId","tokenActivationUrl","productPricingUrl","isWizardStep","isWizard","onClick","disabled"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./node_modules/@coso/saas/dist/esm/token-activation-helpers-db86e106.js","./node_modules/@coso/saas/dist/esm/coso-token-activation_2.entry.js"],"sourcesContent":["import $ from 'jquery';\n\nvar TokenActivationKind;\n(function (TokenActivationKind) {\n TokenActivationKind[TokenActivationKind[\"Unknown\"] = 0] = \"Unknown\";\n TokenActivationKind[TokenActivationKind[\"Append\"] = 1] = \"Append\";\n TokenActivationKind[TokenActivationKind[\"AppendOrNow\"] = 2] = \"AppendOrNow\";\n TokenActivationKind[TokenActivationKind[\"Now\"] = 3] = \"Now\";\n TokenActivationKind[TokenActivationKind[\"Exact\"] = 4] = \"Exact\";\n})(TokenActivationKind || (TokenActivationKind = {}));\nclass TokenActivationHelpers {\n static activate(id, contrId, controllerAction = \"/Token/Activate/\", workerType = 0, hideActivateTokenBtn = true, hideWizardActivateToken = true, hideWizardActivateToken2 = true, hideActivateThroughConfig = true) {\n this.disableActivationButtons();\n this.showLoadingIndicators();\n this.clearAlerts();\n const control = this.getControl(contrId);\n if (!control)\n return;\n const token = control.value.trim();\n if (!this.isValidGuid(token)) {\n this.showInvalidTokenError();\n this.enableActivationButtons();\n this.hideLoadingIndicators();\n return;\n }\n const data = this.createTokenActivationModel(id, token, workerType);\n if (this.isOverlapPromptVisible()) {\n this.setActivationKindAndDate(data);\n }\n $.post(controllerAction, data, (response) => this.tokenActivation_completed(response, hideActivateTokenBtn, hideWizardActivateToken, hideWizardActivateToken2, hideActivateThroughConfig)).fail(this.handleActivationError);\n }\n static disableActivationButtons() {\n $(\"#activateTokenBtn, #wizardActivateToken, #wizardActivateToken2, #activateThroughConfig\").prop(\"disabled\", true);\n }\n static enableActivationButtons() {\n $(\"#activateTokenBtn, #wizardActivateToken, #wizardActivateToken2, #activateThroughConfig\").prop(\"disabled\", false);\n }\n static showLoadingIndicators() {\n $(\"#activateAnotherLink, #loadingTokenActivation\").removeClass(\"hidden\");\n }\n static hideLoadingIndicators() {\n $(\"#activateAnotherLink, #loadingTokenActivation\").removeClass(\"hidden\").addClass(\"hidden\");\n }\n static clearAlerts() {\n $(\".tokenBody .alert\").remove();\n }\n static getControl(contrId) {\n let control = $(contrId)[0];\n if (!control && $(\"#activateTokenForm_isWizardModal\").length > 0) {\n control = $(\"#tokenInputBox_isWizardModal\")[0];\n }\n return control;\n }\n static isValidGuid(token) {\n const guidRegexp = new RegExp(\"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$\");\n return guidRegexp.test(token);\n }\n static showInvalidTokenError() {\n $(\"#tokenInput, #tokenInput_isWizard, #tokenInput_isWizardModal\").addClass(\"has-error\");\n $(\".tokenBody\").append('
' +\n \"Error! \" +\n \"The activation token must have valid GUID format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.\" +\n '\" +\n \"
\");\n }\n static createTokenActivationModel(id, token, workerType) {\n return {\n ConfigurationId: id,\n Token: token,\n ActivationKind: TokenActivationKind.Unknown,\n ActivationDate: \"\",\n WorkerType: workerType,\n };\n }\n static isOverlapPromptVisible() {\n return $(\".overlapPrompt\").is(\":visible\");\n }\n static setActivationKindAndDate(data) {\n let tokenActivationKind = $(\"input[name=tokenActivationKind]:checked\").val();\n if (!tokenActivationKind && $(\"#activateTokenForm_isWizardModal\").length > 0) {\n tokenActivationKind = $(\"input[name=tokenActivationKind]:checked\", \"#activateTokenForm_isWizardModal\").val();\n }\n if (!tokenActivationKind && $(\"#activateTokenForm_isWizard\").length > 0) {\n tokenActivationKind = $(\"input[name=tokenActivationKind]:checked\", \"#activateTokenForm_isWizard\").val();\n }\n data.ActivationKind = TokenActivationKind[tokenActivationKind];\n if (data.ActivationKind === TokenActivationKind.Exact) {\n let activationDate = $(\"#subscriptionStart, #subscriptionStart_isWizard, #subscriptionStart_isWizardModal\").val();\n if (!activationDate && $(\"#activateTokenForm_isWizardModal\").length > 0) {\n activationDate = $(\"#subscriptionStart, #subscriptionStart_isWizard, #subscriptionStart_isWizardModal\", \"#activateTokenForm_isWizardModal\").val();\n }\n if (!activationDate && $(\"#activateTokenForm_isWizard\").length > 0) {\n activationDate = $(\"#subscriptionStart, #subscriptionStart_isWizard, #subscriptionStart_isWizardModal\", \"#activateTokenForm_isWizard\").val();\n }\n data.ActivationDate = activationDate;\n }\n }\n static handleActivationError(jqXHR, _textStatus, errorThrown) {\n console.error(\"Something went wrong when activating the token. \" + \"Error \" + jqXHR.status + \": \" + errorThrown);\n let errorMsg = \"\";\n if (jqXHR.responseJSON) {\n errorMsg = jqXHR.responseJSON.message;\n }\n const detailsLink = errorMsg ? \"
Show Details
\" : \"\";\n const errorDiv = $('
' +\n \"Error! \" +\n \"Cannot activate token. Try again later!\" +\n detailsLink +\n '
' +\n errorMsg +\n \"
\" +\n '\" +\n \"
\");\n $(\".tokenBody\").append(errorDiv);\n if (errorMsg) {\n errorDiv.find(\".details\").click(function (e) {\n e.preventDefault();\n const detailsDiv = errorDiv.find(\".error-details\");\n detailsDiv.toggle();\n $(this).text(detailsDiv.is(\":visible\") ? \"Hide Details\" : \"Show Details\");\n });\n }\n this.enableActivationButtons();\n this.hideLoadingIndicators();\n }\n static tokenActivation_completed(data, hideActivateTokenBtn, hideWizardActivateToken, hideWizardActivateToken2, hideActivateThroughConfig) {\n if (data.success) {\n this.showSuccessMessage();\n this.hideActivationButtons(hideActivateTokenBtn, hideWizardActivateToken, hideWizardActivateToken2, hideActivateThroughConfig);\n this.handleWizardActivation();\n this.dispatchTokenActivationCompletedEvent();\n }\n else if (data.userPrompt) {\n this.showUserPrompt(data.appendDate, data.StartDate);\n }\n else {\n this.showErrorMessage(data.errorMsg);\n }\n if (!data.userPrompt) {\n this.hideOverlapPrompt();\n }\n this.resetActivationUI();\n window.tokenJustActivated = true;\n }\n static showSuccessMessage() {\n $(\".tokenBody\").append('
' +\n \"Success: \" +\n \"Token was activated!\" +\n '\" +\n \"
\");\n }\n static hideActivationButtons(hideActivateTokenBtn, hideWizardActivateToken, hideWizardActivateToken2, hideActivateThroughConfig) {\n if (hideActivateTokenBtn) {\n $(\"#activateTokenBtn\").hide();\n }\n if (hideWizardActivateToken) {\n $(\"#wizardActivateToken\").hide();\n }\n if (hideWizardActivateToken2) {\n $(\"#wizardActivateToken2\").hide();\n }\n if (hideActivateThroughConfig) {\n $(\"#activateThroughConfig\").hide();\n }\n }\n static handleWizardActivation() {\n if ($(\"#tokenInputBox_isWizard\").length) {\n $(\".beforeActivation\").addClass(\"hidden\");\n $(\".afterActivation\").removeClass(\"hidden\");\n $(\"#startWizard\").removeClass(\"linkDisabled\");\n $(\"#activateAnother\").removeClass(\"in\");\n if ($(\".wizard\").length > 0 && $(\"#tokenInputBox_isWizard\").length > 0) {\n $(\"#tokenInputBox_isWizard\").val(\"\");\n $(\"#activateAnotherLink, #loadingTokenActivation\").removeClass(\"hidden\").addClass(\"hidden\");\n $.ajax({\n url: window.location.origin + \"/ConfigWizard/CleanRegistrationSession\",\n type: \"POST\",\n });\n }\n }\n }\n static dispatchTokenActivationCompletedEvent() {\n const event = new Event(\"tokenActivation_completed\");\n document.dispatchEvent(event);\n }\n static showUserPrompt(appendDate, startDate = null) {\n const formattedDate = new Date(appendDate).toLocaleDateString();\n const formattedStartDate = startDate ? new Date(startDate).toLocaleDateString() : null;\n this.updatePromptMessages(formattedDate, formattedStartDate);\n this.setPromptControlsReadOnly();\n $(\".overlapPrompt\").show();\n $(\"#rbValidNow, #rbValidNow_isWizardModal, #rbValidNow_isWizard\").prop(\"checked\", true);\n }\n static updatePromptMessages(formattedEndDate, formattedStartDate = null) {\n const defaultMessage = `You have a valid subscription(s) until ${formattedEndDate}. Would you like to activate this new subscription now or after the current subscription ends? Alternatively, choose a custom date the subscription should start from.`;\n const defaultMessageStartDate = `You have a valid subscription(s) between ${formattedStartDate} and ${formattedEndDate}. Would you like to activate this new subscription now or after the current subscription ends? Alternatively, choose a custom date for the subscription to start.`;\n const updatedMessageHtml = formattedStartDate && formattedStartDate.trim() !== \"\"\n ? defaultMessageStartDate\n : defaultMessage;\n $(\"#lblTokenActivationMessage, #lblTokenActivationMessage_isWizard, #lblTokenActivationMessage_isWizardModal\").html(updatedMessageHtml);\n const validFromHtml = $(\"#lblRbValidFrom, #lblRbValidFrom_isWizardModal, #lblRbValidFrom_isWizard\").html();\n $(\"#lblRbValidFrom, #lblRbValidFrom_isWizardModal, #lblRbValidFrom_isWizard\").html(validFromHtml.replace(\"{0}\", formattedEndDate));\n }\n static setPromptControlsReadOnly() {\n $(\"#tokenInputBox, #tokenInputBox_isWizard\").prop(\"readonly\", true);\n }\n static showErrorMessage(errorMsg) {\n $(\".tokenBody\").append('
' +\n \"Error! \" +\n errorMsg +\n '\" +\n \"
\");\n }\n static hideOverlapPrompt() {\n $(\".overlapPrompt\").hide();\n $(\"#tokenInputBox, #tokenInputBox_isWizard\").prop(\"readonly\", false);\n }\n static resetActivationUI() {\n $(\"#activateAnotherLink, #loadingTokenActivation\").removeClass(\"hidden\").addClass(\"hidden\");\n $(\"#activateTokenBtn, #wizardActivateToken, #wizardActivateToken2, #activateThroughConfig\").prop(\"disabled\", false);\n }\n}\n\nexport { TokenActivationHelpers as T };\n\n","import { r as registerInstance, h } from './index-687e57d5.js';\nimport $ from 'jquery';\nimport { T as TokenActivationHelpers } from './token-activation-helpers-db86e106.js';\nimport { createFocusTrap } from 'focus-trap';\n\nconst cosoTokenActivationCss = \":host{display:block}\";\nconst CosoTokenActivationStyle0 = cosoTokenActivationCss;\n\nconst CosoTokenActivation = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.tokenActivationSuccess = false;\n this.closeModalRedirectPath = undefined;\n }\n componentWillLoad() {\n $(document).ready(() => {\n $(\"#tokenInputBox\").on(\"input\", function () {\n $(\".tokenBody .alert\").remove();\n $(\"#activateTokenBtn\").prop(\"disabled\", false);\n if (!$(\".modal-footer span[id='ajaxLoader']\").hasClass(\"hidden\")) {\n $(\".modal-footer span[id='ajaxLoader']\").addClass(\"hidden\");\n }\n });\n $(\"#tokenInputBox_isWizard\").on(\"input\", function () {\n $(\"#wizardActivateToken\").show();\n $(\".tokenBody .alert\").remove();\n });\n window.tokenJustActivated = false;\n $(\"#closeActivateToBtn\").click(function () {\n if (window.tokenJustActivated == false)\n return;\n window.location.reload();\n window.tokenJustActivated = false;\n });\n $(\"#activateTokenModal\").on(\"show.bs.modal\", (event) => {\n var button = $(event.relatedTarget);\n var id = button.attr(\"data-id\");\n this._token = button.attr(\"data-token\");\n var workerType = Number(button.attr(\"data-workertype\"));\n var controllerAction = button.attr(\"data-controlleraction\");\n if (!controllerAction)\n controllerAction = \"/Token/Activate/\";\n $(\"#activateTokenBtn, #wizardActivateToken\").off(\"click\");\n $(\"#activateTokenBtn, #wizardActivateToken\").on(\"click\", function () {\n $(this).prop(\"disabled\", true);\n var ctrlId = \"#tokenInputBox\";\n TokenActivationHelpers.activate(id, ctrlId, controllerAction, workerType);\n });\n $(\"#activateTokenBtn, #wizardActivateToken\").show();\n $(\"#tokenInputBox\").val(\"\");\n $(\"#tokenInput\").removeClass(\"has-error\");\n $(\".tokenBody .alert\").remove();\n $(\".overlapPrompt\").hide();\n $(\"#tokenInputBox\").prop(\"readonly\", false);\n });\n $(\"#activateTokenModal\").on(\"shown.bs.modal\", () => {\n if (this._token) {\n $(\"#tokenInputBox\").val(this._token);\n }\n this.activeFocusTrap = createFocusTrap(\"#activateTokenModal\");\n this.activeFocusTrap.activate();\n });\n $(\"#activateTokenModal\").on(\"hide.bs.modal\", () => {\n if (this.activeFocusTrap) {\n this.activeFocusTrap.deactivate();\n this.activeFocusTrap = null;\n }\n });\n });\n document.addEventListener(\"tokenActivation_completed\", () => {\n this.tokenActivationSuccess = true;\n });\n }\n componentDidLoad() {\n $(document).on(\"click\", \"#closeActivateToBtn\", () => {\n if (this.tokenActivationSuccess && this.closeModalRedirectPath) {\n window.location.href = this.closeModalRedirectPath;\n }\n this.tokenActivationSuccess = false;\n });\n }\n render() {\n return (h(\"div\", { key: '51344808c1eba349e65f701e1ad303b4a66a5a47', id: \"activateTokenModal\", class: \"modal fade\", role: \"dialog\", \"aria-label\": \"Token activation\" }, h(\"div\", { key: 'e0fd3779ecc145379f5b122d5832b310ccd7b257', class: \"modal-dialog modal-sm\" }, h(\"div\", { key: '01e173f736291919abf3640bd04094705c880d8f', class: \"modal-content\" }, h(\"div\", { key: '8eec3a21ac601bc9890f911ce083def29351ceed', class: \"modal-header\" }, h(\"h2\", { key: 'e751bd1a445036967c5aecd2e6551c774bb8dc32', class: \"h5 modal-title\" }, \"Token activation\"), h(\"button\", { key: '0b2b537052e8bda11d44c99d323210653268869a', type: \"button\", class: \"close\", \"data-dismiss\": \"modal\", \"aria-label\": \"Close\" }, h(\"span\", { key: 'ec24cb95ea676c12a3a881d6d16556e9d75bbc72', \"aria-hidden\": \"true\" }, \"\\u00D7\"))), h(\"div\", { key: '834b50037474ac755163054ef921dbb536c30c9d', class: \"modal-body tokenBody\", id: \"tokenBody\" }, h(\"coso-token-activation-form\", { key: 'b1cc91f21e98e38a4dd5bbaf50a7a11b295fd8a4' })), h(\"div\", { key: '3ccf3e181ed69d9f130e135131e3cac9238ec798', class: \"modal-footer\" }, h(\"button\", { key: '5b01d51d914e6682602599b0979d85af203f6f5b', id: \"closeActivateToBtn\", type: \"button\", class: \"btn btn-secondary \", \"data-dismiss\": \"modal\" }, \"Close\"), h(\"button\", { key: 'bdf10996c38e86ebd6a4afa0bf033f6d4e3db506', id: \"activateTokenBtn\", type: \"submit\", class: \"btn btn-primary\" }, \"Activate\", h(\"span\", { key: '025c4cb8f063928edf2f2784eb93829b18ce550b', id: \"loadingTokenActivation\", class: \"hidden\" }, h(\"span\", { key: 'c80a8906ec234a987d5b8120fb9b2cbfdf893b89', class: \"ml-1 fa fa-spinner fa-spin\" }))))))));\n }\n};\nCosoTokenActivation.style = CosoTokenActivationStyle0;\n\nconst cosoTokenActivationWizardCss = \":host{display:block}\";\nconst CosoTokenActivationWizardStyle0 = cosoTokenActivationWizardCss;\n\nconst CosoTokenActivationWizard = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.token = undefined;\n this.configurationId = undefined;\n this.tokenActivationUrl = \"/Token/Activate/\";\n this.productPricingUrl = undefined;\n this.isWizardStep = false;\n }\n render() {\n return [\n h(\"div\", { key: '759876fb865b89429eff054d9a7f4bfc20589a70', class: \"tokenBody\" }),\n h(\"div\", { key: 'c8537848decc442976a4ebb23e61de2d172d40fc', class: \"beforeActivation form-group row\" }, h(\"div\", { key: '83887eea586601c10981c26d8fca02cce30074d1', class: \"col-md-6\" }, h(\"coso-token-activation-form\", { key: 'a149eb7ec85b1d7d823db27a0ecf6f4ba9586202', token: this.token, isWizard: true, productPricingUrl: this.productPricingUrl }), h(\"button\", { key: 'f16062ba4eb3ec52213365c797afff220086a625', type: \"button\", id: \"activateThroughConfig\", class: \"btn btn-success\", onClick: () => TokenActivationHelpers.activate(this.configurationId, \"#tokenInputBox_isWizard\", this.tokenActivationUrl), disabled: !this.configurationId }, \"Activate\", h(\"span\", { key: 'f25869f81a63f401dd37fda9e30f4e63b8e86878', id: \"loadingTokenActivation\", class: \"hidden\" }, h(\"span\", { key: '8bcc4ff9a408fa64fef94dfd4e2b70d410b98957', class: \"ml-1 fa fa-spinner fa-spin\" }))))),\n h(\"div\", { key: '79687fc654b53f448a13b0deb4b624349625e0f9', class: \"afterActivation hidden\" }, h(\"p\", { key: '06be92342b327de87f46c7f198e5a957cec1bc36', style: { \"font-size\": \"1.5em\" } }, \"Token is now activated.\"), h(\"strong\", { key: '515156c7176d0c500cb46aa60cf54a0c48eb1510' }, \"Token Activated:\"), h(\"p\", { key: '7254e35ddd1c15c98999f32c065615e8e5ee2ac4' }, h(\"span\", { key: '2ada90258c1b267f9ffb415ef9abd8d06273ee35', id: \"token\", class: \"badge badge-pill badge-secondary\" })), this.isWizardStep ? (undefined) : (h(\"a\", { href: \"/\", class: \"btn btn-primary\" }, \"Go to Home\"))),\n ];\n }\n};\nCosoTokenActivationWizard.style = CosoTokenActivationWizardStyle0;\n\nexport { CosoTokenActivation as coso_token_activation, CosoTokenActivationWizard as coso_token_activation_wizard };\n\n"],"x_google_ignoreList":[0,1]}