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,EAAAA,EAAAA,OAAO3E,IACb,KAAM,EAAGjB,GACZC,SAIiB,eAAtByB,EAAYlC,QACV2F,EAAAA,EAAAA,cAAcC,EAAAA,EAAAA,oBAAoB,MAAOlF,EAAa,CACrDC,GACAhC,EAAAA,EAAAA,oBAAoB,OAAQ,CAAEwH,SAAU9B,IAAsB,EAC5DgC,EAAAA,EAAAA,YAAYZ,EAAKa,OAAQ,WACzB1F,GACC,OAEkB,YAAtBsB,EAAYlC,QACV2F,EAAAA,EAAAA,cAAcC,EAAAA,EAAAA,oBAAoB,MAAO/E,EAAa,EACrDlC,EAAAA,EAAAA,oBAAoB,MAAOmC,EAAa,EACtCyF,EAAAA,EAAAA,iBAAiB,8GACjBxF,GACApC,EAAAA,EAAAA,oBAAoB,MAAOqC,EAAa,EACtCrC,EAAAA,EAAAA,oBAAoB,OAAQ,CAAEwH,SAAUhD,IAAiB,CAC/B,OAAvBf,EAAapC,QACT2F,EAAAA,EAAAA,cAAcC,EAAAA,EAAAA,oBAAoB,MAAO,CACxCrH,IAAK,EACLE,MAAO,qBACPwH,aAAaC,EAAAA,EAAAA,iBAAiB9D,EAAapC,QAC1C,KAAM,EAAGiB,KACZuF,EAAAA,EAAAA,oBAAoB,IAAI,GAC5BtF,GACC,MAELE,QAGJoF,EAAAA,EAAAA,oBAAoB,IAAI,EAElC,ICrWA,MAAMC,EAAc,EAEpB,O","sources":["webpack://beliefnet-frontend/./src/components/newsletters/signup/Manage.vue?5d8c","webpack://beliefnet-frontend/./src/components/newsletters/signup/Manage.vue"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, vShow as _vShow, withDirectives as _withDirectives, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, unref as _unref, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, createTextVNode as _createTextVNode } from \"vue\"\n\nconst _hoisted_1 = { key: 0 }\nconst _hoisted_2 = { class: \"box-border-decoration add-most-padding text-center\" }\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"h3\", null, \"Thank you for updating your preferences.\", -1)\nconst _hoisted_4 = { class: \"add-padding\" }\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"h3\", null, \"You have successfully been unsubscribed from ALL Newsletters.\", -1)\nconst _hoisted_6 = /*#__PURE__*/_createElementVNode(\"h5\", null, \"Please allow up to 3 days for your changes to go into effect.\", -1)\nconst _hoisted_7 = [\n _hoisted_5,\n _hoisted_6\n]\nconst _hoisted_8 = { class: \"add-padding\" }\nconst _hoisted_9 = /*#__PURE__*/_createElementVNode(\"h5\", { class: \"text-left\" }, \"Newly Removed Newsletters:\", -1)\nconst _hoisted_10 = { class: \"list-unstyled two-column-list single-col-mobile\" }\nconst _hoisted_11 = [\"textContent\"]\nconst _hoisted_12 = { class: \"add-padding\" }\nconst _hoisted_13 = /*#__PURE__*/_createElementVNode(\"h5\", { class: \"text-left\" }, \"Newly Added Newsletters:\", -1)\nconst _hoisted_14 = { class: \"list-unstyled two-column-list single-col-mobile\" }\nconst _hoisted_15 = [\"textContent\"]\nconst _hoisted_16 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"add-more-padding\" }, \" We’re sorry to see you go! If you’d still like to receive great Beliefnet content, but just delivered less frequently, we hope you consider our once-a-week newsletter options below. \", -1)\nconst _hoisted_17 = { class: \"add-padding\" }\nconst _hoisted_18 = /*#__PURE__*/_createElementVNode(\"h5\", null, \" Click the respective buttons below to keep receiving your dose of Beliefnet, without the inbox clutter! \", -1)\nconst _hoisted_19 = { class: \"retention-signup\" }\nconst _hoisted_20 = [\"value\"]\nconst _hoisted_21 = /*#__PURE__*/_createElementVNode(\"input\", {\n type: \"hidden\",\n name: \"partners\",\n value: \"on\"\n}, null, -1)\nconst _hoisted_22 = /*#__PURE__*/_createElementVNode(\"input\", {\n type: \"hidden\",\n name: \"SourceDesc\",\n value: \"9003\"\n}, null, -1)\nconst _hoisted_23 = [\"value\"]\nconst _hoisted_24 = {\n type: \"submit\",\n class: \"btn btn-accent-2\"\n}\nconst _hoisted_25 = { class: \"clearfix add-more-padding col-sm-12 text-center\" }\nconst _hoisted_26 = {\n method: \"get\",\n action: \"/newsletter/manage.aspx\"\n}\nconst _hoisted_27 = [\"value\"]\nconst _hoisted_28 = /*#__PURE__*/_createElementVNode(\"input\", {\n type: \"submit\",\n value: \"Update Again?\",\n class: \"btn-lg btn-accent-2 add-padding\"\n}, null, -1)\nconst _hoisted_29 = { key: 1 }\nconst _hoisted_30 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"col-sm-12\" }, [\n /*#__PURE__*/_createElementVNode(\"div\", { class: \"box-border-decoration add-most-padding text-center\" }, [\n /*#__PURE__*/_createElementVNode(\"strong\", null, \" To complete the manage or unsubscribe process, uncheck the boxes next to the titles from which you wish to be removed, then click “Update Subscriptionâ€at the bottom of the page. \"),\n /*#__PURE__*/_createElementVNode(\"br\"),\n /*#__PURE__*/_createElementVNode(\"em\", null, \"(You can also check the boxes next to titles you wish to subscribe to if you wish!)\")\n ])\n], -1)\nconst _hoisted_31 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"clearfix add-more-padding col-sm-12 text-center\" }, [\n /*#__PURE__*/_createElementVNode(\"input\", {\n type: \"submit\",\n class: \"btn-lg btn-accent-2 add-padding\",\n value: \"Update Subscription\"\n })\n], -1)\nconst _hoisted_32 = { key: 2 }\nconst _hoisted_33 = { class: \"box-border-decoration text-center add-most-padding container-fluid\" }\nconst _hoisted_34 = /*#__PURE__*/_createElementVNode(\"strong\", null, \" Be sure to enter the e-mail address to which you are currently receiving newsletters from Beliefnet. \", -1)\nconst _hoisted_35 = { class: \"clearfix add-more-padding\" }\nconst _hoisted_36 = [\"textContent\"]\nconst _hoisted_37 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"input-group\" }, [\n /*#__PURE__*/_createElementVNode(\"input\", {\n type: \"email\",\n name: \"emailAddress\",\n class: \"form-control\",\n placeholder: \"Enter Your Email Address\"\n }),\n /*#__PURE__*/_createElementVNode(\"span\", { class: \"input-group-btn\" }, [\n /*#__PURE__*/_createElementVNode(\"input\", {\n type: \"submit\",\n class: \"btn btn-accent-2\",\n value: \"Submit\"\n })\n ])\n], -1)\nconst _hoisted_38 = /*#__PURE__*/_createElementVNode(\"a\", { href: \"/Newsletter/SignupProcess.aspx\" }, \" If you would like to subscribe to Beliefnet's free newsletters, please click here to sign up \", -1)\n\nimport { ref, toRefs, inject } from 'vue';\nimport { useLogger } from 'vue-logger-plugin';\nimport { NewsletterManageService } from '../../../services/newslettermanage.service';\nimport { useIdentityStore } from '../../../stores/identity-store';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Manage',\n props: { emailAddress: String },\n setup(__props) {\n\nconst props = __props;\n\nconst newsletterManageService: NewsletterManageService | undefined = inject('NewsletterManageService');\n\n// Incoming props\n\n\n// get back video id of what we need\nconst { emailAddress } = toRefs(props);\n\nconst logger = useLogger();\nconst currentPage = ref('initial');\nconst errorMessage = ref(null);\nconst unsubscribed = ref(false);\nconst addedNewsletters = ref([]);\nconst showNewNewsletters = ref(false);\nconst removedNewsletters = ref([]);\nconst showRemovedNewsletters = ref(false);\nconst showRetentionNewsletters = ref(false);\nconst retentionNewsletters = ref([]);\n\n// if an email argument was passed in let's change the page to the preference page\nif (emailAddress?.value !== null && emailAddress?.value?.length > 0) {\n logger.debug(`Got email ${emailAddress?.value} rendering preference page`);\n currentPage.value = 'preference';\n\n // after we capture the email, update the identity store\n if (emailAddress?.value) {\n const identity = useIdentityStore();\n identity.registerEmail(emailAddress.value).then(() => 'Identity Email Registration Complete');\n }\n}\n\n// when user enters an email\nconst onEmailSubmit = (e) => {\n e.preventDefault();\n\n // clear out the error\n errorMessage.value = null;\n\n const email = e.target.elements.emailAddress.value;\n if (email === null || email.length < 1) {\n errorMessage.value = 'Please enter an email address!';\n return false;\n }\n \n // after we capture the email, update the identity store\n if (email) {\n const identity = useIdentityStore();\n identity.registerEmail(email).then(() => 'Identity Email Registration Complete');\n }\n\n newsletterManageService?.checkEmailSubscriptions(email).then((res) => {\n if (res.processed === true) {\n const url = new URL(window.location.href);\n const emailAddressKey = 'emailAddress';\n\n // remove the param if it is there\n if (url.searchParams.has(emailAddressKey)) {\n url.searchParams.delete(emailAddressKey);\n }\n\n // add in the email that the user just entered.\n url.searchParams.append(emailAddressKey, email);\n\n logger.debug('switching to url', url.href);\n // valid email means we're going to show the preference page and redirect to the preference page instead\n window.location.href = url.href;\n } else if (res.processed === false) {\n errorMessage.value = 'Invalid email address';\n }\n });\n\n return false;\n};\n\n// when user updates preference\nconst onPreferenceSubmit = (e) => {\n e.preventDefault();\n\n // reset some values\n unsubscribed.value = false;\n showNewNewsletters.value = false;\n addedNewsletters.value = [];\n showRemovedNewsletters.value = false;\n removedNewsletters.value = [];\n showRetentionNewsletters.value = false;\n retentionNewsletters.value = [];\n\n // get back all the selected newsletters\n let newsletters = [];\n e.target.elements.newsletter.forEach((element) => {\n if (element.checked) {\n newsletters.push(element.value);\n }\n });\n\n // did user unsubscribed from all\n if (newsletters.length < 1) {\n unsubscribed.value = true;\n }\n\n newsletterManageService?.updateEmailSubscription(emailAddress?.value, newsletters).then((res) => {\n if (res.processed === true) {\n // show confirmation page\n currentPage.value = 'confirmation';\n // scroll to top of page\n window.scrollTo(0, 0);\n\n // determine if we added any new newsletters\n if (res.message.new.length > 0) {\n res.message.new.forEach((element) => {\n addedNewsletters.value.push(element.DisplayName);\n });\n showNewNewsletters.value = true;\n }\n\n // determine if we removed any newsletters\n if (res.message.removed.length > 0) {\n res.message.removed.forEach((element) => {\n removedNewsletters.value.push(element.DisplayName);\n });\n showRemovedNewsletters.value = true;\n }\n\n // determine if we have any retention newsletters\n if (res.message.retention.length > 0) {\n res.message.retention.forEach((element) => {\n retentionNewsletters.value.push({ listId: element.ListId, display: element.DisplayName });\n });\n showRetentionNewsletters.value = true;\n }\n }\n });\n};\n\n// rentention newsletter click\nconst onRetentionSubmit = (formElement) => {\n formElement.preventDefault();\n\n newsletterManageService\n ?.updateEmailSubscription(formElement.target.elements.email.value, [\n formElement.target.elements.newsletter.value\n ])\n .then((res) => {\n if (res.processed === true) {\n formElement.target.innerHTML = '<p>Thanks! Your preferences have been updated.</p>';\n }\n });\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (currentPage.value === 'confirmation')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _withDirectives(_createElementVNode(\"div\", _hoisted_4, _hoisted_7, 512), [\n [_vShow, unsubscribed.value]\n ]),\n _withDirectives(_createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createElementVNode(\"ul\", _hoisted_10, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(removedNewsletters.value, (name) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n class: \"border-list-items\",\n key: name,\n textContent: _toDisplayString(name)\n }, null, 8, _hoisted_11))\n }), 128))\n ])\n ], 512), [\n [_vShow, showRemovedNewsletters.value]\n ]),\n _withDirectives(_createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createElementVNode(\"ul\", _hoisted_14, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(addedNewsletters.value, (name) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n class: \"border-list-items\",\n key: name,\n textContent: _toDisplayString(name)\n }, null, 8, _hoisted_15))\n }), 128))\n ])\n ], 512), [\n [_vShow, showNewNewsletters.value]\n ]),\n _withDirectives(_createElementVNode(\"div\", null, [\n _hoisted_16,\n _createElementVNode(\"div\", _hoisted_17, [\n _hoisted_18,\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(retentionNewsletters.value, (newsletter) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"inline-block\",\n key: newsletter,\n onSubmit: onRetentionSubmit\n }, [\n _createElementVNode(\"form\", _hoisted_19, [\n _createElementVNode(\"input\", {\n type: \"hidden\",\n name: \"newsletter\",\n value: newsletter.listId\n }, null, 8, _hoisted_20),\n _hoisted_21,\n _hoisted_22,\n _createElementVNode(\"input\", {\n type: \"hidden\",\n name: \"email\",\n value: _unref(emailAddress)\n }, null, 8, _hoisted_23),\n _createElementVNode(\"button\", _hoisted_24, _toDisplayString(newsletter.display), 1)\n ])\n ], 32))\n }), 128))\n ])\n ], 512), [\n [_vShow, showRetentionNewsletters.value]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_25, [\n _createElementVNode(\"form\", _hoisted_26, [\n _createElementVNode(\"input\", {\n type: \"hidden\",\n name: \"emailAddress\",\n value: _unref(emailAddress)\n }, null, 8, _hoisted_27),\n _hoisted_28\n ])\n ])\n ]))\n : (currentPage.value === 'preference')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_29, [\n _hoisted_30,\n _createElementVNode(\"form\", { onSubmit: onPreferenceSubmit }, [\n _renderSlot(_ctx.$slots, \"default\"),\n _hoisted_31\n ], 32)\n ]))\n : (currentPage.value === 'initial')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_32, [\n _createElementVNode(\"div\", _hoisted_33, [\n _createTextVNode(\" To manage or unsubscribe from Beliefnet newsletters, please begin by entering your e-mail address below. \"),\n _hoisted_34,\n _createElementVNode(\"div\", _hoisted_35, [\n _createElementVNode(\"form\", { onSubmit: onEmailSubmit }, [\n (errorMessage.value !== null)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"alert alert-danger\",\n textContent: _toDisplayString(errorMessage.value)\n }, null, 8, _hoisted_36))\n : _createCommentVNode(\"\", true),\n _hoisted_37\n ], 32)\n ]),\n _hoisted_38\n ])\n ]))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./Manage.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Manage.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"names":["_hoisted_1","key","_hoisted_2","class","_hoisted_3","_createElementVNode","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","type","name","value","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","method","action","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","placeholder","_hoisted_38","href","_defineComponent","__name","props","emailAddress","String","setup","__props","newsletterManageService","inject","toRefs","logger","useLogger","currentPage","ref","errorMessage","unsubscribed","addedNewsletters","showNewNewsletters","removedNewsletters","showRemovedNewsletters","showRetentionNewsletters","retentionNewsletters","_a","length","debug","identity","useIdentityStore","registerEmail","then","onEmailSubmit","e","preventDefault","email","target","elements","checkEmailSubscriptions","res","processed","url","URL","window","location","emailAddressKey","searchParams","has","delete","append","onPreferenceSubmit","newsletters","newsletter","forEach","element","checked","push","updateEmailSubscription","scrollTo","message","new","DisplayName","removed","retention","listId","ListId","display","onRetentionSubmit","formElement","innerHTML","_ctx","_cache","_openBlock","_createElementBlock","_withDirectives","_vShow","_Fragment","_renderList","textContent","_toDisplayString","onSubmit","_unref","_renderSlot","$slots","_createTextVNode","_createCommentVNode","__exports__"],"sourceRoot":""}