From 30e0b8b3f8796136363ef04a47734a092c368346 Mon Sep 17 00:00:00 2001 From: Ryan Parrish Date: Tue, 23 Jul 2024 03:15:04 -0600 Subject: [PATCH 01/10] =?UTF-8?q?MWPW-150566=20-=20=F0=9F=86=95=20Editoria?= =?UTF-8?q?l-Card=20block=20(#2533)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial editorial-card block files * set some defaults on edy-card * styled lockup-area * Set default picture styles w/ no line-height * add alignment options * updates to editorial card features * card footer stylez * decBgRow func * footer text alignment * nobg, nomedia, remove console * no flex on footer * margin-top-vp for stagger * footerAlign * footer fix * no-bg content default * margin-bottom * decorate media viewport, aspect-ratio support * added 'open' as default variant-style * static-links-copy and some grid POC * grid POC * refactor flex-grid to just flex * revert grid stuff in section-meta, moved to diff branch * added tests and additional 'static' row support * added static row test example * test coverage 100 * remove test console * Adding shared block content.css * shared to styles. default m-lockup * comment typo * Fixed modal-image-link cover image display * added click cursor, aligned transitions specs for .grow, lockup-area wrapping LH, handleClickableCard and broadcastHover * test coverage * safari bug: fix image overflow on element border-radius * scoped cards to scale to .click.grow grouping * removed the broadcastHover event to extend video hoverplay. Will stash for future enhancement if needed * updated .grow name to -> .hover-scale for clarity * addressed copy margins w/ no-bg.no-border present, fixed the .center media display in masonry layout * early returns, removed underline-footer-links, fixed card link to not bubble to nested link targets. Refactored some code logic to own func * few style feedback optimize, rename sel * fixed media-area ghost margin * load iconography.css * clear tests, were prone to build up shared test state * fixed tests * refactor overly complex loadIconography, await func * fixed unit test * various housekeeping items, rtl, etc --------- Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com> Co-authored-by: Elan Bartholomew --- libs/blocks/editorial-card/editorial-card.css | 250 ++++++++++++++++++ libs/blocks/editorial-card/editorial-card.js | 121 +++++++++ libs/styles/iconography.css | 92 +++++++ libs/styles/rounded-corners.css | 4 + libs/styles/styles.css | 13 +- libs/utils/utils.js | 1 + .../editorial-card/editorial-card.test.js | 45 ++++ test/blocks/editorial-card/mocks/body.html | 148 +++++++++++ 8 files changed, 671 insertions(+), 3 deletions(-) create mode 100644 libs/blocks/editorial-card/editorial-card.css create mode 100644 libs/blocks/editorial-card/editorial-card.js create mode 100644 libs/styles/iconography.css create mode 100644 test/blocks/editorial-card/editorial-card.test.js create mode 100644 test/blocks/editorial-card/mocks/body.html diff --git a/libs/blocks/editorial-card/editorial-card.css b/libs/blocks/editorial-card/editorial-card.css new file mode 100644 index 0000000000..effea939c6 --- /dev/null +++ b/libs/blocks/editorial-card/editorial-card.css @@ -0,0 +1,250 @@ +.editorial-card { + --card-height-default: 213px; + --card-scale-default: 1.03; + + border: 1px solid var(--color-gray-300); + overflow: hidden; + display: flex; + flex-direction: column; + transform: translateZ(0); +} + +.editorial-card, +.editorial-card::after, +.editorial-card::before { + box-sizing: border-box; +} + +.section.masonry-layout > .editorial-card[class*='grid-span-'] { + display: flex; +} + +.dark .editorial-card, +.editorial-card.dark { + color: #fff; + border-color: var(--color-gray-700); +} + +.editorial-card.no-bg { background: none;} +.editorial-card.no-border { border: none;} + +.editorial-card.click { + cursor: pointer; +} + +.editorial-card.click.hover-scale { + transition: all .2s ease-in-out; +} + +.editorial-card.click.hover-scale:hover { + transform: scale(var(--card-scale-default)); +} + +.editorial-card:not(.no-bg).click.hover-scale:hover { + box-shadow: 0 3px 6px 0 rgba(0 0 0 / 16%); +} + +.editorial-card.static-links-copy .foreground a:not([class*="button"]) { + color: inherit; + text-decoration: underline; +} + +[class*=-up] .editorial-card { + max-width: none; + width: 100%; + min-width: initial; +} + +.editorial-card.has-footer { + height: 100%; +} + +.editorial-card .media-area picture, +.editorial-card .foreground picture { + line-height: 0; + display: block; +} + +.editorial-card .media-area img, +.editorial-card .media-area video { + object-fit: cover; + object-position: center; + width: 100%; + height: 100%; + max-height: var(--card-height-default); +} + +.editorial-card .media-area .modal-img-link { + display: block; +} + +.editorial-card .foreground, +.editorial-card .footer { + padding: var(--spacing-xs); +} + +.editorial-card .extra-row { + padding: 0 var(--spacing-xs); +} + +.editorial-card .footer { + padding-top: 0; + margin-top: auto; +} + +.editorial-card .footer > div { + display: flex; + flex-direction: column; + text-align: end; + justify-content: end; + row-gap: var(--spacing-xxs); +} + +.editorial-card.no-bg.no-border .foreground { + padding: var(--spacing-s) 0; +} + +.editorial-card.no-bg.no-media > .foreground { + padding-top: 0; +} + +.editorial-card.no-bg.no-border .static, +.editorial-card.no-bg.no-border .footer { + padding-inline: 0; +} + +.editorial-card .foreground > div { + display: flex; + flex-direction: column; + row-gap: var(--spacing-xxs); +} + +.editorial-card .background > div { + height: 100%; +} + +.editorial-card .media-area > div { + line-height: 0; +} + +.editorial-card.footer-align-left .footer > div { text-align: start; } +.editorial-card.footer-align-center .footer > div { text-align: center; } + +.editorial-card.no-bg.no-border .foreground > div { + row-gap: var(--spacing-xs); +} + +.editorial-card .background img { + object-fit: cover; + width: 100%; + height: 100%; +} + +.editorial-card .lockup-area, +.editorial-card .device { + margin: 0; +} + +.editorial-card .lockup-area { + row-gap: var(--spacing-xxs); +} + +.editorial-card .lockup-label { + line-height: initial; +} + +.editorial-card .action-area, +.editorial-card .footer > .action-area { + display: flex; + align-items: center; + justify-content: right; + gap: var(--spacing-xxs); + flex-flow: wrap; + flex-direction: row; +} + +.editorial-card .action-area .con-button { + white-space: nowrap; +} + +.editorial-card.center .action-area { + justify-content: center; +} + +.editorial-card.right .action-area { + justify-content: right; +} + +.editorial-card hr { + background-color: currentcolor; + border: none; + height: 1px; + width: 100%; + margin: var(--spacing-xs) 0; +} + +.editorial-card .background { + position: absolute; + inset: 0; + z-index: -1; + overflow: hidden; +} + +.editorial-card .media-area { + overflow: hidden; + width: 100%; +} + +.editorial-card .media-area.background { + position: relative; + z-index: initial; +} + +.editorial-card .media-area.background video { + position: relative; +} + +/* Aspect Ratio */ +.editorial-card.media-square .media-area img, +.editorial-card.media-square .media-area video { + aspect-ratio: var(--aspect-ratio-square); + max-height: unset; +} + +.editorial-card.media-wide .media-area img, +.editorial-card.media-wide .media-area video { + aspect-ratio: var(--aspect-ratio-wide); + max-height: unset; +} + +.editorial-card.media-standard .media-area img, +.editorial-card.media-standard .media-area video { + aspect-ratio: var(--aspect-ratio-standard); + max-height: unset; +} + +.editorial-card.media-tall .media-area img, +.editorial-card.media-tall .media-area video { + aspect-ratio: var(--aspect-ratio-tall); + max-height: unset; +} + +/* Media Height */ +.editorial-card.media-height-auto .media-area img, +.editorial-card.media-height-auto .media-area video { + max-height: unset; +} + +/* Align */ +.editorial-card.center { + text-align: center; + justify-items: center; +} + +.editorial-card.right { + text-align: end; + justify-items: end; +} + +.editorial-card.footer-align-left .action-area { justify-content: start; } +.editorial-card.footer-align-center .action-area { justify-content: center; } diff --git a/libs/blocks/editorial-card/editorial-card.js b/libs/blocks/editorial-card/editorial-card.js new file mode 100644 index 0000000000..9451f6ea88 --- /dev/null +++ b/libs/blocks/editorial-card/editorial-card.js @@ -0,0 +1,121 @@ +import { createTag, loadStyle, getConfig } from '../../utils/utils.js'; +import { decorateBlockBg, decorateBlockText, decorateBlockHrs, decorateTextOverrides, applyHoverPlay } from '../../utils/decorate.js'; + +const { miloLibs, codeRoot } = getConfig(); +const base = miloLibs || codeRoot; + +async function loadIconography() { + await new Promise((resolve) => { loadStyle(`${base}/styles/iconography.css`, resolve); }); +} + +async function decorateLockupFromContent(el) { + const rows = el.querySelectorAll(':scope > div > p'); + const firstRowImg = rows[0]?.querySelector('img'); + if (!firstRowImg) return; + await loadIconography(); + rows[0].classList.add('lockup-area'); + rows[0].childNodes.forEach((node) => { + if (node.nodeType === 3 && node.nodeValue !== ' ') { + const newSpan = createTag('span', { class: 'lockup-label' }, node.nodeValue); + node.parentElement.replaceChild(newSpan, node); + } + }); +} + +const extendDeviceContent = (el) => { + const detail = el.querySelector('[class^="detail-"]'); + const prevElem = detail?.previousElementSibling; + if (!prevElem || ![...prevElem.classList].some((c) => c.startsWith('body-'))) return; + prevElem.classList.remove('body-m'); + prevElem.classList.add('body-xxs', 'device'); +}; + +const decorateMedia = (el, media) => { + if (!media) return; + media.classList.add('media-area'); + const mediaVideo = media.querySelector('video'); + if (mediaVideo) { + applyHoverPlay(mediaVideo); + } + if (media.children.length > 1) decorateBlockBg(el, media); +}; + +const decorateForeground = async (el, rows) => { + rows.forEach(async (row, i) => { + if (i === 0) { + row.classList.add('foreground'); + await decorateLockupFromContent(row); + } else if (i === (rows.length - 1)) { + row.classList.add('footer'); + } else { + row.classList.add('extra-row'); + } + decorateBlockText(row, ['m', 'm', 'm']); // heading, body, detail + decorateBlockHrs(row); + }); +}; + +const decorateBgRow = (el, background) => { + if (background.textContent.trim() === '') { + el.classList.add('no-bg'); + background.remove(); + return; + } + decorateBlockBg(el, background); +}; + +function handleClickableCard(el) { + const links = el.querySelectorAll('a'); + if (el.classList.contains('click') && links) { + el.addEventListener('click', (e) => { + /* c8 ignore next 2 */ + if (e.target.tagName === 'A') return; + (() => (links[0].target === '_blank' ? window.open(links[0].href) : window.location.assign(links[0].href)))(); + }); + } +} + +const init = async (el) => { + el.classList.add('con-block'); + if (el.className.includes('open')) { + el.classList.add('no-border', 'l-rounded-corners-image', 'static-links-copy'); + } + if (el.className.includes('rounded-corners')) { + loadStyle(`${base}/styles/rounded-corners.css`); + } + if (![...el.classList].some((c) => c.endsWith('-lockup'))) el.classList.add('m-lockup'); + let rows = el.querySelectorAll(':scope > div'); + const [head, middle, ...tail] = rows; + if (rows.length === 4) el.classList.add('has-footer'); + if (rows.length >= 1) { + const count = rows.length >= 3 ? 'three-plus' : rows.length; + switch (count) { + case 'three-plus': + // 3+ rows (0:bg, 1:media, 2:copy, ...3:static, last:footer) + decorateBgRow(el, head); + rows = tail; + await decorateForeground(el, rows); + decorateMedia(el, middle); + break; + case 2: + // 2 rows (0:media, 1:copy) + rows = middle; + await decorateForeground(el, [rows]); + decorateMedia(el, head); + el.classList.add('no-bg'); + break; + case 1: + // 1 row (0:copy) + rows = head; + await decorateForeground(el, [rows]); + el.classList.add('no-bg', 'no-media'); + break; + default: + } + } + extendDeviceContent(el); + decorateTextOverrides(el); + handleClickableCard(el); +}; + +export default init; diff --git a/libs/styles/iconography.css b/libs/styles/iconography.css new file mode 100644 index 0000000000..acee064c00 --- /dev/null +++ b/libs/styles/iconography.css @@ -0,0 +1,92 @@ +/* iconograph.css +This is consonant shared design patterns +dealing w/ groups of media and associated text +- lockup +(coming soon...) +- avatar +*/ + +:root { + /* lockup sizes */ + --type-lockup-all-weight: 700; + --type-lockup-xxl-size: 55px; + --type-lockup-xxl-ls: -0.01em; + --type-lockup-xl-size: 44px; + --type-lockup-xl-ls: -0.01em; + --type-lockup-l-size: 38px; + --type-lockup-l-ls: -0.01em; + --type-lockup-m-size: 27px; + --type-lockup-m-ls: -0.02em; + --type-lockup-s-size: 22px; + --type-lockup-s-ls: -0.02em; + --type-lockup-xs-size: 16px; + --type-lockup-xs-ls: 0; + --type-lockup-xxs-size: 11px; + --type-lockup-xxs-ls: -0.01em; +} + +/* Lockup */ +.lockup-area { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--spacing-xs); + margin-bottom: var(--spacing-s); + font-weight: var(--type-lockup-all-weight); + line-height: 1.25em; +} + +.lockup-area > * { line-height: 0; } + +.center .lockup-area { justify-content: center; } +.right .lockup-area { justify-content: flex-end; } + +.xxs-lockup .lockup-area { + font-size: var(--type-lockup-xxs-size); + letter-spacing:var(--type-lockup-xxs-ls); + gap: 4px; +} + +.xs-lockup .lockup-area { + font-size: var(--type-lockup-xs-size); + letter-spacing:var(--type-lockup-xs-ls); + gap: 6px; +} + +.s-lockup .lockup-area { + font-size: var(--type-lockup-s-size); + letter-spacing:var(--type-lockup-s-ls); + gap: 8px; +} + +.m-lockup .lockup-area { + font-size: var(--type-lockup-m-size); + letter-spacing:var(--type-lockup-m-ls); + gap: 10px; +} + +.l-lockup .lockup-area { + font-size: var(--type-lockup-l-size); + letter-spacing:var(--type-lockup-l-ls); + gap: 15px; +} + +.xl-lockup .lockup-area { + font-size: var(--type-lockup-xl-size); + letter-spacing:var(--type-lockup-xl-ls); + gap: 17px; +} + +.xxl-lockup .lockup-area { + font-size: var(--type-lockup-xxl-size); + letter-spacing:var(--type-lockup-xxl-ls); + gap: 20px; +} + +.xxs-lockup .lockup-area img { height: var(--icon-size-xxs); } +.xs-lockup .lockup-area img { height: var(--icon-size-xs); } +.s-lockup .lockup-area img { height: var(--icon-size-s); } +.m-lockup .lockup-area img { height: var(--icon-size-m); } +.l-lockup .lockup-area img { height: var(--icon-size-l); } +.xl-lockup .lockup-area img { height: var(--icon-size-xl); } +.xxl-lockup .lockup-area img { height: var(--icon-size-xxl); } diff --git a/libs/styles/rounded-corners.css b/libs/styles/rounded-corners.css index 8aee00aba2..2e693dbe58 100644 --- a/libs/styles/rounded-corners.css +++ b/libs/styles/rounded-corners.css @@ -8,24 +8,28 @@ .rounded-corners, .rounded-corners > .background img, +.rounded-corners-image .media-area, .rounded-corners-image .foreground .image picture img { border-radius: var(--m-rounded-corners); } .s-rounded-corners, .s-rounded-corners > .background img, +.s-rounded-corners-image .media-area, .s-rounded-corners-image .foreground .image picture img { border-radius: var(--s-rounded-corners); } .m-rounded-corners, .m-rounded-corners > .background img, +.m-rounded-corners-image .media-area, .m-rounded-corners-image .foreground .image picture img { border-radius: var(--m-rounded-corners); } .l-rounded-corners, .l-rounded-corners > .background img, +.l-rounded-corners-image .media-area, .l-rounded-corners-image .foreground .image picture img { border-radius: var(--l-rounded-corners); } diff --git a/libs/styles/styles.css b/libs/styles/styles.css index a54f7d8799..390675e445 100644 --- a/libs/styles/styles.css +++ b/libs/styles/styles.css @@ -117,6 +117,7 @@ --aspect-ratio-square: 1/1; --aspect-ratio-standard: 4/3; --aspect-ratio-wide: 16/9; + --aspect-ratio-tall: 9/16; /* icon sizes */ --icon-size-xxl: 80px; @@ -126,7 +127,7 @@ --icon-size-s: 32px; --icon-size-xs: 24px; --icon-size-xxs: 16px; - + /* z-index */ --above-all: 9000; /* Used for page tools that overlay page content */ } @@ -473,8 +474,6 @@ picture.bg-img img { width: 100%; } - - /* progressive section appearance */ main > div, main .section[data-status='decorated'] { @@ -876,6 +875,10 @@ a.static:hover { .con-block.xl-spacing-static-bottom-tablet { padding-bottom: var(--spacing-xl-static); } .con-block.xxl-spacing-static-bottom-tablet { padding-bottom: var(--spacing-xxl-static); } .con-block.xxxl-spacing-static-bottom-tablet { padding-bottom: var(--spacing-xxxl-static); } + + /* margin */ + .con-block.margin-top-tablet { margin-top: var(--spacing-s); } + .con-block.margin-bottom-tablet { margin-bottom: var(--spacing-s); } } /* tablet large up */ @@ -948,6 +951,10 @@ a.static:hover { .con-block.xl-spacing-static-bottom-desktop { padding-bottom: var(--spacing-xl-static); } .con-block.xxl-spacing-static-bottom-desktop { padding-bottom: var(--spacing-xxl-static); } .con-block.xxxl-spacing-static-bottom-desktop { padding-bottom: var(--spacing-xxxl-static); } + + /* margin */ + .con-block.margin-top-desktop { margin-top: var(--spacing-s); } + .con-block.margin-bottom-desktop { margin-bottom: var(--spacing-s); } } /* desktop large < 1440 */ diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 50c8cc0206..c4f4a6f64b 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -26,6 +26,7 @@ const MILO_BLOCKS = [ 'carousel', 'chart', 'columns', + 'editorial-card', 'faas', 'featured-article', 'figure', diff --git a/test/blocks/editorial-card/editorial-card.test.js b/test/blocks/editorial-card/editorial-card.test.js new file mode 100644 index 0000000000..e5d612dbc9 --- /dev/null +++ b/test/blocks/editorial-card/editorial-card.test.js @@ -0,0 +1,45 @@ +import { readFile } from '@web/test-runner-commands'; +import { expect } from '@esm-bundle/chai'; +import { getLocale, setConfig } from '../../../libs/utils/utils.js'; + +const locales = { '': { ietf: 'en-US', tk: 'hah7vzn.css' } }; +const config = { + imsClientId: 'milo', + codeRoot: '/libs', + contentRoot: `${window.location.origin}${getLocale(locales).prefix}`, + locales, +}; + +setConfig(config); + +describe('editorial-card', () => { + let editorialCards; + + beforeEach(async () => { + document.body.innerHTML = await readFile({ path: './mocks/body.html' }); + const { default: init } = await import('../../../libs/blocks/editorial-card/editorial-card.js'); + editorialCards = document.querySelectorAll('.editorial-card'); + editorialCards.forEach((card) => { + init(card); + }); + }); + + afterEach(() => { + document.body.innerHTML = ''; + }); + + it('w/ 1 row has a foreground', () => { + const foreground = editorialCards[0].querySelector('.foreground'); + expect(foreground).to.exist; + }); + + it('w/ 4 rows has a footer', () => { + const footer = editorialCards[3].querySelector('.footer'); + expect(footer).to.exist; + }); + + it('w/ lockup gets decorated', async () => { + const lockup = editorialCards[4].classList.contains('m-lockup'); + expect(lockup).to.exist; + }); +}); diff --git a/test/blocks/editorial-card/mocks/body.html b/test/blocks/editorial-card/mocks/body.html new file mode 100644 index 0000000000..65970475ee --- /dev/null +++ b/test/blocks/editorial-card/mocks/body.html @@ -0,0 +1,148 @@ +
+
+
+
+
+

1 Row - [copy]

+

no-border

+
+
+
+
+ +
+
+

2 Row - [media, copy]

+

l-rounded-corners-image

+
+
+
+
+
+
transparent
+
+
+
+ +
+
+
+
+

3 Row - [bg, media, copy]

+

l-rounded-corners

+ Link +
+
+
+
+
+
#fafafa
+
+
+
+ + + + + + +
+
+
+
+

device1 + device2

+

DETAIL

+ +

l-rounded-corners

+
+
+
+
+
+

Footer can have stuff in it

+

Learn More Watch the Video

+
+
+
+ +
+ +
+

Variants: open, click w/ lockup content

+
+
+
+
+ +
+
+

+ + Lockup +

+

per-breakpoint media - mobile image, tablet image, desktop video

+

Open
'no-border', 'l-rounded-corners-image', 'static-links-copy', 'underline-links-footer'

+ +

Editorial Card (static links copy) Static link

+

TODO: the footer should have its own footer-static-links variant

+
+
+ +
+
+

extra static row

+
+
+
+
+
+
+ + + +
+
+
+
+

Healine

+

Normal copy row

+
+
+
+
+

STATIC ROW

+
+
+
+ +
+
+ +
From 28692434952f6117f897313ad3526e2d5dde90ff Mon Sep 17 00:00:00 2001 From: Robert Bogos <146744221+robert-bogos@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:15:11 +0300 Subject: [PATCH 02/10] [MWPW-152674] [Gray Box] Desktop gnav not hidden when device view is open (#2597) fixed gnav not hidden on device view --- libs/blocks/graybox/graybox.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/blocks/graybox/graybox.css b/libs/blocks/graybox/graybox.css index 53d8a0b23b..33f828a849 100644 --- a/libs/blocks/graybox/graybox.css +++ b/libs/blocks/graybox/graybox.css @@ -90,7 +90,7 @@ position: fixed; right: 0; top: 15%; - z-index: calc(var(--above-all) + 1); + z-index: calc(var(--above-all) + 2); } .graybox-container .gb-toggle { @@ -190,7 +190,7 @@ } .dialog-modal.graybox-modal { - z-index: var(--above-all); + z-index: calc(var(--above-all) + 1); } .dialog-modal.graybox-modal.mobile > div { @@ -260,7 +260,7 @@ .modal-curtain.graybox-curtain.is-open { background: var(--gb-modal-bg); - z-index: calc(var(--above-all) - 1); + z-index: var(--above-all); } @media (max-height: 910px), (max-width: 420px) { From 3e11762740a352775b975040a0f0ea9a2a4b00e0 Mon Sep 17 00:00:00 2001 From: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Date: Tue, 23 Jul 2024 03:15:18 -0600 Subject: [PATCH 03/10] MWPW-143053 [MEP] Request for New Personalization Tag - CC Paid (#2604) add entitlement --- libs/features/personalization/entitlements.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/features/personalization/entitlements.js b/libs/features/personalization/entitlements.js index e1592f01fa..2ecce45ae3 100644 --- a/libs/features/personalization/entitlements.js +++ b/libs/features/personalization/entitlements.js @@ -19,6 +19,7 @@ const ENTITLEMENT_MAP = { 'eda8c774-420b-44c2-9006-f9a8d0fb5168': '3d-substance-texturing', '76e408f6-ab08-49f0-adb6-f9b4efcc205d': 'cc-free', '08216aa4-4a0f-4136-8b27-182212764a7c': 'dc-free', + 'fc2d5b34-fa75-4e80-9f23-7d4b40bcfc9b': 'cc-paid', // PEP segments '6cb0d58c-3a65-47e2-b459-c52bb158d5b6': 'lightroom-web-usage', 'caa3de84-6336-4fa8-8db2-240fc88106cc': 'photoshop-signup-source', From cebd090016b85667d57f175d7b70fb0895d12c31 Mon Sep 17 00:00:00 2001 From: sonawanesnehal3 <152426902+sonawanesnehal3@users.noreply.github.com> Date: Tue, 23 Jul 2024 19:51:31 +0530 Subject: [PATCH 04/10] [MWPW-154795] Style Feds Global-footer region picker drop-up variant (without hash) (#2599) * Style region-picker dropup * Style region-picker dropup * Style region-picker dropup * Style region-picker dropup --------- Co-authored-by: Snehal Sonawane --- libs/blocks/global-footer/global-footer.css | 45 +++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/libs/blocks/global-footer/global-footer.css b/libs/blocks/global-footer/global-footer.css index 1a240cf2c0..797cebf833 100644 --- a/libs/blocks/global-footer/global-footer.css +++ b/libs/blocks/global-footer/global-footer.css @@ -142,12 +142,13 @@ left: 0; display: none; padding: 20px; - min-width: 130px; + min-width: 165px; max-height: 300px; overflow-y: auto; background: var(--feds-background-nav--light); - border: 1px solid var(--feds-color-border--light); + border: 1px solid var(--color-gray-300); border-radius: 4px; + box-sizing: border-box; } [dir = "rtl"] .feds-regionPicker-wrapper > .fragment { @@ -190,7 +191,8 @@ } .feds-regionPicker-wrapper > .fragment a:hover { - background: var(--feds-background-link--hover--light); + color: var(--color-gray-500); + background: none; } /* Social */ @@ -311,3 +313,40 @@ margin: 0; } } + +.footer-region-button.inline-dialog-active + .fragment p, +.feds-regionPicker + .fragment p { + font-size: var(--type-detail-l-size); + margin-top: 20px; + margin-bottom: 0; +} + +.footer-region-button.inline-dialog-active + .fragment p:first-child, +.feds-regionPicker + .fragment p:first-child { + margin-top: 0; +} + +.feds-regionPicker-wrapper > .fragment a { + line-height: 1; + padding: 0; + color: var(--color-gray-700); +} + +.footer-region-button.inline-dialog-active + .fragment p strong > a, +.feds-regionPicker + .fragment p strong > a { + display: flex; + align-items: center; + justify-content: space-between; +} + +.footer-region-button.inline-dialog-active + .fragment p strong > a::after, +.feds-regionPicker-wrapper > .fragment p strong > a::after { + content: ' '; + display: block; + margin: 0 2px; + width: 6px; + height: 16px; + border: solid var(--color-info-accent); + border-width: 0 1px 1px 0; + transform: rotate(45deg); +} From 99b33a0b78d32c978b9515e1161b191f210eb0af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:21:38 +0000 Subject: [PATCH 05/10] [AUTOMATED-PR] Update imslib.min.js dependency (#2605) Update self hosted dependency Co-authored-by: GitHub Action --- libs/deps/imslib.min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/deps/imslib.min.js b/libs/deps/imslib.min.js index a4e6e7ea66..40cefad2c9 100644 --- a/libs/deps/imslib.min.js +++ b/libs/deps/imslib.min.js @@ -1,4 +1,4 @@ -// Built 2024-05-22T01:11:29.633Z - Last Modified 2024-05-21T12:11:43.000Z +// Built 2024-07-23T01:16:46.077Z - Last Modified 2024-07-22T13:19:42.000Z var roll=function(){ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -14,4 +14,4 @@ var roll=function(){ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};function t(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}var r=function(){return(r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0&&i[i.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]0)&&!(o=n.next()).done;)s.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return s}function a(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(a)),u=c.next();!u.done;u=c.next()){var l=u.value;if(r===l||r.endsWith("."+l))return new e(!0,a[l],i)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}}return new e(!1,i)},e.prototype.shouldFallbackToAdobe=function(e){return!!this.proxied&&("feature_disabled"===e.error&&"cdsc"===e.error_description)},e.THIRD_PARTY_DOMAINS_PROD={"behance.net":"https://sso.behance.net"},e.THIRD_PARTY_DOMAINS_STAGE={"s2stagehance.com":"https://sso.s2stagehance.com"},e}(),m=new(function(){function e(){this.baseUrlAdobe="",this.baseUrlServices="",this.checkTokenEndpoint=new g,this.jslibver="v2-v0.41.0-12-g3caf235"}return e.prototype.loadEnvironment=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r="");var o=e===l.STAGE;o?(this.baseUrlAdobe="https://ims-na1-stg1.adobelogin.com",this.baseUrlServices="https://adobeid-na1-stg1.services.adobe.com"):(this.baseUrlAdobe="https://ims-na1.adobelogin.com",this.baseUrlServices="https://adobeid-na1.services.adobe.com"),this.checkTokenEndpoint=g.computeEndpoint(t,r,o,this.baseUrlServices)},e}());function y(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function k(e,t){if(null==e)return t;if(e===t)return e;if(!y(e))return e;var r=Object.assign({},e);return y(t)&&Object.keys(t).forEach((function(o){var i,n;y(t[o])?o in e?r[o]=k(e[o],t[o]):Object.assign(r,((i={})[o]=t[o],i)):Object.assign(r,((n={})[o]=t[o],n))})),r}var w=new(function(){function e(){this.getCustomApiParameters=function(e,t){return e[t]||{}}}return e.prototype.mergeExternalParameters=function(e,t,r){return k(this.getCustomApiParameters(t,r),e)},e.prototype.toJson=function(e){try{return"string"!=typeof e?e:JSON.parse(e)}catch(e){return null}},e}()),b=function(){function e(){}return e.getInitialRedirectUri=function(e,t){var r=e.redirect_uri||t||window.location.href,o="function"==typeof r?r():r,i=o.indexOf("from_ims");return-1===i?o:("#"===o[i-1]&&i--,o.substr(0,i))},e.createDefaultRedirectUrl=function(e,t,r,o){var i=this.getInitialRedirectUri(r,e),n=this.createOldHash(i);return n.indexOf("?")>0?n+"&client_id="+t+"&api="+o:n+"?client_id="+t+"&api="+o},e.createRedirectUrl=function(e,t,r,o,i){void 0===i&&(i="");var n=this.createDefaultRedirectUrl(e,t,r,o);(i=i||r.scope||"")&&(n=n+"&scope="+i);var s=r.reauth||"";return s&&(n=n+"&reauth="+s),n},e.createOldHash=function(e){var t=e.indexOf("#");return t<0?e+"#old_hash=&from_ims=true":e.substring(0,t)+"#old_hash="+e.substring(t+1)+"&from_ims=true"},e.mergeApiParamsWithExternalParams=function(e,t,r){return k(w.getCustomApiParameters(e,r),t)},e}(),S=function(){var e=this;this.composeRedirectUrl=function(e){var t=e.apiParameters,o=e.externalParameters,i=void 0===o?{}:o,n=e.adobeIdRedirectUri,s=void 0===n?"":n,a=e.clientId,c=e.locale,u=e.state,l=void 0===u?{}:u,d=e.scope,p=void 0===d?i.scope||t.scope||"":d,h=b.mergeApiParamsWithExternalParams(t,i,"authorize");l&&(h.state=k(h.state||{},l));var f=b.createRedirectUrl(s,a,h,"authorize",p),v=i.locale||c||"",g=e.response_type,y=void 0===g?h.response_type||"":g;return r(r({},h),{client_id:a,scope:p,locale:v,response_type:y,jslVersion:m.jslibver,redirect_uri:f})},this.createRedirectUrl=function(t){var r=e.composeRedirectUrl(t),o=v.uriEncodeData(r);return m.baseUrlAdobe+"/ims/authorize/v1?"+o}},I=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.signIn=function(e){var r=t.createRedirectUrl(e);v.setHrefUrl(r)},t.authorizeToken=function(e,r){var o=t.composeRedirectUrl(r);e&&(o.user_assertion=e,o.user_assertion_type="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),t.createAuthorizeForm(o).submit()},t}return t(r,e),r.prototype.createAuthorizeForm=function(e){var t=m.baseUrlAdobe+"/ims/authorize/v1",r=document.createElement("form");r.style.display="none",r.setAttribute("method","post"),r.setAttribute("action",t);var o=null,i=null,n="";for(var s in e){if("object"==typeof(i=e[s])){if(0===Object.keys(i).length)continue;n=JSON.stringify(i)}else n=i;""!==n&&(o=this.createFormElement("input","text",s,n),r.appendChild(o))}return document.getElementsByTagName("body")[0].appendChild(r),r},r.prototype.createFormElement=function(e,t,r,o){var i=document.createElement(e);return i.setAttribute("type",t),i.setAttribute("name",r),i.setAttribute("value",o),i},r}(S),_=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/,T=["https://auth.services.adobe.com","https://auth-stg1.services.adobe.com","https://localhost.corp.adobe.com:9000"],P=new function(){var e=this;this.windowObjectReference=null,this.previousUrl="",this.openSignInWindow=function(t,r,o,i){e.onProcessLocation=i,e.allowOrigin=o.allowOrigin,e.timerId&&clearInterval(e.timerId),window.removeEventListener("message",e.receiveMessage),window.addEventListener("message",e.receiveMessage),e.broadcastChannel&&e.broadcastChannel.close(),e.broadcastChannel=new BroadcastChannel("imslib"),e.broadcastChannel.onmessage=e.receiveMessage;var n="popup=yes, width="+o.width+", height="+o.height+", top="+o.top+", left="+o.left;!e.windowObjectReference||e.windowObjectReference&&e.windowObjectReference.closed?e.windowObjectReference=window.open(t,o.title,n):e.previousUrl!==t?(e.windowObjectReference=window.open(t,o.title,n),e.windowObjectReference&&e.windowObjectReference.focus()):e.windowObjectReference.focus(),e.previousUrl=t},this.receiveMessage=function(t){if(a(T,[e.allowOrigin]).includes(t.origin)){try{if(!_.test(t.data))return void console.warn("refused to receive message containing unknown data format",t.data)}catch(e){return void console.error(e)}e.broadcastChannel&&e.broadcastChannel.close(),e.onProcessLocation&&e.onProcessLocation(t.data)}else console.warn("refused to receive message from origin not whitelisted",t.origin)}},R=function(e){function o(t,o){var i=e.call(this)||this;return i.signIn=function(e){e.state=r(r({},e.state),{imslibmodal:!0});var t=e.state.nonce,o=i.createRedirectUrl(e);P.openSignInWindow(o,t,i.popupSettings,i.onPopupMessage)},i.onPopupMessage=t,i.popupSettings=o,i}return t(o,e),o}(S),E=function(){function e(e,t){this.status=0,this.data="",this.status=e,this.data=this.toJson(t)}return e.prototype.toJson=function(e){try{return"string"!=typeof e?e:JSON.parse(e)}catch(t){return e}},e}(),A=new(function(){function e(){}return e.prototype.http=function(e){return new Promise((function(t,r){var o=new(0,window.XMLHttpRequest);"boolean"==typeof e.withCredentials?o.withCredentials=e.withCredentials:o.withCredentials=!0,"number"==typeof e.timeout&&(o.timeout=e.timeout),o.open(e.method,e.url,!0);var i;o.onload=function(){return this.status>=200&&this.status<300?t(new E(this.status,this.response)):r(new E(this.status,this.response))},o.onerror=function(){var e=new E(this.status,this.response);return r(e)},o.ontimeout=function(){var e=new E(0,"timeout");return r(e)},o.onabort=function(){var e=new E(0,"aborted");return r(e)},(i=e.headers)&&Object.keys(i).forEach((function(e){o.setRequestHeader(e,i[e])})),o.send(e.data)}))},e.prototype.post=function(e,t,r,o,i){return void 0===r&&(r={}),this.http({headers:r,method:"POST",url:e,data:t,withCredentials:o,timeout:i})},e.prototype.get=function(e,t,r,o){return void 0===t&&(t={}),this.http({headers:t,method:"GET",url:e,withCredentials:r,timeout:o})},e}()),O=function(){this.probe=function(e,t,r){if(void 0===r&&(r=2e3),!e||0===e.length)return Promise.resolve([]);for(var o={"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:0,"X-IMS-CLIENTID":t},i="/ims/cdsc_probe?"+v.uriEncodeData({client_id:t}),n=[],s=[],a=function(t){var a=e[t]+i;s.push(A.post(a,{},o,!1,r).then((function(e){return 200==e.status&&n.push(t)})).catch((function(){})))},c=0;c=0?new q("ride_pba_idle_session","",!0):null;var i=this.addRedirectUriToJump(r,o);return new q(r,i)},e.prototype.addRedirectUriToJump=function(e,t){if(!t||"string"!=typeof t)return"";var r=t;this.adobeIdThinData||(this.adobeIdThinData=new H);var o=this.adobeIdThinData.computeRideRedirectUri(e);if(!o||0===o.length)return r;try{var i=new URL(r);return i.searchParams.append("redirect_uri",o),i.toString()}catch(e){return r}},e.prototype.isUnauthorizedException=function(e){var t=e.status;return 401===(void 0===t?0:t)},e}()),K=new(function(){function e(){this.triggerOnError=null}return e.prototype.post=function(e,t,r){var o=this;void 0===r&&(r={});var i=z.getCachedApiResponse(e,t);if(i){var n=i.status,s=i.data;return 200===n?Promise.resolve(s):Promise.reject(s)}return A.post(e,t,r).then((function(r){return o.storeApiResponse(e,JSON.stringify(t),r)})).catch((function(r){return o.verifyError(e,JSON.stringify(t),r)}))},e.prototype.get=function(e,t){var r=this;void 0===t&&(t={});var o=z.getCachedApiResponse(e);if(o){var i=o.status,n=o.data;return 200===i?Promise.resolve(n):Promise.reject(n)}return A.get(e,t).then((function(t){return r.storeApiResponse(e,"",t)})).catch((function(t){return r.verifyError(e,"",t)}))},e.prototype.verifyError=function(e,t,r){this.storeApiResponse(e,t,r);var o=J.verify(r,e);return Promise.reject(o||r.data)},e.prototype.storeApiResponse=function(e,t,r){return void 0===t&&(t=""),z.storeApiResponse(e,t,r),Promise.resolve(r.data)},e}()),B=function(){function e(e){void 0===e&&(e={}),this.CONTENT_FORM_ENCODED="application/x-www-form-urlencoded;charset=utf-8",this.apiParameters=e}return e.prototype.validateToken=function(e){var t=e.token,o=e.client_id,i=e.type,n=v.uriEncodeData(r(r({},w.getCustomApiParameters(this.apiParameters,"validate_token")),{type:i||"access_token",client_id:o,token:t})),s=m.baseUrlAdobe+"/ims/validate_token/v1?jslVersion="+m.jslibver,a=this.formEncoded();return this.addClientIdInHeader(o,a),K.post(s,n,a)},e.prototype.getProfile=function(e){var t=e.token,o=e.client_id,i=r({},w.getCustomApiParameters(this.apiParameters,"profile")),n=this.createAuthorizationHeader(t);this.addClientIdInHeader(o,n);var s=v.uriEncodeData(r({client_id:o},i)),a=m.baseUrlAdobe+"/ims/profile/v1?"+s+"&jslVersion="+m.jslibver;return K.get(a,n)},e.prototype.getUserInfo=function(e){var t=e.token,o=e.client_id,i=r({},w.getCustomApiParameters(this.apiParameters,"userinfo")),n=this.createAuthorizationHeader(t);this.addClientIdInHeader(o,n);var s=v.uriEncodeData(r({client_id:o},i)),a=m.baseUrlAdobe+"/ims/userinfo/v1?"+s+"&jslVersion="+m.jslibver;return K.get(a,n)},e.prototype.logoutToken=function(e){var t=e.client_id,o=e.token,i=r({},w.getCustomApiParameters(this.apiParameters,"logout_token")),n=m.baseUrlServices+"/ims/logout/v1?jslVersion="+m.jslibver,s=this.addClientIdInHeader(t);return K.post(n,r({client_id:t,access_token:o},i),s)},e.prototype.checkStatus=function(){var e=m.baseUrlServices+"/ims/check/v1/status";return K.get(e)},e.prototype.checkToken=function(e,t,o){var i=e.client_id,n=e.scope,s=r({},w.mergeExternalParameters(t,this.apiParameters,"check_token")),a=r(r({},s),{client_id:i,scope:n});return o&&(a.user_id=o),this.callCheckToken(v.uriEncodeData(a),i,"/check/v6/token?jslVersion="+m.jslibver)},e.prototype.switchProfile=function(e,t,o){void 0===o&&(o="");var i=e.client_id,n=e.scope,s=void 0===n?"":n,a=r({},w.mergeExternalParameters(t,this.apiParameters,"check_token")),c=v.uriEncodeData(r(r({},a),{client_id:i,scope:s,user_id:o}));return this.callCheckToken(c,i,"/check/v6/token?jslVersion="+m.jslibver)},e.prototype.listSocialProviders=function(e){var t=e.client_id,o=r({},w.getCustomApiParameters(this.apiParameters,"providers")),i=v.uriEncodeData(r({client_id:t},o)),n=m.baseUrlServices+"/ims/social/v2/providers?"+i+"&jslVersion="+m.jslibver,s=this.addClientIdInHeader(t);return K.get(n,s)},e.prototype.exchangeIjt=function(e,t){var o=e.client_id,i=r({},w.getCustomApiParameters(this.apiParameters,"ijt")),n=m.baseUrlServices+"/ims/jump/implicit/"+t,s=v.uriEncodeData(r({client_id:o},i)),a=n+"?"+s+"&jslVersion="+m.jslibver;a.length>2048&&(delete i.redirect_uri,a=n+"?"+(s=v.uriEncodeData(i)));var c=this.addClientIdInHeader(o);return K.get(a,c)},e.prototype.avatarUrl=function(e){return m.baseUrlAdobe+"/ims/avatar/download/"+e},e.prototype.getReleaseFlags=function(e){var t=e.token,o=e.client_id,i=r({},w.getCustomApiParameters(this.apiParameters,"fg_value")),n=this.createAuthorizationHeader(t);this.addClientIdInHeader(o,n);var s=v.uriEncodeData(r({client_id:o},i)),a=m.baseUrlAdobe+"/ims/fg/value/v1?"+s+"&jslVersion="+m.jslibver;return K.get(a,n)},e.prototype.getTransitoryAuthorizationCode=function(e,t,o){void 0===t&&(t={});var i=r({},w.mergeExternalParameters(t,this.apiParameters,"check_token")),n=v.uriEncodeData(r(r({},i),e));return this.callCheckToken(n,o,"/check/v6/token?client_id="+o+"&jslVersion="+m.jslibver)},e.prototype.getTokenFromCode=function(e,t){void 0===t&&(t={});var o=r({},w.mergeExternalParameters(t,this.apiParameters,"token"));o.grant_type="authorization_code",delete e.other;var i=m.baseUrlServices+"/ims/token/v3?jslVersion="+m.jslibver,n=v.uriEncodeData(r(r({},o),e)),s=this.formEncoded();return this.addClientIdInHeader(e.client_id,s),K.post(i,n,s)},e.prototype.jumpToken=function(e,t,o){void 0===t&&(t={});var i=r({},w.mergeExternalParameters(t,this.apiParameters,"jumptoken")),n=m.baseUrlServices+"/ims/jumptoken/v1?client_id="+o+"&jslVersion="+m.jslibver,s=v.uriEncodeData(r(r({},i),e)),a=this.formEncoded();return this.addClientIdInHeader(o,a),K.post(n,s,a)},e.prototype.socialHeadlessSignIn=function(e,t){void 0===t&&(t={});var o=r({},w.mergeExternalParameters(t,this.apiParameters,"jumptoken")),i=m.baseUrlServices+"/ims/social/v2/native?jslVersion="+m.jslibver,n=v.uriEncodeData(r(r(r({},o),e),{response_type:"implicit_jump"}));return K.post(i,n,this.formEncoded())},e.prototype.createAuthorizationHeader=function(e){var t={};return e&&(t[d]="Bearer "+e),t},e.prototype.formEncoded=function(e){return void 0===e&&(e={}),e["content-type"]=this.CONTENT_FORM_ENCODED,e},e.prototype.addClientIdInHeader=function(e,t){return void 0===t&&(t={}),t.client_id=e,t},e.prototype.callCheckToken=function(e,t,r){var o=this.formEncoded();return this.addClientIdInHeader(t,o),K.post(m.checkTokenEndpoint.url+"/ims"+r,e,o).catch((function(t){if(!m.checkTokenEndpoint.shouldFallbackToAdobe(t))throw t;return K.post(m.checkTokenEndpoint.fallbackUrl+"/ims"+r,e,o)}))},e}();!function(e){e.INITIALIZE_ERROR="initialize_error",e.HTTP="http",e.FRAGMENT="fragment",e.CSRF="csrf",e.NOT_ALLOWED="not_allowed",e.PROFILE_EXCEPTION="profile_exception",e.TOKEN_EXPIRED="token_expired",e.SOCIAL_PROVIDERS="SOCIAL_PROVIDERS",e.RIDE_EXCEPTION="ride_exception"}(N||(N={}));var W=function(e){this.message=null,this.errorType=N.PROFILE_EXCEPTION,this.message=e},Y=/\s|,/g;function X(e){return e.split(Y).sort().join(",")}var Z,Q=function(){function e(e){this.profileServiceRequest=e,this.storage=h.getStorageByName(c.SessionStorage)}return e.prototype.getProfile=function(e){var t=this,r=this.profileServiceRequest,o=r.clientId,i=r.imsApis,n=this.getProfileFromStorage();return n?Promise.resolve(n):i.getProfile({client_id:o,token:e}).then((function(e){if(!e)throw new W("NO profile response");if(0===Object.keys(e).length)throw new W("NO profile value");return t.saveProfileToStorage(e),Promise.resolve(e)})).catch((function(e){return e instanceof G?Promise.reject(e):(t.removeProfile(),Promise.reject(e))}))},e.prototype.getProfileStorageKey=function(){var e=this.profileServiceRequest;return"adobeid_ims_profile/"+e.clientId+"/"+!1+"/"+X(e.scope)},e.prototype.getProfileFromStorage=function(){var e=this.getProfileStorageKey(),t=this.storage.getItem(e);return t&&JSON.parse(t)},e.prototype.saveProfileToStorage=function(e){var t=this.getProfileStorageKey();this.storage.setItem(t,JSON.stringify(e))},e.prototype.removeProfile=function(){var e=this.getProfileStorageKey();this.storage.removeItem(e)},e.prototype.removeProfileIfOtherUser=function(e){if(e){var t=this.getProfileFromStorage();t&&t.userId!==e&&this.removeProfile()}},e}();!function(e){e.GUEST="guest"}(Z||(Z={}));var $,ee=function(){function e(e,t){var r=this;this.REAUTH_SCOPE="reauthenticated",this.valid=!1,this.isReauth=function(){return r.scope.indexOf(r.REAUTH_SCOPE)>=0},this.client_id="",this.scope="",this.expire=new Date,this.user_id="",this.tokenValue="",this.sid="",this.state=null,this.fromFragment=!1,this.impersonatorId="",this.isImpersonatedSession=!1;var o=e.valid,i=e.tokenValue,n=e.access_token,s=e.state,a=e.other,c=i||n,u=this.parseJwt(c);if(!u)throw new Error("token cannot be decoded "+c);this.state=w.toJson(s);var l=u.client_id,d=u.user_id,p=u.scope,h=u.sid,f=u.imp_id,v=u.imp_sid,g=u.pba,m=u.atp,y=u.gse;this.atp=m,this.client_id=l,this.expire=t,this.user_id=d,this.scope=p,this.valid=o,this.tokenValue=c,this.sid=h,this.other=a,this.impersonatorId=f||"",this.isImpersonatedSession=!!v,this.pbaSatisfiedPolicies=g&&g.split(",")||[],this.isGuestToken=this.atp===Z.GUEST,this.gse=y}return e.prototype.parseJwt=function(e){if(!e)return null;try{return JSON.parse(atob(e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")))}catch(t){return p.error("error on decoding token ",e,t),null}},e.prototype.validate=function(e,t){var r,o,i,n=this.valid,s=this.client_id,a=this.scope,c=this.expire;return c0&&(r=new Array(o+1).join(e)+r),r}("0",5,e.toString(2))},le=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("Data is not a string");var r=e.toLowerCase().split("");!function(e){if(e.length%8!=0)throw new Error("Data length is not a multiple of 8");e.forEach((function(e){if(!(e in ce))throw new Error("Unknown encoded character "+e)}));var t=!1;e.forEach((function(e){if("="!==e&&t)throw new Error("Found padding char in the middle of the string");"="===e&&(t=!0)}))}(r);var o=function(e){for(var t=e.length-1,r=0;"="===e[t];)++r,--t;return r}(r),i=[];r.forEach((function(e){i.push(ue(ce[e]))}));var n=i.join("");return o>0&&(n=n.slice(0,-5*o)),n.length%8!=0&&(n=n.slice(0,n.length%8*-1)),t?function(e){var t="";if(e.length%8!=0)throw new Error("Length must be a multiple of 8");for(var r=0,o=e.length;rfe.lastUserInteraction&&(fe.lastUserInteraction=i)}return o.tokenService.refreshToken(e).then((function(e){return o.onTokenProfileReceived(e)})).catch((function(e){if(p.error("refresh token error",e),e instanceof G)return Promise.reject(e);var t=o.verifyRideErrorExceptionStrict(e);return t||(o.profileService.removeProfile(),o.onTokenExpired(),Promise.reject(e))}))},this.switchProfile=function(e,t){return void 0===t&&(t={}),e?o.tokenService.switchProfile(e,t).then((function(e){return o.onTokenProfileReceived(e)})).catch((function(e){return o.verifyRideErrorException(e)})):Promise.reject(new Error("Please provide the user id for switchProfile"))},this.executeErrorCallback=function(e){if(p.info("initialize exception ended",e),!e||e.type!==$.LOGOUT){var t=o.adobeIdData.onError;t&&t(N.HTTP,"Initialization error")}},this.triggerOnImsInstance=function(e){var t=document.createEvent("CustomEvent"),r={clientId:o.adobeIdData.client_id,instance:e};t.initCustomEvent("onImsLibInstance",!1,!1,r),window.dispatchEvent(t)},this.processInitializeException=function(e){return void 0===e&&(e={}),p.warn("initialize",e),o.restoreHash(),Promise.reject(e)},this.verifyModalSignInEvent=function(e){return e instanceof ae?o.notifyParentAboutModalSignIn(e):Promise.reject(e)},this.verifyTokenExpiredException=function(e){return e instanceof ne?(o.adobeIdData.handlers.triggerOnAccessTokenHasExpired(),Promise.resolve()):Promise.reject(e)},this.verifyRideErrorException=function(e){return i(o,void 0,Promise,(function(){return n(this,(function(t){switch(t.label){case 0:return e instanceof q?this.adobeIdData.overrideErrorHandler&&!this.adobeIdData.overrideErrorHandler(e)?[2,Promise.reject(e)]:e.isPbaExpiredIdleSessionWorkaround?[4,this.signIn()]:[3,2]:[3,4];case 1:return t.sent(),[3,4];case 2:return e.jump?[4,v.replaceUrlAndWait(e.jump,1e4)]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2,Promise.reject(e)]}}))}))},this.verifyRideErrorExceptionStrict=function(e){return e instanceof q?o.verifyRideErrorException(e):null},this.verifyCsrfException=function(e){var t=e.type;return t&&t===N.CSRF&&o.signOut(),Promise.reject(e)},this.processTokenResponse=function(e){var t=o.adobeIdData.handlers,r=e.tokenFields,i=e.profile,n=r.tokenValue,s=r.state,a=r.expire,c=r.sid,u=r.user_id,l=r.other,d=void 0===l?{}:l,h=r.impersonatorId,f=r.isImpersonatedSession,g=r.pbaSatisfiedPolicies,m=r.isGuestToken,y=r.gse;p.info("token",n),d.from_ims&&v.setHash(d.old_hash||""),o.profileService.removeProfileIfOtherUser(u);var k={token:n,expire:a,sid:c,impersonatorId:h,isImpersonatedSession:f,pbaSatisfiedPolicies:g,isGuestToken:m,gse:y};return r.isReauth()?t.triggerOnReauthAccessToken(k):o.tokenReceived(k),i&&o.profileService.saveProfileToStorage(i),Promise.resolve(s)},this.exchangeIjt=function(e){var t=o.adobeIdData.ijt;return e||t?o.tokenService.exchangeIjt(e||t).then((function(e){return e.profile?o.profileService.saveProfileToStorage(e.profile):o.profileService.removeProfile(),Promise.resolve(e)})):Promise.reject(new Error("please set the adobeid.ijt value"))},this.adobeIdData=new L(e),t&&(this.instanceKey=t);var s=this.adobeIdData,a=s.api_parameters,c=void 0===a?{}:a,u=s.client_id,l=s.scope,d=s.useLocalStorage,h=s.autoValidateToken,g=s.modalMode,m=s.modalSettings;this.imsApis=new B(c),this.csrfService=new f(u,this.instanceKey),this.serviceRequest={clientId:u,scope:l,imsApis:this.imsApis},this.tokenService=new pe(r(r({},this.serviceRequest),{useLocalStorage:d,autoValidateToken:h}),this.csrfService),this.profileService=new Q(this.serviceRequest),this.signInservice=g?new R(this.onPopupMessage,m):new I}return Object.defineProperty(e.prototype,"version",{get:function(){return m.jslibver},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"adobeid",{get:function(){return r({},this.adobeIdData)},enumerable:!0,configurable:!0}),e.prototype.enableLogging=function(){p.enableLogging()},e.prototype.disableLogging=function(){p.disableLogging()},e.prototype.checkInitialized=function(){this.initialized},e.prototype.signUp=function(e,t){var r=this;void 0===e&&(e={}),this.checkInitialized();var o=this.adobeIdData,i=this.csrfService;if(!o)throw new Error("no adobeId on reAuthenticate");var n=i.initialize();return o.createSignUpRedirectRequest(e,t,n).then((function(e){r.signInservice.signIn(e)}))},e.prototype.isSignedInUser=function(){var e=this.getAccessToken();return(!e||!e.isGuestToken)&&!(!e&&!this.getReauthAccessToken())},e.prototype.getProfile=function(){var e=this,t=this.profileService.getProfileFromStorage();if(t)return Promise.resolve(t);var r=this.getAccessToken()||this.getReauthAccessToken();if(!r){var o="please login before getting the profile";return Promise.reject(new W(o))}if(r.isGuestToken){o="guest account does not have a profile";return Promise.reject(new W(o))}return this.profileService.getProfile(r.token).then((function(e){return Promise.resolve(e)})).catch((function(t){return p.error("get profile exception ",t),t instanceof G?e.refreshToken().then((function(e){return Promise.resolve(e.profile)})):Promise.reject(new W(t.message||t))}))},e.prototype.avatarUrl=function(e){return this.imsApis.avatarUrl(e)},e.prototype.getReleaseFlags=function(e){return void 0===e&&(e=!1),e?this.tokenService.getDecodedReleaseFlags():this.tokenService.getReleaseFlags()},e.prototype.getAccessToken=function(){return this.getTokenFromStorage(!1)},e.prototype.getReauthAccessToken=function(){return this.getTokenFromStorage(!0)},e.prototype.getTokenFromStorage=function(e){var t=this.tokenService.getTokenFieldsFromStorage(e);return t?{token:t.tokenValue,expire:t.expire,sid:t.sid,impersonatorId:t.impersonatorId,isImpersonatedSession:t.isImpersonatedSession,pbaSatisfiedPolicies:t.pbaSatisfiedPolicies,isGuestToken:t.isGuestToken,gse:t.gse}:null},e.prototype.listSocialProviders=function(){var e=this;return new Promise((function(t,r){var o=e.adobeIdData.client_id;e.imsApis.listSocialProviders({client_id:o}).then((function(e){t(e)})).catch((function(e){r(e)}))}))},e.prototype.tokenReceived=function(e){this.adobeIdData.handlers.triggerOnAccessToken(e),fe.startAutoRefreshFlow({expire:e.expire,refreshTokenMethod:this.refreshToken})},e.prototype.onTokenProfileReceived=function(e){var t=e.tokenInfo,r=e.profile;return p.info("token",t),this.tokenReceived(t),this.profileService.saveProfileToStorage(r),Promise.resolve(e)},e.prototype.validateToken=function(){var e=this;return this.tokenService.validateToken().then((function(){return Promise.resolve(!0)})).catch((function(t){return p.warn("validate token exception",t),t instanceof G?Promise.reject(!1):(e.profileService.removeProfile(),Promise.reject(!1))}))},e.prototype.onTokenExpired=function(){var e=this.adobeIdData.handlers;this.tokenService.purge(),e.triggerOnAccessTokenHasExpired()},e.prototype.setStandAloneToken=function(e){return this.tokenService.setStandAloneToken(e)},e.prototype.initialize=function(){var e=this,t=this.adobeIdData,r=t.handlers,o=t.standalone,i=t.ijt,n=t.alwaysRemoveTokenFromUrl,s=null;return o&&this.setStandAloneToken(o),(i?this.exchangeIjt:this.tokenService.getTokenAndProfile)().then(this.processTokenResponse,this.processError.apply(this)).then((function(e){s=e})).finally((function(){p.info("onReady initialization"),window.addEventListener("getImsLibInstance",(function(){e.triggerOnImsInstance(e)}),!1),n&&v.setHash(te.removeAccessToken()),r.triggerOnReady(s?s.context:null),e.triggerOnImsInstance(e),e.initialized=!0}))},e.prototype.processError=function(){var e=this;return function(t){return e.verifyModalSignInEvent(t).catch(e.processInitializeException).catch(e.verifyTokenExpiredException).catch(e.verifyRideErrorException).catch(e.verifyCsrfException).catch(e.executeErrorCallback)}},e.prototype.notifyParentAboutModalSignIn=function(e){var t=window.location.href.replace("imslibmodal","wasmodal");if(window.opener)window.opener.postMessage(t,window.location.origin),window.close();else{var r=new BroadcastChannel("imslib");r.postMessage(t),r.close(),window.close()}return Promise.reject("popup")},e.prototype.restoreHash=function(){var e=te.fragmentToObject();e&&e.from_ims&&v.setHash(e.old_hash||"")},e.prototype.getTransitoryAuthorizationCode=function(e,t){return void 0===t&&(t={}),(e=e||{}).response_type=e.response_type||"code",e.target_client_id=e.target_client_id||this.adobeIdData.client_id,e.target_scope=e.target_scope||this.adobeIdData.scope,this.imsApis.getTransitoryAuthorizationCode(e,t,this.adobeIdData.client_id)},e.prototype.jumpToken=function(e,t){return void 0===t&&(t={}),e.target_client_id=e.target_client_id||this.adobeIdData.client_id,e.target_scope=e.target_scope||this.adobeIdData.scope,this.imsApis.jumpToken(e,t,this.adobeIdData.client_id)},e.prototype.getVerifierByKey=function(e){return(new M).getVerifierByKey(e)},e.prototype.socialHeadlessSignIn=function(e,t){return void 0===t&&(t={}),i(this,void 0,Promise,(function(){var r=this;return n(this,(function(o){return[2,this.imsApis.socialHeadlessSignIn(e,t).then((function(e){return r.exchangeIjt(e.token)})).catch((function(t){return"ride_AdobeID_social"===t.error&&r.signIn({idp_flow:"social.native",provider_id:e.provider_id,idp_token:e.idp_token}),Promise.reject(t)}))]}))}))},e.prototype.getAccountType=function(){var e=this.getAccessToken();if(!e)throw new Error("please login before getting the account type");if(e.isGuestToken)return oe.GUEST;var t=this.profileService.getProfileFromStorage();if(!t)throw new Error("you need to first get the profile before getting the account type");return t.account_type},e.prototype.getSessionExpiration=function(){var e=this.getAccessToken();if(!e)throw new Error("please obtain a token before getting the session expiration");return e.gse},e}(),ge=new(function(){function e(){this.createIMSLib=function(e,t){void 0===e&&(e=null),void 0===t&&(t="adobeIMS");var r=new ve(e,t);return window[t]=r,r}}return e.prototype.initAdobeIms=function(){window.adobeImsFactory={createIMSLib:this.createIMSLib};var e=window.adobeIMS||null;if(!e){var t=window.adobeid;if(!t||!t.client_id)return;(e=this.createIMSLib(t,"adobeIMS")).initialize()}},e}());return new(function(){function e(){ge.initAdobeIms()}return e.prototype.initialize=function(){return!0},e}())}(); +var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};function t(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}var r=function(){return(r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0&&n[n.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s}function a(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(a)),u=c.next();!u.done;u=c.next()){var l=u.value;if(r===l||r.endsWith("."+l))return new e(!0,a[l],n)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}}return new e(!1,n)},e.prototype.shouldFallbackToAdobe=function(e){return!!this.proxied&&("feature_disabled"===e.error&&"cdsc"===e.error_description)},e.THIRD_PARTY_DOMAINS_PROD={"behance.net":"https://sso.behance.net"},e.THIRD_PARTY_DOMAINS_STAGE={"s2stagehance.com":"https://sso.s2stagehance.com"},e}(),m=new(function(){function e(){this.baseUrlAdobe="",this.baseUrlServices="",this.checkTokenEndpoint=new g,this.jslibver="v2-v0.42.0-10-g2e3497b"}return e.prototype.loadEnvironment=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r="");var o=e===l.STAGE;o?(this.baseUrlAdobe="https://ims-na1-stg1.adobelogin.com",this.baseUrlServices="https://adobeid-na1-stg1.services.adobe.com"):(this.baseUrlAdobe="https://ims-na1.adobelogin.com",this.baseUrlServices="https://adobeid-na1.services.adobe.com"),this.checkTokenEndpoint=g.computeEndpoint(t,r,o,this.baseUrlServices)},e}());function y(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function k(e,t){if(null==e)return t;if(e===t)return e;if(!y(e))return e;var r=Object.assign({},e);return y(t)&&Object.keys(t).forEach((function(o){var n,i;y(t[o])?o in e?r[o]=k(e[o],t[o]):Object.assign(r,((n={})[o]=t[o],n)):Object.assign(r,((i={})[o]=t[o],i))})),r}var w=new(function(){function e(){this.getCustomApiParameters=function(e,t){return e[t]||{}}}return e.prototype.mergeExternalParameters=function(e,t,r){return k(this.getCustomApiParameters(t,r),e)},e.prototype.toJson=function(e){try{return"string"!=typeof e?e:JSON.parse(e)}catch(e){return null}},e}()),b=function(){function e(){}return e.getInitialRedirectUri=function(e,t){var r=e.redirect_uri||t||window.location.href,o="function"==typeof r?r():r,n=o.indexOf("from_ims");return-1===n?o:("#"===o[n-1]&&n--,o.substr(0,n))},e.createDefaultRedirectUrl=function(e,t,r,o){var n=this.getInitialRedirectUri(r,e),i=this.createOldHash(n);return i.indexOf("?")>0?i+"&client_id="+t+"&api="+o:i+"?client_id="+t+"&api="+o},e.createRedirectUrl=function(e,t,r,o,n){void 0===n&&(n="");var i=this.createDefaultRedirectUrl(e,t,r,o);(n=n||r.scope||"")&&(i=i+"&scope="+n);var s=r.reauth||"";return s&&(i=i+"&reauth="+s),i},e.createOldHash=function(e){var t=e.indexOf("#");return t<0?e+"#old_hash=&from_ims=true":e.substring(0,t)+"#old_hash="+e.substring(t+1)+"&from_ims=true"},e.mergeApiParamsWithExternalParams=function(e,t,r){return k(w.getCustomApiParameters(e,r),t)},e}(),S=function(){var e=this;this.composeRedirectUrl=function(e){var t=e.apiParameters,o=e.externalParameters,n=void 0===o?{}:o,i=e.adobeIdRedirectUri,s=void 0===i?"":i,a=e.clientId,c=e.locale,u=e.state,l=void 0===u?{}:u,d=e.scope,p=void 0===d?n.scope||t.scope||"":d,h=b.mergeApiParamsWithExternalParams(t,n,"authorize");l&&(h.state=k(h.state||{},l));var f=b.createRedirectUrl(s,a,h,"authorize",p),v=n.locale||c||"",g=e.response_type,y=void 0===g?h.response_type||"":g;return r(r({},h),{client_id:a,scope:p,locale:v,response_type:y,jslVersion:m.jslibver,redirect_uri:f})},this.createRedirectUrl=function(t){var r=e.composeRedirectUrl(t),o=v.uriEncodeData(r);return m.baseUrlAdobe+"/ims/authorize/v1?"+o}},T=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.signIn=function(e){var r=t.createRedirectUrl(e);v.setHrefUrl(r)},t.authorizeToken=function(e,r){var o=t.composeRedirectUrl(r);e&&(o.user_assertion=e,o.user_assertion_type="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),t.createAuthorizeForm(o).submit()},t}return t(r,e),r.prototype.createAuthorizeForm=function(e){var t=m.baseUrlAdobe+"/ims/authorize/v1",r=document.createElement("form");r.style.display="none",r.setAttribute("method","post"),r.setAttribute("action",t);var o=null,n=null,i="";for(var s in e){if("object"==typeof(n=e[s])){if(0===Object.keys(n).length)continue;i=JSON.stringify(n)}else i=n;""!==i&&(o=this.createFormElement("input","text",s,i),r.appendChild(o))}return document.getElementsByTagName("body")[0].appendChild(r),r},r.prototype.createFormElement=function(e,t,r,o){var n=document.createElement(e);return n.setAttribute("type",t),n.setAttribute("name",r),n.setAttribute("value",o),n},r}(S),I=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/,_=["https://auth.services.adobe.com","https://auth-stg1.services.adobe.com","https://localhost.corp.adobe.com:9000"],P=new function(){var e=this;this.windowObjectReference=null,this.previousUrl="",this.openSignInWindow=function(t,r,o,n){e.onProcessLocation=n,e.allowOrigin=o.allowOrigin,e.timerId&&clearInterval(e.timerId),window.removeEventListener("message",e.receiveMessage),window.addEventListener("message",e.receiveMessage),e.broadcastChannel&&e.broadcastChannel.close(),e.broadcastChannel=new BroadcastChannel("imslib"),e.broadcastChannel.onmessage=e.receiveMessage;var i="popup=yes, width="+o.width+", height="+o.height+", top="+o.top+", left="+o.left;!e.windowObjectReference||e.windowObjectReference&&e.windowObjectReference.closed?e.windowObjectReference=window.open(t,o.title,i):e.previousUrl!==t?(e.windowObjectReference=window.open(t,o.title,i),e.windowObjectReference&&e.windowObjectReference.focus()):e.windowObjectReference.focus(),e.previousUrl=t},this.receiveMessage=function(t){if(a(_,[e.allowOrigin]).includes(t.origin)){try{if(!I.test(t.data))return void console.warn("refused to receive message containing unknown data format",t.data)}catch(e){return void console.error(e)}e.broadcastChannel&&e.broadcastChannel.close(),e.onProcessLocation&&e.onProcessLocation(t.data)}else console.warn("refused to receive message from origin not whitelisted",t.origin)}},R=function(e){function o(t,o){var n=e.call(this)||this;return n.signIn=function(e){e.state=r(r({},e.state),{imslibmodal:!0});var t=e.state.nonce,o=n.createRedirectUrl(e);P.openSignInWindow(o,t,n.popupSettings,n.onPopupMessage)},n.onPopupMessage=t,n.popupSettings=o,n}return t(o,e),o}(S),E=function(){function e(e,t){this.status=0,this.data="",this.status=e,this.data=this.toJson(t)}return e.prototype.toJson=function(e){try{return"string"!=typeof e?e:JSON.parse(e)}catch(t){return e}},e}(),A=new(function(){function e(){}return e.prototype.http=function(e){return new Promise((function(t,r){var o=new(0,window.XMLHttpRequest);"boolean"==typeof e.withCredentials?o.withCredentials=e.withCredentials:o.withCredentials=!0,"number"==typeof e.timeout&&(o.timeout=e.timeout),o.open(e.method,e.url,!0);var n;o.onload=function(){return this.status>=200&&this.status<300?t(new E(this.status,this.response)):r(new E(this.status,this.response))},o.onerror=function(){var e=new E(this.status,this.response);return r(e)},o.ontimeout=function(){var e=new E(0,"timeout");return r(e)},o.onabort=function(){var e=new E(0,"aborted");return r(e)},(n=e.headers)&&Object.keys(n).forEach((function(e){o.setRequestHeader(e,n[e])})),o.send(e.data)}))},e.prototype.post=function(e,t,r,o,n){return void 0===r&&(r={}),this.http({headers:r,method:"POST",url:e,data:t,withCredentials:o,timeout:n})},e.prototype.get=function(e,t,r,o){return void 0===t&&(t={}),this.http({headers:t,method:"GET",url:e,withCredentials:r,timeout:o})},e}()),O=function(){this.probe=function(e,t,r){if(void 0===r&&(r=2e3),!e||0===e.length)return Promise.resolve([]);for(var o={"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:0,"X-IMS-CLIENTID":t},n="/ims/cdsc_probe?"+v.uriEncodeData({client_id:t}),i=[],s=[],a=function(t){var a=e[t]+n;s.push(A.post(a,{},o,!1,r).then((function(e){return 200==e.status&&i.push(t)})).catch((function(){})))},c=0;c=0?new G("ride_pba_idle_session","",!0):null;var n=this.addRedirectUriToJump(r,o);return new G(r,n)},e.prototype.addRedirectUriToJump=function(e,t){if(!t||"string"!=typeof t)return"";var r=t;this.adobeIdThinData||(this.adobeIdThinData=new H);var o=this.adobeIdThinData.computeRideRedirectUri(e);if(!o||0===o.length)return r;try{var n=new URL(r);return n.searchParams.append("redirect_uri",o),n.toString()}catch(e){return r}},e.prototype.isUnauthorizedException=function(e){var t=e.status;return 401===(void 0===t?0:t)},e}()),K=new(function(){function e(){this.triggerOnError=null}return e.prototype.post=function(e,t,r){var o=this;void 0===r&&(r={});var n=z.getCachedApiResponse(e,t);if(n){var i=n.status,s=n.data;return 200===i?Promise.resolve(s):Promise.reject(s)}return A.post(e,t,r).then((function(r){return o.storeApiResponse(e,JSON.stringify(t),r)})).catch((function(r){return o.verifyError(e,JSON.stringify(t),r)}))},e.prototype.get=function(e,t){var r=this;void 0===t&&(t={});var o=z.getCachedApiResponse(e);if(o){var n=o.status,i=o.data;return 200===n?Promise.resolve(i):Promise.reject(i)}return A.get(e,t).then((function(t){return r.storeApiResponse(e,"",t)})).catch((function(t){return r.verifyError(e,"",t)}))},e.prototype.verifyError=function(e,t,r){this.storeApiResponse(e,t,r);var o=J.verify(r,e);return Promise.reject(o||r.data)},e.prototype.storeApiResponse=function(e,t,r){return void 0===t&&(t=""),z.storeApiResponse(e,t,r),Promise.resolve(r.data)},e}()),B=function(){function e(e){void 0===e&&(e={}),this.CONTENT_FORM_ENCODED="application/x-www-form-urlencoded;charset=utf-8",this.apiParameters=e}return e.prototype.validateToken=function(e){var t=e.token,o=e.client_id,n=e.type,i=v.uriEncodeData(r(r({},w.getCustomApiParameters(this.apiParameters,"validate_token")),{type:n||"access_token",client_id:o,token:t})),s=m.baseUrlAdobe+"/ims/validate_token/v1?jslVersion="+m.jslibver,a=this.formEncoded();return this.addClientIdInHeader(o,a),K.post(s,i,a)},e.prototype.getProfile=function(e){var t=e.token,o=e.client_id,n=r({},w.getCustomApiParameters(this.apiParameters,"profile")),i=this.createAuthorizationHeader(t);this.addClientIdInHeader(o,i);var s=v.uriEncodeData(r({client_id:o},n)),a=m.baseUrlAdobe+"/ims/profile/v1?"+s+"&jslVersion="+m.jslibver;return K.get(a,i)},e.prototype.getUserInfo=function(e){var t=e.token,o=e.client_id,n=r({},w.getCustomApiParameters(this.apiParameters,"userinfo")),i=this.createAuthorizationHeader(t);this.addClientIdInHeader(o,i);var s=v.uriEncodeData(r({client_id:o},n)),a=m.baseUrlAdobe+"/ims/userinfo/v1?"+s+"&jslVersion="+m.jslibver;return K.get(a,i)},e.prototype.logoutToken=function(e){var t=e.client_id,o=e.token,n=r({},w.getCustomApiParameters(this.apiParameters,"logout_token")),i=m.baseUrlServices+"/ims/logout/v1?jslVersion="+m.jslibver,s=this.addClientIdInHeader(t);return K.post(i,r({client_id:t,access_token:o},n),s)},e.prototype.checkStatus=function(){var e=m.baseUrlServices+"/ims/check/v1/status";return K.get(e)},e.prototype.checkToken=function(e,t,o){var n=e.client_id,i=e.scope,s=r({},w.mergeExternalParameters(t,this.apiParameters,"check_token")),a=r(r({},s),{client_id:n,scope:i});return o&&(a.user_id=o),this.callCheckToken(v.uriEncodeData(a),n,"/check/v6/token?jslVersion="+m.jslibver)},e.prototype.switchProfile=function(e,t,o){void 0===o&&(o="");var n=e.client_id,i=e.scope,s=void 0===i?"":i,a=r({},w.mergeExternalParameters(t,this.apiParameters,"check_token")),c=v.uriEncodeData(r(r({},a),{client_id:n,scope:s,user_id:o}));return this.callCheckToken(c,n,"/check/v6/token?jslVersion="+m.jslibver)},e.prototype.listSocialProviders=function(e){var t=e.client_id,o=r({},w.getCustomApiParameters(this.apiParameters,"providers")),n=v.uriEncodeData(r({client_id:t},o)),i=m.baseUrlServices+"/ims/social/v2/providers?"+n+"&jslVersion="+m.jslibver,s=this.addClientIdInHeader(t);return K.get(i,s)},e.prototype.exchangeIjt=function(e,t){var o=e.client_id,n=r({},w.getCustomApiParameters(this.apiParameters,"ijt")),i=m.baseUrlServices+"/ims/jump/implicit/"+t,s=v.uriEncodeData(r({client_id:o},n)),a=i+"?"+s+"&jslVersion="+m.jslibver;a.length>2048&&(delete n.redirect_uri,a=i+"?"+(s=v.uriEncodeData(n)));var c=this.addClientIdInHeader(o);return K.get(a,c)},e.prototype.avatarUrl=function(e){return m.baseUrlAdobe+"/ims/avatar/download/"+e},e.prototype.getReleaseFlags=function(e){var t=e.token,o=e.client_id,n=r({},w.getCustomApiParameters(this.apiParameters,"fg_value")),i=this.createAuthorizationHeader(t);this.addClientIdInHeader(o,i);var s=v.uriEncodeData(r({client_id:o},n)),a=m.baseUrlAdobe+"/ims/fg/value/v1?"+s+"&jslVersion="+m.jslibver;return K.get(a,i)},e.prototype.getTransitoryAuthorizationCode=function(e,t,o){void 0===t&&(t={});var n=r({},w.mergeExternalParameters(t,this.apiParameters,"check_token")),i=v.uriEncodeData(r(r({},n),e));return this.callCheckToken(i,o,"/check/v6/token?client_id="+o+"&jslVersion="+m.jslibver)},e.prototype.getTokenFromCode=function(e,t){void 0===t&&(t={});var o=r({},w.mergeExternalParameters(t,this.apiParameters,"token"));o.grant_type="authorization_code",delete e.other;var n=m.baseUrlServices+"/ims/token/v3?jslVersion="+m.jslibver,i=v.uriEncodeData(r(r({},o),e)),s=this.formEncoded();return this.addClientIdInHeader(e.client_id,s),K.post(n,i,s)},e.prototype.jumpToken=function(e,t,o){void 0===t&&(t={});var n=r({},w.mergeExternalParameters(t,this.apiParameters,"jumptoken")),i=m.baseUrlServices+"/ims/jumptoken/v1?client_id="+o+"&jslVersion="+m.jslibver,s=v.uriEncodeData(r(r({},n),e)),a=this.formEncoded();return this.addClientIdInHeader(o,a),K.post(i,s,a)},e.prototype.socialHeadlessSignIn=function(e,t){void 0===t&&(t={});var o=r({},w.mergeExternalParameters(t,this.apiParameters,"jumptoken")),n=m.baseUrlServices+"/ims/social/v2/native?jslVersion="+m.jslibver,i=v.uriEncodeData(r(r(r({},o),e),{response_type:"implicit_jump"}));return K.post(n,i,this.formEncoded())},e.prototype.createAuthorizationHeader=function(e){var t={};return e&&(t[d]="Bearer "+e),t},e.prototype.formEncoded=function(e){return void 0===e&&(e={}),e["content-type"]=this.CONTENT_FORM_ENCODED,e},e.prototype.addClientIdInHeader=function(e,t){return void 0===t&&(t={}),t.client_id=e,t},e.prototype.callCheckToken=function(e,t,r){var o=this.formEncoded();return this.addClientIdInHeader(t,o),K.post(m.checkTokenEndpoint.url+"/ims"+r,e,o).catch((function(t){if(!m.checkTokenEndpoint.shouldFallbackToAdobe(t))throw t;return K.post(m.checkTokenEndpoint.fallbackUrl+"/ims"+r,e,o)}))},e}();!function(e){e.INITIALIZE_ERROR="initialize_error",e.HTTP="http",e.FRAGMENT="fragment",e.CSRF="csrf",e.NOT_ALLOWED="not_allowed",e.PROFILE_EXCEPTION="profile_exception",e.TOKEN_EXPIRED="token_expired",e.SOCIAL_PROVIDERS="SOCIAL_PROVIDERS",e.RIDE_EXCEPTION="ride_exception"}(N||(N={}));var W=function(e){this.message=null,this.errorType=N.PROFILE_EXCEPTION,this.message=e},Y=/\s|,/g;function X(e){return e.split(Y).sort().join(",")}var Z,Q=function(){function e(e){this.profileServiceRequest=e,this.storage=h.getStorageByName(c.SessionStorage)}return e.prototype.getProfile=function(e){var t=this,r=this.profileServiceRequest,o=r.clientId,n=r.imsApis,i=this.getProfileFromStorage();return i?Promise.resolve(i):n.getProfile({client_id:o,token:e}).then((function(e){if(!e)throw new W("NO profile response");if(0===Object.keys(e).length)throw new W("NO profile value");return t.saveProfileToStorage(e),Promise.resolve(e)})).catch((function(e){return e instanceof q?Promise.reject(e):(t.removeProfile(),Promise.reject(e))}))},e.prototype.getProfileStorageKey=function(){var e=this.profileServiceRequest;return"adobeid_ims_profile/"+e.clientId+"/"+!1+"/"+X(e.scope)},e.prototype.getProfileFromStorage=function(){var e=this.getProfileStorageKey(),t=this.storage.getItem(e);return t&&JSON.parse(t)},e.prototype.saveProfileToStorage=function(e){var t=this.getProfileStorageKey();this.storage.setItem(t,JSON.stringify(e))},e.prototype.removeProfile=function(){var e=this.getProfileStorageKey();this.storage.removeItem(e)},e.prototype.removeProfileIfOtherUser=function(e){if(e){var t=this.getProfileFromStorage();t&&t.userId!==e&&this.removeProfile()}},e}();!function(e){e.GUEST="guest"}(Z||(Z={}));var $,ee=function(){function e(e,t){var r=this;this.REAUTH_SCOPE="reauthenticated",this.valid=!1,this.isReauth=function(){return r.scope.indexOf(r.REAUTH_SCOPE)>=0},this.client_id="",this.scope="",this.expire=new Date,this.user_id="",this.tokenValue="",this.sid="",this.state=null,this.fromFragment=!1,this.impersonatorId="",this.isImpersonatedSession=!1;var o=e.valid,n=e.tokenValue,i=e.access_token,s=e.state,a=e.other,c=n||i,u=this.parseJwt(c);if(!u)throw new Error("token cannot be decoded "+c);this.state=w.toJson(s);var l=u.client_id,d=u.user_id,p=u.scope,h=u.sid,f=u.imp_id,v=u.imp_sid,g=u.pba,m=u.atp,y=u.gse;this.atp=m,this.client_id=l,this.expire=t,this.user_id=d,this.scope=p,this.valid=o,this.tokenValue=c,this.sid=h,this.other=a,this.impersonatorId=f||"",this.isImpersonatedSession=!!v,this.pbaSatisfiedPolicies=g&&g.split(",")||[],this.isGuestToken=this.atp===Z.GUEST,this.gse=y}return e.prototype.parseJwt=function(e){if(!e)return null;try{return JSON.parse(atob(e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")))}catch(t){return p.error("error on decoding token ",e,t),null}},e.prototype.validate=function(e,t){var r,o,n,i=this.valid,s=this.client_id,a=this.scope,c=this.expire;return c0&&(r=new Array(o+1).join(e)+r),r}("0",5,e.toString(2))},le=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("Data is not a string");var r=e.toLowerCase().split("");!function(e){if(e.length%8!=0)throw new Error("Data length is not a multiple of 8");e.forEach((function(e){if(!(e in ce))throw new Error("Unknown encoded character "+e)}));var t=!1;e.forEach((function(e){if("="!==e&&t)throw new Error("Found padding char in the middle of the string");"="===e&&(t=!0)}))}(r);var o=function(e){for(var t=e.length-1,r=0;"="===e[t];)++r,--t;return r}(r),n=[];r.forEach((function(e){n.push(ue(ce[e]))}));var i=n.join("");return o>0&&(i=i.slice(0,-5*o)),i.length%8!=0&&(i=i.slice(0,i.length%8*-1)),t?function(e){var t="";if(e.length%8!=0)throw new Error("Length must be a multiple of 8");for(var r=0,o=e.length;rfe.lastUserInteraction&&(fe.lastUserInteraction=n)}return o.tokenService.refreshToken(e).then((function(e){return o.onTokenProfileReceived(e)})).catch((function(e){if(p.error("refresh token error",e),e instanceof q)return Promise.reject(e);var t=o.verifyRideErrorExceptionStrict(e);return t||(o.profileService.removeProfile(),o.onTokenExpired(),Promise.reject(e))}))},this.switchProfile=function(e,t){return void 0===t&&(t={}),e?o.tokenService.switchProfile(e,t).then((function(e){return o.onTokenProfileReceived(e)})).catch((function(e){return o.verifyRideErrorException(e)})):Promise.reject(new Error("Please provide the user id for switchProfile"))},this.executeErrorCallback=function(e){if(p.info("initialize exception ended",e),!e||e.type!==$.LOGOUT){var t=o.adobeIdData.onError;t&&t(N.HTTP,"Initialization error")}},this.triggerOnImsInstance=function(e){var t=document.createEvent("CustomEvent"),r={clientId:o.adobeIdData.client_id,instance:e};t.initCustomEvent("onImsLibInstance",!1,!1,r),window.dispatchEvent(t)},this.processInitializeException=function(e){return void 0===e&&(e={}),p.warn("initialize",e),o.restoreHash(),Promise.reject(e)},this.verifyModalSignInEvent=function(e){return e instanceof ae?o.notifyParentAboutModalSignIn(e):Promise.reject(e)},this.verifyTokenExpiredException=function(e){return e instanceof ie?(o.adobeIdData.handlers.triggerOnAccessTokenHasExpired(),Promise.resolve()):Promise.reject(e)},this.verifyRideErrorException=function(e){return n(o,void 0,Promise,(function(){return i(this,(function(t){switch(t.label){case 0:return e instanceof G?this.adobeIdData.overrideErrorHandler&&!this.adobeIdData.overrideErrorHandler(e)?[2,Promise.reject(e)]:e.isPbaExpiredIdleSessionWorkaround?[4,this.signIn()]:[3,2]:[3,4];case 1:return t.sent(),[3,4];case 2:return e.jump?[4,v.replaceUrlAndWait(e.jump,1e4)]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2,Promise.reject(e)]}}))}))},this.verifyRideErrorExceptionStrict=function(e){return e instanceof G?o.verifyRideErrorException(e):null},this.verifyCsrfException=function(e){var t=e.type;return t&&t===N.CSRF&&o.signOut(),Promise.reject(e)},this.processTokenResponse=function(e){var t=o.adobeIdData.handlers,r=e.tokenFields,n=e.profile,i=r.tokenValue,s=r.state,a=r.expire,c=r.sid,u=r.user_id,l=r.other,d=void 0===l?{}:l,h=r.impersonatorId,f=r.isImpersonatedSession,g=r.pbaSatisfiedPolicies,m=r.isGuestToken,y=r.gse;p.info("token",i),d.from_ims&&v.setHash(d.old_hash||""),o.profileService.removeProfileIfOtherUser(u);var k={token:i,expire:a,sid:c,impersonatorId:h,isImpersonatedSession:f,pbaSatisfiedPolicies:g,isGuestToken:m,gse:y};return r.isReauth()?t.triggerOnReauthAccessToken(k):o.tokenReceived(k),n&&o.profileService.saveProfileToStorage(n),Promise.resolve(s)},this.exchangeIjt=function(e){var t=o.adobeIdData.ijt;return e||t?o.tokenService.exchangeIjt(e||t).then((function(e){return e.profile?o.profileService.saveProfileToStorage(e.profile):o.profileService.removeProfile(),Promise.resolve(e)})):Promise.reject(new Error("please set the adobeid.ijt value"))},this.adobeIdData=new L(e),t&&(this.instanceKey=t);var s=this.adobeIdData,a=s.api_parameters,c=void 0===a?{}:a,u=s.client_id,l=s.scope,d=s.useLocalStorage,h=s.autoValidateToken,g=s.modalMode,m=s.modalSettings;this.imsApis=new B(c),this.csrfService=new f(u,this.instanceKey),this.serviceRequest={clientId:u,scope:l,imsApis:this.imsApis},this.tokenService=new pe(r(r({},this.serviceRequest),{useLocalStorage:d,autoValidateToken:h}),this.csrfService),this.profileService=new Q(this.serviceRequest),this.signInservice=g?new R(this.onPopupMessage,m):new T}return Object.defineProperty(e.prototype,"version",{get:function(){return m.jslibver},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"adobeid",{get:function(){return r({},this.adobeIdData)},enumerable:!0,configurable:!0}),e.prototype.enableLogging=function(){p.enableLogging()},e.prototype.disableLogging=function(){p.disableLogging()},e.prototype.checkInitialized=function(){this.initialized},e.prototype.signUp=function(e,t){var r=this;void 0===e&&(e={}),this.checkInitialized();var o=this.adobeIdData,n=this.csrfService;if(!o)throw new Error("no adobeId on reAuthenticate");var i=n.initialize();return o.createSignUpRedirectRequest(e,t,i).then((function(e){r.signInservice.signIn(e)}))},e.prototype.isSignedInUser=function(){var e=this.getAccessToken();return(!e||!e.isGuestToken)&&!(!e&&!this.getReauthAccessToken())},e.prototype.getProfile=function(){var e=this,t=this.profileService.getProfileFromStorage();if(t)return Promise.resolve(t);var r=this.getAccessToken()||this.getReauthAccessToken();if(!r){var o="please login before getting the profile";return Promise.reject(new W(o))}if(r.isGuestToken){o="guest account does not have a profile";return Promise.reject(new W(o))}return this.profileService.getProfile(r.token).then((function(e){return Promise.resolve(e)})).catch((function(t){return p.error("get profile exception ",t),t instanceof q?e.refreshToken().then((function(e){return Promise.resolve(e.profile)})):Promise.reject(new W(t.message||t))}))},e.prototype.avatarUrl=function(e){return this.imsApis.avatarUrl(e)},e.prototype.getReleaseFlags=function(e){return void 0===e&&(e=!1),e?this.tokenService.getDecodedReleaseFlags():this.tokenService.getReleaseFlags()},e.prototype.getAccessToken=function(){return this.getTokenFromStorage(!1)},e.prototype.getReauthAccessToken=function(){return this.getTokenFromStorage(!0)},e.prototype.getTokenFromStorage=function(e){var t=this.tokenService.getTokenFieldsFromStorage(e);return t?{token:t.tokenValue,expire:t.expire,sid:t.sid,impersonatorId:t.impersonatorId,isImpersonatedSession:t.isImpersonatedSession,pbaSatisfiedPolicies:t.pbaSatisfiedPolicies,isGuestToken:t.isGuestToken,gse:t.gse}:null},e.prototype.listSocialProviders=function(){var e=this;return new Promise((function(t,r){var o=e.adobeIdData.client_id;e.imsApis.listSocialProviders({client_id:o}).then((function(e){t(e)})).catch((function(e){r(e)}))}))},e.prototype.tokenReceived=function(e){this.adobeIdData.handlers.triggerOnAccessToken(e),fe.startAutoRefreshFlow({expire:e.expire,refreshTokenMethod:this.refreshToken})},e.prototype.onTokenProfileReceived=function(e){var t=e.tokenInfo,r=e.profile;return p.info("token",t),this.tokenReceived(t),this.profileService.saveProfileToStorage(r),Promise.resolve(e)},e.prototype.validateToken=function(){var e=this;return this.tokenService.validateToken().then((function(){return Promise.resolve(!0)})).catch((function(t){return p.warn("validate token exception",t),t instanceof q?Promise.reject(!1):(e.profileService.removeProfile(),Promise.reject(!1))}))},e.prototype.onTokenExpired=function(){var e=this.adobeIdData.handlers;this.tokenService.purge(),e.triggerOnAccessTokenHasExpired()},e.prototype.setStandAloneToken=function(e){return this.tokenService.setStandAloneToken(e)},e.prototype.initialize=function(){var e,t=this,r=this.adobeIdData,o=r.handlers,n=r.standalone,i=r.ijt,s=r.alwaysRemoveTokenFromUrl,a=r.enableGuestAccounts,c=r.enableGuestTokenForceRefresh,u=null;switch(n&&this.setStandAloneToken(n),!0){case!!i:e=this.exchangeIjt;break;case a:e=this.tokenService.getGuestToken.bind(this.tokenService,{},{enableGuestAccounts:a,enableGuestTokenForceRefresh:c});break;default:e=this.tokenService.getTokenAndProfile}return e().then(this.processTokenResponse,this.processError.apply(this)).then((function(e){u=e})).finally((function(){p.info("onReady initialization"),window.addEventListener("getImsLibInstance",(function(){t.triggerOnImsInstance(t)}),!1),s&&v.setHash(te.removeAccessToken()),o.triggerOnReady(u?u.context:null),t.triggerOnImsInstance(t),t.initialized=!0}))},e.prototype.processError=function(){var e=this;return function(t){return e.verifyModalSignInEvent(t).catch(e.processInitializeException).catch(e.verifyTokenExpiredException).catch(e.verifyRideErrorException).catch(e.verifyCsrfException).catch(e.executeErrorCallback)}},e.prototype.notifyParentAboutModalSignIn=function(e){var t=window.location.href.replace("imslibmodal","wasmodal");if(window.opener)window.opener.postMessage(t,window.location.origin),window.close();else{var r=new BroadcastChannel("imslib");r.postMessage(t),r.close(),window.close()}return Promise.reject("popup")},e.prototype.restoreHash=function(){var e=te.fragmentToObject();e&&e.from_ims&&v.setHash(e.old_hash||"")},e.prototype.getTransitoryAuthorizationCode=function(e,t){return void 0===t&&(t={}),(e=e||{}).response_type=e.response_type||"code",e.target_client_id=e.target_client_id||this.adobeIdData.client_id,e.target_scope=e.target_scope||this.adobeIdData.scope,this.imsApis.getTransitoryAuthorizationCode(e,t,this.adobeIdData.client_id)},e.prototype.jumpToken=function(e,t){return void 0===t&&(t={}),e.target_client_id=e.target_client_id||this.adobeIdData.client_id,e.target_scope=e.target_scope||this.adobeIdData.scope,this.imsApis.jumpToken(e,t,this.adobeIdData.client_id)},e.prototype.getVerifierByKey=function(e){return(new M).getVerifierByKey(e)},e.prototype.socialHeadlessSignIn=function(e,t){return void 0===t&&(t={}),n(this,void 0,Promise,(function(){var r=this;return i(this,(function(o){return[2,this.imsApis.socialHeadlessSignIn(e,t).then((function(e){return r.exchangeIjt(e.token)})).catch((function(t){return"ride_AdobeID_social"===t.error&&r.signIn({idp_flow:"social.native",provider_id:e.provider_id,idp_token:e.idp_token}),Promise.reject(t)}))]}))}))},e.prototype.getAccountType=function(){var e=this.getAccessToken();if(!e)throw new Error("please login before getting the account type");if(e.isGuestToken)return oe.GUEST;var t=this.profileService.getProfileFromStorage();if(!t)throw new Error("you need to first get the profile before getting the account type");return t.account_type},e.prototype.getSessionExpiration=function(){var e=this.getAccessToken();if(!e)throw new Error("please obtain a token before getting the session expiration");return e.gse},e}(),ge=new(function(){function e(){this.createIMSLib=function(e,t){void 0===e&&(e=null),void 0===t&&(t="adobeIMS");var r=new ve(e,t);return window[t]=r,r}}return e.prototype.initAdobeIms=function(){window.adobeImsFactory={createIMSLib:this.createIMSLib};var e=window.adobeIMS||null;if(!e){var t=window.adobeid;if(!t||!t.client_id)return;(e=this.createIMSLib(t,"adobeIMS")).initialize()}},e}());return new(function(){function e(){ge.initAdobeIms()}return e.prototype.initialize=function(){return!0},e}())}(); From 8c2b08c06493acdf87d9f1a9a65ef6d96f16b6de Mon Sep 17 00:00:00 2001 From: Okan Sahin <39759830+mokimo@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:58:08 +0200 Subject: [PATCH 06/10] Revert "[MWPW-154795] Style Feds Global-footer region picker drop-up variant (without hash)" (#2611) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "[MWPW-154795] Style Feds Global-footer region picker drop-up variant …" This reverts commit cebd090016b85667d57f175d7b70fb0895d12c31. --- libs/blocks/global-footer/global-footer.css | 45 ++------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/libs/blocks/global-footer/global-footer.css b/libs/blocks/global-footer/global-footer.css index 797cebf833..1a240cf2c0 100644 --- a/libs/blocks/global-footer/global-footer.css +++ b/libs/blocks/global-footer/global-footer.css @@ -142,13 +142,12 @@ left: 0; display: none; padding: 20px; - min-width: 165px; + min-width: 130px; max-height: 300px; overflow-y: auto; background: var(--feds-background-nav--light); - border: 1px solid var(--color-gray-300); + border: 1px solid var(--feds-color-border--light); border-radius: 4px; - box-sizing: border-box; } [dir = "rtl"] .feds-regionPicker-wrapper > .fragment { @@ -191,8 +190,7 @@ } .feds-regionPicker-wrapper > .fragment a:hover { - color: var(--color-gray-500); - background: none; + background: var(--feds-background-link--hover--light); } /* Social */ @@ -313,40 +311,3 @@ margin: 0; } } - -.footer-region-button.inline-dialog-active + .fragment p, -.feds-regionPicker + .fragment p { - font-size: var(--type-detail-l-size); - margin-top: 20px; - margin-bottom: 0; -} - -.footer-region-button.inline-dialog-active + .fragment p:first-child, -.feds-regionPicker + .fragment p:first-child { - margin-top: 0; -} - -.feds-regionPicker-wrapper > .fragment a { - line-height: 1; - padding: 0; - color: var(--color-gray-700); -} - -.footer-region-button.inline-dialog-active + .fragment p strong > a, -.feds-regionPicker + .fragment p strong > a { - display: flex; - align-items: center; - justify-content: space-between; -} - -.footer-region-button.inline-dialog-active + .fragment p strong > a::after, -.feds-regionPicker-wrapper > .fragment p strong > a::after { - content: ' '; - display: block; - margin: 0 2px; - width: 6px; - height: 16px; - border: solid var(--color-info-accent); - border-width: 0 1px 1px 0; - transform: rotate(45deg); -} From 2c5b9a4ededc7d7cf5be98a00104b15e4c21391e Mon Sep 17 00:00:00 2001 From: Mira Fedas <30750556+mirafedas@users.noreply.github.com> Date: Tue, 23 Jul 2024 18:12:29 +0200 Subject: [PATCH 07/10] MWPW-154026: Long CTAs fall in the second line in merch card footer (#2565) * updated merch-card with no height set for secure transaction * updated merch-card dep * updated with mas main --- libs/deps/merch-card.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/deps/merch-card.js b/libs/deps/merch-card.js index c2faecc668..a09ba60b33 100644 --- a/libs/deps/merch-card.js +++ b/libs/deps/merch-card.js @@ -1,4 +1,4 @@ -// branch: main commit: 6912c83356744bd0c794c11c70bc1bf0dc95bfdf Tue, 16 Jul 2024 10:10:30 GMT +// branch: main commit: dcc9d0f85a22e50d7f04145197bd535349471347 Tue, 23 Jul 2024 14:43:25 GMT import{html as o,LitElement as te,nothing as re}from"/libs/deps/lit-all.min.js";import{LitElement as Y,html as M,css as Q}from"/libs/deps/lit-all.min.js";var h=class extends Y{static properties={size:{type:String,attribute:!0},src:{type:String,attribute:!0},alt:{type:String,attribute:!0},href:{type:String,attribute:!0}};constructor(){super(),this.size="m",this.alt=""}render(){let{href:e}=this;return e?M` ${this.alt} `:M` ${this.alt}`}static styles=Q` @@ -225,7 +225,6 @@ import{html as o,LitElement as te,nothing as re}from"/libs/deps/lit-all.min.js"; gap: var(--consonant-merch-spacing-xxs); align-items: center; flex: 1; - height: 100%; line-height: normal; } @@ -1641,4 +1640,4 @@ body.merch-modal {
${this.defaultSlot} `}connectedCallback(){super.connectedCallback(),this.#e=this.getContainer(),this.setAttribute("tabindex",this.getAttribute("tabindex")??"0"),this.addEventListener("keydown",this.keydownHandler),this.addEventListener("mouseleave",this.toggleActionMenu),this.addEventListener($,this.handleQuantitySelection),this.addEventListener(O,this.merchCardReady,{once:!0}),this.updateComplete.then(()=>{this.merchCardReady()}),this.storageOptions?.addEventListener("change",this.handleStorageChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.keydownHandler),this.removeEventListener($,this.handleQuantitySelection),this.storageOptions?.removeEventListener(z,this.handleStorageChange)}appendInvisibleSpacesToFooterLinks(){[...this.querySelectorAll('[slot="footer"] a')].forEach(e=>{P(e).forEach(r=>{let i=r.textContent.split(" ").map(x=>x.match(/.{1,7}/g)?.join("\u200B")).join(" ");r.textContent=i})})}keydownHandler(e){let t=document.activeElement?.closest(p);if(!t)return;function r(E,S){let w=document.elementFromPoint(E,S)?.closest(p);w&&(t.selected=!1,e.preventDefault(),e.stopImmediatePropagation(),w.focus(),w.selected=!0,w.scrollIntoView({behavior:"smooth",block:"center"}))}let{x:n,y:a,width:i,height:x}=t.getBoundingClientRect(),u=64,{code:_}=e;if(_==="Tab"){let E=Array.from(this.querySelectorAll('a[href], button:not([disabled]), textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select')),S=E[0],w=E[E.length-1];(!e.shiftKey&&document.activeElement===w||e.shiftKey&&document.activeElement===S)&&(e.preventDefault(),e.stopImmediatePropagation())}else switch(_){case j:r(n-u,a);break;case F:r(n+i+u,a);break;case U:r(n,a-u);break;case V:r(n,a+x+u);break;case W:if(this.variant==="twp")return;this.footerSlot?.querySelector("a")?.click();break}}updateMiniCompareElementMinHeight(e,t){let r=`--consonant-merch-card-mini-compare-${t}-height`,n=Math.max(0,parseInt(window.getComputedStyle(e).height)||0),a=parseInt(this.#e.style.getPropertyValue(r))||0;n>a&&this.#e.style.setProperty(r,`${n}px`)}async adjustTitleWidth(){if(!["segment","plans"].includes(this.variant))return;let e=this.getBoundingClientRect().width,t=this.badgeElement?.getBoundingClientRect().width||0;e===0||t===0||this.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(e-t-16)}px`)}async adjustMiniCompareBodySlots(){if(this.variant!==R||this.getBoundingClientRect().width===0)return;this.updateMiniCompareElementMinHeight(this.shadowRoot.querySelector(".top-section"),"top-section"),["heading-m","body-m","heading-m-price","price-commitment","offers","promo-text","secure-transaction-label"].forEach(r=>this.updateMiniCompareElementMinHeight(this.shadowRoot.querySelector(`slot[name="${r}"]`),r)),this.updateMiniCompareElementMinHeight(this.shadowRoot.querySelector("footer"),"footer");let t=this.shadowRoot.querySelector(".mini-compare-chart-badge");t&&t.textContent!==""&&this.#e.style.setProperty("--consonant-merch-card-mini-compare-top-section-mobile-height","32px")}adjustMiniCompareFooterRows(){if(this.variant!==R||this.getBoundingClientRect().width===0)return;[...this.querySelector('[slot="footer-rows"]').children].forEach((t,r)=>{let n=Math.max(ne,parseInt(window.getComputedStyle(t).height)||0),a=parseInt(this.#e.style.getPropertyValue(K(r+1)))||0;n>a&&this.#e.style.setProperty(K(r+1),`${n}px`)})}get storageOptions(){return this.querySelector("sp-radio-group#storage")}get storageSpecificOfferSelect(){let e=this.storageOptions?.selected;if(e){let t=this.querySelector(`merch-offer-select[storage="${e}"]`);if(t)return t}return this.querySelector("merch-offer-select")}get offerSelect(){return this.storageOptions?this.storageSpecificOfferSelect:this.querySelector("merch-offer-select")}get quantitySelect(){return this.querySelector("merch-quantity-select")}merchCardReady(){this.offerSelect&&!this.offerSelect.planType||this.dispatchEvent(new CustomEvent(N,{bubbles:!0}))}handleStorageChange(){let e=this.closest("merch-card")?.offerSelect.cloneNode(!0);e&&this.dispatchEvent(new CustomEvent(z,{detail:{offerSelect:e},bubbles:!0}))}get dynamicPrice(){return this.querySelector('[slot="price"]')}selectMerchOffer(e){if(e===this.merchOffer)return;this.merchOffer=e;let t=this.dynamicPrice;if(e.price&&t){let r=e.price.cloneNode(!0);t.onceSettled?t.onceSettled().then(()=>{t.replaceWith(r)}):t.replaceWith(r)}}};customElements.define(f,l); -//# sourceMappingURL=merch-card.js.map \ No newline at end of file +//# sourceMappingURL=merch-card.js.map From d739e72d56ec76581c749d25092a81360fef53fe Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Tue, 23 Jul 2024 20:16:04 +0200 Subject: [PATCH 08/10] MWPW-153808: fix duplicate tax label (#2614) * bump commerce * MWPW-153808: fix duplicate tax labels --- libs/deps/commerce.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/deps/commerce.js b/libs/deps/commerce.js index 7cd000e2c5..c3a2dc1903 100644 --- a/libs/deps/commerce.js +++ b/libs/deps/commerce.js @@ -1,5 +1,6 @@ -// branch: main commit: 6912c83356744bd0c794c11c70bc1bf0dc95bfdf Tue, 16 Jul 2024 15:13:51 GMT +// branch: main commit: c9d55dcfbb025978f8378c6aad1a2d2a773bbdd3 Tue, 23 Jul 2024 17:39:22 GMT var kr=Object.defineProperty;var ui=(e,t,r)=>t in e?kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var li=(e,t)=>{for(var r in t)kr(e,r,{get:t[r],enumerable:!0})};var ne=(e,t,r)=>(ui(e,typeof t!="symbol"?t+"":t,r),r),Gr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var Lt=(e,t,r)=>(Gr(e,t,"read from private field"),r?r.call(e):t.get(e)),Fr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Nt=(e,t,r,n)=>(Gr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Ie;(function(e){e.ServerError="ServerError",e.ClientError="ClientError",e.UnexpectedError="UnexpectedError"})(Ie||(Ie={}));var Vr=(e,t,r)=>({type:(i=>i>=500?Ie.ServerError:i<400?Ie.UnexpectedError:Ie.ClientError)(e),message:t,originatingRequest:r,status:e});var fi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Be;(function(e){e.AUTHORIZATION="Authorization",e.X_API_KEY="X-Api-Key"})(Be||(Be={}));var Ct=class{constructor(t){this.fetchOptions=t}commonHeaders(){let t={};return this.fetchOptions.apiKey&&(t[Be.X_API_KEY]=this.fetchOptions.apiKey),this.fetchOptions.accessToken&&(t[Be.AUTHORIZATION]=`Bearer ${this.fetchOptions.accessToken}`),t}transformData(t,r){return r?t.map(n=>r(n)):t.map(n=>this.identifyTransform(n))}transformDatum(t,r){return r?r(t):this.identifyTransform(t)}identifyTransform(t){return t}failOnBadStatusOrParseBody(t,r){return fi(this,void 0,void 0,function*(){if(t.ok)return t.json().then(i=>({headers:t.headers,status:t.status,statusText:t.statusText,data:i}));let n=yield t.text();return Promise.reject(Vr(t.status,n,r))})}buildUrl(t,r,n,i,o){var s;let a=(s=this.fetchOptions.baseUrl)!==null&&s!==void 0?s:i(this.fetchOptions.env),c=o(r,n);return this.generateUrl(a,t,c)}generateUrl(t,r,n){let i=new URL(r,t);return n&&(i.search=this.convertToSearchParams(n).toString()),i.toString()}convertToSearchParams(t){return new URLSearchParams(t)}setParams(t,r,n){n!=null&&typeof n=="boolean"?t[r]=String(n):n&&(t[r]=n)}},It=Ct;var Y;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(Y||(Y={}));var Re;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(Re||(Re={}));var G;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(G||(G={}));var fe;(function(e){e.V2="UCv2",e.V3="UCv3"})(fe||(fe={}));var $;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})($||($={}));var Rt=function(e){var t;return(t=pi.get(e))!==null&&t!==void 0?t:e},pi=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var jr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o};function ve(e,t,r){var n,i;try{for(var o=jr(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=Wr(s.value,2),c=a[0],l=a[1],u=Rt(c);l!=null&&r.has(u)&&t.set(u,l)}}catch(p){n={error:p}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}function Ye(e){switch(e){case Y.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function $e(e,t){var r,n;for(var i in e){var o=e[i];try{for(var s=(r=void 0,jr(Object.entries(o))),a=s.next();!a.done;a=s.next()){var c=Wr(a.value,2),l=c[0],u=c[1];if(u!=null){var p=Rt(l);t.set("items["+i+"]["+p+"]",u)}}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}var mi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Hr(e){gi(e);var t=e.env,r=e.items,n=e.workflowStep,i=mi(e,["env","items","workflowStep"]),o=new URL(Ye(t));return o.pathname=n+"/",$e(r,o.searchParams),ve(i,o.searchParams,di),o.toString()}var di=new Set(["cli","co","lang","ctx","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","code","campaignid","appctxid"]),Ei=["env","workflowStep","clientId","country","items"];function gi(e){var t,r;try{for(var n=hi(Ei),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!0}var xi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_i="p_draft_landscape",vi="/store/";function Dt(e){bi(e);var t=e.env,r=e.items,n=e.workflowStep,i=e.ms,o=e.marketSegment,s=e.ot,a=e.offerType,c=e.pa,l=e.productArrangementCode,u=e.landscape,p=xi(e,["env","items","workflowStep","ms","marketSegment","ot","offerType","pa","productArrangementCode","landscape"]),f={marketSegment:o??i,offerType:a??s,productArrangementCode:l??c},d=new URL(Ye(t));return d.pathname=""+vi+n,n!==$.SEGMENTATION&&n!==$.CHANGE_PLAN_TEAM_PLANS&&$e(r,d.searchParams),n===$.SEGMENTATION&&ve(f,d.searchParams,Ut),ve(p,d.searchParams,Ut),u===G.DRAFT&&ve({af:_i},d.searchParams,Ut),d.toString()}var Ut=new Set(["af","ai","apc","appctxid","cli","co","csm","ctx","ctxRtUrl","DCWATC","dp","fr","gsp","ijt","lang","lo","mal","ms","mv","mv2","nglwfdata","ot","otac","pa","pcid","promoid","q","rf","sc","scl","sdid","sid","spint","svar","th","thm","trackingid","usid","workflowid","context.guid","so.ca","so.su","so.tr","so.va"]),Ti=["env","workflowStep","clientId","country"];function bi(e){var t,r;try{for(var n=yi(Ti),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(e.workflowStep!==$.SEGMENTATION&&e.workflowStep!==$.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function Mt(e,t){switch(e){case fe.V2:return Hr(t);case fe.V3:return Dt(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Dt(t)}}var kt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(kt||(kt={}));var I;(function(e){e.MONTH="MONTH",e.YEAR="YEAR",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.PERPETUAL="PERPETUAL",e.TERM_LICENSE="TERM_LICENSE",e.ACCESS_PASS="ACCESS_PASS",e.THREE_MONTHS="THREE_MONTHS",e.SIX_MONTHS="SIX_MONTHS"})(I||(I={}));var L;(function(e){e.ANNUAL="ANNUAL",e.MONTHLY="MONTHLY",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.P1D="P1D",e.P1Y="P1Y",e.P3Y="P3Y",e.P10Y="P10Y",e.P15Y="P15Y",e.P3D="P3D",e.P7D="P7D",e.P30D="P30D",e.HALF_YEARLY="HALF_YEARLY",e.QUARTERLY="QUARTERLY"})(L||(L={}));var Gt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Gt||(Gt={}));var Ft;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ft||(Ft={}));var Vt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Vt||(Vt={}));var jt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(jt||(jt={}));var Wt=()=>{};Wt.createContext=Wt;var Si=G.PUBLISHED,Xr=e=>{switch(e){case Y.PRODUCTION:return"https://wcs.adobe.io";case Y.STAGE:return"https://wcs-stage.adobe.io";case Y.LOCAL:return"http://localhost:3002";default:return"https://wcs-stage.adobe.io"}},Br=(e,t)=>{var r;return e.api_key=t.apiKey,e.landscape=(r=t.landscape)!==null&&r!==void 0?r:Si,e};var Pi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Ht=class extends It{constructor(t){super(t),this.apiPaths={getWebCommerceArtifact:"web_commerce_artifact"},this.getWebCommerceArtifact=(r,n,i,o)=>Pi(this,void 0,void 0,function*(){let s=this.buildUrl(this.apiPaths.getWebCommerceArtifact,n,r,a=>Xr(a),(a,c)=>this.evaluateGetWebCommerceArtifactParams(a,c));return this.fetchOptions.fetch(s,{signal:o,headers:Object.assign({},this.commonHeaders()),mode:"cors"}).then(a=>this.failOnBadStatusOrParseBody(a,`GET ${s}`)).then(a=>{let l=a.data;return{data:this.transformDatum(l,i)}})})}evaluateGetWebCommerceArtifactParams(t,r){let n={};return this.setParams(n,"offer_selector_ids",r.offerSelectorIds.join(",")),this.setParams(n,"country",r.country),this.setParams(n,"language",r.language),this.setParams(n,"currency",r.currency),this.setParams(n,"locale",r.locale),this.setParams(n,"promotion_code",r.promotionCode),Br(n,t)}},Yr=Ht;var qe=e=>new Yr(e).getWebCommerceArtifact;var $r="tacocat.js";var ze=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),qr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function w(e,t={},{metadata:r=!0,search:n=!0,storage:i=!0}={}){let o;if(n&&o==null){let s=new URLSearchParams(window.location.search),a=Te(n)?n:e;o=s.get(a)}if(i&&o==null){let s=Te(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=Qr(Te(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var be=()=>{};var zr=e=>typeof e=="boolean",ce=e=>typeof e=="function",Ze=e=>typeof e=="number",Zr=e=>e!=null&&typeof e=="object";var Te=e=>typeof e=="string",Xt=e=>Te(e)&&e,Se=e=>Ze(e)&&Number.isFinite(e)&&e>0;function Pe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function v(e,t){if(zr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function ie(e,t,r){let n=Object.values(t);return n.find(i=>ze(i,e))??r??n[0]}function Qr(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function Ae(e,t=1){return Ze(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Ai=Date.now(),Bt=()=>`(+${Date.now()-Ai}ms)`,Qe=new Set,wi=v(w("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Jr(e){let t=`[${$r}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=wi?(s,...a)=>{console.debug(`${t} ${s}`,...a,Bt())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([l])=>l(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([,l])=>l(c,...a))}}}function Oi(e,t){let r=[e,t];return Qe.add(r),()=>{Qe.delete(r)}}Oi((e,...t)=>{console.error(e,...t,Bt())},(e,...t)=>{console.warn(e,...t,Bt())});var Li="no promo",Kr="promo-tag",Ni="yellow",Ci="neutral",Ii=(e,t,r)=>{let n=o=>o||Li,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},Ri="cancel-context",Ue=(e,t)=>{let r=e===Ri,n=!r&&e?.length>0,i=(n||r)&&(t&&t!=e||!t&&!r),o=i&&n||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Kr:`${Kr} no-promo`,text:Ii(s,t,i),variant:o?Ni:Ci,isOverriden:i}};var Yt=function(e,t){return Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Yt(e,t)};function De(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Mi,function(a,c,l,u,p,f){if(c)t.minimumIntegerDigits=l.length;else{if(u&&p)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(ln.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(on.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(on,function(a,c,l,u,p,f){return l==="*"?t.minimumFractionDigits=c.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""}),i.options.length&&(t=T(T({},t),sn(i.options[0])));continue}if(un.test(i.stem)){t=T(T({},t),sn(i.stem));continue}var o=fn(i.stem);o&&(t=T(T({},t),o));var s=ki(i.stem);s&&(t=T(T({},t),s))}return t}var zt,Gi=new RegExp("^"+qt.source+"*"),Fi=new RegExp(qt.source+"*$");function x(e,t){return{start:e,end:t}}var Vi=!!String.prototype.startsWith,ji=!!String.fromCodePoint,Wi=!!Object.fromEntries,Hi=!!String.prototype.codePointAt,Xi=!!String.prototype.trimStart,Bi=!!String.prototype.trimEnd,Yi=!!Number.isSafeInteger,$i=Yi?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Qt=!0;try{mn=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Qt=((zt=mn.exec("a"))===null||zt===void 0?void 0:zt[0])==="a"}catch{Qt=!1}var mn,hn=Vi?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Jt=ji?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},dn=Wi?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},qi=Xi?function(t){return t.trimStart()}:function(t){return t.replace(Gi,"")},zi=Bi?function(t){return t.trimEnd()}:function(t){return t.replace(Fi,"")};function gn(e,t){return new RegExp(e,t)}var Kt;Qt?(Zt=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Kt=function(t,r){var n;Zt.lastIndex=r;var i=Zt.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Kt=function(t,r){for(var n=[];;){var i=En(t,r);if(i===void 0||yn(i)||Ji(i))break;n.push(i),r+=i>=65536?2:1}return Jt.apply(void 0,n)};var Zt,xn=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:A.pound,location:x(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(g.UNMATCHED_CLOSING_TAG,x(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&er(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:A.literal,value:"<"+i+"/>",location:x(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:A.tag,value:i,children:s,location:x(n,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,x(a,this.clonePosition())))}else return this.error(g.UNCLOSED_TAG,x(n,this.clonePosition()))}else return this.error(g.INVALID_TAG,x(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Qi(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=x(n,this.clonePosition());return{val:{type:A.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Zi(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Jt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Jt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(g.EMPTY_ARGUMENT,x(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:A.argument,value:i,location:x(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Kt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=x(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,x(s,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=zi(p.val);if(f.length===0)return this.error(g.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));var d=x(u,this.clonePosition());l={style:f,styleLocation:d}}var h=this.tryParseArgumentClose(i);if(h.err)return h;var E=x(i,this.clonePosition());if(l&&hn(l?.style,"::",0)){var S=qi(l.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(S,l.styleLocation);return p.err?p:{val:{type:A.number,value:n,location:E,style:p.val},err:null}}else{if(S.length===0)return this.error(g.EXPECT_DATE_TIME_SKELETON,E);var f={type:pe.dateTime,pattern:S,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?rn(S):{}},N=a==="date"?A.date:A.time;return{val:{type:N,value:n,location:E,style:f},err:null}}}return{val:{type:a==="number"?A.number:a==="date"?A.date:A.time,value:n,location:E,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var P=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,x(P,T({},P)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),O=0;if(a!=="select"&&b.value==="offset"){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),b=this.parseIdentifierIfPossible(),O=p.val}var y=this.tryParsePluralOrSelectOptions(t,a,r,b);if(y.err)return y;var h=this.tryParseArgumentClose(i);if(h.err)return h;var C=x(i,this.clonePosition());return a==="select"?{val:{type:A.select,value:n,options:dn(y.val),location:C},err:null}:{val:{type:A.plural,value:n,options:dn(y.val),offset:O,pluralType:a==="plural"?"cardinal":"ordinal",location:C},err:null}}default:return this.error(g.INVALID_ARGUMENT_TYPE,x(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,x(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=cn(t)}catch{return this.error(g.INVALID_NUMBER_SKELETON,r)}return{val:{type:pe.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?pn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,l=i.value,u=i.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR,g.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=x(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?g.DUPLICATE_SELECT_ARGUMENT_SELECTOR:g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(s=!0),this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,x(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(t+1,r,n);if(h.err)return h;var E=this.tryParseArgumentClose(d);if(E.err)return E;a.push([l,{value:h.val,location:x(d,this.clonePosition())}]),c.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,u=o.location}return a.length===0?this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR:g.EXPECT_PLURAL_ARGUMENT_SELECTOR,x(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(g.MISSING_OTHER_CLAUSE,x(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=x(i,this.clonePosition());return o?(s*=n,$i(s)?{val:s,err:null}:this.error(r,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=En(this.message,t);if(r===void 0)throw Error("Offset "+t+" is at invalid UTF-16 code unit boundary");return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(hn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&yn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function er(e){return e>=97&&e<=122||e>=65&&e<=90}function Zi(e){return er(e)||e===47}function Qi(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function yn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ji(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function tr(e){e.forEach(function(t){if(delete t.location,rt(t)||nt(t))for(var r in t.options)delete t.options[r].location,tr(t.options[r].value);else Ke(t)&&ot(t.style)||(et(t)||tt(t))&&Me(t.style)?delete t.style.location:it(t)&&tr(t.children)})}function _n(e,t){t===void 0&&(t={}),t=T({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new xn(e,t).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||tr(r.val),r.val}function ke(e,t){var r=t&&t.cache?t.cache:io,n=t&&t.serializer?t.serializer:no,i=t&&t.strategy?t.strategy:eo;return i(e,{cache:r,serializer:n})}function Ki(e){return e==null||typeof e=="number"||typeof e=="boolean"}function vn(e,t,r,n){var i=Ki(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function Tn(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function rr(e,t,r,n,i){return r.bind(t,e,n,i)}function eo(e,t){var r=e.length===1?vn:Tn;return rr(e,this,r,t.cache.create(),t.serializer)}function to(e,t){return rr(e,this,Tn,t.cache.create(),t.serializer)}function ro(e,t){return rr(e,this,vn,t.cache.create(),t.serializer)}var no=function(){return JSON.stringify(arguments)};function nr(){this.cache=Object.create(null)}nr.prototype.get=function(e){return this.cache[e]};nr.prototype.set=function(e,t){this.cache[e]=t};var io={create:function(){return new nr}},st={variadic:to,monadic:ro};var me;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(me||(me={}));var Ge=function(e){De(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var ir=function(e){De(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'+r+'": "'+n+'". Options are "'+Object.keys(i).join('", "')+'"',me.INVALID_VALUE,o)||this}return t}(Ge);var bn=function(e){De(t,e);function t(r,n,i){return e.call(this,'Value for "'+r+'" must be of type '+n,me.INVALID_VALUE,i)||this}return t}(Ge);var Sn=function(e){De(t,e);function t(r,n){return e.call(this,'The intl string context variable "'+r+'" was not provided to the string "'+n+'"',me.MISSING_VALUE,n)||this}return t}(Ge);var U;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(U||(U={}));function oo(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==U.literal||r.type!==U.literal?t.push(r):n.value+=r.value,t},[])}function so(e){return typeof e=="function"}function Fe(e,t,r,n,i,o,s){if(e.length===1&&$t(e[0]))return[{type:U.literal,value:e[0].value}];for(var a=[],c=0,l=e;c0?e.substring(0,n):"";let i=wn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(fo);return t.decimal=c&&c[c.length-1]||".",t.separator=c&&c[1]&&c[0]||",",c=t.mask.split(t.decimal),t.integer=c[0],t.fraction=c[1],t}function mo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,ho(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function ho(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),_o=[sr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),sr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),sr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ar={[I.YEAR]:{[L.MONTHLY]:Ve.MONTH,[L.ANNUAL]:Ve.YEAR},[I.MONTH]:{[L.MONTHLY]:Ve.MONTH}},vo=(e,t)=>e.indexOf(`'${t}'`)===0,To=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+So(e)),r},bo=e=>{let t=Po(e),r=vo(e,t),n=e.replace(/'.*?'/,""),i=Cn.test(n)||In.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},Rn=e=>e.replace(Cn,Nn).replace(In,Nn),So=e=>e.match(/#(.?)#/)?.[1]===Ln?go:Ln,Po=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function at({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=bo(e),l=r?Un(e):"",u=To(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),d=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):On(u,f),h=r?d.lastIndexOf(l):d.length,E=d.substring(0,h),S=d.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,d).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:a,recurrenceTerm:i}}var Dn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=xo[r]??1;return at(e,i>1?Ve.MONTH:ar[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=_o.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(yo[s]??(u=>u))(c(a))})},Mn=({commitment:e,term:t,...r})=>at(r,ar[e]?.[t]),kn=e=>{let{commitment:t,term:r}=e;return t===I.YEAR&&r===L.MONTHLY?at(e,Ve.YEAR,n=>n*12):at(e,ar[t]?.[r])};var Ao={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},wo=Jr("ConsonantTemplates/price"),Oo=/<.+?>/g,W={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",disabled:"disabled",currencySpace:"price-currency-space",currencySymbol:"price-currency-symbol",decimals:"price-decimals",decimalsDelimiter:"price-decimals-delimiter",integer:"price-integer",recurrence:"price-recurrence",taxInclusivity:"price-tax-inclusivity",unitType:"price-unit-type"},he={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Lo="TAX_EXCLUSIVE",No=e=>Zr(e)?Object.entries(e).filter(([,t])=>Te(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+qr(n)+'"'}`,""):"",z=(e,t,r,n=!1)=>`${n?Rn(t):t??""}`;function Co(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=z(W.currencySymbol,r),d=z(W.currencySpace,o?" ":""),h="";return a&&(h+=f+d),h+=z(W.integer,s),h+=z(W.decimalsDelimiter,i),h+=z(W.decimals,n),a||(h+=d+f),h+=z(W.recurrence,c,null,!0),h+=z(W.unitType,l,null,!0),h+=z(W.taxInclusivity,u,!0),z(e,h,{...p,"aria-label":t})}var de=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1}={})=>({country:n,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:c,literals:l={}}={},{commitment:u,formatString:p,price:f,priceWithoutDiscount:d,taxDisplay:h,taxTerm:E,term:S,usePrecision:N}={},P={})=>{Object.entries({country:n,formatString:p,language:c,price:f}).forEach(([re,wt])=>{if(wt==null)throw new Error(`Argument "${re}" is missing`)});let b={...Ao,...l},O=`${c.toLowerCase()}-${n.toUpperCase()}`;function y(re,wt){let Ot=b[re];if(Ot==null)return"";try{return new An(Ot.replace(Oo,""),O).format(wt)}catch{return wo.error("Failed to format literal:",Ot),""}}let C=t&&d?d:f,M=e?Dn:Mn;r&&(M=kn);let{accessiblePrice:X,recurrenceTerm:B,...R}=M({commitment:u,formatString:p,term:S,price:e?f:C,usePrecision:N,isIndianPrice:n==="IN"}),j=X,ae="";if(v(o)&&B){let re=y(he.recurrenceAriaLabel,{recurrenceTerm:B});re&&(j+=" "+re),ae=y(he.recurrenceLabel,{recurrenceTerm:B})}let le="";if(v(s)){le=y(he.perUnitLabel,{perUnit:"LICENSE"});let re=y(he.perUnitAriaLabel,{perUnit:"LICENSE"});re&&(j+=" "+re)}let te="";v(a)&&E&&(te=y(h===Lo?he.taxExclusiveLabel:he.taxInclusiveLabel,{taxTerm:E}),te&&(j+=" "+te)),t&&(j=y(he.strikethroughAriaLabel,{strikethroughPrice:j}));let q=W.container;if(e&&(q+=" "+W.containerOptical),t&&(q+=" "+W.containerStrikethrough),r&&(q+=" "+W.containerAnnual),v(i))return Co(q,{...R,accessibleLabel:j,recurrenceLabel:ae,perUnitLabel:le,taxInclusivityLabel:te},P);let{currencySymbol:ye,decimals:He,decimalsDelimiter:Xe,hasCurrencySpace:Ce,integer:At,isCurrencyFirst:ai}=R,_e=[At,Xe,He];ai?(_e.unshift(Ce?"\xA0":""),_e.unshift(ye)):(_e.push(Ce?"\xA0":""),_e.push(ye)),_e.push(ae,le,te);let ci=_e.join("");return z(q,ci,P)},Gn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${de()(e,t,r)}${i?" "+de({displayStrikethrough:!0})(e,t,r):""}`};var cr=de(),ur=Gn(),lr=de({displayOptical:!0}),fr=de({displayStrikethrough:!0}),pr=de({displayAnnual:!0});var Io=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Fn=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=Io(n,i);return o===void 0?'':`${o}%`};var mr=Fn();var hr="ABM",dr="PUF",Er="M2M",gr="PERPETUAL",Vn="P3Y",Ro="TAX_INCLUSIVE_DETAILS",Uo="TAX_EXCLUSIVE",jn={ABM:hr,PUF:dr,M2M:Er,PERPETUAL:gr,P3Y:Vn},tc={[hr]:{commitment:I.YEAR,term:L.MONTHLY},[dr]:{commitment:I.YEAR,term:L.ANNUAL},[Er]:{commitment:I.MONTH,term:L.MONTHLY},[gr]:{commitment:I.PERPETUAL,term:void 0},[Vn]:{commitment:I.THREE_MONTHS,term:L.P3Y}},Wn="Value is not an offer",ct=e=>{if(typeof e!="object")return Wn;let{commitment:t,term:r}=e,n=Do(t,r);return{...e,planType:n}};var Do=(e,t)=>{if(e===void 0)return Wn;if(e===""&&t==="")return"";let r="";return e===I.YEAR?t===L.MONTHLY?r=hr:t===L.ANNUAL&&(r=dr):e===I.MONTH?t===L.MONTHLY&&(r=Er):e===I.PERPETUAL&&(r=gr),r};function xr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Ro)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Uo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:Ee}=Object,Z=Ee({...fe}),Q=Ee({...$}),H=Ee({...Y}),yr=Ee({...I}),we=Ee({...Re}),_r=Ee({...jn}),vr=Ee({...L});var Or={};li(Or,{CLASS_NAME_FAILED:()=>ut,CLASS_NAME_PENDING:()=>lt,CLASS_NAME_RESOLVED:()=>ft,ERROR_MESSAGE_BAD_REQUEST:()=>Tr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Sr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>br,EVENT_TYPE_ERROR:()=>Mo,EVENT_TYPE_FAILED:()=>pt,EVENT_TYPE_PENDING:()=>mt,EVENT_TYPE_READY:()=>ge,EVENT_TYPE_RESOLVED:()=>ht,LOG_NAMESPACE:()=>Pr,PARAM_AOS_API_KEY:()=>ko,PARAM_ENV:()=>Ar,PARAM_LANDSCAPE:()=>wr,PARAM_WCS_API_KEY:()=>Go,STATE_FAILED:()=>J,STATE_PENDING:()=>K,STATE_RESOLVED:()=>ee,TAG_NAME_SERVICE:()=>oe});var ut="placeholder-failed",lt="placeholder-pending",ft="placeholder-resolved",Tr="Bad WCS request",br="Commerce offer not found",Sr="Literals URL not provided",Mo="wcms:commerce:error",pt="wcms:placeholder:failed",mt="wcms:placeholder:pending",ge="wcms:commerce:ready",ht="wcms:placeholder:resolved",Pr="wcms/commerce",Ar="commerce.env",wr="commerce.landscape",ko="commerce.aosKey",Go="commerce.wcsKey",J="failed",K="pending",ee="resolved",oe="wcms-commerce";var Lr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Hn=new Set,Fo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Xn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Lr.serializableTypes.includes(r))return r}return e}function Vo(e,t){if(!Lr.ignoredProperties.includes(e))return Xn(t)}var Nr={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=Lr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(Fo(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Xn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,Vo)),Hn.has(c)||(Hn.add(c),window.lana?.log(c,{sampleRate:r,tags:n,clientId:i}))}};var _=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Z.V3,checkoutWorkflowStep:Q.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,domainSwitch:!1,env:H.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:we.PRODUCTION,landscape:G.PUBLISHED,wcsBufferLimit:1});function Bn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(oe);i!==r&&(r=i,i&&e(i))}return document.addEventListener(ge,n,{once:t}),ue(n),()=>document.removeEventListener(ge,n)}function je(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(xr)),i}var ue=e=>window.setTimeout(e);function Oe(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Ae).filter(Se);return r.length||(r=[t]),r}function dt(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Xt)}function F(){return window.customElements.get(oe)?.instance}var jo="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},se=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Yn({locale:e={}}={}){if(!e.prefix)return{country:_.country,language:_.language,locale:jo};let t=e.prefix.replace("/","")??"",[r=_.country,n=_.language]=(m[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function Cr(e={}){let{commerce:t={},locale:r=void 0}=e,i=(e.env?.name===se.PROD?se.PROD:ie(w(Ar,t,{metadata:!1}),se,se.PROD))===se.STAGE?H.STAGE:H.PRODUCTION,o=w("checkoutClientId",t)??_.checkoutClientId,s=ie(w("checkoutWorkflow",t),Z,_.checkoutWorkflow),a=Q.CHECKOUT;s===Z.V3&&(a=ie(w("checkoutWorkflowStep",t),Q,_.checkoutWorkflowStep));let c=v(w("displayOldPrice",t),_.displayOldPrice),l=v(w("displayPerUnit",t),_.displayPerUnit),u=v(w("displayRecurrence",t),_.displayRecurrence),p=v(w("displayTax",t),_.displayTax),f=v(w("entitlement",t),_.entitlement),d=v(w("modal",t),_.modal),h=v(w("forceTaxExclusive",t),_.forceTaxExclusive),E=w("promotionCode",t)??_.promotionCode,S=Oe(w("quantity",t)),N=w("wcsApiKey",t)??_.wcsApiKey,P=e.env?.name===se.PROD?G.PUBLISHED:ie(w(wr,t),G,_.landscape),b=Ae(w("wcsBufferDelay",t),_.wcsBufferDelay),O=Ae(w("wcsBufferLimit",t),_.wcsBufferLimit),y=v(w("domain.switch",t),!1);return{...Yn({locale:r}),displayOldPrice:c,checkoutClientId:o,checkoutWorkflow:s,checkoutWorkflowStep:a,displayPerUnit:l,displayRecurrence:u,displayTax:p,entitlement:f,extraOptions:_.extraOptions,modal:d,env:i,forceTaxExclusive:h,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:E,quantity:S,wcsApiKey:N,wcsBufferDelay:b,wcsBufferLimit:O,wcsEnv:i===H.STAGE?we.STAGE:we.PRODUCTION,landscape:P,domainSwitch:y}}var qn="debug",Wo="error",Ho="info",Xo="warn",Bo=Date.now(),Ir=new Set,Rr=new Set,$n=new Map,We=Object.freeze({DEBUG:qn,ERROR:Wo,INFO:Ho,WARN:Xo}),zn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},Zn={filter:({level:e})=>e!==qn},Yo={filter:()=>!1};function $o(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;ce(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Bo}}function qo(e){[...Rr].every(t=>t(e))&&Ir.forEach(t=>t(e))}function Qn(e){let t=($n.get(e)??0)+1;$n.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>qo($o(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Qn(`${i.namespace}/${o}`)},debug:n(We.DEBUG),error:n(We.ERROR),info:n(We.INFO),warn:n(We.WARN)});return i}function Et(...e){e.forEach(t=>{let{append:r,filter:n}=t;ce(n)?Rr.add(n):ce(r)&&Ir.add(r)})}function zo(e={}){let{name:t}=e,r=v(w("commerce.debug",{search:!0,storage:!0}),t===se.LOCAL);return Et(r?zn:Zn),t===se.PROD&&Et(Nr),D}function Zo(){Ir.clear(),Rr.clear()}var D={...Qn(Pr),Level:We,Plugins:{consoleAppender:zn,debugFilter:Zn,quietFilter:Yo,lanaAppender:Nr},init:zo,reset:Zo,use:Et};var Qo={CLASS_NAME_FAILED:ut,CLASS_NAME_PENDING:lt,CLASS_NAME_RESOLVED:ft,EVENT_TYPE_FAILED:pt,EVENT_TYPE_PENDING:mt,EVENT_TYPE_RESOLVED:ht,STATE_FAILED:J,STATE_PENDING:K,STATE_RESOLVED:ee},Jo={[J]:ut,[K]:lt,[ee]:ft},Ko={[J]:pt,[K]:mt,[ee]:ht},yt=new WeakMap;function V(e){if(!yt.has(e)){let t=D.module(e.constructor.is);yt.set(e,{changes:new Map,connected:!1,dispose:be,error:void 0,log:t,options:void 0,promises:[],state:K,timer:null,value:void 0,version:0})}return yt.get(e)}function gt(e){let t=V(e),{error:r,promises:n,state:i}=t;(i===ee||i===J)&&(t.promises=[],i===ee?n.forEach(({resolve:o})=>o(e)):i===J&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(Ko[i],{bubbles:!0}))}function xt(e){let t=yt.get(e);[J,K,ee].forEach(r=>{e.classList.toggle(Jo[r],r===t.state)})}var es={get error(){return V(this).error},get log(){return V(this).log},get options(){return V(this).options},get state(){return V(this).state},get value(){return V(this).value},attributeChangedCallback(e,t,r){V(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){V(this).dispose=Bn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=V(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=be},onceSettled(){let{error:e,promises:t,state:r}=V(this);return ee===r?Promise.resolve(this):J===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=ee,n.value=t,xt(this),this.log.debug("Resolved:",{element:this,value:t}),ue(()=>gt(this)),!0)},toggleFailed(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=J,xt(this),n.log.error("Failed:",{element:this,error:t}),ue(()=>gt(this)),!0)},togglePending(e){let t=V(this);return t.version++,e&&(t.options=e),t.state=K,xt(this),ue(()=>gt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!F())return;let t=V(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=K,t.timer=ue(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===K&&t.version===s&&(t.state=i,t.error=r,t.value=o,xt(this),gt(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Jn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function _t(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Jn(t)),i}function vt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(es)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Qo)),window.customElements.define(r,i,{extends:t})),i}function Tt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function bt(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Jn(t)),e):null}var ts="download",rs="upgrade",xe,Le=class Le extends HTMLAnchorElement{constructor(){super();Fr(this,xe,void 0);this.addEventListener("click",this.clickHandler)}static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-extra-options","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi","data-entitlement","data-upgrade","data-modal"]}static createCheckoutLink(r={},n=""){let i=F();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E}=i.collectCheckoutOptions(r),S=_t(Le,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E});return n&&(S.innerHTML=`${n}`),S}static getCheckoutLinks(r){return Tt(Le,r)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(r){var n;(n=Lt(this,xe))==null||n.call(this,r)}async render(r={}){if(!this.isConnected)return!1;let n=F();if(!n)return!1;this.dataset.imsCountry||n.imsCountryPromise.then(u=>{u&&(this.dataset.imsCountry=u)},be);let i=n.collectCheckoutOptions(r,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(u){this.placeholder.log.error("cannot parse exta checkout options",u)}let s=this.placeholder.togglePending(i);this.href="";let a=n.resolveOfferSelectors(i),c=await Promise.all(a);c=c.map(u=>je(u,i));let l=await n.buildCheckoutAction(c.flat(),{...o,...i});return this.renderOffers(c.flat(),i,{},l,s)}renderOffers(r,n,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=F();if(!a)return!1;if(n={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...n,...i},s??(s=this.placeholder.togglePending(n)),Lt(this,xe)&&Nt(this,xe,void 0),o){this.classList.remove(ts,rs),this.placeholder.toggleResolved(s,r,n);let{url:l,text:u,className:p,handler:f}=o;return l&&(this.href=l),u&&(this.firstElementChild.innerHTML=u),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),Nt(this,xe,f.bind(this))),!0}else if(r.length){if(this.placeholder.toggleResolved(s,r,n)){let l=a.buildCheckoutURL(r,n);return this.setAttribute("href",l),!0}}else{let l=new Error(`Not provided: ${n?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,l,n))return this.setAttribute("href","#"),!0}return!1}updateOptions(r={}){let n=F();if(!n)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}=n.collectCheckoutOptions(r);return bt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}),!0}};xe=new WeakMap,ne(Le,"is","checkout-link"),ne(Le,"tag","a");var Ur=Le,St=vt(Ur);var Kn=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],ns={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Ne=class Ne extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let r=F();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return _t(Ne,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return Tt(Ne,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,r,n,i){let o=`${t}_${r}`;if(Kn.includes(t)||Kn.includes(o))return!0;let s=ns[`${n}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,r){let[n]=await t.resolveOfferSelectors(r),i=je(await n,r);if(i?.length){let{country:o,language:s}=r,a=i[0],[c=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let r=F();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;this.placeholder.dataset.displayTax||(n.displayTax=await this.resolveDisplayTax(r,n)||!1);let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(je(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=F();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=F();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return bt(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};ne(Ne,"is","inline-price"),ne(Ne,"tag","span");var Dr=Ne,Pt=vt(Dr);function ei({providers:e,settings:t},r){let n=D.module("checkout");function i(l,u){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:d,country:h,language:E,promotionCode:S,quantity:N}=t,{checkoutMarketSegment:P,checkoutWorkflow:b=f,checkoutWorkflowStep:O=d,imsCountry:y,country:C=y??h,language:M=E,quantity:X=N,entitlement:B,upgrade:R,modal:j,perpetual:ae,promotionCode:le=S,wcsOsi:te,extraOptions:q,...ye}=Object.assign({},u?.dataset??{},l??{}),He=ie(b,Z,_.checkoutWorkflow),Xe=Q.CHECKOUT;He===Z.V3&&(Xe=ie(O,Q,_.checkoutWorkflowStep));let Ce=Pe({...ye,extraOptions:q,checkoutClientId:p,checkoutMarketSegment:P,country:C,quantity:Oe(X,_.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Xe,language:M,entitlement:v(B),upgrade:v(R),modal:v(j),perpetual:v(ae),promotionCode:Ue(le).effectivePromoCode,wcsOsi:dt(te)});if(u)for(let At of e.checkout)At(u,Ce);return Ce}async function o(l,u){let p=F(),f=await r.getCheckoutAction?.(l,u,p.imsSignedInPromise);return f||null}function s(l,u){if(!Array.isArray(l)||!l.length||!u)return"";let{env:p,landscape:f}=t,{checkoutClientId:d,checkoutMarketSegment:h,checkoutWorkflow:E,checkoutWorkflowStep:S,country:N,promotionCode:P,quantity:b,...O}=i(u),y=window.frameElement?"if":"fp",C={checkoutPromoCode:P,clientId:d,context:y,country:N,env:p,items:[],marketSegment:h,workflowStep:S,landscape:f,...O};if(l.length===1){let[{offerId:M,offerType:X,productArrangementCode:B}]=l,{marketSegments:[R]}=l[0];Object.assign(C,{marketSegment:R,offerType:X,productArrangementCode:B}),C.items.push(b[0]===1?{id:M}:{id:M,quantity:b[0]})}else C.items.push(...l.map(({offerId:M},X)=>({id:M,quantity:b[X]??_.quantity})));return Mt(E,C)}let{createCheckoutLink:a,getCheckoutLinks:c}=St;return{CheckoutLink:St,CheckoutWorkflow:Z,CheckoutWorkflowStep:Q,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:c}}function is({interval:e=200,maxAttempts:t=25}={}){let r=D.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function os(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function ss(e){let t=D.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function ti({}){let e=is(),t=os(e),r=ss(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}function as(e){if(!e.priceLiteralsURL)throw new Error(Sr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(r=>{r.json().then(({data:n})=>{t(n)})})})}async function ri(e){let r=await(e.priceLiteralsPromise||as(e));if(Array.isArray(r)){let n=o=>r.find(s=>ze(s.lang,o)),i=n(e.language)??n(_.language);if(i)return Object.freeze(i)}return{}}function ni({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:d,forceTaxExclusive:h,language:E,promotionCode:S,quantity:N}=r,{displayOldPrice:P=u,displayPerUnit:b=p,displayRecurrence:O=f,displayTax:y=d,forceTaxExclusive:C=h,country:M=l,language:X=E,perpetual:B,promotionCode:R=S,quantity:j=N,template:ae,wcsOsi:le,...te}=Object.assign({},c?.dataset??{},a??{}),q=Pe({...te,country:M,displayOldPrice:v(P),displayPerUnit:v(b),displayRecurrence:v(O),displayTax:v(y),forceTaxExclusive:v(C),language:X,perpetual:v(B),promotionCode:Ue(R).effectivePromoCode,quantity:Oe(j,_.quantity),template:ae,wcsOsi:dt(le)});if(c)for(let ye of t.price)ye(c,q);return q}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=mr;break;case"strikethrough":u=fr;break;case"optical":u=lr;break;case"annual":u=pr;break;default:u=c.promotionCode?ur:cr}let p=n(c);p.literals=Object.assign({},e.price,Pe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Pt;return{InlinePrice:Pt,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Mr="_acom",ii={[H.PRODUCTION]:"https://wcs.adobe.com",[H.STAGE]:"https://wcs.stage.adobe.com",[H.PRODUCTION+Mr]:"https://www.adobe.com",[H.STAGE+Mr]:"https://www.stage.adobe.com"};function oi({settings:e}){let t=D.module("wcs"),{env:r,domainSwitch:n,wcsApiKey:i}=e,o=n?ii[r+Mr]:ii[r],s={apiKey:i,baseUrl:o,fetch:window.fetch.bind(window)},a=qe(s),c=new Map,l=new Map,u;async function p(h,E,S=!0){let N=br;try{t.debug("Fetching:",h),h.offerSelectorIds=h.offerSelectorIds.sort();let{data:P}=await a(h,{apiKey:i,environment:e.wcsEnv,landscape:r===H.STAGE?"ALL":e.landscape},({resolvedOffers:O})=>({offers:O.map(ct)}));t.debug("Fetched:",h,P);let{offers:b}=P??{};E.forEach(({resolve:O},y)=>{let C=b.filter(({offerSelectorIds:M})=>M.includes(y)).flat();C.length&&(E.delete(y),O(C))})}catch(P){P.status===404&&h.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(h.offerSelectorIds.map(b=>p({...h,offerSelectorIds:[b]},E,!1)))):(t.error("Failed:",h,P),N=Tr)}S&&E.size&&(t.debug("Missing:",{offerSelectorIds:[...E.keys()]}),E.forEach(P=>{P.reject(new Error(N))}))}function f(){clearTimeout(u);let h=[...l.values()];l.clear(),h.forEach(({options:E,promises:S})=>p(E,S))}function d({country:h,language:E,perpetual:S=!1,promotionCode:N="",wcsOsi:P=[]}){let b=`${E}_${h}`;h!=="GB"&&(E=S?"EN":"MULT");let O=[h,E,N].filter(y=>y).join("-").toLowerCase();return P.map(y=>{let C=`${y}-${O}`;if(!c.has(C)){let M=new Promise((X,B)=>{let R=l.get(O);if(!R){let j={country:h,locale:b,offerSelectorIds:[]};h!=="GB"&&(j.language=E),R={options:j,promises:new Map},l.set(O,R)}N&&(R.options.promotionCode=N),R.options.offerSelectorIds.push(y),R.promises.set(y,{resolve:X,reject:B}),R.options.offerSelectorIds.length>=e.wcsBufferLimit?f():(t.debug("Queued:",R.options),u||(u=setTimeout(f,e.wcsBufferDelay)))});c.set(C,M)}return c.get(C)})}return{WcsCommitment:yr,WcsPlanType:_r,WcsTerm:vr,resolveOfferSelectors:d}}var k=class extends HTMLElement{get isWcmsCommerce(){return!0}};ne(k,"instance"),ne(k,"promise",null);window.customElements.define(oe,k);async function cs(e,t){let r=D.init(e.env).module("service");r.debug("Activating:",e);let n={price:{}},i=Object.freeze(Cr(e));try{n.price=await ri(i)}catch(c){r.warn("Price literals were not fetched:",c)}let o={checkout:new Set,price:new Set},s=document.createElement(oe),a={literals:n,providers:o,settings:i};return k.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...ei(a,t),...ti(a),...ni(a),...oi(a),...Or,Log:D,get defaults(){return _},get literals(){return n},get log(){return D},get providers(){return{checkout(c){return o.checkout.add(c),()=>o.checkout.delete(c)},price(c){return o.price.add(c),()=>o.price.delete(c)}}},get settings(){return i}})),r.debug("Activated:",{literals:n,settings:i,element:s}),document.head.append(s),ue(()=>{let c=new CustomEvent(ge,{bubbles:!0,cancelable:!1,detail:k.instance});k.instance.dispatchEvent(c)}),k.instance}function si(){document.head.querySelector(oe)?.remove(),k.promise=null,D.reset()}function us(e,t){if(ce(e)){let r=ce(t)?t():{};return r.force&&si(),k.promise??(k.promise=cs(e(),r))}return k.promise?k.promise:new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(ge,n,{once:!0})})}export{St as CheckoutLink,Z as CheckoutWorkflow,Q as CheckoutWorkflowStep,_ as Defaults,Pt as InlinePrice,G as Landscape,D as Log,oe as TAG_NAME_SERVICE,yr as WcsCommitment,we as WcsEnv,_r as WcsPlanType,vr as WcsTerm,ct as applyPlanType,Yn as getLocaleSettings,Cr as getSettings,us as init,si as reset}; -//# sourceMappingURL=commerce.js.map + Try polyfilling it using "@formatjs/intl-pluralrules" + `,me.MISSING_INTL_API,s);var O=r.getPluralRules(t,{type:u.pluralType}).select(f-(u.offset||0));b=u.options[O]||u.options.other}if(!b)throw new ir(u.value,f,Object.keys(u.options),s);a.push.apply(a,Fe(b.value,t,r,n,i,f-(u.offset||0)));continue}}return oo(a)}function ao(e,t){return t?T(T(T({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=T(T({},e[n]),t[n]||{}),r},{})):e}function co(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=ao(e[n],t[n]),r},T({},e)):e}function or(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function uo(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:ke(function(){for(var t,r=[],n=0;n0?e.substring(0,n):"";let i=wn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(fo);return t.decimal=c&&c[c.length-1]||".",t.separator=c&&c[1]&&c[0]||",",c=t.mask.split(t.decimal),t.integer=c[0],t.fraction=c[1],t}function mo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,ho(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function ho(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),_o=[sr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),sr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),sr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ar={[I.YEAR]:{[L.MONTHLY]:Ve.MONTH,[L.ANNUAL]:Ve.YEAR},[I.MONTH]:{[L.MONTHLY]:Ve.MONTH}},vo=(e,t)=>e.indexOf(`'${t}'`)===0,To=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+So(e)),r},bo=e=>{let t=Po(e),r=vo(e,t),n=e.replace(/'.*?'/,""),i=Cn.test(n)||In.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},Rn=e=>e.replace(Cn,Nn).replace(In,Nn),So=e=>e.match(/#(.?)#/)?.[1]===Ln?go:Ln,Po=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function at({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=bo(e),l=r?Un(e):"",u=To(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),d=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):On(u,f),h=r?d.lastIndexOf(l):d.length,E=d.substring(0,h),S=d.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,d).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:a,recurrenceTerm:i}}var Dn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=xo[r]??1;return at(e,i>1?Ve.MONTH:ar[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=_o.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(yo[s]??(u=>u))(c(a))})},Mn=({commitment:e,term:t,...r})=>at(r,ar[e]?.[t]),kn=e=>{let{commitment:t,term:r}=e;return t===I.YEAR&&r===L.MONTHLY?at(e,Ve.YEAR,n=>n*12):at(e,ar[t]?.[r])};var Ao={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},wo=Jr("ConsonantTemplates/price"),Oo=/<.+?>/g,W={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",disabled:"disabled",currencySpace:"price-currency-space",currencySymbol:"price-currency-symbol",decimals:"price-decimals",decimalsDelimiter:"price-decimals-delimiter",integer:"price-integer",recurrence:"price-recurrence",taxInclusivity:"price-tax-inclusivity",unitType:"price-unit-type"},he={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Lo="TAX_EXCLUSIVE",No=e=>Zr(e)?Object.entries(e).filter(([,t])=>Te(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+qr(n)+'"'}`,""):"",z=(e,t,r,n=!1)=>`${n?Rn(t):t??""}`;function Co(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=z(W.currencySymbol,r),d=z(W.currencySpace,o?" ":""),h="";return a&&(h+=f+d),h+=z(W.integer,s),h+=z(W.decimalsDelimiter,i),h+=z(W.decimals,n),a||(h+=d+f),h+=z(W.recurrence,c,null,!0),h+=z(W.unitType,l,null,!0),h+=z(W.taxInclusivity,u,!0),z(e,h,{...p,"aria-label":t})}var de=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1}={})=>({country:n,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:c,literals:l={}}={},{commitment:u,formatString:p,price:f,priceWithoutDiscount:d,taxDisplay:h,taxTerm:E,term:S,usePrecision:N}={},P={})=>{Object.entries({country:n,formatString:p,language:c,price:f}).forEach(([re,wt])=>{if(wt==null)throw new Error(`Argument "${re}" is missing`)});let b={...Ao,...l},O=`${c.toLowerCase()}-${n.toUpperCase()}`;function y(re,wt){let Ot=b[re];if(Ot==null)return"";try{return new An(Ot.replace(Oo,""),O).format(wt)}catch{return wo.error("Failed to format literal:",Ot),""}}let C=t&&d?d:f,M=e?Dn:Mn;r&&(M=kn);let{accessiblePrice:X,recurrenceTerm:B,...R}=M({commitment:u,formatString:p,term:S,price:e?f:C,usePrecision:N,isIndianPrice:n==="IN"}),j=X,ae="";if(v(o)&&B){let re=y(he.recurrenceAriaLabel,{recurrenceTerm:B});re&&(j+=" "+re),ae=y(he.recurrenceLabel,{recurrenceTerm:B})}let le="";if(v(s)){le=y(he.perUnitLabel,{perUnit:"LICENSE"});let re=y(he.perUnitAriaLabel,{perUnit:"LICENSE"});re&&(j+=" "+re)}let te="";v(a)&&E&&(te=y(h===Lo?he.taxExclusiveLabel:he.taxInclusiveLabel,{taxTerm:E}),te&&(j+=" "+te)),t&&(j=y(he.strikethroughAriaLabel,{strikethroughPrice:j}));let q=W.container;if(e&&(q+=" "+W.containerOptical),t&&(q+=" "+W.containerStrikethrough),r&&(q+=" "+W.containerAnnual),v(i))return Co(q,{...R,accessibleLabel:j,recurrenceLabel:ae,perUnitLabel:le,taxInclusivityLabel:te},P);let{currencySymbol:ye,decimals:He,decimalsDelimiter:Xe,hasCurrencySpace:Ce,integer:At,isCurrencyFirst:ai}=R,_e=[At,Xe,He];ai?(_e.unshift(Ce?"\xA0":""),_e.unshift(ye)):(_e.push(Ce?"\xA0":""),_e.push(ye)),_e.push(ae,le,te);let ci=_e.join("");return z(q,ci,P)},Gn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${de()(e,t,r)}${i?" "+de({displayStrikethrough:!0})(e,t,r):""}`};var cr=de(),ur=Gn(),lr=de({displayOptical:!0}),fr=de({displayStrikethrough:!0}),pr=de({displayAnnual:!0});var Io=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Fn=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=Io(n,i);return o===void 0?'':`${o}%`};var mr=Fn();var hr="ABM",dr="PUF",Er="M2M",gr="PERPETUAL",Vn="P3Y",Ro="TAX_INCLUSIVE_DETAILS",Uo="TAX_EXCLUSIVE",jn={ABM:hr,PUF:dr,M2M:Er,PERPETUAL:gr,P3Y:Vn},tc={[hr]:{commitment:I.YEAR,term:L.MONTHLY},[dr]:{commitment:I.YEAR,term:L.ANNUAL},[Er]:{commitment:I.MONTH,term:L.MONTHLY},[gr]:{commitment:I.PERPETUAL,term:void 0},[Vn]:{commitment:I.THREE_MONTHS,term:L.P3Y}},Wn="Value is not an offer",ct=e=>{if(typeof e!="object")return Wn;let{commitment:t,term:r}=e,n=Do(t,r);return{...e,planType:n}};var Do=(e,t)=>{if(e===void 0)return Wn;if(e===""&&t==="")return"";let r="";return e===I.YEAR?t===L.MONTHLY?r=hr:t===L.ANNUAL&&(r=dr):e===I.MONTH?t===L.MONTHLY&&(r=Er):e===I.PERPETUAL&&(r=gr),r};function xr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Ro)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Uo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:Ee}=Object,Z=Ee({...fe}),Q=Ee({...$}),H=Ee({...Y}),yr=Ee({...I}),we=Ee({...Re}),_r=Ee({...jn}),vr=Ee({...L});var Or={};li(Or,{CLASS_NAME_FAILED:()=>ut,CLASS_NAME_PENDING:()=>lt,CLASS_NAME_RESOLVED:()=>ft,ERROR_MESSAGE_BAD_REQUEST:()=>Tr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Sr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>br,EVENT_TYPE_ERROR:()=>Mo,EVENT_TYPE_FAILED:()=>pt,EVENT_TYPE_PENDING:()=>mt,EVENT_TYPE_READY:()=>ge,EVENT_TYPE_RESOLVED:()=>ht,LOG_NAMESPACE:()=>Pr,PARAM_AOS_API_KEY:()=>ko,PARAM_ENV:()=>Ar,PARAM_LANDSCAPE:()=>wr,PARAM_WCS_API_KEY:()=>Go,STATE_FAILED:()=>J,STATE_PENDING:()=>K,STATE_RESOLVED:()=>ee,TAG_NAME_SERVICE:()=>oe});var ut="placeholder-failed",lt="placeholder-pending",ft="placeholder-resolved",Tr="Bad WCS request",br="Commerce offer not found",Sr="Literals URL not provided",Mo="wcms:commerce:error",pt="wcms:placeholder:failed",mt="wcms:placeholder:pending",ge="wcms:commerce:ready",ht="wcms:placeholder:resolved",Pr="wcms/commerce",Ar="commerce.env",wr="commerce.landscape",ko="commerce.aosKey",Go="commerce.wcsKey",J="failed",K="pending",ee="resolved",oe="wcms-commerce";var Lr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Hn=new Set,Fo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Xn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Lr.serializableTypes.includes(r))return r}return e}function Vo(e,t){if(!Lr.ignoredProperties.includes(e))return Xn(t)}var Nr={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=Lr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(Fo(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Xn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,Vo)),Hn.has(c)||(Hn.add(c),window.lana?.log(c,{sampleRate:r,tags:n,clientId:i}))}};var _=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Z.V3,checkoutWorkflowStep:Q.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,domainSwitch:!1,env:H.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:we.PRODUCTION,landscape:G.PUBLISHED,wcsBufferLimit:1});function Bn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(oe);i!==r&&(r=i,i&&e(i))}return document.addEventListener(ge,n,{once:t}),ue(n),()=>document.removeEventListener(ge,n)}function je(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(xr)),i}var ue=e=>window.setTimeout(e);function Oe(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Ae).filter(Se);return r.length||(r=[t]),r}function dt(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Xt)}function F(){return window.customElements.get(oe)?.instance}var jo="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},se=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Yn({locale:e={}}={}){if(!e.prefix)return{country:_.country,language:_.language,locale:jo};let t=e.prefix.replace("/","")??"",[r=_.country,n=_.language]=(m[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function Cr(e={}){let{commerce:t={},locale:r=void 0}=e,i=(e.env?.name===se.PROD?se.PROD:ie(w(Ar,t,{metadata:!1}),se,se.PROD))===se.STAGE?H.STAGE:H.PRODUCTION,o=w("checkoutClientId",t)??_.checkoutClientId,s=ie(w("checkoutWorkflow",t),Z,_.checkoutWorkflow),a=Q.CHECKOUT;s===Z.V3&&(a=ie(w("checkoutWorkflowStep",t),Q,_.checkoutWorkflowStep));let c=v(w("displayOldPrice",t),_.displayOldPrice),l=v(w("displayPerUnit",t),_.displayPerUnit),u=v(w("displayRecurrence",t),_.displayRecurrence),p=v(w("displayTax",t),_.displayTax),f=v(w("entitlement",t),_.entitlement),d=v(w("modal",t),_.modal),h=v(w("forceTaxExclusive",t),_.forceTaxExclusive),E=w("promotionCode",t)??_.promotionCode,S=Oe(w("quantity",t)),N=w("wcsApiKey",t)??_.wcsApiKey,P=e.env?.name===se.PROD?G.PUBLISHED:ie(w(wr,t),G,_.landscape),b=Ae(w("wcsBufferDelay",t),_.wcsBufferDelay),O=Ae(w("wcsBufferLimit",t),_.wcsBufferLimit),y=v(w("domain.switch",t),!1);return{...Yn({locale:r}),displayOldPrice:c,checkoutClientId:o,checkoutWorkflow:s,checkoutWorkflowStep:a,displayPerUnit:l,displayRecurrence:u,displayTax:p,entitlement:f,extraOptions:_.extraOptions,modal:d,env:i,forceTaxExclusive:h,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:E,quantity:S,wcsApiKey:N,wcsBufferDelay:b,wcsBufferLimit:O,wcsEnv:i===H.STAGE?we.STAGE:we.PRODUCTION,landscape:P,domainSwitch:y}}var qn="debug",Wo="error",Ho="info",Xo="warn",Bo=Date.now(),Ir=new Set,Rr=new Set,$n=new Map,We=Object.freeze({DEBUG:qn,ERROR:Wo,INFO:Ho,WARN:Xo}),zn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},Zn={filter:({level:e})=>e!==qn},Yo={filter:()=>!1};function $o(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;ce(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Bo}}function qo(e){[...Rr].every(t=>t(e))&&Ir.forEach(t=>t(e))}function Qn(e){let t=($n.get(e)??0)+1;$n.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>qo($o(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Qn(`${i.namespace}/${o}`)},debug:n(We.DEBUG),error:n(We.ERROR),info:n(We.INFO),warn:n(We.WARN)});return i}function Et(...e){e.forEach(t=>{let{append:r,filter:n}=t;ce(n)?Rr.add(n):ce(r)&&Ir.add(r)})}function zo(e={}){let{name:t}=e,r=v(w("commerce.debug",{search:!0,storage:!0}),t===se.LOCAL);return Et(r?zn:Zn),t===se.PROD&&Et(Nr),D}function Zo(){Ir.clear(),Rr.clear()}var D={...Qn(Pr),Level:We,Plugins:{consoleAppender:zn,debugFilter:Zn,quietFilter:Yo,lanaAppender:Nr},init:zo,reset:Zo,use:Et};var Qo={CLASS_NAME_FAILED:ut,CLASS_NAME_PENDING:lt,CLASS_NAME_RESOLVED:ft,EVENT_TYPE_FAILED:pt,EVENT_TYPE_PENDING:mt,EVENT_TYPE_RESOLVED:ht,STATE_FAILED:J,STATE_PENDING:K,STATE_RESOLVED:ee},Jo={[J]:ut,[K]:lt,[ee]:ft},Ko={[J]:pt,[K]:mt,[ee]:ht},yt=new WeakMap;function V(e){if(!yt.has(e)){let t=D.module(e.constructor.is);yt.set(e,{changes:new Map,connected:!1,dispose:be,error:void 0,log:t,options:void 0,promises:[],state:K,timer:null,value:void 0,version:0})}return yt.get(e)}function gt(e){let t=V(e),{error:r,promises:n,state:i}=t;(i===ee||i===J)&&(t.promises=[],i===ee?n.forEach(({resolve:o})=>o(e)):i===J&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(Ko[i],{bubbles:!0}))}function xt(e){let t=yt.get(e);[J,K,ee].forEach(r=>{e.classList.toggle(Jo[r],r===t.state)})}var es={get error(){return V(this).error},get log(){return V(this).log},get options(){return V(this).options},get state(){return V(this).state},get value(){return V(this).value},attributeChangedCallback(e,t,r){V(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){V(this).dispose=Bn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=V(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=be},onceSettled(){let{error:e,promises:t,state:r}=V(this);return ee===r?Promise.resolve(this):J===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=ee,n.value=t,xt(this),this.log.debug("Resolved:",{element:this,value:t}),ue(()=>gt(this)),!0)},toggleFailed(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=J,xt(this),n.log.error("Failed:",{element:this,error:t}),ue(()=>gt(this)),!0)},togglePending(e){let t=V(this);return t.version++,e&&(t.options=e),t.state=K,xt(this),ue(()=>gt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!F())return;let t=V(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=K,t.timer=ue(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===K&&t.version===s&&(t.state=i,t.error=r,t.value=o,xt(this),gt(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Jn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function _t(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Jn(t)),i}function vt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(es)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Qo)),window.customElements.define(r,i,{extends:t})),i}function Tt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function bt(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Jn(t)),e):null}var ts="download",rs="upgrade",xe,Le=class Le extends HTMLAnchorElement{constructor(){super();Fr(this,xe,void 0);this.addEventListener("click",this.clickHandler)}static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-extra-options","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi","data-entitlement","data-upgrade","data-modal"]}static createCheckoutLink(r={},n=""){let i=F();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E}=i.collectCheckoutOptions(r),S=_t(Le,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E});return n&&(S.innerHTML=`${n}`),S}static getCheckoutLinks(r){return Tt(Le,r)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(r){var n;(n=Lt(this,xe))==null||n.call(this,r)}async render(r={}){if(!this.isConnected)return!1;let n=F();if(!n)return!1;this.dataset.imsCountry||n.imsCountryPromise.then(u=>{u&&(this.dataset.imsCountry=u)},be);let i=n.collectCheckoutOptions(r,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(u){this.placeholder.log.error("cannot parse exta checkout options",u)}let s=this.placeholder.togglePending(i);this.href="";let a=n.resolveOfferSelectors(i),c=await Promise.all(a);c=c.map(u=>je(u,i));let l=await n.buildCheckoutAction(c.flat(),{...o,...i});return this.renderOffers(c.flat(),i,{},l,s)}renderOffers(r,n,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=F();if(!a)return!1;if(n={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...n,...i},s??(s=this.placeholder.togglePending(n)),Lt(this,xe)&&Nt(this,xe,void 0),o){this.classList.remove(ts,rs),this.placeholder.toggleResolved(s,r,n);let{url:l,text:u,className:p,handler:f}=o;return l&&(this.href=l),u&&(this.firstElementChild.innerHTML=u),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),Nt(this,xe,f.bind(this))),!0}else if(r.length){if(this.placeholder.toggleResolved(s,r,n)){let l=a.buildCheckoutURL(r,n);return this.setAttribute("href",l),!0}}else{let l=new Error(`Not provided: ${n?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,l,n))return this.setAttribute("href","#"),!0}return!1}updateOptions(r={}){let n=F();if(!n)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}=n.collectCheckoutOptions(r);return bt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}),!0}};xe=new WeakMap,ne(Le,"is","checkout-link"),ne(Le,"tag","a");var Ur=Le,St=vt(Ur);var Kn=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],ns={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Ne=class Ne extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let r=F();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return _t(Ne,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return Tt(Ne,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,r,n,i){let o=`${t}_${r}`;if(Kn.includes(t)||Kn.includes(o))return!0;let s=ns[`${n}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,r){let[n]=await t.resolveOfferSelectors(r),i=je(await n,r);if(i?.length){let{country:o,language:s}=r,a=i[0],[c=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let r=F();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(je(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=F();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=F();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return bt(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};ne(Ne,"is","inline-price"),ne(Ne,"tag","span");var Dr=Ne,Pt=vt(Dr);function ei({providers:e,settings:t},r){let n=D.module("checkout");function i(l,u){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:d,country:h,language:E,promotionCode:S,quantity:N}=t,{checkoutMarketSegment:P,checkoutWorkflow:b=f,checkoutWorkflowStep:O=d,imsCountry:y,country:C=y??h,language:M=E,quantity:X=N,entitlement:B,upgrade:R,modal:j,perpetual:ae,promotionCode:le=S,wcsOsi:te,extraOptions:q,...ye}=Object.assign({},u?.dataset??{},l??{}),He=ie(b,Z,_.checkoutWorkflow),Xe=Q.CHECKOUT;He===Z.V3&&(Xe=ie(O,Q,_.checkoutWorkflowStep));let Ce=Pe({...ye,extraOptions:q,checkoutClientId:p,checkoutMarketSegment:P,country:C,quantity:Oe(X,_.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Xe,language:M,entitlement:v(B),upgrade:v(R),modal:v(j),perpetual:v(ae),promotionCode:Ue(le).effectivePromoCode,wcsOsi:dt(te)});if(u)for(let At of e.checkout)At(u,Ce);return Ce}async function o(l,u){let p=F(),f=await r.getCheckoutAction?.(l,u,p.imsSignedInPromise);return f||null}function s(l,u){if(!Array.isArray(l)||!l.length||!u)return"";let{env:p,landscape:f}=t,{checkoutClientId:d,checkoutMarketSegment:h,checkoutWorkflow:E,checkoutWorkflowStep:S,country:N,promotionCode:P,quantity:b,...O}=i(u),y=window.frameElement?"if":"fp",C={checkoutPromoCode:P,clientId:d,context:y,country:N,env:p,items:[],marketSegment:h,workflowStep:S,landscape:f,...O};if(l.length===1){let[{offerId:M,offerType:X,productArrangementCode:B}]=l,{marketSegments:[R]}=l[0];Object.assign(C,{marketSegment:R,offerType:X,productArrangementCode:B}),C.items.push(b[0]===1?{id:M}:{id:M,quantity:b[0]})}else C.items.push(...l.map(({offerId:M},X)=>({id:M,quantity:b[X]??_.quantity})));return Mt(E,C)}let{createCheckoutLink:a,getCheckoutLinks:c}=St;return{CheckoutLink:St,CheckoutWorkflow:Z,CheckoutWorkflowStep:Q,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:c}}function is({interval:e=200,maxAttempts:t=25}={}){let r=D.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function os(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function ss(e){let t=D.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function ti({}){let e=is(),t=os(e),r=ss(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}function as(e){if(!e.priceLiteralsURL)throw new Error(Sr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(r=>{r.json().then(({data:n})=>{t(n)})})})}async function ri(e){let r=await(e.priceLiteralsPromise||as(e));if(Array.isArray(r)){let n=o=>r.find(s=>ze(s.lang,o)),i=n(e.language)??n(_.language);if(i)return Object.freeze(i)}return{}}function ni({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:d,forceTaxExclusive:h,language:E,promotionCode:S,quantity:N}=r,{displayOldPrice:P=u,displayPerUnit:b=p,displayRecurrence:O=f,displayTax:y=d,forceTaxExclusive:C=h,country:M=l,language:X=E,perpetual:B,promotionCode:R=S,quantity:j=N,template:ae,wcsOsi:le,...te}=Object.assign({},c?.dataset??{},a??{}),q=Pe({...te,country:M,displayOldPrice:v(P),displayPerUnit:v(b),displayRecurrence:v(O),displayTax:v(y),forceTaxExclusive:v(C),language:X,perpetual:v(B),promotionCode:Ue(R).effectivePromoCode,quantity:Oe(j,_.quantity),template:ae,wcsOsi:dt(le)});if(c)for(let ye of t.price)ye(c,q);return q}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=mr;break;case"strikethrough":u=fr;break;case"optical":u=lr;break;case"annual":u=pr;break;default:u=c.promotionCode?ur:cr}let p=n(c);p.literals=Object.assign({},e.price,Pe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Pt;return{InlinePrice:Pt,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Mr="_acom",ii={[H.PRODUCTION]:"https://wcs.adobe.com",[H.STAGE]:"https://wcs.stage.adobe.com",[H.PRODUCTION+Mr]:"https://www.adobe.com",[H.STAGE+Mr]:"https://www.stage.adobe.com"};function oi({settings:e}){let t=D.module("wcs"),{env:r,domainSwitch:n,wcsApiKey:i}=e,o=n?ii[r+Mr]:ii[r],s={apiKey:i,baseUrl:o,fetch:window.fetch.bind(window)},a=qe(s),c=new Map,l=new Map,u;async function p(h,E,S=!0){let N=br;try{t.debug("Fetching:",h),h.offerSelectorIds=h.offerSelectorIds.sort();let{data:P}=await a(h,{apiKey:i,environment:e.wcsEnv,landscape:r===H.STAGE?"ALL":e.landscape},({resolvedOffers:O})=>({offers:O.map(ct)}));t.debug("Fetched:",h,P);let{offers:b}=P??{};E.forEach(({resolve:O},y)=>{let C=b.filter(({offerSelectorIds:M})=>M.includes(y)).flat();C.length&&(E.delete(y),O(C))})}catch(P){P.status===404&&h.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(h.offerSelectorIds.map(b=>p({...h,offerSelectorIds:[b]},E,!1)))):(t.error("Failed:",h,P),N=Tr)}S&&E.size&&(t.debug("Missing:",{offerSelectorIds:[...E.keys()]}),E.forEach(P=>{P.reject(new Error(N))}))}function f(){clearTimeout(u);let h=[...l.values()];l.clear(),h.forEach(({options:E,promises:S})=>p(E,S))}function d({country:h,language:E,perpetual:S=!1,promotionCode:N="",wcsOsi:P=[]}){let b=`${E}_${h}`;h!=="GB"&&(E=S?"EN":"MULT");let O=[h,E,N].filter(y=>y).join("-").toLowerCase();return P.map(y=>{let C=`${y}-${O}`;if(!c.has(C)){let M=new Promise((X,B)=>{let R=l.get(O);if(!R){let j={country:h,locale:b,offerSelectorIds:[]};h!=="GB"&&(j.language=E),R={options:j,promises:new Map},l.set(O,R)}N&&(R.options.promotionCode=N),R.options.offerSelectorIds.push(y),R.promises.set(y,{resolve:X,reject:B}),R.options.offerSelectorIds.length>=e.wcsBufferLimit?f():(t.debug("Queued:",R.options),u||(u=setTimeout(f,e.wcsBufferDelay)))});c.set(C,M)}return c.get(C)})}return{WcsCommitment:yr,WcsPlanType:_r,WcsTerm:vr,resolveOfferSelectors:d}}var k=class extends HTMLElement{get isWcmsCommerce(){return!0}};ne(k,"instance"),ne(k,"promise",null);window.customElements.define(oe,k);async function cs(e,t){let r=D.init(e.env).module("service");r.debug("Activating:",e);let n={price:{}},i=Object.freeze(Cr(e));try{n.price=await ri(i)}catch(c){r.warn("Price literals were not fetched:",c)}let o={checkout:new Set,price:new Set},s=document.createElement(oe),a={literals:n,providers:o,settings:i};return k.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...ei(a,t),...ti(a),...ni(a),...oi(a),...Or,Log:D,get defaults(){return _},get literals(){return n},get log(){return D},get providers(){return{checkout(c){return o.checkout.add(c),()=>o.checkout.delete(c)},price(c){return o.price.add(c),()=>o.price.delete(c)}}},get settings(){return i}})),r.debug("Activated:",{literals:n,settings:i,element:s}),document.head.append(s),ue(()=>{let c=new CustomEvent(ge,{bubbles:!0,cancelable:!1,detail:k.instance});k.instance.dispatchEvent(c)}),k.instance}function si(){document.head.querySelector(oe)?.remove(),k.promise=null,D.reset()}function us(e,t){if(ce(e)){let r=ce(t)?t():{};return r.force&&si(),k.promise??(k.promise=cs(e(),r))}return k.promise?k.promise:new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(ge,n,{once:!0})})}export{St as CheckoutLink,Z as CheckoutWorkflow,Q as CheckoutWorkflowStep,_ as Defaults,Pt as InlinePrice,G as Landscape,D as Log,oe as TAG_NAME_SERVICE,yr as WcsCommitment,we as WcsEnv,_r as WcsPlanType,vr as WcsTerm,ct as applyPlanType,Yn as getLocaleSettings,Cr as getSettings,us as init,si as reset}; + //# sourceMappingURL=commerce.js.map + \ No newline at end of file From 4d3ab7baf9bfb1620affd28fafa14a61882a4fb3 Mon Sep 17 00:00:00 2001 From: Megan Thomas Date: Tue, 23 Jul 2024 11:16:11 -0700 Subject: [PATCH 09/10] MWPW-146743 Improve Article Header Performance (#2577) Co-authored-by: Jason Slavin --- libs/blocks/article-header/article-header.js | 108 ++++++++++++------ .../article-header/article-header.test.js | 18 +++ test/blocks/article-header/mocks/body.html | 1 + .../article-header/mocks/placeholders.json | 8 ++ 4 files changed, 99 insertions(+), 36 deletions(-) diff --git a/libs/blocks/article-header/article-header.js b/libs/blocks/article-header/article-header.js index 86052fb74e..fb4ea8235f 100644 --- a/libs/blocks/article-header/article-header.js +++ b/libs/blocks/article-header/article-header.js @@ -1,16 +1,15 @@ import { createTag, getMetadata, getConfig } from '../../utils/utils.js'; -import { copyToClipboard } from '../../utils/tools.js'; -import { loadTaxonomy, getLinkForTopic, getTaxonomyModule } from '../article-feed/article-helpers.js'; -import { replaceKey } from '../../features/placeholders.js'; import { fetchIcons } from '../../features/icons/icons.js'; -import { buildFigure } from '../figure/figure.js'; + +let copyText = 'Copied to clipboard'; async function validateAuthorUrl(url) { if (!url) return null; const resp = await fetch(`${url.toLowerCase()}.plain.html`); if (!resp?.ok) { - console.log(`Could not retrieve metadata for ${url}`); + /* c8 ignore next 3 */ + window.lana?.log(`Could not retrieve metadata for ${url}`, { tags: 'errorType=warn,module=article-header' }); return null; } @@ -34,7 +33,6 @@ function openPopup(e) { async function buildAuthorInfo(authorEl, bylineContainer) { const { href, textContent } = authorEl; - const config = getConfig(); const base = config.miloLibs || config.codeRoot; const authorImg = createTag('div', { class: 'article-author-image' }); @@ -57,6 +55,7 @@ async function buildAuthorInfo(authorEl, bylineContainer) { authorImg.style.backgroundImage = 'none'; }); img.addEventListener('error', () => { + /* c8 ignore next 1 */ img.remove(); }); } else { @@ -65,33 +64,63 @@ async function buildAuthorInfo(authorEl, bylineContainer) { } } +async function copyToClipboard(button, copyTxt) { + try { + await navigator.clipboard.writeText(window.location.href); + button.setAttribute('title', copyTxt); + button.setAttribute('aria-label', copyTxt); + + const tooltip = createTag('div', { role: 'status', 'aria-live': 'polite', class: 'copied-to-clipboard' }, copyTxt); + button.append(tooltip); + + setTimeout(() => { + /* c8 ignore next 1 */ + tooltip.remove(); + }, 3000); + button.classList.remove('copy-failure'); + button.classList.add('copy-success'); + } catch (e) { + button.classList.add('copy-failure'); + button.classList.remove('copy-success'); + } +} + +async function updateShareText(shareBlock) { + const { replaceKey } = await import('../../features/placeholders.js'); + const config = getConfig(); + const labels = [ + `${await replaceKey('share-twitter', config)}`, + `${await replaceKey('share-linkedin', config)}`, + `${await replaceKey('share-facebook', config)}`, + `${await replaceKey('copy-to-clipboard', config)}`, + ]; + const shareLinks = shareBlock.querySelectorAll('a'); + [...shareLinks].forEach((el, index) => el.setAttribute('aria-label', labels[index])); + copyText = await replaceKey('copied-to-clipboard', config); +} + async function buildSharing() { const url = encodeURIComponent(window.location.href); const title = encodeURIComponent(document.querySelector('h1').textContent); const description = encodeURIComponent(getMetadata('description')); - const platformMap = { twitter: { 'data-href': `https://www.twitter.com/share?&url=${url}&text=${title}`, - alt: `${await replaceKey('share-twitter', getConfig())}`, - 'aria-label': `${await replaceKey('share-twitter', getConfig())}`, + 'aria-label': 'share twitter', }, linkedin: { 'data-type': 'LinkedIn', 'data-href': `https://www.linkedin.com/shareArticle?mini=true&url=${url}&title=${title}&summary=${description || ''}`, - alt: `${await replaceKey('share-linkedin', getConfig())}`, - 'aria-label': `${await replaceKey('share-linkedin', getConfig())}`, + 'aria-label': 'share linkedin', }, facebook: { 'data-type': 'Facebook', 'data-href': `https://www.facebook.com/sharer/sharer.php?u=${url}`, - alt: `${await replaceKey('share-facebook', getConfig())}`, - 'aria-label': `${await replaceKey('share-facebook', getConfig())}`, + 'aria-label': 'share facebook', }, link: { id: 'copy-to-clipboard', - alt: `${await replaceKey('copy-to-clipboard', getConfig())}`, - 'aria-label': `${await replaceKey('copy-to-clipboard', getConfig())}`, + 'aria-label': 'copy to clipboard', }, }; @@ -115,37 +144,46 @@ async function buildSharing() { link.addEventListener('click', openPopup); }); const copyButton = sharing.querySelector('#copy-to-clipboard'); - copyButton.addEventListener('click', async () => { - const copyText = await replaceKey('copied-to-clipboard', getConfig()); - await copyToClipboard(copyButton, copyText); - }); + copyButton.addEventListener('click', () => copyToClipboard(copyButton, copyText)); return sharing; } -async function validateDate(date) { +function validateDate(date) { const { env } = getConfig(); if (env?.name === 'prod') return; if (date && !/^[0-1]\d{1}-[0-3]\d{1}-[2]\d{3}$/.test(date.textContent.trim())) { - // match publication date to MM-DD-YYYY format date.classList.add('article-date-invalid'); - date.setAttribute('title', await replaceKey('invalid-date', getConfig())); + date.setAttribute('title', 'Invalid Date Format: Must be MM-DD-YYYY'); } } -export default async function init(blockEl) { - if (!getTaxonomyModule()) { - await loadTaxonomy(); +function decorateFigure(el) { + el.classList.add('article-feature-image'); + const picture = el.querySelector('picture'); + const caption = el.querySelector('em'); + const figure = document.createElement('figure'); + + if (caption) { + caption.classList.add('caption'); + const figcaption = document.createElement('figcaption'); + figcaption.append(caption); + figure.append(figcaption); } - const childrenEls = Array.from(blockEl.children); - if (childrenEls.length < 4) { - console.warn('Block does not have enough children'); - } + figure.classList.add('figure-feature'); + figure.prepend(picture); + el.prepend(figure); + el.lastElementChild.remove(); +} +export default async function init(blockEl) { + const childrenEls = Array.from(blockEl.children); const categoryContainer = childrenEls[0]; const categoryEl = categoryContainer.firstElementChild.firstElementChild; if (categoryEl?.textContent) { + const { getTaxonomyModule, loadTaxonomy, getLinkForTopic } = await import('../article-feed/article-helpers.js'); + if (!getTaxonomyModule()) await loadTaxonomy(); const categoryTag = getLinkForTopic(categoryEl.textContent); categoryEl.innerHTML = categoryTag; } @@ -162,19 +200,17 @@ export default async function init(blockEl) { const authorEl = authorContainer.querySelector('a'); authorContainer.classList.add('article-author'); - await buildAuthorInfo(authorEl, bylineContainer); + buildAuthorInfo(authorEl, bylineContainer); const date = bylineContainer.querySelector('.article-byline-info > p:last-child'); date.classList.add('article-date'); - await validateDate(date); + validateDate(date); const shareBlock = await buildSharing(); bylineContainer.append(shareBlock); const featureImgContainer = childrenEls[3]; - featureImgContainer.classList.add('article-feature-image'); - const featureFigEl = buildFigure(featureImgContainer.firstElementChild); - featureFigEl.classList.add('figure-feature'); - featureImgContainer.prepend(featureFigEl); - featureImgContainer.lastElementChild.remove(); + decorateFigure(featureImgContainer); + + document.addEventListener('milo:deferred', () => updateShareText(shareBlock)); } diff --git a/test/blocks/article-header/article-header.test.js b/test/blocks/article-header/article-header.test.js index df302d267f..cbcf096c1f 100644 --- a/test/blocks/article-header/article-header.test.js +++ b/test/blocks/article-header/article-header.test.js @@ -48,6 +48,13 @@ describe('article header', () => { stub.restore(); }); + it('updates share text after deferred event', async () => { + document.dispatchEvent(new Event('milo:deferred')); + const shareLink = document.querySelector('.article-byline-sharing a'); + await delay(100); + expect(shareLink.getAttribute('aria-label')).to.equal('Click to share on twitter'); + }); + it('should add copy-failure class to link if the copy fails', async () => { const writeTextStub = sinon.stub(navigator.clipboard, 'writeText').rejects(); const copyLink = document.body.querySelector('.article-byline-sharing #copy-to-clipboard'); @@ -72,6 +79,17 @@ describe('article header', () => { writeTextStub.restore(); }); + it('updates copy text after deferred event', async () => { + document.dispatchEvent(new Event('milo:deferred')); + const writeTextStub = sinon.stub(navigator.clipboard, 'writeText').resolves(); + const copyLink = document.body.querySelector('.article-byline-sharing #copy-to-clipboard'); + sinon.fake(); + copyLink.click(); + const tooltip = await waitForElement('.copied-to-clipboard'); + expect(tooltip.textContent).to.equal('Link copied to clipboard'); + writeTextStub.restore(); + }); + it('sets default taxonomy path to "topics"', () => { const categoryLink = document.querySelector('.article-category a'); expect(categoryLink.href.includes('/topics/')).to.be.true; diff --git a/test/blocks/article-header/mocks/body.html b/test/blocks/article-header/mocks/body.html index 3b4e6be5f7..ffe3737645 100644 --- a/test/blocks/article-header/mocks/body.html +++ b/test/blocks/article-header/mocks/body.html @@ -32,6 +32,7 @@

--> + Caption

diff --git a/test/blocks/article-header/mocks/placeholders.json b/test/blocks/article-header/mocks/placeholders.json index a7f0478ee7..c3f811738d 100644 --- a/test/blocks/article-header/mocks/placeholders.json +++ b/test/blocks/article-header/mocks/placeholders.json @@ -10,6 +10,14 @@ { "key": "no-results", "value": "No results found" + }, + { + "key": "share-twitter", + "value": "Click to share on twitter" + }, + { + "key": "copied-to-clipboard", + "value": "Link copied to clipboard" } ], ":type": "sheet" From 3afac8dad43745de2ccf48f24f723c44eaddbf69 Mon Sep 17 00:00:00 2001 From: Drashti Modasara Date: Wed, 24 Jul 2024 13:21:54 +0530 Subject: [PATCH 10/10] Revert "[MWPW-152968] mWeb - Passing ECID to Branch.io banner - Implementation" (#2612) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "[MWPW-152968] mWeb - Passing ECID to Branch.io banner - Implementatio…" This reverts commit 694344636a552449737f3f99a765cb240fb834a1. --- .../mobile-app-banner/mobile-app-banner.js | 24 ++----------- .../mobile-app-banner.test.js | 34 +------------------ 2 files changed, 3 insertions(+), 55 deletions(-) diff --git a/libs/blocks/mobile-app-banner/mobile-app-banner.js b/libs/blocks/mobile-app-banner/mobile-app-banner.js index f845de1ab0..9d7106dd07 100644 --- a/libs/blocks/mobile-app-banner/mobile-app-banner.js +++ b/libs/blocks/mobile-app-banner/mobile-app-banner.js @@ -13,18 +13,8 @@ async function getKey(product) { return keyMatch[0]?.key; } -async function getECID() { - let ecid = null; - if (window.alloy) { - await window.alloy('getIdentity').then((data) => { - ecid = data?.identity?.ECID; - }).catch((err) => window.lana.log(`Error fetching ECID: ${err}`, { tags: 'errorType=error,module=mobile-app-banner' })); - } - return ecid; -} - /* eslint-disable */ -function branchInit(key, ecidVal) { +function branchInit(key) { let initValue = false; function initBranch() { if (initValue) { @@ -58,16 +48,8 @@ function branchInit(key, ecidVal) { 0 ); const privacyConsent = window.adobePrivacy?.hasUserProvidedConsent(); - const isAndroid = navigator.userAgent.includes('Android'); - - const cookieGrp = window.adobePrivacy?.activeCookieGroups(); - const performanceCookieConsent = cookieGrp.includes('C0002'); - const advertisingCookieConsent = cookieGrp.includes('C0004'); - - if (performanceCookieConsent && advertisingCookieConsent && isAndroid) branch.setBranchViewData({ data: { ecid: ecidVal }}); branch.init(key, { tracking_disabled: !privacyConsent }); } - ['adobePrivacy:PrivacyConsent', 'adobePrivacy:PrivacyReject', 'adobePrivacy:PrivacyCustom'] .forEach((event) => { window.addEventListener(event, initBranch); @@ -81,7 +63,5 @@ export default async function init(el) { const classListArray = Array.from(el.classList); const product = classListArray.find((token) => token.startsWith('product-')).split('-')[1]; const key = await getKey(product); - if (!key) return; - const ecid = await getECID(); - branchInit(key, ecid); + if (key) branchInit(key); } diff --git a/test/blocks/mobile-app-banner/mobile-app-banner.test.js b/test/blocks/mobile-app-banner/mobile-app-banner.test.js index 81b65f8e19..b8656f95f1 100644 --- a/test/blocks/mobile-app-banner/mobile-app-banner.test.js +++ b/test/blocks/mobile-app-banner/mobile-app-banner.test.js @@ -51,11 +51,7 @@ describe('mobile-app-banner', () => { }); it('should init by adding branchio script', async () => { - window.adobePrivacy = { - hasUserProvidedConsent: () => true, - activeCookieGroups: () => ['C0002', 'C0004'], - }; - const userAgentStub = sinon.stub(navigator, 'userAgent').get(() => 'Android'); + window.adobePrivacy = { hasUserProvidedConsent: () => true }; const module = await import('../../../libs/blocks/mobile-app-banner/mobile-app-banner.js'); const banner = document.body.querySelector('.mobile-app-banner.product-test'); await module.default(banner); @@ -67,33 +63,5 @@ describe('mobile-app-banner', () => { if (scriptTag.getAttribute('src') !== null) scriptSrcs.push(scriptTag.getAttribute('src')); }); expect(scriptSrcs).to.include('https://cdn.branch.io/branch-latest.min.js'); - userAgentStub.restore(); - }); - - it('should fetch ecid from alloy and return if event is dispatched twice', async () => { - window.adobePrivacy = { - hasUserProvidedConsent: () => true, - activeCookieGroups: () => ['C0002', 'C0004'], - }; - window.alloy = () => {}; - const alloyStub = sinon.stub(window, 'alloy').callsFake((command) => { - if (command === 'getIdentity') { - return Promise.resolve({ identity: { ECID: 'test-ecid' } }); - } - return 'test-ecid'; - }); - const module = await import('../../../libs/blocks/mobile-app-banner/mobile-app-banner.js'); - const banner = document.body.querySelector('.mobile-app-banner.product-test'); - await module.default(banner); - window.dispatchEvent(new CustomEvent('adobePrivacy:PrivacyConsent')); - await delay(0); - const scriptTags = document.querySelectorAll('head > script'); - const scriptSrcs = []; - scriptTags.forEach((scriptTag) => { - if (scriptTag.getAttribute('src') !== null) scriptSrcs.push(scriptTag.getAttribute('src')); - }); - window.dispatchEvent(new CustomEvent('adobePrivacy:PrivacyConsent')); - expect(scriptSrcs).to.include('https://cdn.branch.io/branch-latest.min.js'); - alloyStub.restore(); }); });