@sunrise-upc/mobile-prod-card 12.3.1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/OttMiniSummaryCard/OttMiniSummaryCard.css +1 -1
- package/dist/esm/components/OttMiniSummaryCard/OttMiniSummaryCard.js +1 -1
- package/dist/esm/components/OttMiniSummaryCard/OttMiniSummaryCard.js.map +1 -1
- package/dist/esm/components/OttMiniSummaryCard/OttMiniSummaryCard.module.scss.js +1 -1
- package/dist/esm/components/StaticLineTable/ConflictPopup/ConflictPopup.js +2 -0
- package/dist/esm/components/StaticLineTable/ConflictPopup/ConflictPopup.js.map +1 -0
- package/dist/esm/components/StaticLineTable/Product.utils.js +1 -1
- package/dist/esm/components/StaticLineTable/Product.utils.js.map +1 -1
- package/dist/esm/components/StaticLineTable/StaticLineTable.css +1 -1
- package/dist/esm/components/StaticLineTable/StaticLineTable.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticLineTable.js.map +1 -1
- package/dist/esm/components/StaticLineTable/StaticLineTable.module.scss.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticLineTableStore/StaticLineTableProvider.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticLineTableStore/StaticLineTableProvider.js.map +1 -1
- package/dist/esm/components/StaticLineTable/StaticProduct.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticProduct.js.map +1 -1
- package/dist/esm/components/StaticLineTable/StaticProductContainer.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticProductContainer.js.map +1 -1
- package/dist/esm/components/StaticLineTable/StaticProductEntitlement.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticProductEntitlement.js.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/lineTable/BundleProductsV3.js +1 -1
- package/dist/esm/components/lineTable/BundleProductsV3.js.map +1 -1
- package/dist/esm/components/lineTable/ProductTableV3.js +1 -1
- package/dist/esm/components/lineTable/ProductTableV3.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/services/LineTableService.js +1 -1
- package/dist/esm/services/LineTableService.js.map +1 -1
- package/dist/esm/utils/utils.js +1 -1
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/index.d.ts +47 -2
- package/package.json +1 -4
- package/dist/esm/components/StaticLineTable/LineTableCarousel.js +0 -2
- package/dist/esm/components/StaticLineTable/LineTableCarousel.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.card_nhPE4.sr-card_XQCLI{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_nhPE4.border-top_zEpKG{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_zFjck{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_xrrV3{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_JfaWI{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.wrapper_FHr8L{width:100%}.heading_EkfHv{font-size:28px;font-weight:700;line-height:36px}@media (max-width:767px){.heading_EkfHv{font-size:20px}}.cardContainer_UXctf{display:flex;justify-content:space-between;align-items:center;padding:24px;background-color:#fff;border-radius:8px;border:1px solid #e0e0e0;gap:24px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);margin:24px 0 32px;position:relative}@media (max-width:767px){.cardContainer_UXctf{padding:16px;gap:12px;flex-direction:row;align-items:center;margin:16px 0}}.cardContainer_UXctf .ribbon-top_LTKu3{position:absolute;top:-12px;z-index:3;color:#fff;overflow:hidden;border-radius:4px;padding:4px 6px}.cardContainer_UXctf .ribbon-top_LTKu3.align-left_xLIHI{left:16px}.cardContainer_UXctf .ribbon-top_LTKu3.align-center_StFq8{left:50%;transform:translateX(-50%)}.cardContainer_UXctf .ribbon-top_LTKu3 span{color:#fff;text-align:center;line-height:16px;font-weight:700;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.imageProductWrapper_hgYe0{display:flex;align-items:center;gap:12px;flex:1}@media (max-width:767px){.imageProductWrapper_hgYe0{width:auto;flex:1;gap:12px;align-items:center}}.imageContainer_JpADZ{flex-shrink:0;display:flex;align-items:center}@media (max-width:767px){.imageContainer_JpADZ{padding:0;width:48px;height:48px}}.productIcon_ND6WM{width:64px;height:64px;object-fit:contain;flex-shrink:0}@media (max-width:767px){.productIcon_ND6WM{width:48px;height:48px}}.contentContainer_riTwc{display:flex;flex-direction:column}@media (max-width:767px){.contentContainer_riTwc{gap:2px;flex:1}}.headingText_542wd{font-size:20px;font-weight:700;line-height:28px;color:#3d3935}@media (max-width:767px){.headingText_542wd{font-size:16px;line-height:22px}}.hardwareDetails_2TsuW{font-size:18px;font-weight:400;line-height:24px;color:#3d3935;margin-top:2px}@media (max-width:767px){.hardwareDetails_2TsuW{font-size:13px;line-height:18px}}.hardwarePayment_5O3Vf{font-size:16px;font-weight:400;line-height:24px;color:#3d3935;margin-top:4px}@media (max-width:767px){.hardwarePayment_5O3Vf{font-size:12px;line-height:16px}}.productsSection_ZWUIq{display:flex;flex-direction:column;gap:4px;flex:1}.actionContainer_du7x3{display:flex;align-items:center;justify-content:flex-end;flex-shrink:0}@media (max-width:767px){.actionContainer_du7x3{width:auto;justify-content:flex-end;margin-left:8px}}.priceContainer_xgxaU{display:flex;flex-direction:row;align-items:flex-end;gap:8px;flex-shrink:0;margin-left:auto}@media (max-width:767px){.priceContainer_xgxaU{width:auto;flex-direction:column;align-items:flex-end;margin-left:0;margin-top:0;gap:0}}.priceWrapper_ytXOY{display:flex;flex-direction:row;align-items:flex-end;gap:8px}.basePrice_gfaSl{font-size:18px;font-weight:400;line-height:24px;text-decoration:line-through;position:relative;color:#3d3935;text-align:right}@media (max-width:767px){.basePrice_gfaSl{font-size:16px;line-height:20px}}.basePrice_gfaSl:after{border-bottom:2px solid #e6003c;content:"";width:100%;position:absolute;right:-1px;top:50%;transform:translateY(-50%)}.productName_daCpa{font-size:20px;font-weight:700;line-height:28px}@media (max-width:767px){.productName_daCpa{font-size:14px;line-height:20px;font-weight:600}}.actualPrice_-IfKh{font-size:20px;font-weight:700;line-height:28px;text-align:right}.actualPrice_-IfKh span{font-size:16px;font-weight:400;line-height:24px}@media (max-width:767px){.actualPrice_-IfKh{font-size:14px;line-height:20px;font-weight:700}.actualPrice_-IfKh span{font-size:12px;font-weight:400}}.changeButton_YzpTb{background:transparent;border:none;color:#da291c;font-size:16px;font-weight:700;cursor:pointer;padding:4px 8px;transition:opacity .2s ease;white-space:nowrap}.changeButton_YzpTb img{margin-left:4px}.changeButton_YzpTb:hover{opacity:.8}@media (max-width:767px){.changeButton_YzpTb{font-size:0;padding:4px}.changeButton_YzpTb img{margin-left:0;width:20px;height:20px}}
|
|
1
|
+
.card_nhPE4.sr-card_XQCLI{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_nhPE4.border-top_zEpKG{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_zFjck{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_xrrV3{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_JfaWI{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.wrapper_FHr8L{width:100%}.heading_EkfHv{font-size:28px;font-weight:700;line-height:36px}@media (max-width:767px){.heading_EkfHv{font-size:20px}}.cardContainer_UXctf{display:flex;justify-content:space-between;align-items:center;padding:24px;background-color:#fff;border-radius:8px;border:1px solid #e0e0e0;gap:24px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);margin:24px 0 32px;position:relative}@media (max-width:767px){.cardContainer_UXctf{padding:16px;gap:12px;flex-direction:row;align-items:center;margin:16px 0}}.cardContainer_UXctf .ribbon-top_LTKu3{position:absolute;top:-12px;z-index:3;color:#fff;overflow:hidden;border-radius:4px;padding:4px 6px}.cardContainer_UXctf .ribbon-top_LTKu3.align-left_xLIHI{left:16px}.cardContainer_UXctf .ribbon-top_LTKu3.align-center_StFq8{left:50%;transform:translateX(-50%)}.cardContainer_UXctf .ribbon-top_LTKu3 span{color:#fff;text-align:center;line-height:16px;font-weight:700;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.imageProductWrapper_hgYe0{display:flex;align-items:center;gap:12px;flex:1}@media (max-width:767px){.imageProductWrapper_hgYe0{width:auto;flex:1;gap:12px;align-items:center}}.imageContainer_JpADZ{flex-shrink:0;display:flex;align-items:center}@media (max-width:767px){.imageContainer_JpADZ{padding:0;width:48px;height:48px}}.productIcon_ND6WM{width:64px;height:64px;object-fit:contain;flex-shrink:0}@media (max-width:767px){.productIcon_ND6WM{width:48px;height:48px}}.contentContainer_riTwc{display:flex;flex-direction:column}@media (max-width:767px){.contentContainer_riTwc{gap:2px;flex:1}}.headingText_542wd{font-size:20px;font-weight:700;line-height:28px;color:#3d3935}@media (max-width:767px){.headingText_542wd{font-size:16px;line-height:22px}}.hardwareDetails_2TsuW{font-size:18px;font-weight:400;line-height:24px;color:#3d3935;margin-top:2px}@media (max-width:767px){.hardwareDetails_2TsuW{font-size:13px;line-height:18px}}.hardwarePayment_5O3Vf{font-size:16px;font-weight:400;line-height:24px;color:#3d3935;margin-top:4px}@media (max-width:767px){.hardwarePayment_5O3Vf{font-size:12px;line-height:16px}}.productsSection_ZWUIq{display:flex;flex-direction:column;gap:4px;flex:1}.bundleItem_NtXD7{font-size:14px;font-weight:400;line-height:20px;color:#3d3935}@media (max-width:767px){.bundleItem_NtXD7{font-size:12px;line-height:16px}}.actionContainer_du7x3{display:flex;align-items:center;justify-content:flex-end;flex-shrink:0}@media (max-width:767px){.actionContainer_du7x3{width:auto;justify-content:flex-end;margin-left:8px}}.priceContainer_xgxaU{display:flex;flex-direction:row;align-items:flex-end;gap:8px;flex-shrink:0;margin-left:auto}@media (max-width:767px){.priceContainer_xgxaU{width:auto;flex-direction:column;align-items:flex-end;margin-left:0;margin-top:0;gap:0}}.priceWrapper_ytXOY{display:flex;flex-direction:row;align-items:flex-end;gap:8px}.basePrice_gfaSl{font-size:18px;font-weight:400;line-height:24px;text-decoration:line-through;position:relative;color:#3d3935;text-align:right}@media (max-width:767px){.basePrice_gfaSl{font-size:16px;line-height:20px}}.basePrice_gfaSl:after{border-bottom:2px solid #e6003c;content:"";width:100%;position:absolute;right:-1px;top:50%;transform:translateY(-50%)}.productName_daCpa{font-size:20px;font-weight:700;line-height:28px}@media (max-width:767px){.productName_daCpa{font-size:14px;line-height:20px;font-weight:600}}.actualPrice_-IfKh{font-size:20px;font-weight:700;line-height:28px;text-align:right}.actualPrice_-IfKh span{font-size:16px;font-weight:400;line-height:24px}@media (max-width:767px){.actualPrice_-IfKh{font-size:14px;line-height:20px;font-weight:700}.actualPrice_-IfKh span{font-size:12px;font-weight:400}}.changeButton_YzpTb{background:transparent;border:none;color:#da291c;font-size:16px;font-weight:700;cursor:pointer;padding:4px 8px;transition:opacity .2s ease;white-space:nowrap}.changeButton_YzpTb img{margin-left:4px}.changeButton_YzpTb:hover{opacity:.8}@media (max-width:767px){.changeButton_YzpTb{font-size:0;padding:4px}.changeButton_YzpTb img{margin-left:0;width:20px;height:20px}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import a from"./OttMiniSummaryCard.module.scss.js";import{viewport as l,replacePlaceholder as t,countZero as i}from"../../utils/utils.js";import n from"../ResponsiveRow/row.js";const r=({content:r,cartData:
|
|
1
|
+
import e from"react";import a from"./OttMiniSummaryCard.module.scss.js";import{viewport as l,replacePlaceholder as t,countZero as i}from"../../utils/utils.js";import n from"../ResponsiveRow/row.js";const r=({content:r,cartData:o,redirectionUrl:c})=>{const m=l();return e.createElement(n,null,e.createElement("section",{className:a.wrapper,"aria-labelledby":"summary-heading"},(null==r?void 0:r.title)&&e.createElement("h3",{id:"summary-heading",className:a.heading},null==r?void 0:r.title),null==o?void 0:o.map((l,n)=>{var d,s;return e.createElement("article",{key:n,className:a.cardContainer,role:"region","aria-label":"Selected products summary"},e.createElement("div",{className:a.imageProductWrapper},(null==l?void 0:l.hardwareImageUrl)&&e.createElement("div",{className:a.imageContainer},e.createElement("img",{src:null==l?void 0:l.hardwareImageUrl,alt:`${null==l?void 0:l.itemName} icon`,className:a.productIcon,width:"mobile"===m?64:96,height:"mobile"===m?64:96})),e.createElement("div",{className:a.contentContainer},e.createElement("div",{className:a.productsSection},e.createElement("span",{className:a.productName,"aria-label":`Selected product: ${null==l?void 0:l.itemName}`},null==l?void 0:l.itemName),(s=null==l?void 0:l.bundleItems,Array.isArray(s)?s.map(e=>String(e).trim()).filter(Boolean):"string"==typeof s?s.split(/[|,]/).map(e=>e.trim()).filter(Boolean):[]).map((l,t)=>e.createElement("span",{key:`${l}-${t}`,className:a.bundleItem},l))),"HOME_SECURITY"===(null==l?void 0:l.itemType)&&e.createElement("div",{className:a.hardwarePayment},(null==r?void 0:r.hsDevicesLabel)&&e.createElement("span",null,null==r?void 0:r.hsDevicesLabel)," "," ",(null==l?void 0:l.accessoryCount)>0&&(null==r?void 0:r.hsAdditionalAccLabel)&&t(null==r?void 0:r.hsAdditionalAccLabel,[null==l?void 0:l.accessoryCount])))),e.createElement("div",{className:a.priceContainer},(null==l?void 0:l.itemDerivedPrice)?e.createElement(e.Fragment,null,e.createElement("span",{className:a.actualPrice,"aria-label":`Total price: ${i(Number(null==l?void 0:l.itemDerivedPrice).toFixed(2))} per month`},i(Number(null==l?void 0:l.itemDerivedPrice).toFixed(2)),e.createElement("span",{"aria-hidden":"true"},null==r?void 0:r.month)),e.createElement("span",{className:a.basePrice,"aria-label":`Original price: ${i(Number(null==l?void 0:l.itemDiscountedPrice).toFixed(2))}`},i(Number(null==l?void 0:l.itemDiscountedPrice).toFixed(2)))):(null==l?void 0:l.itemOneTimePrice)?e.createElement("span",{className:a.actualPrice,"aria-label":`Total price: ${i(Number(null==l?void 0:l.itemDiscountedPrice).toFixed(2))} per month`},i(Number(null==l?void 0:l.itemOneTimePrice).toFixed(2)),e.createElement("span",{"aria-hidden":"true"},"/-")):e.createElement("span",{className:a.actualPrice,"aria-label":`Total price: ${i(Number(null==l?void 0:l.itemDiscountedPrice).toFixed(2))} per month`},i(Number(null==l?void 0:l.itemDiscountedPrice).toFixed(2)),e.createElement("span",{"aria-hidden":"true"},null==r?void 0:r.month))),(null==o?void 0:o.length)===n+1&&e.createElement("div",{className:a.actionContainer},e.createElement("button",{className:a.changeButton,"aria-label":"Change selected products",type:"button",onClick:()=>{c&&(window.location.href=c)}},"mobile"!==m&&(null==r?void 0:r.changeText),e.createElement("img",{src:null===(d=null==r?void 0:r.changeIcon)||void 0===d?void 0:d.filename,alt:"edit icon",role:"presentation"}))))})))};export{r as default};
|
|
2
2
|
//# sourceMappingURL=OttMiniSummaryCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OttMiniSummaryCard.js","sources":["../../../../src/components/OttMiniSummaryCard/OttMiniSummaryCard.tsx"],"sourcesContent":["import React, { JSX } from 'react';\r\nimport styles from './OttMiniSummaryCard.module.scss';\r\nimport { countZero, replacePlaceholder, viewport } from '../../utils/utils';\r\nimport Row from '../ResponsiveRow';\r\n\r\nexport interface ProductItem {\r\n changeText: string;\r\n month: string;\r\n changeIcon: any;\r\n title:string;\r\n hsDevicesLabel: string;\r\n hsAdditionalAccLabel: string;\r\n}\r\n\r\nexport interface OttMiniSummaryCardProps {\r\n content: ProductItem;\r\n cartData: any;\r\n redirectionUrl?: string;\r\n}\r\n\r\nconst OttMiniSummaryCard = ({ content, cartData, redirectionUrl }: OttMiniSummaryCardProps): JSX.Element => {\r\n const viewPortType = viewport();\r\n return (\r\n <Row>\r\n <section className={styles.wrapper} aria-labelledby='summary-heading'>\r\n {content?.title && <h3 id='summary-heading' className={styles.heading}>{content?.title}</h3>}\r\n {cartData?.map((item: any, index: number) => {\r\n return (\r\n <article\r\n key={index}\r\n className={styles.cardContainer}\r\n role='region'\r\n aria-label='Selected products summary'\r\n >\r\n {/* Image and Product Title Section */}\r\n <div className={styles.imageProductWrapper}>\r\n {item?.hardwareImageUrl && (\r\n <div className={styles.imageContainer}>\r\n <img\r\n src={item?.hardwareImageUrl}\r\n alt={`${item?.itemName} icon`}\r\n className={styles.productIcon}\r\n width={viewPortType === 'mobile' ? 64 : 96}\r\n height={viewPortType === 'mobile' ? 64 : 96}\r\n />\r\n </div>\r\n )}\r\n <div className={styles.contentContainer}>\r\n {/* {item?.isHardware ? (\r\n <>\r\n <div className={styles.headingText}>{item?.hardwareProductTitle}</div>\r\n {item?.hardwareDetails && (\r\n <div className={styles.hardwareDetails}>{item?.hardwareDetails}</div>\r\n )}\r\n <div className={styles.hardwarePayment}>\r\n In 24 monthly installments. Down payment: {countZero(1)}.–\r\n </div>\r\n </>\r\n ) : ( */}\r\n <div className={styles.productsSection}>\r\n <span\r\n className={styles.productName}\r\n aria-label={`Selected product: ${item?.itemName}`}\r\n >\r\n {item?.itemName}\r\n </span>\r\n </div>\r\n {/* )} */}\r\n {item?.itemType === 'HOME_SECURITY' && (\r\n <div className={styles.hardwarePayment}>\r\n {content?.hsDevicesLabel && <span>{content?.hsDevicesLabel}</span>} {' '}\r\n {item?.accessoryCount > 0 &&\r\n content?.hsAdditionalAccLabel &&\r\n replacePlaceholder(content?.hsAdditionalAccLabel, [item?.accessoryCount])}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n\r\n {/* Price Section */}\r\n <div className={styles.priceContainer}>\r\n {item?.itemDerivedPrice ? (\r\n <>\r\n <span\r\n className={styles.actualPrice}\r\n aria-label={`Total price: ${countZero(\r\n Number(item?.itemDerivedPrice).toFixed(2)\r\n )} per month`}\r\n >\r\n {countZero(Number(item?.itemDerivedPrice).toFixed(2))}\r\n <span aria-hidden='true'>{content?.month}</span>\r\n </span>\r\n <span\r\n className={styles.basePrice}\r\n aria-label={`Original price: ${countZero(\r\n Number(item?.itemDiscountedPrice).toFixed(2)\r\n )}`}\r\n >\r\n {countZero(Number(item?.itemDiscountedPrice).toFixed(2))}\r\n </span>\r\n </>\r\n ) : item?.itemOneTimePrice ? <span\r\n className={styles.actualPrice}\r\n aria-label={`Total price: ${countZero(\r\n Number(item?.itemDiscountedPrice).toFixed(2)\r\n )} per month`}\r\n >\r\n {countZero(Number(item?.itemOneTimePrice).toFixed(2))}\r\n <span aria-hidden='true'>/-</span>\r\n </span> : (\r\n <span\r\n className={styles.actualPrice}\r\n aria-label={`Total price: ${countZero(\r\n Number(item?.itemDiscountedPrice).toFixed(2)\r\n )} per month`}\r\n >\r\n {countZero(Number(item?.itemDiscountedPrice).toFixed(2))}\r\n <span aria-hidden='true'>{content?.month}</span>\r\n </span>\r\n )}\r\n </div>\r\n\r\n {/* Change Button Section - Show on last element if 2 cards, always show if 1 card */}\r\n {(cartData?.length === index + 1) && (\r\n <div className={styles.actionContainer}>\r\n <button\r\n className={styles.changeButton}\r\n aria-label='Change selected products'\r\n type='button'\r\n onClick={() => {\r\n // const redirectionUrl = returnPreviousUrl(is4pFlow ? '4P' : item?.itemType);\r\n if (redirectionUrl) {\r\n window.location.href = redirectionUrl;\r\n }\r\n }}\r\n >\r\n {viewPortType !== 'mobile' && content?.changeText}\r\n <img src={content?.changeIcon?.filename} alt='edit icon' role='presentation' />\r\n </button>\r\n </div>\r\n )}\r\n </article>\r\n );\r\n })}\r\n </section>\r\n </Row>\r\n );\r\n};\r\n\r\nexport default OttMiniSummaryCard;\r\n"],"names":["OttMiniSummaryCard","content","cartData","redirectionUrl","viewPortType","viewport","React","Row","createElement","className","styles","wrapper","title","id","heading","map","item","index","key","cardContainer","role","imageProductWrapper","hardwareImageUrl","imageContainer","src","alt","itemName","productIcon","width","height","contentContainer","productsSection","productName","itemType","hardwarePayment","hsDevicesLabel","accessoryCount","hsAdditionalAccLabel","replacePlaceholder","priceContainer","itemDerivedPrice","Fragment","actualPrice","countZero","Number","toFixed","month","basePrice","itemDiscountedPrice","itemOneTimePrice","length","actionContainer","changeButton","type","onClick","window","location","href","changeText","_a","changeIcon","filename"],"mappings":"sMAoBA,MAAMA,EAAqB,EAAGC,UAASC,WAAUC,qBAC/C,MAAMC,EAAeC,IACrB,OACEC,gBAACC,EAAG,KACFD,EAAAE,cAAA,UAAA,CAASC,UAAWC,EAAOC,0BAAyB,oBACjDV,aAAO,EAAPA,EAASW,QAASN,EAAAE,cAAA,KAAA,CAAIK,GAAG,kBAAkBJ,UAAWC,EAAOI,SAAUb,aAAO,EAAPA,EAASW,OAChFV,aAAQ,EAARA,EAAUa,IAAI,CAACC,EAAWC,WACzB,OACEX,EAAAE,cAAA,UAAA,CACEU,IAAKD,EACLR,UAAWC,EAAOS,cAClBC,KAAK,sBACM,6BAGXd,EAAAE,cAAA,MAAA,CAAKC,UAAWC,EAAOW,sBACpBL,aAAI,EAAJA,EAAMM,mBACLhB,EAAAE,cAAA,MAAA,CAAKC,UAAWC,EAAOa,gBACrBjB,EAAAE,cAAA,MAAA,CACEgB,IAAKR,aAAI,EAAJA,EAAMM,iBACXG,IAAK,GAAGT,aAAI,EAAJA,EAAMU,gBACdjB,UAAWC,EAAOiB,YAClBC,MAAwB,WAAjBxB,EAA4B,GAAK,GACxCyB,OAAyB,WAAjBzB,EAA4B,GAAK,MAI/CE,EAAAE,cAAA,MAAA,CAAKC,UAAWC,EAAOoB,kBAYnBxB,EAAAE,cAAA,MAAA,CA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AAE,cAAA,OAAA,CAAA,cAAkB,QAAM,OAE1BF,EAAAE,cAAA,OAAA,CACEC,UAAWC,EAAOgC,yBACN,gBAAgBC,EAC1BC,OAAO5B,eAAAA,EAAMgC,qBAAqBH,QAAQ,iBAG3CF,EAAUC,OAAO5B,aAAI,EAAJA,EAAMgC,qBAAqBH,QAAQ,IACrDvC,EAAAE,cAAA,OAAA,CAAA,cAAkB,QAAQP,aAAO,EAAPA,EAAS6C,UAMvC5C,eAAAA,EAAUgD,UAAWjC,EAAQ,GAC7BX,EAAAE,cAAA,MAAA,CAAKC,UAAWC,EAAOyC,iBACrB7C,EAAAE,cAAA,SAAA,CACEC,UAAWC,EAAO0C,aAAY,aACnB,2BACXC,KAAK,SACLC,QAAS,KAEHnD,IACFoD,OAAOC,SAASC,KAAOtD,KAIT,WAAjBC,IAA6BH,aAAO,EAAPA,EAASyD,YACvCpD,EAAAE,cAAA,MAAA,CAAKgB,IAAwB,QAAnBmC,EAAA1D,aAAO,EAAPA,EAAS2D,kBAAU,IAAAD,OAAA,EAAAA,EAAEE,SAAUpC,IAAI,YAAYL,KAAK"}
|
|
1
|
+
{"version":3,"file":"OttMiniSummaryCard.js","sources":["../../../../src/components/OttMiniSummaryCard/OttMiniSummaryCard.tsx"],"sourcesContent":["import React, { JSX } from 'react';\r\nimport styles from './OttMiniSummaryCard.module.scss';\r\nimport { countZero, replacePlaceholder, viewport } from '../../utils/utils';\r\nimport Row from '../ResponsiveRow';\r\n\r\nexport interface ProductItem {\r\n changeText: string;\r\n month: string;\r\n changeIcon: any;\r\n title:string;\r\n hsDevicesLabel: string;\r\n hsAdditionalAccLabel: string;\r\n}\r\n\r\nexport interface OttMiniSummaryCardProps {\r\n content: ProductItem;\r\n cartData: any;\r\n redirectionUrl?: string;\r\n}\r\n\r\n// Host passes an array; a ',' or '|' separated string is still accepted\r\nconst getBundleItems = (bundleItems?: string[] | string): string[] => {\r\n if (Array.isArray(bundleItems)) {\r\n return bundleItems.map((bundleItem) => String(bundleItem).trim()).filter(Boolean);\r\n }\r\n return typeof bundleItems === 'string'\r\n ? bundleItems.split(/[|,]/).map((bundleItem) => bundleItem.trim()).filter(Boolean)\r\n : [];\r\n};\r\n\r\nconst OttMiniSummaryCard = ({ content, cartData, redirectionUrl }: OttMiniSummaryCardProps): JSX.Element => {\r\n const viewPortType = viewport();\r\n return (\r\n <Row>\r\n <section className={styles.wrapper} aria-labelledby='summary-heading'>\r\n {content?.title && <h3 id='summary-heading' className={styles.heading}>{content?.title}</h3>}\r\n {cartData?.map((item: any, index: number) => {\r\n return (\r\n <article\r\n key={index}\r\n className={styles.cardContainer}\r\n role='region'\r\n aria-label='Selected products summary'\r\n >\r\n {/* Image and Product Title Section */}\r\n <div className={styles.imageProductWrapper}>\r\n {item?.hardwareImageUrl && (\r\n <div className={styles.imageContainer}>\r\n <img\r\n src={item?.hardwareImageUrl}\r\n alt={`${item?.itemName} icon`}\r\n className={styles.productIcon}\r\n width={viewPortType === 'mobile' ? 64 : 96}\r\n height={viewPortType === 'mobile' ? 64 : 96}\r\n />\r\n </div>\r\n )}\r\n <div className={styles.contentContainer}>\r\n {/* {item?.isHardware ? (\r\n <>\r\n <div className={styles.headingText}>{item?.hardwareProductTitle}</div>\r\n {item?.hardwareDetails && (\r\n <div className={styles.hardwareDetails}>{item?.hardwareDetails}</div>\r\n )}\r\n <div className={styles.hardwarePayment}>\r\n In 24 monthly installments. Down payment: {countZero(1)}.–\r\n </div>\r\n </>\r\n ) : ( */}\r\n <div className={styles.productsSection}>\r\n <span\r\n className={styles.productName}\r\n aria-label={`Selected product: ${item?.itemName}`}\r\n >\r\n {item?.itemName}\r\n </span>\r\n {getBundleItems(item?.bundleItems).map((bundleItem, bundleIndex) => (\r\n <span key={`${bundleItem}-${bundleIndex}`} className={styles.bundleItem}>\r\n {bundleItem}\r\n </span>\r\n ))}\r\n </div>\r\n {/* )} */}\r\n {item?.itemType === 'HOME_SECURITY' && (\r\n <div className={styles.hardwarePayment}>\r\n {content?.hsDevicesLabel && <span>{content?.hsDevicesLabel}</span>} {' '}\r\n {item?.accessoryCount > 0 &&\r\n content?.hsAdditionalAccLabel &&\r\n replacePlaceholder(content?.hsAdditionalAccLabel, [item?.accessoryCount])}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n\r\n {/* Price Section */}\r\n <div className={styles.priceContainer}>\r\n {item?.itemDerivedPrice ? (\r\n <>\r\n <span\r\n className={styles.actualPrice}\r\n aria-label={`Total price: ${countZero(\r\n Number(item?.itemDerivedPrice).toFixed(2)\r\n )} per month`}\r\n >\r\n {countZero(Number(item?.itemDerivedPrice).toFixed(2))}\r\n <span aria-hidden='true'>{content?.month}</span>\r\n </span>\r\n <span\r\n className={styles.basePrice}\r\n aria-label={`Original price: ${countZero(\r\n Number(item?.itemDiscountedPrice).toFixed(2)\r\n )}`}\r\n >\r\n {countZero(Number(item?.itemDiscountedPrice).toFixed(2))}\r\n </span>\r\n </>\r\n ) : item?.itemOneTimePrice ? <span\r\n className={styles.actualPrice}\r\n aria-label={`Total price: ${countZero(\r\n Number(item?.itemDiscountedPrice).toFixed(2)\r\n )} per month`}\r\n >\r\n {countZero(Number(item?.itemOneTimePrice).toFixed(2))}\r\n <span aria-hidden='true'>/-</span>\r\n </span> : (\r\n <span\r\n className={styles.actualPrice}\r\n aria-label={`Total price: ${countZero(\r\n Number(item?.itemDiscountedPrice).toFixed(2)\r\n )} per month`}\r\n >\r\n {countZero(Number(item?.itemDiscountedPrice).toFixed(2))}\r\n <span aria-hidden='true'>{content?.month}</span>\r\n </span>\r\n )}\r\n </div>\r\n\r\n {/* Change Button Section - Show on last element if 2 cards, always show if 1 card */}\r\n {(cartData?.length === index + 1) && (\r\n <div className={styles.actionContainer}>\r\n <button\r\n className={styles.changeButton}\r\n aria-label='Change selected products'\r\n type='button'\r\n onClick={() => {\r\n // const redirectionUrl = returnPreviousUrl(is4pFlow ? '4P' : item?.itemType);\r\n if (redirectionUrl) {\r\n window.location.href = redirectionUrl;\r\n }\r\n }}\r\n >\r\n {viewPortType !== 'mobile' && content?.changeText}\r\n <img src={content?.changeIcon?.filename} alt='edit icon' role='presentation' />\r\n </button>\r\n </div>\r\n )}\r\n </article>\r\n );\r\n })}\r\n </section>\r\n </Row>\r\n );\r\n};\r\n\r\nexport default OttMiniSummaryCard;\r\n"],"names":["OttMiniSummaryCard","content","cartData","redirectionUrl","viewPortType","viewport","React","Row","createElement","className","styles","wrapper","title","id","heading","map","item","index","bundleItems","key","cardContainer","role","imageProductWrapper","hardwareImageUrl","imageContainer","src","alt","itemName","productIcon","width","height","contentContainer","productsSection","productName","Array","isArray","bundleItem","String","trim","filter","Boolean","split","bundleIndex","itemType","hardwarePayment","hsDevicesLabel","accessoryCount","hsAdditionalAccLabel","replacePlaceholder","priceContainer","itemDerivedPrice","Fragment","actualPrice","countZero","Number","toFixed","month","basePrice","itemDiscountedPrice","itemOneTimePrice","length","actionContainer","changeButton","type","onClick","window","location","href","changeText","_a","changeIcon","filename"],"mappings":"sMAqBA,MASMA,EAAqB,EAAGC,UAASC,WAAUC,qBAC/C,MAAMC,EAAeC,IACrB,OACEC,gBAACC,EAAG,KACFD,EAAAE,cAAA,UAAA,CAASC,UAAWC,EAAOC,0BAAyB,oBACjDV,aAAO,EAAPA,EAASW,QAASN,EAAAE,cAAA,KAAA,CAAIK,GAAG,kBAAkBJ,UAAWC,EAAOI,SAAUb,aAAO,EAAPA,EAASW,OAChFV,aAAQ,EAARA,EAAUa,IAAI,CAACC,EAAWC,WAfXC,EAgBd,OACEZ,EAAAE,cAAA,UAAA,CACEW,IAAKF,EACLR,UAAWC,EAAOU,cAClBC,KAAK,sBACM,6BAGXf,EAAAE,cAAA,MAAA,CAAKC,UAAWC,EAAOY,sBACpBN,aAAI,EAAJA,EAAMO,mBACLjB,EAAAE,cAAA,MAAA,CAAKC,UAAWC,EAAOc,gBACrBlB,EAAAE,cAAA,MAAA,CACEiB,IAAKT,aAAI,EAAJA,EAAMO,iBACXG,IAAK,GAAGV,aAAI,E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|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './OttMiniSummaryCard.css';
|
|
2
|
-
var a={wrapper:"wrapper_FHr8L",heading:"heading_EkfHv",cardContainer:"cardContainer_UXctf",imageProductWrapper:"imageProductWrapper_hgYe0",imageContainer:"imageContainer_JpADZ",productIcon:"productIcon_ND6WM",contentContainer:"contentContainer_riTwc",hardwarePayment:"hardwarePayment_5O3Vf",productsSection:"productsSection_ZWUIq",actionContainer:"actionContainer_du7x3",priceContainer:"priceContainer_xgxaU",basePrice:"basePrice_gfaSl",productName:"productName_daCpa",actualPrice:"actualPrice_-IfKh",changeButton:"changeButton_YzpTb"};export{a as default};
|
|
2
|
+
var a={wrapper:"wrapper_FHr8L",heading:"heading_EkfHv",cardContainer:"cardContainer_UXctf",imageProductWrapper:"imageProductWrapper_hgYe0",imageContainer:"imageContainer_JpADZ",productIcon:"productIcon_ND6WM",contentContainer:"contentContainer_riTwc",hardwarePayment:"hardwarePayment_5O3Vf",productsSection:"productsSection_ZWUIq",bundleItem:"bundleItem_NtXD7",actionContainer:"actionContainer_du7x3",priceContainer:"priceContainer_xgxaU",basePrice:"basePrice_gfaSl",productName:"productName_daCpa",actualPrice:"actualPrice_-IfKh",changeButton:"changeButton_YzpTb"};export{a as default};
|
|
3
3
|
//# sourceMappingURL=OttMiniSummaryCard.module.scss.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o,{useMemo as t}from"react";import e from"../../GenericPopup/GenericPopup.js";import{replacePlaceholderInObject as n}from"../../../utils/utils.js";const r=({modalState:r,conflict:i,content:l,onClose:a,onContinue:c,wafIdentifier:u})=>{const m=t(()=>{var o,t;return n(l,[null!==(t=null===(o=null==i?void 0:i.params)||void 0===o?void 0:o.currentProductName)&&void 0!==t?t:""])},[l,i]);return o.createElement(e,{modalState:r,onCloseHandler:a,content:m,onPrimaryClick:c,wafIdentifier:u})};export{r as default};
|
|
2
|
+
//# sourceMappingURL=ConflictPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConflictPopup.js","sources":["../../../../../src/components/StaticLineTable/ConflictPopup/ConflictPopup.tsx"],"sourcesContent":["import React, { JSX, useMemo } from 'react';\r\nimport GenericPopup, { TeleSalesErrorModalSchema } from '../../GenericPopup/GenericPopup';\r\nimport { replacePlaceholderInObject } from '../../../utils/utils';\r\nimport { CartConflict } from '../StaticLineTableStore/StaticLineTableProvider';\r\n\r\nexport interface ConflictPopupProps {\r\n modalState: boolean;\r\n conflict: CartConflict | null;\r\n content?: TeleSalesErrorModalSchema;\r\n onClose: () => void;\r\n onContinue: () => void;\r\n wafIdentifier?: string;\r\n}\r\n\r\n// Shown when the update-cart API responds with a conflict code (e.g. product\r\n// already exists in the persistent cart). Reuses GenericPopup since the\r\n// content structure (heading/body/primaryButton) coming from Storyblok\r\n// (mainContent?.conflictPopup) is the same shape.\r\nconst ConflictPopup = ({\r\n modalState,\r\n conflict,\r\n content,\r\n onClose,\r\n onContinue,\r\n wafIdentifier\r\n}: ConflictPopupProps): JSX.Element => {\r\n \r\n const resolvedContent = useMemo(() => {\r\n return replacePlaceholderInObject(content, [conflict?.params?.currentProductName ?? '']);\r\n }, [content, conflict]);\r\n\r\n return (\r\n <GenericPopup\r\n modalState={modalState}\r\n onCloseHandler={onClose}\r\n content={resolvedContent}\r\n onPrimaryClick={onContinue}\r\n wafIdentifier={wafIdentifier}\r\n />\r\n );\r\n};\r\n\r\nexport default ConflictPopup;\r\n\r\n\r\n"],"names":["ConflictPopup","modalState","conflict","content","onClose","onContinue","wafIdentifier","resolvedContent","useMemo","replacePlaceholderInObject","_b","_a","params","currentProductName","React","createElement","GenericPopup","onCloseHandler","onPrimaryClick"],"mappings":"0JAkBA,MAAMA,EAAgB,EACpBC,aACAC,WACAC,UACAC,UACAC,aACAC,oBAGA,MAAMC,EAAkBC,EAAQ,aAC9B,OAAOC,EAA2BN,EAAS,SAACO,EAAgB,QAAhBC,EAAAT,eAAAA,EAAUU,cAAM,IAAAD,OAAA,EAAAA,EAAEE,kCAAsB,MACnF,CAACV,EAASD,IAEb,OACEY,EAAAC,cAACC,EAAY,CACXf,WAAYA,EACZgB,eAAgBb,EAChBD,QAASI,EACTW,eAAgBb,EAChBC,cAAeA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"js-cookie";import{DEFAULT_MOBILEPOSTPAID_BUNDLE as l,TV_SERVICE_OPTION as i,RATEPLAN as n,VCTYPE as e,DEFAULT_WIRELINE_BUNDLE as d,ONE_ECOMMERCE_SUMMARY as t,ONE_ECOMMERCE_INTERNET_SUMMARY as u}from"../../utils/constants.js";import{fetchShogunOfferData as r,createCartV2 as v}from"../../services/LineTableService.js";import{getElementMaximumHeight as c,getLocalStorageWithExpiry as a,redirectWithSuccess as s,checkLinkWithLang as p}from"../../utils/utils.js";import{trackNewDatalayerEvent as m}from"../../utils/AnalyticsUtils.js";import{COMBINEDEVICE as f,GAEVENT as y,LINETABLEPRODUCT as h,ADDTOCART as g,LINETABLE as I,LINETABLEDEVICE as b}from"../../Analytics/AnalyticsConstants.js";import{trackEligibleItem as T,getEcomCartInfo as w}from"../../models/Analytics/items.js";import{calculateDateTime as D}from"./StaticLineTabelTimer/util.js";const P=(o,l)=>{try{const i=new Date,n=D(new Date(o.replace(/-/g,"/"))),e=D(new Date(l.replace(/-/g,"/")));return!Number.isNaN(n.getTime())&&!Number.isNaN(e.getTime())&&(i>=n&&i<e)}catch(o){return!1}},C=(o,l)=>{try{const i=D(new Date(o.replace(/-/g,"/"))),n=D(new Date(l.replace(/-/g,"/")));if(Number.isNaN(i.getTime())||Number.isNaN(n.getTime()))return 0;const e=(new Date).getTime(),d=i.getTime(),t=n.getTime();return e<d?Math.max(0,d-e):e>=d&&e<t?Math.max(0,t-e):0}catch(o){return 0}},N=(o,i,n,e,d)=>{null==o||o.map(o=>{var e,t,u,r,v,c,a,s,p,m,f,y,h,g,I,b,T,w,D,C,N,S,_,x,L;const O={id:"",promoIds:[]},E=null===(v=null===(r=null===(u=null===(t=null===(e=null==o?void 0:o.products)||void 0===e?void 0:e[0])||void 0===t?void 0:t.reference)||void 0===u?void 0:u.content)||void 0===r?void 0:r.product)||void 0===v?void 0:v[0],M=null===(m=null===(p=null===(s=null===(a=null===(c=null==o?void 0:o.promotion)||void 0===c?void 0:c[0])||void 0===a?void 0:a.reference)||void 0===s?void 0:s.content)||void 0===p?void 0:p.promoDescription)||void 0===m?void 0:m[0];null==M||M.promotionId,O.id=null==E?void 0:E.productId;const A=null===(f=null==o?void 0:o.timer)||void 0===f?void 0:f[0],B=!!A&&P(A.startTime,A.endTime),k=null===(T=null===(b=null===(I=null===(g=null===(h=null===(y=null==A?void 0:A.promotion)||void 0===y?void 0:y[0])||void 0===h?void 0:h.reference)||void 0===g?void 0:g.content)||void 0===I?void 0:I.promoDescription)||void 0===b?void 0:b[0])||void 0===T?void 0:T.promotionId,R=d&&!0===d&&""===(null==M?void 0:M.promotionId)?l:null==M?void 0:M.promotionId;if(B&&k?null===(w=null==O?void 0:O.promoIds)||void 0===w||w.push(k):null===(D=null==O?void 0:O.promoIds)||void 0===D||D.push(R),n){const l=null===(x=null===(_=null===(S=null===(N=null===(C=null==o?void 0:o.mobilePromotion)||void 0===C?void 0:C[0])||void 0===N?void 0:N.reference)||void 0===S?void 0:S.content)||void 0===_?void 0:_.promoDescription)||void 0===x?void 0:x[0];null===(L=null==O?void 0:O.promoIds)||void 0===L||L.push(null==l?void 0:l.promotionId)}null==i||i.push(O)})},S=(o,l,i)=>{var n,e,d;const t=null===(n=null==o?void 0:o.tabCaption)||void 0===n?void 0:n.replace(/\b\w/g,o=>o.toUpperCase()).replace(/\s+/g,"");return{atlOffers:[{placements:i,offerValidations:[{key:"Segment",type:"CustomerType",value:"Residential"},{key:"OrderType",type:"CustomerInterest",value:"New"},{key:"CurrentPage",type:"Context",value:"mobile-subscription"},{key:"Category",type:"CustomerInterest",value:null!=t?t:""},{key:"RequestedOfferCount",type:"Context",value:null!==(d=null===(e=null==o?void 0:o.pegaRequestOfferCount)||void 0===e?void 0:e.toString())&&void 0!==d?d:"3"},l?{key:"Tag",type:"CustomerInterest",value:l}:null].filter(Boolean)}]}},_=o=>{let l=!1,i=!1;return null==o||o.map(o=>{var n;null===(n=null==o?void 0:o.promotionInfo)||void 0===n||n.map(o=>{(null==o?void 0:o.hardwareGift)&&(l=!0),(null==o?void 0:o.cashBack)&&(i=!0)})}),{showGift:l,cashbackAvailable:i}},x=(i,n,u,r,c,m,f,y,b,w,D,P,C,N,S,_,x,L,O,E,M)=>{var A,B,k;if(f){i(!0);const d=a(e);0!==(null===(A=Object.keys(r))||void 0===A?void 0:A.length)&&v(r,"",(null==m?void 0:m.promoID)?null==m?void 0:m.promoID:l,n,"mobile",u,N,S,null===(k=null===(B=null==c?void 0:c.productContainer)||void 0===B?void 0:B[0])||void 0===k?void 0:k.isQoQaFlow,null==d?void 0:d.voucher,null,null,L,O,E).then(l=>{var i;o.remove("one-commerce-cartId",{path:"/"}),o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),o.set("cartProduct",null==m?void 0:m.id,{path:"/"}),T(g,r,"",h),s(null===(i=null==c?void 0:c.summaryPageUrl)||void 0===i?void 0:i.cached_url,M)}).catch(o=>{console.log(o),i(!1)}).finally(()=>{i(!1)})}else{const l="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid");b&&w&&l?(i(!0),0!==r.length&&v(r,y,(null==m?void 0:m.promoID)?null==m?void 0:m.promoID:d,n,"fixnet",u,"","",!1,"","",x,void 0,void 0,E).then(l=>{var i,n,e,d,u,v,a,f,y,h,b;"undefined"!=typeof window&&o.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),"undefined"!=typeof window&&o.set("cartProduct",null==m?void 0:m.id,{path:"/"}),"undefined"!=typeof window&&o.remove("landline"),T(g,r,"",I);const w=p(null===(i=null==_?void 0:_.productBasedCheckoutUrl)||void 0===i?void 0:i.cached_url);let D=!1;if((null===(n=r[0])||void 0===n?void 0:n.isBundle)?null===(d=null===(e=r[0])||void 0===e?void 0:e.bundledOffers)||void 0===d||d.map(o=>{var l,i,n;"internet"!==(null===(l=null==o?void 0:o.productType)||void 0===l?void 0:l.toLowerCase())&&"tv"!=(null===(i=null==o?void 0:o.productType)||void 0===i?void 0:i.toLowerCase())||(null==o?void 0:o.recommendAccessory)&&(D=null==o?void 0:o.recommendAccessory),"mobile"!==(null===(n=null==o?void 0:o.productType)||void 0===n?void 0:n.toLowerCase())||(D=!1)}):(null===(u=null==r?void 0:r[0])||void 0===u?void 0:u.recommendAccessory)&&(D=null===(v=null==r?void 0:r[0])||void 0===v?void 0:v.recommendAccessory),D){const o={flow:"WIN"};sessionStorage.setItem(t,JSON.stringify(o))}const P=w||((null==_?void 0:_.enableTVStreamingOptionsStepper)&&(null===(a=null==c?void 0:c.vasStepperURL)||void 0===a?void 0:a.cached_url)?null===(f=null==c?void 0:c.vasStepperURL)||void 0===f?void 0:f.cached_url:D&&(null===(y=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===y?void 0:y.cached_url)?null===(h=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===h?void 0:h.cached_url:null===(b=null==c?void 0:c.summaryPageUrl)||void 0===b?void 0:b.cached_url);s(P,M)}).catch(o=>{console.log(o)}).finally(()=>{i(!1)})):(null==c?void 0:c.enableLinecheckOverlay)?D(!P):C()}},L=new Map,O=(o,l,i)=>{const n=[];for(const e of o){const o=`${e}${l}`,d=[];for(let l=0;l<i;l++){const i=document.getElementById(`${o}${l}`);i&&d.push(i)}d.length>0&&n.push(d)}if(0===n.length)return;for(const o of n)for(const l of o)l.style.height="unset";const e=n.map(o=>Math.max(...o.map(o=>o.clientHeight)));n.forEach((o,l)=>{const i=`${e[l]}px`;for(const l of o)l.style.height=i})},E=(o,l,i=0)=>{const n=L.get(o);if(n)if("boolean"!=typeof n)clearTimeout(n);else if(i<=0)return;if(i<=0&&"function"==typeof queueMicrotask)return L.set(o,!0),void queueMicrotask(()=>{L.delete(o),M(o,l)});L.set(o,setTimeout(()=>{L.delete(o),M(o,l)},i))},M=(o,l)=>{(()=>{let i=0;const n=[];[...Array(l)].forEach((l,e)=>{const d=document.getElementById(`timer-section${o}${e}`);if(d){n.push(d);if("true"===d.dataset.timerActive){const o=d.firstElementChild,l=parseFloat((null==o?void 0:o.style.height)||"0")||0;i=Math.max(i,l)}}}),n.forEach(o=>{const l="true"===o.dataset.timerActive;o.style.transition="height 0.3s ease",o.style.height=l?"0px":`${i}px`})})();const i=new Set;document.querySelectorAll(`[data-entitlement-tab="${o}"]`).forEach(o=>{i.add(`entitlement-row-${o.dataset.entitlementRow}-`)}),O([...i],o,l),O(["headingV3","descriptionV3","titleV3","product-configv3","cashback-section","exclusive-benefits-section","benefits-section","price-section","discountedpricetoggle-section","contract-section"],o,l),O(["detailsectionv3","gift-section","order-section"],o,l),c(`benefits-price-section${o}`,l)},A=(o,i,n,e,d,t)=>{var u,r,v,c,a,s,p;const h={msisdn:null!==(u=null==e?void 0:e.msisdn)&&void 0!==u?u:"",ratePlan:null!==(r=null==e?void 0:e.ratePlan)&&void 0!==r?r:"",ratePlanType:null!==(v=null==e?void 0:e.ratePlanType)&&void 0!==v?v:"",productId:e?null==o?void 0:o.id:""},I=(null==o?void 0:o.promoID)?null==o?void 0:o.promoID:l;let D="";D=`?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${null!=I?I:""}&productCode=${null!==(c=null==o?void 0:o.id)&&void 0!==c?c:""}`,window.location.href=(null===(p=null===(s=null===(a=null==i?void 0:i.addSmartPhone)||void 0===a?void 0:a[0])||void 0===s?void 0:s.buttonLink)||void 0===p?void 0:p.cached_url)+D,((o,l,i,n,e,d)=>{var t,u,r,v,c,a,s,p,m,f,y,h,g,I,b,T,w,D,P,C,N,S,_,x,L;const O=l,E=null!==(v=null===(r=null===(u=null===(t=null==O?void 0:O[0])||void 0===t?void 0:t.prices)||void 0===u?void 0:u[0])||void 0===r?void 0:r.value)&&void 0!==v?v:0,M=null!==(p=null===(s=null===(a=null===(c=null==O?void 0:O[0])||void 0===c?void 0:c.derivedPrice)||void 0===a?void 0:a[0])||void 0===s?void 0:s.value)&&void 0!==p?p:0,A=null!==(h=null===(y=null===(f=null===(m=null==O?void 0:O[0])||void 0===m?void 0:m.promotionInfo)||void 0===f?void 0:f[0])||void 0===y?void 0:y.contractDuration)&&void 0!==h?h:0,B=null!==(T=null===(b=null===(I=null===(g=null==O?void 0:O[0])||void 0===g?void 0:g.promotionInfo)||void 0===I?void 0:I[0])||void 0===b?void 0:b.campaignDuration)&&void 0!==T?T:0,k=null!=i?i:"",R=d&&(null===(P=null===(D=null===(w=null==l?void 0:l[0])||void 0===w?void 0:w.promotionInfo)||void 0===D?void 0:D[0])||void 0===P?void 0:P.id),U=d&&(null===(S=null===(N=null===(C=null==l?void 0:l[0])||void 0===C?void 0:C.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.version),F=d?{discountRef:R,discountType:"DISCOUNT"}:null,$=[];null==$||$.push({author:"offerType",text:"ATL"}),null==$||$.push({author:"externalPromotionName",text:R}),null==$||$.push({author:"offerVersion",text:U});const V=d?$:null,j=new URLSearchParams(window.location.search).get("flow"),J={mobileSubscription:null!==(x=null===(_=null==O?void 0:O[0])||void 0===_?void 0:_.id)&&void 0!==x?x:"",mobileSubscriptionPrice:M>0?M:E,mobileSubscriptionPromo:o,subGroup:"MOBILE",duration:Number(B>0?B:A),basePrice:E,withoutPromo:!1,pretopostvalue:k,upBenefit:"MULTIMOBILE"==n.mob_benefit_category||"FMC"==n.mob_benefit_category,ultimateBundlePromo:null!==(L=null==e?void 0:e.ultimateBundlePromotion)&&void 0!==L?L:"",clientDiscountInfo:F,extraNotes:V,isOttFlow:"ott"===j};void 0!==typeof window&&sessionStorage.setItem("one-ecommerce-mobileSummary",JSON.stringify(J))})(I,n,e&&h,o,d,t),m(y,f,w(n,"",b)),T(g,n,"",b)},B=(o,i,n,e,d,t)=>{((o,l,i,n,e,d,t)=>{var r,v,c,a,s,p,m,f,y,h,g,I,b,T,w,D,P,C,N,S,_,x,L,O,E,M;const A=l,B=null!==(a=null===(c=null===(v=null===(r=null==A?void 0:A[0])||void 0===r?void 0:r.prices)||void 0===v?void 0:v[0])||void 0===c?void 0:c.value)&&void 0!==a?a:0,k=null!==(f=null===(m=null===(p=null===(s=null==A?void 0:A[0])||void 0===s?void 0:s.derivedPrice)||void 0===p?void 0:p[0])||void 0===m?void 0:m.value)&&void 0!==f?f:0,R=null!==(b=null!==(I=null===(g=null===(h=null===(y=null==A?void 0:A[0])||void 0===y?void 0:y.promotionInfo)||void 0===h?void 0:h[0])||void 0===g?void 0:g.contractDuration)&&void 0!==I?I:null==i?void 0:i.contractDuration)&&void 0!==b?b:0,U=null!==(P=null===(D=null===(w=null===(T=null==A?void 0:A[0])||void 0===T?void 0:T.promotionInfo)||void 0===w?void 0:w[0])||void 0===D?void 0:D.campaignDuration)&&void 0!==P?P:0,F=e&&(null===(S=null===(N=null===(C=null==l?void 0:l[0])||void 0===C?void 0:C.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.id),$=e&&(null===(L=null===(x=null===(_=null==l?void 0:l[0])||void 0===_?void 0:_.promotionInfo)||void 0===x?void 0:x[0])||void 0===L?void 0:L.version),V=e?{discountRef:F,discountType:"DISCOUNT"}:null,j=[];null==j||j.push({author:"offerType",text:"ATL"}),null==j||j.push({author:"externalPromotionName",text:F}),null==j||j.push({author:"offerVersion",text:$});const J=e?j:null,q={internetSubscription:null!=d?d:"",internetSubscriptionId:null!==(E=null===(O=null==A?void 0:A[0])||void 0===O?void 0:O.id)&&void 0!==E?E:"",internetSubscriptionPrice:k>0?k:B,internetSubscriptionPromo:o,subGroup:"INTERNET",duration:Number(U>0?U:R),basePrice:B,withPromo:k>0,upBenefit:"MULTIMOBILE"==i.mob_benefit_category||"FMC"==i.mob_benefit_category,ultimateBundlePromo:null!==(M=null==n?void 0:n.ultimateBundlePromotion)&&void 0!==M?M:"",clientDiscountInfo:V,extraNotes:J,productType:"subscription",recommendAccessory:t};void 0!==typeof window&&sessionStorage.setItem(u,JSON.stringify(q))})((null==o?void 0:o.promoID)?null==o?void 0:o.promoID:l,i,o,n,e,d,t),m(y,f,w(i,"",b)),T(g,i,"",b)},k=(o,l)=>{let i;return l||(i=(o||[]).filter(o=>!0===(null==o?void 0:o.enableTV))),i},R=(o,l,i,n,e,d)=>{var t,u,r,v,c,a,s,p,m,f,y;const h={base:"",onetimePrice:"",discount:[],contractDuration:"",int_fmc:0,mob_fmc:0,mob_benefit_category:"",id:"",promoID:"",loyaltyPrice:""};let g=0,I=0,b=0;Array.isArray(o)&&(null==o||o.map(l=>{var i,n,t,u,r,v,c,a,s;h.id=null!==(i=null==l?void 0:l.id)&&void 0!==i?i:"",null===(n=null==l?void 0:l.prices)||void 0===n||n.map(o=>{var l,i;"recurring"===(null===(l=null==o?void 0:o.priceType)||void 0===l?void 0:l.toLowerCase())?e&&(null==e?void 0:e.length)>0?(null==e||e.forEach(o=>{(null==o?void 0:o.beneficiaryPrice)>0?I+=parseFloat(null==o?void 0:o.beneficiaryPrice):(null==o?void 0:o.derivedPrice)>0?I+=parseFloat(null==o?void 0:o.derivedPrice):b+=parseFloat(null==o?void 0:o.recurringPrice),(null==o?void 0:o.recurringPrice)>0&&(g+=parseFloat(null==o?void 0:o.recurringPrice))}),I>0&&(I+=b),h.base=JSON.stringify(parseFloat(null==o?void 0:o.value)+(I>0?I:g))):h.base=null==o?void 0:o.value:"one time"===(null===(i=null==o?void 0:o.priceType)||void 0===i?void 0:i.toLowerCase())&&(h.onetimePrice=null==o?void 0:o.value)}),null===(t=null==l?void 0:l.derivedPrice)||void 0===t||t.map(l=>{var i,n,t,u,r,v,c,a;const s={cycleStart:"",cycleEnd:"",value:""};s.cycleStart=d&&!(null===(i=null==o?void 0:o[0])||void 0===i?void 0:i.isBundle)&&(null===(n=null==o?void 0:o[0])||void 0===n?void 0:n.contractDuration)?1:null===(t=null==l?void 0:l.cycle)||void 0===t?void 0:t.cycleStart,s.cycleEnd=d&&!(null===(u=null==o?void 0:o[0])||void 0===u?void 0:u.isBundle)&&(null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.contractDuration)?d&&!(null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.isBundle)&&(null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.contractDuration):null===(a=null==l?void 0:l.cycle)||void 0===a?void 0:a.cycleEnd,s.value=null==l?void 0:l.value,e&&(null==e?void 0:e.length)>0&&(s.value=I>0?JSON.stringify(parseFloat(null==l?void 0:l.value)+I):JSON.stringify(parseFloat(null==l?void 0:l.value)+g)),h.discount.push(s)}),(null===(v=null===(r=null===(u=null==l?void 0:l.promotionInfo)||void 0===u?void 0:u[0])||void 0===r?void 0:r.relatedPromo)||void 0===v?void 0:v.length)>0&&(null===(s=null===(a=null===(c=null==l?void 0:l.promotionInfo)||void 0===c?void 0:c[0])||void 0===a?void 0:a.relatedPromo)||void 0===s||s.map(o=>{"LOYALTY_DISCOUNT"===(null==o?void 0:o.type)&&(h.loyaltyPrice=null==o?void 0:o.discount)}))})),null===(u=null===(t=null==o?void 0:o[0])||void 0===t?void 0:t.bundledOffers)||void 0===u||u.forEach(o=>{var l,i,n,e,t;null===(l=null==o?void 0:o.prices)||void 0===l||l.forEach(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.forEach(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?h.int_fmc+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(h.mob_fmc+=Number(null==o?void 0:o.value),h.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==o?void 0:o.contractDuration)&&(h.contractDuration=null==o?void 0:o.contractDuration),(null===(n=null===(i=null==o?void 0:o.promotionInfo)||void 0===i?void 0:i[0])||void 0===n?void 0:n.id)&&!d&&(h.promoID=null===(t=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===t?void 0:t.id)}),(null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.isBundle)||(h.contractDuration=null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.contractDuration,d||(h.promoID=null===(s=null===(a=null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.promotionInfo)||void 0===a?void 0:a[0])||void 0===s?void 0:s.id));let T=0;if(null===(m=null===(p=null==o?void 0:o[0])||void 0===p?void 0:p.prices)||void 0===m||m.map(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.map(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?T+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(h.mob_fmc+=Number(null==o?void 0:o.value),h.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==h?void 0:h.contractDuration)||l||(h.contractDuration="12"),h.int_fmc=h.int_fmc,"4P"==i){let l="0";null===(y=null===(f=null==o?void 0:o[0])||void 0===f?void 0:f.bundledOffers)||void 0===y||y.map(o=>{(null==o?void 0:o.contractDuration)&&(l=Number(l)>Number(null==o?void 0:o.contractDuration)?l:null==o?void 0:o.contractDuration)}),h.contractDuration=l}return h},U=(o,l)=>{var i,n;let e=o;e=o.filter(o=>{var i;const n=null===(i=null==o?void 0:o.gigaSpeed)||void 0===i?void 0:i.toLowerCase();return(null==l?void 0:l.gigaSpeed)?"hide"!=n:"show"!=n});let d=e;let t=[],u=[],r=[];for(let o of d){const l=null===(i=null==o?void 0:o.productIndex)||void 0===i?void 0:i.includes(","),e=l&&(null===(n=null==o?void 0:o.productIndex)||void 0===n?void 0:n.split(","));if(l)for(let l of e)for(let i=0;i<3;i++)Number(l)===i&&(0===i?t.push(o):1===i?u.push(o):r.push(o));else for(let l=0;l<3;l++)Number(null==o?void 0:o.productIndex)===l&&(0===l?t.push(o):1===l?u.push(o):r.push(o))}return(null==l?void 0:l.TV)&&(null==l?void 0:l.Netflix)?r:(null==l?void 0:l.TV)?u:t},F=o=>{var l;return null===(l=(null==o?void 0:o.products)||[])||void 0===l?void 0:l.map(o=>{var l,e,d;return{itemType:null!==(l=null==o?void 0:o.type)&&void 0!==l?l:"",promotionId:null!==(e=null==o?void 0:o.promo)&&void 0!==e?e:"",items:[{itemType:(null==o?void 0:o.type)===i?i:n,id:null!==(d=null==o?void 0:o.id)&&void 0!==d?d:""}]}})};let $=null;const V=o=>(null==$?void 0:$.gloxTokenId)===o&&null!==$.results,j=(o,l,i)=>{if(V(o))return Promise.resolve($.results);if((null==$?void 0:$.gloxTokenId)===o&&null!==$.promise)return $.promise;const n=r(o,l,i).then(i=>{var n;const e=null!==(n=null==i?void 0:i[l])&&void 0!==n?n:[];return(null==$?void 0:$.gloxTokenId)===o&&($.results=e,$.promise=null),e}).catch(l=>{throw(null==$?void 0:$.gloxTokenId)===o&&($=null),l});return $={gloxTokenId:o,results:null,promise:n},n},J=(o,l)=>{const i=o.filter(o=>{var i,n,e,d,t,u;const r=null===(u=null===(t=null===(d=null===(e=null===(n=null===(i=null==o?void 0:o.products)||void 0===i?void 0:i[0])||void 0===n?void 0:n.reference)||void 0===e?void 0:e.content)||void 0===d?void 0:d.product)||void 0===t?void 0:t[0])||void 0===u?void 0:u.productId;return l.includes(r)});return i.sort((o,i)=>{var n,e,d,t,u,r,v,c,a,s,p,m;const f=null===(r=null===(u=null===(t=null===(d=null===(e=null===(n=null==o?void 0:o.products)||void 0===n?void 0:n[0])||void 0===e?void 0:e.reference)||void 0===d?void 0:d.content)||void 0===t?void 0:t.product)||void 0===u?void 0:u[0])||void 0===r?void 0:r.productId,y=null===(m=null===(p=null===(s=null===(a=null===(c=null===(v=null==i?void 0:i.products)||void 0===v?void 0:v[0])||void 0===c?void 0:c.reference)||void 0===a?void 0:a.content)||void 0===s?void 0:s.product)||void 0===p?void 0:p[0])||void 0===m?void 0:m.productId;return l.indexOf(f)-l.indexOf(y)}),i};export{_ as checkGiftOrCashback,A as combineWithSmartPhone,B as combineWithVasOptions,U as fetchFilteredProducts,F as fetchOttItems,S as fetchPegaProducts,R as fetchPrice,k as fetchServiceOptions,N as fetchStaticProductIds,J as filterShogunProducts,M as findHeight,j as getShogunSharedOffer,C as getTimeUntilNextTimerEvent,V as isShogunOfferResolved,P as isTimerActive,E as scheduleFindHeight,x as staticCreateCart};
|
|
1
|
+
import o from"js-cookie";import{TV_SERVICE_OPTION as l,RATEPLAN as i,DEFAULT_MOBILEPOSTPAID_BUNDLE as n,VCTYPE as e,DEFAULT_WIRELINE_BUNDLE as d,ONE_ECOMMERCE_SUMMARY as t,ONE_ECOMMERCE_INTERNET_SUMMARY as u}from"../../utils/constants.js";import{fetchShogunOfferData as v,createCartV2 as r,coreUpdateCart as c}from"../../services/LineTableService.js";import{getElementMaximumHeight as a,getLocalStorageWithExpiry as s,redirectWithSuccess as p,checkLinkWithLang as m}from"../../utils/utils.js";import{trackNewDatalayerEvent as f}from"../../utils/AnalyticsUtils.js";import{LINETABLEPRODUCT as y,ADDTOCART as h,LINETABLE as I,LINETABLEDEVICE as g,COMBINEDEVICE as b,GAEVENT as T}from"../../Analytics/AnalyticsConstants.js";import{trackEligibleItem as D,getEcomCartInfo as P}from"../../models/Analytics/items.js";import{calculateDateTime as w}from"./StaticLineTabelTimer/util.js";const C=(o,l)=>{try{const i=new Date,n=w(new Date(o.replace(/-/g,"/"))),e=w(new Date(l.replace(/-/g,"/")));return!Number.isNaN(n.getTime())&&!Number.isNaN(e.getTime())&&(i>=n&&i<e)}catch(o){return!1}},N=(o,l)=>{try{const i=w(new Date(o.replace(/-/g,"/"))),n=w(new Date(l.replace(/-/g,"/")));if(Number.isNaN(i.getTime())||Number.isNaN(n.getTime()))return 0;const e=(new Date).getTime(),d=i.getTime(),t=n.getTime();return e<d?Math.max(0,d-e):e>=d&&e<t?Math.max(0,t-e):0}catch(o){return 0}},S=(o,l,i,e,d)=>{null==o||o.map(o=>{var e,t,u,v,r,c,a,s,p,m,f,y,h,I,g,b,T,D,P,w,N,S,_,x,O;const L={id:"",promoIds:[]},A=null===(r=null===(v=null===(u=null===(t=null===(e=null==o?void 0:o.products)||void 0===e?void 0:e[0])||void 0===t?void 0:t.reference)||void 0===u?void 0:u.content)||void 0===v?void 0:v.product)||void 0===r?void 0:r[0],E=null===(m=null===(p=null===(s=null===(a=null===(c=null==o?void 0:o.promotion)||void 0===c?void 0:c[0])||void 0===a?void 0:a.reference)||void 0===s?void 0:s.content)||void 0===p?void 0:p.promoDescription)||void 0===m?void 0:m[0];null==E||E.promotionId,L.id=null==A?void 0:A.productId;const k=null===(f=null==o?void 0:o.timer)||void 0===f?void 0:f[0],B=!!k&&C(k.startTime,k.endTime),U=null===(T=null===(b=null===(g=null===(I=null===(h=null===(y=null==k?void 0:k.promotion)||void 0===y?void 0:y[0])||void 0===h?void 0:h.reference)||void 0===I?void 0:I.content)||void 0===g?void 0:g.promoDescription)||void 0===b?void 0:b[0])||void 0===T?void 0:T.promotionId,M=d&&!0===d&&""===(null==E?void 0:E.promotionId)?n:null==E?void 0:E.promotionId;if(B&&U?null===(D=null==L?void 0:L.promoIds)||void 0===D||D.push(U):null===(P=null==L?void 0:L.promoIds)||void 0===P||P.push(M),i){const l=null===(x=null===(_=null===(S=null===(N=null===(w=null==o?void 0:o.mobilePromotion)||void 0===w?void 0:w[0])||void 0===N?void 0:N.reference)||void 0===S?void 0:S.content)||void 0===_?void 0:_.promoDescription)||void 0===x?void 0:x[0];null===(O=null==L?void 0:L.promoIds)||void 0===O||O.push(null==l?void 0:l.promotionId)}null==l||l.push(L)})},_=(o,l,i)=>{var n,e,d;const t=null===(n=null==o?void 0:o.tabCaption)||void 0===n?void 0:n.replace(/\b\w/g,o=>o.toUpperCase()).replace(/\s+/g,"");return{atlOffers:[{placements:i,offerValidations:[{key:"Segment",type:"CustomerType",value:"Residential"},{key:"OrderType",type:"CustomerInterest",value:"New"},{key:"CurrentPage",type:"Context",value:"mobile-subscription"},{key:"Category",type:"CustomerInterest",value:null!=t?t:""},{key:"RequestedOfferCount",type:"Context",value:null!==(d=null===(e=null==o?void 0:o.pegaRequestOfferCount)||void 0===e?void 0:e.toString())&&void 0!==d?d:"3"},l?{key:"Tag",type:"CustomerInterest",value:l}:null].filter(Boolean)}]}},x=o=>{let l=!1,i=!1;return null==o||o.map(o=>{var n;null===(n=null==o?void 0:o.promotionInfo)||void 0===n||n.map(o=>{(null==o?void 0:o.hardwareGift)&&(l=!0),(null==o?void 0:o.cashBack)&&(i=!0)})}),{showGift:l,cashbackAvailable:i}},O=(l,i,u,v,c,a,f,g,b,T,P,w,C,N,S,_,x,O,L,A,E)=>{var k,B,U;if(f){l(!0);const d=s(e);0!==(null===(k=Object.keys(v))||void 0===k?void 0:k.length)&&r(v,"",(null==a?void 0:a.promoID)?null==a?void 0:a.promoID:n,i,"mobile",u,N,S,null===(U=null===(B=null==c?void 0:c.productContainer)||void 0===B?void 0:B[0])||void 0===U?void 0:U.isQoQaFlow,null==d?void 0:d.voucher,null,null,O,L,A).then(l=>{var i;o.remove("one-commerce-cartId",{path:"/"}),o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),o.set("cartProduct",null==a?void 0:a.id,{path:"/"}),D(h,v,"",y),p(null===(i=null==c?void 0:c.summaryPageUrl)||void 0===i?void 0:i.cached_url,E)}).catch(o=>{console.log(o),l(!1)}).finally(()=>{l(!1)})}else{const n="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid");b&&T&&n?(l(!0),0!==v.length&&r(v,g,(null==a?void 0:a.promoID)?null==a?void 0:a.promoID:d,i,"fixnet",u,"","",!1,"","",x,void 0,void 0,A).then(l=>{var i,n,e,d,u,r,s,f,y,g,b;"undefined"!=typeof window&&o.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),"undefined"!=typeof window&&o.set("cartProduct",null==a?void 0:a.id,{path:"/"}),"undefined"!=typeof window&&o.remove("landline"),D(h,v,"",I);const T=m(null===(i=null==_?void 0:_.productBasedCheckoutUrl)||void 0===i?void 0:i.cached_url);let P=!1;if((null===(n=v[0])||void 0===n?void 0:n.isBundle)?null===(d=null===(e=v[0])||void 0===e?void 0:e.bundledOffers)||void 0===d||d.map(o=>{var l,i,n;"internet"!==(null===(l=null==o?void 0:o.productType)||void 0===l?void 0:l.toLowerCase())&&"tv"!=(null===(i=null==o?void 0:o.productType)||void 0===i?void 0:i.toLowerCase())||(null==o?void 0:o.recommendAccessory)&&(P=null==o?void 0:o.recommendAccessory),"mobile"!==(null===(n=null==o?void 0:o.productType)||void 0===n?void 0:n.toLowerCase())||(P=!1)}):(null===(u=null==v?void 0:v[0])||void 0===u?void 0:u.recommendAccessory)&&(P=null===(r=null==v?void 0:v[0])||void 0===r?void 0:r.recommendAccessory),P){const o={flow:"WIN"};sessionStorage.setItem(t,JSON.stringify(o))}const w=T||((null==_?void 0:_.enableTVStreamingOptionsStepper)&&(null===(s=null==c?void 0:c.vasStepperURL)||void 0===s?void 0:s.cached_url)?null===(f=null==c?void 0:c.vasStepperURL)||void 0===f?void 0:f.cached_url:P&&(null===(y=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===y?void 0:y.cached_url)?null===(g=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===g?void 0:g.cached_url:null===(b=null==c?void 0:c.summaryPageUrl)||void 0===b?void 0:b.cached_url);p(w,E)}).catch(o=>{console.log(o)}).finally(()=>{l(!1)})):(null==c?void 0:c.enableLinecheckOverlay)?P(!w):C()}},L=(o,l)=>{a(`headingV3${o}`,l),a(`descriptionV3${o}`,l),a(`titleV3${o}`,l),(()=>{let i=0;const n=[];[...Array(l)].forEach((l,e)=>{const d=document.getElementById(`timer-section${o}${e}`);if(d){n.push(d);if("true"===d.dataset.timerActive){const o=d.firstElementChild,l=parseFloat((null==o?void 0:o.style.height)||"0")||0;i=Math.max(i,l)}}}),n.forEach(o=>{const l="true"===o.dataset.timerActive;o.style.transition="height 0.3s ease",o.style.height=l?"0px":`${i}px`})})(),a(`detailsectionv3${o}`,l),a(`product-configv3${o}`,l),a(`gift-section${o}`,l),a(`benefits-section${o}`,l),a(`order-section${o}`,l),a(`price-section${o}`,l),a(`benefits-price-section${o}`,l),a(`contract-section${o}`,l),a(`exclusive-benefits-section${o}`,l),a(`discountedpricetoggle-section${o}`,l)},A=(o,l,i,e,d,t)=>{var u,v,r,c,a,s,p;const m={msisdn:null!==(u=null==e?void 0:e.msisdn)&&void 0!==u?u:"",ratePlan:null!==(v=null==e?void 0:e.ratePlan)&&void 0!==v?v:"",ratePlanType:null!==(r=null==e?void 0:e.ratePlanType)&&void 0!==r?r:"",productId:e?null==o?void 0:o.id:""},y=(null==o?void 0:o.promoID)?null==o?void 0:o.promoID:n;let I="";I=`?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${null!=y?y:""}&productCode=${null!==(c=null==o?void 0:o.id)&&void 0!==c?c:""}`,window.location.href=(null===(p=null===(s=null===(a=null==l?void 0:l.addSmartPhone)||void 0===a?void 0:a[0])||void 0===s?void 0:s.buttonLink)||void 0===p?void 0:p.cached_url)+I,((o,l,i,n,e,d)=>{var t,u,v,r,c,a,s,p,m,f,y,h,I,g,b,T,D,P,w,C,N,S,_,x,O;const L=l,A=null!==(r=null===(v=null===(u=null===(t=null==L?void 0:L[0])||void 0===t?void 0:t.prices)||void 0===u?void 0:u[0])||void 0===v?void 0:v.value)&&void 0!==r?r:0,E=null!==(p=null===(s=null===(a=null===(c=null==L?void 0:L[0])||void 0===c?void 0:c.derivedPrice)||void 0===a?void 0:a[0])||void 0===s?void 0:s.value)&&void 0!==p?p:0,k=null!==(h=null===(y=null===(f=null===(m=null==L?void 0:L[0])||void 0===m?void 0:m.promotionInfo)||void 0===f?void 0:f[0])||void 0===y?void 0:y.contractDuration)&&void 0!==h?h:0,B=null!==(T=null===(b=null===(g=null===(I=null==L?void 0:L[0])||void 0===I?void 0:I.promotionInfo)||void 0===g?void 0:g[0])||void 0===b?void 0:b.campaignDuration)&&void 0!==T?T:0,U=null!=i?i:"",M=d&&(null===(w=null===(P=null===(D=null==l?void 0:l[0])||void 0===D?void 0:D.promotionInfo)||void 0===P?void 0:P[0])||void 0===w?void 0:w.id),R=d&&(null===(S=null===(N=null===(C=null==l?void 0:l[0])||void 0===C?void 0:C.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.version),$=d?{discountRef:M,discountType:"DISCOUNT"}:null,F=[];null==F||F.push({author:"offerType",text:"ATL"}),null==F||F.push({author:"externalPromotionName",text:M}),null==F||F.push({author:"offerVersion",text:R});const V=d?F:null,j=new URLSearchParams(window.location.search).get("flow"),J={mobileSubscription:null!==(x=null===(_=null==L?void 0:L[0])||void 0===_?void 0:_.id)&&void 0!==x?x:"",mobileSubscriptionPrice:E>0?E:A,mobileSubscriptionPromo:o,subGroup:"MOBILE",duration:Number(B>0?B:k),basePrice:A,withoutPromo:!1,pretopostvalue:U,upBenefit:"MULTIMOBILE"==n.mob_benefit_category||"FMC"==n.mob_benefit_category,ultimateBundlePromo:null!==(O=null==e?void 0:e.ultimateBundlePromotion)&&void 0!==O?O:"",clientDiscountInfo:$,extraNotes:V,isOttFlow:"ott"===j};void 0!==typeof window&&sessionStorage.setItem("one-ecommerce-mobileSummary",JSON.stringify(J))})(y,i,e&&m,o,d,t),f(T,b,P(i,"",g)),D(h,i,"",g)},E=(o,l,i,e,d,t)=>{((o,l,i,n,e,d,t)=>{var v,r,c,a,s,p,m,f,y,h,I,g,b,T,D,P,w,C,N,S,_,x,O,L,A,E;const k=l,B=null!==(a=null===(c=null===(r=null===(v=null==k?void 0:k[0])||void 0===v?void 0:v.prices)||void 0===r?void 0:r[0])||void 0===c?void 0:c.value)&&void 0!==a?a:0,U=null!==(f=null===(m=null===(p=null===(s=null==k?void 0:k[0])||void 0===s?void 0:s.derivedPrice)||void 0===p?void 0:p[0])||void 0===m?void 0:m.value)&&void 0!==f?f:0,M=null!==(b=null!==(g=null===(I=null===(h=null===(y=null==k?void 0:k[0])||void 0===y?void 0:y.promotionInfo)||void 0===h?void 0:h[0])||void 0===I?void 0:I.contractDuration)&&void 0!==g?g:null==i?void 0:i.contractDuration)&&void 0!==b?b:0,R=null!==(w=null===(P=null===(D=null===(T=null==k?void 0:k[0])||void 0===T?void 0:T.promotionInfo)||void 0===D?void 0:D[0])||void 0===P?void 0:P.campaignDuration)&&void 0!==w?w:0,$=e&&(null===(S=null===(N=null===(C=null==l?void 0:l[0])||void 0===C?void 0:C.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.id),F=e&&(null===(O=null===(x=null===(_=null==l?void 0:l[0])||void 0===_?void 0:_.promotionInfo)||void 0===x?void 0:x[0])||void 0===O?void 0:O.version),V=e?{discountRef:$,discountType:"DISCOUNT"}:null,j=[];null==j||j.push({author:"offerType",text:"ATL"}),null==j||j.push({author:"externalPromotionName",text:$}),null==j||j.push({author:"offerVersion",text:F});const J=e?j:null,G={internetSubscription:null!=d?d:"",internetSubscriptionId:null!==(A=null===(L=null==k?void 0:k[0])||void 0===L?void 0:L.id)&&void 0!==A?A:"",internetSubscriptionPrice:U>0?U:B,internetSubscriptionPromo:o,subGroup:"INTERNET",duration:Number(R>0?R:M),basePrice:B,withPromo:U>0,upBenefit:"MULTIMOBILE"==i.mob_benefit_category||"FMC"==i.mob_benefit_category,ultimateBundlePromo:null!==(E=null==n?void 0:n.ultimateBundlePromotion)&&void 0!==E?E:"",clientDiscountInfo:V,extraNotes:J,productType:"subscription",recommendAccessory:t};void 0!==typeof window&&sessionStorage.setItem(u,JSON.stringify(G))})((null==o?void 0:o.promoID)?null==o?void 0:o.promoID:n,l,o,i,e,d,t),f(T,b,P(l,"",g)),D(h,l,"",g)},k=(o,l)=>{let i;return l||(i=(o||[]).filter(o=>!0===(null==o?void 0:o.enableTV))),i},B=(o,l,i,n,e,d)=>{var t,u,v,r,c,a,s,p,m,f,y;const h={base:"",onetimePrice:"",discount:[],contractDuration:"",int_fmc:0,mob_fmc:0,mob_benefit_category:"",id:"",promoID:"",loyaltyPrice:""};let I=0,g=0,b=0;Array.isArray(o)&&(null==o||o.map(l=>{var i,n,t,u,v,r,c,a,s;h.id=null!==(i=null==l?void 0:l.id)&&void 0!==i?i:"",null===(n=null==l?void 0:l.prices)||void 0===n||n.map(o=>{var l,i;"recurring"===(null===(l=null==o?void 0:o.priceType)||void 0===l?void 0:l.toLowerCase())?e&&(null==e?void 0:e.length)>0?(null==e||e.forEach(o=>{(null==o?void 0:o.beneficiaryPrice)>0?g+=parseFloat(null==o?void 0:o.beneficiaryPrice):(null==o?void 0:o.derivedPrice)>0?g+=parseFloat(null==o?void 0:o.derivedPrice):b+=parseFloat(null==o?void 0:o.recurringPrice),(null==o?void 0:o.recurringPrice)>0&&(I+=parseFloat(null==o?void 0:o.recurringPrice))}),g>0&&(g+=b),h.base=JSON.stringify(parseFloat(null==o?void 0:o.value)+(g>0?g:I))):h.base=null==o?void 0:o.value:"one time"===(null===(i=null==o?void 0:o.priceType)||void 0===i?void 0:i.toLowerCase())&&(h.onetimePrice=null==o?void 0:o.value)}),null===(t=null==l?void 0:l.derivedPrice)||void 0===t||t.map(l=>{var i,n,t,u,v,r,c,a;const s={cycleStart:"",cycleEnd:"",value:""};s.cycleStart=d&&!(null===(i=null==o?void 0:o[0])||void 0===i?void 0:i.isBundle)&&(null===(n=null==o?void 0:o[0])||void 0===n?void 0:n.contractDuration)?1:null===(t=null==l?void 0:l.cycle)||void 0===t?void 0:t.cycleStart,s.cycleEnd=d&&!(null===(u=null==o?void 0:o[0])||void 0===u?void 0:u.isBundle)&&(null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.contractDuration)?d&&!(null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.isBundle)&&(null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.contractDuration):null===(a=null==l?void 0:l.cycle)||void 0===a?void 0:a.cycleEnd,s.value=null==l?void 0:l.value,e&&(null==e?void 0:e.length)>0&&(s.value=g>0?JSON.stringify(parseFloat(null==l?void 0:l.value)+g):JSON.stringify(parseFloat(null==l?void 0:l.value)+I)),h.discount.push(s)}),(null===(r=null===(v=null===(u=null==l?void 0:l.promotionInfo)||void 0===u?void 0:u[0])||void 0===v?void 0:v.relatedPromo)||void 0===r?void 0:r.length)>0&&(null===(s=null===(a=null===(c=null==l?void 0:l.promotionInfo)||void 0===c?void 0:c[0])||void 0===a?void 0:a.relatedPromo)||void 0===s||s.map(o=>{"LOYALTY_DISCOUNT"===(null==o?void 0:o.type)&&(h.loyaltyPrice=null==o?void 0:o.discount)}))})),null===(u=null===(t=null==o?void 0:o[0])||void 0===t?void 0:t.bundledOffers)||void 0===u||u.forEach(o=>{var l,i,n,e,t;null===(l=null==o?void 0:o.prices)||void 0===l||l.forEach(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.forEach(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?h.int_fmc+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(h.mob_fmc+=Number(null==o?void 0:o.value),h.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==o?void 0:o.contractDuration)&&(h.contractDuration=null==o?void 0:o.contractDuration),(null===(n=null===(i=null==o?void 0:o.promotionInfo)||void 0===i?void 0:i[0])||void 0===n?void 0:n.id)&&!d&&(h.promoID=null===(t=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===t?void 0:t.id)}),(null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.isBundle)||(h.contractDuration=null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.contractDuration,d||(h.promoID=null===(s=null===(a=null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.promotionInfo)||void 0===a?void 0:a[0])||void 0===s?void 0:s.id));let T=0;if(null===(m=null===(p=null==o?void 0:o[0])||void 0===p?void 0:p.prices)||void 0===m||m.map(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.map(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?T+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(h.mob_fmc+=Number(null==o?void 0:o.value),h.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==h?void 0:h.contractDuration)||l||(h.contractDuration="12"),h.int_fmc=h.int_fmc,"4P"==i){let l="0";null===(y=null===(f=null==o?void 0:o[0])||void 0===f?void 0:f.bundledOffers)||void 0===y||y.map(o=>{(null==o?void 0:o.contractDuration)&&(l=Number(l)>Number(null==o?void 0:o.contractDuration)?l:null==o?void 0:o.contractDuration)}),h.contractDuration=l}return h},U=(o,l)=>{var i,n;let e=o;e=o.filter(o=>{var i;const n=null===(i=null==o?void 0:o.gigaSpeed)||void 0===i?void 0:i.toLowerCase();return(null==l?void 0:l.gigaSpeed)?"hide"!=n:"show"!=n});let d=e;let t=[],u=[],v=[];for(let o of d){const l=null===(i=null==o?void 0:o.productIndex)||void 0===i?void 0:i.includes(","),e=l&&(null===(n=null==o?void 0:o.productIndex)||void 0===n?void 0:n.split(","));if(l)for(let l of e)for(let i=0;i<3;i++)Number(l)===i&&(0===i?t.push(o):1===i?u.push(o):v.push(o));else for(let l=0;l<3;l++)Number(null==o?void 0:o.productIndex)===l&&(0===l?t.push(o):1===l?u.push(o):v.push(o))}return(null==l?void 0:l.TV)&&(null==l?void 0:l.Netflix)?v:(null==l?void 0:l.TV)?u:t},M=o=>{var n;return null===(n=(null==o?void 0:o.products)||[])||void 0===n?void 0:n.map(o=>{var n,e,d;return{itemType:null!==(n=null==o?void 0:o.type)&&void 0!==n?n:"",promotionId:null!==(e=null==o?void 0:o.promo)&&void 0!==e?e:"",items:[{itemType:(null==o?void 0:o.type)===l?l:i,id:null!==(d=null==o?void 0:o.id)&&void 0!==d?d:""}]}})};let R=null;const $=o=>(null==R?void 0:R.gloxTokenId)===o&&null!==R.results,F=(o,l,i)=>{if($(o))return Promise.resolve(R.results);if((null==R?void 0:R.gloxTokenId)===o&&null!==R.promise)return R.promise;const n=v(o,l,i).then(i=>{var n;const e=null!==(n=null==i?void 0:i[l])&&void 0!==n?n:[];return(null==R?void 0:R.gloxTokenId)===o&&(R.results=e,R.promise=null),e}).catch(l=>{throw(null==R?void 0:R.gloxTokenId)===o&&(R=null),l});return R={gloxTokenId:o,results:null,promise:n},n},V=(o,l)=>{const i=o.filter(o=>{var i,n,e,d,t,u;const v=null===(u=null===(t=null===(d=null===(e=null===(n=null===(i=null==o?void 0:o.products)||void 0===i?void 0:i[0])||void 0===n?void 0:n.reference)||void 0===e?void 0:e.content)||void 0===d?void 0:d.product)||void 0===t?void 0:t[0])||void 0===u?void 0:u.productId;return l.includes(v)});return i.sort((o,i)=>{var n,e,d,t,u,v,r,c,a,s,p,m;const f=null===(v=null===(u=null===(t=null===(d=null===(e=null===(n=null==o?void 0:o.products)||void 0===n?void 0:n[0])||void 0===e?void 0:e.reference)||void 0===d?void 0:d.content)||void 0===t?void 0:t.product)||void 0===u?void 0:u[0])||void 0===v?void 0:v.productId,y=null===(m=null===(p=null===(s=null===(a=null===(c=null===(r=null==i?void 0:i.products)||void 0===r?void 0:r[0])||void 0===c?void 0:c.reference)||void 0===a?void 0:a.content)||void 0===s?void 0:s.product)||void 0===p?void 0:p[0])||void 0===m?void 0:m.productId;return l.indexOf(f)-l.indexOf(y)}),i},j=new Set(["4090"]),J=(l,n,e)=>{var d,t,u,v;if(!n&&(null==l?void 0:l.isBundle)){const i=null!==(d=null==l?void 0:l.bundledOffers)&&void 0!==d?d:[],n=null===(u=null===(t=i.find(o=>{var l,i;return null===(i=null===(l=null==o?void 0:o.promotionInfo)||void 0===l?void 0:l[0])||void 0===i?void 0:i.id}))||void 0===t?void 0:t.promotionInfo)||void 0===u?void 0:u[0],e="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid")||"";return{resolvedUsecase:null==n?void 0:n.promoType,payload:{cartItem:[{itemType:null==n?void 0:n.promoType,action:"ADD",promotionId:null==n?void 0:n.id,items:i.map(o=>({itemType:null==o?void 0:o.productType,id:null==o?void 0:o.id,action:"ADD"})),note:[{author:"linecheckCorrelationId",text:e}]}]}}}const r=null===(v=null==l?void 0:l.promotionInfo)||void 0===v?void 0:v[0];return{resolvedUsecase:null==r?void 0:r.promoType,payload:{cartItem:[{itemType:null==r?void 0:r.promoType,action:"ADD",promotionId:null==r?void 0:r.id,items:[{itemType:i,id:null==l?void 0:l.id,action:"ADD"}]}]}}},G=(l,i,n,e,d,t,u,v,r,a,s,m,f,I)=>{if(!e||!n||0===n.length)return;const g=()=>{l(!0);const u=null==n?void 0:n[0],{payload:v,resolvedUsecase:r}=J(u,t);c(v,i,e,r).then(l=>{var i;o.remove("one-commerce-cartId",{path:"/"}),o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),o.set("cartProduct",null==u?void 0:u.id,{path:"/"}),D(h,n,"",y),p(null===(i=null==d?void 0:d.summaryPageUrl)||void 0===i?void 0:i.cached_url,f)}).catch(o=>{var l;const i=null===(l=null==o?void 0:o.response)||void 0===l?void 0:l.data;j.has(String(null==i?void 0:i.code))&&I?I(i):console.log(o)}).finally(()=>{l(!1)})};if(t)g();else{const l="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid");u&&v&&l?g():(null==d?void 0:d.enableLinecheckOverlay)?r(!a):s()}};export{J as buildUpdateCartPayload,x as checkGiftOrCashback,A as combineWithSmartPhone,E as combineWithVasOptions,G as coreProductUpdateCart,U as fetchFilteredProducts,M as fetchOttItems,_ as fetchPegaProducts,B as fetchPrice,k as fetchServiceOptions,S as fetchStaticProductIds,V as filterShogunProducts,L as findHeight,F as getShogunSharedOffer,N as getTimeUntilNextTimerEvent,$ as isShogunOfferResolved,C as isTimerActive,O as staticCreateCart};
|
|
2
2
|
//# sourceMappingURL=Product.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Product.utils.js","sources":["../../../../src/components/StaticLineTable/Product.utils.ts"],"sourcesContent":["import Cookies from 'js-cookie';\r\nimport { SetStateAction } from 'react';\r\nimport {\r\n DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n DEFAULT_WIRELINE_BUNDLE,\r\n ONE_ECOMMERCE_INTERNET_SUMMARY,\r\n ONE_ECOMMERCE_SUMMARY,\r\n RATEPLAN,\r\n TV_SERVICE_OPTION,\r\n VCTYPE\r\n} from '../../utils/constants';\r\nimport { createCartV2, fetchShogunOfferData } from '../../services/LineTableService';\r\nimport {\r\n checkLinkWithLang,\r\n getElementMaximumHeight,\r\n getLocalStorageWithExpiry,\r\n redirectWithSuccess,\r\n SuccessLoaderData\r\n} from '../../utils/utils';\r\nimport { trackNewDatalayerEvent } from '../../utils/AnalyticsUtils';\r\nimport {\r\n ADDTOCART,\r\n COMBINEDEVICE,\r\n GAEVENT,\r\n LINETABLE,\r\n LINETABLEDEVICE,\r\n LINETABLEPRODUCT\r\n} from '../../Analytics/AnalyticsConstants';\r\nimport { getEcomCartInfo, trackEligibleItem } from '../../models/Analytics/items';\r\nimport { AtlOffer, OfferValidation, PegaProductRequestBase } from '../lineTable/lineTable.types';\r\nimport { calculateDateTime } from './StaticLineTabelTimer/util';\r\n\r\nexport const isTimerActive = (startTime: string, endTime: string): boolean => {\r\n try {\r\n const now = new Date();\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return false;\r\n }\r\n\r\n return now >= start && now < end;\r\n } catch {\r\n return false;\r\n }\r\n};\r\n\r\nexport const getTimeUntilNextTimerEvent = (startTime: string, endTime: string): number => {\r\n try {\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return 0;\r\n }\r\n\r\n const now = new Date().getTime();\r\n const startTimeMs = start.getTime();\r\n const endTimeMs = end.getTime();\r\n\r\n // Next transition is start when timer is upcoming, otherwise end when active.\r\n if (now < startTimeMs) {\r\n return Math.max(0, startTimeMs - now);\r\n }\r\n if (now >= startTimeMs && now < endTimeMs) {\r\n return Math.max(0, endTimeMs - now);\r\n }\r\n\r\n return 0;\r\n } catch {\r\n return 0;\r\n }\r\n};\r\n\r\nexport const fetchStaticProductIds = (\r\n productList: any,\r\n productId: any,\r\n bundle4PProduct?: boolean,\r\n tvOptionIds?: any,\r\n //US_31295\r\n pricesToggleState?: any\r\n): any => {\r\n let enableStream = false;\r\n let promotionId = '';\r\n productList?.map((data: any) => {\r\n const productRequest: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n\r\n const productData = data?.products?.[0]?.reference?.content?.product?.[0];\r\n const promotionData = data?.promotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n promotionId = promotionData?.promotionId;\r\n productRequest['id'] = productData?.productId;\r\n const timer = data?.timer?.[0];\r\n const timerIsActive = timer ? isTimerActive(timer.startTime, timer.endTime) : false;\r\n const timerPromotionId =\r\n timer?.promotion?.[0]?.reference?.content?.promoDescription?.[0]?.promotionId;\r\n const defaultPromotionId =\r\n pricesToggleState && pricesToggleState === true && promotionData?.promotionId === ''\r\n ? DEFAULT_MOBILEPOSTPAID_BUNDLE\r\n : promotionData?.promotionId;\r\n\r\n //US_31295 - add default promo only when timer is not active and timer has no promo\r\n if (timerIsActive && timerPromotionId) {\r\n productRequest?.promoIds?.push(timerPromotionId);\r\n } else {\r\n productRequest?.promoIds?.push(defaultPromotionId);\r\n }\r\n\r\n //for 4P product\r\n if (bundle4PProduct) {\r\n const mobilePromotionData =\r\n data?.mobilePromotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n productRequest?.promoIds?.push(mobilePromotionData?.promotionId);\r\n }\r\n\r\n productId?.push(productRequest);\r\n });\r\n if (enableStream) {\r\n tvOptionIds?.map((option: any) => {\r\n const tvOptionObj: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n tvOptionObj['id'] = option?.text;\r\n tvOptionObj?.promoIds?.push(promotionId);\r\n\r\n productId?.push(tvOptionObj);\r\n });\r\n }\r\n};\r\n\r\nexport const fetchPegaProducts = (\r\n content: any,\r\n pegaCustomerInterest?: string,\r\n placements?: string\r\n): PegaProductRequestBase => {\r\n // const url = window?.location?.pathname?.split('/') ?? [];\r\n // const pathname = url[url.length - 1];\r\n //set customerInterest as content?.tabCaption capitalize inital letter and after space and then remove spaces - from Other plans into OtherPlans\r\n const customerInterest = content?.tabCaption\r\n ?.replace(/\\b\\w/g, (l: string) => l.toUpperCase())\r\n .replace(/\\s+/g, '');\r\n\r\n const offerValidations = [\r\n {\r\n key: 'Segment',\r\n type: 'CustomerType',\r\n value: 'Residential'\r\n },\r\n {\r\n key: 'OrderType',\r\n type: 'CustomerInterest',\r\n value: 'New'\r\n },\r\n {\r\n key: 'CurrentPage',\r\n type: 'Context',\r\n value: 'mobile-subscription' //pathname ?? ''\r\n },\r\n {\r\n key: 'Category',\r\n type: 'CustomerInterest',\r\n value: customerInterest ?? ''\r\n },\r\n {\r\n key: 'RequestedOfferCount',\r\n type: 'Context',\r\n value: content?.pegaRequestOfferCount?.toString() ?? '3'\r\n },\r\n pegaCustomerInterest\r\n ? {\r\n key: 'Tag',\r\n type: 'CustomerInterest',\r\n value: pegaCustomerInterest\r\n }\r\n : null\r\n ].filter(Boolean) as OfferValidation[];\r\n\r\n const atlOffers: AtlOffer = {\r\n placements,\r\n offerValidations\r\n };\r\n\r\n const pegaProducts: PegaProductRequestBase = {\r\n atlOffers: [atlOffers]\r\n };\r\n\r\n return pegaProducts;\r\n};\r\n\r\nexport const checkGiftOrCashback = (data: any): any => {\r\n let showGift = false;\r\n let cashbackAvailable = false;\r\n data?.map((product: any) => {\r\n product?.promotionInfo?.map((offer: any) => {\r\n if (offer?.hardwareGift) showGift = true;\r\n if (offer?.cashBack) cashbackAvailable = true;\r\n });\r\n });\r\n return { showGift, cashbackAvailable };\r\n};\r\n\r\nexport const staticCreateCart = (\r\n setShowLoader: { (value: SetStateAction<boolean>): void; (arg0: boolean): void },\r\n cartEndPoint: string,\r\n giftItem: any,\r\n uniqueProductData: any,\r\n mainContent: any,\r\n showPrice: any,\r\n isMobileFlow: boolean,\r\n radioValue: any,\r\n eligibleBundle: any,\r\n address: any,\r\n setShowLinecheck: any,\r\n showLinecheck: any,\r\n lineCheckCallBack: any,\r\n enableP2P: any,\r\n P2PData: any,\r\n content: any,\r\n tvOptions?: any,\r\n discountRef?: string,\r\n discountVersion?: string,\r\n // Shogun/rewards (loyalty) flow — forwarded verbatim to createCartV2 so it\r\n // can append the pointsBurnt note at the item level (RATEPLAN for MOBILE,\r\n // internet item for FIXNET).\r\n rewardsInfo?: { pointsBurnt?: string | number; rewardOfferId?: string | number; gloxTokenId?: string | null },\r\n successLoaderData?: SuccessLoaderData\r\n): any => {\r\n if (isMobileFlow) {\r\n setShowLoader(true);\r\n const vcType: { voucher: string; voucherType: string } = getLocalStorageWithExpiry(VCTYPE);\r\n Object.keys(uniqueProductData)?.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n '',\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n cartEndPoint,\r\n 'mobile',\r\n giftItem,\r\n enableP2P,\r\n P2PData,\r\n mainContent?.productContainer?.[0]?.isQoQaFlow,\r\n vcType?.voucher,\r\n null,\r\n null,\r\n discountRef,\r\n discountVersion,\r\n rewardsInfo\r\n )\r\n .then((res: any) => {\r\n Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEPRODUCT);\r\n\r\n redirectWithSuccess(mainContent?.summaryPageUrl?.cached_url, successLoaderData);\r\n })\r\n .catch((err) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n setShowLoader(false);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n } else {\r\n const linecheckId: any =\r\n typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid');\r\n if (!eligibleBundle || !address || !linecheckId) {\r\n mainContent?.enableLinecheckOverlay ? setShowLinecheck(!showLinecheck) : lineCheckCallBack();\r\n } else {\r\n setShowLoader(true);\r\n uniqueProductData.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n radioValue,\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_WIRELINE_BUNDLE,\r\n cartEndPoint,\r\n 'fixnet',\r\n giftItem,\r\n '',\r\n '',\r\n false,\r\n '',\r\n '',\r\n tvOptions,\r\n undefined,\r\n undefined,\r\n rewardsInfo\r\n )\r\n .then((res: any) => {\r\n typeof window !== 'undefined' && Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n typeof window !== 'undefined' &&\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n typeof window !== 'undefined' &&\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n typeof window !== 'undefined' && Cookies.remove('landline');\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLE);\r\n const productUrl = checkLinkWithLang(content?.productBasedCheckoutUrl?.cached_url);\r\n let recommendAccessory = false;\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (uniqueProductData[0]?.isBundle) {\r\n uniqueProductData[0]?.bundledOffers?.map((item: any) => {\r\n if (\r\n item?.productType?.toLowerCase() === 'internet' ||\r\n item?.productType?.toLowerCase() == 'tv'\r\n ) {\r\n if (item?.recommendAccessory) {\r\n recommendAccessory = item?.recommendAccessory;\r\n }\r\n }\r\n // setting to false incase of Mobile product Type as it is currently out of scope\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n recommendAccessory = false;\r\n return;\r\n }\r\n });\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n if (uniqueProductData?.[0]?.recommendAccessory) {\r\n recommendAccessory = uniqueProductData?.[0]?.recommendAccessory;\r\n }\r\n }\r\n //setting the session to identify internet flow for mia for win\r\n if (recommendAccessory) {\r\n const sessionObj = { flow: 'WIN' };\r\n sessionStorage.setItem(ONE_ECOMMERCE_SUMMARY, JSON.stringify(sessionObj));\r\n }\r\n\r\n const finalURL = productUrl\r\n ? productUrl\r\n : content?.enableTVStreamingOptionsStepper && mainContent?.vasStepperURL?.cached_url\r\n ? mainContent?.vasStepperURL?.cached_url\r\n : recommendAccessory && mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n ? mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n : mainContent?.summaryPageUrl?.cached_url;\r\n\r\n redirectWithSuccess(finalURL, successLoaderData);\r\n })\r\n .catch((err: any) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n }\r\n }\r\n};\r\n\r\nconst pendingHeightPasses = new Map<number, ReturnType<typeof setTimeout> | boolean>();\r\n\r\nconst equalizeSectionGroup = (prefixes: string[], tabIndex: number, cardsLength: number) => {\r\n const groups: HTMLElement[][] = [];\r\n\r\n for (const prefix of prefixes) {\r\n const idPrefix = `${prefix}${tabIndex}`;\r\n const elements: HTMLElement[] = [];\r\n for (let item = 0; item < cardsLength; item++) {\r\n const element = document.getElementById(`${idPrefix}${item}`);\r\n if (element) {\r\n elements.push(element);\r\n }\r\n }\r\n if (elements.length > 0) {\r\n groups.push(elements);\r\n }\r\n }\r\n\r\n if (groups.length === 0) {\r\n return;\r\n }\r\n\r\n // Phase 1: Batch all DOM writes (reset heights)\r\n for (const elements of groups) {\r\n for (const element of elements) {\r\n element.style.height = 'unset';\r\n }\r\n }\r\n\r\n // Phase 2: Batch all DOM reads (single layout reflow for the entire level)\r\n const maxHeights = groups.map((elements) =>\r\n Math.max(...elements.map((element) => element.clientHeight))\r\n );\r\n\r\n // Phase 3: Batch all DOM writes (apply equalized heights)\r\n groups.forEach((elements, index) => {\r\n const maxHeight = `${maxHeights[index]}px`;\r\n for (const element of elements) {\r\n element.style.height = maxHeight;\r\n }\r\n });\r\n};\r\n\r\n// Every card in a tab requests the same pass; run it once per tab before paint when delay is 0.\r\nexport const scheduleFindHeight = (tabIndex: number, cardsLength: number, delay = 0) => {\r\n const pending = pendingHeightPasses.get(tabIndex);\r\n if (pending) {\r\n if (typeof pending !== 'boolean') {\r\n clearTimeout(pending);\r\n } else if (delay <= 0) {\r\n return;\r\n }\r\n }\r\n\r\n if (delay <= 0 && typeof queueMicrotask === 'function') {\r\n pendingHeightPasses.set(tabIndex, true);\r\n queueMicrotask(() => {\r\n pendingHeightPasses.delete(tabIndex);\r\n findHeight(tabIndex, cardsLength);\r\n });\r\n return;\r\n }\r\n\r\n pendingHeightPasses.set(\r\n tabIndex,\r\n setTimeout(() => {\r\n pendingHeightPasses.delete(tabIndex);\r\n findHeight(tabIndex, cardsLength);\r\n }, delay)\r\n );\r\n};\r\n\r\nexport const findHeight = (tabIndex: number, cardsLength: number) => {\r\n const setTimerSectionHeight = () => {\r\n let maxActiveTimerHeight = 0;\r\n const timerSections: HTMLElement[] = [];\r\n\r\n [...Array(cardsLength)].forEach((_, index) => {\r\n const timerSection = document.getElementById(`timer-section${tabIndex}${index}`);\r\n if (timerSection) {\r\n timerSections.push(timerSection);\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n if (isTimerActive) {\r\n const spacer = timerSection.firstElementChild as HTMLElement | null;\r\n // Read the inline style target height instead of clientHeight so that\r\n // an in-progress CSS transition does not yield an intermediate value.\r\n const targetHeight = parseFloat(spacer?.style.height || '0') || 0;\r\n maxActiveTimerHeight = Math.max(maxActiveTimerHeight, targetHeight);\r\n }\r\n }\r\n });\r\n\r\n timerSections.forEach((timerSection) => {\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n timerSection.style.transition = 'height 0.3s ease';\r\n timerSection.style.height = isTimerActive ? '0px' : `${maxActiveTimerHeight}px`;\r\n });\r\n };\r\n\r\n setTimerSectionHeight();\r\n\r\n const entitlementPrefixes = new Set<string>();\r\n document.querySelectorAll<HTMLElement>(`[data-entitlement-tab=\"${tabIndex}\"]`).forEach((element) => {\r\n entitlementPrefixes.add(`entitlement-row-${element.dataset.entitlementRow}-`);\r\n });\r\n equalizeSectionGroup([...entitlementPrefixes], tabIndex, cardsLength);\r\n\r\n // Level 1: Equalize independent leaf sections in a single layout pass\r\n equalizeSectionGroup(\r\n [\r\n 'headingV3',\r\n 'descriptionV3',\r\n 'titleV3',\r\n 'product-configv3',\r\n 'cashback-section',\r\n 'exclusive-benefits-section',\r\n 'benefits-section',\r\n 'price-section',\r\n 'discountedpricetoggle-section',\r\n 'contract-section'\r\n ],\r\n tabIndex,\r\n cardsLength\r\n );\r\n\r\n // Level 2: Equalize mid-level parent sections after their children are sized\r\n equalizeSectionGroup(\r\n ['detailsectionv3', 'gift-section', 'order-section'],\r\n tabIndex,\r\n cardsLength\r\n );\r\n\r\n // Level 3: Equalize outer bottom container after its children are sized\r\n getElementMaximumHeight('benefits-price-section' + `${tabIndex}`, cardsLength);\r\n};\r\n\r\nconst setMobileSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n pretopostvalues?: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration = productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n const pretopostvalue = pretopostvalues ?? '';\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const flow = urlParams.get('flow');\r\n const sessionObj: any = {\r\n mobileSubscription: productPrice?.[0]?.id ?? '',\r\n mobileSubscriptionPrice: discount > 0 ? discount : base,\r\n mobileSubscriptionPromo: promoId,\r\n subGroup: 'MOBILE',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withoutPromo: false,\r\n pretopostvalue: pretopostvalue,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n isOttFlow: flow === 'ott' ? true : false\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem('one-ecommerce-mobileSummary', JSON.stringify(sessionObj));\r\n};\r\n\r\nexport const combineWithSmartPhone = (\r\n showPrice: any,\r\n storyContent: any,\r\n uniqueProductData: any,\r\n responseData?: any,\r\n product?: any,\r\n pegaIntegration?: boolean\r\n) => {\r\n const pretopostvalues = {\r\n msisdn: responseData?.msisdn ?? '',\r\n ratePlan: responseData?.ratePlan ?? '',\r\n ratePlanType: responseData?.ratePlanType ?? '',\r\n productId: responseData ? showPrice?.id : ''\r\n };\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n let Params = '';\r\n Params = `?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${\r\n promoId ?? ''\r\n }&productCode=${showPrice?.id ?? ''}`;\r\n window.location.href = storyContent?.addSmartPhone?.[0]?.buttonLink?.cached_url + Params;\r\n setMobileSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n responseData && pretopostvalues,\r\n showPrice,\r\n product,\r\n pegaIntegration\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nconst setFixnetSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any,\r\n productName?: string,\r\n recommendAccessory?: boolean | undefined\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration =\r\n productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? showPrice?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n\r\n const sessionObj: any = {\r\n internetSubscription: productName ?? '',\r\n internetSubscriptionId: productPrice?.[0]?.id ?? '',\r\n internetSubscriptionPrice: discount > 0 ? discount : base,\r\n internetSubscriptionPromo: promoId,\r\n subGroup: 'INTERNET',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withPromo: discount > 0 ? true : false,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n productType: 'subscription',\r\n recommendAccessory: recommendAccessory\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem(ONE_ECOMMERCE_INTERNET_SUMMARY, JSON.stringify(sessionObj));\r\n};\r\nexport const combineWithVasOptions = (\r\n showPrice: any,\r\n uniqueProductData: any,\r\n product?: any,\r\n pegaIntegration?: boolean,\r\n productName?: string,\r\n recommendAccessory?: boolean\r\n) => {\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n\r\n setFixnetSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n showPrice,\r\n product,\r\n pegaIntegration,\r\n productName,\r\n recommendAccessory\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nexport const fetchServiceOptions = (entitlement: any, isMobileFlow: boolean) => {\r\n let service: any;\r\n if (!isMobileFlow) {\r\n service = (entitlement || []).filter((product: any) => product?.enableTV === true);\r\n }\r\n return service;\r\n};\r\n\r\nexport const fetchPrice = (\r\n product: any,\r\n isMobileFlow: boolean,\r\n pageType?: string,\r\n isConfigurator?: boolean,\r\n tvOptions?: any[],\r\n pegaIntegration?: boolean\r\n): any => {\r\n const showPrice: any = {\r\n base: '',\r\n onetimePrice: '',\r\n discount: [],\r\n contractDuration: '',\r\n int_fmc: 0,\r\n mob_fmc: 0,\r\n mob_benefit_category: '',\r\n id: '',\r\n promoID: '',\r\n loyaltyPrice: ''\r\n };\r\n let tvOptionsBasePrice = 0;\r\n let tvOptionsDiscountPrice = 0;\r\n let tvOptionsBaseToDiscount = 0;\r\n\r\n Array.isArray(product) &&\r\n product?.map((item: any) => {\r\n showPrice['id'] = item?.id ?? '';\r\n item?.prices?.map((basePrice: any) => {\r\n if (basePrice?.priceType?.toLowerCase() === 'recurring') {\r\n if (tvOptions && tvOptions?.length > 0) {\r\n tvOptions?.forEach((opt: any) => {\r\n if (opt?.beneficiaryPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.beneficiaryPrice);\r\n } else if (opt?.derivedPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.derivedPrice);\r\n } else {\r\n tvOptionsBaseToDiscount += parseFloat(opt?.recurringPrice);\r\n }\r\n if (opt?.recurringPrice > 0) {\r\n tvOptionsBasePrice += parseFloat(opt?.recurringPrice);\r\n }\r\n });\r\n //If one of the options in the list has a discount, other options base price is stored to sum it up in the end\r\n if (tvOptionsDiscountPrice > 0) {\r\n tvOptionsDiscountPrice += tvOptionsBaseToDiscount;\r\n }\r\n showPrice['base'] = JSON.stringify(\r\n parseFloat(basePrice?.value) +\r\n (tvOptionsDiscountPrice > 0 ? tvOptionsDiscountPrice : tvOptionsBasePrice)\r\n );\r\n } else {\r\n showPrice['base'] = basePrice?.value;\r\n }\r\n } else if (basePrice?.priceType?.toLowerCase() === 'one time')\r\n showPrice['onetimePrice'] = basePrice?.value;\r\n });\r\n item?.derivedPrice?.map((discountPrice: any) => {\r\n const cycle = { cycleStart: '', cycleEnd: '', value: '' };\r\n cycle['cycleStart'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? 1\r\n : discountPrice?.cycle?.cycleStart;\r\n cycle['cycleEnd'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n : discountPrice?.cycle?.cycleEnd;\r\n cycle['value'] = discountPrice?.value;\r\n if (tvOptions && tvOptions?.length > 0) {\r\n if (tvOptionsDiscountPrice > 0) {\r\n cycle['value'] = JSON.stringify(\r\n parseFloat(discountPrice?.value) + tvOptionsDiscountPrice\r\n );\r\n } else {\r\n cycle['value'] = JSON.stringify(parseFloat(discountPrice?.value) + tvOptionsBasePrice);\r\n }\r\n }\r\n showPrice['discount'].push(cycle);\r\n });\r\n // Calculating loyalty price introduced with DC portfolio\r\n if (item?.promotionInfo?.[0]?.relatedPromo?.length > 0) {\r\n item?.promotionInfo?.[0]?.relatedPromo?.map((promo: any) => {\r\n if (promo?.type === 'LOYALTY_DISCOUNT') {\r\n showPrice['loyaltyPrice'] = promo?.discount;\r\n }\r\n });\r\n }\r\n });\r\n\r\n product?.[0]?.bundledOffers?.forEach((item: any) => {\r\n item?.prices?.forEach((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.forEach((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n showPrice['int_fmc'] += Number(price?.value);\r\n } else if (\r\n price?.priceCategory == 'MULTIMOBILE' ||\r\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\r\n price?.priceCategory == 'FMC'\r\n ) {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (item?.contractDuration) {\r\n showPrice['contractDuration'] = item?.contractDuration; // for bundled products contract duration is taken from bundled offers\r\n }\r\n if (item?.promotionInfo?.[0]?.id && !pegaIntegration) {\r\n showPrice['promoID'] = item?.promotionInfo?.[0]?.id;\r\n }\r\n });\r\n if (!product?.[0]?.isBundle) {\r\n showPrice['contractDuration'] = product?.[0]?.contractDuration; // for other products\r\n if (!pegaIntegration) {\r\n showPrice['promoID'] = product?.[0]?.promotionInfo?.[0]?.id;\r\n }\r\n }\r\n let int_fmc = 0;\r\n product?.[0]?.prices?.map((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.map((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n int_fmc += Number(price?.value);\r\n } else if (\r\n price?.priceCategory == 'MULTIMOBILE' ||\r\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\r\n price?.priceCategory == 'FMC'\r\n ) {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (!showPrice?.contractDuration && !isMobileFlow) {\r\n showPrice['contractDuration'] = '12';\r\n }\r\n {\r\n showPrice['int_fmc'] = isConfigurator ? int_fmc : showPrice['int_fmc'];\r\n }\r\n if (pageType == '4P') {\r\n let bundleContractDuration = '0';\r\n product?.[0]?.bundledOffers?.map((offerData: any) => {\r\n if (offerData?.contractDuration) {\r\n bundleContractDuration =\r\n Number(bundleContractDuration) > Number(offerData?.contractDuration)\r\n ? bundleContractDuration\r\n : offerData?.contractDuration;\r\n }\r\n });\r\n showPrice['contractDuration'] = bundleContractDuration;\r\n }\r\n return showPrice;\r\n};\r\n\r\n//function for creating different array for 3 selections\r\nexport const fetchFilteredProducts = (productList: any, toggleState: any) => {\r\n //need to centralize for comman solution\r\n // Filter productList based on gigaSpeed toggle - US #363853\r\n let filteredList = productList;\r\n\r\n filteredList = productList.filter((item: any) => {\r\n const gigaSpeedValue = item?.gigaSpeed?.toLowerCase();\r\n if (toggleState?.gigaSpeed) {\r\n return gigaSpeedValue != 'hide';\r\n } else {\r\n return gigaSpeedValue != 'show';\r\n }\r\n });\r\n\r\n let mainArray = filteredList;\r\n const numberOfArray = 3;\r\n let res1 = [];\r\n let res2 = [];\r\n let res3 = [];\r\n for (let item of mainArray) {\r\n const multiIndex = item?.productIndex?.includes(',');\r\n const updatedMultiIndex = multiIndex && item?.productIndex?.split(',');\r\n if (multiIndex) {\r\n for (let mIndex of updatedMultiIndex) {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(mIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(item?.productIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n }\r\n const displayContent =\r\n toggleState?.TV && toggleState?.Netflix ? res3 : toggleState?.TV ? res2 : res1;\r\n return displayContent;\r\n};\r\nexport const fetchOttItems = (ottCartData: any) => {\r\n return (ottCartData?.products || [])?.map((products: any) => ({\r\n itemType: products?.type ?? '',\r\n promotionId: products?.promo ?? '',\r\n items: [\r\n {\r\n itemType: products?.type === TV_SERVICE_OPTION ? TV_SERVICE_OPTION : RATEPLAN,\r\n id: products?.id ?? ''\r\n }\r\n ]\r\n }));\r\n};\r\n\r\n// ─── Shogun shared-offer cache ────────────────────────────────────────────────\r\n\r\ninterface ShogunOfferCacheEntry {\r\n gloxTokenId: string;\r\n results: any[] | null;\r\n promise: Promise<any[]> | null;\r\n}\r\n\r\nlet shogunOfferSharedCache: ShogunOfferCacheEntry | null = null;\r\n\r\n/**\r\n * Returns true when the shared cache already holds resolved results for the\r\n * given token. Callers can use this to skip triggering a loading state.\r\n */\r\nexport const isShogunOfferResolved = (gloxTokenId: string): boolean =>\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.results !== null;\r\n\r\n/**\r\n * Shared-promise manager for the Shogun offer API.\r\n *\r\n * Because the Shogun flow sends no product payload (only gloxTokenId) the\r\n * response is identical for every StaticProductContainer on the page.\r\n * This function ensures exactly one network request is made:\r\n * - If results are already resolved → returns Promise.resolve(results)\r\n * - If a fetch is in-flight → returns the same promise\r\n * - First caller → creates the fetch and stores the promise\r\n *\r\n * On failure the promise rejects — the caller is responsible for surfacing\r\n * the error (e.g. showing the telesales/error popup). The failure is NOT\r\n * cached, so a retry (e.g. tab switch) will trigger a fresh request.\r\n */\r\nexport const getShogunSharedOffer = (\r\n gloxTokenId: string,\r\n uniqueId: string,\r\n offerEndpoint: string\r\n): Promise<any[]> => {\r\n // Already resolved\r\n if (isShogunOfferResolved(gloxTokenId)) {\r\n return Promise.resolve(shogunOfferSharedCache!.results!);\r\n }\r\n\r\n // In-flight\r\n if (\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.promise !== null\r\n ) {\r\n return shogunOfferSharedCache.promise;\r\n }\r\n\r\n // First caller — start the real fetch\r\n const fetchPromise: Promise<any[]> = fetchShogunOfferData(gloxTokenId, uniqueId, offerEndpoint)\r\n .then((resp: any) => {\r\n const results: any[] = resp?.[uniqueId] ?? [];\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache.results = results;\r\n shogunOfferSharedCache.promise = null;\r\n }\r\n return results;\r\n })\r\n .catch((err: any) => {\r\n // Clear the cache entry so the next call retries the API.\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache = null;\r\n }\r\n throw err;\r\n });\r\n\r\n shogunOfferSharedCache = { gloxTokenId, results: null, promise: fetchPromise };\r\n return fetchPromise;\r\n};\r\n\r\n\r\n/**\r\n * Filters and sorts the Storyblok product list to match only the products\r\n * returned by the Shogun offer API, preserving the API response order.\r\n */\r\nexport const filterShogunProducts = (\r\n availableProducts: any[],\r\n shogunProductIds: string[]\r\n): any[] => {\r\n const filtered = availableProducts.filter((product: any) => {\r\n const productId = product?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.includes(productId);\r\n });\r\n\r\n filtered.sort((a: any, b: any) => {\r\n const aId = a?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n const bId = b?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.indexOf(aId) - shogunProductIds.indexOf(bId);\r\n });\r\n\r\n return filtered;\r\n};\r\n"],"names":["isTimerActive","startTime","endTime","now","Date","start","calculateDateTime","replace","end","Number","isNaN","getTime","_a","getTimeUntilNextTimerEvent","startTimeMs","endTimeMs","Math","max","fetchStaticProductIds","productList","productId","bundle4PProduct","tvOptionIds","pricesToggleState","map","data","productRequest","id","promoIds","productData","_e","_d","_c","_b","products","reference","content","product","promotionData","_k","_j","_h","_g","_f","promotion","promoDescription","promotionId","timer","_l","timerIsActive","timerPromotionId","_s","_r","_q","_p","_o","_m","defaultPromotionId","DEFAULT_MOBILEPOSTPAID_BUNDLE","_t","push","_u","mobilePromotionData","_z","_y","_x","_w","_v","mobilePromotion","_0","fetchPegaProducts","pegaCustomerInterest","placements","customerInterest","tabCaption","l","toUpperCase","atlOffers","offerValidations","key","type","value","pegaRequestOfferCount","toString","filter","Boolean","checkGiftOrCashback","showGift","cashbackAvailable","promotionInfo","offer","hardwareGift","cashBack","staticCreateCart","setShowLoader","cartEndPoint","giftItem","uniqueProductData","mainContent","showPrice","isMobileFlow","radioValue","eligibleBundle","address","setShowLinecheck","showLinecheck","lineCheckCallBack","enableP2P","P2PData","tvOptions","discountRef","discountVersion","rewardsInfo","successLoaderData","vcType","getLocalStorageWithExpiry","VCTYPE","Object","keys","length","createCartV2","promoID","productContainer","isQoQaFlow","voucher","then","res","Cookies","remove","path","set","trackEligibleItem","ADDTOCART","LINETABLEPRODUCT","redirectWithSuccess","summaryPageUrl","cached_url","catch","err","console","log","finally","linecheckId","window","get","DEFAULT_WIRELINE_BUNDLE","undefined","LINETABLE","productUrl","checkLinkWithLang","productBasedCheckoutUrl","recommendAccessory","isBundle","bundledOffers","item","productType","toLowerCase","sessionObj","flow","sessionStorage","setItem","ONE_ECOMMERCE_SUMMARY","JSON","stringify","finalURL","enableTVStreamingOptionsStepper","vasStepperURL","multiItemPageRedirectionUrl","enableLinecheckOverlay","pendingHeightPasses","Map","equalizeSectionGroup","prefixes","tabIndex","cardsLength","groups","prefix","idPrefix","elements","element","document","getElementById","style","height","maxHeights","clientHeight","forEach","index","maxHeight","scheduleFindHeight","delay","pending","clearTimeout","queueMicrotask","delete","findHeight","setTimeout","maxActiveTimerHeight","timerSections","Array","_","timerSection","dataset","timerActive","spacer","firstElementChild","targetHeight","parseFloat","transition","setTimerSectionHeight","entitlementPrefixes","Set","querySelectorAll","add","entitlementRow","getElementMaximumHeight","combineWithSmartPhone","storyContent","responseData","pegaIntegration","pretopostvalues","msisdn","ratePlan","ratePlanType","promoId","Params","location","href","addSmartPhone","buttonLink","productPrice","base","prices","discount","derivedPrice","contractDuration","campaignDuration","pretopostvalue","version","clientDiscountInfo","discountType","note","author","text","extraNotes","URLSearchParams","search","mobileSubscription","mobileSubscriptionPrice","mobileSubscriptionPromo","subGroup","duration","basePrice","withoutPromo","upBenefit","mob_benefit_category","ultimateBundlePromo","ultimateBundlePromotion","isOttFlow","setMobileSummarySession","trackNewDatalayerEvent","GAEVENT","COMBINEDEVICE","getEcomCartInfo","LINETABLEDEVICE","combineWithVasOptions","productName","internetSubscription","internetSubscriptionId","internetSubscriptionPrice","internetSubscriptionPromo","withPromo","_1","ONE_ECOMMERCE_INTERNET_SUMMARY","setFixnetSummarySession","fetchServiceOptions","entitlement","service","enableTV","fetchPrice","pageType","isConfigurator","onetimePrice","int_fmc","mob_fmc","loyaltyPrice","tvOptionsBasePrice","tvOptionsDiscountPrice","tvOptionsBaseToDiscount","isArray","priceType","opt","beneficiaryPrice","recurringPrice","discountPrice","cycle","cycleStart","cycleEnd","relatedPromo","promo","productDetails","priceAlteration","price","priceCategory","bundleContractDuration","offerData","fetchFilteredProducts","toggleState","filteredList","gigaSpeedValue","gigaSpeed","mainArray","res1","res2","res3","multiIndex","productIndex","includes","updatedMultiIndex","split","mIndex","i","TV","Netflix","fetchOttItems","ottCartData","itemType","items","TV_SERVICE_OPTION","RATEPLAN","shogunOfferSharedCache","isShogunOfferResolved","gloxTokenId","results","getShogunSharedOffer","uniqueId","offerEndpoint","Promise","resolve","promise","fetchPromise","fetchShogunOfferData","resp","filterShogunProducts","availableProducts","shogunProductIds","filtered","sort","a","b","aId","bId","indexOf"],"mappings":"81BAgCaA,EAAgB,CAACC,EAAmBC,KAC/C,IACE,MAAMC,EAAM,IAAIC,KACVC,EAAQC,EAAkB,IAAIF,KAAKH,EAAUM,QAAQ,KAAM,OAC3DC,EAAMF,EAAkB,IAAIF,KAAKF,EAAQK,QAAQ,KAAM,OAE7D,OAAIE,OAAOC,MAAML,EAAMM,aAAcF,OAAOC,MAAMF,EAAIG,aAI/CR,GAAOE,GAASF,EAAMK,EAC/B,CAAE,MAAAI,GACA,OAAO,CACT,GAGWC,EAA6B,CAACZ,EAAmBC,KAC5D,IACE,MAAMG,EAAQC,EAAkB,IAAIF,KAAKH,EAAUM,QAAQ,KAAM,OAC3DC,EAAMF,EAAkB,IAAIF,KAAKF,EAAQK,QAAQ,KAAM,OAE7D,GAAIE,OAAOC,MAAML,EAAMM,YAAcF,OAAOC,MAAMF,EAAIG,WACpD,OAAO,EAGT,MAAMR,GAAM,IAAIC,MAAOO,UACjBG,EAAcT,EAAMM,UACpBI,EAAYP,EAAIG,UA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AA2B,QAA3BC,EAAgB,QAAhBC,EAAW,QAAXC,EAAAmT,aAAC,EAADA,EAAG3T,gBAAQ,IAAAQ,OAAA,EAAAA,EAAG,UAAE,IAAAD,OAAA,EAAAA,EAAEN,iBAAS,IAAAK,OAAA,EAAAA,EAAEJ,eAAO,IAAAG,OAAA,EAAAA,EAAEF,eAAO,IAAAW,OAAA,EAAAA,EAAG,UAAE,IAAAQ,OAAA,EAAAA,EAAEpC,UAChE,OAAOqU,EAAiBO,QAAQF,GAAOL,EAAiBO,QAAQD,KAG3DL"}
|
|
1
|
+
{"version":3,"file":"Product.utils.js","sources":["../../../../src/components/StaticLineTable/Product.utils.ts"],"sourcesContent":["import Cookies from 'js-cookie';\r\nimport { SetStateAction } from 'react';\r\nimport {\r\n DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n DEFAULT_WIRELINE_BUNDLE,\r\n ONE_ECOMMERCE_INTERNET_SUMMARY,\r\n ONE_ECOMMERCE_SUMMARY,\r\n RATEPLAN,\r\n TV_SERVICE_OPTION,\r\n VCTYPE\r\n} from '../../utils/constants';\r\nimport { createCartV2, fetchShogunOfferData, coreUpdateCart } from '../../services/LineTableService';\r\nimport {\r\n checkLinkWithLang,\r\n getElementMaximumHeight,\r\n getLocalStorageWithExpiry,\r\n redirectWithSuccess,\r\n SuccessLoaderData\r\n} from '../../utils/utils';\r\nimport { trackNewDatalayerEvent } from '../../utils/AnalyticsUtils';\r\nimport {\r\n ADDTOCART,\r\n COMBINEDEVICE,\r\n GAEVENT,\r\n LINETABLE,\r\n LINETABLEDEVICE,\r\n LINETABLEPRODUCT\r\n} from '../../Analytics/AnalyticsConstants';\r\nimport { getEcomCartInfo, trackEligibleItem } from '../../models/Analytics/items';\r\nimport { AtlOffer, OfferValidation, PegaProductRequestBase } from '../lineTable/lineTable.types';\r\nimport { calculateDateTime } from './StaticLineTabelTimer/util';\r\n\r\nexport const isTimerActive = (startTime: string, endTime: string): boolean => {\r\n try {\r\n const now = new Date();\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return false;\r\n }\r\n\r\n return now >= start && now < end;\r\n } catch {\r\n return false;\r\n }\r\n};\r\n\r\nexport const getTimeUntilNextTimerEvent = (startTime: string, endTime: string): number => {\r\n try {\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return 0;\r\n }\r\n\r\n const now = new Date().getTime();\r\n const startTimeMs = start.getTime();\r\n const endTimeMs = end.getTime();\r\n\r\n // Next transition is start when timer is upcoming, otherwise end when active.\r\n if (now < startTimeMs) {\r\n return Math.max(0, startTimeMs - now);\r\n }\r\n if (now >= startTimeMs && now < endTimeMs) {\r\n return Math.max(0, endTimeMs - now);\r\n }\r\n\r\n return 0;\r\n } catch {\r\n return 0;\r\n }\r\n};\r\n\r\nexport const fetchStaticProductIds = (\r\n productList: any,\r\n productId: any,\r\n bundle4PProduct?: boolean,\r\n tvOptionIds?: any,\r\n //US_31295\r\n pricesToggleState?: any\r\n): any => {\r\n let enableStream = false;\r\n let promotionId = '';\r\n productList?.map((data: any) => {\r\n const productRequest: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n\r\n const productData = data?.products?.[0]?.reference?.content?.product?.[0];\r\n const promotionData = data?.promotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n promotionId = promotionData?.promotionId;\r\n productRequest['id'] = productData?.productId;\r\n const timer = data?.timer?.[0];\r\n const timerIsActive = timer ? isTimerActive(timer.startTime, timer.endTime) : false;\r\n const timerPromotionId =\r\n timer?.promotion?.[0]?.reference?.content?.promoDescription?.[0]?.promotionId;\r\n const defaultPromotionId =\r\n pricesToggleState && pricesToggleState === true && promotionData?.promotionId === ''\r\n ? DEFAULT_MOBILEPOSTPAID_BUNDLE\r\n : promotionData?.promotionId;\r\n\r\n //US_31295 - add default promo only when timer is not active and timer has no promo\r\n if (timerIsActive && timerPromotionId) {\r\n productRequest?.promoIds?.push(timerPromotionId);\r\n } else {\r\n productRequest?.promoIds?.push(defaultPromotionId);\r\n }\r\n\r\n //for 4P product\r\n if (bundle4PProduct) {\r\n const mobilePromotionData =\r\n data?.mobilePromotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n productRequest?.promoIds?.push(mobilePromotionData?.promotionId);\r\n }\r\n\r\n productId?.push(productRequest);\r\n });\r\n if (enableStream) {\r\n tvOptionIds?.map((option: any) => {\r\n const tvOptionObj: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n tvOptionObj['id'] = option?.text;\r\n tvOptionObj?.promoIds?.push(promotionId);\r\n\r\n productId?.push(tvOptionObj);\r\n });\r\n }\r\n};\r\n\r\nexport const fetchPegaProducts = (\r\n content: any,\r\n pegaCustomerInterest?: string,\r\n placements?: string\r\n): PegaProductRequestBase => {\r\n // const url = window?.location?.pathname?.split('/') ?? [];\r\n // const pathname = url[url.length - 1];\r\n //set customerInterest as content?.tabCaption capitalize inital letter and after space and then remove spaces - from Other plans into OtherPlans\r\n const customerInterest = content?.tabCaption\r\n ?.replace(/\\b\\w/g, (l: string) => l.toUpperCase())\r\n .replace(/\\s+/g, '');\r\n\r\n const offerValidations = [\r\n {\r\n key: 'Segment',\r\n type: 'CustomerType',\r\n value: 'Residential'\r\n },\r\n {\r\n key: 'OrderType',\r\n type: 'CustomerInterest',\r\n value: 'New'\r\n },\r\n {\r\n key: 'CurrentPage',\r\n type: 'Context',\r\n value: 'mobile-subscription' //pathname ?? ''\r\n },\r\n {\r\n key: 'Category',\r\n type: 'CustomerInterest',\r\n value: customerInterest ?? ''\r\n },\r\n {\r\n key: 'RequestedOfferCount',\r\n type: 'Context',\r\n value: content?.pegaRequestOfferCount?.toString() ?? '3'\r\n },\r\n pegaCustomerInterest\r\n ? {\r\n key: 'Tag',\r\n type: 'CustomerInterest',\r\n value: pegaCustomerInterest\r\n }\r\n : null\r\n ].filter(Boolean) as OfferValidation[];\r\n\r\n const atlOffers: AtlOffer = {\r\n placements,\r\n offerValidations\r\n };\r\n\r\n const pegaProducts: PegaProductRequestBase = {\r\n atlOffers: [atlOffers]\r\n };\r\n\r\n return pegaProducts;\r\n};\r\n\r\nexport const checkGiftOrCashback = (data: any): any => {\r\n let showGift = false;\r\n let cashbackAvailable = false;\r\n data?.map((product: any) => {\r\n product?.promotionInfo?.map((offer: any) => {\r\n if (offer?.hardwareGift) showGift = true;\r\n if (offer?.cashBack) cashbackAvailable = true;\r\n });\r\n });\r\n return { showGift, cashbackAvailable };\r\n};\r\n\r\nexport const staticCreateCart = (\r\n setShowLoader: { (value: SetStateAction<boolean>): void; (arg0: boolean): void },\r\n cartEndPoint: string,\r\n giftItem: any,\r\n uniqueProductData: any,\r\n mainContent: any,\r\n showPrice: any,\r\n isMobileFlow: boolean,\r\n radioValue: any,\r\n eligibleBundle: any,\r\n address: any,\r\n setShowLinecheck: any,\r\n showLinecheck: any,\r\n lineCheckCallBack: any,\r\n enableP2P: any,\r\n P2PData: any,\r\n content: any,\r\n tvOptions?: any,\r\n discountRef?: string,\r\n discountVersion?: string,\r\n // Shogun/rewards (loyalty) flow — forwarded verbatim to createCartV2 so it\r\n // can append the pointsBurnt note at the item level (RATEPLAN for MOBILE,\r\n // internet item for FIXNET).\r\n rewardsInfo?: {\r\n pointsBurnt?: string | number;\r\n rewardOfferId?: string | number;\r\n gloxTokenId?: string | null;\r\n parentRewards?: {\r\n guid?: string | null;\r\n loyaltyPromotion?: string | number;\r\n pointsBurnt?: string | number;\r\n };\r\n },\r\n successLoaderData?: SuccessLoaderData\r\n): any => {\r\n if (isMobileFlow) {\r\n setShowLoader(true);\r\n const vcType: { voucher: string; voucherType: string } = getLocalStorageWithExpiry(VCTYPE);\r\n Object.keys(uniqueProductData)?.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n '',\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n cartEndPoint,\r\n 'mobile',\r\n giftItem,\r\n enableP2P,\r\n P2PData,\r\n mainContent?.productContainer?.[0]?.isQoQaFlow,\r\n vcType?.voucher,\r\n null,\r\n null,\r\n discountRef,\r\n discountVersion,\r\n rewardsInfo\r\n )\r\n .then((res: any) => {\r\n Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEPRODUCT);\r\n\r\n redirectWithSuccess(mainContent?.summaryPageUrl?.cached_url, successLoaderData);\r\n })\r\n .catch((err) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n setShowLoader(false);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n } else {\r\n const linecheckId: any =\r\n typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid');\r\n if (!eligibleBundle || !address || !linecheckId) {\r\n mainContent?.enableLinecheckOverlay ? setShowLinecheck(!showLinecheck) : lineCheckCallBack();\r\n } else {\r\n setShowLoader(true);\r\n uniqueProductData.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n radioValue,\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_WIRELINE_BUNDLE,\r\n cartEndPoint,\r\n 'fixnet',\r\n giftItem,\r\n '',\r\n '',\r\n false,\r\n '',\r\n '',\r\n tvOptions,\r\n undefined,\r\n undefined,\r\n rewardsInfo\r\n )\r\n .then((res: any) => {\r\n typeof window !== 'undefined' && Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n typeof window !== 'undefined' &&\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n typeof window !== 'undefined' &&\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n typeof window !== 'undefined' && Cookies.remove('landline');\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLE);\r\n const productUrl = checkLinkWithLang(content?.productBasedCheckoutUrl?.cached_url);\r\n let recommendAccessory = false;\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (uniqueProductData[0]?.isBundle) {\r\n uniqueProductData[0]?.bundledOffers?.map((item: any) => {\r\n if (\r\n item?.productType?.toLowerCase() === 'internet' ||\r\n item?.productType?.toLowerCase() == 'tv'\r\n ) {\r\n if (item?.recommendAccessory) {\r\n recommendAccessory = item?.recommendAccessory;\r\n }\r\n }\r\n // setting to false incase of Mobile product Type as it is currently out of scope\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n recommendAccessory = false;\r\n return;\r\n }\r\n });\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n if (uniqueProductData?.[0]?.recommendAccessory) {\r\n recommendAccessory = uniqueProductData?.[0]?.recommendAccessory;\r\n }\r\n }\r\n //setting the session to identify internet flow for mia for win\r\n if (recommendAccessory) {\r\n const sessionObj = { flow: 'WIN' };\r\n sessionStorage.setItem(ONE_ECOMMERCE_SUMMARY, JSON.stringify(sessionObj));\r\n }\r\n\r\n const finalURL = productUrl\r\n ? productUrl\r\n : content?.enableTVStreamingOptionsStepper && mainContent?.vasStepperURL?.cached_url\r\n ? mainContent?.vasStepperURL?.cached_url\r\n : recommendAccessory && mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n ? mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n : mainContent?.summaryPageUrl?.cached_url;\r\n\r\n redirectWithSuccess(finalURL, successLoaderData);\r\n })\r\n .catch((err: any) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n }\r\n }\r\n};\r\n\r\nexport const findHeight = (tabIndex: number, cardsLength: number) => {\r\n const setTimerSectionHeight = () => {\r\n let maxActiveTimerHeight = 0;\r\n const timerSections: HTMLElement[] = [];\r\n\r\n [...Array(cardsLength)].forEach((_, index) => {\r\n const timerSection = document.getElementById(`timer-section${tabIndex}${index}`);\r\n if (timerSection) {\r\n timerSections.push(timerSection);\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n if (isTimerActive) {\r\n const spacer = timerSection.firstElementChild as HTMLElement | null;\r\n // Read the inline style target height instead of clientHeight so that\r\n // an in-progress CSS transition does not yield an intermediate value.\r\n const targetHeight = parseFloat(spacer?.style.height || '0') || 0;\r\n maxActiveTimerHeight = Math.max(maxActiveTimerHeight, targetHeight);\r\n }\r\n }\r\n });\r\n\r\n timerSections.forEach((timerSection) => {\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n timerSection.style.transition = 'height 0.3s ease';\r\n timerSection.style.height = isTimerActive ? '0px' : `${maxActiveTimerHeight}px`;\r\n });\r\n };\r\n\r\n getElementMaximumHeight('headingV3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('descriptionV3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('titleV3' + `${tabIndex}`, cardsLength);\r\n setTimerSectionHeight();\r\n getElementMaximumHeight('detailsectionv3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('product-configv3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('gift-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('benefits-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('order-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('price-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('benefits-price-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('contract-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('exclusive-benefits-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('discountedpricetoggle-section' + `${tabIndex}`, cardsLength);\r\n};\r\n\r\nconst setMobileSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n pretopostvalues?: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration = productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n const pretopostvalue = pretopostvalues ?? '';\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const flow = urlParams.get('flow');\r\n const sessionObj: any = {\r\n mobileSubscription: productPrice?.[0]?.id ?? '',\r\n mobileSubscriptionPrice: discount > 0 ? discount : base,\r\n mobileSubscriptionPromo: promoId,\r\n subGroup: 'MOBILE',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withoutPromo: false,\r\n pretopostvalue: pretopostvalue,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n isOttFlow: flow === 'ott' ? true : false\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem('one-ecommerce-mobileSummary', JSON.stringify(sessionObj));\r\n};\r\n\r\nexport const combineWithSmartPhone = (\r\n showPrice: any,\r\n storyContent: any,\r\n uniqueProductData: any,\r\n responseData?: any,\r\n product?: any,\r\n pegaIntegration?: boolean\r\n) => {\r\n const pretopostvalues = {\r\n msisdn: responseData?.msisdn ?? '',\r\n ratePlan: responseData?.ratePlan ?? '',\r\n ratePlanType: responseData?.ratePlanType ?? '',\r\n productId: responseData ? showPrice?.id : ''\r\n };\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n let Params = '';\r\n Params = `?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${\r\n promoId ?? ''\r\n }&productCode=${showPrice?.id ?? ''}`;\r\n window.location.href = storyContent?.addSmartPhone?.[0]?.buttonLink?.cached_url + Params;\r\n setMobileSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n responseData && pretopostvalues,\r\n showPrice,\r\n product,\r\n pegaIntegration\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nconst setFixnetSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any,\r\n productName?: string,\r\n recommendAccessory?: boolean | undefined\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration =\r\n productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? showPrice?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n\r\n const sessionObj: any = {\r\n internetSubscription: productName ?? '',\r\n internetSubscriptionId: productPrice?.[0]?.id ?? '',\r\n internetSubscriptionPrice: discount > 0 ? discount : base,\r\n internetSubscriptionPromo: promoId,\r\n subGroup: 'INTERNET',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withPromo: discount > 0 ? true : false,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n productType: 'subscription',\r\n recommendAccessory: recommendAccessory\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem(ONE_ECOMMERCE_INTERNET_SUMMARY, JSON.stringify(sessionObj));\r\n};\r\nexport const combineWithVasOptions = (\r\n showPrice: any,\r\n uniqueProductData: any,\r\n product?: any,\r\n pegaIntegration?: boolean,\r\n productName?: string,\r\n recommendAccessory?: boolean\r\n) => {\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n\r\n setFixnetSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n showPrice,\r\n product,\r\n pegaIntegration,\r\n productName,\r\n recommendAccessory\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nexport const fetchServiceOptions = (entitlement: any, isMobileFlow: boolean) => {\r\n let service: any;\r\n if (!isMobileFlow) {\r\n service = (entitlement || []).filter((product: any) => product?.enableTV === true);\r\n }\r\n return service;\r\n};\r\n\r\nexport const fetchPrice = (\r\n product: any,\r\n isMobileFlow: boolean,\r\n pageType?: string,\r\n isConfigurator?: boolean,\r\n tvOptions?: any[],\r\n pegaIntegration?: boolean\r\n): any => {\r\n const showPrice: any = {\r\n base: '',\r\n onetimePrice: '',\r\n discount: [],\r\n contractDuration: '',\r\n int_fmc: 0,\r\n mob_fmc: 0,\r\n mob_benefit_category: '',\r\n id: '',\r\n promoID: '',\r\n loyaltyPrice: ''\r\n };\r\n let tvOptionsBasePrice = 0;\r\n let tvOptionsDiscountPrice = 0;\r\n let tvOptionsBaseToDiscount = 0;\r\n\r\n Array.isArray(product) &&\r\n product?.map((item: any) => {\r\n showPrice['id'] = item?.id ?? '';\r\n item?.prices?.map((basePrice: any) => {\r\n if (basePrice?.priceType?.toLowerCase() === 'recurring') {\r\n if (tvOptions && tvOptions?.length > 0) {\r\n tvOptions?.forEach((opt: any) => {\r\n if (opt?.beneficiaryPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.beneficiaryPrice);\r\n } else if (opt?.derivedPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.derivedPrice);\r\n } else {\r\n tvOptionsBaseToDiscount += parseFloat(opt?.recurringPrice);\r\n }\r\n if (opt?.recurringPrice > 0) {\r\n tvOptionsBasePrice += parseFloat(opt?.recurringPrice);\r\n }\r\n });\r\n //If one of the options in the list has a discount, other options base price is stored to sum it up in the end\r\n if (tvOptionsDiscountPrice > 0) {\r\n tvOptionsDiscountPrice += tvOptionsBaseToDiscount;\r\n }\r\n showPrice['base'] = JSON.stringify(\r\n parseFloat(basePrice?.value) +\r\n (tvOptionsDiscountPrice > 0 ? tvOptionsDiscountPrice : tvOptionsBasePrice)\r\n );\r\n } else {\r\n showPrice['base'] = basePrice?.value;\r\n }\r\n } else if (basePrice?.priceType?.toLowerCase() === 'one time')\r\n showPrice['onetimePrice'] = basePrice?.value;\r\n });\r\n item?.derivedPrice?.map((discountPrice: any) => {\r\n const cycle = { cycleStart: '', cycleEnd: '', value: '' };\r\n cycle['cycleStart'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? 1\r\n : discountPrice?.cycle?.cycleStart;\r\n cycle['cycleEnd'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n : discountPrice?.cycle?.cycleEnd;\r\n cycle['value'] = discountPrice?.value;\r\n if (tvOptions && tvOptions?.length > 0) {\r\n if (tvOptionsDiscountPrice > 0) {\r\n cycle['value'] = JSON.stringify(\r\n parseFloat(discountPrice?.value) + tvOptionsDiscountPrice\r\n );\r\n } else {\r\n cycle['value'] = JSON.stringify(parseFloat(discountPrice?.value) + tvOptionsBasePrice);\r\n }\r\n }\r\n showPrice['discount'].push(cycle);\r\n });\r\n // Calculating loyalty price introduced with DC portfolio\r\n if (item?.promotionInfo?.[0]?.relatedPromo?.length > 0) {\r\n item?.promotionInfo?.[0]?.relatedPromo?.map((promo: any) => {\r\n if (promo?.type === 'LOYALTY_DISCOUNT') {\r\n showPrice['loyaltyPrice'] = promo?.discount;\r\n }\r\n });\r\n }\r\n });\r\n\r\n product?.[0]?.bundledOffers?.forEach((item: any) => {\r\n item?.prices?.forEach((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.forEach((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n showPrice['int_fmc'] += Number(price?.value);\r\n } else if (\r\n price?.priceCategory == 'MULTIMOBILE' ||\r\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\r\n price?.priceCategory == 'FMC'\r\n ) {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (item?.contractDuration) {\r\n showPrice['contractDuration'] = item?.contractDuration; // for bundled products contract duration is taken from bundled offers\r\n }\r\n if (item?.promotionInfo?.[0]?.id && !pegaIntegration) {\r\n showPrice['promoID'] = item?.promotionInfo?.[0]?.id;\r\n }\r\n });\r\n if (!product?.[0]?.isBundle) {\r\n showPrice['contractDuration'] = product?.[0]?.contractDuration; // for other products\r\n if (!pegaIntegration) {\r\n showPrice['promoID'] = product?.[0]?.promotionInfo?.[0]?.id;\r\n }\r\n }\r\n let int_fmc = 0;\r\n product?.[0]?.prices?.map((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.map((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n int_fmc += Number(price?.value);\r\n } else if (\r\n price?.priceCategory == 'MULTIMOBILE' ||\r\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\r\n price?.priceCategory == 'FMC'\r\n ) {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (!showPrice?.contractDuration && !isMobileFlow) {\r\n showPrice['contractDuration'] = '12';\r\n }\r\n {\r\n showPrice['int_fmc'] = isConfigurator ? int_fmc : showPrice['int_fmc'];\r\n }\r\n if (pageType == '4P') {\r\n let bundleContractDuration = '0';\r\n product?.[0]?.bundledOffers?.map((offerData: any) => {\r\n if (offerData?.contractDuration) {\r\n bundleContractDuration =\r\n Number(bundleContractDuration) > Number(offerData?.contractDuration)\r\n ? bundleContractDuration\r\n : offerData?.contractDuration;\r\n }\r\n });\r\n showPrice['contractDuration'] = bundleContractDuration;\r\n }\r\n return showPrice;\r\n};\r\n\r\n//function for creating different array for 3 selections\r\nexport const fetchFilteredProducts = (productList: any, toggleState: any) => {\r\n //need to centralize for comman solution\r\n // Filter productList based on gigaSpeed toggle - US #363853\r\n let filteredList = productList;\r\n\r\n filteredList = productList.filter((item: any) => {\r\n const gigaSpeedValue = item?.gigaSpeed?.toLowerCase();\r\n if (toggleState?.gigaSpeed) {\r\n return gigaSpeedValue != 'hide';\r\n } else {\r\n return gigaSpeedValue != 'show';\r\n }\r\n });\r\n\r\n let mainArray = filteredList;\r\n const numberOfArray = 3;\r\n let res1 = [];\r\n let res2 = [];\r\n let res3 = [];\r\n for (let item of mainArray) {\r\n const multiIndex = item?.productIndex?.includes(',');\r\n const updatedMultiIndex = multiIndex && item?.productIndex?.split(',');\r\n if (multiIndex) {\r\n for (let mIndex of updatedMultiIndex) {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(mIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(item?.productIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n }\r\n const displayContent =\r\n toggleState?.TV && toggleState?.Netflix ? res3 : toggleState?.TV ? res2 : res1;\r\n return displayContent;\r\n};\r\nexport const fetchOttItems = (ottCartData: any) => {\r\n return (ottCartData?.products || [])?.map((products: any) => ({\r\n itemType: products?.type ?? '',\r\n promotionId: products?.promo ?? '',\r\n items: [\r\n {\r\n itemType: products?.type === TV_SERVICE_OPTION ? TV_SERVICE_OPTION : RATEPLAN,\r\n id: products?.id ?? ''\r\n }\r\n ]\r\n }));\r\n};\r\n\r\n// ─── Shogun shared-offer cache ────────────────────────────────────────────────\r\n\r\ninterface ShogunOfferCacheEntry {\r\n gloxTokenId: string;\r\n results: any[] | null;\r\n promise: Promise<any[]> | null;\r\n}\r\n\r\nlet shogunOfferSharedCache: ShogunOfferCacheEntry | null = null;\r\n\r\n/**\r\n * Returns true when the shared cache already holds resolved results for the\r\n * given token. Callers can use this to skip triggering a loading state.\r\n */\r\nexport const isShogunOfferResolved = (gloxTokenId: string): boolean =>\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.results !== null;\r\n\r\n/**\r\n * Shared-promise manager for the Shogun offer API.\r\n *\r\n * Because the Shogun flow sends no product payload (only gloxTokenId) the\r\n * response is identical for every StaticProductContainer on the page.\r\n * This function ensures exactly one network request is made:\r\n * - If results are already resolved → returns Promise.resolve(results)\r\n * - If a fetch is in-flight → returns the same promise\r\n * - First caller → creates the fetch and stores the promise\r\n *\r\n * On failure the promise rejects — the caller is responsible for surfacing\r\n * the error (e.g. showing the telesales/error popup). The failure is NOT\r\n * cached, so a retry (e.g. tab switch) will trigger a fresh request.\r\n */\r\nexport const getShogunSharedOffer = (\r\n gloxTokenId: string,\r\n uniqueId: string,\r\n offerEndpoint: string\r\n): Promise<any[]> => {\r\n // Already resolved\r\n if (isShogunOfferResolved(gloxTokenId)) {\r\n return Promise.resolve(shogunOfferSharedCache!.results!);\r\n }\r\n\r\n // In-flight\r\n if (\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.promise !== null\r\n ) {\r\n return shogunOfferSharedCache.promise;\r\n }\r\n\r\n // First caller — start the real fetch\r\n const fetchPromise: Promise<any[]> = fetchShogunOfferData(gloxTokenId, uniqueId, offerEndpoint)\r\n .then((resp: any) => {\r\n const results: any[] = resp?.[uniqueId] ?? [];\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache.results = results;\r\n shogunOfferSharedCache.promise = null;\r\n }\r\n return results;\r\n })\r\n .catch((err: any) => {\r\n // Clear the cache entry so the next call retries the API.\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache = null;\r\n }\r\n throw err;\r\n });\r\n\r\n shogunOfferSharedCache = { gloxTokenId, results: null, promise: fetchPromise };\r\n return fetchPromise;\r\n};\r\n\r\n\r\n/**\r\n * Filters and sorts the Storyblok product list to match only the products\r\n * returned by the Shogun offer API, preserving the API response order.\r\n */\r\nexport const filterShogunProducts = (\r\n availableProducts: any[],\r\n shogunProductIds: string[]\r\n): any[] => {\r\n const filtered = availableProducts.filter((product: any) => {\r\n const productId = product?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.includes(productId);\r\n });\r\n\r\n filtered.sort((a: any, b: any) => {\r\n const aId = a?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n const bId = b?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.indexOf(aId) - shogunProductIds.indexOf(bId);\r\n });\r\n\r\n return filtered;\r\n};\r\n\r\n// Error codes returned by the update-cart API that should surface the\r\n// conflict confirmation popup (e.g. product already exists in the\r\n// persistent cart). Add further codes here as new conflict scenarios need\r\n// to be handled the same way.\r\nconst CART_CONFLICT_CODES = new Set(['4090']);\r\n\r\n/**\r\n * Builds the update-cart payload for coreUpdateCart.\r\n *\r\n * - For non-mobile bundle products the payload is built from the bundled\r\n * offers: one item per bundled offer (itemType = productType) plus the\r\n * linecheck correlation id note. The cartItem itemType/promotionId come\r\n * from the bundled offer that carries the promotion (e.g. the INTERNET\r\n * offer with promoType HOME_ORDER).\r\n * - Mobile / standalone products keep the single RATEPLAN payload.\r\n *\r\n * Returns both the payload and the resolved usecase (promoType) so the caller\r\n * can forward it to coreUpdateCart.\r\n */\r\nexport const buildUpdateCartPayload = (\r\n product: any,\r\n isMobileFlow: boolean,\r\n usecase?: string\r\n): { payload: any; resolvedUsecase: any } => {\r\n if (!isMobileFlow && product?.isBundle) {\r\n const bundledOffers = product?.bundledOffers ?? [];\r\n const bundlePromotion = bundledOffers.find(\r\n (offer: any) => offer?.promotionInfo?.[0]?.id\r\n )?.promotionInfo?.[0];\r\n const linecheckCorrelationId =\r\n (typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid')) || '';\r\n\r\n return {\r\n resolvedUsecase: usecase ?? bundlePromotion?.promoType,\r\n payload: {\r\n cartItem: [\r\n {\r\n itemType: bundlePromotion?.promoType,\r\n action: 'ADD',\r\n promotionId: bundlePromotion?.id,\r\n items: bundledOffers.map((offer: any) => ({\r\n itemType: offer?.productType,\r\n id: offer?.id,\r\n action: 'ADD'\r\n })),\r\n note: [\r\n {\r\n author: 'linecheckCorrelationId',\r\n text: linecheckCorrelationId\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n };\r\n }\r\n\r\n const promotion = product?.promotionInfo?.[0];\r\n return {\r\n // Fall back to the promotion's promoType (e.g. MOBILE_ORDER) when no\r\n // explicit usecase is supplied by the caller.\r\n resolvedUsecase: usecase ?? promotion?.promoType,\r\n payload: {\r\n cartItem: [\r\n {\r\n itemType: promotion?.promoType,\r\n action: 'ADD',\r\n promotionId: promotion?.id,\r\n items: [\r\n {\r\n itemType: RATEPLAN,\r\n id: product?.id,\r\n action: 'ADD'\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n };\r\n};\r\n\r\nexport const coreProductUpdateCart = (\r\n setShowLoader: { (value: SetStateAction<boolean>): void; (arg0: boolean): void },\r\n cartEndPoint: string,\r\n uniqueProductData: any,\r\n existingCartId: string,\r\n mainContent: any,\r\n // Same gating used by staticCreateCart: on mobile the update-cart call is\r\n // always made; on non-mobile (fixnet) flows we only call the API once a\r\n // linecheck has been completed (eligibleBundle + address + linecheck\r\n // correlation id), otherwise the linecheck overlay/callback is triggered.\r\n isMobileFlow: boolean,\r\n eligibleBundle: any,\r\n address: any,\r\n setShowLinecheck: any,\r\n showLinecheck: any,\r\n lineCheckCallBack: any,\r\n usecase?: string,\r\n successLoaderData?: SuccessLoaderData,\r\n // Invoked when the API responds with an error code so the caller can\r\n // store the conflict in context and show the confirmation popup.\r\n onConflict?: (conflict: any) => void\r\n) => {\r\n if (!existingCartId || !uniqueProductData || uniqueProductData.length === 0) {\r\n return;\r\n }\r\n\r\n const updateCart = () => {\r\n setShowLoader(true);\r\n\r\n const product = uniqueProductData?.[0];\r\n const { payload, resolvedUsecase } = buildUpdateCartPayload(product, isMobileFlow, usecase);\r\n\r\n coreUpdateCart(payload, cartEndPoint, existingCartId, resolvedUsecase)\r\n .then((res: any) => {\r\n Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly updated cartid in the cookies.\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n Cookies.set('cartProduct', product?.id, { path: '/' });\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEPRODUCT);\r\n\r\n redirectWithSuccess(mainContent?.summaryPageUrl?.cached_url, successLoaderData);\r\n })\r\n .catch((err) => {\r\n const errorData = err?.response?.data;\r\n // Conflict response (e.g. product already exists): the backend returns\r\n // one of CART_CONFLICT_CODES for these conflict scenarios. Only those\r\n // codes should surface the confirmation popup.\r\n if (CART_CONFLICT_CODES.has(String(errorData?.code)) && onConflict) {\r\n onConflict(errorData);\r\n return;\r\n }\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n };\r\n\r\n if (isMobileFlow) {\r\n updateCart();\r\n } else {\r\n const linecheckId: any =\r\n typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid');\r\n if (!eligibleBundle || !address || !linecheckId) {\r\n mainContent?.enableLinecheckOverlay ? setShowLinecheck(!showLinecheck) : lineCheckCallBack();\r\n } else {\r\n updateCart();\r\n }\r\n }\r\n};"],"names":["isTimerActive","startTime","endTime","now","Date","start","calculateDateTime","replace","end","Number","isNaN","getTime","_a","getTimeUntilNextTimerEvent","startTimeMs","endTimeMs","Math","max","fetchStaticProductIds","productList","productId","bundle4PProduct","tvOptionIds","pricesToggleState","map","data","productRequest","id","promoIds","productData","_e","_d","_c","_b","products","reference","content","product","promotionData","_k","_j","_h","_g","_f","promotion","promoDescription","promotionId","timer","_l","timerIsActive","timerPromotionId","_s","_r","_q","_p","_o","_m","defaultPromotionId","DEFAULT_MOBILEPOSTPAID_BUNDLE","_t","push","_u","mobilePromotionData","_z","_y","_x","_w","_v","mobilePromotion","_0","fetchPegaProducts","pegaCustomerInterest","placements","customerInterest","tabCaption","l","toUpperCase","atlOffers","offerValidations","key","type","value","pegaRequestOfferCount","toString","filter","Boolean","checkGiftOrCashback","showGift","cashbackAvailable","promotionInfo","offer","hardwareGift","cashBack","staticCreateCart","setShowLoader","cartEndPoint","giftItem","uniqueProductData","mainContent","showPrice","isMobileFlow","radioValue","eligibleBundle","address","setShowLinecheck","showLinecheck","lineCheckCallBack","enableP2P","P2PData","tvOptions","discountRef","discountVersion","rewardsInfo","successLoaderData","vcType","getLocalStorageWithExpiry","VCTYPE","Object","keys","length","createCartV2","promoID","productContainer","isQoQaFlow","voucher","then","res","Cookies","remove","path","set","trackEligibleItem","ADDTOCART","LINETABLEPRODUCT","redirectWithSuccess","summaryPageUrl","cached_url","catch","err","console","log","finally","linecheckId","window","get","DEFAULT_WIRELINE_BUNDLE","undefined","LINETABLE","productUrl","checkLinkWithLang","productBasedCheckoutUrl","recommendAccessory","isBundle","bundledOffers","item","productType","toLowerCase","sessionObj","flow","sessionStorage","setItem","ONE_ECOMMERCE_SUMMARY","JSON","stringify","finalURL","enableTVStreamingOptionsStepper","vasStepperURL","multiItemPageRedirectionUrl","enableLinecheckOverlay","findHeight","tabIndex","cardsLength","getElementMaximumHeight","maxActiveTimerHeight","timerSections","Array","forEach","_","index","timerSection","document","getElementById","dataset","timerActive","spacer","firstElementChild","targetHeight","parseFloat","style","height","transition","setTimerSectionHeight","combineWithSmartPhone","storyContent","responseData","pegaIntegration","pretopostvalues","msisdn","ratePlan","ratePlanType","promoId","Params","location","href","addSmartPhone","buttonLink","productPrice","base","prices","discount","derivedPrice","contractDuration","campaignDuration","pretopostvalue","version","clientDiscountInfo","discountType","note","author","text","extraNotes","URLSearchParams","search","mobileSubscription","mobileSubscriptionPrice","mobileSubscriptionPromo","subGroup","duration","basePrice","withoutPromo","upBenefit","mob_benefit_category","ultimateBundlePromo","ultimateBundlePromotion","isOttFlow","setMobileSummarySession","trackNewDatalayerEvent","GAEVENT","COMBINEDEVICE","getEcomCartInfo","LINETABLEDEVICE","combineWithVasOptions","productName","internetSubscription","internetSubscriptionId","internetSubscriptionPrice","internetSubscriptionPromo","withPromo","_1","ONE_ECOMMERCE_INTERNET_SUMMARY","setFixnetSummarySession","fetchServiceOptions","entitlement","service","enableTV","fetchPrice","pageType","isConfigurator","onetimePrice","int_fmc","mob_fmc","loyaltyPrice","tvOptionsBasePrice","tvOptionsDiscountPrice","tvOptionsBaseToDiscount","isArray","priceType","opt","beneficiaryPrice","recurringPrice","discountPrice","cycle","cycleStart","cycleEnd","relatedPromo","promo","productDetails","priceAlteration","price","priceCategory","bundleContractDuration","offerData","fetchFilteredProducts","toggleState","filteredList","gigaSpeedValue","gigaSpeed","mainArray","res1","res2","res3","multiIndex","productIndex","includes","updatedMultiIndex","split","mIndex","i","TV","Netflix","fetchOttItems","ottCartData","itemType","items","TV_SERVICE_OPTION","RATEPLAN","shogunOfferSharedCache","isShogunOfferResolved","gloxTokenId","results","getShogunSharedOffer","uniqueId","offerEndpoint","Promise","resolve","promise","fetchPromise","fetchShogunOfferData","resp","filterShogunProducts","availableProducts","shogunProductIds","filtered","sort","a","b","aId","bId","indexOf","CART_CONFLICT_CODES","Set","buildUpdateCartPayload","usecase","bundlePromotion","find","linecheckCorrelationId","resolvedUsecase","promoType","payload","cartItem","action","coreProductUpdateCart","existingCartId","onConflict","updateCart","coreUpdateCart","errorData","response","has","String","code"],"mappings":"k3BAgCaA,EAAgB,CAACC,EAAmBC,KAC/C,IACE,MAAMC,EAAM,IAAIC,KACVC,EAAQC,EAAkB,IAAIF,KAAKH,EAAUM,QAAQ,KAAM,OAC3DC,EAAMF,EAAkB,IAAIF,KAAKF,EAAQK,QAAQ,KAAM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