diff --git a/studio/src/aem/fragment.js b/studio/src/aem/fragment.js index 93501baee..9d3eac852 100644 --- a/studio/src/aem/fragment.js +++ b/studio/src/aem/fragment.js @@ -309,7 +309,7 @@ export class Fragment { const prepared = new Fragment(this); // Fields that should never be reset (they're fragment-specific, not inherited) - const excludeFields = ['variations', 'tags', 'originalId', 'locReady']; + const excludeFields = ['variations', 'tags', 'originalId', 'locReady', 'compatVersion']; for (const field of prepared.fields) { if (excludeFields.includes(field.name)) continue; diff --git a/studio/src/constants.js b/studio/src/constants.js index 2c0832425..ce34ddc23 100644 --- a/studio/src/constants.js +++ b/studio/src/constants.js @@ -1,3 +1,5 @@ +import { COMPAT_VERSION_GLOBAL_PROMO_CODE } from '../../web-components/src/compat-version.js'; + export const CHECKOUT_CTA_TEXTS = { 'buy-now': 'Buy now', 'free-trial': 'Free trial', @@ -264,5 +266,13 @@ export const TRANSLATIONS_ALLOWED_SURFACES = ['acom', 'acom-cc', 'acom-dc', 'exp /** Plain preview origin — use for direct `.json` lookups (e.g. fil_PH placeholder fallback). */ export const ODIN_PREVIEW_ORIGIN = 'https://odinpreview.corp.adobe.com'; + +/** + * Compat version of the card. + * 0: assumed version for fragments before compat version was introduced. + * see web-components/src/compat-version.js for more details. + */ +export const COMPAT_VERSION = COMPAT_VERSION_GLOBAL_PROMO_CODE; + /** Freyja fragments API root on the preview origin — use as `preview.url` in pipeline contexts. */ export const ODIN_PREVIEW_FRAGMENTS_URL = `${ODIN_PREVIEW_ORIGIN}/adobe/contentFragments`; diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index e959eff3f..18e7d7fa4 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -7,7 +7,7 @@ import '../aem/aem-tag-picker-field.js'; import './variant-picker.js'; import { SPECTRUM_COLORS } from '../utils/spectrum-colors.js'; import '../rte/osi-field.js'; -import { CARD_MODEL_PATH } from '../constants.js'; +import { CARD_MODEL_PATH, COMPAT_VERSION } from '../constants.js'; import '../fields/secure-text-field.js'; import '../fields/plan-type-field.js'; import { getFragmentMapping, showToast } from '../utils.js'; @@ -21,9 +21,49 @@ import { getItemFieldStateByIndex } from '../utils/field-state.js'; import { Fragment } from '../aem/fragment.js'; import { toAttribute } from '../aem/tag-path-utils.js'; import { getGlobalSettingsDefaults } from '../settings/settings-store.js'; +import { getLocaleByCode } from '../../../io/www/src/fragment/locales.js'; const QUANTITY_MODEL = 'quantitySelect'; const WHAT_IS_INCLUDED = 'whatsIncluded'; +const EVENT_COMMERCE_READY = 'wcms:commerce:ready'; +const INLINE_PRICE_SELECTOR = 'span[is="inline-price"][data-wcs-osi]'; + +function isEditorPriceElement(element) { + if (element.closest('#preview-wrapper')) return true; + const host = element.getRootNode()?.host; + return host?.nodeName === 'RTE-FIELD' && !!host.closest('merch-card-editor'); +} + +export function getActiveMerchCardEditor() { + return document.querySelector('merch-card-editor'); +} + +function groupedPreviewLocaleProvider(element, options) { + if (!isEditorPriceElement(element)) return; + const localeCode = getActiveMerchCardEditor()?.previewLocaleOverride; + if (!localeCode) return; + + const locale = getLocaleByCode(localeCode); + if (!locale) return; + + options.locale = localeCode; + options.language = locale.lang; + options.country = locale.country; +} + +function editorPromoCodeProvider(element, options) { + if (!isEditorPriceElement(element)) return; + const promoCode = getActiveMerchCardEditor()?.getEffectiveFieldValue('promoCode', 0); + if (!promoCode) return; + options.promotionCode = promoCode; +} + +function checkoutOptionsProvider(element, options) { + if (!isEditorPriceElement(element)) return; + const promoCode = getActiveMerchCardEditor()?.getEffectiveFieldValue('promoCode', 0); + if (!promoCode) return; + options.promotionCode = promoCode; +} const VARIANT_RTE_MARKS = { [VARIANT_NAMES.MINI]: { @@ -41,6 +81,7 @@ class MerchCardEditor extends LitElement { localeDefaultFragment: { type: Object, attribute: false }, isVariation: { type: Boolean, attribute: false }, fieldsReady: { type: Boolean, state: true }, + previewLocaleOverride: { type: String, state: true }, }; static SECTION_FIELDS = { @@ -72,6 +113,7 @@ class MerchCardEditor extends LitElement { this.isVariation = false; this.lastMnemonicState = null; this.fieldsReady = false; + this.previewLocaleOverride = null; this.localeSearch = ''; this.reactiveController = new ReactiveController(this, []); } @@ -92,6 +134,44 @@ class MerchCardEditor extends LitElement { return (this.fragment.getFieldValues('pznTags') || []).filter(Boolean).join(','); } + #normalizeGroupedPreviewLocaleCode(tagValue) { + const localeCode = tagValue?.split('/').pop()?.trim(); + return getLocaleByCode(localeCode) ? localeCode : null; + } + + get groupedPreviewLocales() { + if (!this.isGroupedVariation) return []; + const tags = this.fragment?.getFieldValues('pznTags') || []; + const localeCodes = [...new Set(tags.map((tag) => this.#normalizeGroupedPreviewLocaleCode(tag)).filter(Boolean))]; + return localeCodes.map((code) => { + const locale = getLocaleByCode(code); + return { + code, + lang: locale.lang, + country: locale.country, + label: `${locale.country} (${locale.lang.toUpperCase()})`, + }; + }); + } + + #syncGroupedPreviewLocale() { + const locales = this.groupedPreviewLocales; + if (!locales.length) { + if (this.previewLocaleOverride !== null) { + this.previewLocaleOverride = null; + } + return; + } + + const codes = locales.map((locale) => locale.code); + const globalLocale = Store.localeOrRegion(); + this.previewLocaleOverride = codes.includes(this.previewLocaleOverride) + ? this.previewLocaleOverride + : codes.includes(globalLocale) + ? globalLocale + : codes[0]; + } + #normalizePznTagIds(value) { const rawValues = Array.isArray(value) ? value : typeof value === 'string' ? [value] : []; return [ @@ -434,17 +514,50 @@ class MerchCardEditor extends LitElement { connectedCallback() { super.connectedCallback(); + this.registerCommerceProviders(); + document.addEventListener(EVENT_COMMERCE_READY, this.#handleCommerceReady); } disconnectedCallback() { super.disconnectedCallback(); + document.removeEventListener(EVENT_COMMERCE_READY, this.#handleCommerceReady); this.lastMnemonicState = null; } + #handleCommerceReady = (event) => { + this.registerCommerceProviders(event.detail); + }; + + registerCommerceProviders(service = document.querySelector('mas-commerce-service')) { + if (!service?.providers) return; + if (!service.providers.has(groupedPreviewLocaleProvider)) { + service.providers.price(groupedPreviewLocaleProvider); + service.providers.checkout(groupedPreviewLocaleProvider); + } + if (!service.providers.has(editorPromoCodeProvider)) { + service.providers.price(editorPromoCodeProvider); + } + if (!service.providers.has(checkoutOptionsProvider)) { + service.providers.checkout(checkoutOptionsProvider); + } + } + + refreshRenderedPrices() { + document.querySelector('mas-commerce-service')?.refreshOffers?.(); + this.querySelectorAll('rte-field').forEach((field) => { + field.shadowRoot?.querySelectorAll(INLINE_PRICE_SELECTOR).forEach((price) => { + price.requestUpdate(true); + }); + }); + } + #cachedGlobalDefaults = null; willUpdate(changedProperties) { this.#cachedGlobalDefaults = null; + if (this.fragmentStore?.get()) { + this.#syncGroupedPreviewLocale(); + } if (changedProperties.has('fragmentStore') && this.fragmentStore) { this.fieldsReady = false; this.reactiveController.updateStores([this.fragmentStore, Store.settings.rows, Store.search]); @@ -611,6 +724,17 @@ class MerchCardEditor extends LitElement { async updated(changedProperties) { super.updated(changedProperties); + if (changedProperties.has('previewLocaleOverride')) { + this.refreshRenderedPrices(); + this.dispatchEvent( + new CustomEvent('preview-locale-change', { + bubbles: true, + composed: true, + detail: { value: this.previewLocaleOverride }, + }), + ); + } + this.ensurePromoCompatVersion(); if (!this.fieldsReady && this.fragment) { await this.updateComplete; await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))); @@ -618,10 +742,25 @@ class MerchCardEditor extends LitElement { } } + ensurePromoCompatVersion() { + if (!this.fragment) return; + const rawPromo = this.getEffectiveFieldValue('promoCode', 0); + const hasPromoCode = String(rawPromo ?? '').trim() !== ''; + if (!hasPromoCode) return; + + const rawCompat = this.getEffectiveFieldValue('compatVersion', 0); + const parsedCompat = Number(rawCompat); + const currentCompat = Number.isFinite(parsedCompat) ? parsedCompat : 0; + if (currentCompat < COMPAT_VERSION) { + this.fragmentStore.updateField('compatVersion', [String(COMPAT_VERSION)]); + } + } + async toggleFields() { if (!this.fragment) { return; } + // Variations can inherit `variant` from their parent fragment. // Use the effective value so template field visibility remains accurate. const variantValue = this.getEffectiveFieldValue('variant'); diff --git a/studio/src/mas-create-dialog.js b/studio/src/mas-create-dialog.js index c6fb22d49..f4c097733 100644 --- a/studio/src/mas-create-dialog.js +++ b/studio/src/mas-create-dialog.js @@ -1,5 +1,5 @@ import { LitElement, html, css, nothing } from 'lit'; -import { EVENT_KEYDOWN, EVENT_OST_OFFER_SELECT, TAG_MODEL_ID_MAPPING } from './constants.js'; +import { COMPAT_VERSION, EVENT_KEYDOWN, EVENT_OST_OFFER_SELECT, TAG_MODEL_ID_MAPPING } from './constants.js'; import router from './router.js'; import Store from './store.js'; import './rte/osi-field.js'; @@ -224,6 +224,7 @@ export class MasCreateDialog extends LitElement { fragmentData.data = { osi: this.osi, tags: this.tags, + compatVersion: COMPAT_VERSION, }; } diff --git a/studio/src/mas-fragment-editor.js b/studio/src/mas-fragment-editor.js index a80538c74..309d55b96 100644 --- a/studio/src/mas-fragment-editor.js +++ b/studio/src/mas-fragment-editor.js @@ -15,6 +15,7 @@ import { } from './constants.js'; import router from './router.js'; import { VARIANTS } from './editors/variant-picker.js'; +import { getActiveMerchCardEditor } from './editors/merch-card-editor.js'; import { extractLocaleFromPath, generateCodeToUse, getFragmentMapping, replaceLocaleInPath, showToast } from './utils.js'; import { getSpectrumVersion } from './constants/icon-library.js'; import './editors/merch-card-editor.js'; @@ -98,6 +99,24 @@ export default class MasFragmentEditor extends LitElement { overflow-y: auto; } + .preview-locale-panel { + display: flex; + flex-direction: column; + gap: 8px; + width: 100%; + padding: 20px 20px 0 20px; + box-sizing: border-box; + } + + .preview-locale-panel sp-field-label { + font-size: 14px; + color: var(--spectrum-global-color-gray-800); + } + + .preview-locale-panel sp-picker { + width: 100%; + } + @media (max-width: 1200px) { #preview-column { position: relative; @@ -1082,6 +1101,9 @@ export default class MasFragmentEditor extends LitElement { } this.fragmentStore.updateField(fieldName, value); + if (fieldName === 'promoCode') { + getActiveMerchCardEditor()?.refreshRenderedPrices?.(); + } } async deleteFragment() { @@ -1372,6 +1394,42 @@ export default class MasFragmentEditor extends LitElement { `; } + #handleGroupedPreviewLocaleChange = (event) => { + const editor = getActiveMerchCardEditor(); + if (!editor) return; + editor.previewLocaleOverride = event.target.value || null; + }; + + #handlePreviewLocaleChange = (event) => { + if (!this.fragmentStore?.previewStore) return; + const localeValue = event.detail?.value ?? null; + const changed = this.fragmentStore.previewStore.setPreviewLocaleOverride(localeValue); + if (!changed) return; + this.fragmentStore.previewStore.resolveFragment(); + this.requestUpdate(); + }; + + get groupedPreviewLocaleSelector() { + const editor = getActiveMerchCardEditor(); + const locales = editor?.groupedPreviewLocales || []; + if (!locales.length) return nothing; + + const selectedLocale = editor?.previewLocaleOverride || locales[0].code; + + return html` +
+ Preview card for: + + ${locales.map((locale) => html`${locale.label}`)} + +
+ `; + } + get localeVariationHeader() { if (!this.fragment || !this.editorContextStore.isVariation(this.fragment.id)) { return nothing; @@ -1544,6 +1602,7 @@ export default class MasFragmentEditor extends LitElement { .updateFragment=${this.updateFragment} .localeDefaultFragment=${this.localeDefaultFragment} .isVariation=${this.editorContextStore.isVariation(this.fragment?.id)} + @preview-locale-change=${this.#handlePreviewLocaleChange} > `; break; @@ -1582,6 +1641,7 @@ export default class MasFragmentEditor extends LitElement { return html`
+ ${this.groupedPreviewLocaleSelector} ${this.editorContextStore.isVariation(this.fragment.id) ? Fragment.isGroupedVariationPath(this.fragment.path) ? this.displayGroupedVariationInfo('preview-header') diff --git a/studio/src/mas-repository.js b/studio/src/mas-repository.js index d1f7854f5..fbb844b93 100644 --- a/studio/src/mas-repository.js +++ b/studio/src/mas-repository.js @@ -29,6 +29,7 @@ import { DICTIONARY_ENTRY_MODEL_ID, TAG_STATUS_DRAFT, CARD_MODEL_PATH, + COMPAT_VERSION, MAS_PRODUCT_CODE_PREFIX, PZN_FOLDER, SURFACES, @@ -85,6 +86,21 @@ export async function prepopulateFragmentCache(fragmentId, previewFragment) { fragmentCache.add(cacheData); } +function ensureCompatVersionOnMerchCardFieldList(modelPath, fields) { + if (modelPath !== CARD_MODEL_PATH) return false; + const idx = fields.findIndex((f) => f.name === 'compatVersion'); + const valuesEmpty = (vals) => !vals?.length || vals[0] === '' || vals[0] == null; + if (idx === -1) { + fields.push({ name: 'compatVersion', type: 'number', values: [COMPAT_VERSION] }); + return true; + } + if (valuesEmpty(fields[idx].values)) { + fields[idx] = { ...fields[idx], type: fields[idx].type || 'number', values: [COMPAT_VERSION] }; + return true; + } + return false; +} + export class MasRepository extends LitElement { static properties = { bucket: { type: String }, @@ -1169,7 +1185,7 @@ export class MasRepository extends LitElement { if (key === 'tags') { fields.push({ name: key, type: 'tag', values: value }); } else { - const type = key === 'locReady' ? 'boolean' : 'text'; + const type = key === 'locReady' ? 'boolean' : key === 'compatVersion' ? 'number' : 'text'; fields.push({ name: key, type, values: [value] }); } return fields; @@ -1265,6 +1281,11 @@ export class MasRepository extends LitElement { return false; } + if (!fragmentToSave.fields) { + fragmentToSave.fields = []; + } + ensureCompatVersionOnMerchCardFieldList(fragmentToSave.model?.path, fragmentToSave.fields); + try { const savedFragment = await this.aem.sites.cf.fragments.save(fragmentToSave); if (!savedFragment) throw new Error('Invalid fragment.'); @@ -1327,7 +1348,11 @@ export class MasRepository extends LitElement { this.operation.set(OPERATIONS.CLONE); const result = await this.aem.sites.cf.fragments.copy(this.fragmentInEdit); let savedResult = result; - const needsSave = (updatedTitle && updatedTitle !== result.title) || osi; + if (!result.fields) { + result.fields = []; + } + const needsCompatSave = ensureCompatVersionOnMerchCardFieldList(result.model?.path, result.fields); + const needsSave = (updatedTitle && updatedTitle !== result.title) || osi || needsCompatSave; if (needsSave) { if (updatedTitle && updatedTitle !== result.title) { result.title = updatedTitle; @@ -1601,13 +1626,16 @@ export class MasRepository extends LitElement { throw new Error(`A variation already exists at ${targetPath}`); } + const createFields = []; + ensureCompatVersionOnMerchCardFieldList(parentFragment.model?.path, createFields); + const newFragment = await this.aem.sites.cf.fragments.create({ title: parentFragment.title, description: parentFragment.description, modelId: parentFragment.model.id, parentPath: targetFolder, name: fragmentName, - fields: [], + fields: createFields, }); if (parentFragment.tags?.length) { @@ -1888,13 +1916,19 @@ export class MasRepository extends LitElement { fragmentName = `${fragmentName}-${suffix}`; } + const groupedFields = []; + if (pznTags?.length) { + groupedFields.push({ name: 'pznTags', type: 'tag', multiple: true, values: pznTags }); + } + ensureCompatVersionOnMerchCardFieldList(parentFragment.model?.path, groupedFields); + const newFragment = await this.aem.sites.cf.fragments.create({ title: parentFragment.title, description: parentFragment.description, modelId: parentFragment.model.id, parentPath: targetFolder, name: fragmentName, - fields: pznTags?.length ? [{ name: 'pznTags', type: 'tag', multiple: true, values: pznTags }] : [], + fields: groupedFields, }); if (parentFragment.tags?.length) { @@ -1950,6 +1984,8 @@ export class MasRepository extends LitElement { .filter((field) => field.name !== 'variations') .map((field) => (field.name === 'pznTags' ? { ...field, values: pznTags } : field)); + ensureCompatVersionOnMerchCardFieldList(sourceFragment.model?.path, fieldsToClone); + const newFragment = await this.aem.sites.cf.fragments.create({ title: sourceFragment.title, description: sourceFragment.description, diff --git a/studio/src/reactivity/preview-fragment-store.js b/studio/src/reactivity/preview-fragment-store.js index afe5945ac..71ea8a9c4 100644 --- a/studio/src/reactivity/preview-fragment-store.js +++ b/studio/src/reactivity/preview-fragment-store.js @@ -61,6 +61,7 @@ export function mergeResolvedPreviewFields(originalFields = [], resolvedFields = export class PreviewFragmentStore extends FragmentStore { resolved = false; placeholderUnsubscribe = null; + previewLocaleOverride = null; #resolving = false; #resolveDebounceTimer = null; #refreshDebounceTimer = null; @@ -136,6 +137,16 @@ export class PreviewFragmentStore extends FragmentStore { this.resolveFragment(); } + setPreviewLocaleOverride(value) { + const nextValue = value || null; + if (this.previewLocaleOverride === nextValue) { + return false; + } + this.previewLocaleOverride = nextValue; + this.resolved = false; + return true; + } + resolveFragment(immediate = false) { this.lazy = false; clearTimeout(this.#resolveDebounceTimer); @@ -214,7 +225,7 @@ export class PreviewFragmentStore extends FragmentStore { body.fields = serializePreviewFields(originalFields); const context = { - locale: Store.localeOrRegion(), + locale: this.previewLocaleOverride || Store.localeOrRegion(), surface: Store.surface(), dictionary: Store.previewDictionary(), preview: { url: ODIN_PREVIEW_FRAGMENTS_URL }, diff --git a/studio/src/reactivity/source-fragment-store.js b/studio/src/reactivity/source-fragment-store.js index 15d6f3a99..eae3bfe7c 100644 --- a/studio/src/reactivity/source-fragment-store.js +++ b/studio/src/reactivity/source-fragment-store.js @@ -81,7 +81,10 @@ export class SourceFragmentStore extends FragmentStore { return success; } - resolvePreviewFragment() { + resolvePreviewFragment(previewLocaleOverride) { + if (previewLocaleOverride !== undefined) { + this.previewStore.setPreviewLocaleOverride(previewLocaleOverride); + } this.previewStore.resolveFragment(); } diff --git a/studio/src/rte/ost.js b/studio/src/rte/ost.js index f03f3f396..0c7025465 100644 --- a/studio/src/rte/ost.js +++ b/studio/src/rte/ost.js @@ -202,6 +202,7 @@ export function openOfferSelectorTool(triggerElement, offerElement) { let initialReferenceOsi; const aosAccessToken = localStorage.getItem('masAccessToken') ?? window.adobeid.authorize(); const searchParameters = new URLSearchParams(); + const promotionCode = triggerElement?.closest('merch-card-editor')?.getEffectiveFieldValue('promoCode', 0)?.trim(); const offerSelectorPlaceholderOptions = {}; if (offerElement) { @@ -223,6 +224,10 @@ export function openOfferSelectorTool(triggerElement, offerElement) { } }); + if (promotionCode && !offerSelectorPlaceholderOptions.promotionCode) { + offerSelectorPlaceholderOptions.promotionCode = promotionCode; + } + [ 'promotionCode', // contextual promo code (e.g. set on card/) 'storedPromoOverride', // promo code set directly on price/CTA diff --git a/studio/src/rte/rte-field.js b/studio/src/rte/rte-field.js index b68093b67..fde8f8ca7 100644 --- a/studio/src/rte/rte-field.js +++ b/studio/src/rte/rte-field.js @@ -1195,6 +1195,7 @@ class RteField extends LitElement { const parser = DOMParser.fromSchema(this.#editorSchema); const doc = parser.parse(container); const tr = this.editorView.state.tr.replaceWith(0, this.editorView.state.doc.content.size, doc.content); + tr.setMeta('external', true); this.editorView.dispatch(tr); } catch (error) { console.error('Error updating editor content:', error); @@ -1217,11 +1218,12 @@ class RteField extends LitElement { const value = this.#serializeContent(newState); // skip change event during initialization const isFirstChange = transaction.getMeta('initialize'); + const isExternalUpdate = transaction.getMeta('external'); if (value !== this.value) { this.#isInternalUpdate = true; this.value = value === '

' ? '' : value; this.#isInternalUpdate = false; - if (isFirstChange) return; + if (isFirstChange || isExternalUpdate) return; this.dispatchEvent( new CustomEvent('change', { bubbles: true, diff --git a/studio/test/aem/fragment.test.js b/studio/test/aem/fragment.test.js index 2c719f886..2495770d6 100644 --- a/studio/test/aem/fragment.test.js +++ b/studio/test/aem/fragment.test.js @@ -491,6 +491,28 @@ describe('Fragment', () => { }); }); + it('does not reset compatVersion when same as parent', () => { + const p = new Fragment( + createFragmentConfig({ + fields: [ + { name: 'compatVersion', type: 'number', values: [1] }, + { name: 'title', values: ['Parent Title'] }, + ], + }), + ); + const v = new Fragment( + createFragmentConfig({ + fields: [ + { name: 'compatVersion', type: 'number', values: [1] }, + { name: 'title', values: ['Parent Title'] }, + ], + }), + ); + const prepared = v.prepareVariationForSave(p); + expect(prepared.getFieldValues('compatVersion')).to.deep.equal([1]); + expect(prepared.getFieldValues('title')).to.deep.equal([]); + }); + it('returns a new Fragment instance and handles null parent', () => { const variation = new Fragment(createFragmentConfig({ fields: [{ name: 'title', values: ['Title'] }] })); expect(variation.prepareVariationForSave(null)).to.equal(variation); diff --git a/studio/test/editors/merch-card-editor.test.html b/studio/test/editors/merch-card-editor.test.html index 0057e51bd..b2ca96f70 100644 --- a/studio/test/editors/merch-card-editor.test.html +++ b/studio/test/editors/merch-card-editor.test.html @@ -89,7 +89,7 @@ import { Fragment } from '../../src/aem/fragment.js'; import generateFragmentStore from '../../src/reactivity/source-fragment-store.js'; import Store from '../../src/store.js'; - import { PAGE_NAMES, TAG_PROMOTION_PREFIX } from '../../src/constants.js'; + import { COMPAT_VERSION, PAGE_NAMES, TAG_PROMOTION_PREFIX } from '../../src/constants.js'; import { delay } from '../utils.js'; // Load the existing mock data for a merch card @@ -1305,6 +1305,106 @@ expect(store.value.getFieldValues('description')).to.deep.equal([]); }); }); + + describe('compat version', () => { + it('writes COMPAT_VERSION into the fragment store when effective compat is below the constant', async () => { + const { fragmentStore, editor } = await setupTestEnvironment({}, 'compat'); + await editor.toggleFields(); + const field = fragmentStore.get().getField('compatVersion'); + expect(field).to.exist; + expect(field.values).to.deep.equal([String(COMPAT_VERSION)]); + }); + + it('bumps compat when own value is below the constant', async () => { + const { fragmentStore, editor } = await setupTestEnvironment( + { compatVersion: ['0'] }, + 'compat-bump', + ); + await editor.toggleFields(); + expect(fragmentStore.get().getFieldValues('compatVersion')).to.deep.equal([String(COMPAT_VERSION)]); + }); + + it('reapplies compat after a refresh replaces the fragment data', async () => { + const { fragmentStore, editor } = await setupTestEnvironment({}, 'compat-refresh'); + await editor.toggleFields(); + expect(fragmentStore.get().getFieldValues('compatVersion')).to.deep.equal([String(COMPAT_VERSION)]); + + const refreshed = structuredClone(fragmentStore.get()); + refreshed.fields = refreshed.fields.filter((field) => field.name !== 'compatVersion'); + fragmentStore.refreshFrom(refreshed); + + await editor.updateComplete; + await delay(50); + + expect(fragmentStore.get().getFieldValues('compatVersion')).to.deep.equal([String(COMPAT_VERSION)]); + expect(fragmentStore.get().hasChanges, 'compat should become dirty again after refresh').to.be.true; + }); + + it('does not change compat when own value already meets the constant', async () => { + const { fragmentStore, editor } = await setupTestEnvironment( + { compatVersion: [String(COMPAT_VERSION)] }, + 'compat-ok', + ); + await editor.toggleFields(); + expect(fragmentStore.get().getFieldValues('compatVersion')).to.deep.equal([String(COMPAT_VERSION)]); + expect(fragmentStore.get().hasChanges, 'toggleFields must not bump compat when already current').to + .be.false; + }); + + it('does not bump compat when there is no promoCode value', async () => { + const { fragmentStore, editor } = await setupTestEnvironment( + { + isVariation: false, + path: '/content/dam/mas/nala/en_US/test-root-compat-no-promo', + compatVersion: ['0'], + }, + 'compat-no-promo', + ); + await editor.toggleFields(); + expect(fragmentStore.get().getFieldValues('compatVersion')).to.deep.equal(['0']); + }); + }); + + describe('commerce price providers', () => { + it('registers both providers and does not duplicate on repeated calls', async () => { + const { editor } = await setupTestEnvironment({}, 'providers'); + const registered = []; + const fakeService = { + providers: { + has: (p) => registered.includes(p), + price: (p) => registered.push(p), + checkout: (p) => registered.push(p), + }, + }; + editor.registerCommerceProviders(fakeService); + expect(registered.length).to.equal(4); + editor.registerCommerceProviders(fakeService); + expect(registered.length).to.equal(4); + }); + + it('registers providers when an unrelated provider is already registered', async () => { + const { editor } = await setupTestEnvironment({}, 'providers-partial'); + const registered = []; + const firstProvider = () => {}; + registered.push(firstProvider); + const fakeService = { + providers: { + has: (p) => registered.includes(p), + price: (p) => registered.push(p), + checkout: (p) => registered.push(p), + }, + }; + const before = registered.length; + editor.registerCommerceProviders(fakeService); + // Both editor providers are registered for price and checkout. + expect(registered.length).to.equal(before + 4); + }); + + it('does not throw when commerce service is unavailable', async () => { + const { editor } = await setupTestEnvironment({}, 'providers-missing-service'); + expect(() => editor.registerCommerceProviders(null)).to.not.throw(); + }); + }); }); }); diff --git a/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps b/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps index 045eefaac..0b637b290 100644 --- a/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps +++ b/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps @@ -23,6 +23,13 @@ "0ef2a804-e788-4959-abb8-b4d96a18b0ef" ] }, + { + "name": "compatVersion", + "type": "number", + "multiple": false, + "locked": false, + "values": [] + }, { "name": "osi", "type": "text", @@ -150,6 +157,13 @@ "Buy now" ] }, + { + "name": "promoCode", + "type": "text", + "multiple": false, + "locked": false, + "values": [] + }, { "name": "parent", "type": "content-fragment", @@ -213,4 +227,4 @@ }, "validationStatus": [], "fieldTags": [] -} \ No newline at end of file +} diff --git a/studio/test/rte/rte-field.test.html b/studio/test/rte/rte-field.test.html index 3388b179e..827b5e2ae 100644 --- a/studio/test/rte/rte-field.test.html +++ b/studio/test/rte/rte-field.test.html @@ -103,6 +103,22 @@ const rte = await createFromTemplate('rte', this.test.title); expect(rte.shadowRoot).exist; }); + + it('should not emit change when syncing an external value update', async function () { + const rte = await createFromTemplate('rte-link', this.test.title); + let changeCount = 0; + rte.addEventListener('change', () => { + changeCount += 1; + }); + + rte.value = 'Buy now'; + await delay(100); + + expect(changeCount).to.equal(0); + expect(rte.value).to.equal( + '

Buy now

', + ); + }); }); describe('RTE Field: styling features', () => { diff --git a/web-components/dist/mas.js b/web-components/dist/mas.js index 232af1f93..f946a5208 100644 --- a/web-components/dist/mas.js +++ b/web-components/dist/mas.js @@ -501,12 +501,12 @@ window.masPriceLiterals = { ":type": "sheet" } .data; -var Kn=Object.defineProperty;var Qn=e=>{throw TypeError(e)};var _l=(e,t,r)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var et=(e,t)=>()=>(e&&(t=e(e=0)),t);var Zn=(e,t)=>{for(var r in t)Kn(e,r,{get:t[r],enumerable:!0})};var m=(e,t,r)=>_l(e,typeof t!="symbol"?t+"":t,r),ta=(e,t,r)=>t.has(e)||Qn("Cannot "+r);var p=(e,t,r)=>(ta(e,t,"read from private field"),r?r.call(e):t.get(e)),E=(e,t,r)=>t.has(e)?Qn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),y=(e,t,r,i)=>(ta(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(ta(e,t,"access private method"),r);var Jn=(e,t,r,i)=>({set _(a){y(e,t,a,r)},get _(){return p(e,t,i)}});var Ii,zi,hn,Gs,zr,me,b,pn,Di,mn=et(()=>{Ii=window,zi=Ii.ShadowRoot&&(Ii.ShadyCSS===void 0||Ii.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hn=Symbol(),Gs=new WeakMap,zr=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==hn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(zi&&t===void 0){let i=r!==void 0&&r.length===1;i&&(t=Gs.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Gs.set(r,t))}return t}toString(){return this.cssText}},me=e=>new zr(typeof e=="string"?e:e+"",void 0,hn),b=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((i,a,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+e[n+1],e[0]);return new zr(r,e,hn)},pn=(e,t)=>{zi?e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):t.forEach(r=>{let i=document.createElement("style"),a=Ii.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=r.cssText,e.appendChild(i)})},Di=zi?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let i of t.cssRules)r+=i.cssText;return me(r)})(e):e});var un,$i,qs,Hh,Vs,fn,js,gn,xn,Fe,Hi=et(()=>{mn();mn();$i=window,qs=$i.trustedTypes,Hh=qs?qs.emptyScript:"",Vs=$i.reactiveElementPolyfillSupport,fn={toAttribute(e,t){switch(t){case Boolean:e=e?Hh:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},js=(e,t)=>t!==e&&(t==t||e==e),gn={attribute:!0,type:String,converter:fn,reflect:!1,hasChanged:js},xn="finalized",Fe=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((r,i)=>{let a=this._$Ep(i,r);a!==void 0&&(this._$Ev.set(a,i),t.push(a))}),t}static createProperty(t,r=gn){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(t,r),!r.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,a=this.getPropertyDescriptor(t,i,r);a!==void 0&&Object.defineProperty(this.prototype,t,a)}}static getPropertyDescriptor(t,r,i){return{get(){return this[r]},set(a){let n=this[t];this[r]=a,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||gn}static finalize(){if(this.hasOwnProperty(xn))return!1;this[xn]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let a of i)this.createProperty(a,r[a])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let a of i)r.unshift(Di(a))}else t!==void 0&&r.push(Di(t));return r}static _$Ep(t,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(r=>r(this))}addController(t){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var t;let r=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return pn(r,this.constructor.elementStyles),r}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$EO(t,r,i=gn){var a;let n=this.constructor._$Ep(t,i);if(n!==void 0&&i.reflect===!0){let o=(((a=i.converter)===null||a===void 0?void 0:a.toAttribute)!==void 0?i.converter:fn).toAttribute(r,i.type);this._$El=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,r){var i;let a=this.constructor,n=a._$Ev.get(t);if(n!==void 0&&this._$El!==n){let o=a.getPropertyOptions(n),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:fn;this._$El=n,this[n]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(t,r,i){let a=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||js)(this[t],r)?(this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):a=!1),!this.isUpdatePending&&a&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((a,n)=>this[n]=a),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(a=>{var n;return(n=a.hostUpdate)===null||n===void 0?void 0:n.call(a)}),this.update(i)):this._$Ek()}catch(a){throw r=!1,this._$Ek(),a}r&&this._$AE(i)}willUpdate(t){}_$AE(t){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var a;return(a=i.hostUpdated)===null||a===void 0?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};Fe[xn]=!0,Fe.elementProperties=new Map,Fe.elementStyles=[],Fe.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Fe}),((un=$i.reactiveElementVersions)!==null&&un!==void 0?un:$i.reactiveElementVersions=[]).push("1.6.3")});function ac(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ws!==void 0?Ws.createHTML(t):t}function $t(e,t,r=e,i){var a,n,o,s;if(t===Ue)return t;let c=i!==void 0?(a=r._$Co)===null||a===void 0?void 0:a[i]:r._$Cl,l=Hr(t)?void 0:t._$litDirective$;return c?.constructor!==l&&((n=c?._$AO)===null||n===void 0||n.call(c,!1),l===void 0?c=void 0:(c=new l(e),c._$AT(e,r,i)),i!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[i]=c:r._$Cl=c),c!==void 0&&(t=$t(e,c._$AS(e,t.values),c,i)),t}var vn,Bi,Dt,Ws,yn,Xe,ec,Bh,bt,$r,Hr,tc,Fh,bn,Dr,Ys,Xs,xt,Ks,Qs,rc,ic,g,df,Ue,w,Zs,vt,Uh,Br,wn,Fr,Ht,En,Gh,An,Sn,Cn,Js,nc,Ur=et(()=>{Bi=window,Dt=Bi.trustedTypes,Ws=Dt?Dt.createPolicy("lit-html",{createHTML:e=>e}):void 0,yn="$lit$",Xe=`lit$${(Math.random()+"").slice(9)}$`,ec="?"+Xe,Bh=`<${ec}>`,bt=document,$r=()=>bt.createComment(""),Hr=e=>e===null||typeof e!="object"&&typeof e!="function",tc=Array.isArray,Fh=e=>tc(e)||typeof e?.[Symbol.iterator]=="function",bn=`[ -\f\r]`,Dr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ys=/-->/g,Xs=/>/g,xt=RegExp(`>|${bn}(?:([^\\s"'>=/]+)(${bn}*=${bn}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),Ks=/'/g,Qs=/"/g,rc=/^(?:script|style|textarea|title)$/i,ic=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),g=ic(1),df=ic(2),Ue=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Zs=new WeakMap,vt=bt.createTreeWalker(bt,129,null,!1);Uh=(e,t)=>{let r=e.length-1,i=[],a,n=t===2?"":"",o=Dr;for(let s=0;s"?(o=a??Dr,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?xt:d[3]==='"'?Qs:Ks):o===Qs||o===Ks?o=xt:o===Ys||o===Xs?o=Dr:(o=xt,a=void 0);let f=o===xt&&e[s+1].startsWith("/>")?" ":"";n+=o===Dr?c+Bh:h>=0?(i.push(l),c.slice(0,h)+yn+c.slice(h)+Xe+f):c+Xe+(h===-2?(i.push(void 0),s):f)}return[ac(e,n+(e[r]||"")+(t===2?"":"")),i]},Br=class e{constructor({strings:t,_$litType$:r},i){let a;this.parts=[];let n=0,o=0,s=t.length-1,c=this.parts,[l,d]=Uh(t,r);if(this.el=e.createElement(l,i),vt.currentNode=this.el.content,r===2){let h=this.el.content,u=h.firstChild;u.remove(),h.append(...u.childNodes)}for(;(a=vt.nextNode())!==null&&c.length0){a.textContent=Dt?Dt.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,i,a){let n=this.strings,o=!1;if(n===void 0)t=$t(this,t,r,0),o=!Hr(t)||t!==this._$AH&&t!==Ue,o&&(this._$AH=t);else{let s=t,c,l;for(t=n[0],c=0;c{var i,a;let n=(i=r?.renderBefore)!==null&&i!==void 0?i:t,o=n._$litPart$;if(o===void 0){let s=(a=r?.renderBefore)!==null&&a!==void 0?a:null;n._$litPart$=o=new Fr(t.insertBefore($r(),s),s,void 0,r??{})}return o._$AI(e),o}});var Tn,kn,U,oc,sc=et(()=>{Hi();Hi();Ur();Ur();U=class extends Fe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let i=super.createRenderRoot();return(t=(r=this.renderOptions).renderBefore)!==null&&t!==void 0||(r.renderBefore=i.firstChild),i}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=nc(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return Ue}};U.finalized=!0,U._$litElement$=!0,(Tn=globalThis.litElementHydrateSupport)===null||Tn===void 0||Tn.call(globalThis,{LitElement:U});oc=globalThis.litElementPolyfillSupport;oc?.({LitElement:U});((kn=globalThis.litElementVersions)!==null&&kn!==void 0?kn:globalThis.litElementVersions=[]).push("3.3.3")});var cc=et(()=>{});var P=et(()=>{Hi();Ur();sc();cc()});var _n={};Zn(_n,{default:()=>Gr});function qh(){return customElements.get("sp-tooltip")!==void 0&&customElements.get("overlay-trigger")!==void 0&&document.querySelector("sp-theme")!==null}var ue,Gr,Ui=et(()=>{P();ue=class ue extends U{constructor(){super(),this.content="",this.placement="top",this.variant="info",this.size="xs",this.tooltipVisible=!1,this.lastPointerType=null,this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener("mousedown",this.handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mousedown",this.handleClickOutside)}handleClickOutside(t){let r=t.composedPath();ue.activeTooltip===this&&!r.includes(this)&&this.hideTooltip()}showTooltip(){ue.activeTooltip&&ue.activeTooltip!==this&&(ue.activeTooltip.closeOverlay(),ue.activeTooltip.tooltipVisible=!1,ue.activeTooltip.requestUpdate()),ue.activeTooltip=this,this.tooltipVisible=!0}hideTooltip(){ue.activeTooltip===this&&(ue.activeTooltip=null),this.tooltipVisible=!1}handleTap(t){t.preventDefault(),this.tooltipVisible?this.hideTooltip():this.showTooltip()}closeOverlay(){let t=this.shadowRoot?.querySelector("overlay-trigger");t?.open!==void 0&&(t.open=!1)}get effectiveContent(){return this.tooltipText||this.mnemonicText||this.content||""}get effectivePlacement(){return this.tooltipPlacement||this.mnemonicPlacement||this.placement||"top"}renderIcon(){return this.src?g`{throw TypeError(e)};var Ml=(e,t,r)=>t in e?Qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var et=(e,t)=>()=>(e&&(t=e(e=0)),t);var Jn=(e,t)=>{for(var r in t)Qn(e,r,{get:t[r],enumerable:!0})};var m=(e,t,r)=>Ml(e,typeof t!="symbol"?t+"":t,r),ia=(e,t,r)=>t.has(e)||Zn("Cannot "+r);var h=(e,t,r)=>(ia(e,t,"read from private field"),r?r.call(e):t.get(e)),w=(e,t,r)=>t.has(e)?Zn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),y=(e,t,r,i)=>(ia(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(ia(e,t,"access private method"),r);var eo=(e,t,r,i)=>({set _(a){y(e,t,a,r)},get _(){return h(e,t,i)}});var zi,Di,mn,qs,zr,me,b,un,$i,gn=et(()=>{zi=window,Di=zi.ShadowRoot&&(zi.ShadyCSS===void 0||zi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,mn=Symbol(),qs=new WeakMap,zr=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==mn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(Di&&t===void 0){let i=r!==void 0&&r.length===1;i&&(t=qs.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&qs.set(r,t))}return t}toString(){return this.cssText}},me=e=>new zr(typeof e=="string"?e:e+"",void 0,mn),b=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((i,a,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+e[n+1],e[0]);return new zr(r,e,mn)},un=(e,t)=>{Di?e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):t.forEach(r=>{let i=document.createElement("style"),a=zi.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=r.cssText,e.appendChild(i)})},$i=Di?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let i of t.cssRules)r+=i.cssText;return me(r)})(e):e});var fn,Hi,Vs,Uh,js,vn,Ws,xn,bn,Fe,Bi=et(()=>{gn();gn();Hi=window,Vs=Hi.trustedTypes,Uh=Vs?Vs.emptyScript:"",js=Hi.reactiveElementPolyfillSupport,vn={toAttribute(e,t){switch(t){case Boolean:e=e?Uh:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},Ws=(e,t)=>t!==e&&(t==t||e==e),xn={attribute:!0,type:String,converter:vn,reflect:!1,hasChanged:Ws},bn="finalized",Fe=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((r,i)=>{let a=this._$Ep(i,r);a!==void 0&&(this._$Ev.set(a,i),t.push(a))}),t}static createProperty(t,r=xn){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(t,r),!r.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,a=this.getPropertyDescriptor(t,i,r);a!==void 0&&Object.defineProperty(this.prototype,t,a)}}static getPropertyDescriptor(t,r,i){return{get(){return this[r]},set(a){let n=this[t];this[r]=a,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||xn}static finalize(){if(this.hasOwnProperty(bn))return!1;this[bn]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let a of i)this.createProperty(a,r[a])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let a of i)r.unshift($i(a))}else t!==void 0&&r.push($i(t));return r}static _$Ep(t,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(r=>r(this))}addController(t){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var t;let r=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return un(r,this.constructor.elementStyles),r}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$EO(t,r,i=xn){var a;let n=this.constructor._$Ep(t,i);if(n!==void 0&&i.reflect===!0){let o=(((a=i.converter)===null||a===void 0?void 0:a.toAttribute)!==void 0?i.converter:vn).toAttribute(r,i.type);this._$El=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,r){var i;let a=this.constructor,n=a._$Ev.get(t);if(n!==void 0&&this._$El!==n){let o=a.getPropertyOptions(n),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:vn;this._$El=n,this[n]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(t,r,i){let a=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||Ws)(this[t],r)?(this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):a=!1),!this.isUpdatePending&&a&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((a,n)=>this[n]=a),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(a=>{var n;return(n=a.hostUpdate)===null||n===void 0?void 0:n.call(a)}),this.update(i)):this._$Ek()}catch(a){throw r=!1,this._$Ek(),a}r&&this._$AE(i)}willUpdate(t){}_$AE(t){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var a;return(a=i.hostUpdated)===null||a===void 0?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};Fe[bn]=!0,Fe.elementProperties=new Map,Fe.elementStyles=[],Fe.shadowRootOptions={mode:"open"},js?.({ReactiveElement:Fe}),((fn=Hi.reactiveElementVersions)!==null&&fn!==void 0?fn:Hi.reactiveElementVersions=[]).push("1.6.3")});function nc(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ys!==void 0?Ys.createHTML(t):t}function $t(e,t,r=e,i){var a,n,o,s;if(t===Ue)return t;let c=i!==void 0?(a=r._$Co)===null||a===void 0?void 0:a[i]:r._$Cl,l=Hr(t)?void 0:t._$litDirective$;return c?.constructor!==l&&((n=c?._$AO)===null||n===void 0||n.call(c,!1),l===void 0?c=void 0:(c=new l(e),c._$AT(e,r,i)),i!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[i]=c:r._$Cl=c),c!==void 0&&(t=$t(e,c._$AS(e,t.values),c,i)),t}var yn,Fi,Dt,Ys,En,Xe,tc,Gh,bt,$r,Hr,rc,qh,wn,Dr,Xs,Ks,xt,Qs,Zs,ic,ac,g,mf,Ue,E,Js,vt,Vh,Br,An,Fr,Ht,Sn,jh,Cn,Tn,kn,ec,oc,Ur=et(()=>{Fi=window,Dt=Fi.trustedTypes,Ys=Dt?Dt.createPolicy("lit-html",{createHTML:e=>e}):void 0,En="$lit$",Xe=`lit$${(Math.random()+"").slice(9)}$`,tc="?"+Xe,Gh=`<${tc}>`,bt=document,$r=()=>bt.createComment(""),Hr=e=>e===null||typeof e!="object"&&typeof e!="function",rc=Array.isArray,qh=e=>rc(e)||typeof e?.[Symbol.iterator]=="function",wn=`[ +\f\r]`,Dr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Xs=/-->/g,Ks=/>/g,xt=RegExp(`>|${wn}(?:([^\\s"'>=/]+)(${wn}*=${wn}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Qs=/'/g,Zs=/"/g,ic=/^(?:script|style|textarea|title)$/i,ac=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),g=ac(1),mf=ac(2),Ue=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),Js=new WeakMap,vt=bt.createTreeWalker(bt,129,null,!1);Vh=(e,t)=>{let r=e.length-1,i=[],a,n=t===2?"":"",o=Dr;for(let s=0;s"?(o=a??Dr,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?xt:d[3]==='"'?Zs:Qs):o===Zs||o===Qs?o=xt:o===Xs||o===Ks?o=Dr:(o=xt,a=void 0);let f=o===xt&&e[s+1].startsWith("/>")?" ":"";n+=o===Dr?c+Gh:p>=0?(i.push(l),c.slice(0,p)+En+c.slice(p)+Xe+f):c+Xe+(p===-2?(i.push(void 0),s):f)}return[nc(e,n+(e[r]||"")+(t===2?"":"")),i]},Br=class e{constructor({strings:t,_$litType$:r},i){let a;this.parts=[];let n=0,o=0,s=t.length-1,c=this.parts,[l,d]=Vh(t,r);if(this.el=e.createElement(l,i),vt.currentNode=this.el.content,r===2){let p=this.el.content,u=p.firstChild;u.remove(),p.append(...u.childNodes)}for(;(a=vt.nextNode())!==null&&c.length0){a.textContent=Dt?Dt.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,i,a){let n=this.strings,o=!1;if(n===void 0)t=$t(this,t,r,0),o=!Hr(t)||t!==this._$AH&&t!==Ue,o&&(this._$AH=t);else{let s=t,c,l;for(t=n[0],c=0;c{var i,a;let n=(i=r?.renderBefore)!==null&&i!==void 0?i:t,o=n._$litPart$;if(o===void 0){let s=(a=r?.renderBefore)!==null&&a!==void 0?a:null;n._$litPart$=o=new Fr(t.insertBefore($r(),s),s,void 0,r??{})}return o._$AI(e),o}});var _n,Pn,U,sc,cc=et(()=>{Bi();Bi();Ur();Ur();U=class extends Fe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let i=super.createRenderRoot();return(t=(r=this.renderOptions).renderBefore)!==null&&t!==void 0||(r.renderBefore=i.firstChild),i}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=oc(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return Ue}};U.finalized=!0,U._$litElement$=!0,(_n=globalThis.litElementHydrateSupport)===null||_n===void 0||_n.call(globalThis,{LitElement:U});sc=globalThis.litElementPolyfillSupport;sc?.({LitElement:U});((Pn=globalThis.litElementVersions)!==null&&Pn!==void 0?Pn:globalThis.litElementVersions=[]).push("3.3.3")});var lc=et(()=>{});var P=et(()=>{Bi();Ur();cc();lc()});var Ln={};Jn(Ln,{default:()=>Gr});function Wh(){return customElements.get("sp-tooltip")!==void 0&&customElements.get("overlay-trigger")!==void 0&&document.querySelector("sp-theme")!==null}var ue,Gr,Gi=et(()=>{P();ue=class ue extends U{constructor(){super(),this.content="",this.placement="top",this.variant="info",this.size="xs",this.tooltipVisible=!1,this.lastPointerType=null,this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener("mousedown",this.handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mousedown",this.handleClickOutside)}handleClickOutside(t){let r=t.composedPath();ue.activeTooltip===this&&!r.includes(this)&&this.hideTooltip()}showTooltip(){ue.activeTooltip&&ue.activeTooltip!==this&&(ue.activeTooltip.closeOverlay(),ue.activeTooltip.tooltipVisible=!1,ue.activeTooltip.requestUpdate()),ue.activeTooltip=this,this.tooltipVisible=!0}hideTooltip(){ue.activeTooltip===this&&(ue.activeTooltip=null),this.tooltipVisible=!1}handleTap(t){t.preventDefault(),this.tooltipVisible?this.hideTooltip():this.showTooltip()}closeOverlay(){let t=this.shadowRoot?.querySelector("overlay-trigger");t?.open!==void 0&&(t.open=!1)}get effectiveContent(){return this.tooltipText||this.mnemonicText||this.content||""}get effectivePlacement(){return this.tooltipPlacement||this.mnemonicPlacement||this.placement||"top"}renderIcon(){return this.src?g``:g``}render(){let t=this.effectiveContent,r=this.effectivePlacement;return t?qh()?g` + >`:g``}render(){let t=this.effectiveContent,r=this.effectivePlacement;return t?Wh()?g` this.showTooltip()} @@ -652,10 +652,10 @@ var Kn=Object.defineProperty;var Qn=e=>{throw TypeError(e)};var _l=(e,t,r)=>t in margin-left: 5px; border-right-color: var(--spectrum-gray-800, #323232); } - `);Gr=ue;customElements.define("mas-mnemonic",Gr)});var tt={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},eo=1e3;function Pl(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function to(e){if(e==null)return;let t=typeof e;if(t==="function")return e.name?`function ${e.name}`:"function";if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:i,originatingRequest:a,status:n}=e;return[i,n,a].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!tt.serializableTypes.includes(r))return r}return e}function Ll(e,t){if(!tt.ignoredProperties.includes(e))return to(t)}var ra={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,i=[],a=[],n=t;r.forEach(l=>{l!=null&&(Pl(l)?i:a).push(l)}),i.length&&(n+=" "+i.map(to).join(" "));let{pathname:o,search:s}=window.location,c=`${tt.delimiter}page=${o}${s}`;c.length>eo&&(c=`${c.slice(0,eo)}`),n+=c,a.length&&(n+=`${tt.delimiter}facts=`,n+=JSON.stringify(a,Ll)),window.lana?.log(n,tt)}};function si(e){Object.assign(tt,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in tt&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var ya={};Zn(ya,{CLASS_NAME_FAILED:()=>oa,CLASS_NAME_HIDDEN:()=>Rl,CLASS_NAME_PENDING:()=>sa,CLASS_NAME_RESOLVED:()=>ca,CheckoutWorkflow:()=>io,CheckoutWorkflowStep:()=>ce,Commitment:()=>rt,ERROR_MESSAGE_BAD_REQUEST:()=>la,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Ul,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>da,EVENT_AEM_ERROR:()=>nt,EVENT_AEM_LOAD:()=>at,EVENT_MAS_ERROR:()=>na,EVENT_MAS_READY:()=>fr,EVENT_MERCH_ADDON_AND_QUANTITY_UPDATE:()=>li,EVENT_MERCH_CARD_ACTION_MENU_TOGGLE:()=>ia,EVENT_MERCH_CARD_COLLECTION_LITERALS_CHANGED:()=>it,EVENT_MERCH_CARD_COLLECTION_SHOWMORE:()=>Bl,EVENT_MERCH_CARD_COLLECTION_SIDENAV_ATTACHED:()=>Hl,EVENT_MERCH_CARD_COLLECTION_SORT:()=>$l,EVENT_MERCH_CARD_QUANTITY_CHANGE:()=>Pt,EVENT_MERCH_OFFER_READY:()=>_t,EVENT_MERCH_OFFER_SELECT_READY:()=>gr,EVENT_MERCH_QUANTITY_SELECTOR_CHANGE:()=>te,EVENT_MERCH_SEARCH_CHANGE:()=>Dl,EVENT_MERCH_SIDENAV_SELECT:()=>Fl,EVENT_MERCH_STOCK_CHANGE:()=>Il,EVENT_MERCH_STORAGE_CHANGE:()=>zl,EVENT_OFFER_SELECTED:()=>aa,EVENT_TYPE_FAILED:()=>ha,EVENT_TYPE_READY:()=>ci,EVENT_TYPE_RESOLVED:()=>Lt,Env:()=>Re,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>ke,HEADER_X_REQUEST_ID:()=>xr,LOG_NAMESPACE:()=>pa,Landscape:()=>Ve,MARK_DURATION_SUFFIX:()=>ct,MARK_START_SUFFIX:()=>st,MODAL_TYPE_3_IN_1:()=>ot,NAMESPACE:()=>Ml,PARAM_AOS_API_KEY:()=>Gl,PARAM_ENV:()=>ua,PARAM_LANDSCAPE:()=>ga,PARAM_MAS_PREVIEW:()=>ma,PARAM_WCS_API_KEY:()=>ql,PROVIDER_ENVIRONMENT:()=>va,SELECTOR_MAS_CHECKOUT_LINK:()=>Ce,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Te,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>De,SUPPORTED_COUNTRIES:()=>ba,TAG_NAME_SERVICE:()=>Ol,TEMPLATE_PRICE:()=>Vl,TEMPLATE_PRICE_ANNUAL:()=>Wl,TEMPLATE_PRICE_LEGAL:()=>xe,TEMPLATE_PRICE_STRIKETHROUGH:()=>jl,Term:()=>ye,WCS_PROD_URL:()=>fa,WCS_STAGE_URL:()=>xa});var rt=Object.freeze({MONTH:"MONTH",YEAR:"YEAR",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",PERPETUAL:"PERPETUAL",TERM_LICENSE:"TERM_LICENSE",ACCESS_PASS:"ACCESS_PASS",THREE_MONTHS:"THREE_MONTHS",SIX_MONTHS:"SIX_MONTHS"}),ye=Object.freeze({ANNUAL:"ANNUAL",MONTHLY:"MONTHLY",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",P1D:"P1D",P1Y:"P1Y",P3Y:"P3Y",P10Y:"P10Y",P15Y:"P15Y",P3D:"P3D",P7D:"P7D",P30D:"P30D",HALF_YEARLY:"HALF_YEARLY",QUARTERLY:"QUARTERLY"}),Ml="merch",Rl="hidden",ci="wcms:commerce:ready",Ol="mas-commerce-service",D='span[is="inline-price"][data-wcs-osi]',Ce='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]',Nl="sp-button[data-wcs-osi]",ro='a[is="upt-link"]',ur=`${D},${Ce},${ro}`,_t="merch-offer:ready",gr="merch-offer-select:ready",ia="merch-card:action-menu-toggle",aa="merch-offer:selected",Il="merch-stock:change",zl="merch-storage:change",te="merch-quantity-selector:change",Pt="merch-card-quantity:change",li="merch-modal:addon-and-quantity-update",Dl="merch-search:change",$l="merch-card-collection:sort",it="merch-card-collection:literals-changed",Hl="merch-card-collection:sidenav-attached",Bl="merch-card-collection:showmore",Fl="merch-sidenav:select",at="aem:load",nt="aem:error",fr="mas:ready",na="mas:error",oa="placeholder-failed",sa="placeholder-pending",ca="placeholder-resolved",la="Bad WCS request",da="Commerce offer not found",Ul="Literals URL not provided",ha="mas:failed",Lt="mas:resolved",pa="mas/commerce",ma="mas.preview",ua="commerce.env",ga="commerce.landscape",Gl="commerce.aosKey",ql="commerce.wcsKey",fa="https://www.adobe.com/web_commerce_artifact",xa="https://www.stage.adobe.com/web_commerce_artifact_stage",Te="failed",qe="pending",De="resolved",Ve={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"},xr="X-Request-Id",ce=Object.freeze({SEGMENTATION:"segmentation",BUNDLE:"bundle",COMMITMENT:"commitment",RECOMMENDATION:"recommendation",EMAIL:"email",PAYMENT:"payment",CHANGE_PLAN_TEAM_PLANS:"change-plan/team-upgrade/plans",CHANGE_PLAN_TEAM_PAYMENT:"change-plan/team-upgrade/payment"}),io="UCv3",Re=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"}),va={PRODUCTION:"PRODUCTION"},ot={TWP:"twp",D2P:"d2p",CRM:"crm"},st=":start",ct=":duration",Vl="price",jl="price-strikethrough",Wl="annual",xe="legal",ke="mas-ff-defaults",Mt="mas-ff-annual-price",Yl={alphabetical:"alphabetical",authored:"authored"},ba=["AE","AM","AR","AT","AU","AZ","BB","BD","BE","BG","BH","BO","BR","BS","BY","CA","CH","CL","CN","CO","CR","CY","CZ","DE","DK","DO","DZ","EC","EE","EG","ES","FI","FR","GB","GE","GH","GR","GT","HK","HN","HR","HU","ID","IE","IL","IN","IQ","IS","IT","JM","JO","JP","KE","KG","KR","KW","KZ","LA","LB","LK","LT","LU","LV","MA","MD","MO","MT","MU","MX","MY","NG","NI","NL","NO","NP","NZ","OM","PA","PE","PH","PK","PL","PR","PT","PY","QA","RO","RS","RU","SA","SE","SG","SI","SK","SV","TH","TJ","TM","TN","TR","TT","TW","TZ","UA","US","UY","UZ","VE","VN","YE","ZA"];var ao="tacocat.js";var wa=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),no=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function F(e,t={},{metadata:r=!0,search:i=!0,storage:a=!0}={}){let n;if(i&&n==null){let o=new URLSearchParams(window.location.search),s=Rt(i)?i:e;n=o.get(s)}if(a&&n==null){let o=Rt(a)?a:e;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(r&&n==null){let o=Kl(Rt(r)?r:e);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[e]}var Xl=e=>typeof e=="boolean",di=e=>typeof e=="function",hi=e=>typeof e=="number",oo=e=>e!=null&&typeof e=="object";var Rt=e=>typeof e=="string",so=e=>Rt(e)&&e,vr=e=>hi(e)&&Number.isFinite(e)&&e>0;function pi(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,i])=>{t(i)&&delete e[r]}),e}function T(e,t){if(Xl(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function br(e,t,r){let i=Object.values(t);return i.find(a=>wa(a,e))??r??i[0]}function Kl(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,i)=>`${r}-${i}`).replace(/\W+/gu,"-").toLowerCase()}function co(e,t=1){return hi(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Ql=Date.now(),Ea=()=>`(+${Date.now()-Ql}ms)`,mi=new Set,Zl=T(F("tacocat.debug",{},{metadata:!1}),!1);function lo(e){let t=`[${ao}/${e}]`,r=(o,s,...c)=>o?!0:(a(s,...c),!1),i=Zl?(o,...s)=>{console.debug(`${t} ${o}`,...s,Ea())}:()=>{},a=(o,...s)=>{let c=`${t} ${o}`;mi.forEach(([l])=>l(c,...s))};return{assert:r,debug:i,error:a,warn:(o,...s)=>{let c=`${t} ${o}`;mi.forEach(([,l])=>l(c,...s))}}}function Jl(e,t){let r=[e,t];return mi.add(r),()=>{mi.delete(r)}}Jl((e,...t)=>{console.error(e,...t,Ea())},(e,...t)=>{console.warn(e,...t,Ea())});var ed="no promo",ho="promo-tag",td="yellow",rd="neutral",id=(e,t,r)=>{let i=n=>n||ed,a=r?` (was "${i(t)}")`:"";return`${i(e)}${a}`},ad="cancel-context",ui=(e,t)=>{let r=e===ad,i=!r&&e?.length>0,a=(i||r)&&(t&&t!=e||!t&&!r),n=a&&i||!a&&!!t,o=n?e||t:void 0;return{effectivePromoCode:o,overridenPromoCode:e,className:n?ho:`${ho} no-promo`,text:id(o,t,a),variant:n?td:rd,isOverriden:a}};var Aa;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Aa||(Aa={}));var ve;(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"})(ve||(ve={}));var we;(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"})(we||(we={}));var Sa;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Sa||(Sa={}));var Ca;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ca||(Ca={}));var Ta;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Ta||(Ta={}));var ka;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(ka||(ka={}));var _a="ABM",Pa="PUF",La="M2M",Ma="PERPETUAL",Ra="P3Y",nd="TAX_INCLUSIVE_DETAILS",od="TAX_EXCLUSIVE",po={ABM:_a,PUF:Pa,M2M:La,PERPETUAL:Ma,P3Y:Ra},qp={[_a]:{commitment:ve.YEAR,term:we.MONTHLY},[Pa]:{commitment:ve.YEAR,term:we.ANNUAL},[La]:{commitment:ve.MONTH,term:we.MONTHLY},[Ma]:{commitment:ve.PERPETUAL,term:void 0},[Ra]:{commitment:ve.THREE_MONTHS,term:we.P3Y}},mo="Value is not an offer",yr=e=>{if(typeof e!="object")return mo;let{commitment:t,term:r}=e,i=sd(t,r);return{...e,planType:i}};var sd=(e,t)=>{switch(e){case void 0:return mo;case"":return"";case ve.YEAR:return t===we.MONTHLY?_a:t===we.ANNUAL?Pa:"";case ve.MONTH:return t===we.MONTHLY?La:"";case ve.PERPETUAL:return Ma;case ve.TERM_LICENSE:return t===we.P3Y?Ra:"";default:return""}};function uo(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:i,priceWithoutTax:a,priceWithoutDiscountAndTax:n,taxDisplay:o}=t;if(o!==nd)return e;let s={...e,priceDetails:{...t,price:a??r,priceWithoutDiscount:n??i,taxDisplay:od}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var go={LOCAL:"local",PROD:"prod",STAGE:"stage"},Oa={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},Na=new Set,Ia=new Set,fo=new Map,xo={append({level:e,message:t,params:r,timestamp:i,source:a}){console[e](`${i}ms [${a}] %c${t}`,"font-weight: bold;",...r)}},vo={filter:({level:e})=>e!==Oa.DEBUG},cd={filter:()=>!1};function ld(e,t,r,i,a){return{level:e,message:t,namespace:r,get params(){return i.length===1&&di(i[0])&&(i=i[0](),Array.isArray(i)||(i=[i])),i},source:a,timestamp:performance.now().toFixed(3)}}function dd(e){[...Ia].every(t=>t(e))&&Na.forEach(t=>t(e))}function bo(e){let t=(fo.get(e)??0)+1;fo.set(e,t);let r=`${e} #${t}`,i={id:r,namespace:e,module:a=>bo(`${i.namespace}/${a}`),updateConfig:si};return Object.values(Oa).forEach(a=>{i[a]=(n,...o)=>dd(ld(a,n,e,o,r))}),Object.seal(i)}function gi(...e){e.forEach(t=>{let{append:r,filter:i}=t;di(i)&&Ia.add(i),di(r)&&Na.add(r)})}function hd(e={}){let{name:t}=e,r=T(F("commerce.debug",{search:!0,storage:!0}),t===go.LOCAL);return gi(r?xo:vo),t===go.PROD&&gi(ra),le}function pd(){Na.clear(),Ia.clear()}var le={...bo(pa),Level:Oa,Plugins:{consoleAppender:xo,debugFilter:vo,quietFilter:cd,lanaAppender:ra},init:hd,reset:pd,use:gi};var md="mas-commerce-service",ud=le.module("utilities"),gd={requestId:xr,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function wr(e,{country:t,forceTaxExclusive:r}){let i;if(e.length<2)i=e;else{let a=t==="GB"?"EN":"MULT";e.sort((n,o)=>n.language===a?-1:o.language===a?1:0),e.sort((n,o)=>!n.term&&o.term?-1:n.term&&!o.term?1:0),i=[e[0]]}return r&&(i=i.map(uo)),i}var yo=(e,t)=>{let r=e.reduce((i,a)=>i+(t(a)||0),0);return r>0?Math.round(r*100)/100:void 0};function za(e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let[t,...r]=e;for(let s of r){let c=[["commitment","commitment types"],["term","terms"],["priceDetails.formatString","currency formats"]];for(let[l,d]of c){let h=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==h&&ud.warn(`Offers have different ${d}, summing may produce unexpected results`,{expected:h,actual:u})}}let i=[["price",s=>s.priceDetails?.price],["priceWithoutDiscount",s=>s.priceDetails?.priceWithoutDiscount],["priceWithoutTax",s=>s.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",s=>s.priceDetails?.priceWithoutDiscountAndTax]],a={};for(let[s,c]of i){let l=yo(e,c);l!==void 0&&(a[s]=l)}let n=e.some(s=>s.priceDetails?.annualized),o;if(n){let s=[["annualizedPrice",c=>c.priceDetails?.annualized?.annualizedPrice],["annualizedPriceWithoutTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutTax],["annualizedPriceWithoutDiscount",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscount],["annualizedPriceWithoutDiscountAndTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscountAndTax]];o={};for(let[c,l]of s){let d=yo(e,l);d!==void 0&&(o[c]=d)}}return{...t,offerSelectorIds:e.flatMap(s=>s.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...a,...o&&{annualized:o}}}}var fi=e=>window.setTimeout(e);function Ot(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(co).filter(vr);return r.length||(r=[t]),r}function xi(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(so)}function pe(){return document.getElementsByTagName(md)?.[0]}function vi(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[i,a]of Object.entries(gd)){let n=r.get(a);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[i]=n)}return t}var Oe=class e extends Error{constructor(t,r,i){if(super(t,{cause:i}),this.name="MasError",r.response){let a=r.response.headers?.get(xr);a&&(r.requestId=a),r.response.status&&(r.status=r.response.status,r.statusText=r.response.statusText),r.response.url&&(r.url=r.response.url)}delete r.response,this.context=r,Error.captureStackTrace&&Error.captureStackTrace(this,e)}toString(){let t=Object.entries(this.context||{}).map(([i,a])=>`${i}: ${JSON.stringify(a)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` -Caused by: ${this.cause}`),r}};var fd={[Te]:oa,[qe]:sa,[De]:ca},xd={[Te]:ha,[De]:Lt},Er,je=class{constructor(t){E(this,Er);m(this,"changes",new Map);m(this,"connected",!1);m(this,"error");m(this,"log");m(this,"options");m(this,"promises",[]);m(this,"state",qe);m(this,"timer",null);m(this,"value");m(this,"version",0);m(this,"wrapperElement");this.wrapperElement=t,this.log=le.module("mas-element")}update(){[Te,qe,De].forEach(t=>{this.wrapperElement.classList.toggle(fd[t],t===this.state)})}notify(){(this.state===De||this.state===Te)&&(this.state===De?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Te&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Oe&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(xd[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,r,i){this.changes.set(t,i),this.requestUpdate()}connectedCallback(){y(this,Er,pe()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:r,state:i}=this;return De===i?Promise.resolve(this.wrapperElement):Te===i?Promise.reject(t):new Promise((a,n)=>{r.push({resolve:a,reject:n})})}toggleResolved(t,r,i){return t!==this.version?!1:(i!==void 0&&(this.options=i),this.state=De,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),fi(()=>this.notify()),!0)}toggleFailed(t,r,i){if(t!==this.version)return!1;i!==void 0&&(this.options=i),this.error=r,this.state=Te,this.update();let a=this.wrapperElement.getAttribute("is");return this.log?.error(`${a}: Failed to render: ${r.message}`,{element:this.wrapperElement,...r.context,...p(this,Er)?.duration}),fi(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=qe,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!pe()||this.timer)return;let{error:r,options:i,state:a,value:n,version:o}=this;this.state=qe,this.timer=fi(async()=>{this.timer=null;let s=null;if(this.changes.size&&(s=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:s}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:s})),s||t)try{await this.wrapperElement.render?.()===!1&&this.state===qe&&this.version===o&&(this.state=a,this.error=r,this.value=n,this.update(),this.notify())}catch(c){this.toggleFailed(this.version,c,i)}})}};Er=new WeakMap;function wo(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function bi(e,t={}){let{tag:r,is:i}=e,a=document.createElement(r,{is:i});return a.setAttribute("is",i),Object.assign(a.dataset,wo(t)),a}function Eo(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,wo(t)),e):null}var vd=/[0-9\-+#]/,bd=/[^\d\-+#]/g;function Ao(e){return e.search(vd)}function yd(e="#.##"){let t={},r=e.length,i=Ao(e);t.prefix=i>0?e.substring(0,i):"";let a=Ao(e.split("").reverse().join("")),n=r-a,o=e.substring(n,n+1),s=n+(o==="."||o===","?1:0);t.suffix=a>0?e.substring(s,r):"",t.mask=e.substring(i,s),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(bd);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 wd(e,t,r){let i=!1,a={value:e};e<0&&(i=!0,a.value=-a.value),a.sign=i?"-":"",a.value=Number(a.value).toFixed(t.fraction&&t.fraction.length),a.value=Number(a.value).toString();let n=t.fraction&&t.fraction.lastIndexOf("0"),[o="0",s=""]=a.value.split(".");return(!s||s&&s.length<=n)&&(s=n<0?"":(+("0."+s)).toFixed(n+1).replace("0.","")),a.integer=o,a.fraction=s,Ed(a,t),(a.result==="0"||a.result==="")&&(i=!1,a.sign=""),!i&&t.maskHasPositiveSign?a.sign="+":i&&t.maskHasPositiveSign?a.sign="-":i&&(a.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),a}function Ed(e,t){e.result="";let r=t.integer.split(t.separator),i=r.join(""),a=i&&i.indexOf("0");if(a>-1)for(;e.integer.lengthe*12,dt=(e,t,r=1)=>{if(!e)return!1;let{start:i,end:a,displaySummary:{amount:n,duration:o,minProductQuantity:s=1,outcomeType:c}={}}=e;if(!(n&&o&&c)||r=d&&l<=h},lt={MONTH:"MONTH",YEAR:"YEAR"},Cd={[ye.ANNUAL]:12,[ye.MONTHLY]:1,[ye.THREE_YEARS]:36,[ye.TWO_YEARS]:24},$a=(e,t)=>({accept:e,round:t}),Td=[$a(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),$a(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),$a(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],Ha={[rt.YEAR]:{[ye.MONTHLY]:lt.MONTH,[ye.ANNUAL]:lt.YEAR},[rt.MONTH]:{[ye.MONTHLY]:lt.MONTH}},kd=(e,t)=>e.indexOf(`'${t}'`)===0,_d=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),i=Lo(r);return!!i?t||(r=r.replace(/[,\.]0+/,i)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+Ld(e)),r},Pd=e=>{let t=Md(e),r=kd(e,t),i=e.replace(/'.*?'/,""),a=ko.test(i)||_o.test(i);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:a}},Po=e=>e.replace(ko,To).replace(_o,To),Ld=e=>e.match(/#(.?)#/)?.[1]===Co?Sd:Co,Md=e=>e.match(/'(.*?)'/)?.[1]??"",Lo=e=>e.match(/0(.?)0/)?.[1]??"";function Nt({formatString:e,price:t,usePrecision:r,isIndianPrice:i=!1},a,n=o=>o){let{currencySymbol:o,isCurrencyFirst:s,hasCurrencySpace:c}=Pd(e),l=r?Lo(e):"",d=_d(e,r),h=r?2:0,u=n(t,{currencySymbol:o}),f=i?u.toLocaleString("hi-IN",{minimumFractionDigits:h,maximumFractionDigits:h}):So(d,u),x=r?f.lastIndexOf(l):f.length,v=f.substring(0,x),S=f.substring(x+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,f).replace(/SYMBOL/,o),currencySymbol:o,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:v,isCurrencyFirst:s,recurrenceTerm:a}}var Mo=e=>{let{commitment:t,term:r,usePrecision:i}=e,a=Cd[r]??1;return Nt(e,a>1?lt.MONTH:Ha[t]?.[r],n=>{let o={divisor:a,price:n,usePrecision:i},{round:s}=Td.find(({accept:c})=>c(o));if(!s)throw new Error(`Missing rounding rule for: ${JSON.stringify(o)}`);return s(o)})},Ro=({commitment:e,term:t,...r})=>Nt(r,Ha[e]?.[t]),Oo=e=>{let{commitment:t,instant:r,price:i,originalPrice:a,priceWithoutDiscount:n,promotion:o,quantity:s=1,term:c}=e;if(t===rt.YEAR&&c===ye.MONTHLY){if(!o)return Nt(e,lt.YEAR,Da);let{displaySummary:{outcomeType:l,duration:d}={}}=o;switch(l){case"PERCENTAGE_DISCOUNT":if(dt(o,r,s)){let h=parseInt(d.replace("P","").replace("M",""));if(isNaN(h))return Da(i);let u=a*h,f=n*(12-h),x=Math.round((u+f)*100)/100;return Nt({...e,price:x},lt.YEAR)}default:return Nt(e,lt.YEAR,()=>Da(n??i))}}return Nt(e,Ha[t]?.[c])};var No="download",Io="upgrade",zo={e:"EDU",t:"TEAM"};function yi(e,t={},r=""){let i=pe();if(!i)return null;let{checkoutMarketSegment:a,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:h,quantity:u,wcsOsi:f,extraOptions:x,analyticsId:v}=i.collectCheckoutOptions(t),S=bi(e,{checkoutMarketSegment:a,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:h,quantity:u,wcsOsi:f,extraOptions:x,analyticsId:v});return r&&(S.innerHTML=`${r}`),S}function wi(e){return class extends e{constructor(){super(...arguments);m(this,"checkoutActionHandler");m(this,"masElement",new je(this))}attributeChangedCallback(i,a,n){this.masElement.attributeChangedCallback(i,a,n)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.clickHandler)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.clickHandler)}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}get marketSegment(){let i=this.options?.ms??this.value?.[0].marketSegments?.[0];return zo[i]??i}get customerSegment(){let i=this.options?.cs??this.value?.[0]?.customerSegment;return zo[i]??i}get is3in1Modal(){return Object.values(ot).includes(this.getAttribute("data-modal"))}get isOpen3in1Modal(){let i=document.querySelector("meta[name=mas-ff-3in1]");return this.is3in1Modal&&(!i||i.content!=="off")}requestUpdate(i=!1){return this.masElement.requestUpdate(i)}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"]}async render(i={}){let a=pe();if(!a)return!1;this.dataset.imsCountry||a.imsCountryPromise.then(f=>{f&&(this.dataset.imsCountry=f)}),i.imsCountry=null;let n=a.collectCheckoutOptions(i,this);if(!n.wcsOsi.length)return!1;let o;try{o=JSON.parse(n.extraOptions??"{}")}catch(f){this.masElement.log?.error("cannot parse exta checkout options",f)}let s=this.masElement.togglePending(n);this.setCheckoutUrl("");let c=a.resolveOfferSelectors(n),l=await Promise.all(c);l=l.map(f=>wr(f,n));let d=l.flat().find(f=>f.promotion);!dt(d?.promotion,d?.promotion?.displaySummary?.instant,n.quantity[0])&&n.promotionCode&&delete n.promotionCode,n.country=this.dataset.imsCountry||n.country;let u=await a.buildCheckoutAction?.(l.flat(),{...o,...n},this);return this.renderOffers(l.flat(),n,{},u,s)}renderOffers(i,a,n={},o=void 0,s=void 0){let c=pe();if(!c)return!1;if(a={...JSON.parse(this.dataset.extraOptions??"{}"),...a,...n},s??(s=this.masElement.togglePending(a)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),o){this.classList.remove(No,Io),this.masElement.toggleResolved(s,i,a);let{url:d,text:h,className:u,handler:f}=o;d&&this.setCheckoutUrl(d),h&&(this.firstElementChild.innerHTML=h),u&&this.classList.add(...u.split(" ")),f&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=f.bind(this))}if(i.length){if(this.masElement.toggleResolved(s,i,a)){if(!this.classList.contains(No)&&!this.classList.contains(Io)){let d=c.buildCheckoutURL(i,a);this.setCheckoutUrl(a.modal==="true"?"#":d)}return!0}}else{let d=new Error(`Not provided: ${a?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(s,d,a))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(i){}updateOptions(i={}){let a=pe();if(!a)return!1;let{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:h,promotionCode:u,quantity:f,wcsOsi:x}=a.collectCheckoutOptions(i);return Eo(this,{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:h,promotionCode:u,quantity:f,wcsOsi:x}),!0}}}var Ar=class Ar extends wi(HTMLAnchorElement){static createCheckoutLink(t={},r=""){return yi(Ar,t,r)}setCheckoutUrl(t){this.setAttribute("href",t)}get isCheckoutLink(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}}};m(Ar,"is","checkout-link"),m(Ar,"tag","a");var $e=Ar;window.customElements.get($e.is)||window.customElements.define($e.is,$e,{extends:$e.tag});var Rd="p_draft_landscape",Od="/store/",Nd=new Map([["countrySpecific","cs"],["customerSegment","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["addonProductArrangementCode","ao"],["offerType","ot"],["marketSegment","ms"]]),Ba=new Set(["af","ai","ao","apc","appctxid","cli","co","cs","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"]),Id=["env","workflowStep","clientId","country"],Do=new Set(["gid","gtoken","notifauditid","cohortid","productname","sdid","attimer","gcsrc","gcprog","gcprogcat","gcpagetype","mv","mv2"]),$o=e=>Nd.get(e)??e;function Ei(e,t,r){for(let[i,a]of Object.entries(e)){let n=$o(i);a!=null&&r.has(n)&&t.set(n,a)}}function zd(e){switch(e){case va.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function Dd(e,t){for(let r in e){let i=e[r];for(let[a,n]of Object.entries(i)){if(n==null)continue;let o=$o(a);t.set(`items[${r}][${o}]`,n)}}}function $d({url:e,modal:t,is3in1:r}){if(!r||!e?.searchParams)return e;e.searchParams.set("rtc","t"),e.searchParams.set("lo","sl");let i=e.searchParams.get("af");return e.searchParams.set("af",[i,"uc_new_user_iframe","uc_new_system_close"].filter(Boolean).join(",")),e.searchParams.get("cli")!=="doc_cloud"&&e.searchParams.set("cli",t===ot.CRM?"creative":"mini_plans"),e}function Hd(e){let t=new URLSearchParams(window.location.search),r={};Do.forEach(i=>{let a=t.get(i);a!==null&&(r[i]=a)}),Object.keys(r).length>0&&Ei(r,e.searchParams,Do)}function Ho(e){Bd(e);let{env:t,items:r,workflowStep:i,marketSegment:a,customerSegment:n,offerType:o,productArrangementCode:s,landscape:c,modal:l,is3in1:d,preselectPlan:h,...u}=e,f=new URL(zd(t));if(f.pathname=`${Od}${i}`,i!==ce.SEGMENTATION&&i!==ce.CHANGE_PLAN_TEAM_PLANS&&Dd(r,f.searchParams),Ei({...u},f.searchParams,Ba),Hd(f),c===Ve.DRAFT&&Ei({af:Rd},f.searchParams,Ba),i===ce.SEGMENTATION){let x={marketSegment:a,offerType:o,customerSegment:n,productArrangementCode:s,quantity:r?.[0]?.quantity,addonProductArrangementCode:s?r?.find(v=>v.productArrangementCode!==s)?.productArrangementCode:r?.[1]?.productArrangementCode};h?.toLowerCase()==="edu"?f.searchParams.set("ms","EDU"):h?.toLowerCase()==="team"&&f.searchParams.set("cs","TEAM"),Ei(x,f.searchParams,Ba),f.searchParams.get("ot")==="PROMOTION"&&f.searchParams.delete("ot"),f=$d({url:f,modal:l,is3in1:d})}return f.toString()}function Bd(e){for(let t of Id)if(!e[t])throw new Error(`Argument "checkoutData" is not valid, missing: ${t}`);if(e.workflowStep!==ce.SEGMENTATION&&e.workflowStep!==ce.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}var N=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflowStep:ce.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,displayPlanType:!1,env:Re.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,alternativePrice:!1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:Ve.PUBLISHED});function Bo({settings:e,providers:t}){function r(n,o){let{checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:h,quantity:u,preselectPlan:f,env:x}=e,v={checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:h,quantity:u,preselectPlan:f,env:x};if(o)for(let Tt of t.checkout)Tt(o,v);let{checkoutMarketSegment:S,checkoutWorkflowStep:z=c,imsCountry:I,country:C=I??l,language:O=d,quantity:K=u,entitlement:q,upgrade:Q,modal:ee,perpetual:de,promotionCode:ie=h,wcsOsi:W,extraOptions:$,...he}=Object.assign(v,o?.dataset??{},n??{}),be=br(z,ce,N.checkoutWorkflowStep);return v=pi({...he,extraOptions:$,checkoutClientId:s,checkoutMarketSegment:S,country:C,quantity:Ot(K,N.quantity),checkoutWorkflowStep:be,language:O,entitlement:T(q),upgrade:T(Q),modal:ee,perpetual:T(de),promotionCode:ui(ie).effectivePromoCode,wcsOsi:xi(W),preselectPlan:f}),v}function i(n,o){if(!Array.isArray(n)||!n.length||!o)return"";let{env:s,landscape:c}=e,{checkoutClientId:l,checkoutMarketSegment:d,checkoutWorkflowStep:h,country:u,promotionCode:f,quantity:x,preselectPlan:v,ms:S,cs:z,...I}=r(o),C=document.querySelector("meta[name=mas-ff-3in1]"),O=Object.values(ot).includes(o.modal)&&(!C||C.content!=="off"),K=window.frameElement||O?"if":"fp",[{productArrangementCode:q,marketSegments:[Q],customerSegment:ee,offerType:de}]=n,ie=S??Q??d,W=z??ee;v?.toLowerCase()==="edu"?ie="EDU":v?.toLowerCase()==="team"&&(W="TEAM");let $={is3in1:O,checkoutPromoCode:f,clientId:l,context:K,country:u,env:s,items:[],marketSegment:ie,customerSegment:W,offerType:de,productArrangementCode:q,workflowStep:h,landscape:c,...I},he=x[0]>1?x[0]:void 0;if(n.length===1){let{offerId:be}=n[0];$.items.push({id:be,quantity:he})}else $.items.push(...n.map(({offerId:be,productArrangementCode:Tt})=>({id:be,quantity:he,...O?{productArrangementCode:Tt}:{}})));return Ho($)}let{createCheckoutLink:a}=$e;return{CheckoutLink:$e,CheckoutWorkflowStep:ce,buildCheckoutURL:i,collectCheckoutOptions:r,createCheckoutLink:a}}function Fd({interval:e=200,maxAttempts:t=25}={}){let r=le.module("ims");return new Promise(i=>{r.debug("Waing for IMS to be ready");let a=0;function n(){window.adobeIMS?.initialized?i():++a>t?(r.debug("Timeout"),i()):setTimeout(n,e)}n()})}function Ud(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function Gd(e){let t=le.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:i})=>(t.debug("Got user country:",i),i),i=>{t.error("Unable to get user country:",i)}):null)}function Fo({}){let e=Fd(),t=Ud(e),r=Gd(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}var Uo=window.masPriceLiterals;function Go(e){if(Array.isArray(Uo)){let t=e.locale==="id_ID"?"in":e.language,r=a=>Uo.find(n=>wa(n.lang,a)),i=r(t)??r(N.language);if(i)return Object.freeze(i)}return{}}var Fa=function(e,t){return Fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},Fa(e,t)};function Sr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Fa(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var L=function(){return L=Object.assign||function(t){for(var r,i=1,a=arguments.length;i0}),r=[],i=0,a=t;i1)throw new RangeError("integer-width stems only accept a single optional option");a.options[0].replace(jd,function(c,l,d,h,u,f){if(l)t.minimumIntegerDigits=d.length;else{if(h&&u)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(Jo.test(a.stem)){t.minimumIntegerDigits=a.stem.length;continue}if(Yo.test(a.stem)){if(a.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");a.stem.replace(Yo,function(c,l,d,h,u,f){return d==="*"?t.minimumFractionDigits=l.length:h&&h[0]==="#"?t.maximumFractionDigits=h.length:u&&f?(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var n=a.options[0];n==="w"?t=L(L({},t),{trailingZeroDisplay:"stripIfInteger"}):n&&(t=L(L({},t),Xo(n)));continue}if(Zo.test(a.stem)){t=L(L({},t),Xo(a.stem));continue}var o=es(a.stem);o&&(t=L(L({},t),o));var s=Wd(a.stem);s&&(t=L(L({},t),s))}return t}var Tr={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function rs(e,t){for(var r="",i=0;i>1),c="a",l=Yd(t);for((l=="H"||l=="k")&&(s=0);s-- >0;)r+=c;for(;o-- >0;)r=l+r}else a==="J"?r+="H":r+=a}return r}function Yd(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,i;r!=="root"&&(i=e.maximize().region);var a=Tr[i||""]||Tr[r||""]||Tr["".concat(r,"-001")]||Tr["001"];return a[0]}var qa,Xd=new RegExp("^".concat(Ga.source,"*")),Kd=new RegExp("".concat(Ga.source,"*$"));function M(e,t){return{start:e,end:t}}var Qd=!!String.prototype.startsWith,Zd=!!String.fromCodePoint,Jd=!!Object.fromEntries,eh=!!String.prototype.codePointAt,th=!!String.prototype.trimStart,rh=!!String.prototype.trimEnd,ih=!!Number.isSafeInteger,ah=ih?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ja=!0;try{is=ss("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),ja=((qa=is.exec("a"))===null||qa===void 0?void 0:qa[0])==="a"}catch{ja=!1}var is,as=Qd?function(t,r,i){return t.startsWith(r,i)}:function(t,r,i){return t.slice(i,i+r.length)===r},Wa=Zd?String.fromCodePoint:function(){for(var t=[],r=0;rn;){if(o=t[n++],o>1114111)throw RangeError(o+" is not a valid code point");i+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return i},ns=Jd?Object.fromEntries:function(t){for(var r={},i=0,a=t;i=i)){var a=t.charCodeAt(r),n;return a<55296||a>56319||r+1===i||(n=t.charCodeAt(r+1))<56320||n>57343?a:(a-55296<<10)+(n-56320)+65536}},nh=th?function(t){return t.trimStart()}:function(t){return t.replace(Xd,"")},oh=rh?function(t){return t.trimEnd()}:function(t){return t.replace(Kd,"")};function ss(e,t){return new RegExp(e,t)}var Ya;ja?(Va=ss("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ya=function(t,r){var i;Va.lastIndex=r;var a=Va.exec(t);return(i=a[1])!==null&&i!==void 0?i:""}):Ya=function(t,r){for(var i=[];;){var a=os(t,r);if(a===void 0||ls(a)||lh(a))break;i.push(a),r+=a>=65536?2:1}return Wa.apply(void 0,i)};var Va,cs=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.locale=r.locale,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,i){for(var a=[];!this.isEOF();){var n=this.char();if(n===123){var o=this.parseArgument(t,i);if(o.err)return o;a.push(o.val)}else{if(n===125&&t>0)break;if(n===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),a.push({type:V.pound,location:M(s,this.clonePosition())})}else if(n===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(k.UNMATCHED_CLOSING_TAG,M(this.clonePosition(),this.clonePosition()))}else if(n===60&&!this.ignoreTag&&Xa(this.peek()||0)){var o=this.parseTag(t,r);if(o.err)return o;a.push(o.val)}else{var o=this.parseLiteral(t,r);if(o.err)return o;a.push(o.val)}}}return{val:a,err:null}},e.prototype.parseTag=function(t,r){var i=this.clonePosition();this.bump();var a=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:V.literal,value:"<".concat(a,"/>"),location:M(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var n=this.parseMessage(t+1,r,!0);if(n.err)return n;var o=n.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:V.tag,value:a,children:o,location:M(i,this.clonePosition())},err:null}:this.error(k.INVALID_TAG,M(s,this.clonePosition())))}else return this.error(k.UNCLOSED_TAG,M(i,this.clonePosition()))}else return this.error(k.INVALID_TAG,M(i,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ch(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var i=this.clonePosition(),a="";;){var n=this.tryParseQuote(r);if(n){a+=n;continue}var o=this.tryParseUnquoted(t,r);if(o){a+=o;continue}var s=this.tryParseLeftAngleBracket();if(s){a+=s;continue}break}var c=M(i,this.clonePosition());return{val:{type:V.literal,value:a,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!sh(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 i=this.char();if(i===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(i);this.bump()}return Wa.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(r==="plural"||r==="selectordinal")||i===125&&t>0?null:(this.bump(),Wa(i))},e.prototype.parseArgument=function(t,r){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(k.EMPTY_ARGUMENT,M(i,this.clonePosition()));var a=this.parseIdentifierIfPossible().value;if(!a)return this.error(k.MALFORMED_ARGUMENT,M(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:V.argument,value:a,location:M(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition())):this.parseArgumentOptions(t,r,a,i);default:return this.error(k.MALFORMED_ARGUMENT,M(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),i=Ya(this.message,r),a=r+i.length;this.bumpTo(a);var n=this.clonePosition(),o=M(t,n);return{value:i,location:o}},e.prototype.parseArgumentOptions=function(t,r,i,a){var n,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(s){case"":return this.error(k.EXPECT_ARGUMENT_TYPE,M(o,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition(),h=this.parseSimpleArgStyleIfPossible();if(h.err)return h;var u=oh(h.val);if(u.length===0)return this.error(k.EXPECT_ARGUMENT_STYLE,M(this.clonePosition(),this.clonePosition()));var f=M(d,this.clonePosition());l={style:u,styleLocation:f}}var x=this.tryParseArgumentClose(a);if(x.err)return x;var v=M(a,this.clonePosition());if(l&&as(l?.style,"::",0)){var S=nh(l.style.slice(2));if(s==="number"){var h=this.parseNumberSkeletonFromString(S,l.styleLocation);return h.err?h:{val:{type:V.number,value:i,location:v,style:h.val},err:null}}else{if(S.length===0)return this.error(k.EXPECT_DATE_TIME_SKELETON,v);var z=S;this.locale&&(z=rs(S,this.locale));var u={type:ht.dateTime,pattern:z,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?jo(z):{}},I=s==="date"?V.date:V.time;return{val:{type:I,value:i,location:v,style:u},err:null}}}return{val:{type:s==="number"?V.number:s==="date"?V.date:V.time,value:i,location:v,style:(n=l?.style)!==null&&n!==void 0?n:null},err:null}}case"plural":case"selectordinal":case"select":{var C=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(k.EXPECT_SELECT_ARGUMENT_OPTIONS,M(C,L({},C)));this.bumpSpace();var O=this.parseIdentifierIfPossible(),K=0;if(s!=="select"&&O.value==="offset"){if(!this.bumpIf(":"))return this.error(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,M(this.clonePosition(),this.clonePosition()));this.bumpSpace();var h=this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,k.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(h.err)return h;this.bumpSpace(),O=this.parseIdentifierIfPossible(),K=h.val}var q=this.tryParsePluralOrSelectOptions(t,s,r,O);if(q.err)return q;var x=this.tryParseArgumentClose(a);if(x.err)return x;var Q=M(a,this.clonePosition());return s==="select"?{val:{type:V.select,value:i,options:ns(q.val),location:Q},err:null}:{val:{type:V.plural,value:i,options:ns(q.val),offset:K,pluralType:s==="plural"?"cardinal":"ordinal",location:Q},err:null}}default:return this.error(k.INVALID_ARGUMENT_TYPE,M(o,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var a=this.clonePosition();if(!this.bumpUntil("'"))return this.error(k.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,M(a,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 i=[];try{i=Qo(t)}catch{return this.error(k.INVALID_NUMBER_SKELETON,r)}return{val:{type:ht.number,tokens:i,location:r,parsedOptions:this.shouldParseSkeletons?ts(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,i,a){for(var n,o=!1,s=[],c=new Set,l=a.value,d=a.location;;){if(l.length===0){var h=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var u=this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_SELECTOR,k.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;d=M(h,this.clonePosition()),l=this.message.slice(h.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?k.DUPLICATE_SELECT_ARGUMENT_SELECTOR:k.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);l==="other"&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?k.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:k.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,M(this.clonePosition(),this.clonePosition()));var x=this.parseMessage(t+1,r,i);if(x.err)return x;var v=this.tryParseArgumentClose(f);if(v.err)return v;s.push([l,{value:x.val,location:M(f,this.clonePosition())}]),c.add(l),this.bumpSpace(),n=this.parseIdentifierIfPossible(),l=n.value,d=n.location}return s.length===0?this.error(r==="select"?k.EXPECT_SELECT_ARGUMENT_SELECTOR:k.EXPECT_PLURAL_ARGUMENT_SELECTOR,M(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(k.MISSING_OTHER_CLAUSE,M(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var i=1,a=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var n=!1,o=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)n=!0,o=o*10+(s-48),this.bump();else break}var c=M(a,this.clonePosition());return n?(o*=i,ah(o)?{val:o,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=os(this.message,t);if(r===void 0)throw Error("Offset ".concat(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(as(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ls(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),i=this.message.charCodeAt(r+(t>=65536?2:1));return i??null},e}();function Xa(e){return e>=97&&e<=122||e>=65&&e<=90}function sh(e){return Xa(e)||e===47}function ch(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 ls(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function lh(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 Ka(e){e.forEach(function(t){if(delete t.location,ki(t)||_i(t))for(var r in t.options)delete t.options[r].location,Ka(t.options[r].value);else Si(t)&&Li(t.style)||(Ci(t)||Ti(t))&&Cr(t.style)?delete t.style.location:Pi(t)&&Ka(t.children)})}function ds(e,t){t===void 0&&(t={}),t=L({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new cs(e,t).parse();if(r.err){var i=SyntaxError(k[r.err.kind]);throw i.location=r.err.location,i.originalMessage=r.err.message,i}return t?.captureLocation||Ka(r.val),r.val}function kr(e,t){var r=t&&t.cache?t.cache:gh,i=t&&t.serializer?t.serializer:uh,a=t&&t.strategy?t.strategy:hh;return a(e,{cache:r,serializer:i})}function dh(e){return e==null||typeof e=="number"||typeof e=="boolean"}function hs(e,t,r,i){var a=dh(i)?i:r(i),n=t.get(a);return typeof n>"u"&&(n=e.call(this,i),t.set(a,n)),n}function ps(e,t,r){var i=Array.prototype.slice.call(arguments,3),a=r(i),n=t.get(a);return typeof n>"u"&&(n=e.apply(this,i),t.set(a,n)),n}function Qa(e,t,r,i,a){return r.bind(t,e,i,a)}function hh(e,t){var r=e.length===1?hs:ps;return Qa(e,this,r,t.cache.create(),t.serializer)}function ph(e,t){return Qa(e,this,ps,t.cache.create(),t.serializer)}function mh(e,t){return Qa(e,this,hs,t.cache.create(),t.serializer)}var uh=function(){return JSON.stringify(arguments)};function Za(){this.cache=Object.create(null)}Za.prototype.get=function(e){return this.cache[e]};Za.prototype.set=function(e,t){this.cache[e]=t};var gh={create:function(){return new Za}},Mi={variadic:ph,monadic:mh};var pt;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(pt||(pt={}));var _r=function(e){Sr(t,e);function t(r,i,a){var n=e.call(this,r)||this;return n.code=i,n.originalMessage=a,n}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Ja=function(e){Sr(t,e);function t(r,i,a,n){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(i,'". Options are "').concat(Object.keys(a).join('", "'),'"'),pt.INVALID_VALUE,n)||this}return t}(_r);var ms=function(e){Sr(t,e);function t(r,i,a){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(i),pt.INVALID_VALUE,a)||this}return t}(_r);var us=function(e){Sr(t,e);function t(r,i){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(i,'"'),pt.MISSING_VALUE,i)||this}return t}(_r);var se;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(se||(se={}));function fh(e){return e.length<2?e:e.reduce(function(t,r){var i=t[t.length-1];return!i||i.type!==se.literal||r.type!==se.literal?t.push(r):i.value+=r.value,t},[])}function xh(e){return typeof e=="function"}function Pr(e,t,r,i,a,n,o){if(e.length===1&&Ua(e[0]))return[{type:se.literal,value:e[0].value}];for(var s=[],c=0,l=e;c{l!=null&&(Rl(l)?i:a).push(l)}),i.length&&(n+=" "+i.map(ro).join(" "));let{pathname:o,search:s}=window.location,c=`${tt.delimiter}page=${o}${s}`;c.length>to&&(c=`${c.slice(0,to)}`),n+=c,a.length&&(n+=`${tt.delimiter}facts=`,n+=JSON.stringify(a,Ol)),window.lana?.log(n,tt)}};function ci(e){Object.assign(tt,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in tt&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var Ea={};Jn(Ea,{CLASS_NAME_FAILED:()=>ca,CLASS_NAME_HIDDEN:()=>Il,CLASS_NAME_PENDING:()=>la,CLASS_NAME_RESOLVED:()=>da,CheckoutWorkflow:()=>ao,CheckoutWorkflowStep:()=>ce,Commitment:()=>rt,ERROR_MESSAGE_BAD_REQUEST:()=>ha,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Vl,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>pa,EVENT_AEM_ERROR:()=>nt,EVENT_AEM_LOAD:()=>at,EVENT_MAS_ERROR:()=>sa,EVENT_MAS_READY:()=>fr,EVENT_MERCH_ADDON_AND_QUANTITY_UPDATE:()=>di,EVENT_MERCH_CARD_ACTION_MENU_TOGGLE:()=>na,EVENT_MERCH_CARD_COLLECTION_LITERALS_CHANGED:()=>it,EVENT_MERCH_CARD_COLLECTION_SHOWMORE:()=>Gl,EVENT_MERCH_CARD_COLLECTION_SIDENAV_ATTACHED:()=>Ul,EVENT_MERCH_CARD_COLLECTION_SORT:()=>Fl,EVENT_MERCH_CARD_QUANTITY_CHANGE:()=>Pt,EVENT_MERCH_OFFER_READY:()=>_t,EVENT_MERCH_OFFER_SELECT_READY:()=>gr,EVENT_MERCH_QUANTITY_SELECTOR_CHANGE:()=>te,EVENT_MERCH_SEARCH_CHANGE:()=>Bl,EVENT_MERCH_SIDENAV_SELECT:()=>ql,EVENT_MERCH_STOCK_CHANGE:()=>$l,EVENT_MERCH_STORAGE_CHANGE:()=>Hl,EVENT_OFFER_SELECTED:()=>oa,EVENT_TYPE_FAILED:()=>ma,EVENT_TYPE_READY:()=>li,EVENT_TYPE_RESOLVED:()=>Lt,Env:()=>Re,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>ke,HEADER_X_REQUEST_ID:()=>xr,LOG_NAMESPACE:()=>ua,Landscape:()=>Ve,MARK_DURATION_SUFFIX:()=>ct,MARK_START_SUFFIX:()=>st,MODAL_TYPE_3_IN_1:()=>ot,NAMESPACE:()=>Nl,PARAM_AOS_API_KEY:()=>jl,PARAM_ENV:()=>fa,PARAM_LANDSCAPE:()=>xa,PARAM_MAS_PREVIEW:()=>ga,PARAM_WCS_API_KEY:()=>Wl,PROVIDER_ENVIRONMENT:()=>ya,SELECTOR_MAS_CHECKOUT_LINK:()=>Ce,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Dl,SELECTOR_MAS_UPT_LINK:()=>io,SORT_ORDER:()=>Ql,STATE_FAILED:()=>Te,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>De,SUPPORTED_COUNTRIES:()=>wa,TAG_NAME_SERVICE:()=>zl,TEMPLATE_PRICE:()=>Yl,TEMPLATE_PRICE_ANNUAL:()=>Kl,TEMPLATE_PRICE_LEGAL:()=>xe,TEMPLATE_PRICE_STRIKETHROUGH:()=>Xl,Term:()=>ye,WCS_PROD_URL:()=>va,WCS_STAGE_URL:()=>ba});var rt=Object.freeze({MONTH:"MONTH",YEAR:"YEAR",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",PERPETUAL:"PERPETUAL",TERM_LICENSE:"TERM_LICENSE",ACCESS_PASS:"ACCESS_PASS",THREE_MONTHS:"THREE_MONTHS",SIX_MONTHS:"SIX_MONTHS"}),ye=Object.freeze({ANNUAL:"ANNUAL",MONTHLY:"MONTHLY",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",P1D:"P1D",P1Y:"P1Y",P3Y:"P3Y",P10Y:"P10Y",P15Y:"P15Y",P3D:"P3D",P7D:"P7D",P30D:"P30D",HALF_YEARLY:"HALF_YEARLY",QUARTERLY:"QUARTERLY"}),Nl="merch",Il="hidden",li="wcms:commerce:ready",zl="mas-commerce-service",D='span[is="inline-price"][data-wcs-osi]',Ce='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]',Dl="sp-button[data-wcs-osi]",io='a[is="upt-link"]',ur=`${D},${Ce},${io}`,_t="merch-offer:ready",gr="merch-offer-select:ready",na="merch-card:action-menu-toggle",oa="merch-offer:selected",$l="merch-stock:change",Hl="merch-storage:change",te="merch-quantity-selector:change",Pt="merch-card-quantity:change",di="merch-modal:addon-and-quantity-update",Bl="merch-search:change",Fl="merch-card-collection:sort",it="merch-card-collection:literals-changed",Ul="merch-card-collection:sidenav-attached",Gl="merch-card-collection:showmore",ql="merch-sidenav:select",at="aem:load",nt="aem:error",fr="mas:ready",sa="mas:error",ca="placeholder-failed",la="placeholder-pending",da="placeholder-resolved",ha="Bad WCS request",pa="Commerce offer not found",Vl="Literals URL not provided",ma="mas:failed",Lt="mas:resolved",ua="mas/commerce",ga="mas.preview",fa="commerce.env",xa="commerce.landscape",jl="commerce.aosKey",Wl="commerce.wcsKey",va="https://www.adobe.com/web_commerce_artifact",ba="https://www.stage.adobe.com/web_commerce_artifact_stage",Te="failed",qe="pending",De="resolved",Ve={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"},xr="X-Request-Id",ce=Object.freeze({SEGMENTATION:"segmentation",BUNDLE:"bundle",COMMITMENT:"commitment",RECOMMENDATION:"recommendation",EMAIL:"email",PAYMENT:"payment",CHANGE_PLAN_TEAM_PLANS:"change-plan/team-upgrade/plans",CHANGE_PLAN_TEAM_PAYMENT:"change-plan/team-upgrade/payment"}),ao="UCv3",Re=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"}),ya={PRODUCTION:"PRODUCTION"},ot={TWP:"twp",D2P:"d2p",CRM:"crm"},st=":start",ct=":duration",Yl="price",Xl="price-strikethrough",Kl="annual",xe="legal",ke="mas-ff-defaults",Mt="mas-ff-annual-price",Ql={alphabetical:"alphabetical",authored:"authored"},wa=["AE","AM","AR","AT","AU","AZ","BB","BD","BE","BG","BH","BO","BR","BS","BY","CA","CH","CL","CN","CO","CR","CY","CZ","DE","DK","DO","DZ","EC","EE","EG","ES","FI","FR","GB","GE","GH","GR","GT","HK","HN","HR","HU","ID","IE","IL","IN","IQ","IS","IT","JM","JO","JP","KE","KG","KR","KW","KZ","LA","LB","LK","LT","LU","LV","MA","MD","MO","MT","MU","MX","MY","NG","NI","NL","NO","NP","NZ","OM","PA","PE","PH","PK","PL","PR","PT","PY","QA","RO","RS","RU","SA","SE","SG","SI","SK","SV","TH","TJ","TM","TN","TR","TT","TW","TZ","UA","US","UY","UZ","VE","VN","YE","ZA"];var no="tacocat.js";var Aa=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),oo=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function F(e,t={},{metadata:r=!0,search:i=!0,storage:a=!0}={}){let n;if(i&&n==null){let o=new URLSearchParams(window.location.search),s=Rt(i)?i:e;n=o.get(s)}if(a&&n==null){let o=Rt(a)?a:e;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(r&&n==null){let o=Jl(Rt(r)?r:e);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[e]}var Zl=e=>typeof e=="boolean",hi=e=>typeof e=="function",pi=e=>typeof e=="number",so=e=>e!=null&&typeof e=="object";var Rt=e=>typeof e=="string",co=e=>Rt(e)&&e,vr=e=>pi(e)&&Number.isFinite(e)&&e>0;function mi(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,i])=>{t(i)&&delete e[r]}),e}function T(e,t){if(Zl(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function br(e,t,r){let i=Object.values(t);return i.find(a=>Aa(a,e))??r??i[0]}function Jl(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,i)=>`${r}-${i}`).replace(/\W+/gu,"-").toLowerCase()}function lo(e,t=1){return pi(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var ed=Date.now(),Sa=()=>`(+${Date.now()-ed}ms)`,ui=new Set,td=T(F("tacocat.debug",{},{metadata:!1}),!1);function ho(e){let t=`[${no}/${e}]`,r=(o,s,...c)=>o?!0:(a(s,...c),!1),i=td?(o,...s)=>{console.debug(`${t} ${o}`,...s,Sa())}:()=>{},a=(o,...s)=>{let c=`${t} ${o}`;ui.forEach(([l])=>l(c,...s))};return{assert:r,debug:i,error:a,warn:(o,...s)=>{let c=`${t} ${o}`;ui.forEach(([,l])=>l(c,...s))}}}function rd(e,t){let r=[e,t];return ui.add(r),()=>{ui.delete(r)}}rd((e,...t)=>{console.error(e,...t,Sa())},(e,...t)=>{console.warn(e,...t,Sa())});var id="no promo",po="promo-tag",ad="yellow",nd="neutral",od=(e,t,r)=>{let i=n=>n||id,a=r?` (was "${i(t)}")`:"";return`${i(e)}${a}`},sd="cancel-context",gi=(e,t)=>{let r=e===sd,i=!r&&e?.length>0,a=(i||r)&&(t&&t!=e||!t&&!r),n=a&&i||!a&&!!t,o=n?e||t:void 0;return{effectivePromoCode:o,overridenPromoCode:e,className:n?po:`${po} no-promo`,text:od(o,t,a),variant:n?ad:nd,isOverriden:a}};var Ca;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Ca||(Ca={}));var ve;(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"})(ve||(ve={}));var we;(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"})(we||(we={}));var Ta;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Ta||(Ta={}));var ka;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(ka||(ka={}));var _a;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(_a||(_a={}));var Pa;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Pa||(Pa={}));var La="ABM",Ma="PUF",Ra="M2M",Oa="PERPETUAL",Na="P3Y",cd="TAX_INCLUSIVE_DETAILS",ld="TAX_EXCLUSIVE",mo={ABM:La,PUF:Ma,M2M:Ra,PERPETUAL:Oa,P3Y:Na},Wp={[La]:{commitment:ve.YEAR,term:we.MONTHLY},[Ma]:{commitment:ve.YEAR,term:we.ANNUAL},[Ra]:{commitment:ve.MONTH,term:we.MONTHLY},[Oa]:{commitment:ve.PERPETUAL,term:void 0},[Na]:{commitment:ve.THREE_MONTHS,term:we.P3Y}},uo="Value is not an offer",yr=e=>{if(typeof e!="object")return uo;let{commitment:t,term:r}=e,i=dd(t,r);return{...e,planType:i}};var dd=(e,t)=>{switch(e){case void 0:return uo;case"":return"";case ve.YEAR:return t===we.MONTHLY?La:t===we.ANNUAL?Ma:"";case ve.MONTH:return t===we.MONTHLY?Ra:"";case ve.PERPETUAL:return Oa;case ve.TERM_LICENSE:return t===we.P3Y?Na:"";default:return""}};function go(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:i,priceWithoutTax:a,priceWithoutDiscountAndTax:n,taxDisplay:o}=t;if(o!==cd)return e;let s={...e,priceDetails:{...t,price:a??r,priceWithoutDiscount:n??i,taxDisplay:ld}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var fo={LOCAL:"local",PROD:"prod",STAGE:"stage"},Ia={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},za=new Set,Da=new Set,xo=new Map,vo={append({level:e,message:t,params:r,timestamp:i,source:a}){console[e](`${i}ms [${a}] %c${t}`,"font-weight: bold;",...r)}},bo={filter:({level:e})=>e!==Ia.DEBUG},hd={filter:()=>!1};function pd(e,t,r,i,a){return{level:e,message:t,namespace:r,get params(){return i.length===1&&hi(i[0])&&(i=i[0](),Array.isArray(i)||(i=[i])),i},source:a,timestamp:performance.now().toFixed(3)}}function md(e){[...Da].every(t=>t(e))&&za.forEach(t=>t(e))}function yo(e){let t=(xo.get(e)??0)+1;xo.set(e,t);let r=`${e} #${t}`,i={id:r,namespace:e,module:a=>yo(`${i.namespace}/${a}`),updateConfig:ci};return Object.values(Ia).forEach(a=>{i[a]=(n,...o)=>md(pd(a,n,e,o,r))}),Object.seal(i)}function fi(...e){e.forEach(t=>{let{append:r,filter:i}=t;hi(i)&&Da.add(i),hi(r)&&za.add(r)})}function ud(e={}){let{name:t}=e,r=T(F("commerce.debug",{search:!0,storage:!0}),t===fo.LOCAL);return fi(r?vo:bo),t===fo.PROD&&fi(aa),le}function gd(){za.clear(),Da.clear()}var le={...yo(ua),Level:Ia,Plugins:{consoleAppender:vo,debugFilter:bo,quietFilter:hd,lanaAppender:aa},init:ud,reset:gd,use:fi};var fd="mas-commerce-service",xd=le.module("utilities"),vd={requestId:xr,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function wr(e,{country:t,forceTaxExclusive:r}){let i;if(e.length<2)i=e;else{let a=t==="GB"?"EN":"MULT";e.sort((n,o)=>n.language===a?-1:o.language===a?1:0),e.sort((n,o)=>!n.term&&o.term?-1:n.term&&!o.term?1:0),i=[e[0]]}return r&&(i=i.map(go)),i}var wo=(e,t)=>{let r=e.reduce((i,a)=>i+(t(a)||0),0);return r>0?Math.round(r*100)/100:void 0};function $a(e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let[t,...r]=e;for(let s of r){let c=[["commitment","commitment types"],["term","terms"],["priceDetails.formatString","currency formats"]];for(let[l,d]of c){let p=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==p&&xd.warn(`Offers have different ${d}, summing may produce unexpected results`,{expected:p,actual:u})}}let i=[["price",s=>s.priceDetails?.price],["priceWithoutDiscount",s=>s.priceDetails?.priceWithoutDiscount],["priceWithoutTax",s=>s.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",s=>s.priceDetails?.priceWithoutDiscountAndTax]],a={};for(let[s,c]of i){let l=wo(e,c);l!==void 0&&(a[s]=l)}let n=e.some(s=>s.priceDetails?.annualized),o;if(n){let s=[["annualizedPrice",c=>c.priceDetails?.annualized?.annualizedPrice],["annualizedPriceWithoutTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutTax],["annualizedPriceWithoutDiscount",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscount],["annualizedPriceWithoutDiscountAndTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscountAndTax]];o={};for(let[c,l]of s){let d=wo(e,l);d!==void 0&&(o[c]=d)}}return{...t,offerSelectorIds:e.flatMap(s=>s.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...a,...o&&{annualized:o}}}}var xi=e=>window.setTimeout(e);function Ot(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(lo).filter(vr);return r.length||(r=[t]),r}function vi(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(co)}function pe(){return document.getElementsByTagName(fd)?.[0]}function bi(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[i,a]of Object.entries(vd)){let n=r.get(a);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[i]=n)}return t}var Oe=class e extends Error{constructor(t,r,i){if(super(t,{cause:i}),this.name="MasError",r.response){let a=r.response.headers?.get(xr);a&&(r.requestId=a),r.response.status&&(r.status=r.response.status,r.statusText=r.response.statusText),r.response.url&&(r.url=r.response.url)}delete r.response,this.context=r,Error.captureStackTrace&&Error.captureStackTrace(this,e)}toString(){let t=Object.entries(this.context||{}).map(([i,a])=>`${i}: ${JSON.stringify(a)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` +Caused by: ${this.cause}`),r}};var bd={[Te]:ca,[qe]:la,[De]:da},yd={[Te]:ma,[De]:Lt},Er,je=class{constructor(t){w(this,Er);m(this,"changes",new Map);m(this,"connected",!1);m(this,"error");m(this,"log");m(this,"options");m(this,"promises",[]);m(this,"state",qe);m(this,"timer",null);m(this,"value");m(this,"version",0);m(this,"wrapperElement");this.wrapperElement=t,this.log=le.module("mas-element")}update(){[Te,qe,De].forEach(t=>{this.wrapperElement.classList.toggle(bd[t],t===this.state)})}notify(){(this.state===De||this.state===Te)&&(this.state===De?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Te&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Oe&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(yd[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,r,i){this.changes.set(t,i),this.requestUpdate()}connectedCallback(){y(this,Er,pe()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:r,state:i}=this;return De===i?Promise.resolve(this.wrapperElement):Te===i?Promise.reject(t):new Promise((a,n)=>{r.push({resolve:a,reject:n})})}toggleResolved(t,r,i){return t!==this.version?!1:(i!==void 0&&(this.options=i),this.state=De,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),xi(()=>this.notify()),!0)}toggleFailed(t,r,i){if(t!==this.version)return!1;i!==void 0&&(this.options=i),this.error=r,this.state=Te,this.update();let a=this.wrapperElement.getAttribute("is");return this.log?.error(`${a}: Failed to render: ${r.message}`,{element:this.wrapperElement,...r.context,...h(this,Er)?.duration}),xi(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=qe,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!pe()||this.timer)return;let{error:r,options:i,state:a,value:n,version:o}=this;this.state=qe,this.timer=xi(async()=>{this.timer=null;let s=null;if(this.changes.size&&(s=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:s}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:s})),s||t)try{await this.wrapperElement.render?.()===!1&&this.state===qe&&this.version===o&&(this.state=a,this.error=r,this.value=n,this.update(),this.notify())}catch(c){this.toggleFailed(this.version,c,i)}})}};Er=new WeakMap;function Eo(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function yi(e,t={}){let{tag:r,is:i}=e,a=document.createElement(r,{is:i});return a.setAttribute("is",i),Object.assign(a.dataset,Eo(t)),a}function Ao(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Eo(t)),e):null}var wd=/[0-9\-+#]/,Ed=/[^\d\-+#]/g;function So(e){return e.search(wd)}function Ad(e="#.##"){let t={},r=e.length,i=So(e);t.prefix=i>0?e.substring(0,i):"";let a=So(e.split("").reverse().join("")),n=r-a,o=e.substring(n,n+1),s=n+(o==="."||o===","?1:0);t.suffix=a>0?e.substring(s,r):"",t.mask=e.substring(i,s),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(Ed);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 Sd(e,t,r){let i=!1,a={value:e};e<0&&(i=!0,a.value=-a.value),a.sign=i?"-":"",a.value=Number(a.value).toFixed(t.fraction&&t.fraction.length),a.value=Number(a.value).toString();let n=t.fraction&&t.fraction.lastIndexOf("0"),[o="0",s=""]=a.value.split(".");return(!s||s&&s.length<=n)&&(s=n<0?"":(+("0."+s)).toFixed(n+1).replace("0.","")),a.integer=o,a.fraction=s,Cd(a,t),(a.result==="0"||a.result==="")&&(i=!1,a.sign=""),!i&&t.maskHasPositiveSign?a.sign="+":i&&t.maskHasPositiveSign?a.sign="-":i&&(a.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),a}function Cd(e,t){e.result="";let r=t.integer.split(t.separator),i=r.join(""),a=i&&i.indexOf("0");if(a>-1)for(;e.integer.lengthe*12,dt=(e,t,r=1)=>{if(!e)return!1;let{start:i,end:a,displaySummary:{amount:n,duration:o,minProductQuantity:s=1,outcomeType:c}={}}=e;if(!(n&&o&&c)||r=d&&l<=p},lt={MONTH:"MONTH",YEAR:"YEAR"},_d={[ye.ANNUAL]:12,[ye.MONTHLY]:1,[ye.THREE_YEARS]:36,[ye.TWO_YEARS]:24},Ba=(e,t)=>({accept:e,round:t}),Pd=[Ba(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),Ba(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),Ba(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],Fa={[rt.YEAR]:{[ye.MONTHLY]:lt.MONTH,[ye.ANNUAL]:lt.YEAR},[rt.MONTH]:{[ye.MONTHLY]:lt.MONTH}},Ld=(e,t)=>e.indexOf(`'${t}'`)===0,Md=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),i=Mo(r);return!!i?t||(r=r.replace(/[,\.]0+/,i)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+Od(e)),r},Rd=e=>{let t=Nd(e),r=Ld(e,t),i=e.replace(/'.*?'/,""),a=_o.test(i)||Po.test(i);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:a}},Lo=e=>e.replace(_o,ko).replace(Po,ko),Od=e=>e.match(/#(.?)#/)?.[1]===To?kd:To,Nd=e=>e.match(/'(.*?)'/)?.[1]??"",Mo=e=>e.match(/0(.?)0/)?.[1]??"";function Nt({formatString:e,price:t,usePrecision:r,isIndianPrice:i=!1},a,n=o=>o){let{currencySymbol:o,isCurrencyFirst:s,hasCurrencySpace:c}=Rd(e),l=r?Mo(e):"",d=Md(e,r),p=r?2:0,u=n(t,{currencySymbol:o}),f=i?u.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):Co(d,u),x=r?f.lastIndexOf(l):f.length,v=f.substring(0,x),S=f.substring(x+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,f).replace(/SYMBOL/,o),currencySymbol:o,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:v,isCurrencyFirst:s,recurrenceTerm:a}}var Ro=e=>{let{commitment:t,term:r,usePrecision:i}=e,a=_d[r]??1;return Nt(e,a>1?lt.MONTH:Fa[t]?.[r],n=>{let o={divisor:a,price:n,usePrecision:i},{round:s}=Pd.find(({accept:c})=>c(o));if(!s)throw new Error(`Missing rounding rule for: ${JSON.stringify(o)}`);return s(o)})},Oo=({commitment:e,term:t,...r})=>Nt(r,Fa[e]?.[t]),No=e=>{let{commitment:t,instant:r,price:i,originalPrice:a,priceWithoutDiscount:n,promotion:o,quantity:s=1,term:c}=e;if(t===rt.YEAR&&c===ye.MONTHLY){if(!o)return Nt(e,lt.YEAR,Ha);let{displaySummary:{outcomeType:l,duration:d}={}}=o;switch(l){case"PERCENTAGE_DISCOUNT":if(dt(o,r,s)){let p=parseInt(d.replace("P","").replace("M",""));if(isNaN(p))return Ha(i);let u=a*p,f=n*(12-p),x=Math.round((u+f)*100)/100;return Nt({...e,price:x},lt.YEAR)}default:return Nt(e,lt.YEAR,()=>Ha(n??i))}}return Nt(e,Fa[t]?.[c])};var Io="download",zo="upgrade",Do={e:"EDU",t:"TEAM"};function wi(e,t={},r=""){let i=pe();if(!i)return null;let{checkoutMarketSegment:a,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:p,quantity:u,wcsOsi:f,extraOptions:x,analyticsId:v}=i.collectCheckoutOptions(t),S=yi(e,{checkoutMarketSegment:a,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:p,quantity:u,wcsOsi:f,extraOptions:x,analyticsId:v});return r&&(S.innerHTML=`${r}`),S}function Ei(e){return class extends e{constructor(){super(...arguments);m(this,"checkoutActionHandler");m(this,"masElement",new je(this))}attributeChangedCallback(i,a,n){this.masElement.attributeChangedCallback(i,a,n)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.clickHandler)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.clickHandler)}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}get marketSegment(){let i=this.options?.ms??this.value?.[0].marketSegments?.[0];return Do[i]??i}get customerSegment(){let i=this.options?.cs??this.value?.[0]?.customerSegment;return Do[i]??i}get is3in1Modal(){return Object.values(ot).includes(this.getAttribute("data-modal"))}get isOpen3in1Modal(){let i=document.querySelector("meta[name=mas-ff-3in1]");return this.is3in1Modal&&(!i||i.content!=="off")}requestUpdate(i=!1){return this.masElement.requestUpdate(i)}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"]}async render(i={}){let a=pe();if(!a)return!1;this.dataset.imsCountry||a.imsCountryPromise.then(f=>{f&&(this.dataset.imsCountry=f)}),i.imsCountry=null;let n=a.collectCheckoutOptions(i,this);if(!n.wcsOsi.length)return!1;let o;try{o=JSON.parse(n.extraOptions??"{}")}catch(f){this.masElement.log?.error("cannot parse exta checkout options",f)}let s=this.masElement.togglePending(n);this.setCheckoutUrl("");let c=a.resolveOfferSelectors(n),l=await Promise.all(c);l=l.map(f=>wr(f,n));let d=l.flat().find(f=>f.promotion);!dt(d?.promotion,d?.promotion?.displaySummary?.instant,n.quantity[0])&&n.promotionCode&&delete n.promotionCode,n.country=this.dataset.imsCountry||n.country;let u=await a.buildCheckoutAction?.(l.flat(),{...o,...n},this);return this.renderOffers(l.flat(),n,{},u,s)}renderOffers(i,a,n={},o=void 0,s=void 0){let c=pe();if(!c)return!1;if(a={...JSON.parse(this.dataset.extraOptions??"{}"),...a,...n},s??(s=this.masElement.togglePending(a)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),o){this.classList.remove(Io,zo),this.masElement.toggleResolved(s,i,a);let{url:d,text:p,className:u,handler:f}=o;d&&this.setCheckoutUrl(d),p&&(this.firstElementChild.innerHTML=p),u&&this.classList.add(...u.split(" ")),f&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=f.bind(this))}if(i.length){if(this.masElement.toggleResolved(s,i,a)){if(!this.classList.contains(Io)&&!this.classList.contains(zo)){let d=c.buildCheckoutURL(i,a);this.setCheckoutUrl(a.modal==="true"?"#":d)}return!0}}else{let d=new Error(`Not provided: ${a?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(s,d,a))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(i){}updateOptions(i={}){let a=pe();if(!a)return!1;let{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:p,promotionCode:u,quantity:f,wcsOsi:x}=a.collectCheckoutOptions(i);return Ao(this,{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:p,promotionCode:u,quantity:f,wcsOsi:x}),!0}}}var Ar=class Ar extends Ei(HTMLAnchorElement){static createCheckoutLink(t={},r=""){return wi(Ar,t,r)}setCheckoutUrl(t){this.setAttribute("href",t)}get isCheckoutLink(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}}};m(Ar,"is","checkout-link"),m(Ar,"tag","a");var $e=Ar;window.customElements.get($e.is)||window.customElements.define($e.is,$e,{extends:$e.tag});var Id="p_draft_landscape",zd="/store/",Dd=new Map([["countrySpecific","cs"],["customerSegment","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["addonProductArrangementCode","ao"],["offerType","ot"],["marketSegment","ms"]]),Ua=new Set(["af","ai","ao","apc","appctxid","cli","co","cs","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"]),$d=["env","workflowStep","clientId","country"],$o=new Set(["gid","gtoken","notifauditid","cohortid","productname","sdid","attimer","gcsrc","gcprog","gcprogcat","gcpagetype","mv","mv2"]),Ho=e=>Dd.get(e)??e;function Ai(e,t,r){for(let[i,a]of Object.entries(e)){let n=Ho(i);a!=null&&r.has(n)&&t.set(n,a)}}function Hd(e){switch(e){case ya.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function Bd(e,t){for(let r in e){let i=e[r];for(let[a,n]of Object.entries(i)){if(n==null)continue;let o=Ho(a);t.set(`items[${r}][${o}]`,n)}}}function Fd({url:e,modal:t,is3in1:r}){if(!r||!e?.searchParams)return e;e.searchParams.set("rtc","t"),e.searchParams.set("lo","sl");let i=e.searchParams.get("af");return e.searchParams.set("af",[i,"uc_new_user_iframe","uc_new_system_close"].filter(Boolean).join(",")),e.searchParams.get("cli")!=="doc_cloud"&&e.searchParams.set("cli",t===ot.CRM?"creative":"mini_plans"),e}function Ud(e){let t=new URLSearchParams(window.location.search),r={};$o.forEach(i=>{let a=t.get(i);a!==null&&(r[i]=a)}),Object.keys(r).length>0&&Ai(r,e.searchParams,$o)}function Bo(e){Gd(e);let{env:t,items:r,workflowStep:i,marketSegment:a,customerSegment:n,offerType:o,productArrangementCode:s,landscape:c,modal:l,is3in1:d,preselectPlan:p,...u}=e,f=new URL(Hd(t));if(f.pathname=`${zd}${i}`,i!==ce.SEGMENTATION&&i!==ce.CHANGE_PLAN_TEAM_PLANS&&Bd(r,f.searchParams),Ai({...u},f.searchParams,Ua),Ud(f),c===Ve.DRAFT&&Ai({af:Id},f.searchParams,Ua),i===ce.SEGMENTATION){let x={marketSegment:a,offerType:o,customerSegment:n,productArrangementCode:s,quantity:r?.[0]?.quantity,addonProductArrangementCode:s?r?.find(v=>v.productArrangementCode!==s)?.productArrangementCode:r?.[1]?.productArrangementCode};p?.toLowerCase()==="edu"?f.searchParams.set("ms","EDU"):p?.toLowerCase()==="team"&&f.searchParams.set("cs","TEAM"),Ai(x,f.searchParams,Ua),f.searchParams.get("ot")==="PROMOTION"&&f.searchParams.delete("ot"),f=Fd({url:f,modal:l,is3in1:d})}return f.toString()}function Gd(e){for(let t of $d)if(!e[t])throw new Error(`Argument "checkoutData" is not valid, missing: ${t}`);if(e.workflowStep!==ce.SEGMENTATION&&e.workflowStep!==ce.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}var N=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflowStep:ce.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,displayPlanType:!1,env:Re.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,alternativePrice:!1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:Ve.PUBLISHED});function Fo({settings:e,providers:t}){function r(n,o){let{checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:p,quantity:u,preselectPlan:f,env:x}=e,v={checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:p,quantity:u,preselectPlan:f,env:x};if(o)for(let Tt of t.checkout)Tt(o,v);let{checkoutMarketSegment:S,checkoutWorkflowStep:z=c,imsCountry:I,country:C=I??l,language:O=d,quantity:K=u,entitlement:q,upgrade:Q,modal:ee,perpetual:de,promotionCode:ie=p,wcsOsi:W,extraOptions:$,...he}=Object.assign(v,o?.dataset??{},n??{}),be=br(z,ce,N.checkoutWorkflowStep);return v=mi({...he,extraOptions:$,checkoutClientId:s,checkoutMarketSegment:S,country:C,quantity:Ot(K,N.quantity),checkoutWorkflowStep:be,language:O,entitlement:T(q),upgrade:T(Q),modal:ee,perpetual:T(de),promotionCode:gi(ie).effectivePromoCode,wcsOsi:vi(W),preselectPlan:f}),v}function i(n,o){if(!Array.isArray(n)||!n.length||!o)return"";let{env:s,landscape:c}=e,{checkoutClientId:l,checkoutMarketSegment:d,checkoutWorkflowStep:p,country:u,promotionCode:f,quantity:x,preselectPlan:v,ms:S,cs:z,...I}=r(o),C=document.querySelector("meta[name=mas-ff-3in1]"),O=Object.values(ot).includes(o.modal)&&(!C||C.content!=="off"),K=window.frameElement||O?"if":"fp",[{productArrangementCode:q,marketSegments:[Q],customerSegment:ee,offerType:de}]=n,ie=S??Q??d,W=z??ee;v?.toLowerCase()==="edu"?ie="EDU":v?.toLowerCase()==="team"&&(W="TEAM");let $={is3in1:O,checkoutPromoCode:f,clientId:l,context:K,country:u,env:s,items:[],marketSegment:ie,customerSegment:W,offerType:de,productArrangementCode:q,workflowStep:p,landscape:c,...I},he=x[0]>1?x[0]:void 0;if(n.length===1){let{offerId:be}=n[0];$.items.push({id:be,quantity:he})}else $.items.push(...n.map(({offerId:be,productArrangementCode:Tt})=>({id:be,quantity:he,...O?{productArrangementCode:Tt}:{}})));return Bo($)}let{createCheckoutLink:a}=$e;return{CheckoutLink:$e,CheckoutWorkflowStep:ce,buildCheckoutURL:i,collectCheckoutOptions:r,createCheckoutLink:a}}function qd({interval:e=200,maxAttempts:t=25}={}){let r=le.module("ims");return new Promise(i=>{r.debug("Waing for IMS to be ready");let a=0;function n(){window.adobeIMS?.initialized?i():++a>t?(r.debug("Timeout"),i()):setTimeout(n,e)}n()})}function Vd(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function jd(e){let t=le.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:i})=>(t.debug("Got user country:",i),i),i=>{t.error("Unable to get user country:",i)}):null)}function Uo({}){let e=qd(),t=Vd(e),r=jd(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}var Go=window.masPriceLiterals;function qo(e){if(Array.isArray(Go)){let t=e.locale==="id_ID"?"in":e.language,r=a=>Go.find(n=>Aa(n.lang,a)),i=r(t)??r(N.language);if(i)return Object.freeze(i)}return{}}var Ga=function(e,t){return Ga=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},Ga(e,t)};function Sr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ga(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var L=function(){return L=Object.assign||function(t){for(var r,i=1,a=arguments.length;i0}),r=[],i=0,a=t;i1)throw new RangeError("integer-width stems only accept a single optional option");a.options[0].replace(Xd,function(c,l,d,p,u,f){if(l)t.minimumIntegerDigits=d.length;else{if(p&&u)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(es.test(a.stem)){t.minimumIntegerDigits=a.stem.length;continue}if(Xo.test(a.stem)){if(a.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");a.stem.replace(Xo,function(c,l,d,p,u,f){return d==="*"?t.minimumFractionDigits=l.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:u&&f?(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var n=a.options[0];n==="w"?t=L(L({},t),{trailingZeroDisplay:"stripIfInteger"}):n&&(t=L(L({},t),Ko(n)));continue}if(Jo.test(a.stem)){t=L(L({},t),Ko(a.stem));continue}var o=ts(a.stem);o&&(t=L(L({},t),o));var s=Kd(a.stem);s&&(t=L(L({},t),s))}return t}var Tr={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function is(e,t){for(var r="",i=0;i>1),c="a",l=Qd(t);for((l=="H"||l=="k")&&(s=0);s-- >0;)r+=c;for(;o-- >0;)r=l+r}else a==="J"?r+="H":r+=a}return r}function Qd(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,i;r!=="root"&&(i=e.maximize().region);var a=Tr[i||""]||Tr[r||""]||Tr["".concat(r,"-001")]||Tr["001"];return a[0]}var ja,Zd=new RegExp("^".concat(Va.source,"*")),Jd=new RegExp("".concat(Va.source,"*$"));function M(e,t){return{start:e,end:t}}var eh=!!String.prototype.startsWith,th=!!String.fromCodePoint,rh=!!Object.fromEntries,ih=!!String.prototype.codePointAt,ah=!!String.prototype.trimStart,nh=!!String.prototype.trimEnd,oh=!!Number.isSafeInteger,sh=oh?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ya=!0;try{as=cs("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ya=((ja=as.exec("a"))===null||ja===void 0?void 0:ja[0])==="a"}catch{Ya=!1}var as,ns=eh?function(t,r,i){return t.startsWith(r,i)}:function(t,r,i){return t.slice(i,i+r.length)===r},Xa=th?String.fromCodePoint:function(){for(var t=[],r=0;rn;){if(o=t[n++],o>1114111)throw RangeError(o+" is not a valid code point");i+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return i},os=rh?Object.fromEntries:function(t){for(var r={},i=0,a=t;i=i)){var a=t.charCodeAt(r),n;return a<55296||a>56319||r+1===i||(n=t.charCodeAt(r+1))<56320||n>57343?a:(a-55296<<10)+(n-56320)+65536}},ch=ah?function(t){return t.trimStart()}:function(t){return t.replace(Zd,"")},lh=nh?function(t){return t.trimEnd()}:function(t){return t.replace(Jd,"")};function cs(e,t){return new RegExp(e,t)}var Ka;Ya?(Wa=cs("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ka=function(t,r){var i;Wa.lastIndex=r;var a=Wa.exec(t);return(i=a[1])!==null&&i!==void 0?i:""}):Ka=function(t,r){for(var i=[];;){var a=ss(t,r);if(a===void 0||ds(a)||ph(a))break;i.push(a),r+=a>=65536?2:1}return Xa.apply(void 0,i)};var Wa,ls=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.locale=r.locale,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,i){for(var a=[];!this.isEOF();){var n=this.char();if(n===123){var o=this.parseArgument(t,i);if(o.err)return o;a.push(o.val)}else{if(n===125&&t>0)break;if(n===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),a.push({type:V.pound,location:M(s,this.clonePosition())})}else if(n===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(k.UNMATCHED_CLOSING_TAG,M(this.clonePosition(),this.clonePosition()))}else if(n===60&&!this.ignoreTag&&Qa(this.peek()||0)){var o=this.parseTag(t,r);if(o.err)return o;a.push(o.val)}else{var o=this.parseLiteral(t,r);if(o.err)return o;a.push(o.val)}}}return{val:a,err:null}},e.prototype.parseTag=function(t,r){var i=this.clonePosition();this.bump();var a=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:V.literal,value:"<".concat(a,"/>"),location:M(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var n=this.parseMessage(t+1,r,!0);if(n.err)return n;var o=n.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:V.tag,value:a,children:o,location:M(i,this.clonePosition())},err:null}:this.error(k.INVALID_TAG,M(s,this.clonePosition())))}else return this.error(k.UNCLOSED_TAG,M(i,this.clonePosition()))}else return this.error(k.INVALID_TAG,M(i,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&hh(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var i=this.clonePosition(),a="";;){var n=this.tryParseQuote(r);if(n){a+=n;continue}var o=this.tryParseUnquoted(t,r);if(o){a+=o;continue}var s=this.tryParseLeftAngleBracket();if(s){a+=s;continue}break}var c=M(i,this.clonePosition());return{val:{type:V.literal,value:a,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!dh(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 i=this.char();if(i===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(i);this.bump()}return Xa.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(r==="plural"||r==="selectordinal")||i===125&&t>0?null:(this.bump(),Xa(i))},e.prototype.parseArgument=function(t,r){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(k.EMPTY_ARGUMENT,M(i,this.clonePosition()));var a=this.parseIdentifierIfPossible().value;if(!a)return this.error(k.MALFORMED_ARGUMENT,M(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:V.argument,value:a,location:M(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition())):this.parseArgumentOptions(t,r,a,i);default:return this.error(k.MALFORMED_ARGUMENT,M(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),i=Ka(this.message,r),a=r+i.length;this.bumpTo(a);var n=this.clonePosition(),o=M(t,n);return{value:i,location:o}},e.prototype.parseArgumentOptions=function(t,r,i,a){var n,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(s){case"":return this.error(k.EXPECT_ARGUMENT_TYPE,M(o,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var u=lh(p.val);if(u.length===0)return this.error(k.EXPECT_ARGUMENT_STYLE,M(this.clonePosition(),this.clonePosition()));var f=M(d,this.clonePosition());l={style:u,styleLocation:f}}var x=this.tryParseArgumentClose(a);if(x.err)return x;var v=M(a,this.clonePosition());if(l&&ns(l?.style,"::",0)){var S=ch(l.style.slice(2));if(s==="number"){var p=this.parseNumberSkeletonFromString(S,l.styleLocation);return p.err?p:{val:{type:V.number,value:i,location:v,style:p.val},err:null}}else{if(S.length===0)return this.error(k.EXPECT_DATE_TIME_SKELETON,v);var z=S;this.locale&&(z=is(S,this.locale));var u={type:ht.dateTime,pattern:z,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Wo(z):{}},I=s==="date"?V.date:V.time;return{val:{type:I,value:i,location:v,style:u},err:null}}}return{val:{type:s==="number"?V.number:s==="date"?V.date:V.time,value:i,location:v,style:(n=l?.style)!==null&&n!==void 0?n:null},err:null}}case"plural":case"selectordinal":case"select":{var C=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(k.EXPECT_SELECT_ARGUMENT_OPTIONS,M(C,L({},C)));this.bumpSpace();var O=this.parseIdentifierIfPossible(),K=0;if(s!=="select"&&O.value==="offset"){if(!this.bumpIf(":"))return this.error(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,M(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,k.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),O=this.parseIdentifierIfPossible(),K=p.val}var q=this.tryParsePluralOrSelectOptions(t,s,r,O);if(q.err)return q;var x=this.tryParseArgumentClose(a);if(x.err)return x;var Q=M(a,this.clonePosition());return s==="select"?{val:{type:V.select,value:i,options:os(q.val),location:Q},err:null}:{val:{type:V.plural,value:i,options:os(q.val),offset:K,pluralType:s==="plural"?"cardinal":"ordinal",location:Q},err:null}}default:return this.error(k.INVALID_ARGUMENT_TYPE,M(o,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var a=this.clonePosition();if(!this.bumpUntil("'"))return this.error(k.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,M(a,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 i=[];try{i=Zo(t)}catch{return this.error(k.INVALID_NUMBER_SKELETON,r)}return{val:{type:ht.number,tokens:i,location:r,parsedOptions:this.shouldParseSkeletons?rs(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,i,a){for(var n,o=!1,s=[],c=new Set,l=a.value,d=a.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var u=this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_SELECTOR,k.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;d=M(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?k.DUPLICATE_SELECT_ARGUMENT_SELECTOR:k.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);l==="other"&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?k.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:k.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,M(this.clonePosition(),this.clonePosition()));var x=this.parseMessage(t+1,r,i);if(x.err)return x;var v=this.tryParseArgumentClose(f);if(v.err)return v;s.push([l,{value:x.val,location:M(f,this.clonePosition())}]),c.add(l),this.bumpSpace(),n=this.parseIdentifierIfPossible(),l=n.value,d=n.location}return s.length===0?this.error(r==="select"?k.EXPECT_SELECT_ARGUMENT_SELECTOR:k.EXPECT_PLURAL_ARGUMENT_SELECTOR,M(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(k.MISSING_OTHER_CLAUSE,M(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var i=1,a=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var n=!1,o=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)n=!0,o=o*10+(s-48),this.bump();else break}var c=M(a,this.clonePosition());return n?(o*=i,sh(o)?{val:o,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=ss(this.message,t);if(r===void 0)throw Error("Offset ".concat(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(ns(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ds(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),i=this.message.charCodeAt(r+(t>=65536?2:1));return i??null},e}();function Qa(e){return e>=97&&e<=122||e>=65&&e<=90}function dh(e){return Qa(e)||e===47}function hh(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 ds(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ph(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 Za(e){e.forEach(function(t){if(delete t.location,_i(t)||Pi(t))for(var r in t.options)delete t.options[r].location,Za(t.options[r].value);else Ci(t)&&Mi(t.style)||(Ti(t)||ki(t))&&Cr(t.style)?delete t.style.location:Li(t)&&Za(t.children)})}function hs(e,t){t===void 0&&(t={}),t=L({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new ls(e,t).parse();if(r.err){var i=SyntaxError(k[r.err.kind]);throw i.location=r.err.location,i.originalMessage=r.err.message,i}return t?.captureLocation||Za(r.val),r.val}function kr(e,t){var r=t&&t.cache?t.cache:vh,i=t&&t.serializer?t.serializer:xh,a=t&&t.strategy?t.strategy:uh;return a(e,{cache:r,serializer:i})}function mh(e){return e==null||typeof e=="number"||typeof e=="boolean"}function ps(e,t,r,i){var a=mh(i)?i:r(i),n=t.get(a);return typeof n>"u"&&(n=e.call(this,i),t.set(a,n)),n}function ms(e,t,r){var i=Array.prototype.slice.call(arguments,3),a=r(i),n=t.get(a);return typeof n>"u"&&(n=e.apply(this,i),t.set(a,n)),n}function Ja(e,t,r,i,a){return r.bind(t,e,i,a)}function uh(e,t){var r=e.length===1?ps:ms;return Ja(e,this,r,t.cache.create(),t.serializer)}function gh(e,t){return Ja(e,this,ms,t.cache.create(),t.serializer)}function fh(e,t){return Ja(e,this,ps,t.cache.create(),t.serializer)}var xh=function(){return JSON.stringify(arguments)};function en(){this.cache=Object.create(null)}en.prototype.get=function(e){return this.cache[e]};en.prototype.set=function(e,t){this.cache[e]=t};var vh={create:function(){return new en}},Ri={variadic:gh,monadic:fh};var pt;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(pt||(pt={}));var _r=function(e){Sr(t,e);function t(r,i,a){var n=e.call(this,r)||this;return n.code=i,n.originalMessage=a,n}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var tn=function(e){Sr(t,e);function t(r,i,a,n){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(i,'". Options are "').concat(Object.keys(a).join('", "'),'"'),pt.INVALID_VALUE,n)||this}return t}(_r);var us=function(e){Sr(t,e);function t(r,i,a){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(i),pt.INVALID_VALUE,a)||this}return t}(_r);var gs=function(e){Sr(t,e);function t(r,i){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(i,'"'),pt.MISSING_VALUE,i)||this}return t}(_r);var se;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(se||(se={}));function bh(e){return e.length<2?e:e.reduce(function(t,r){var i=t[t.length-1];return!i||i.type!==se.literal||r.type!==se.literal?t.push(r):i.value+=r.value,t},[])}function yh(e){return typeof e=="function"}function Pr(e,t,r,i,a,n,o){if(e.length===1&&qa(e[0]))return[{type:se.literal,value:e[0].value}];for(var s=[],c=0,l=e;c0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ds,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var fs=gs;var tn={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",strikethroughAriaLabel:"Regularly at",planTypeLabel:"{planType, select, ABM {Annual, billed monthly} other {}}"},wh=lo("ConsonantTemplates/price"),Eh=/<\/?[^>]+(>|$)/g,j={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerPromoStrikethrough:"price-promo-strikethrough",containerAlternative:"price-alternative",containerAnnual:"price-annual",containerAnnualPrefix:"price-annual-prefix",containerAnnualSuffix:"price-annual-suffix",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"},We={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel",alternativePriceAriaLabel:"alternativePriceAriaLabel"},rn="TAX_EXCLUSIVE",Ah=e=>oo(e)?Object.entries(e).filter(([,t])=>Rt(t)||hi(t)||t===!0).reduce((t,[r,i])=>t+` ${r}${i===!0?"":'="'+no(i)+'"'}`,""):"",Y=(e,t,r,i=!1)=>`${i?Po(t):t??""}`;function Sh(e){e=e.replaceAll("","</a>");let t=/]+(>|$)/g;return e.match(t)?.forEach(i=>{let a=i.replace("",">");e=e.replaceAll(i,a)}),e}function Ch(e){e=e.replaceAll("</a>","");let t=/<a (?!>)(.*?)(>|$)/g;return e.match(t)?.forEach(i=>{let a=i.replace("<a ","");e=e.replaceAll(i,a)}),e}function He(e,t,r,i){let a=e[r];if(a==null)return"";let n=a.includes("<"),o=a.includes("${t}`:r&&(v=`${r}`),c&&(v+=f+x),v+=Y(j.integer,s),v+=Y(j.decimalsDelimiter,n),v+=Y(j.decimals,a),c||(v+=x+f),v+=Y(j.recurrence,l,null,!0),v+=Y(j.unitType,d,null,!0),v+=Y(j.taxInclusivity,h,!0),Y(e,v,{...u})}var ae=({isAlternativePrice:e=!1,displayOptical:t=!1,displayStrikethrough:r=!1,displayPromoStrikethrough:i=!1,displayAnnual:a=!1,instant:n=void 0}={})=>({country:o,displayFormatted:s=!0,displayRecurrence:c=!0,displayPerUnit:l=!1,displayTax:d=!1,language:h,literals:u={},quantity:f=1,space:x=!1,isPromoApplied:v=!1}={},{commitment:S,offerSelectorIds:z,formatString:I,price:C,priceWithoutDiscount:O,taxDisplay:K,taxTerm:q,term:Q,usePrecision:ee,promotion:de}={},ie={})=>{Object.entries({country:o,formatString:I,language:h,price:C}).forEach(([Tl,kl])=>{if(kl==null)throw new Error(`Argument "${Tl}" is missing for osi ${z?.toString()}, country ${o}, language ${h}`)});let W={...tn,...u},$=`${h.toLowerCase()}-${o.toUpperCase()}`,he;de&&!v&&O?he=e||i?C:O:r&&O?he=O:he=C;let be=t?Mo:Ro;a&&(be=Oo);let{accessiblePrice:Tt,recurrenceTerm:jn,...Wn}=be({commitment:S,formatString:I,instant:n,isIndianPrice:o==="IN",originalPrice:C,priceWithoutDiscount:O,price:t?C:he,promotion:de,quantity:f,term:Q,usePrecision:ee}),Zi="",Ji="",ea="";T(c)&&jn&&(ea=He(W,$,We.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=He(W,$,We.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=He(W,$,K===rn?We.taxExclusiveLabel:We.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=He(W,$,We.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=He(W,$,We.alternativePriceAriaLabel,{alternativePrice:Ji}));let Je=j.container;if(t&&(Je+=" "+j.containerOptical),r&&(Je+=" "+j.containerStrikethrough),i&&(Je+=" "+j.containerPromoStrikethrough),e&&(Je+=" "+j.containerAlternative),a&&(Je+=" "+j.containerAnnual),T(s))return Th(Je,{...Wn,accessibleLabel:Zi,altAccessibleLabel:Ji,recurrenceLabel:ea,perUnitLabel:ni,taxInclusivityLabel:oi},ie);let{currencySymbol:Yn,decimals:wl,decimalsDelimiter:El,hasCurrencySpace:Xn,integer:Al,isCurrencyFirst:Sl}=Wn,kt=[Al,El,wl];Sl?(kt.unshift(Xn?"\xA0":""),kt.unshift(Yn)):(kt.push(Xn?"\xA0":""),kt.push(Yn)),kt.push(ea,ni,oi);let Cl=kt.join("");return Y(Je,Cl,ie)},xs=()=>(e,t,r)=>{let i=dt(t.promotion,t.promotion?.displaySummary?.instant,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n=(e.displayOldPrice===void 0||T(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price&&(!t.promotion||i);return`${n?ae({displayStrikethrough:!0})({isPromoApplied:i,...e},t,r)+" ":""}${ae({isAlternativePrice:n})({isPromoApplied:i,...e},t,r)}`},vs=()=>(e,t,r)=>{let{instant:i}=e;try{i||(i=new URLSearchParams(document.location.search).get("instant")),i&&(i=new Date(i))}catch{i=void 0}let a=dt(t.promotion,i,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n={...e,displayTax:!1,displayPerUnit:!1,isPromoApplied:a};if(!a)return ae()(e,{...t,price:t.priceWithoutDiscount},r)+Y(j.containerAnnualPrefix," (")+ae({displayAnnual:!0,instant:i})(n,{...t,price:t.priceWithoutDiscount},r)+Y(j.containerAnnualSuffix,")");let s=(e.displayOldPrice===void 0||T(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${s?ae({displayStrikethrough:!0})(n,t,r)+" ":""}${ae({isAlternativePrice:s})({isPromoApplied:a,...e},t,r)}${Y(j.containerAnnualPrefix," (")}${ae({displayAnnual:!0,instant:i})(n,t,r)}${Y(j.containerAnnualSuffix,")")}`},bs=()=>(e,t,r)=>{let i={...e,displayTax:!1,displayPerUnit:!1};return`${ae({isAlternativePrice:e.displayOldPrice})(e,t,r)}${Y(j.containerAnnualPrefix," (")}${ae({displayAnnual:!0})(i,t,r)}${Y(j.containerAnnualSuffix,")")}`};var Lr={...j,containerLegal:"price-legal",planType:"price-plan-type"},Ri={...We,planTypeLabel:"planTypeLabel"};function kh(e,{perUnitLabel:t,taxInclusivityLabel:r,planTypeLabel:i},a={}){let n="";return n+=Y(Lr.unitType,t,null,!0),r&&i&&(r+=". "),n+=Y(Lr.taxInclusivity,r,!0),n+=Y(Lr.planType,i,null),Y(e,n,{...a})}var ys=({country:e,displayPerUnit:t=!1,displayTax:r=!1,displayPlanType:i=!1,language:a,literals:n={}}={},{taxDisplay:o,taxTerm:s,planType:c}={},l={})=>{let d={...tn,...n},h=`${a.toLowerCase()}-${e.toUpperCase()}`,u="";T(t)&&(u=He(d,h,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=He(d,h,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=He(d,h,Ri.planTypeLabel,{planType:c}));let v=Lr.container;return v+=" "+Lr.containerLegal,kh(v,{perUnitLabel:u,taxInclusivityLabel:f,planTypeLabel:x},l)};var ws=ae(),Es=xs(),As=ae({displayOptical:!0}),Ss=ae({displayStrikethrough:!0}),Cs=ae({displayPromoStrikethrough:!0}),Ts=ae({displayAnnual:!0}),ks=ae({displayOptical:!0,isAlternativePrice:!0}),_s=ae({isAlternativePrice:!0}),Ps=bs(),Ls=vs(),Ms=ys;var _h=(e,t)=>{if(!(!vr(e)||!vr(t)))return Math.floor((t-e)/t*100)},Rs=()=>(e,t)=>{let{price:r,priceWithoutDiscount:i}=t,a=_h(r,i);return a===void 0?'':`${a}%`};var Os=Rs();var Ns="INDIVIDUAL_COM",nn="TEAM_COM",Is="INDIVIDUAL_EDU",on="TEAM_EDU",Ph=["AT_de","AU_en","BE_en","BE_fr","BE_nl","BG_bg","CH_de","CH_fr","CH_it","CZ_cs","CO_es","DE_de","DK_da","EE_et","EG_ar","EG_en","ES_es","FI_fi","FR_fr","GB_en","GR_el","GR_en","HU_hu","ID_en","ID_id","ID_in","IE_en","IN_en","IN_hi","IT_it","JP_ja","KR_ko","LU_de","LU_en","LU_fr","LT_lt","LV_lv","MY_en","MY_ms","MU_en","NL_nl","NG_en","NO_nb","NZ_en","PE_es","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","SG_en","TH_en","TH_th","TR_tr","UA_uk","ZA_en","SA_ar","SA_en","MX_es","CL_es","PE_es","AR_es"],Lh={[Ns]:[],[nn]:["VN_vi","VN_en","TW_zh"],[Is]:[],[on]:["VN_vi","VN_en","TW_zh"]},Mh={MU_en:[!0,!0,!0,!0],NG_en:[!1,!1,!1,!1],AU_en:[!1,!1,!1,!1],JP_ja:[!1,!1,!1,!1],NZ_en:[!1,!1,!1,!1],TH_en:[!1,!1,!1,!1],TH_th:[!1,!1,!1,!1],ZA_en:[!1,!1,!1,!1],PE_es:[!1,!1,!1,!1]},Rh=[Ns,nn,Is,on],Oh=e=>[nn,on].includes(e);function an(e,t,r,i){if(e[t])return e[t];let a=`${t}_${r}`;if(e[a])return e[a];let n;if(i)n=e.find(o=>o.startsWith(`${t}_`));else{let o=Object.keys(e).find(s=>s.startsWith(`${t}_`));n=o?e[o]:null}return n}var Nh=(e,t,r,i)=>{let a=`${r}_${i}`,n=an(Mh,e,t,!1);if(n){let o=Rh.indexOf(a);return n[o]}return Oh(a)},Ih=(e,t,r,i)=>{if(an(Ph,e,t,!0))return!0;let a=Lh[`${r}_${i}`];return a?an(a,e,t,!0)?!0:N.displayTax:N.displayTax},Oi=async(e,t,r,i)=>{let a=Ih(e,t,r,i);return{displayTax:a,forceTaxExclusive:a?Nh(e,t,r,i):N.forceTaxExclusive}},Mr=class Mr extends HTMLSpanElement{constructor(){super();m(this,"masElement",new je(this));this.handleClick=this.handleClick.bind(this)}static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-display-plan-type","data-display-annual","data-perpetual","data-promotion-code","data-force-tax-exclusive","data-template","data-wcs-osi","data-quantity"]}static createInlinePrice(r){let i=pe();if(!i)return null;let{displayOldPrice:a,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:h,promotionCode:u,quantity:f,alternativePrice:x,template:v,wcsOsi:S}=i.collectPriceOptions(r);return bi(Mr,{displayOldPrice:a,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:h,promotionCode:u,quantity:f,alternativePrice:x,template:v,wcsOsi:S})}get isInlinePrice(){return!0}attributeChangedCallback(r,i,a){this.masElement.attributeChangedCallback(r,i,a)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.handleClick)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.handleClick)}handleClick(r){r.target!==this&&(r.stopImmediatePropagation(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})))}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}get isFailed(){return this.masElement.state===Te}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let i=pe();if(!i)return!1;let a=i.collectPriceOptions(r,this),n={...i.settings,...a};if(!n.wcsOsi.length)return!1;try{let o=this.masElement.togglePending({});this.innerHTML="";let s=i.resolveOfferSelectors(n),c=await Promise.all(s),l=c.map(f=>{let x=wr(f,n);return x?.length?x[0]:null});if(l.some(f=>!f))throw new Error(`Failed to select offers for: ${n.wcsOsi}`);let d=l,h=za(l);if(i.featureFlags[ke]||n[ke]){if(a.displayPerUnit===void 0&&(n.displayPerUnit=h.customerSegment!=="INDIVIDUAL"),a.displayTax===void 0||a.forceTaxExclusive===void 0){let{country:f,language:x}=n,[v=""]=h.marketSegments,S=await Oi(f,x,h.customerSegment,v);a.displayTax===void 0&&(n.displayTax=S?.displayTax||n.displayTax),a.forceTaxExclusive===void 0&&(n.forceTaxExclusive=S?.forceTaxExclusive||n.forceTaxExclusive),n.forceTaxExclusive&&(d=c.map(z=>{let I=wr(z,n);return I?.length?I[0]:null}))}}else a.displayOldPrice===void 0&&(n.displayOldPrice=!0);if(i.featureFlags[Mt]&&n.displayAnnual!==!1&&(n.displayAnnual=!0),n.template==="discount"&&d.length===2){let[f,x]=d,v={...f,priceDetails:{...f.priceDetails,priceWithoutDiscount:x.priceDetails?.price}};return this.renderOffers([v],n,o)}let u=za(d);return this.renderOffers([u],n,o)}catch(o){throw this.innerHTML="",o}}renderOffers(r,i,a=void 0){if(!this.isConnected)return;let n=pe();if(!n)return!1;if(a??(a=this.masElement.togglePending()),r.length){if(this.masElement.toggleResolved(a,r,i)){this.innerHTML=n.buildPriceHTML(r,this.options);let o=this.closest("p, h3, div");if(!o||!o.querySelector('span[data-template="strikethrough"]')||o.querySelector(".alt-aria-label"))return!0;let s=o?.querySelectorAll('span[is="inline-price"]');return s.length>1&&s.length===o.querySelectorAll('span[data-template="strikethrough"]').length*2&&s.forEach(c=>{c.dataset.template!=="strikethrough"&&c.options&&!c.options.alternativePrice&&!c.isFailed&&(c.options.alternativePrice=!0,c.innerHTML=n.buildPriceHTML(r,c.options))}),!0}}else{let o=new Error(`Not provided: ${this.options?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(a,o,this.options))return this.innerHTML="",!0}return!1}};m(Mr,"is","inline-price"),m(Mr,"tag","span");var Be=Mr;window.customElements.get(Be.is)||window.customElements.define(Be.is,Be,{extends:Be.tag});function zs({literals:e,providers:t,settings:r}){function i(o,s=null){let c={country:r.country,language:r.language,locale:r.locale,literals:{...e.price}};if(s&&t?.price)for(let q of t.price)q(s,c);let{displayOldPrice:l,displayPerUnit:d,displayRecurrence:h,displayTax:u,displayPlanType:f,forceTaxExclusive:x,perpetual:v,displayAnnual:S,promotionCode:z,quantity:I,alternativePrice:C,wcsOsi:O,...K}=Object.assign(c,s?.dataset??{},o??{});return c=pi(Object.assign({...c,...K,displayOldPrice:T(l),displayPerUnit:T(d),displayRecurrence:T(h),displayTax:T(u),displayPlanType:T(f),forceTaxExclusive:T(x),perpetual:T(v),displayAnnual:T(S),promotionCode:ui(z).effectivePromoCode,quantity:Ot(I,N.quantity),alternativePrice:T(C),wcsOsi:xi(O)})),c}function a(o,s){if(!Array.isArray(o)||!o.length||!s)return"";let{template:c}=s,l;switch(c){case"discount":l=Os;break;case"strikethrough":l=Ss;break;case"promo-strikethrough":l=Cs;break;case"annual":l=Ts;break;case"legal":l=Ms;break;default:s.template==="optical"&&s.alternativePrice?l=ks:s.template==="optical"?l=As:s.displayAnnual&&o[0].planType==="ABM"?l=s.promotionCode?Ls:Ps:s.alternativePrice?l=_s:l=s.promotionCode?Es:ws}let[d]=o;return d={...d,...d.priceDetails},l({...r,...s},d)}let n=Be.createInlinePrice;return{InlinePrice:Be,buildPriceHTML:a,collectPriceOptions:i,createInlinePrice:n}}function zh({locale:e=void 0,country:t=void 0,language:r=void 0}={}){return r??(r=e?.split("_")?.[0]||N.language),t??(t=e?.split("_")?.[1]||N.country),e??(e=`${r}_${t}`),{locale:e,country:t,language:r}}function Ds(e={},t){let r=t.featureFlags[ke],{commerce:i={}}=e,a=Re.PRODUCTION,n=fa,o=F("checkoutClientId",i)??N.checkoutClientId,s=br(F("checkoutWorkflowStep",i),ce,N.checkoutWorkflowStep),c=T(F("displayOldPrice",i),N.displayOldPrice),l=N.displayPerUnit,d=T(F("displayRecurrence",i),N.displayRecurrence),h=T(F("displayTax",i),N.displayTax),u=T(F("displayPlanType",i),N.displayPlanType),f=T(F("entitlement",i),N.entitlement),x=T(F("modal",i),N.modal),v=T(F("forceTaxExclusive",i),N.forceTaxExclusive),S=F("promotionCode",i)??N.promotionCode,z=Ot(F("quantity",i)),I=F("wcsApiKey",i)??N.wcsApiKey,C=i?.env==="stage",O=Ve.PUBLISHED;["true",""].includes(i.allowOverride)&&(C=(F(ua,i,{metadata:!1})?.toLowerCase()??i?.env)==="stage",O=br(F(ga,i),Ve,O)),C&&(a=Re.STAGE,n=xa);let q=F(ma)??e.preview,Q=typeof q<"u"&&q!=="off"&&q!=="false",ee={};Q&&(ee={preview:Q});let de=F("mas-io-url")??e.masIOUrl??`https://www${a===Re.STAGE?".stage":""}.adobe.com/mas/io`,ie=F("preselect-plan")??void 0;return{...zh(e),...ee,displayOldPrice:c,checkoutClientId:o,checkoutWorkflowStep:s,displayPerUnit:l,displayRecurrence:d,displayTax:h,displayPlanType:u,entitlement:f,extraOptions:N.extraOptions,modal:x,env:a,forceTaxExclusive:v,promotionCode:S,quantity:z,alternativePrice:N.alternativePrice,wcsApiKey:I,wcsURL:n,landscape:O,masIOUrl:de,...ie&&{preselectPlan:ie}}}async function Ni(e,t={},r=2,i=100){let a;for(let n=0;n<=r;n++)try{let o=await fetch(e,t);return o.retryCount=n,o}catch(o){if(a=o,a.retryCount=n,n>r)break;await new Promise(s=>setTimeout(s,i*(n+1)))}throw a}var Dh="mas-commerce-service";function Rr(e,t){let r;return function(){let i=this,a=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(i,a),t)}}function ne(e,t={},r=null,i=null){let a=i?document.createElement(e,{is:i}):document.createElement(e);r instanceof HTMLElement?a.appendChild(r):a.innerHTML=r;for(let[n,o]of Object.entries(t))a.setAttribute(n,o);return a}function Ne(e){return`startTime:${e.startTime.toFixed(2)}|duration:${e.duration.toFixed(2)}`}function sn(){return window.matchMedia("(max-width: 1024px)").matches}function mt(){return document.getElementsByTagName(Dh)?.[0]}function Or(e){let t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.marginTop)+parseFloat(t.marginBottom)}var cn="wcs";function $s({settings:e}){let t=le.module(cn),{env:r,wcsApiKey:i}=e,a=new Map,n=new Map,o,s=new Map;async function c(x,v,S=!0){let z=pe(),I=da;t.debug("Fetching:",x);let C="",O;if(x.offerSelectorIds.length>1)throw new Error("Multiple OSIs are not supported anymore");let K=new Map(v),[q]=x.offerSelectorIds,Q=Date.now()+Math.random().toString(36).substring(2,7),ee=`${cn}:${q}:${Q}${st}`,de=`${cn}:${q}:${Q}${ct}`,ie;try{if(performance.mark(ee),C=new URL(e.wcsURL),C.searchParams.set("offer_selector_ids",q),C.searchParams.set("country",x.country),C.searchParams.set("locale",x.locale),C.searchParams.set("landscape",r===Re.STAGE?"ALL":e.landscape),C.searchParams.set("api_key",i),x.language&&C.searchParams.set("language",x.language),x.promotionCode&&C.searchParams.set("promotion_code",x.promotionCode),x.currency&&C.searchParams.set("currency",x.currency),O=await Ni(C.toString(),{credentials:"omit"}),O.ok){let W=[];try{let $=await O.json();t.debug("Fetched:",x,$),W=$.resolvedOffers??[]}catch($){t.error(`Error parsing JSON: ${$.message}`,{...$.context,...z?.duration})}W=W.map(yr),v.forEach(({resolve:$},he)=>{let be=W.filter(({offerSelectorIds:Tt})=>Tt.includes(he)).flat();be.length&&(K.delete(he),v.delete(he),$(be))})}else I=la}catch(W){I=`Network error: ${W.message}`}finally{ie=performance.measure(de,ee),performance.clearMarks(ee),performance.clearMeasures(de)}if(S&&v.size){t.debug("Missing:",{offerSelectorIds:[...v.keys()]});let W=vi(O);v.forEach($=>{$.reject(new Oe(I,{...x,...W,response:O,measure:Ne(ie),...z?.duration}))})}}function l(){clearTimeout(o);let x=[...n.values()];n.clear(),x.forEach(({options:v,promises:S})=>c(v,S))}function d(x){if(!x||typeof x!="object")throw new TypeError("Cache must be a Map or similar object");let v=r===Re.STAGE?"stage":"prod",S=x[v];if(!S||typeof S!="object"){t.warn(`No cache found for environment: ${r}`);return}for(let[z,I]of Object.entries(S))a.set(z,Promise.resolve(I.map(yr)));t.debug(`Prefilled WCS cache with ${S.size} entries`)}function h(){let x=a.size;s=new Map(a),a.clear(),t.debug(`Moved ${x} cache entries to stale cache`)}function u(x,v,S){let z=x!=="GB"&&!S?"MULT":"en",I=ba.includes(x)?x:N.country;return{validCountry:I,validLanguage:z,locale:`${v}_${I}`}}function f({country:x,language:v,perpetual:S=!1,promotionCode:z="",wcsOsi:I=[]}){let{validCountry:C,validLanguage:O,locale:K}=u(x,v,S),q=[C,O,z].filter(Q=>Q).join("-").toLowerCase();return I.map(Q=>{let ee=`${Q}-${q}`;if(a.has(ee))return a.get(ee);let de=new Promise((ie,W)=>{let $=n.get(q);$||($={options:{country:C,locale:K,...O==="MULT"&&{language:O},offerSelectorIds:[]},promises:new Map},n.set(q,$)),z&&($.options.promotionCode=z),$.options.offerSelectorIds.push(Q),$.promises.set(Q,{resolve:ie,reject:W}),l()}).catch(ie=>{if(s.has(ee))return s.get(ee);throw ie});return a.set(ee,de),de})}return{Commitment:rt,PlanType:po,Term:ye,applyPlanType:yr,resolveOfferSelectors:f,flushWcsCacheInternal:h,prefillWcsCache:d,normalizeCountryLanguageAndLocale:u}}var Hs="mas-commerce-service",Bs="mas-commerce-service:start",Fs="mas-commerce-service:ready",Nr,It,ut,Us,dn,ln=class extends HTMLElement{constructor(){super(...arguments);E(this,ut);E(this,Nr);E(this,It);m(this,"lastLoggingTime",0)}async registerCheckoutAction(r){typeof r=="function"&&(this.buildCheckoutAction=async(i,a,n)=>{let o=await r?.(i,a,this.imsSignedInPromise,n);return o||null})}get featureFlags(){return p(this,It)||y(this,It,{[ke]:Z(this,ut,dn).call(this,ke),[Mt]:Z(this,ut,dn).call(this,Mt)}),p(this,It)}activate(){let r=p(this,ut,Us),i=Ds(r,this);si(r.lana);let a=le.init(r.hostEnv).module("service");a.debug("Activating:",r);let o={price:Go(i)},s={checkout:new Set,price:new Set},c={literals:o,providers:s,settings:i};Object.defineProperties(this,Object.getOwnPropertyDescriptors({...Bo(c),...Fo(c),...zs(c),...$s(c),...ya,Log:le,resolvePriceTaxFlags:Oi,get defaults(){return N},get log(){return le},get providers(){return{checkout(d){return s.checkout.add(d),()=>s.checkout.delete(d)},price(d){return s.price.add(d),()=>s.price.delete(d)},has:d=>s.price.has(d)||s.checkout.has(d)}},get settings(){return i}})),a.debug("Activated:",{literals:o,settings:i});let l=new CustomEvent(ci,{bubbles:!0,cancelable:!1,detail:this});performance.mark(Fs),y(this,Nr,performance.measure(Fs,Bs)),this.dispatchEvent(l),setTimeout(()=>{this.logFailedRequests()},1e4)}connectedCallback(){performance.mark(Bs),this.activate()}flushWcsCache(){this.flushWcsCacheInternal(),this.log.debug("Flushed WCS cache")}isPreview(){let r=this.getAttribute("preview");return r!=null&&["true","on",!0].includes(r)}refreshOffers(){this.flushWcsCacheInternal(),document.querySelectorAll(ur).forEach(r=>r.requestUpdate(!0)),this.log.debug("Refreshed WCS offers"),this.logFailedRequests()}refreshFragments(){this.flushWcsCacheInternal(),customElements.get("aem-fragment")?.cache.clear(),document.querySelectorAll("aem-fragment").forEach(r=>r.refresh(!1)),this.log.debug("Refreshed AEM fragments"),this.logFailedRequests()}get duration(){return{"mas-commerce-service:measure":Ne(p(this,Nr))}}logFailedRequests(){let r=[...performance.getEntriesByType("resource")].filter(({startTime:a})=>a>this.lastLoggingTime).filter(({transferSize:a,duration:n,responseStatus:o})=>a===0&&n===0&&o<200||o>=400),i=Array.from(new Map(r.map(a=>[a.name,a])).values());if(i.some(({name:a})=>/(\/fragment\?|web_commerce_artifact)/.test(a))){let a=i.map(({name:n})=>n);this.log.error("Failed requests:",{failedUrls:a,...this.duration})}this.lastLoggingTime=performance.now().toFixed(3)}};Nr=new WeakMap,It=new WeakMap,ut=new WeakSet,Us=function(){let r=this.getAttribute("env")??"prod",i={commerce:{env:r},hostEnv:{name:r},lana:{tags:this.getAttribute("lana-tags"),sampleRate:parseInt(this.getAttribute("lana-sample-rate")??1,10),isProdDomain:r==="prod"},masIOUrl:this.getAttribute("mas-io-url")};return["locale","country","language","preview"].forEach(a=>{let n=this.getAttribute(a);n&&(i[a]=n)}),["checkout-workflow-step","force-tax-exclusive","checkout-client-id","allow-override","wcs-api-key"].forEach(a=>{let n=this.getAttribute(a);if(n!=null){let o=a.replace(/-([a-z])/g,s=>s[1].toUpperCase());i.commerce[o]=n}}),i},dn=function(r){return["on","true",!0].includes(this.getAttribute(`data-${r}`)||F(r))};window.customElements.get(Hs)||window.customElements.define(Hs,ln);var Ir=class Ir extends wi(HTMLButtonElement){static createCheckoutButton(t={},r=""){return yi(Ir,t,r)}setCheckoutUrl(t){this.setAttribute("data-href",t)}get href(){return this.getAttribute("data-href")}get isCheckoutButton(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}this.href&&(window.location.href=this.href)}};m(Ir,"is","checkout-button"),m(Ir,"tag","button");var zt=Ir;window.customElements.get(zt.is)||window.customElements.define(zt.is,zt,{extends:zt.tag});function $h(e){return`https://${e==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var ft,gt=class gt extends HTMLAnchorElement{constructor(){super();m(this,"masElement",new je(this));E(this,ft);this.setAttribute("is",gt.is)}get isUptLink(){return!0}initializeWcsData(r,i){this.setAttribute("data-wcs-osi",r),i&&this.setAttribute("data-promotion-code",i)}attributeChangedCallback(r,i,a){this.masElement.attributeChangedCallback(r,i,a)}connectedCallback(){this.masElement.connectedCallback(),y(this,ft,mt()),p(this,ft)&&(this.log=p(this,ft).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),y(this,ft,void 0)}requestUpdate(r=!1){this.masElement.requestUpdate(r)}onceSettled(){return this.masElement.onceSettled()}async render(){let r=mt();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let i=r.collectCheckoutOptions({},this);if(!i.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let a=this.masElement.togglePending(i),n=r.resolveOfferSelectors(i);try{let[[o]]=await Promise.all(n),{country:s,language:c,env:l}=i,d=`locale=${c}_${s}&country=${s}&offer_id=${o.offerId}`,h=this.getAttribute("data-promotion-code");h&&(d+=`&promotion_code=${encodeURIComponent(h)}`),this.href=`${$h(l)}?${d}`,this.masElement.toggleResolved(a,o,i)}catch(o){let s=new Error(`Could not resolve offer selectors for id: ${i.wcsOsi}.`,o.message);return this.masElement.toggleFailed(a,s,i),!1}}static createFrom(r){let i=new gt;for(let a of r.attributes)a.name!=="is"&&(a.name==="class"&&a.value.includes("upt-link")?i.setAttribute("class",a.value.replace("upt-link","").trim()):i.setAttribute(a.name,a.value));return i.innerHTML=r.innerHTML,i.setAttribute("tabindex",0),i}};ft=new WeakMap,m(gt,"is","upt-link"),m(gt,"tag","a"),m(gt,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var Ye=gt;window.customElements.get(Ye.is)||window.customElements.define(Ye.is,Ye,{extends:Ye.tag});P();P();var H="(max-width: 767px)",re="(max-width: 1199px)",B="(min-width: 768px)",_="(min-width: 1200px)",oe="(min-width: 1600px)",lc={matchMobile:window.matchMedia(H),matchDesktop:window.matchMedia(`${_} and (not ${oe})`),matchDesktopOrUp:window.matchMedia(_),matchLargeDesktop:window.matchMedia(oe),get isMobile(){return this.matchMobile.matches},get isDesktop(){return this.matchDesktop.matches},get isDesktopOrUp(){return this.matchDesktopOrUp.matches}},R=lc;function Fi(){return lc.isDesktop}var dc=b` +`,pt.MISSING_INTL_API,o);var O=r.getPluralRules(t,{type:d.pluralType}).select(u-(d.offset||0));C=d.options[O]||d.options.other}if(!C)throw new tn(d.value,u,Object.keys(d.options),o);s.push.apply(s,Pr(C.value,t,r,i,a,u-(d.offset||0)));continue}}return bh(s)}function wh(e,t){return t?L(L(L({},e||{}),t||{}),Object.keys(e).reduce(function(r,i){return r[i]=L(L({},e[i]),t[i]||{}),r},{})):e}function Eh(e,t){return t?Object.keys(e).reduce(function(r,i){return r[i]=wh(e[i],t[i]),r},L({},e)):e}function rn(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function Ah(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:kr(function(){for(var t,r=[],i=0;i0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=hs,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var xs=fs;var an={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",strikethroughAriaLabel:"Regularly at",planTypeLabel:"{planType, select, ABM {Annual, billed monthly} other {}}"},Sh=ho("ConsonantTemplates/price"),Ch=/<\/?[^>]+(>|$)/g,j={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerPromoStrikethrough:"price-promo-strikethrough",containerAlternative:"price-alternative",containerAnnual:"price-annual",containerAnnualPrefix:"price-annual-prefix",containerAnnualSuffix:"price-annual-suffix",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"},We={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel",alternativePriceAriaLabel:"alternativePriceAriaLabel"},nn="TAX_EXCLUSIVE",Th=e=>so(e)?Object.entries(e).filter(([,t])=>Rt(t)||pi(t)||t===!0).reduce((t,[r,i])=>t+` ${r}${i===!0?"":'="'+oo(i)+'"'}`,""):"",Y=(e,t,r,i=!1)=>`${i?Lo(t):t??""}`;function kh(e){e=e.replaceAll("","</a>");let t=/]+(>|$)/g;return e.match(t)?.forEach(i=>{let a=i.replace("",">");e=e.replaceAll(i,a)}),e}function _h(e){e=e.replaceAll("</a>","");let t=/<a (?!>)(.*?)(>|$)/g;return e.match(t)?.forEach(i=>{let a=i.replace("<a ","");e=e.replaceAll(i,a)}),e}function He(e,t,r,i){let a=e[r];if(a==null)return"";let n=a.includes("<"),o=a.includes("${t}`:r&&(v=`${r}`),c&&(v+=f+x),v+=Y(j.integer,s),v+=Y(j.decimalsDelimiter,n),v+=Y(j.decimals,a),c||(v+=x+f),v+=Y(j.recurrence,l,null,!0),v+=Y(j.unitType,d,null,!0),v+=Y(j.taxInclusivity,p,!0),Y(e,v,{...u})}var ae=({isAlternativePrice:e=!1,displayOptical:t=!1,displayStrikethrough:r=!1,displayPromoStrikethrough:i=!1,displayAnnual:a=!1,instant:n=void 0}={})=>({country:o,displayFormatted:s=!0,displayRecurrence:c=!0,displayPerUnit:l=!1,displayTax:d=!1,language:p,literals:u={},quantity:f=1,space:x=!1,isPromoApplied:v=!1}={},{commitment:S,offerSelectorIds:z,formatString:I,price:C,priceWithoutDiscount:O,taxDisplay:K,taxTerm:q,term:Q,usePrecision:ee,promotion:de}={},ie={})=>{Object.entries({country:o,formatString:I,language:p,price:C}).forEach(([Pl,Ll])=>{if(Ll==null)throw new Error(`Argument "${Pl}" is missing for osi ${z?.toString()}, country ${o}, language ${p}`)});let W={...an,...u},$=`${p.toLowerCase()}-${o.toUpperCase()}`,he;de&&!v&&O?he=e||i?C:O:r&&O?he=O:he=C;let be=t?Ro:Oo;a&&(be=No);let{accessiblePrice:Tt,recurrenceTerm:Wn,...Yn}=be({commitment:S,formatString:I,instant:n,isIndianPrice:o==="IN",originalPrice:C,priceWithoutDiscount:O,price:t?C:he,promotion:de,quantity:f,term:Q,usePrecision:ee}),ea="",ta="",ra="";T(c)&&Wn&&(ra=He(W,$,We.recurrenceLabel,{recurrenceTerm:Wn}));let oi="";T(l)&&(x&&(oi+=" "),oi+=He(W,$,We.perUnitLabel,{perUnit:"LICENSE"}));let si="";T(d)&&q&&(x&&(si+=" "),si+=He(W,$,K===nn?We.taxExclusiveLabel:We.taxInclusiveLabel,{taxTerm:q})),r&&(ea=He(W,$,We.strikethroughAriaLabel,{strikethroughPrice:ea})),e&&(ta=He(W,$,We.alternativePriceAriaLabel,{alternativePrice:ta}));let Je=j.container;if(t&&(Je+=" "+j.containerOptical),r&&(Je+=" "+j.containerStrikethrough),i&&(Je+=" "+j.containerPromoStrikethrough),e&&(Je+=" "+j.containerAlternative),a&&(Je+=" "+j.containerAnnual),T(s))return Ph(Je,{...Yn,accessibleLabel:ea,altAccessibleLabel:ta,recurrenceLabel:ra,perUnitLabel:oi,taxInclusivityLabel:si},ie);let{currencySymbol:Xn,decimals:Sl,decimalsDelimiter:Cl,hasCurrencySpace:Kn,integer:Tl,isCurrencyFirst:kl}=Yn,kt=[Tl,Cl,Sl];kl?(kt.unshift(Kn?"\xA0":""),kt.unshift(Xn)):(kt.push(Kn?"\xA0":""),kt.push(Xn)),kt.push(ra,oi,si);let _l=kt.join("");return Y(Je,_l,ie)},vs=()=>(e,t,r)=>{let i=dt(t.promotion,t.promotion?.displaySummary?.instant,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n=(e.displayOldPrice===void 0||T(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price&&(!t.promotion||i);return`${n?ae({displayStrikethrough:!0})({isPromoApplied:i,...e},t,r)+" ":""}${ae({isAlternativePrice:n})({isPromoApplied:i,...e},t,r)}`},bs=()=>(e,t,r)=>{let{instant:i}=e;try{i||(i=new URLSearchParams(document.location.search).get("instant")),i&&(i=new Date(i))}catch{i=void 0}let a=dt(t.promotion,i,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n={...e,displayTax:!1,displayPerUnit:!1,isPromoApplied:a};if(!a)return ae()(e,{...t,price:t.priceWithoutDiscount},r)+Y(j.containerAnnualPrefix," (")+ae({displayAnnual:!0,instant:i})(n,{...t,price:t.priceWithoutDiscount},r)+Y(j.containerAnnualSuffix,")");let s=(e.displayOldPrice===void 0||T(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${s?ae({displayStrikethrough:!0})(n,t,r)+" ":""}${ae({isAlternativePrice:s})({isPromoApplied:a,...e},t,r)}${Y(j.containerAnnualPrefix," (")}${ae({displayAnnual:!0,instant:i})(n,t,r)}${Y(j.containerAnnualSuffix,")")}`},ys=()=>(e,t,r)=>{let i={...e,displayTax:!1,displayPerUnit:!1};return`${ae({isAlternativePrice:e.displayOldPrice})(e,t,r)}${Y(j.containerAnnualPrefix," (")}${ae({displayAnnual:!0})(i,t,r)}${Y(j.containerAnnualSuffix,")")}`};var Lr={...j,containerLegal:"price-legal",planType:"price-plan-type"},Oi={...We,planTypeLabel:"planTypeLabel"};function Lh(e,{perUnitLabel:t,taxInclusivityLabel:r,planTypeLabel:i},a={}){let n="";return n+=Y(Lr.unitType,t,null,!0),r&&i&&(r+=". "),n+=Y(Lr.taxInclusivity,r,!0),n+=Y(Lr.planType,i,null),Y(e,n,{...a})}var ws=({country:e,displayPerUnit:t=!1,displayTax:r=!1,displayPlanType:i=!1,language:a,literals:n={}}={},{taxDisplay:o,taxTerm:s,planType:c}={},l={})=>{let d={...an,...n},p=`${a.toLowerCase()}-${e.toUpperCase()}`,u="";T(t)&&(u=He(d,p,Oi.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=He(d,p,o===nn?Oi.taxExclusiveLabel:Oi.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=He(d,p,Oi.planTypeLabel,{planType:c}));let v=Lr.container;return v+=" "+Lr.containerLegal,Lh(v,{perUnitLabel:u,taxInclusivityLabel:f,planTypeLabel:x},l)};var Es=ae(),As=vs(),Ss=ae({displayOptical:!0}),Cs=ae({displayStrikethrough:!0}),Ts=ae({displayPromoStrikethrough:!0}),ks=ae({displayAnnual:!0}),_s=ae({displayOptical:!0,isAlternativePrice:!0}),Ps=ae({isAlternativePrice:!0}),Ls=ys(),Ms=bs(),Rs=ws;var Mh=(e,t)=>{if(!(!vr(e)||!vr(t)))return Math.floor((t-e)/t*100)},Os=()=>(e,t)=>{let{price:r,priceWithoutDiscount:i}=t,a=Mh(r,i);return a===void 0?'':`${a}%`};var Ns=Os();var Is="INDIVIDUAL_COM",sn="TEAM_COM",zs="INDIVIDUAL_EDU",cn="TEAM_EDU",Rh=["AT_de","AU_en","BE_en","BE_fr","BE_nl","BG_bg","CH_de","CH_fr","CH_it","CZ_cs","CO_es","DE_de","DK_da","EE_et","EG_ar","EG_en","ES_es","FI_fi","FR_fr","GB_en","GR_el","GR_en","HU_hu","ID_en","ID_id","ID_in","IE_en","IN_en","IN_hi","IT_it","JP_ja","KR_ko","LU_de","LU_en","LU_fr","LT_lt","LV_lv","MY_en","MY_ms","MU_en","NL_nl","NG_en","NO_nb","NZ_en","PE_es","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","SG_en","TH_en","TH_th","TR_tr","UA_uk","ZA_en","SA_ar","SA_en","MX_es","CL_es","PE_es","AR_es"],Oh={[Is]:[],[sn]:["VN_vi","VN_en","TW_zh"],[zs]:[],[cn]:["VN_vi","VN_en","TW_zh"]},Nh={MU_en:[!0,!0,!0,!0],NG_en:[!1,!1,!1,!1],AU_en:[!1,!1,!1,!1],JP_ja:[!1,!1,!1,!1],NZ_en:[!1,!1,!1,!1],TH_en:[!1,!1,!1,!1],TH_th:[!1,!1,!1,!1],ZA_en:[!1,!1,!1,!1],PE_es:[!1,!1,!1,!1]},Ih=[Is,sn,zs,cn],zh=e=>[sn,cn].includes(e);function on(e,t,r,i){if(e[t])return e[t];let a=`${t}_${r}`;if(e[a])return e[a];let n;if(i)n=e.find(o=>o.startsWith(`${t}_`));else{let o=Object.keys(e).find(s=>s.startsWith(`${t}_`));n=o?e[o]:null}return n}var Dh=(e,t,r,i)=>{let a=`${r}_${i}`,n=on(Nh,e,t,!1);if(n){let o=Ih.indexOf(a);return n[o]}return zh(a)},$h=(e,t,r,i)=>{if(on(Rh,e,t,!0))return!0;let a=Oh[`${r}_${i}`];return a?on(a,e,t,!0)?!0:N.displayTax:N.displayTax},Ni=async(e,t,r,i)=>{let a=$h(e,t,r,i);return{displayTax:a,forceTaxExclusive:a?Dh(e,t,r,i):N.forceTaxExclusive}},Mr=class Mr extends HTMLSpanElement{constructor(){super();m(this,"masElement",new je(this));this.handleClick=this.handleClick.bind(this)}static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-display-plan-type","data-display-annual","data-perpetual","data-promotion-code","data-force-tax-exclusive","data-template","data-wcs-osi","data-quantity"]}static createInlinePrice(r){let i=pe();if(!i)return null;let{displayOldPrice:a,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:p,promotionCode:u,quantity:f,alternativePrice:x,template:v,wcsOsi:S}=i.collectPriceOptions(r);return yi(Mr,{displayOldPrice:a,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:p,promotionCode:u,quantity:f,alternativePrice:x,template:v,wcsOsi:S})}get isInlinePrice(){return!0}attributeChangedCallback(r,i,a){this.masElement.attributeChangedCallback(r,i,a)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.handleClick)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.handleClick)}handleClick(r){r.target!==this&&(r.stopImmediatePropagation(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})))}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}get isFailed(){return this.masElement.state===Te}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let i=pe();if(!i)return!1;let a=i.collectPriceOptions(r,this),n={...i.settings,...a};if(!n.wcsOsi.length)return!1;try{let o=this.masElement.togglePending({});this.innerHTML="";let s=i.resolveOfferSelectors(n),c=await Promise.all(s),l=c.map(f=>{let x=wr(f,n);return x?.length?x[0]:null});if(l.some(f=>!f))throw new Error(`Failed to select offers for: ${n.wcsOsi}`);let d=l,p=$a(l);if(i.featureFlags[ke]||n[ke]){if(a.displayPerUnit===void 0&&(n.displayPerUnit=p.customerSegment!=="INDIVIDUAL"),a.displayTax===void 0||a.forceTaxExclusive===void 0){let{country:f,language:x}=n,[v=""]=p.marketSegments,S=await Ni(f,x,p.customerSegment,v);a.displayTax===void 0&&(n.displayTax=S?.displayTax||n.displayTax),a.forceTaxExclusive===void 0&&(n.forceTaxExclusive=S?.forceTaxExclusive||n.forceTaxExclusive),n.forceTaxExclusive&&(d=c.map(z=>{let I=wr(z,n);return I?.length?I[0]:null}))}}else a.displayOldPrice===void 0&&(n.displayOldPrice=!0);if(i.featureFlags[Mt]&&n.displayAnnual!==!1&&(n.displayAnnual=!0),n.template==="discount"&&d.length===2){let[f,x]=d,v={...f,priceDetails:{...f.priceDetails,priceWithoutDiscount:x.priceDetails?.price}};return this.renderOffers([v],n,o)}let u=$a(d);return this.renderOffers([u],n,o)}catch(o){throw this.innerHTML="",o}}renderOffers(r,i,a=void 0){if(!this.isConnected)return;let n=pe();if(!n)return!1;if(a??(a=this.masElement.togglePending()),r.length){if(this.masElement.toggleResolved(a,r,i)){this.innerHTML=n.buildPriceHTML(r,this.options);let o=this.closest("p, h3, div");if(!o||!o.querySelector('span[data-template="strikethrough"]')||o.querySelector(".alt-aria-label"))return!0;let s=o?.querySelectorAll('span[is="inline-price"]');return s.length>1&&s.length===o.querySelectorAll('span[data-template="strikethrough"]').length*2&&s.forEach(c=>{c.dataset.template!=="strikethrough"&&c.options&&!c.options.alternativePrice&&!c.isFailed&&(c.options.alternativePrice=!0,c.innerHTML=n.buildPriceHTML(r,c.options))}),!0}}else{let o=new Error(`Not provided: ${this.options?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(a,o,this.options))return this.innerHTML="",!0}return!1}};m(Mr,"is","inline-price"),m(Mr,"tag","span");var Be=Mr;window.customElements.get(Be.is)||window.customElements.define(Be.is,Be,{extends:Be.tag});function Ds({literals:e,providers:t,settings:r}){function i(o,s=null){let c={country:r.country,language:r.language,locale:r.locale,literals:{...e.price}};if(s&&t?.price)for(let q of t.price)q(s,c);let{displayOldPrice:l,displayPerUnit:d,displayRecurrence:p,displayTax:u,displayPlanType:f,forceTaxExclusive:x,perpetual:v,displayAnnual:S,promotionCode:z,quantity:I,alternativePrice:C,wcsOsi:O,...K}=Object.assign(c,s?.dataset??{},o??{});return c=mi(Object.assign({...c,...K,displayOldPrice:T(l),displayPerUnit:T(d),displayRecurrence:T(p),displayTax:T(u),displayPlanType:T(f),forceTaxExclusive:T(x),perpetual:T(v),displayAnnual:T(S),promotionCode:gi(z).effectivePromoCode,quantity:Ot(I,N.quantity),alternativePrice:T(C),wcsOsi:vi(O)})),c}function a(o,s){if(!Array.isArray(o)||!o.length||!s)return"";let{template:c}=s,l;switch(c){case"discount":l=Ns;break;case"strikethrough":l=Cs;break;case"promo-strikethrough":l=Ts;break;case"annual":l=ks;break;case"legal":l=Rs;break;default:s.template==="optical"&&s.alternativePrice?l=_s:s.template==="optical"?l=Ss:s.displayAnnual&&o[0].planType==="ABM"?l=s.promotionCode?Ms:Ls:s.alternativePrice?l=Ps:l=s.promotionCode?As:Es}let[d]=o;return d={...d,...d.priceDetails},l({...r,...s},d)}let n=Be.createInlinePrice;return{InlinePrice:Be,buildPriceHTML:a,collectPriceOptions:i,createInlinePrice:n}}function Hh({locale:e=void 0,country:t=void 0,language:r=void 0}={}){return r??(r=e?.split("_")?.[0]||N.language),t??(t=e?.split("_")?.[1]||N.country),e??(e=`${r}_${t}`),{locale:e,country:t,language:r}}function $s(e={},t){let r=t.featureFlags[ke],{commerce:i={}}=e,a=Re.PRODUCTION,n=va,o=F("checkoutClientId",i)??N.checkoutClientId,s=br(F("checkoutWorkflowStep",i),ce,N.checkoutWorkflowStep),c=T(F("displayOldPrice",i),N.displayOldPrice),l=N.displayPerUnit,d=T(F("displayRecurrence",i),N.displayRecurrence),p=T(F("displayTax",i),N.displayTax),u=T(F("displayPlanType",i),N.displayPlanType),f=T(F("entitlement",i),N.entitlement),x=T(F("modal",i),N.modal),v=T(F("forceTaxExclusive",i),N.forceTaxExclusive),S=F("promotionCode",i)??N.promotionCode,z=Ot(F("quantity",i)),I=F("wcsApiKey",i)??N.wcsApiKey,C=i?.env==="stage",O=Ve.PUBLISHED;["true",""].includes(i.allowOverride)&&(C=(F(fa,i,{metadata:!1})?.toLowerCase()??i?.env)==="stage",O=br(F(xa,i),Ve,O)),C&&(a=Re.STAGE,n=ba);let q=F(ga)??e.preview,Q=typeof q<"u"&&q!=="off"&&q!=="false",ee={};Q&&(ee={preview:Q});let de=F("mas-io-url")??e.masIOUrl??`https://www${a===Re.STAGE?".stage":""}.adobe.com/mas/io`,ie=F("preselect-plan")??void 0;return{...Hh(e),...ee,displayOldPrice:c,checkoutClientId:o,checkoutWorkflowStep:s,displayPerUnit:l,displayRecurrence:d,displayTax:p,displayPlanType:u,entitlement:f,extraOptions:N.extraOptions,modal:x,env:a,forceTaxExclusive:v,promotionCode:S,quantity:z,alternativePrice:N.alternativePrice,wcsApiKey:I,wcsURL:n,landscape:O,masIOUrl:de,...ie&&{preselectPlan:ie}}}async function Ii(e,t={},r=2,i=100){let a;for(let n=0;n<=r;n++)try{let o=await fetch(e,t);return o.retryCount=n,o}catch(o){if(a=o,a.retryCount=n,n>r)break;await new Promise(s=>setTimeout(s,i*(n+1)))}throw a}var Bh="mas-commerce-service";function Rr(e,t){let r;return function(){let i=this,a=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(i,a),t)}}function ne(e,t={},r=null,i=null){let a=i?document.createElement(e,{is:i}):document.createElement(e);r instanceof HTMLElement?a.appendChild(r):a.innerHTML=r;for(let[n,o]of Object.entries(t))a.setAttribute(n,o);return a}function Ne(e){return`startTime:${e.startTime.toFixed(2)}|duration:${e.duration.toFixed(2)}`}function ln(){return window.matchMedia("(max-width: 1024px)").matches}function mt(){return document.getElementsByTagName(Bh)?.[0]}function Or(e){let t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.marginTop)+parseFloat(t.marginBottom)}var dn="wcs";function Hs({settings:e}){let t=le.module(dn),{env:r,wcsApiKey:i}=e,a=new Map,n=new Map,o,s=new Map;async function c(x,v,S=!0){let z=pe(),I=pa;t.debug("Fetching:",x);let C="",O;if(x.offerSelectorIds.length>1)throw new Error("Multiple OSIs are not supported anymore");let K=new Map(v),[q]=x.offerSelectorIds,Q=Date.now()+Math.random().toString(36).substring(2,7),ee=`${dn}:${q}:${Q}${st}`,de=`${dn}:${q}:${Q}${ct}`,ie;try{if(performance.mark(ee),C=new URL(e.wcsURL),C.searchParams.set("offer_selector_ids",q),C.searchParams.set("country",x.country),C.searchParams.set("locale",x.locale),C.searchParams.set("landscape",r===Re.STAGE?"ALL":e.landscape),C.searchParams.set("api_key",i),x.language&&C.searchParams.set("language",x.language),x.promotionCode&&C.searchParams.set("promotion_code",x.promotionCode),x.currency&&C.searchParams.set("currency",x.currency),O=await Ii(C.toString(),{credentials:"omit"}),O.ok){let W=[];try{let $=await O.json();t.debug("Fetched:",x,$),W=$.resolvedOffers??[]}catch($){t.error(`Error parsing JSON: ${$.message}`,{...$.context,...z?.duration})}W=W.map(yr),v.forEach(({resolve:$},he)=>{let be=W.filter(({offerSelectorIds:Tt})=>Tt.includes(he)).flat();be.length&&(K.delete(he),v.delete(he),$(be))})}else I=ha}catch(W){I=`Network error: ${W.message}`}finally{ie=performance.measure(de,ee),performance.clearMarks(ee),performance.clearMeasures(de)}if(S&&v.size){t.debug("Missing:",{offerSelectorIds:[...v.keys()]});let W=bi(O);v.forEach($=>{$.reject(new Oe(I,{...x,...W,response:O,measure:Ne(ie),...z?.duration}))})}}function l(){clearTimeout(o);let x=[...n.values()];n.clear(),x.forEach(({options:v,promises:S})=>c(v,S))}function d(x){if(!x||typeof x!="object")throw new TypeError("Cache must be a Map or similar object");let v=r===Re.STAGE?"stage":"prod",S=x[v];if(!S||typeof S!="object"){t.warn(`No cache found for environment: ${r}`);return}for(let[z,I]of Object.entries(S))a.set(z,Promise.resolve(I.map(yr)));t.debug(`Prefilled WCS cache with ${S.size} entries`)}function p(){let x=a.size;s=new Map(a),a.clear(),t.debug(`Moved ${x} cache entries to stale cache`)}function u(x,v,S){let z=x!=="GB"&&!S?"MULT":"en",I=wa.includes(x)?x:N.country;return{validCountry:I,validLanguage:z,locale:`${v}_${I}`}}function f({country:x,language:v,perpetual:S=!1,promotionCode:z="",wcsOsi:I=[]}){let{validCountry:C,validLanguage:O,locale:K}=u(x,v,S),q=[C,O,z].filter(Q=>Q).join("-").toLowerCase();return I.map(Q=>{let ee=`${Q}-${q}`;if(a.has(ee))return a.get(ee);let de=new Promise((ie,W)=>{let $=n.get(q);$||($={options:{country:C,locale:K,...O==="MULT"&&{language:O},offerSelectorIds:[]},promises:new Map},n.set(q,$)),z&&($.options.promotionCode=z),$.options.offerSelectorIds.push(Q),$.promises.set(Q,{resolve:ie,reject:W}),l()}).catch(ie=>{if(s.has(ee))return s.get(ee);throw ie});return a.set(ee,de),de})}return{Commitment:rt,PlanType:mo,Term:ye,applyPlanType:yr,resolveOfferSelectors:f,flushWcsCacheInternal:p,prefillWcsCache:d,normalizeCountryLanguageAndLocale:u}}var Bs="mas-commerce-service",Fs="mas-commerce-service:start",Us="mas-commerce-service:ready",Nr,It,ut,Gs,pn,hn=class extends HTMLElement{constructor(){super(...arguments);w(this,ut);w(this,Nr);w(this,It);m(this,"lastLoggingTime",0)}async registerCheckoutAction(r){typeof r=="function"&&(this.buildCheckoutAction=async(i,a,n)=>{let o=await r?.(i,a,this.imsSignedInPromise,n);return o||null})}get featureFlags(){return h(this,It)||y(this,It,{[ke]:Z(this,ut,pn).call(this,ke),[Mt]:Z(this,ut,pn).call(this,Mt)}),h(this,It)}activate(){let r=h(this,ut,Gs),i=$s(r,this);ci(r.lana);let a=le.init(r.hostEnv).module("service");a.debug("Activating:",r);let o={price:qo(i)},s={checkout:new Set,price:new Set},c={literals:o,providers:s,settings:i};Object.defineProperties(this,Object.getOwnPropertyDescriptors({...Fo(c),...Uo(c),...Ds(c),...Hs(c),...Ea,Log:le,resolvePriceTaxFlags:Ni,get defaults(){return N},get log(){return le},get providers(){return{checkout(d){return s.checkout.add(d),()=>s.checkout.delete(d)},price(d){return s.price.add(d),()=>s.price.delete(d)},has:d=>s.price.has(d)||s.checkout.has(d)}},get settings(){return i}})),a.debug("Activated:",{literals:o,settings:i});let l=new CustomEvent(li,{bubbles:!0,cancelable:!1,detail:this});performance.mark(Us),y(this,Nr,performance.measure(Us,Fs)),this.dispatchEvent(l),setTimeout(()=>{this.logFailedRequests()},1e4)}connectedCallback(){performance.mark(Fs),this.activate()}flushWcsCache(){this.flushWcsCacheInternal(),this.log.debug("Flushed WCS cache")}isPreview(){let r=this.getAttribute("preview");return r!=null&&["true","on",!0].includes(r)}refreshOffers(){this.flushWcsCacheInternal(),document.querySelectorAll(ur).forEach(r=>r.requestUpdate(!0)),this.log.debug("Refreshed WCS offers"),this.logFailedRequests()}refreshFragments(){this.flushWcsCacheInternal(),customElements.get("aem-fragment")?.cache.clear(),document.querySelectorAll("aem-fragment").forEach(r=>r.refresh(!1)),this.log.debug("Refreshed AEM fragments"),this.logFailedRequests()}get duration(){return{"mas-commerce-service:measure":Ne(h(this,Nr))}}logFailedRequests(){let r=[...performance.getEntriesByType("resource")].filter(({startTime:a})=>a>this.lastLoggingTime).filter(({transferSize:a,duration:n,responseStatus:o})=>a===0&&n===0&&o<200||o>=400),i=Array.from(new Map(r.map(a=>[a.name,a])).values());if(i.some(({name:a})=>/(\/fragment\?|web_commerce_artifact)/.test(a))){let a=i.map(({name:n})=>n);this.log.error("Failed requests:",{failedUrls:a,...this.duration})}this.lastLoggingTime=performance.now().toFixed(3)}};Nr=new WeakMap,It=new WeakMap,ut=new WeakSet,Gs=function(){let r=this.getAttribute("env")??"prod",i={commerce:{env:r},hostEnv:{name:r},lana:{tags:this.getAttribute("lana-tags"),sampleRate:parseInt(this.getAttribute("lana-sample-rate")??1,10),isProdDomain:r==="prod"},masIOUrl:this.getAttribute("mas-io-url")};return["locale","country","language","preview"].forEach(a=>{let n=this.getAttribute(a);n&&(i[a]=n)}),["checkout-workflow-step","force-tax-exclusive","checkout-client-id","allow-override","wcs-api-key"].forEach(a=>{let n=this.getAttribute(a);if(n!=null){let o=a.replace(/-([a-z])/g,s=>s[1].toUpperCase());i.commerce[o]=n}}),i},pn=function(r){return["on","true",!0].includes(this.getAttribute(`data-${r}`)||F(r))};window.customElements.get(Bs)||window.customElements.define(Bs,hn);var Ir=class Ir extends Ei(HTMLButtonElement){static createCheckoutButton(t={},r=""){return wi(Ir,t,r)}setCheckoutUrl(t){this.setAttribute("data-href",t)}get href(){return this.getAttribute("data-href")}get isCheckoutButton(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}this.href&&(window.location.href=this.href)}};m(Ir,"is","checkout-button"),m(Ir,"tag","button");var zt=Ir;window.customElements.get(zt.is)||window.customElements.define(zt.is,zt,{extends:zt.tag});function Fh(e){return`https://${e==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var ft,gt=class gt extends HTMLAnchorElement{constructor(){super();m(this,"masElement",new je(this));w(this,ft);this.setAttribute("is",gt.is)}get isUptLink(){return!0}initializeWcsData(r,i){this.setAttribute("data-wcs-osi",r),i&&this.setAttribute("data-promotion-code",i)}attributeChangedCallback(r,i,a){this.masElement.attributeChangedCallback(r,i,a)}connectedCallback(){this.masElement.connectedCallback(),y(this,ft,mt()),h(this,ft)&&(this.log=h(this,ft).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),y(this,ft,void 0)}requestUpdate(r=!1){this.masElement.requestUpdate(r)}onceSettled(){return this.masElement.onceSettled()}async render(){let r=mt();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let i=r.collectCheckoutOptions({},this);if(!i.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let a=this.masElement.togglePending(i),n=r.resolveOfferSelectors(i);try{let[[o]]=await Promise.all(n),{country:s,language:c,env:l}=i,d=`locale=${c}_${s}&country=${s}&offer_id=${o.offerId}`,p=this.getAttribute("data-promotion-code");p&&(d+=`&promotion_code=${encodeURIComponent(p)}`),this.href=`${Fh(l)}?${d}`,this.masElement.toggleResolved(a,o,i)}catch(o){let s=new Error(`Could not resolve offer selectors for id: ${i.wcsOsi}.`,o.message);return this.masElement.toggleFailed(a,s,i),!1}}static createFrom(r){let i=new gt;for(let a of r.attributes)a.name!=="is"&&(a.name==="class"&&a.value.includes("upt-link")?i.setAttribute("class",a.value.replace("upt-link","").trim()):i.setAttribute(a.name,a.value));return i.innerHTML=r.innerHTML,i.setAttribute("tabindex",0),i}};ft=new WeakMap,m(gt,"is","upt-link"),m(gt,"tag","a"),m(gt,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var Ye=gt;window.customElements.get(Ye.is)||window.customElements.define(Ye.is,Ye,{extends:Ye.tag});P();P();var H="(max-width: 767px)",re="(max-width: 1199px)",B="(min-width: 768px)",_="(min-width: 1200px)",oe="(min-width: 1600px)",dc={matchMobile:window.matchMedia(H),matchDesktop:window.matchMedia(`${_} and (not ${oe})`),matchDesktopOrUp:window.matchMedia(_),matchLargeDesktop:window.matchMedia(oe),get isMobile(){return this.matchMobile.matches},get isDesktop(){return this.matchDesktop.matches},get isDesktopOrUp(){return this.matchDesktopOrUp.matches}},R=dc;function Ui(){return dc.isDesktop}var hc=b` :host { --consonant-merch-card-background-color: #fff; --consonant-merch-card-border: 1px solid @@ -903,7 +903,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" ::slotted([slot='price']) { color: var(--consonant-merch-card-price-color); } -`,hc=()=>[b` +`,pc=()=>[b` /* Tablet */ @media screen and ${me(B)} { :host([size='wide']), @@ -919,7 +919,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" grid-column: span 2; } } - `];P();function Vh(){return customElements.get("sp-tooltip")!==void 0||document.querySelector("sp-theme")!==null}var Bt=class extends U{constructor(){super(),this.size="m",this.alt="",this.loading="lazy"}connectedCallback(){super.connectedCallback(),setTimeout(()=>this.handleTooltips(),0)}handleTooltips(){if(Vh())return;this.querySelectorAll("sp-tooltip, overlay-trigger").forEach(r=>{let i="",a="top";if(r.tagName==="SP-TOOLTIP")i=r.textContent,a=r.getAttribute("placement")||"top";else if(r.tagName==="OVERLAY-TRIGGER"){let n=r.querySelector("sp-tooltip");n&&(i=n.textContent,a=n.getAttribute("placement")||r.getAttribute("placement")||"top")}if(i){let n=document.createElement("mas-mnemonic");n.setAttribute("content",i),n.setAttribute("placement",a);let o=this.querySelector("img"),s=this.querySelector("a");s&&s.contains(o)?n.appendChild(s):o&&n.appendChild(o),this.innerHTML="",this.appendChild(n),Promise.resolve().then(()=>Ui())}r.remove()})}render(){let{href:t}=this;return t?g` + `];P();function Yh(){return customElements.get("sp-tooltip")!==void 0||document.querySelector("sp-theme")!==null}var Bt=class extends U{constructor(){super(),this.size="m",this.alt="",this.loading="lazy"}connectedCallback(){super.connectedCallback(),setTimeout(()=>this.handleTooltips(),0)}handleTooltips(){if(Yh())return;this.querySelectorAll("sp-tooltip, overlay-trigger").forEach(r=>{let i="",a="top";if(r.tagName==="SP-TOOLTIP")i=r.textContent,a=r.getAttribute("placement")||"top";else if(r.tagName==="OVERLAY-TRIGGER"){let n=r.querySelector("sp-tooltip");n&&(i=n.textContent,a=n.getAttribute("placement")||r.getAttribute("placement")||"top")}if(i){let n=document.createElement("mas-mnemonic");n.setAttribute("content",i),n.setAttribute("placement",a);let o=this.querySelector("img"),s=this.querySelector("a");s&&s.contains(o)?n.appendChild(s):o&&n.appendChild(o),this.innerHTML="",this.appendChild(n),Promise.resolve().then(()=>Gi())}r.remove()})}render(){let{href:t}=this;return t?g` ${this.alt}{this.isConnected&&(this.parentElement.style.background=this.value,p(this,yt)?this.parentElement.style.borderRadius=p(this,yt):p(this,yt)===""&&(this.parentElement.style.borderRadius=""))},1))}static get observedAttributes(){return["colors","positions","angle","border-radius"]}get value(){let r=p(this,Vr).map((i,a)=>{let n=p(this,jr)[a]||"";return`${i} ${n}`}).join(", ");return`linear-gradient(${p(this,qr)}, ${r})`}connectedCallback(){p(this,Ft).call(this)}attributeChangedCallback(r,i,a){r==="border-radius"&&y(this,yt,a?.trim()),r==="colors"&&a?y(this,Vr,a?.split(",").map(n=>n.trim())??[]):r==="positions"&&a?y(this,jr,a?.split(",").map(n=>n.trim())??[]):r==="angle"&&y(this,qr,a?.trim()??""),p(this,Ft).call(this)}};qr=new WeakMap,yt=new WeakMap,Vr=new WeakMap,jr=new WeakMap,Ft=new WeakMap;customElements.define("merch-gradient",Gi);P();var Ut=class extends U{constructor(){super(),this.planType=void 0,this.checked=!1,this.updatePlanType=this.updatePlanType.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCustomClick=this.handleCustomClick.bind(this)}getOsi(t,r){let n=({TRIAL:["TRIAL"],BASE:["BASE","PROMOTION","TRIAL"],PROMOTION:["PROMOTION","BASE","TRIAL"]}[r]||[r]).map(s=>`p[data-plan-type="${t}"] ${D}[data-offer-type="${s}"]`).join(", ");return this.querySelector(n)?.dataset?.wcsOsi}connectedCallback(){super.connectedCallback(),this.addEventListener(Lt,this.updatePlanType)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Lt,this.updatePlanType)}updatePlanType(t){if(t.target.tagName!=="SPAN")return;let r=t.target,i=r?.value?.[0];i&&(r.setAttribute("data-offer-type",i.offerType),r.closest("p").setAttribute("data-plan-type",i.planType))}handleChange(t){this.checked=t.target.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0}))}handleCustomClick(){this.shadowRoot.querySelector("input").click()}handleKeyDown(t){t.key===" "&&(t.preventDefault(),this.handleCustomClick())}render(){return g` {this.isConnected&&(this.parentElement.style.background=this.value,h(this,yt)?this.parentElement.style.borderRadius=h(this,yt):h(this,yt)===""&&(this.parentElement.style.borderRadius=""))},1))}static get observedAttributes(){return["colors","positions","angle","border-radius"]}get value(){let r=h(this,Vr).map((i,a)=>{let n=h(this,jr)[a]||"";return`${i} ${n}`}).join(", ");return`linear-gradient(${h(this,qr)}, ${r})`}connectedCallback(){h(this,Ft).call(this)}attributeChangedCallback(r,i,a){r==="border-radius"&&y(this,yt,a?.trim()),r==="colors"&&a?y(this,Vr,a?.split(",").map(n=>n.trim())??[]):r==="positions"&&a?y(this,jr,a?.split(",").map(n=>n.trim())??[]):r==="angle"&&y(this,qr,a?.trim()??""),h(this,Ft).call(this)}};qr=new WeakMap,yt=new WeakMap,Vr=new WeakMap,jr=new WeakMap,Ft=new WeakMap;customElements.define("merch-gradient",qi);P();var Ut=class extends U{constructor(){super(),this.planType=void 0,this.checked=!1,this.updatePlanType=this.updatePlanType.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCustomClick=this.handleCustomClick.bind(this)}getOsi(t,r){let n=({TRIAL:["TRIAL"],BASE:["BASE","PROMOTION","TRIAL"],PROMOTION:["PROMOTION","BASE","TRIAL"]}[r]||[r]).map(s=>`p[data-plan-type="${t}"] ${D}[data-offer-type="${s}"]`).join(", ");return this.querySelector(n)?.dataset?.wcsOsi}connectedCallback(){super.connectedCallback(),this.addEventListener(Lt,this.updatePlanType)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Lt,this.updatePlanType)}updatePlanType(t){if(t.target.tagName!=="SPAN")return;let r=t.target,i=r?.value?.[0];i&&(r.setAttribute("data-offer-type",i.offerType),r.closest("p").setAttribute("data-plan-type",i.planType))}handleChange(t){this.checked=t.target.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0}))}handleCustomClick(){this.shadowRoot.querySelector("input").click()}handleKeyDown(t){t.key===" "&&(t.preventDefault(),this.handleCustomClick())}render(){return g` o&&n.style.setProperty(i,`${a}px`)}get badge(){let t;if(!(!this.card.badgeBackgroundColor||!this.card.badgeColor||!this.card.badgeText))return this.evergreen&&(t=`border: 1px solid ${this.card.badgeBackgroundColor}; border-right: none;`),g` + `);customElements.define("merch-addon",Ut);P();var Gt,Wr=class Wr{constructor(t){m(this,"card");w(this,Gt);this.card=t,this.insertVariantStyle()}getContainer(){return y(this,Gt,h(this,Gt)??this.card.closest('merch-card-collection, [class*="-merch-cards"]')??this.card.parentElement),h(this,Gt)}insertVariantStyle(){let t=this.constructor.name;if(!Wr.styleMap[t]){Wr.styleMap[t]=!0;let r=document.createElement("style");r.innerHTML=this.getGlobalCSS(),document.head.appendChild(r)}}updateCardElementMinHeight(t,r){if(!t||this.card.heightSync===!1)return;let i=`--consonant-merch-card-${this.card.variant}-${r}-height`,a=Math.max(0,parseInt(window.getComputedStyle(t).height)||0),n=this.getContainer(),o=parseInt(n.style.getPropertyValue(i))||0;a>o&&n.style.setProperty(i,`${a}px`)}get badge(){let t;if(!(!this.card.badgeBackgroundColor||!this.card.badgeColor||!this.card.badgeText))return this.evergreen&&(t=`border: 1px solid ${this.card.badgeBackgroundColor}; border-right: none;`),g`
`}getGlobalCSS(){return""}get theme(){return document.querySelector("sp-theme")}get evergreen(){return this.card.classList.contains("intro-pricing")}get promoBottom(){return this.card.classList.contains("promo-bottom")}get headingSelector(){return'[slot="heading-xs"]'}get secureLabel(){return this.card.secureLabel?g`${this.card.secureLabel}`:w}get secureLabelFooter(){return g`
+ >`:E}get secureLabelFooter(){return g`
${this.secureLabel} -
`}async postCardUpdateHook(){}connectedCallbackHook(){}disconnectedCallbackHook(){}syncHeights(){}renderLayout(){}get aemFragmentMapping(){return qi(this.card.variant)}};Gt=new WeakMap,m(Wr,"styleMap",{});var A=Wr;P();var pc=` +
`}async postCardUpdateHook(){}connectedCallbackHook(){}disconnectedCallbackHook(){}syncHeights(){}renderLayout(){}get aemFragmentMapping(){return Vi(this.card.variant)}};Gt=new WeakMap,m(Wr,"styleMap",{});var A=Wr;P();var mc=` :root { --consonant-merch-card-catalog-width: 302px; --consonant-merch-card-catalog-icon-size: 40px; @@ -1215,12 +1215,12 @@ merch-card[variant="catalog"] .payment-details { merch-card[variant="catalog"] [slot="footer"] .spectrum-Link--primary { font-size: 15px; font-weight: 700; -}`;var mc={cardName:{attribute:"name"},badge:!0,ctas:{slot:"footer",size:"m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},prices:{tag:"h3",slot:"heading-xs"},shortDescription:{tag:"div",slot:"action-menu-content",attributes:{tabindex:"0"}},size:["wide","super-wide"],title:{tag:"h3",slot:"heading-xs"}},qt=class extends A{constructor(r){super(r);m(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(ia,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});m(this,"toggleActionMenu",r=>{!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter"||(r.preventDefault(),r.stopPropagation(),this.setMenuVisibility(!this.isMenuOpen()))});m(this,"toggleActionMenuFromCard",r=>{let i=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.setIconVisibility(!1),this.actionMenuContentSlot&&r?.type==="mouseleave"&&this.setMenuVisibility(!1)});m(this,"showActionMenuOnHover",()=>{this.actionMenu&&this.setIconVisibility(!0)});m(this,"hideActionMenu",()=>{this.setMenuVisibility(!1),this.setIconVisibility(!1)});m(this,"hideActionMenuOnBlur",r=>{r.relatedTarget===this.actionMenu||this.actionMenu?.contains(r.relatedTarget)||this.slottedContent?.contains(r.relatedTarget)||(this.isMenuOpen()&&this.setMenuVisibility(!1),this.card.contains(r.relatedTarget)||this.setIconVisibility(!1))});m(this,"handleCardFocusOut",r=>{r.relatedTarget===this.actionMenu||this.actionMenu?.contains(r.relatedTarget)||r.relatedTarget===this.card||(this.slottedContent&&(r.target===this.slottedContent||this.slottedContent.contains(r.target))&&(this.slottedContent.contains(r.relatedTarget)||this.setMenuVisibility(!1)),!this.card.contains(r.relatedTarget)&&!this.isMenuOpen()&&this.setIconVisibility(!1))});m(this,"handleKeyDown",r=>{(r.key==="Escape"||r.key==="Esc")&&(r.preventDefault(),this.hideActionMenu(),this.actionMenu?.focus())})}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}get slottedContent(){return this.card.querySelector('[slot="action-menu-content"]')}setIconVisibility(r){if(this.slottedContent){if(sn()&&this.card.actionMenu)return;this.actionMenu?.classList.toggle("invisible",!r),this.actionMenu?.classList.toggle("always-visible",r)}}setMenuVisibility(r){this.actionMenuContentSlot?.classList.toggle("hidden",!r),this.setAriaExpanded(this.actionMenu,r.toString()),r&&(this.dispatchActionMenuToggle(),setTimeout(()=>{let i=this.slottedContent?.querySelector("a");i&&i.focus()},0))}isMenuOpen(){return!this.actionMenuContentSlot?.classList.contains("hidden")}renderLayout(){return g`
+}`;var uc={cardName:{attribute:"name"},badge:!0,ctas:{slot:"footer",size:"m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},prices:{tag:"h3",slot:"heading-xs"},shortDescription:{tag:"div",slot:"action-menu-content",attributes:{tabindex:"0"}},size:["wide","super-wide"],title:{tag:"h3",slot:"heading-xs"}},qt=class extends A{constructor(r){super(r);m(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(na,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});m(this,"toggleActionMenu",r=>{!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter"||(r.preventDefault(),r.stopPropagation(),this.setMenuVisibility(!this.isMenuOpen()))});m(this,"toggleActionMenuFromCard",r=>{let i=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.setIconVisibility(!1),this.actionMenuContentSlot&&r?.type==="mouseleave"&&this.setMenuVisibility(!1)});m(this,"showActionMenuOnHover",()=>{this.actionMenu&&this.setIconVisibility(!0)});m(this,"hideActionMenu",()=>{this.setMenuVisibility(!1),this.setIconVisibility(!1)});m(this,"hideActionMenuOnBlur",r=>{r.relatedTarget===this.actionMenu||this.actionMenu?.contains(r.relatedTarget)||this.slottedContent?.contains(r.relatedTarget)||(this.isMenuOpen()&&this.setMenuVisibility(!1),this.card.contains(r.relatedTarget)||this.setIconVisibility(!1))});m(this,"handleCardFocusOut",r=>{r.relatedTarget===this.actionMenu||this.actionMenu?.contains(r.relatedTarget)||r.relatedTarget===this.card||(this.slottedContent&&(r.target===this.slottedContent||this.slottedContent.contains(r.target))&&(this.slottedContent.contains(r.relatedTarget)||this.setMenuVisibility(!1)),!this.card.contains(r.relatedTarget)&&!this.isMenuOpen()&&this.setIconVisibility(!1))});m(this,"handleKeyDown",r=>{(r.key==="Escape"||r.key==="Esc")&&(r.preventDefault(),this.hideActionMenu(),this.actionMenu?.focus())})}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}get slottedContent(){return this.card.querySelector('[slot="action-menu-content"]')}setIconVisibility(r){if(this.slottedContent){if(ln()&&this.card.actionMenu)return;this.actionMenu?.classList.toggle("invisible",!r),this.actionMenu?.classList.toggle("always-visible",r)}}setMenuVisibility(r){this.actionMenuContentSlot?.classList.toggle("hidden",!r),this.setAriaExpanded(this.actionMenu,r.toString()),r&&(this.dispatchActionMenuToggle(),setTimeout(()=>{let i=this.slottedContent?.querySelector("a");i&&i.focus()},0))}isMenuOpen(){return!this.actionMenuContentSlot?.classList.contains("hidden")}renderLayout(){return g`
${this.badge}
`:""}
${this.secureLabelFooter} - `}getGlobalCSS(){return pc}setAriaExpanded(r,i){r.setAttribute("aria-expanded",i)}connectedCallbackHook(){this.card.addEventListener("mouseenter",this.showActionMenuOnHover),this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.addEventListener("focusin",this.showActionMenuOnHover),this.card.addEventListener("focusout",this.handleCardFocusOut),this.card.addEventListener("keydown",this.handleKeyDown)}disconnectedCallbackHook(){this.card.removeEventListener("mouseenter",this.showActionMenuOnHover),this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.removeEventListener("focusin",this.showActionMenuOnHover),this.card.removeEventListener("focusout",this.handleCardFocusOut),this.card.removeEventListener("keydown",this.handleKeyDown)}};m(qt,"variantStyle",b` + `}getGlobalCSS(){return mc}setAriaExpanded(r,i){r.setAttribute("aria-expanded",i)}connectedCallbackHook(){this.card.addEventListener("mouseenter",this.showActionMenuOnHover),this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.addEventListener("focusin",this.showActionMenuOnHover),this.card.addEventListener("focusout",this.handleCardFocusOut),this.card.addEventListener("keydown",this.handleKeyDown)}disconnectedCallbackHook(){this.card.removeEventListener("mouseenter",this.showActionMenuOnHover),this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.removeEventListener("focusin",this.showActionMenuOnHover),this.card.removeEventListener("focusout",this.handleCardFocusOut),this.card.removeEventListener("keydown",this.handleKeyDown)}};m(qt,"variantStyle",b` :host([variant='catalog']) { min-height: 330px; width: var(--consonant-merch-card-catalog-width); @@ -1272,7 +1272,7 @@ merch-card[variant="catalog"] [slot="footer"] .spectrum-Link--primary { right: initial; left: 16px; } - `);P();var uc=` + `);P();var gc=` :root { --consonant-merch-card-image-width: 300px; --merch-card-collection-card-width: var(--consonant-merch-card-image-width); @@ -1311,7 +1311,7 @@ merch-card[variant="catalog"] [slot="footer"] .spectrum-Link--primary { grid-template-columns: repeat(4, var(--consonant-merch-card-image-width)); } } -`;var gc={cardName:{attribute:"name"},badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},badgeIcon:!0,borderColor:{attribute:"border-color"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],ctas:{slot:"footer",size:"m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},prices:{tag:"h3",slot:"heading-xs"},promoText:{tag:"p",slot:"promo-text"},size:["wide","super-wide"],title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"body-xxs"},backgroundImage:{tag:"div",slot:"bg-image"}},wt=class extends A{constructor(t){super(t)}getGlobalCSS(){return uc}renderLayout(){return g`
+`;var fc={cardName:{attribute:"name"},badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},badgeIcon:!0,borderColor:{attribute:"border-color"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],ctas:{slot:"footer",size:"m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},prices:{tag:"h3",slot:"heading-xs"},promoText:{tag:"p",slot:"promo-text"},size:["wide","super-wide"],title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"body-xxs"},backgroundImage:{tag:"div",slot:"bg-image"}},wt=class extends A{constructor(t){super(t)}getGlobalCSS(){return gc}renderLayout(){return g`
@@ -1355,7 +1355,7 @@ merch-card[variant="catalog"] [slot="footer"] .spectrum-Link--primary { left: 0px; right: initial; } - `);P();var fc=` + `);P();var xc=` :root { --consonant-merch-card-inline-heading-width: 300px; } @@ -1391,7 +1391,7 @@ merch-card[variant="catalog"] [slot="footer"] .spectrum-Link--primary { grid-template-columns: repeat(4, var(--consonant-merch-card-inline-heading-width)); } } -`;var Vi=class extends A{constructor(t){super(t)}getGlobalCSS(){return fc}renderLayout(){return g` ${this.badge} +`;var ji=class extends A{constructor(t){super(t)}getGlobalCSS(){return xc}renderLayout(){return g` ${this.badge}
@@ -1399,7 +1399,7 @@ merch-card[variant="catalog"] [slot="footer"] .spectrum-Link--primary {
- ${this.card.customHr?"":g`
`} ${this.secureLabelFooter}`}};P();var xc=` + ${this.card.customHr?"":g`
`} ${this.secureLabelFooter}`}};P();var vc=` :root { --consonant-merch-card-mini-compare-chart-icon-size: 32px; --consonant-merch-card-mini-compare-border-color: #E9E9E9; @@ -2196,14 +2196,14 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(7) { merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { min-height: var(--consonant-merch-card-footer-row-8-min-height); } -`;var jh=32,vc={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m-price"},promoText:{tag:"div",slot:"promo-text"},shortDescription:{tag:"div",slot:"body-xxs"},description:{tag:"div",slot:"body-m"},mnemonics:{size:"l"},quantitySelect:{tag:"div",slot:"quantity-select"},callout:{tag:"div",slot:"callout-content"},addon:!0,secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],whatsIncluded:{tag:"div",slot:"footer-rows"},ctas:{slot:"footer",size:"l"},style:"consonant"},Vt=class extends A{constructor(r){super(r);m(this,"getRowMinHeightPropertyName",r=>`--consonant-merch-card-footer-row-${r}-min-height`);m(this,"getMiniCompareFooter",()=>{let r=this.card.secureLabel?g` +`;var Xh=32,bc={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m-price"},promoText:{tag:"div",slot:"promo-text"},shortDescription:{tag:"div",slot:"body-xxs"},description:{tag:"div",slot:"body-m"},mnemonics:{size:"l"},quantitySelect:{tag:"div",slot:"quantity-select"},callout:{tag:"div",slot:"callout-content"},addon:!0,secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],whatsIncluded:{tag:"div",slot:"footer-rows"},ctas:{slot:"footer",size:"l"},style:"consonant"},Vt=class extends A{constructor(r){super(r);m(this,"getRowMinHeightPropertyName",r=>`--consonant-merch-card-footer-row-${r}-min-height`);m(this,"getMiniCompareFooter",()=>{let r=this.card.secureLabel?g` ${this.card.secureLabel}`:g``;return this.isNewVariant?g`
${r}

-
`:g`
${r}
`});this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}connectedCallbackHook(){this.card.addEventListener(te,this.updatePriceQuantity),this.visibilityObserver=new IntersectionObserver(([r])=>{r.boundingClientRect.height!==0&&r.isIntersecting&&(R.isMobile||requestAnimationFrame(()=>{let i=this.getContainer();if(!i)return;i.querySelectorAll('merch-card[variant="mini-compare-chart"]').forEach(n=>n.variantLayout?.syncHeights?.())}),this.visibilityObserver.disconnect())}),this.visibilityObserver.observe(this.card)}disconnectedCallbackHook(){if(this.card.removeEventListener(te,this.updatePriceQuantity),this.visibilityObserver?.disconnect(),this.calloutListenersAdded){document.removeEventListener("touchstart",this.handleCalloutTouch),document.removeEventListener("mouseover",this.handleCalloutMouse);let r=this.card.querySelector('[slot="callout-content"] .icon-button');r?.removeEventListener("focusin",this.handleCalloutFocusin),r?.removeEventListener("focusout",this.handleCalloutFocusout),r?.removeEventListener("keydown",this.handleCalloutKeydown),this.calloutListenersAdded=!1}}updatePriceQuantity({detail:r}){!this.mainPrice||!r?.option||(this.mainPrice.dataset.quantity=r.option)}priceOptionsProvider(r,i){if(this.isNewVariant){if(r.dataset.template===xe){i.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(r.dataset.template==="strikethrough"||r.dataset.template==="price")&&(i.displayPerUnit=!1)}}getGlobalCSS(){return xc}adjustMiniCompareBodySlots(){if(this.card.getBoundingClientRect().width<=2)return;this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(".top-section"),"top-section");let r=["heading-m","subtitle","body-m","heading-m-price","body-xxs","price-commitment","quantity-select","offers","promo-text","callout-content","addon"];this.card.classList.contains("bullet-list")&&r.push("footer-rows"),r.forEach(a=>this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(`slot[name="${a}"]`),a)),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector("footer"),"footer"),this.card.shadowRoot.querySelector(".mini-compare-chart-badge")?.textContent!==""&&this.getContainer().style.setProperty("--consonant-merch-card-mini-compare-chart-top-section-mobile-height","32px")}adjustMiniCompareFooterRows(){if(this.card.getBoundingClientRect().width===0)return;let r;if(this.isNewVariant){let i=this.card.querySelector("merch-whats-included");if(!i)return;r=[...i.querySelectorAll('[slot="content"] merch-mnemonic-list')]}else{let i=this.card.querySelector('[slot="footer-rows"] ul');if(!i||!i.children)return;r=[...i.children]}r.length&&r.forEach((i,a)=>{let n=Math.max(jh,parseFloat(window.getComputedStyle(i).height)||0),o=parseFloat(this.getContainer().style.getPropertyValue(this.getRowMinHeightPropertyName(a+1)))||0;n>o&&this.getContainer().style.setProperty(this.getRowMinHeightPropertyName(a+1),`${n}px`)})}removeEmptyRows(){this.isNewVariant?this.card.querySelectorAll("merch-whats-included merch-mnemonic-list").forEach(i=>{let a=i.querySelector('[slot="description"]');a&&!a.textContent.trim()&&i.remove()}):this.card.querySelectorAll(".footer-row-cell").forEach(i=>{let a=i.querySelector(".footer-row-cell-description");a&&!a.textContent.trim()&&i.remove()})}padFooterRows(){let r=this.getContainer();if(!r)return;let i=r.querySelectorAll('merch-card[variant="mini-compare-chart"]');if(this.isNewVariant){let a=0;if(i.forEach(l=>{let d=l.querySelector("merch-whats-included");if(!d)return;let h=d.querySelectorAll('[slot="content"] merch-mnemonic-list:not([data-placeholder])');a=Math.max(a,h.length)}),a===0)return;let n=this.card.querySelector("merch-whats-included");if(!n)return;let o=n.querySelector('[slot="content"]');if(!o)return;o.querySelectorAll("merch-mnemonic-list[data-placeholder]").forEach(l=>l.remove());let s=o.querySelectorAll("merch-mnemonic-list").length,c=a-s;for(let l=0;l{let l=c.querySelector('[slot="footer-rows"] ul');if(!l)return;let d=l.querySelectorAll("li.footer-row-cell:not([data-placeholder])");a=Math.max(a,d.length)}),a===0)return;let n=this.card.querySelector('[slot="footer-rows"] ul');if(!n)return;n.querySelectorAll("li.footer-row-cell[data-placeholder]").forEach(c=>c.remove());let o=n.querySelectorAll("li.footer-row-cell").length,s=a-o;for(let c=0;cs.remove()),r.checked){if(o){let s=ne("p",{class:"addon-heading-m-price-addon",slot:"heading-m-price"},o.innerHTML);this.card.appendChild(s)}}else{let s=ne("p",{class:"card-heading",id:"free",slot:"heading-m-price"},"Free");this.card.appendChild(s)}}}showTooltip(r){r.classList.remove("hide-tooltip"),r.setAttribute("aria-expanded","true")}hideTooltip(r){r.classList.add("hide-tooltip"),r.setAttribute("aria-expanded","false")}adjustCallout(){let r=this.card.querySelector('[slot="callout-content"] .icon-button');if(!r||this.calloutListenersAdded)return;let i=r.title||r.dataset.tooltip;if(!i)return;r.title&&(r.dataset.tooltip=r.title,r.removeAttribute("title"));let a=r.parentElement;if(a&&a.tagName==="P"){let n=document.createElement("div"),o=document.createElement("div");o.className="callout-row";let s=document.createElement("div");for(s.className="callout-text";a.firstChild&&a.firstChild!==r;)s.appendChild(a.firstChild);o.appendChild(s),o.appendChild(r),n.appendChild(o),a.replaceWith(n)}r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.setAttribute("aria-label",i),r.setAttribute("aria-expanded","false"),this.hideTooltip(r),this.handleCalloutTouch=n=>{n.target!==r?this.hideTooltip(r):r.classList.contains("hide-tooltip")?this.showTooltip(r):this.hideTooltip(r)},this.handleCalloutMouse=n=>{n.target!==r?this.hideTooltip(r):this.showTooltip(r)},this.handleCalloutFocusin=()=>{this.showTooltip(r)},this.handleCalloutFocusout=()=>{this.hideTooltip(r)},this.handleCalloutKeydown=n=>{n.key==="Escape"&&(this.hideTooltip(r),r.blur())},document.addEventListener("touchstart",this.handleCalloutTouch),document.addEventListener("mouseover",this.handleCalloutMouse),r.addEventListener("focusin",this.handleCalloutFocusin),r.addEventListener("focusout",this.handleCalloutFocusout),r.addEventListener("keydown",this.handleCalloutKeydown),this.calloutListenersAdded=!0}async adjustAddon(){await this.card.updateComplete;let r=this.card.addon;if(!r)return;let i=this.mainPrice,a=this.card.planType;if(i&&(await i.onceSettled(),a=i.value?.[0]?.planType),!a)return;r.planType=a,this.card.querySelector("merch-addon[plan-type]")?.updateComplete.then(()=>{this.updateCardElementMinHeight(this.card.shadowRoot.querySelector('slot[name="addon"]'),"addon")})}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let r=this.mainPrice;if(!r)return;let i=r.cloneNode(!0);if(await r.onceSettled(),!r?.options)return;r.options.displayPerUnit&&(r.dataset.displayPerUnit="false"),r.options.displayTax&&(r.dataset.displayTax="false"),r.options.displayPlanType&&(r.dataset.displayPlanType="false"),i.setAttribute("data-template","legal"),r.parentNode.insertBefore(i,r.nextSibling),await i.onceSettled()}catch{}}adjustShortDescription(){let r=this.card.querySelector('[slot="body-xxs"]'),i=r?.textContent?.trim();if(!i)return;let n=this.card.querySelector('[slot="heading-m-price"] [data-template="legal"]')?.querySelector(".price-plan-type");if(!n)return;let o=document.createElement("em");o.setAttribute("slot","body-xxs"),o.textContent=` ${i}`,n.appendChild(o),r.remove()}renderLayout(){return this.isNewVariant?g`
+ `:g`
${r}
`});this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}connectedCallbackHook(){this.card.addEventListener(te,this.updatePriceQuantity),this.visibilityObserver=new IntersectionObserver(([r])=>{r.boundingClientRect.height!==0&&r.isIntersecting&&(R.isMobile||requestAnimationFrame(()=>{let i=this.getContainer();if(!i)return;i.querySelectorAll('merch-card[variant="mini-compare-chart"]').forEach(n=>n.variantLayout?.syncHeights?.())}),this.visibilityObserver.disconnect())}),this.visibilityObserver.observe(this.card)}disconnectedCallbackHook(){if(this.card.removeEventListener(te,this.updatePriceQuantity),this.visibilityObserver?.disconnect(),this.calloutListenersAdded){document.removeEventListener("touchstart",this.handleCalloutTouch),document.removeEventListener("mouseover",this.handleCalloutMouse);let r=this.card.querySelector('[slot="callout-content"] .icon-button');r?.removeEventListener("focusin",this.handleCalloutFocusin),r?.removeEventListener("focusout",this.handleCalloutFocusout),r?.removeEventListener("keydown",this.handleCalloutKeydown),this.calloutListenersAdded=!1}}updatePriceQuantity({detail:r}){!this.mainPrice||!r?.option||(this.mainPrice.dataset.quantity=r.option)}priceOptionsProvider(r,i){if(this.isNewVariant){if(r.dataset.template===xe){i.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(r.dataset.template==="strikethrough"||r.dataset.template==="price")&&(i.displayPerUnit=!1)}}getGlobalCSS(){return vc}adjustMiniCompareBodySlots(){if(this.card.getBoundingClientRect().width<=2)return;this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(".top-section"),"top-section");let r=["heading-m","subtitle","body-m","heading-m-price","body-xxs","price-commitment","quantity-select","offers","promo-text","callout-content","addon"];this.card.classList.contains("bullet-list")&&r.push("footer-rows"),r.forEach(a=>this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(`slot[name="${a}"]`),a)),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector("footer"),"footer"),this.card.shadowRoot.querySelector(".mini-compare-chart-badge")?.textContent!==""&&this.getContainer().style.setProperty("--consonant-merch-card-mini-compare-chart-top-section-mobile-height","32px")}adjustMiniCompareFooterRows(){if(this.card.getBoundingClientRect().width===0)return;let r;if(this.isNewVariant){let i=this.card.querySelector("merch-whats-included");if(!i)return;r=[...i.querySelectorAll('[slot="content"] merch-mnemonic-list')]}else{let i=this.card.querySelector('[slot="footer-rows"] ul');if(!i||!i.children)return;r=[...i.children]}r.length&&r.forEach((i,a)=>{let n=Math.max(Xh,parseFloat(window.getComputedStyle(i).height)||0),o=parseFloat(this.getContainer().style.getPropertyValue(this.getRowMinHeightPropertyName(a+1)))||0;n>o&&this.getContainer().style.setProperty(this.getRowMinHeightPropertyName(a+1),`${n}px`)})}removeEmptyRows(){this.isNewVariant?this.card.querySelectorAll("merch-whats-included merch-mnemonic-list").forEach(i=>{let a=i.querySelector('[slot="description"]');a&&!a.textContent.trim()&&i.remove()}):this.card.querySelectorAll(".footer-row-cell").forEach(i=>{let a=i.querySelector(".footer-row-cell-description");a&&!a.textContent.trim()&&i.remove()})}padFooterRows(){let r=this.getContainer();if(!r)return;let i=r.querySelectorAll('merch-card[variant="mini-compare-chart"]');if(this.isNewVariant){let a=0;if(i.forEach(l=>{let d=l.querySelector("merch-whats-included");if(!d)return;let p=d.querySelectorAll('[slot="content"] merch-mnemonic-list:not([data-placeholder])');a=Math.max(a,p.length)}),a===0)return;let n=this.card.querySelector("merch-whats-included");if(!n)return;let o=n.querySelector('[slot="content"]');if(!o)return;o.querySelectorAll("merch-mnemonic-list[data-placeholder]").forEach(l=>l.remove());let s=o.querySelectorAll("merch-mnemonic-list").length,c=a-s;for(let l=0;l{let l=c.querySelector('[slot="footer-rows"] ul');if(!l)return;let d=l.querySelectorAll("li.footer-row-cell:not([data-placeholder])");a=Math.max(a,d.length)}),a===0)return;let n=this.card.querySelector('[slot="footer-rows"] ul');if(!n)return;n.querySelectorAll("li.footer-row-cell[data-placeholder]").forEach(c=>c.remove());let o=n.querySelectorAll("li.footer-row-cell").length,s=a-o;for(let c=0;cs.remove()),r.checked){if(o){let s=ne("p",{class:"addon-heading-m-price-addon",slot:"heading-m-price"},o.innerHTML);this.card.appendChild(s)}}else{let s=ne("p",{class:"card-heading",id:"free",slot:"heading-m-price"},"Free");this.card.appendChild(s)}}}showTooltip(r){r.classList.remove("hide-tooltip"),r.setAttribute("aria-expanded","true")}hideTooltip(r){r.classList.add("hide-tooltip"),r.setAttribute("aria-expanded","false")}adjustCallout(){let r=this.card.querySelector('[slot="callout-content"] .icon-button');if(!r||this.calloutListenersAdded)return;let i=r.title||r.dataset.tooltip;if(!i)return;r.title&&(r.dataset.tooltip=r.title,r.removeAttribute("title"));let a=r.parentElement;if(a&&a.tagName==="P"){let n=document.createElement("div"),o=document.createElement("div");o.className="callout-row";let s=document.createElement("div");for(s.className="callout-text";a.firstChild&&a.firstChild!==r;)s.appendChild(a.firstChild);o.appendChild(s),o.appendChild(r),n.appendChild(o),a.replaceWith(n)}r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.setAttribute("aria-label",i),r.setAttribute("aria-expanded","false"),this.hideTooltip(r),this.handleCalloutTouch=n=>{n.target!==r?this.hideTooltip(r):r.classList.contains("hide-tooltip")?this.showTooltip(r):this.hideTooltip(r)},this.handleCalloutMouse=n=>{n.target!==r?this.hideTooltip(r):this.showTooltip(r)},this.handleCalloutFocusin=()=>{this.showTooltip(r)},this.handleCalloutFocusout=()=>{this.hideTooltip(r)},this.handleCalloutKeydown=n=>{n.key==="Escape"&&(this.hideTooltip(r),r.blur())},document.addEventListener("touchstart",this.handleCalloutTouch),document.addEventListener("mouseover",this.handleCalloutMouse),r.addEventListener("focusin",this.handleCalloutFocusin),r.addEventListener("focusout",this.handleCalloutFocusout),r.addEventListener("keydown",this.handleCalloutKeydown),this.calloutListenersAdded=!0}async adjustAddon(){await this.card.updateComplete;let r=this.card.addon;if(!r)return;let i=this.mainPrice,a=this.card.planType;if(i&&(await i.onceSettled(),a=i.value?.[0]?.planType),!a)return;r.planType=a,this.card.querySelector("merch-addon[plan-type]")?.updateComplete.then(()=>{this.updateCardElementMinHeight(this.card.shadowRoot.querySelector('slot[name="addon"]'),"addon")})}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let r=this.mainPrice;if(!r)return;let i=r.cloneNode(!0);if(await r.onceSettled(),!r?.options)return;r.options.displayPerUnit&&(r.dataset.displayPerUnit="false"),r.options.displayTax&&(r.dataset.displayTax="false"),r.options.displayPlanType&&(r.dataset.displayPlanType="false"),i.setAttribute("data-template","legal"),r.parentNode.insertBefore(i,r.nextSibling),await i.onceSettled()}catch{}}adjustShortDescription(){let r=this.card.querySelector('[slot="body-xxs"]'),i=r?.textContent?.trim();if(!i)return;let n=this.card.querySelector('[slot="heading-m-price"] [data-template="legal"]')?.querySelector(".price-plan-type");if(!n)return;let o=document.createElement("em");o.setAttribute("slot","body-xxs"),o.textContent=` ${i}`,n.appendChild(o),r.remove()}renderLayout(){return this.isNewVariant?g`
${this.badge}
@@ -2492,7 +2492,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { background-color: #eb1000; color: #ffffff; } - `);P();var bc=` + `);P();var yc=` :root { --list-checked-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' width='20' height='20'%3E%3Cpath fill='%23222222' d='M15.656,3.8625l-.7275-.5665a.5.5,0,0,0-.7.0875L7.411,12.1415,4.0875,8.8355a.5.5,0,0,0-.707,0L2.718,9.5a.5.5,0,0,0,0,.707l4.463,4.45a.5.5,0,0,0,.75-.0465L15.7435,4.564A.5.5,0,0,0,15.656,3.8625Z'%3E%3C/path%3E%3C/svg%3E"); --merch-card-collection-card-width: var(--consonant-merch-card-mini-compare-chart-mweb-width); @@ -3210,7 +3210,7 @@ merch-card .footer-row-cell:nth-child(7) { merch-card .footer-row-cell:nth-child(8) { min-height: var(--consonant-merch-card-footer-row-8-min-height); } -`;var Wh=32,yc={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m-price"},promoText:{tag:"div",slot:"promo-text"},shortDescription:{tag:"div",slot:"body-m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],ctas:{slot:"footer",size:"l"},style:"consonant"},jt=class extends A{constructor(r){super(r);m(this,"getRowMinHeightPropertyName",r=>`--consonant-merch-card-footer-row-${r}-min-height`);m(this,"getMiniCompareFooter",()=>g`
+`;var Kh=32,wc={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m-price"},promoText:{tag:"div",slot:"promo-text"},shortDescription:{tag:"div",slot:"body-m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],ctas:{slot:"footer",size:"l"},style:"consonant"},jt=class extends A{constructor(r){super(r);m(this,"getRowMinHeightPropertyName",r=>`--consonant-merch-card-footer-row-${r}-min-height`);m(this,"getMiniCompareFooter",()=>g`
${this.secureLabel}`);m(this,"getMiniCompareFooterRows",()=>g` `);this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}connectedCallbackHook(){this.card.addEventListener(te,this.updatePriceQuantity)}disconnectedCallbackHook(){this.card.removeEventListener(te,this.updatePriceQuantity),this._syncObserver?.disconnect(),this._syncObserver=null}updatePriceQuantity({detail:r}){!this.mainPrice||!r?.option||(this.mainPrice.dataset.quantity=r.option)}priceOptionsProvider(r,i){if(r.dataset.template===xe){i.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(r.dataset.template==="strikethrough"||r.dataset.template==="price")&&(i.displayPerUnit=!1)}getGlobalCSS(){return bc}adjustMiniCompareBodySlots(){if(this.card.getBoundingClientRect().width<=2){this._syncObserver||(this._syncObserver=new ResizeObserver(()=>{this.card.getBoundingClientRect().width>2&&(this._syncObserver?.disconnect(),this._syncObserver=null,this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}),this._syncObserver.observe(this.card));return}["heading-xs","subtitle","heading-m-price","promo-text","body-m","body-xs","footer-rows"].forEach(i=>{let n=this.card.querySelector(`[slot="${i}"]`)??this.card.shadowRoot.querySelector(`slot[name="${i}"]`);this.updateCardElementMinHeight(n,i)}),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector('slot[name="promo-text"]'),"promo-text"),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector("footer"),"footer")}adjustMiniCompareFooterRows(){if(this.card.getBoundingClientRect().width===0)return;let r=this.card.querySelector('[slot="footer-rows"] ul');!r||!r.children||[...r.children].forEach((i,a)=>{let n=Math.max(Wh,parseFloat(window.getComputedStyle(i).height)||0),o=parseFloat(this.getContainer().style.getPropertyValue(this.getRowMinHeightPropertyName(a+1)))||0;n>o&&this.getContainer().style.setProperty(this.getRowMinHeightPropertyName(a+1),`${n}px`)})}removeEmptyRows(){this.card.querySelectorAll(".footer-row-cell").forEach(i=>{let a=i.querySelector(".footer-row-cell-description");a&&!a.textContent.trim()&&i.remove()})}setupToggle(){if(this.toggleSetupDone)return;let r=this.card.querySelector('[slot="body-xs"]');if(!r)return;let i=r.querySelector("p"),a=r.querySelector("ul");if(!i||!a||r.querySelector(".footer-rows-title"))return;this.toggleSetupDone=!0;let n=i.textContent.trim(),o=this.card.querySelector("h3")?.id,s=o?`${o}-list`:`mweb-list-${Date.now()}`;a.setAttribute("id",s),a.classList.add("checkmark-copy-container");let c=ne("div",{class:"footer-rows-title"},n);if(R.isMobile){let l=ne("button",{class:"toggle-icon","aria-label":n,"aria-expanded":"false","aria-controls":s});c.appendChild(l),c.addEventListener("click",()=>{let d=a.classList.toggle("open");l.classList.toggle("expanded",d),l.setAttribute("aria-expanded",String(d))})}else a.classList.add("open");i.replaceWith(c)}get mainPrice(){return this.card.querySelector(`[slot="heading-m-price"] ${D}[data-template="price"]`)}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let r=this.mainPrice;if(!r)return;let i=r.cloneNode(!0);if(await r.onceSettled(),!r?.options)return;r.options.displayPerUnit&&(r.dataset.displayPerUnit="false"),r.options.displayTax&&(r.dataset.displayTax="false"),r.options.displayPlanType&&(r.dataset.displayPlanType="false"),i.setAttribute("data-template","legal"),r.parentNode.insertBefore(i,r.nextSibling),await i.onceSettled()}catch{}}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?w:g``}renderLayout(){return g` +
`);this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}connectedCallbackHook(){this.card.addEventListener(te,this.updatePriceQuantity)}disconnectedCallbackHook(){this.card.removeEventListener(te,this.updatePriceQuantity),this._syncObserver?.disconnect(),this._syncObserver=null}updatePriceQuantity({detail:r}){!this.mainPrice||!r?.option||(this.mainPrice.dataset.quantity=r.option)}priceOptionsProvider(r,i){if(r.dataset.template===xe){i.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(r.dataset.template==="strikethrough"||r.dataset.template==="price")&&(i.displayPerUnit=!1)}getGlobalCSS(){return yc}adjustMiniCompareBodySlots(){if(this.card.getBoundingClientRect().width<=2){this._syncObserver||(this._syncObserver=new ResizeObserver(()=>{this.card.getBoundingClientRect().width>2&&(this._syncObserver?.disconnect(),this._syncObserver=null,this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}),this._syncObserver.observe(this.card));return}["heading-xs","subtitle","heading-m-price","promo-text","body-m","body-xs","footer-rows"].forEach(i=>{let n=this.card.querySelector(`[slot="${i}"]`)??this.card.shadowRoot.querySelector(`slot[name="${i}"]`);this.updateCardElementMinHeight(n,i)}),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector('slot[name="promo-text"]'),"promo-text"),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector("footer"),"footer")}adjustMiniCompareFooterRows(){if(this.card.getBoundingClientRect().width===0)return;let r=this.card.querySelector('[slot="footer-rows"] ul');!r||!r.children||[...r.children].forEach((i,a)=>{let n=Math.max(Kh,parseFloat(window.getComputedStyle(i).height)||0),o=parseFloat(this.getContainer().style.getPropertyValue(this.getRowMinHeightPropertyName(a+1)))||0;n>o&&this.getContainer().style.setProperty(this.getRowMinHeightPropertyName(a+1),`${n}px`)})}removeEmptyRows(){this.card.querySelectorAll(".footer-row-cell").forEach(i=>{let a=i.querySelector(".footer-row-cell-description");a&&!a.textContent.trim()&&i.remove()})}setupToggle(){if(this.toggleSetupDone)return;let r=this.card.querySelector('[slot="body-xs"]');if(!r)return;let i=r.querySelector("p"),a=r.querySelector("ul");if(!i||!a||r.querySelector(".footer-rows-title"))return;this.toggleSetupDone=!0;let n=i.textContent.trim(),o=this.card.querySelector("h3")?.id,s=o?`${o}-list`:`mweb-list-${Date.now()}`;a.setAttribute("id",s),a.classList.add("checkmark-copy-container");let c=ne("div",{class:"footer-rows-title"},n);if(R.isMobile){let l=ne("button",{class:"toggle-icon","aria-label":n,"aria-expanded":"false","aria-controls":s});c.appendChild(l),c.addEventListener("click",()=>{let d=a.classList.toggle("open");l.classList.toggle("expanded",d),l.setAttribute("aria-expanded",String(d))})}else a.classList.add("open");i.replaceWith(c)}get mainPrice(){return this.card.querySelector(`[slot="heading-m-price"] ${D}[data-template="price"]`)}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let r=this.mainPrice;if(!r)return;let i=r.cloneNode(!0);if(await r.onceSettled(),!r?.options)return;r.options.displayPerUnit&&(r.dataset.displayPerUnit="false"),r.options.displayTax&&(r.dataset.displayTax="false"),r.options.displayPlanType&&(r.dataset.displayPlanType="false"),i.setAttribute("data-template","legal"),r.parentNode.insertBefore(i,r.nextSibling),await i.onceSettled()}catch{}}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?E:g``}renderLayout(){return g` ${this.badge}
${this.icons} @@ -3508,7 +3508,7 @@ merch-card .footer-row-cell:nth-child(8) { gap: var(--consonant-merch-spacing-xxs); margin: unset; } - `);P();var wc=` + `);P();var Ec=` :root { --consonant-merch-card-plans-width: 302px; --consonant-merch-card-plans-students-width: 302px; @@ -3974,11 +3974,11 @@ merch-card-collection:has([slot="subtitle"]) merch-card { --merch-sidenav-collection-gap: 54px; } } -`;var ji={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},addon:!0,secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],whatsIncluded:{tag:"div",slot:"whats-included"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},Ec={...function(){let{whatsIncluded:e,size:t,...r}=ji;return r}(),title:{tag:"h3",slot:"heading-s"},secureLabel:!1},Ac={...function(){let{subtitle:e,whatsIncluded:t,size:r,quantitySelect:i,...a}=ji;return a}()},ge=class extends A{constructor(t){super(t),this.adaptForMedia=this.adaptForMedia.bind(this)}priceOptionsProvider(t,r){t.dataset.template===xe&&(r.displayPlanType=this.card?.settings?.displayPlanType??!1)}getGlobalCSS(){return wc}adjustSlotPlacement(t,r,i){let a=this.card.shadowRoot,n=a.querySelector("footer"),o=this.card.getAttribute("size");if(!o)return;let s=a.querySelector(`footer slot[name="${t}"]`),c=a.querySelector(`.body slot[name="${t}"]`),l=a.querySelector(".body");if(o.includes("wide")||(n?.classList.remove("wide-footer"),s&&s.remove()),!!r.includes(o)){if(n?.classList.toggle("wide-footer",R.isDesktopOrUp),!i&&s){if(c)s.remove();else{let d=l.querySelector(`[data-placeholder-for="${t}"]`);d?d.replaceWith(s):l.appendChild(s)}return}if(i&&c){let d=document.createElement("div");if(d.setAttribute("data-placeholder-for",t),d.classList.add("slot-placeholder"),!s){let h=c.cloneNode(!0);n.prepend(h)}c.replaceWith(d)}}}adaptForMedia(){if(!this.card.closest("merch-card-collection,overlay-trigger,.two-merch-cards,.three-merch-cards,.four-merch-cards, .columns")){this.card.removeAttribute("size");return}this.adjustSlotPlacement("addon",["super-wide"],R.isDesktopOrUp),this.adjustSlotPlacement("callout-content",["super-wide"],R.isDesktopOrUp)}adjustCallout(){let t=this.card.querySelector('[slot="callout-content"] .icon-button');t&&t.title&&(t.dataset.tooltip=t.title,t.removeAttribute("title"),t.classList.add("hide-tooltip"),document.addEventListener("touchstart",r=>{r.preventDefault(),r.target!==t?t.classList.add("hide-tooltip"):r.target.classList.toggle("hide-tooltip")}),document.addEventListener("mouseover",r=>{r.preventDefault(),r.target!==t?t.classList.add("hide-tooltip"):r.target.classList.remove("hide-tooltip")}))}async adjustEduLists(){if(this.card.variant!=="plans-education"||this.card.querySelector(".spacer"))return;let r=this.card.querySelector('[slot="body-xs"]');if(!r)return;let i=r.querySelector("ul");if(!i)return;let a=i.previousElementSibling,n=document.createElement("div");n.classList.add("spacer"),r.insertBefore(n,a);let o=new IntersectionObserver(([s])=>{if(s.boundingClientRect.height===0)return;let c=0,l=this.card.querySelector('[slot="heading-s"]');l&&(c+=Or(l));let d=this.card.querySelector('[slot="subtitle"]');d&&(c+=Or(d));let h=this.card.querySelector('[slot="heading-m"]');h&&(c+=8+Or(h));for(let f of r.childNodes){if(f.classList.contains("spacer"))break;c+=Or(f)}let u=this.card.parentElement.style.getPropertyValue("--merch-card-plans-edu-list-max-offset");c>(parseFloat(u)||0)&&this.card.parentElement.style.setProperty("--merch-card-plans-edu-list-max-offset",`${c}px`),this.card.style.setProperty("--merch-card-plans-edu-list-offset",`${c}px`),o.disconnect()});o.observe(this.card)}async postCardUpdateHook(){this.adaptForMedia(),this.adjustAddon(),this.adjustCallout(),this.legalAdjusted||(await this.adjustLegal(),await this.adjustEduLists())}get headingM(){return this.card.querySelector('[slot="heading-m"]')}get mainPrice(){return this.headingM?.querySelector(`${D}[data-template="price"]`)}get divider(){return this.card.variant==="plans-education"?g`
`:w}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=[],r=this.card.querySelector(`[slot="heading-m"] ${D}[data-template="price"]`);r&&t.push(r);let i=t.map(async a=>{let n=a.cloneNode(!0);await a.onceSettled(),a?.options&&(a.options.displayPerUnit&&(a.dataset.displayPerUnit="false"),a.options.displayTax&&(a.dataset.displayTax="false"),a.options.displayPlanType&&(a.dataset.displayPlanType="false"),n.setAttribute("data-template","legal"),a.parentNode.insertBefore(n,a.nextSibling),await n.onceSettled())});await Promise.all(i)}catch{}}async adjustAddon(){await this.card.updateComplete;let t=this.card.addon;if(!t)return;t.setAttribute("custom-checkbox","");let r=this.mainPrice;if(!r)return;await r.onceSettled();let i=r.value?.[0]?.planType;i&&(t.planType=i)}get stockCheckbox(){return this.card.checkboxLabel?g``:E}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?E:g``}connectedCallbackHook(){R.matchMobile.addEventListener("change",this.adaptForMedia),R.matchDesktopOrUp.addEventListener("change",this.adaptForMedia)}disconnectedCallbackHook(){R.matchMobile.removeEventListener("change",this.adaptForMedia),R.matchDesktopOrUp.removeEventListener("change",this.adaptForMedia)}renderLayout(){return g` ${this.badge}
${this.icons} @@ -4106,7 +4106,7 @@ merch-card-collection:has([slot="subtitle"]) merch-card { line-height: 21px; padding: 2px 10px 3px; } - `),m(ge,"collectionOptions",{customHeaderArea:t=>t.sidenav?g``:w,headerVisibility:{search:!1,sort:!1,result:["mobile","tablet"],custom:["desktop"]},onSidenavAttached:t=>{let r=()=>{let i=t.querySelectorAll("merch-card");for(let n of i)n.hasAttribute("data-size")&&(n.setAttribute("size",n.getAttribute("data-size")),n.removeAttribute("data-size"));if(!R.isDesktop)return;let a=0;for(let n of i){if(n.style.display==="none")continue;let o=n.getAttribute("size"),s=o==="wide"?2:o==="super-wide"?3:1;s===2&&a%3===2&&(n.setAttribute("data-size",o),n.removeAttribute("size"),s=1),a+=s}};R.matchDesktop.addEventListener("change",r),t.addEventListener(it,r),t.onUnmount.push(()=>{R.matchDesktop.removeEventListener("change",r),t.removeEventListener(it,r)})}});P();var Sc=` + `),m(ge,"collectionOptions",{customHeaderArea:t=>t.sidenav?g``:E,headerVisibility:{search:!1,sort:!1,result:["mobile","tablet"],custom:["desktop"]},onSidenavAttached:t=>{let r=()=>{let i=t.querySelectorAll("merch-card");for(let n of i)n.hasAttribute("data-size")&&(n.setAttribute("size",n.getAttribute("data-size")),n.removeAttribute("data-size"));if(!R.isDesktop)return;let a=0;for(let n of i){if(n.style.display==="none")continue;let o=n.getAttribute("size"),s=o==="wide"?2:o==="super-wide"?3:1;s===2&&a%3===2&&(n.setAttribute("data-size",o),n.removeAttribute("size"),s=1),a+=s}};R.matchDesktop.addEventListener("change",r),t.addEventListener(it,r),t.onUnmount.push(()=>{R.matchDesktop.removeEventListener("change",r),t.removeEventListener(it,r)})}});P();var Cc=` :root { --consonant-merch-card-plans-v2-font-family-regular: 'Adobe Clean', 'adobe-clean', sans-serif; --consonant-merch-card-plans-v2-font-family: 'Adobe Clean Display', 'adobe-clean-display', 'Adobe Clean', 'adobe-clean', sans-serif; @@ -4742,11 +4742,11 @@ merch-card[variant="plans-v2"][size="wide"] footer [slot="heading-m"] { } } -`;var Cc={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m"},shortDescription:{tag:"p",slot:"short-description"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},addon:!0,secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-red-700-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],whatsIncluded:{tag:"div",slot:"whats-included"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},Ke=class extends A{constructor(t){super(t),this.adaptForMedia=this.adaptForMedia.bind(this),this.toggleShortDescription=this.toggleShortDescription.bind(this),this.shortDescriptionExpanded=!1,this.syncScheduled=!1}priceOptionsProvider(t,r){if(t.dataset.template===xe){r.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(t.dataset.template==="strikethrough"||t.dataset.template==="price")&&(r.displayPerUnit=!1)}getGlobalCSS(){return Sc}adjustSlotPlacement(t,r,i){let{shadowRoot:a}=this.card,n=a.querySelector("footer"),o=a.querySelector(".body"),s=this.card.getAttribute("size");if(!s)return;let c=a.querySelector(`footer slot[name="${t}"]`),l=a.querySelector(`.body slot[name="${t}"]`);if(s.includes("wide")||(n?.classList.remove("wide-footer"),c?.remove()),!!r.includes(s)){if(n?.classList.toggle("wide-footer",R.isDesktopOrUp),!i&&c){if(l)c.remove();else{let d=o.querySelector(`[data-placeholder-for="${t}"]`);d?d.replaceWith(c):o.appendChild(c)}return}if(i&&l){let d=document.createElement("div");d.setAttribute("data-placeholder-for",t),d.classList.add("slot-placeholder"),c||n.prepend(l.cloneNode(!0)),l.replaceWith(d)}}}adaptForMedia(){if(!this.card.closest("merch-card-collection,overlay-trigger,.two-merch-cards,.three-merch-cards,.four-merch-cards,.columns"))return this.card.hasAttribute("size"),void 0;this.adjustSlotPlacement("heading-m",["wide"],!0),this.adjustSlotPlacement("addon",["super-wide"],R.isDesktopOrUp),this.adjustSlotPlacement("callout-content",["super-wide"],R.isDesktopOrUp)}adjustCallout(){let t=this.card.querySelector('[slot="callout-content"] .icon-button');if(!t?.title)return;t.dataset.tooltip=t.title,t.removeAttribute("title"),t.classList.add("hide-tooltip");let r=i=>{i===t?t.classList.toggle("hide-tooltip"):t.classList.add("hide-tooltip")};document.addEventListener("touchstart",i=>{i.preventDefault(),r(i.target)}),document.addEventListener("mouseover",i=>{i.preventDefault(),i.target!==t?t.classList.add("hide-tooltip"):t.classList.remove("hide-tooltip")})}async postCardUpdateHook(){if(this.card.isConnected&&(this.adaptForMedia(),this.adjustAddon(),this.adjustCallout(),this.updateShortDescriptionVisibility(),this.hasShortDescription?this.card.setAttribute("has-short-description",""):this.card.removeAttribute("has-short-description"),this.legalAdjusted||await this.adjustLegal(),await this.card.updateComplete,this.card.prices?.length>0&&await Promise.all(this.card.prices.map(t=>t.onceSettled?.()||Promise.resolve())),window.matchMedia("(min-width: 768px)").matches)){let t=this.getContainer();if(!t)return;let r=`--consonant-merch-card-${this.card.variant}`,i=t.style.getPropertyValue(`${r}-body-height`);requestAnimationFrame(i?()=>{this.syncHeights()}:()=>{t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`).forEach(n=>n.variantLayout?.syncHeights?.())})}}get mainPrice(){return this.card.querySelector(`[slot="heading-m"] ${D}[data-template="price"]`)}syncHeights(){if(this.card.getBoundingClientRect().width<=2)return;let t=this.card.shadowRoot?.querySelector(".body");t&&this.updateCardElementMinHeight(t,"body");let r=this.card.shadowRoot?.querySelector("footer");r&&this.updateCardElementMinHeight(r,"footer");let i=this.card.querySelector('[slot="short-description"]');i&&this.updateCardElementMinHeight(i,"short-description")}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=this.mainPrice;if(!t)return;let r=t.cloneNode(!0);if(await t.onceSettled(),!t?.options)return;t.options.displayPerUnit&&(t.dataset.displayPerUnit="false"),t.options.displayTax&&(t.dataset.displayTax="false"),t.options.displayPlanType&&(t.dataset.displayPlanType="false"),r.setAttribute("data-template","legal"),t.parentNode.insertBefore(r,t.nextSibling),await r.onceSettled()}catch{}}async adjustAddon(){await this.card.updateComplete;let t=this.card.addon;if(!t)return;t.setAttribute("custom-checkbox","");let r=this.mainPrice;if(!r)return;await r.onceSettled();let i=r.value?.[0]?.planType;i&&(t.planType=i)}get stockCheckbox(){return this.card.checkboxLabel?g``:E}get hasShortDescription(){return!!this.card.querySelector('[slot="short-description"]')}get shortDescriptionLabel(){let t=this.card.querySelector('[slot="short-description"]'),r=t.querySelector("strong, b");if(r?.textContent?.trim())return r.textContent.trim();let i=t.querySelector("h1, h2, h3, h4, h5, h6, p");return i?.textContent?.trim()?i.textContent.trim():t.textContent?.trim().split(` `)[0].trim()}updateShortDescriptionVisibility(){let t=this.card.querySelector('[slot="short-description"]');if(!t)return;let r=t.querySelector("strong, b, p");r&&(R.isMobile?r.style.display="none":r.style.display="")}toggleShortDescription(){this.shortDescriptionExpanded=!this.shortDescriptionExpanded,this.card.requestUpdate()}get shortDescriptionToggle(){return this.hasShortDescription?R.isMobile?g`
- `:w}get icons(){return this.card.querySelector('[slot="icons"]')||this.card.getAttribute("id")?g``:w}get secureLabelFooter(){return g`
`:Q`
${e}
`});this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}connectedCallbackHook(){this.card.addEventListener(O,this.updatePriceQuantity),this.visibilityObserver=new IntersectionObserver(([e])=>{e.boundingClientRect.height!==0&&e.isIntersecting&&(f.isMobile||requestAnimationFrame(()=>{let r=this.getContainer();if(!r)return;r.querySelectorAll('merch-card[variant="mini-compare-chart"]').forEach(n=>n.variantLayout?.syncHeights?.())}),this.visibilityObserver.disconnect())}),this.visibilityObserver.observe(this.card)}disconnectedCallbackHook(){if(this.card.removeEventListener(O,this.updatePriceQuantity),this.visibilityObserver?.disconnect(),this.calloutListenersAdded){document.removeEventListener("touchstart",this.handleCalloutTouch),document.removeEventListener("mouseover",this.handleCalloutMouse);let e=this.card.querySelector('[slot="callout-content"] .icon-button');e?.removeEventListener("focusin",this.handleCalloutFocusin),e?.removeEventListener("focusout",this.handleCalloutFocusout),e?.removeEventListener("keydown",this.handleCalloutKeydown),this.calloutListenersAdded=!1}}updatePriceQuantity({detail:e}){!this.mainPrice||!e?.option||(this.mainPrice.dataset.quantity=e.option)}priceOptionsProvider(e,r){if(this.isNewVariant){if(e.dataset.template===N){r.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(e.dataset.template==="strikethrough"||e.dataset.template==="price")&&(r.displayPerUnit=!1)}}getGlobalCSS(){return Pr}adjustMiniCompareBodySlots(){if(this.card.getBoundingClientRect().width<=2)return;this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(".top-section"),"top-section");let e=["heading-m","subtitle","body-m","heading-m-price","body-xxs","price-commitment","quantity-select","offers","promo-text","callout-content","addon"];this.card.classList.contains("bullet-list")&&e.push("footer-rows"),e.forEach(i=>this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(`slot[name="${i}"]`),i)),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector("footer"),"footer"),this.card.shadowRoot.querySelector(".mini-compare-chart-badge")?.textContent!==""&&this.getContainer().style.setProperty("--consonant-merch-card-mini-compare-chart-top-section-mobile-height","32px")}adjustMiniCompareFooterRows(){if(this.card.getBoundingClientRect().width===0)return;let e;if(this.isNewVariant){let r=this.card.querySelector("merch-whats-included");if(!r)return;e=[...r.querySelectorAll('[slot="content"] merch-mnemonic-list')]}else{let r=this.card.querySelector('[slot="footer-rows"] ul');if(!r||!r.children)return;e=[...r.children]}e.length&&e.forEach((r,i)=>{let n=Math.max(ri,parseFloat(window.getComputedStyle(r).height)||0),o=parseFloat(this.getContainer().style.getPropertyValue(this.getRowMinHeightPropertyName(i+1)))||0;n>o&&this.getContainer().style.setProperty(this.getRowMinHeightPropertyName(i+1),`${n}px`)})}removeEmptyRows(){this.isNewVariant?this.card.querySelectorAll("merch-whats-included merch-mnemonic-list").forEach(r=>{let i=r.querySelector('[slot="description"]');i&&!i.textContent.trim()&&r.remove()}):this.card.querySelectorAll(".footer-row-cell").forEach(r=>{let i=r.querySelector(".footer-row-cell-description");i&&!i.textContent.trim()&&r.remove()})}padFooterRows(){let e=this.getContainer();if(!e)return;let r=e.querySelectorAll('merch-card[variant="mini-compare-chart"]');if(this.isNewVariant){let i=0;if(r.forEach(p=>{let h=p.querySelector("merch-whats-included");if(!h)return;let v=h.querySelectorAll('[slot="content"] merch-mnemonic-list:not([data-placeholder])');i=Math.max(i,v.length)}),i===0)return;let n=this.card.querySelector("merch-whats-included");if(!n)return;let o=n.querySelector('[slot="content"]');if(!o)return;o.querySelectorAll("merch-mnemonic-list[data-placeholder]").forEach(p=>p.remove());let c=o.querySelectorAll("merch-mnemonic-list").length,l=i-c;for(let p=0;p{let p=l.querySelector('[slot="footer-rows"] ul');if(!p)return;let h=p.querySelectorAll("li.footer-row-cell:not([data-placeholder])");i=Math.max(i,h.length)}),i===0)return;let n=this.card.querySelector('[slot="footer-rows"] ul');if(!n)return;n.querySelectorAll("li.footer-row-cell[data-placeholder]").forEach(l=>l.remove());let o=n.querySelectorAll("li.footer-row-cell").length,c=i-o;for(let l=0;lc.remove()),e.checked){if(o){let c=L("p",{class:"addon-heading-m-price-addon",slot:"heading-m-price"},o.innerHTML);this.card.appendChild(c)}}else{let c=L("p",{class:"card-heading",id:"free",slot:"heading-m-price"},"Free");this.card.appendChild(c)}}}showTooltip(e){e.classList.remove("hide-tooltip"),e.setAttribute("aria-expanded","true")}hideTooltip(e){e.classList.add("hide-tooltip"),e.setAttribute("aria-expanded","false")}adjustCallout(){let e=this.card.querySelector('[slot="callout-content"] .icon-button');if(!e||this.calloutListenersAdded)return;let r=e.title||e.dataset.tooltip;if(!r)return;e.title&&(e.dataset.tooltip=e.title,e.removeAttribute("title"));let i=e.parentElement;if(i&&i.tagName==="P"){let n=document.createElement("div"),o=document.createElement("div");o.className="callout-row";let c=document.createElement("div");for(c.className="callout-text";i.firstChild&&i.firstChild!==e;)c.appendChild(i.firstChild);o.appendChild(c),o.appendChild(e),n.appendChild(o),i.replaceWith(n)}e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",r),e.setAttribute("aria-expanded","false"),this.hideTooltip(e),this.handleCalloutTouch=n=>{n.target!==e?this.hideTooltip(e):e.classList.contains("hide-tooltip")?this.showTooltip(e):this.hideTooltip(e)},this.handleCalloutMouse=n=>{n.target!==e?this.hideTooltip(e):this.showTooltip(e)},this.handleCalloutFocusin=()=>{this.showTooltip(e)},this.handleCalloutFocusout=()=>{this.hideTooltip(e)},this.handleCalloutKeydown=n=>{n.key==="Escape"&&(this.hideTooltip(e),e.blur())},document.addEventListener("touchstart",this.handleCalloutTouch),document.addEventListener("mouseover",this.handleCalloutMouse),e.addEventListener("focusin",this.handleCalloutFocusin),e.addEventListener("focusout",this.handleCalloutFocusout),e.addEventListener("keydown",this.handleCalloutKeydown),this.calloutListenersAdded=!0}async adjustAddon(){await this.card.updateComplete;let e=this.card.addon;if(!e)return;let r=this.mainPrice,i=this.card.planType;if(r&&(await r.onceSettled(),i=r.value?.[0]?.planType),!i)return;e.planType=i,this.card.querySelector("merch-addon[plan-type]")?.updateComplete.then(()=>{this.updateCardElementMinHeight(this.card.shadowRoot.querySelector('slot[name="addon"]'),"addon")})}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let e=this.mainPrice;if(!e)return;let r=e.cloneNode(!0);if(await e.onceSettled(),!e?.options)return;e.options.displayPerUnit&&(e.dataset.displayPerUnit="false"),e.options.displayTax&&(e.dataset.displayTax="false"),e.options.displayPlanType&&(e.dataset.displayPlanType="false"),r.setAttribute("data-template","legal"),e.parentNode.insertBefore(r,e.nextSibling),await r.onceSettled()}catch{}}adjustShortDescription(){let e=this.card.querySelector('[slot="body-xxs"]'),r=e?.textContent?.trim();if(!r)return;let n=this.card.querySelector('[slot="heading-m-price"] [data-template="legal"]')?.querySelector(".price-plan-type");if(!n)return;let o=document.createElement("em");o.setAttribute("slot","body-xxs"),o.textContent=` ${r}`,n.appendChild(o),e.remove()}renderLayout(){return this.isNewVariant?Q`
${this.badge}
@@ -1730,7 +1730,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { ${this.getMiniCompareFooter()} - `}syncHeights(){this.card.getBoundingClientRect().width<=2||(this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}async postCardUpdateHook(){if(await Promise.all(this.card.prices.map(e=>e.onceSettled())),this.isNewVariant&&(this.legalAdjusted||await this.adjustLegal(),this.adjustShortDescription(),this.adjustCallout()),await this.adjustAddon(),f.isMobile)this.removeEmptyRows();else{this.padFooterRows();let e=this.getContainer();if(!e)return;let r=e.style.getPropertyValue("--consonant-merch-card-footer-row-1-min-height");requestAnimationFrame(r?()=>{this.syncHeights()}:()=>{e.querySelectorAll('merch-card[variant="mini-compare-chart"]').forEach(n=>n.variantLayout?.syncHeights?.())})}}};d(Ee,"variantStyle",Za` + `}syncHeights(){this.card.getBoundingClientRect().width<=2||(this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}async postCardUpdateHook(){if(await Promise.all(this.card.prices.map(e=>e.onceSettled())),this.isNewVariant&&(this.legalAdjusted||await this.adjustLegal(),this.adjustShortDescription(),this.adjustCallout()),await this.adjustAddon(),f.isMobile)this.removeEmptyRows();else{this.padFooterRows();let e=this.getContainer();if(!e)return;let r=e.style.getPropertyValue("--consonant-merch-card-footer-row-1-min-height");requestAnimationFrame(r?()=>{this.syncHeights()}:()=>{e.querySelectorAll('merch-card[variant="mini-compare-chart"]').forEach(n=>n.variantLayout?.syncHeights?.())})}}};d(Ee,"variantStyle",ti` :host([variant='mini-compare-chart']) { max-width: var( --consonant-merch-card-mini-compare-chart-wide-width, @@ -1821,7 +1821,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { color: #505050; } - @media screen and ${Pr(C)} { + @media screen and ${_r(S)} { [class*'-merch-cards'] :host([variant='mini-compare-chart']) footer { @@ -1831,7 +1831,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { } } - @media screen and ${Pr(u)} { + @media screen and ${_r(u)} { :host([variant='mini-compare-chart']) footer { padding: var(--consonant-merch-spacing-xs) var(--consonant-merch-spacing-s) @@ -1984,7 +1984,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { background-color: #eb1000; color: #ffffff; } - `);import{html as gt,css as ei,unsafeCSS as Rr,nothing as ti}from"./lit-all.min.js";var Mr=` + `);import{html as ut,css as ai,unsafeCSS as Or,nothing as ii}from"./lit-all.min.js";var Rr=` :root { --list-checked-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' width='20' height='20'%3E%3Cpath fill='%23222222' d='M15.656,3.8625l-.7275-.5665a.5.5,0,0,0-.7.0875L7.411,12.1415,4.0875,8.8355a.5.5,0,0,0-.707,0L2.718,9.5a.5.5,0,0,0,0,.707l4.463,4.45a.5.5,0,0,0,.75-.0465L15.7435,4.564A.5.5,0,0,0,15.656,3.8625Z'%3E%3C/path%3E%3C/svg%3E"); --merch-card-collection-card-width: var(--consonant-merch-card-mini-compare-chart-mweb-width); @@ -2552,7 +2552,7 @@ merch-card[variant="mini-compare-chart-mweb"] .price-plan-type{ } } -@media screen and ${C} { +@media screen and ${S} { merch-card[variant="mini-compare-chart-mweb"] [slot="heading-xs"] { font-size: var(--consonant-merch-card-body-s-font-size); line-height: var(--consonant-merch-card-body-s-line-height); @@ -2702,7 +2702,7 @@ merch-card .footer-row-cell:nth-child(7) { merch-card .footer-row-cell:nth-child(8) { min-height: var(--consonant-merch-card-footer-row-8-min-height); } -`;var ri=32,Or={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m-price"},promoText:{tag:"div",slot:"promo-text"},shortDescription:{tag:"div",slot:"body-m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],ctas:{slot:"footer",size:"l"},style:"consonant"},ke=class extends x{constructor(e){super(e);d(this,"getRowMinHeightPropertyName",e=>`--consonant-merch-card-footer-row-${e}-min-height`);d(this,"getMiniCompareFooter",()=>gt`
+`;var ni=32,Nr={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m-price"},promoText:{tag:"div",slot:"promo-text"},shortDescription:{tag:"div",slot:"body-m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],ctas:{slot:"footer",size:"l"},style:"consonant"},ke=class extends x{constructor(e){super(e);d(this,"getRowMinHeightPropertyName",e=>`--consonant-merch-card-footer-row-${e}-min-height`);d(this,"getMiniCompareFooter",()=>ut`
${this.secureLabel}

-
`);d(this,"getMiniCompareFooterRows",()=>gt`
`);d(this,"getMiniCompareFooterRows",()=>ut` `);this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}connectedCallbackHook(){this.card.addEventListener(O,this.updatePriceQuantity)}disconnectedCallbackHook(){this.card.removeEventListener(O,this.updatePriceQuantity),this._syncObserver?.disconnect(),this._syncObserver=null}updatePriceQuantity({detail:e}){!this.mainPrice||!e?.option||(this.mainPrice.dataset.quantity=e.option)}priceOptionsProvider(e,r){if(e.dataset.template===N){r.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(e.dataset.template==="strikethrough"||e.dataset.template==="price")&&(r.displayPerUnit=!1)}getGlobalCSS(){return Mr}adjustMiniCompareBodySlots(){if(this.card.getBoundingClientRect().width<=2){this._syncObserver||(this._syncObserver=new ResizeObserver(()=>{this.card.getBoundingClientRect().width>2&&(this._syncObserver?.disconnect(),this._syncObserver=null,this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}),this._syncObserver.observe(this.card));return}["heading-xs","subtitle","heading-m-price","promo-text","body-m","body-xs","footer-rows"].forEach(r=>{let n=this.card.querySelector(`[slot="${r}"]`)??this.card.shadowRoot.querySelector(`slot[name="${r}"]`);this.updateCardElementMinHeight(n,r)}),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector('slot[name="promo-text"]'),"promo-text"),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector("footer"),"footer")}adjustMiniCompareFooterRows(){if(this.card.getBoundingClientRect().width===0)return;let e=this.card.querySelector('[slot="footer-rows"] ul');!e||!e.children||[...e.children].forEach((r,i)=>{let n=Math.max(ri,parseFloat(window.getComputedStyle(r).height)||0),o=parseFloat(this.getContainer().style.getPropertyValue(this.getRowMinHeightPropertyName(i+1)))||0;n>o&&this.getContainer().style.setProperty(this.getRowMinHeightPropertyName(i+1),`${n}px`)})}removeEmptyRows(){this.card.querySelectorAll(".footer-row-cell").forEach(r=>{let i=r.querySelector(".footer-row-cell-description");i&&!i.textContent.trim()&&r.remove()})}setupToggle(){if(this.toggleSetupDone)return;let e=this.card.querySelector('[slot="body-xs"]');if(!e)return;let r=e.querySelector("p"),i=e.querySelector("ul");if(!r||!i||e.querySelector(".footer-rows-title"))return;this.toggleSetupDone=!0;let n=r.textContent.trim(),o=this.card.querySelector("h3")?.id,c=o?`${o}-list`:`mweb-list-${Date.now()}`;i.setAttribute("id",c),i.classList.add("checkmark-copy-container");let l=L("div",{class:"footer-rows-title"},n);if(f.isMobile){let p=L("button",{class:"toggle-icon","aria-label":n,"aria-expanded":"false","aria-controls":c});l.appendChild(p),l.addEventListener("click",()=>{let h=i.classList.toggle("open");p.classList.toggle("expanded",h),p.setAttribute("aria-expanded",String(h))})}else i.classList.add("open");r.replaceWith(l)}get mainPrice(){return this.card.querySelector(`[slot="heading-m-price"] ${b}[data-template="price"]`)}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let e=this.mainPrice;if(!e)return;let r=e.cloneNode(!0);if(await e.onceSettled(),!e?.options)return;e.options.displayPerUnit&&(e.dataset.displayPerUnit="false"),e.options.displayTax&&(e.dataset.displayTax="false"),e.options.displayPlanType&&(e.dataset.displayPlanType="false"),r.setAttribute("data-template","legal"),e.parentNode.insertBefore(r,e.nextSibling),await r.onceSettled()}catch{}}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?ti:gt``}renderLayout(){return gt` +
`);this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}connectedCallbackHook(){this.card.addEventListener(O,this.updatePriceQuantity)}disconnectedCallbackHook(){this.card.removeEventListener(O,this.updatePriceQuantity),this._syncObserver?.disconnect(),this._syncObserver=null}updatePriceQuantity({detail:e}){!this.mainPrice||!e?.option||(this.mainPrice.dataset.quantity=e.option)}priceOptionsProvider(e,r){if(e.dataset.template===N){r.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(e.dataset.template==="strikethrough"||e.dataset.template==="price")&&(r.displayPerUnit=!1)}getGlobalCSS(){return Rr}adjustMiniCompareBodySlots(){if(this.card.getBoundingClientRect().width<=2){this._syncObserver||(this._syncObserver=new ResizeObserver(()=>{this.card.getBoundingClientRect().width>2&&(this._syncObserver?.disconnect(),this._syncObserver=null,this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}),this._syncObserver.observe(this.card));return}["heading-xs","subtitle","heading-m-price","promo-text","body-m","body-xs","footer-rows"].forEach(r=>{let n=this.card.querySelector(`[slot="${r}"]`)??this.card.shadowRoot.querySelector(`slot[name="${r}"]`);this.updateCardElementMinHeight(n,r)}),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector('slot[name="promo-text"]'),"promo-text"),this.updateCardElementMinHeight(this.card.shadowRoot.querySelector("footer"),"footer")}adjustMiniCompareFooterRows(){if(this.card.getBoundingClientRect().width===0)return;let e=this.card.querySelector('[slot="footer-rows"] ul');!e||!e.children||[...e.children].forEach((r,i)=>{let n=Math.max(ni,parseFloat(window.getComputedStyle(r).height)||0),o=parseFloat(this.getContainer().style.getPropertyValue(this.getRowMinHeightPropertyName(i+1)))||0;n>o&&this.getContainer().style.setProperty(this.getRowMinHeightPropertyName(i+1),`${n}px`)})}removeEmptyRows(){this.card.querySelectorAll(".footer-row-cell").forEach(r=>{let i=r.querySelector(".footer-row-cell-description");i&&!i.textContent.trim()&&r.remove()})}setupToggle(){if(this.toggleSetupDone)return;let e=this.card.querySelector('[slot="body-xs"]');if(!e)return;let r=e.querySelector("p"),i=e.querySelector("ul");if(!r||!i||e.querySelector(".footer-rows-title"))return;this.toggleSetupDone=!0;let n=r.textContent.trim(),o=this.card.querySelector("h3")?.id,c=o?`${o}-list`:`mweb-list-${Date.now()}`;i.setAttribute("id",c),i.classList.add("checkmark-copy-container");let l=L("div",{class:"footer-rows-title"},n);if(f.isMobile){let p=L("button",{class:"toggle-icon","aria-label":n,"aria-expanded":"false","aria-controls":c});l.appendChild(p),l.addEventListener("click",()=>{let h=i.classList.toggle("open");p.classList.toggle("expanded",h),p.setAttribute("aria-expanded",String(h))})}else i.classList.add("open");r.replaceWith(l)}get mainPrice(){return this.card.querySelector(`[slot="heading-m-price"] ${b}[data-template="price"]`)}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let e=this.mainPrice;if(!e)return;let r=e.cloneNode(!0);if(await e.onceSettled(),!e?.options)return;e.options.displayPerUnit&&(e.dataset.displayPerUnit="false"),e.options.displayTax&&(e.dataset.displayTax="false"),e.options.displayPlanType&&(e.dataset.displayPlanType="false"),r.setAttribute("data-template","legal"),e.parentNode.insertBefore(r,e.nextSibling),await r.onceSettled()}catch{}}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?ii:ut``}renderLayout(){return ut` ${this.badge}
${this.icons} @@ -2727,7 +2727,7 @@ merch-card .footer-row-cell:nth-child(8) { ${this.getMiniCompareFooter()}
${this.getMiniCompareFooterRows()} - `}async postCardUpdateHook(){if(await Promise.all(this.card.prices.map(e=>e.onceSettled())),this.legalAdjusted||await this.adjustLegal(),this.setupToggle(),f.isMobile)this.removeEmptyRows();else{this.adjustMiniCompareFooterRows();let e=this.getContainer();if(!e)return;requestAnimationFrame(()=>{e.querySelectorAll('merch-card[variant="mini-compare-chart-mweb"]').forEach(i=>{i.variantLayout?.adjustMiniCompareBodySlots?.(),i.variantLayout?.adjustMiniCompareFooterRows?.()})})}}};d(ke,"variantStyle",ei` + `}async postCardUpdateHook(){if(await Promise.all(this.card.prices.map(e=>e.onceSettled())),this.legalAdjusted||await this.adjustLegal(),this.setupToggle(),f.isMobile)this.removeEmptyRows();else{this.adjustMiniCompareFooterRows();let e=this.getContainer();if(!e)return;requestAnimationFrame(()=>{e.querySelectorAll('merch-card[variant="mini-compare-chart-mweb"]').forEach(i=>{i.variantLayout?.adjustMiniCompareBodySlots?.(),i.variantLayout?.adjustMiniCompareFooterRows?.()})})}}};d(ke,"variantStyle",ai` :host([variant='mini-compare-chart-mweb']) .body > slot { display: block; } @@ -2772,7 +2772,7 @@ merch-card .footer-row-cell:nth-child(8) { padding-inline-start: var(--consonant-merch-spacing-xs); } - @media screen and ${Rr(C)} { + @media screen and ${Or(S)} { [class*'-merch-cards'] :host([variant='mini-compare-chart-mweb']) footer { @@ -2782,7 +2782,7 @@ merch-card .footer-row-cell:nth-child(8) { } } - @media screen and ${Rr(u)} { + @media screen and ${Or(u)} { :host([variant='mini-compare-chart-mweb']) footer { padding: 0; } @@ -3000,7 +3000,7 @@ merch-card .footer-row-cell:nth-child(8) { gap: var(--consonant-merch-spacing-xxs); margin: unset; } - `);import{html as We,css as ai,nothing as ut}from"./lit-all.min.js";var Nr=` + `);import{html as We,css as oi,nothing as ft}from"./lit-all.min.js";var Dr=` :root { --consonant-merch-card-plans-width: 302px; --consonant-merch-card-plans-students-width: 302px; @@ -3391,7 +3391,7 @@ merch-card-collection:has([slot="subtitle"]) merch-card { } } -@media screen and ${C} { +@media screen and ${S} { .plans-team .columns .row-1 { grid-template-columns: min-content; } @@ -3466,11 +3466,11 @@ merch-card-collection:has([slot="subtitle"]) merch-card { --merch-sidenav-collection-gap: 54px; } } -`;var ft={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},addon:!0,secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],whatsIncluded:{tag:"div",slot:"whats-included"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},Dr={...function(){let{whatsIncluded:a,size:t,...e}=ft;return e}(),title:{tag:"h3",slot:"heading-s"},secureLabel:!1},Fr={...function(){let{subtitle:a,whatsIncluded:t,size:e,quantitySelect:r,...i}=ft;return i}()},_=class extends x{constructor(t){super(t),this.adaptForMedia=this.adaptForMedia.bind(this)}priceOptionsProvider(t,e){t.dataset.template===N&&(e.displayPlanType=this.card?.settings?.displayPlanType??!1)}getGlobalCSS(){return Nr}adjustSlotPlacement(t,e,r){let i=this.card.shadowRoot,n=i.querySelector("footer"),o=this.card.getAttribute("size");if(!o)return;let c=i.querySelector(`footer slot[name="${t}"]`),l=i.querySelector(`.body slot[name="${t}"]`),p=i.querySelector(".body");if(o.includes("wide")||(n?.classList.remove("wide-footer"),c&&c.remove()),!!e.includes(o)){if(n?.classList.toggle("wide-footer",f.isDesktopOrUp),!r&&c){if(l)c.remove();else{let h=p.querySelector(`[data-placeholder-for="${t}"]`);h?h.replaceWith(c):p.appendChild(c)}return}if(r&&l){let h=document.createElement("div");if(h.setAttribute("data-placeholder-for",t),h.classList.add("slot-placeholder"),!c){let v=l.cloneNode(!0);n.prepend(v)}l.replaceWith(h)}}}adaptForMedia(){if(!this.card.closest("merch-card-collection,overlay-trigger,.two-merch-cards,.three-merch-cards,.four-merch-cards, .columns")){this.card.removeAttribute("size");return}this.adjustSlotPlacement("addon",["super-wide"],f.isDesktopOrUp),this.adjustSlotPlacement("callout-content",["super-wide"],f.isDesktopOrUp)}adjustCallout(){let t=this.card.querySelector('[slot="callout-content"] .icon-button');t&&t.title&&(t.dataset.tooltip=t.title,t.removeAttribute("title"),t.classList.add("hide-tooltip"),document.addEventListener("touchstart",e=>{e.preventDefault(),e.target!==t?t.classList.add("hide-tooltip"):e.target.classList.toggle("hide-tooltip")}),document.addEventListener("mouseover",e=>{e.preventDefault(),e.target!==t?t.classList.add("hide-tooltip"):e.target.classList.remove("hide-tooltip")}))}async adjustEduLists(){if(this.card.variant!=="plans-education"||this.card.querySelector(".spacer"))return;let e=this.card.querySelector('[slot="body-xs"]');if(!e)return;let r=e.querySelector("ul");if(!r)return;let i=r.previousElementSibling,n=document.createElement("div");n.classList.add("spacer"),e.insertBefore(n,i);let o=new IntersectionObserver(([c])=>{if(c.boundingClientRect.height===0)return;let l=0,p=this.card.querySelector('[slot="heading-s"]');p&&(l+=qe(p));let h=this.card.querySelector('[slot="subtitle"]');h&&(l+=qe(h));let v=this.card.querySelector('[slot="heading-m"]');v&&(l+=8+qe(v));for(let R of e.childNodes){if(R.classList.contains("spacer"))break;l+=qe(R)}let A=this.card.parentElement.style.getPropertyValue("--merch-card-plans-edu-list-max-offset");l>(parseFloat(A)||0)&&this.card.parentElement.style.setProperty("--merch-card-plans-edu-list-max-offset",`${l}px`),this.card.style.setProperty("--merch-card-plans-edu-list-offset",`${l}px`),o.disconnect()});o.observe(this.card)}async postCardUpdateHook(){this.adaptForMedia(),this.adjustAddon(),this.adjustCallout(),this.legalAdjusted||(await this.adjustLegal(),await this.adjustEduLists())}get headingM(){return this.card.querySelector('[slot="heading-m"]')}get mainPrice(){return this.headingM?.querySelector(`${b}[data-template="price"]`)}get divider(){return this.card.variant==="plans-education"?We`
`:ut}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=[],e=this.card.querySelector(`[slot="heading-m"] ${b}[data-template="price"]`);e&&t.push(e);let r=t.map(async i=>{let n=i.cloneNode(!0);await i.onceSettled(),i?.options&&(i.options.displayPerUnit&&(i.dataset.displayPerUnit="false"),i.options.displayTax&&(i.dataset.displayTax="false"),i.options.displayPlanType&&(i.dataset.displayPlanType="false"),n.setAttribute("data-template","legal"),i.parentNode.insertBefore(n,i.nextSibling),await n.onceSettled())});await Promise.all(r)}catch{}}async adjustAddon(){await this.card.updateComplete;let t=this.card.addon;if(!t)return;t.setAttribute("custom-checkbox","");let e=this.mainPrice;if(!e)return;await e.onceSettled();let r=e.value?.[0]?.planType;r&&(t.planType=r)}get stockCheckbox(){return this.card.checkboxLabel?We``:ft}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?ft:We``}connectedCallbackHook(){f.matchMobile.addEventListener("change",this.adaptForMedia),f.matchDesktopOrUp.addEventListener("change",this.adaptForMedia)}disconnectedCallbackHook(){f.matchMobile.removeEventListener("change",this.adaptForMedia),f.matchDesktopOrUp.removeEventListener("change",this.adaptForMedia)}renderLayout(){return We` ${this.badge}
${this.icons} @@ -3491,7 +3491,7 @@ merch-card-collection:has([slot="subtitle"]) merch-card {
${this.secureLabelFooter} - `}};d(_,"variantStyle",ai` + `}};d(_,"variantStyle",oi` :host([variant^='plans']) { min-height: 273px; --merch-card-plans-min-width: 244px; @@ -3598,7 +3598,7 @@ merch-card-collection:has([slot="subtitle"]) merch-card { line-height: 21px; padding: 2px 10px 3px; } - `),d(_,"collectionOptions",{customHeaderArea:t=>t.sidenav?We``:ut,headerVisibility:{search:!1,sort:!1,result:["mobile","tablet"],custom:["desktop"]},onSidenavAttached:t=>{let e=()=>{let r=t.querySelectorAll("merch-card");for(let n of r)n.hasAttribute("data-size")&&(n.setAttribute("size",n.getAttribute("data-size")),n.removeAttribute("data-size"));if(!f.isDesktop)return;let i=0;for(let n of r){if(n.style.display==="none")continue;let o=n.getAttribute("size"),c=o==="wide"?2:o==="super-wide"?3:1;c===2&&i%3===2&&(n.setAttribute("data-size",o),n.removeAttribute("size"),c=1),i+=c}};f.matchDesktop.addEventListener("change",e),t.addEventListener(ge,e),t.onUnmount.push(()=>{f.matchDesktop.removeEventListener("change",e),t.removeEventListener(ge,e)})}});import{html as G,css as ii,unsafeCSS as $r,nothing as vt}from"./lit-all.min.js";var Ir=` + `),d(_,"collectionOptions",{customHeaderArea:t=>t.sidenav?We``:ft,headerVisibility:{search:!1,sort:!1,result:["mobile","tablet"],custom:["desktop"]},onSidenavAttached:t=>{let e=()=>{let r=t.querySelectorAll("merch-card");for(let n of r)n.hasAttribute("data-size")&&(n.setAttribute("size",n.getAttribute("data-size")),n.removeAttribute("data-size"));if(!f.isDesktop)return;let i=0;for(let n of r){if(n.style.display==="none")continue;let o=n.getAttribute("size"),c=o==="wide"?2:o==="super-wide"?3:1;c===2&&i%3===2&&(n.setAttribute("data-size",o),n.removeAttribute("size"),c=1),i+=c}};f.matchDesktop.addEventListener("change",e),t.addEventListener(ge,e),t.onUnmount.push(()=>{f.matchDesktop.removeEventListener("change",e),t.removeEventListener(ge,e)})}});import{html as j,css as ci,unsafeCSS as Br,nothing as xt}from"./lit-all.min.js";var $r=` :root { --consonant-merch-card-plans-v2-font-family-regular: 'Adobe Clean', 'adobe-clean', sans-serif; --consonant-merch-card-plans-v2-font-family: 'Adobe Clean Display', 'adobe-clean-display', 'Adobe Clean', 'adobe-clean', sans-serif; @@ -4047,7 +4047,7 @@ merch-card[variant="plans-v2"] .help-text { margin-top: var(--consonant-merch-spacing-xxs); } -@media screen and ${y}, ${C} { +@media screen and ${y}, ${S} { :root { --consonant-merch-card-plans-v2-width: 100%; } @@ -4234,12 +4234,12 @@ merch-card[variant="plans-v2"][size="wide"] footer [slot="heading-m"] { } } -`;var Br={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"subtitle"},prices:{tag:"p",slot:"heading-m"},shortDescription:{tag:"p",slot:"short-description"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},addon:!0,secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-red-700-plans"},allowedBadgeColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-gray-700-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],allowedBorderColors:["spectrum-yellow-300-plans","spectrum-gray-300-plans","spectrum-green-900-plans","spectrum-red-700-plans","gradient-purple-blue"],borderColor:{attribute:"border-color"},size:["wide","super-wide"],whatsIncluded:{tag:"div",slot:"whats-included"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},X=class extends x{constructor(t){super(t),this.adaptForMedia=this.adaptForMedia.bind(this),this.toggleShortDescription=this.toggleShortDescription.bind(this),this.shortDescriptionExpanded=!1,this.syncScheduled=!1}priceOptionsProvider(t,e){if(t.dataset.template===N){e.displayPlanType=this.card?.settings?.displayPlanType??!1;return}(t.dataset.template==="strikethrough"||t.dataset.template==="price")&&(e.displayPerUnit=!1)}getGlobalCSS(){return Ir}adjustSlotPlacement(t,e,r){let{shadowRoot:i}=this.card,n=i.querySelector("footer"),o=i.querySelector(".body"),c=this.card.getAttribute("size");if(!c)return;let l=i.querySelector(`footer slot[name="${t}"]`),p=i.querySelector(`.body slot[name="${t}"]`);if(c.includes("wide")||(n?.classList.remove("wide-footer"),l?.remove()),!!e.includes(c)){if(n?.classList.toggle("wide-footer",f.isDesktopOrUp),!r&&l){if(p)l.remove();else{let h=o.querySelector(`[data-placeholder-for="${t}"]`);h?h.replaceWith(l):o.appendChild(l)}return}if(r&&p){let h=document.createElement("div");h.setAttribute("data-placeholder-for",t),h.classList.add("slot-placeholder"),l||n.prepend(p.cloneNode(!0)),p.replaceWith(h)}}}adaptForMedia(){if(!this.card.closest("merch-card-collection,overlay-trigger,.two-merch-cards,.three-merch-cards,.four-merch-cards,.columns"))return this.card.hasAttribute("size"),void 0;this.adjustSlotPlacement("heading-m",["wide"],!0),this.adjustSlotPlacement("addon",["super-wide"],f.isDesktopOrUp),this.adjustSlotPlacement("callout-content",["super-wide"],f.isDesktopOrUp)}adjustCallout(){let t=this.card.querySelector('[slot="callout-content"] .icon-button');if(!t?.title)return;t.dataset.tooltip=t.title,t.removeAttribute("title"),t.classList.add("hide-tooltip");let e=r=>{r===t?t.classList.toggle("hide-tooltip"):t.classList.add("hide-tooltip")};document.addEventListener("touchstart",r=>{r.preventDefault(),e(r.target)}),document.addEventListener("mouseover",r=>{r.preventDefault(),r.target!==t?t.classList.add("hide-tooltip"):t.classList.remove("hide-tooltip")})}async postCardUpdateHook(){if(this.card.isConnected&&(this.adaptForMedia(),this.adjustAddon(),this.adjustCallout(),this.updateShortDescriptionVisibility(),this.hasShortDescription?this.card.setAttribute("has-short-description",""):this.card.removeAttribute("has-short-description"),this.legalAdjusted||await this.adjustLegal(),await this.card.updateComplete,this.card.prices?.length>0&&await Promise.all(this.card.prices.map(t=>t.onceSettled?.()||Promise.resolve())),window.matchMedia("(min-width: 768px)").matches)){let t=this.getContainer();if(!t)return;let e=`--consonant-merch-card-${this.card.variant}`,r=t.style.getPropertyValue(`${e}-body-height`);requestAnimationFrame(r?()=>{this.syncHeights()}:()=>{t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`).forEach(n=>n.variantLayout?.syncHeights?.())})}}get mainPrice(){return this.card.querySelector(`[slot="heading-m"] ${b}[data-template="price"]`)}syncHeights(){if(this.card.getBoundingClientRect().width<=2)return;let t=this.card.shadowRoot?.querySelector(".body");t&&this.updateCardElementMinHeight(t,"body");let e=this.card.shadowRoot?.querySelector("footer");e&&this.updateCardElementMinHeight(e,"footer");let r=this.card.querySelector('[slot="short-description"]');r&&this.updateCardElementMinHeight(r,"short-description")}async adjustLegal(){if(!this.legalAdjusted)try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=this.mainPrice;if(!t)return;let e=t.cloneNode(!0);if(await t.onceSettled(),!t?.options)return;t.options.displayPerUnit&&(t.dataset.displayPerUnit="false"),t.options.displayTax&&(t.dataset.displayTax="false"),t.options.displayPlanType&&(t.dataset.displayPlanType="false"),e.setAttribute("data-template","legal"),t.parentNode.insertBefore(e,t.nextSibling),await e.onceSettled()}catch{}}async adjustAddon(){await this.card.updateComplete;let t=this.card.addon;if(!t)return;t.setAttribute("custom-checkbox","");let e=this.mainPrice;if(!e)return;await e.onceSettled();let r=e.value?.[0]?.planType;r&&(t.planType=r)}get stockCheckbox(){return this.card.checkboxLabel?G``:xt}get hasShortDescription(){return!!this.card.querySelector('[slot="short-description"]')}get shortDescriptionLabel(){let t=this.card.querySelector('[slot="short-description"]'),e=t.querySelector("strong, b");if(e?.textContent?.trim())return e.textContent.trim();let r=t.querySelector("h1, h2, h3, h4, h5, h6, p");return r?.textContent?.trim()?r.textContent.trim():t.textContent?.trim().split(` +`)[0].trim()}updateShortDescriptionVisibility(){let t=this.card.querySelector('[slot="short-description"]');if(!t)return;let e=t.querySelector("strong, b, p");e&&(f.isMobile?e.style.display="none":e.style.display="")}toggleShortDescription(){this.shortDescriptionExpanded=!this.shortDescriptionExpanded,this.card.requestUpdate()}get shortDescriptionToggle(){return this.hasShortDescription?f.isMobile?j`
- `:G` + `:j`
- `:vt}get icons(){return this.card.querySelector('[slot="icons"]')||this.card.getAttribute("id")?G``:vt}get secureLabelFooter(){return G`
+ `:xt}get icons(){return this.card.querySelector('[slot="icons"]')||this.card.getAttribute("id")?j``:xt}get secureLabelFooter(){return j`
${this.secureLabel} -
`}connectedCallbackHook(){this.handleMediaChange=()=>{this.adaptForMedia(),this.updateShortDescriptionVisibility(),this.card.requestUpdate(),window.matchMedia("(min-width: 768px)").matches&&requestAnimationFrame(()=>{this.syncHeights()})},f.matchMobile.addEventListener("change",this.handleMediaChange),f.matchDesktopOrUp.addEventListener("change",this.handleMediaChange),this.visibilityObserver=new IntersectionObserver(([t])=>{t.boundingClientRect.height!==0&&t.isIntersecting&&(window.matchMedia("(min-width: 768px)").matches&&requestAnimationFrame(()=>{this.syncHeights()}),this.visibilityObserver.disconnect())}),this.visibilityObserver.observe(this.card)}disconnectedCallbackHook(){f.matchMobile.removeEventListener("change",this.handleMediaChange),f.matchDesktopOrUp.removeEventListener("change",this.handleMediaChange),this.visibilityObserver?.disconnect()}renderLayout(){let e=this.card.getAttribute("size")==="wide";return G` ${this.badge} +
`}connectedCallbackHook(){this.handleMediaChange=()=>{this.adaptForMedia(),this.updateShortDescriptionVisibility(),this.card.requestUpdate(),window.matchMedia("(min-width: 768px)").matches&&requestAnimationFrame(()=>{this.syncHeights()})},f.matchMobile.addEventListener("change",this.handleMediaChange),f.matchDesktopOrUp.addEventListener("change",this.handleMediaChange),this.visibilityObserver=new IntersectionObserver(([t])=>{t.boundingClientRect.height!==0&&t.isIntersecting&&(window.matchMedia("(min-width: 768px)").matches&&requestAnimationFrame(()=>{this.syncHeights()}),this.visibilityObserver.disconnect())}),this.visibilityObserver.observe(this.card)}disconnectedCallbackHook(){f.matchMobile.removeEventListener("change",this.handleMediaChange),f.matchDesktopOrUp.removeEventListener("change",this.handleMediaChange),this.visibilityObserver?.disconnect()}renderLayout(){let e=this.card.getAttribute("size")==="wide";return j` ${this.badge}
- ${e?G` + ${e?j`
${this.icons} @@ -4276,7 +4276,7 @@ merch-card[variant="plans-v2"][size="wide"] footer [slot="heading-m"] {
- `:G` + `:j`
${this.icons}
@@ -4292,7 +4292,7 @@ merch-card[variant="plans-v2"][size="wide"] footer [slot="heading-m"] { `}
${this.secureLabelFooter} ${this.shortDescriptionToggle} - `}};d(X,"variantStyle",ii` + `}};d(X,"variantStyle",ci` :host([variant='plans-v2']) { display: flex; flex-direction: column; @@ -4781,7 +4781,7 @@ merch-card[variant="plans-v2"][size="wide"] footer [slot="heading-m"] { margin-right: 0; } - @media ${$r(y)}, ${$r(C)} { + @media ${Br(y)}, ${Br(S)} { :host([variant='plans-v2']) { --merch-card-plans-v2-padding: 26px 16px; } @@ -4848,7 +4848,7 @@ merch-card[variant="plans-v2"][size="wide"] footer [slot="heading-m"] { .toggle-label { color: #292929; } - `),d(X,"collectionOptions",{customHeaderArea:t=>t.sidenav?G``:vt,headerVisibility:{search:!1,sort:!1,result:["mobile","tablet"],custom:["desktop"]},onSidenavAttached:t=>{let e=()=>{let r=t.querySelectorAll("merch-card");if(r.forEach(n=>{n.hasAttribute("data-size")&&(n.setAttribute("size",n.getAttribute("data-size")),n.removeAttribute("data-size"))}),!f.isDesktop)return;let i=0;r.forEach(n=>{if(n.style.display==="none")return;let o=n.getAttribute("size"),c=o==="wide"?2:o==="super-wide"?3:1;c===2&&i%3===2&&(n.setAttribute("data-size",o),n.removeAttribute("size"),c=1),i+=c})};f.matchDesktop.addEventListener("change",e),t.addEventListener(ge,e),t.onUnmount.push(()=>{f.matchDesktop.removeEventListener("change",e),t.removeEventListener(ge,e)})}});import{html as Rt,css as ni}from"./lit-all.min.js";var qr=` + `),d(X,"collectionOptions",{customHeaderArea:t=>t.sidenav?j``:xt,headerVisibility:{search:!1,sort:!1,result:["mobile","tablet"],custom:["desktop"]},onSidenavAttached:t=>{let e=()=>{let r=t.querySelectorAll("merch-card");if(r.forEach(n=>{n.hasAttribute("data-size")&&(n.setAttribute("size",n.getAttribute("data-size")),n.removeAttribute("data-size"))}),!f.isDesktop)return;let i=0;r.forEach(n=>{if(n.style.display==="none")return;let o=n.getAttribute("size"),c=o==="wide"?2:o==="super-wide"?3:1;c===2&&i%3===2&&(n.setAttribute("data-size",o),n.removeAttribute("size"),c=1),i+=c})};f.matchDesktop.addEventListener("change",e),t.addEventListener(ge,e),t.onUnmount.push(()=>{f.matchDesktop.removeEventListener("change",e),t.removeEventListener(ge,e)})}});import{html as Nt,css as si}from"./lit-all.min.js";var Hr=` :root { --consonant-merch-card-product-width: 300px; } @@ -4983,14 +4983,14 @@ merch-card[variant="product"] { } } -`;var Hr={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},prices:{tag:"p",slot:"heading-xs"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"color-yellow-300-variation"},allowedBadgeColors:["color-yellow-300-variation","color-gray-300-variation","color-gray-700-variation","color-green-900-variation","gradient-purple-blue"],allowedBorderColors:["color-yellow-300-variation","color-gray-300-variation","color-green-900-variation","gradient-purple-blue"],borderColor:{attribute:"border-color"},whatsIncluded:{tag:"div",slot:"whats-included"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},Se=class extends x{constructor(t){super(t),this.postCardUpdateHook=this.postCardUpdateHook.bind(this),this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}getGlobalCSS(){return qr}priceOptionsProvider(t,e){t.dataset.template===N&&(e.displayPlanType=this.card?.settings?.displayPlanType??!1,(t.dataset.template==="strikethrough"||t.dataset.template==="price")&&(e.displayPerUnit=!1))}adjustProductBodySlots(){if(this.card.getBoundingClientRect().width===0)return;["heading-xs","body-xxs","body-xs","promo-text","callout-content","addon","body-lower"].forEach(e=>this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(`slot[name="${e}"]`),e))}renderLayout(){return Rt` ${this.badge} +`;var Ur={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},prices:{tag:"p",slot:"heading-xs"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},secureLabel:!0,planType:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"color-yellow-300-variation"},allowedBadgeColors:["color-yellow-300-variation","color-gray-300-variation","color-gray-700-variation","color-green-900-variation","gradient-purple-blue"],allowedBorderColors:["color-yellow-300-variation","color-gray-300-variation","color-green-900-variation","gradient-purple-blue"],borderColor:{attribute:"border-color"},whatsIncluded:{tag:"div",slot:"whats-included"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},Ce=class extends x{constructor(t){super(t),this.postCardUpdateHook=this.postCardUpdateHook.bind(this),this.updatePriceQuantity=this.updatePriceQuantity.bind(this)}getGlobalCSS(){return Hr}priceOptionsProvider(t,e){t.dataset.template===N&&(e.displayPlanType=this.card?.settings?.displayPlanType??!1,(t.dataset.template==="strikethrough"||t.dataset.template==="price")&&(e.displayPerUnit=!1))}adjustProductBodySlots(){if(this.card.getBoundingClientRect().width===0)return;["heading-xs","body-xxs","body-xs","promo-text","callout-content","addon","body-lower"].forEach(e=>this.updateCardElementMinHeight(this.card.shadowRoot.querySelector(`slot[name="${e}"]`),e))}renderLayout(){return Nt` ${this.badge}
- ${this.promoBottom?"":Rt``} + ${this.promoBottom?"":Nt``} - ${this.promoBottom?Rt``:""} + ${this.promoBottom?Nt``:""} @@ -4999,7 +4999,7 @@ merch-card[variant="product"] {

- ${this.secureLabelFooter}`}connectedCallbackHook(){window.addEventListener("resize",this.postCardUpdateHook),this.card.addEventListener(O,this.updatePriceQuantity)}disconnectedCallbackHook(){window.removeEventListener("resize",this.postCardUpdateHook),this.card.removeEventListener(O,this.updatePriceQuantity)}async postCardUpdateHook(){this.card.isConnected&&(this.adjustAddon(),f.isMobile||this.adjustProductBodySlots(),this.legalAdjusted||await this.adjustLegal())}async adjustLegal(){if(!(this.legalAdjusted||!this.card.id))try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=this.mainPrice;if(!t)return;let e=t.cloneNode(!0);if(await t.onceSettled(),!t?.options)return;t.options.displayPerUnit&&(t.dataset.displayPerUnit="false"),t.options.displayTax&&(t.dataset.displayTax="false"),t.options.displayPlanType&&(t.dataset.displayPlanType="false"),e.setAttribute("data-template","legal"),t.parentNode.insertBefore(e,t.nextSibling),await e.onceSettled()}catch{}}get headingXSSlot(){return this.card.shadowRoot.querySelector('slot[name="heading-xs"]').assignedElements()[0]}get mainPrice(){return this.card.querySelector(`[slot="heading-xs"] ${b}[data-template="price"]`)}updatePriceQuantity({detail:t}){!this.mainPrice||!t?.option||(this.mainPrice.dataset.quantity=t.option)}toggleAddon(t){let e=this.mainPrice,r=this.headingXSSlot;if(!e&&r){let i=t?.getAttribute("plan-type"),n=null;if(t&&i&&(n=t.querySelector(`p[data-plan-type="${i}"]`)?.querySelector('span[is="inline-price"]')),this.card.querySelectorAll('p[slot="heading-xs"]').forEach(o=>o.remove()),t.checked){if(n){let o=L("p",{class:"addon-heading-xs-price-addon",slot:"heading-xs"},n.innerHTML);this.card.appendChild(o)}}else{let o=L("p",{class:"card-heading",id:"free",slot:"heading-xs"},"Free");this.card.appendChild(o)}}}async adjustAddon(){await this.card.updateComplete;let t=this.card.addon;if(!t)return;let e=this.mainPrice,r=this.card.planType;e&&(await e.onceSettled(),r=e.value?.[0]?.planType),r&&(t.planType=r)}};d(Se,"variantStyle",ni` + ${this.secureLabelFooter}`}connectedCallbackHook(){window.addEventListener("resize",this.postCardUpdateHook),this.card.addEventListener(O,this.updatePriceQuantity)}disconnectedCallbackHook(){window.removeEventListener("resize",this.postCardUpdateHook),this.card.removeEventListener(O,this.updatePriceQuantity)}async postCardUpdateHook(){this.card.isConnected&&(this.adjustAddon(),f.isMobile||this.adjustProductBodySlots(),this.legalAdjusted||await this.adjustLegal())}async adjustLegal(){if(!(this.legalAdjusted||!this.card.id))try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=this.mainPrice;if(!t)return;let e=t.cloneNode(!0);if(await t.onceSettled(),!t?.options)return;t.options.displayPerUnit&&(t.dataset.displayPerUnit="false"),t.options.displayTax&&(t.dataset.displayTax="false"),t.options.displayPlanType&&(t.dataset.displayPlanType="false"),e.setAttribute("data-template","legal"),t.parentNode.insertBefore(e,t.nextSibling),await e.onceSettled()}catch{}}get headingXSSlot(){return this.card.shadowRoot.querySelector('slot[name="heading-xs"]').assignedElements()[0]}get mainPrice(){return this.card.querySelector(`[slot="heading-xs"] ${b}[data-template="price"]`)}updatePriceQuantity({detail:t}){!this.mainPrice||!t?.option||(this.mainPrice.dataset.quantity=t.option)}toggleAddon(t){let e=this.mainPrice,r=this.headingXSSlot;if(!e&&r){let i=t?.getAttribute("plan-type"),n=null;if(t&&i&&(n=t.querySelector(`p[data-plan-type="${i}"]`)?.querySelector('span[is="inline-price"]')),this.card.querySelectorAll('p[slot="heading-xs"]').forEach(o=>o.remove()),t.checked){if(n){let o=L("p",{class:"addon-heading-xs-price-addon",slot:"heading-xs"},n.innerHTML);this.card.appendChild(o)}}else{let o=L("p",{class:"card-heading",id:"free",slot:"heading-xs"},"Free");this.card.appendChild(o)}}}async adjustAddon(){await this.card.updateComplete;let t=this.card.addon;if(!t)return;let e=this.mainPrice,r=this.card.planType;e&&(await e.onceSettled(),r=e.value?.[0]?.planType),r&&(t.planType=r)}};d(Ce,"variantStyle",si` :host([variant='product']) { background: linear-gradient(white, white) padding-box, @@ -5048,7 +5048,7 @@ merch-card[variant="product"] { color: rgb(80, 80, 80); line-height: var(--consonant-merch-card-detail-xs-line-height); } - `);import{html as Ot,css as oi}from"./lit-all.min.js";var Ur=` + `);import{html as Dt,css as li}from"./lit-all.min.js";var Gr=` :root { --consonant-merch-card-segment-width: 378px; } @@ -5152,21 +5152,21 @@ merch-card-collection.segment merch-card { width: auto; height: 100%; } -`;var jr={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},prices:{tag:"p",slot:"heading-xs"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},callout:{tag:"div",slot:"callout-content"},planType:!0,secureLabel:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"color-red-700-variation"},allowedBadgeColors:["color-yellow-300-variation","color-gray-300-variation","color-gray-700-variation","color-green-900-variation","color-red-700-variation","gradient-purple-blue"],allowedBorderColors:["color-yellow-300-variation","color-gray-300-variation","color-green-900-variation","color-red-700-variation","gradient-purple-blue"],borderColor:{attribute:"border-color"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},Ce=class extends x{constructor(t){super(t)}priceOptionsProvider(t,e){t.dataset.template===N&&(e.displayPlanType=this.card?.settings?.displayPlanType??!1,(t.dataset.template==="strikethrough"||t.dataset.template==="price")&&(e.displayPerUnit=!1))}getGlobalCSS(){return Ur}get badgeElement(){return this.card.querySelector('[slot="badge"]')}get mainPrice(){return this.card.querySelector(`[slot="heading-xs"] ${b}[data-template="price"]`)}async postCardUpdateHook(){this.legalAdjusted||await this.adjustLegal()}async adjustLegal(){if(!(this.legalAdjusted||!this.card.id))try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=this.mainPrice;if(!t)return;let e=t.cloneNode(!0);if(await t.onceSettled(),!t?.options)return;t.options.displayPerUnit&&(t.dataset.displayPerUnit="false"),t.options.displayTax&&(t.dataset.displayTax="false"),t.options.displayPlanType&&(t.dataset.displayPlanType="false"),e.setAttribute("data-template","legal"),t.parentNode.insertBefore(e,t.nextSibling),await e.onceSettled()}catch{}}renderLayout(){return Ot` +`;var jr={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},prices:{tag:"p",slot:"heading-xs"},promoText:{tag:"p",slot:"promo-text"},description:{tag:"div",slot:"body-xs"},callout:{tag:"div",slot:"callout-content"},planType:!0,secureLabel:!0,badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"color-red-700-variation"},allowedBadgeColors:["color-yellow-300-variation","color-gray-300-variation","color-gray-700-variation","color-green-900-variation","color-red-700-variation","gradient-purple-blue"],allowedBorderColors:["color-yellow-300-variation","color-gray-300-variation","color-green-900-variation","color-red-700-variation","gradient-purple-blue"],borderColor:{attribute:"border-color"},ctas:{slot:"footer",size:"m"},style:"consonant",perUnitLabel:{tag:"span",slot:"per-unit-label"}},Se=class extends x{constructor(t){super(t)}priceOptionsProvider(t,e){t.dataset.template===N&&(e.displayPlanType=this.card?.settings?.displayPlanType??!1,(t.dataset.template==="strikethrough"||t.dataset.template==="price")&&(e.displayPerUnit=!1))}getGlobalCSS(){return Gr}get badgeElement(){return this.card.querySelector('[slot="badge"]')}get mainPrice(){return this.card.querySelector(`[slot="heading-xs"] ${b}[data-template="price"]`)}async postCardUpdateHook(){this.legalAdjusted||await this.adjustLegal()}async adjustLegal(){if(!(this.legalAdjusted||!this.card.id))try{this.legalAdjusted=!0,await this.card.updateComplete,await customElements.whenDefined("inline-price");let t=this.mainPrice;if(!t)return;let e=t.cloneNode(!0);if(await t.onceSettled(),!t?.options)return;t.options.displayPerUnit&&(t.dataset.displayPerUnit="false"),t.options.displayTax&&(t.dataset.displayTax="false"),t.options.displayPlanType&&(t.dataset.displayPlanType="false"),e.setAttribute("data-template","legal"),t.parentNode.insertBefore(e,t.nextSibling),await e.onceSettled()}catch{}}renderLayout(){return Dt` ${this.badge}
- ${this.promoBottom?"":Ot``} - ${this.promoBottom?Ot``:""}

${this.secureLabelFooter} - `}};d(Ce,"variantStyle",oi` + `}};d(Se,"variantStyle",li` :host([variant='segment']) { min-height: 214px; background: @@ -5177,7 +5177,7 @@ merch-card-collection.segment merch-card { :host([variant='segment']) ::slotted(h3[slot='heading-xs']) { max-width: var(--consonant-merch-card-heading-xs-max-width, 100%); } - `);import{html as ci,css as si}from"./lit-all.min.js";var Gr=` + `);import{html as di,css as hi}from"./lit-all.min.js";var Vr=` merch-card[variant='media'] { border: 0; @@ -5290,7 +5290,7 @@ merch-card-collection.segment merch-card { width: 700px; } -`;var Vr={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"body-xxs"},description:{tag:"div",slot:"body-xs"},ctas:{slot:"footer",size:"m"},backgroundImage:{tag:"div",slot:"bg-image"},style:"consonant"},Ae=class extends x{constructor(t){super(t)}getGlobalCSS(){return Gr}removeFocusFromModalClose(){let t=this.card.closest(".dialog-modal");t&&t.querySelector(".dialog-close")?.blur()}async postCardUpdateHook(){this.removeFocusFromModalClose()}renderLayout(){return ci` +`;var Wr={cardName:{attribute:"name"},title:{tag:"h3",slot:"heading-xs"},subtitle:{tag:"p",slot:"body-xxs"},description:{tag:"div",slot:"body-xs"},ctas:{slot:"footer",size:"m"},backgroundImage:{tag:"div",slot:"bg-image"},style:"consonant"},Ae=class extends x{constructor(t){super(t)}getGlobalCSS(){return Vr}removeFocusFromModalClose(){let t=this.card.closest(".dialog-modal");t&&t.querySelector(".dialog-close")?.blur()}async postCardUpdateHook(){this.removeFocusFromModalClose()}renderLayout(){return di`
@@ -5302,7 +5302,7 @@ merch-card-collection.segment merch-card {
- `}};d(Ae,"variantStyle",si` + `}};d(Ae,"variantStyle",hi` :host([variant='media']) .media-row { display: flex; gap: 24px; @@ -5331,7 +5331,7 @@ merch-card-collection.segment merch-card { gap: 40px; } } - `);import{html as Nt,css as li}from"./lit-all.min.js";var Wr=` + `);import{html as Ft,css as pi}from"./lit-all.min.js";var Kr=` :root { --consonant-merch-card-special-offers-width: 302px; --merch-card-collection-card-width: var(--consonant-merch-card-special-offers-width); @@ -5387,7 +5387,7 @@ merch-card[variant="special-offers"] span[is="inline-price"][data-template="pric grid-template-columns: repeat(4, minmax(302px, var(--consonant-merch-card-special-offers-width))); } } -`;var Kr={cardName:{attribute:"name"},backgroundImage:{tag:"div",slot:"bg-image"},subtitle:{tag:"p",slot:"detail-m"},title:{tag:"h3",slot:"heading-xs"},prices:{tag:"p",slot:"heading-xs-price"},description:{tag:"div",slot:"body-xs"},ctas:{slot:"footer",size:"l"},badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-special-offers"},allowedBadgeColors:["spectrum-yellow-300-special-offers","spectrum-gray-300-special-offers","spectrum-green-900-special-offers"],allowedBorderColors:["spectrum-yellow-300-special-offers","spectrum-gray-300-special-offers","spectrum-green-900-special-offers"],borderColor:{attribute:"border-color"}},Te=class extends x{constructor(t){super(t)}get headingSelector(){return'[slot="detail-m"]'}getGlobalCSS(){return Wr}renderLayout(){return Nt`${this.cardImage} +`;var Yr={cardName:{attribute:"name"},backgroundImage:{tag:"div",slot:"bg-image"},subtitle:{tag:"p",slot:"detail-m"},title:{tag:"h3",slot:"heading-xs"},prices:{tag:"p",slot:"heading-xs-price"},description:{tag:"div",slot:"body-xs"},ctas:{slot:"footer",size:"l"},badgeIcon:!0,badge:{tag:"div",slot:"badge",default:"spectrum-yellow-300-special-offers"},allowedBadgeColors:["spectrum-yellow-300-special-offers","spectrum-gray-300-special-offers","spectrum-green-900-special-offers"],allowedBorderColors:["spectrum-yellow-300-special-offers","spectrum-gray-300-special-offers","spectrum-green-900-special-offers"],borderColor:{attribute:"border-color"}},Te=class extends x{constructor(t){super(t)}get headingSelector(){return'[slot="detail-m"]'}getGlobalCSS(){return Kr}renderLayout(){return Ft`${this.cardImage}
@@ -5395,18 +5395,18 @@ merch-card[variant="special-offers"] span[is="inline-price"][data-template="pric
- ${this.evergreen?Nt` + ${this.evergreen?Ft`
- `:Nt` + `:Ft`
${this.secureLabelFooter} `} - `}};d(Te,"variantStyle",li` + `}};d(Te,"variantStyle",pi` :host([variant='special-offers']) { min-height: 439px; background: @@ -5440,7 +5440,7 @@ merch-card[variant="special-offers"] span[is="inline-price"][data-template="pric ) { border-color: var(--spectrum-green-900-special-offers); } - `);import{html as di,css as hi}from"./lit-all.min.js";var Yr=` + `);import{html as mi,css as gi}from"./lit-all.min.js";var Qr=` :root { --merch-card-simplified-pricing-express-width: 311px; } @@ -5836,7 +5836,7 @@ merch-card[variant="simplified-pricing-express"] mas-mnemonic { } /* Tablet styles - responsive full width with padding */ -@media screen and ${w} and ${C} { +@media screen and ${w} and ${S} { .collection-container.simplified-pricing-express { display: block; width: 100%; @@ -5883,7 +5883,7 @@ merch-card[variant="simplified-pricing-express"] [slot="cta"] a.spectrum-Button. font-size: var(--merch-card-simplified-pricing-express-body-xs-font-size, 14px); } } -`;var Dt={title:{tag:"h3",slot:"heading-xs",maxCount:250,withSuffix:!0},badge:{tag:"div",slot:"badge",default:"spectrum-blue-400"},allowedBadgeColors:["spectrum-blue-400","spectrum-gray-300","spectrum-yellow-300","gradient-purple-blue","gradient-firefly-spectrum"],description:{tag:"div",slot:"body-xs",maxCount:2e3,withSuffix:!1},prices:{tag:"div",slot:"price"},callout:{tag:"div",slot:"callout-content",editorLabel:"Price description"},ctas:{slot:"cta",size:"XL"},borderColor:{attribute:"border-color",specialValues:{gray:"var(--spectrum-gray-300)",blue:"var(--spectrum-blue-400)","gradient-purple-blue":"linear-gradient(96deg, #B539C8 0%, #7155FA 66%, #3B63FB 100%)","gradient-firefly-spectrum":"linear-gradient(96deg, #D73220 0%, #D92361 33%, #7155FA 100%)"}},disabledAttributes:["badgeColor","badgeBorderColor","trialBadgeColor","trialBadgeBorderColor"],supportsDefaultChild:!0},Le=class extends x{getGlobalCSS(){return Yr}get aemFragmentMapping(){return Dt}get headingSelector(){return'[slot="heading-xs"]'}get badge(){return this.card.querySelector('[slot="badge"]')}syncHeights(){if(this.card.getBoundingClientRect().width===0)return;let t=this.card.shadowRoot;if(!t)return;["header","price-container","cta"].forEach(i=>this.updateCardElementMinHeight(t.querySelector(`.${i}`),i));let e=this.card.querySelector('[slot="body-xs"]');e&&this.updateCardElementMinHeight(e,"description");let r=this.card.querySelector('[slot="body-xs"] p:has(mas-mnemonic)');r&&this.updateCardElementMinHeight(r,"icons")}async postCardUpdateHook(){if(!this.card.isConnected)return;await this.card.updateComplete,this.card.prices?.length&&await Promise.all(this.card.prices.map(i=>i.onceSettled?.()));let t=this.getContainer();if(!t)return;let e=t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`),r=34;e.forEach(i=>{i.classList.remove("small-font-size-button"),i.querySelectorAll('[slot="cta"] sp-button, [slot="cta"] button, [slot="cta"] a.con-button, [slot="cta"] a.spectrum-Button, a[slot="cta"]').forEach(o=>{let c=o.textContent.trim().length>r;o.classList.toggle("small-font-size-button",c)})}),f.isDesktopOrUp&&e.forEach(i=>i.variantLayout?.syncHeights?.())}connectedCallbackHook(){!this.card||this.card.failed||(this.setupAccordion(),this.card?.hasAttribute("data-default-card")&&!it()&&this.card.setAttribute("data-expanded","true"),this.observeVisibility())}resyncSiblings(){let t=this.getContainer();t&&t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`).forEach(e=>e.variantLayout?.syncHeights?.())}observeVisibility(){typeof ResizeObserver>"u"||(this.lastSyncedWidth=0,this.sizeObserver=new ResizeObserver(()=>{let t=this.card.getBoundingClientRect().width;t<=2||t===this.lastSyncedWidth||(this.lastSyncedWidth=t,this.resyncSiblings())}),this.sizeObserver.observe(this.card))}setupAccordion(){let t=this.card;if(!t)return;let e=()=>{if(it())t.removeAttribute("data-expanded");else{let i=t.hasAttribute("data-default-card");t.setAttribute("data-expanded",i?"true":"false")}};e();let r=window.matchMedia(y);this.mediaQueryListener=()=>{e()},r.addEventListener("change",this.mediaQueryListener)}disconnectedCallbackHook(){this.mediaQueryListener&&window.matchMedia(y).removeEventListener("change",this.mediaQueryListener),this.sizeObserver?.disconnect(),this.sizeObserver=null}handleChevronClick(t){t.preventDefault(),t.stopPropagation(),this.toggleExpanded()}handleCardClick(t){t.target.closest('.chevron-button, mas-mnemonic, button, a, [role="button"]')||(t.preventDefault(),this.toggleExpanded())}toggleExpanded(){let t=this.card;if(!t||it())return;let i=t.getAttribute("data-expanded")==="true"?"false":"true";t.setAttribute("data-expanded",i)}renderLayout(){return di` +`;var It={title:{tag:"h3",slot:"heading-xs",maxCount:250,withSuffix:!0},badge:{tag:"div",slot:"badge",default:"spectrum-blue-400"},allowedBadgeColors:["spectrum-blue-400","spectrum-gray-300","spectrum-yellow-300","gradient-purple-blue","gradient-firefly-spectrum"],description:{tag:"div",slot:"body-xs",maxCount:2e3,withSuffix:!1},prices:{tag:"div",slot:"price"},callout:{tag:"div",slot:"callout-content",editorLabel:"Price description"},ctas:{slot:"cta",size:"XL"},borderColor:{attribute:"border-color",specialValues:{gray:"var(--spectrum-gray-300)",blue:"var(--spectrum-blue-400)","gradient-purple-blue":"linear-gradient(96deg, #B539C8 0%, #7155FA 66%, #3B63FB 100%)","gradient-firefly-spectrum":"linear-gradient(96deg, #D73220 0%, #D92361 33%, #7155FA 100%)"}},disabledAttributes:["badgeColor","badgeBorderColor","trialBadgeColor","trialBadgeBorderColor"],supportsDefaultChild:!0},Le=class extends x{getGlobalCSS(){return Qr}get aemFragmentMapping(){return It}get headingSelector(){return'[slot="heading-xs"]'}get badge(){return this.card.querySelector('[slot="badge"]')}syncHeights(){if(this.card.getBoundingClientRect().width===0)return;let t=this.card.shadowRoot;if(!t)return;["header","price-container","cta"].forEach(i=>this.updateCardElementMinHeight(t.querySelector(`.${i}`),i));let e=this.card.querySelector('[slot="body-xs"]');e&&this.updateCardElementMinHeight(e,"description");let r=this.card.querySelector('[slot="body-xs"] p:has(mas-mnemonic)');r&&this.updateCardElementMinHeight(r,"icons")}async postCardUpdateHook(){if(!this.card.isConnected)return;await this.card.updateComplete,this.card.prices?.length&&await Promise.all(this.card.prices.map(i=>i.onceSettled?.()));let t=this.getContainer();if(!t)return;let e=t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`),r=34;e.forEach(i=>{i.classList.remove("small-font-size-button"),i.querySelectorAll('[slot="cta"] sp-button, [slot="cta"] button, [slot="cta"] a.con-button, [slot="cta"] a.spectrum-Button, a[slot="cta"]').forEach(o=>{let c=o.textContent.trim().length>r;o.classList.toggle("small-font-size-button",c)})}),f.isDesktopOrUp&&e.forEach(i=>i.variantLayout?.syncHeights?.())}connectedCallbackHook(){!this.card||this.card.failed||(this.setupAccordion(),this.card?.hasAttribute("data-default-card")&&!nt()&&this.card.setAttribute("data-expanded","true"),this.observeVisibility())}resyncSiblings(){let t=this.getContainer();t&&t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`).forEach(e=>e.variantLayout?.syncHeights?.())}observeVisibility(){typeof ResizeObserver>"u"||(this.lastSyncedWidth=0,this.sizeObserver=new ResizeObserver(()=>{let t=this.card.getBoundingClientRect().width;t<=2||t===this.lastSyncedWidth||(this.lastSyncedWidth=t,this.resyncSiblings())}),this.sizeObserver.observe(this.card))}setupAccordion(){let t=this.card;if(!t)return;let e=()=>{if(nt())t.removeAttribute("data-expanded");else{let i=t.hasAttribute("data-default-card");t.setAttribute("data-expanded",i?"true":"false")}};e();let r=window.matchMedia(y);this.mediaQueryListener=()=>{e()},r.addEventListener("change",this.mediaQueryListener)}disconnectedCallbackHook(){this.mediaQueryListener&&window.matchMedia(y).removeEventListener("change",this.mediaQueryListener),this.sizeObserver?.disconnect(),this.sizeObserver=null}handleChevronClick(t){t.preventDefault(),t.stopPropagation(),this.toggleExpanded()}handleCardClick(t){t.target.closest('.chevron-button, mas-mnemonic, button, a, [role="button"]')||(t.preventDefault(),this.toggleExpanded())}toggleExpanded(){let t=this.card;if(!t||nt())return;let i=t.getAttribute("data-expanded")==="true"?"false":"true";t.setAttribute("data-expanded",i)}renderLayout(){return mi`
- `}};d(Le,"variantStyle",hi` + `}};d(Le,"variantStyle",gi` :host([variant='simplified-pricing-express']) { --merch-card-simplified-pricing-express-width: 365px; --merch-card-simplified-pricing-express-padding: 24px; @@ -6346,7 +6346,7 @@ merch-card[variant="simplified-pricing-express"] [slot="cta"] a.spectrum-Button. max-height: 1000px; } } - `);import{html as Xr,css as pi}from"./lit-all.min.js";var Qr=` + `);import{html as Zr,css as ui}from"./lit-all.min.js";var Xr=` :root { --merch-card-full-pricing-express-width: 378px; --merch-card-full-pricing-express-mobile-width: 365px; @@ -6948,14 +6948,14 @@ merch-card[variant="full-pricing-express"] mas-mnemonic { margin-bottom: 0; } } -`;var Ft={title:{tag:"h3",slot:"heading-xs",maxCount:250,withSuffix:!0},badge:{tag:"div",slot:"badge",default:"spectrum-blue-400"},allowedBadgeColors:["spectrum-blue-400","spectrum-gray-300","spectrum-yellow-300","gradient-purple-blue","gradient-firefly-spectrum"],description:{tag:"div",slot:"body-s",maxCount:2e3,withSuffix:!1},shortDescription:{tag:"div",slot:"short-description",maxCount:3e3,withSuffix:!1},callout:{tag:"div",slot:"callout-content",editorLabel:"Price description"},prices:{tag:"div",slot:"price"},trialBadge:{tag:"div",slot:"trial-badge"},ctas:{slot:"cta",size:"XL"},mnemonics:{size:"xs"},borderColor:{attribute:"border-color",specialValues:{gray:"var(--spectrum-gray-300)",blue:"var(--spectrum-blue-400)","gradient-purple-blue":"linear-gradient(96deg, #B539C8 0%, #7155FA 66%, #3B63FB 100%)","gradient-firefly-spectrum":"linear-gradient(96deg, #D73220 0%, #D92361 33%, #7155FA 100%)"}},showAllSpectrumColors:!0,multiWhatsIncluded:"true",disabledAttributes:[]},ze=class extends x{getGlobalCSS(){return Qr}get aemFragmentMapping(){return Ft}get headingSelector(){return'[slot="heading-xs"]'}get badgeElement(){return this.card.querySelector('[slot="badge"]')}get badge(){return Xr` +`;var $t={title:{tag:"h3",slot:"heading-xs",maxCount:250,withSuffix:!0},badge:{tag:"div",slot:"badge",default:"spectrum-blue-400"},allowedBadgeColors:["spectrum-blue-400","spectrum-gray-300","spectrum-yellow-300","gradient-purple-blue","gradient-firefly-spectrum"],description:{tag:"div",slot:"body-s",maxCount:2e3,withSuffix:!1},shortDescription:{tag:"div",slot:"short-description",maxCount:3e3,withSuffix:!1},callout:{tag:"div",slot:"callout-content",editorLabel:"Price description"},prices:{tag:"div",slot:"price"},trialBadge:{tag:"div",slot:"trial-badge"},ctas:{slot:"cta",size:"XL"},mnemonics:{size:"xs"},borderColor:{attribute:"border-color",specialValues:{gray:"var(--spectrum-gray-300)",blue:"var(--spectrum-blue-400)","gradient-purple-blue":"linear-gradient(96deg, #B539C8 0%, #7155FA 66%, #3B63FB 100%)","gradient-firefly-spectrum":"linear-gradient(96deg, #D73220 0%, #D92361 33%, #7155FA 100%)"}},showAllSpectrumColors:!0,multiWhatsIncluded:"true",disabledAttributes:[]},ze=class extends x{getGlobalCSS(){return Xr}get aemFragmentMapping(){return $t}get headingSelector(){return'[slot="heading-xs"]'}get badgeElement(){return this.card.querySelector('[slot="badge"]')}get badge(){return Zr`
- `}syncHeights(){if(this.card.getBoundingClientRect().width<=2)return;let t=this.card.shadowRoot;t&&["header","short-description","price-container","cta"].forEach(e=>this.updateCardElementMinHeight(t.querySelector(`.${e}`),e))}resyncSiblings(){let t=this.getContainer();t&&t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`).forEach(e=>e.variantLayout?.syncHeights?.())}async postCardUpdateHook(){if(!this.card.isConnected)return;await this.card.updateComplete,this.card.prices?.length&&await Promise.all(this.card.prices.map(e=>e.onceSettled()));let t=this.getContainer();if(t){let e=t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`),r=49;e.forEach(i=>{i.classList.remove("small-font-size-button"),i.querySelectorAll('[slot="cta"] sp-button, [slot="cta"] button, [slot="cta"] a.con-button, [slot="cta"] a.spectrum-Button, a[slot="cta"]').forEach(o=>{let c=o.textContent.trim().length>r;o.classList.toggle("small-font-size-button",c)})})}window.matchMedia("(min-width: 768px)").matches&&this.resyncSiblings()}connectedCallbackHook(){!this.card||typeof ResizeObserver>"u"||(this.lastSyncedWidth=0,this.sizeObserver=new ResizeObserver(()=>{let t=this.card.getBoundingClientRect().width;t<=2||t===this.lastSyncedWidth||(this.lastSyncedWidth=t,this.resyncSiblings())}),this.sizeObserver.observe(this.card))}disconnectedCallbackHook(){this.sizeObserver?.disconnect(),this.sizeObserver=null}renderLayout(){return Xr` + `}syncHeights(){if(this.card.getBoundingClientRect().width<=2)return;let t=this.card.shadowRoot;t&&["header","short-description","price-container","cta"].forEach(e=>this.updateCardElementMinHeight(t.querySelector(`.${e}`),e))}resyncSiblings(){let t=this.getContainer();t&&t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`).forEach(e=>e.variantLayout?.syncHeights?.())}async postCardUpdateHook(){if(!this.card.isConnected)return;await this.card.updateComplete,this.card.prices?.length&&await Promise.all(this.card.prices.map(e=>e.onceSettled()));let t=this.getContainer();if(t){let e=t.querySelectorAll(`merch-card[variant="${this.card.variant}"]`),r=49;e.forEach(i=>{i.classList.remove("small-font-size-button"),i.querySelectorAll('[slot="cta"] sp-button, [slot="cta"] button, [slot="cta"] a.con-button, [slot="cta"] a.spectrum-Button, a[slot="cta"]').forEach(o=>{let c=o.textContent.trim().length>r;o.classList.toggle("small-font-size-button",c)})})}window.matchMedia("(min-width: 768px)").matches&&this.resyncSiblings()}connectedCallbackHook(){!this.card||typeof ResizeObserver>"u"||(this.lastSyncedWidth=0,this.sizeObserver=new ResizeObserver(()=>{let t=this.card.getBoundingClientRect().width;t<=2||t===this.lastSyncedWidth||(this.lastSyncedWidth=t,this.resyncSiblings())}),this.sizeObserver.observe(this.card))}disconnectedCallbackHook(){this.sizeObserver?.disconnect(),this.sizeObserver=null}renderLayout(){return Zr` ${this.badge}
@@ -6980,7 +6980,7 @@ merch-card[variant="full-pricing-express"] mas-mnemonic {
- `}};d(ze,"variantStyle",pi` + `}};d(ze,"variantStyle",ui` :host([variant='full-pricing-express']) { /* CSS Variables */ --merch-card-full-pricing-express-width: 437px; @@ -7304,16 +7304,16 @@ merch-card[variant="full-pricing-express"] mas-mnemonic { ); } } - `);import{html as It,css as mi,nothing as gi}from"./lit-all.min.js";var Zr=` + `);import{html as Bt,css as fi,nothing as vi}from"./lit-all.min.js";var Jr=` /* Headless variant: minimal container for label/value rows */ .headless { display: flex; flex-direction: column; padding: var(--consonant-merch-spacing-xs, 8px); } -`;var Jr={cardName:{attribute:"name"},title:{tag:"p",slot:"heading-xs"},cardTitle:{tag:"p",slot:"heading-xs"},subtitle:{tag:"p",slot:"body-xxs"},description:{tag:"div",slot:"body-xs"},promoText:{tag:"p",slot:"promo-text"},shortDescription:{tag:"p",slot:"short-description"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},whatsIncluded:{tag:"div",slot:"whats-included"},addonConfirmation:{tag:"div",slot:"addon-confirmation"},badge:{tag:"div",slot:"badge"},trialBadge:{tag:"div",slot:"trial-badge"},prices:{tag:"p",slot:"prices"},backgroundImage:{tag:"div",slot:"bg-image"},ctas:{slot:"footer",size:"m"},addon:!0,secureLabel:!0,borderColor:{attribute:"border-color"},backgroundColor:{attribute:"background-color"},size:[],mnemonics:{size:"m"}},ui=[{slot:"bg-image",label:"Background Image"},{slot:"badge",label:"Badge"},{slot:"icons",label:"Mnemonic icon"},{slot:"heading-xs",label:"Title"},{slot:"body-xxs",label:"Subtitle"},{slot:"body-xs",label:"Product description"},{slot:"promo-text",label:"Promo Text"},{slot:"callout-content",label:"Callout text"},{slot:"short-description",label:"Short Description"},{slot:"trial-badge",label:"Trial Badge"},{slot:"prices",label:"Product price"},{slot:"quantity-select",label:"Quantity select"},{slot:"addon",label:"Addon"},{slot:"whats-included",label:"What's included"},{slot:"addon-confirmation",label:"Addon confirmation"},{slot:"footer",label:"CTAs"}],Pe=class extends x{constructor(t){super(t)}getGlobalCSS(){return Zr}renderLayout(){return It` +`;var ea={cardName:{attribute:"name"},title:{tag:"p",slot:"heading-xs"},cardTitle:{tag:"p",slot:"heading-xs"},subtitle:{tag:"p",slot:"body-xxs"},description:{tag:"div",slot:"body-xs"},promoText:{tag:"p",slot:"promo-text"},shortDescription:{tag:"p",slot:"short-description"},callout:{tag:"div",slot:"callout-content"},quantitySelect:{tag:"div",slot:"quantity-select"},whatsIncluded:{tag:"div",slot:"whats-included"},addonConfirmation:{tag:"div",slot:"addon-confirmation"},badge:{tag:"div",slot:"badge"},trialBadge:{tag:"div",slot:"trial-badge"},prices:{tag:"p",slot:"prices"},backgroundImage:{tag:"div",slot:"bg-image"},ctas:{slot:"footer",size:"m"},addon:!0,secureLabel:!0,borderColor:{attribute:"border-color"},backgroundColor:{attribute:"background-color"},size:[],mnemonics:{size:"m"}},xi=[{slot:"bg-image",label:"Background Image"},{slot:"badge",label:"Badge"},{slot:"icons",label:"Mnemonic icon"},{slot:"heading-xs",label:"Title"},{slot:"body-xxs",label:"Subtitle"},{slot:"body-xs",label:"Product description"},{slot:"promo-text",label:"Promo Text"},{slot:"callout-content",label:"Callout text"},{slot:"short-description",label:"Short Description"},{slot:"trial-badge",label:"Trial Badge"},{slot:"prices",label:"Product price"},{slot:"quantity-select",label:"Quantity select"},{slot:"addon",label:"Addon"},{slot:"whats-included",label:"What's included"},{slot:"addon-confirmation",label:"Addon confirmation"},{slot:"footer",label:"CTAs"}],Pe=class extends x{constructor(t){super(t)}getGlobalCSS(){return Jr}renderLayout(){return Bt`
- ${ui.map(({slot:t,label:e})=>It` + ${xi.map(({slot:t,label:e})=>Bt`
${e} @@ -7321,16 +7321,16 @@ merch-card[variant="full-pricing-express"] mas-mnemonic {
`)} - ${this.card.secureLabel?It` + ${this.card.secureLabel?Bt`
Secure label ${this.secureLabel}
- `:gi} + `:vi}
- `}};d(Pe,"variantStyle",mi` + `}};d(Pe,"variantStyle",fi` :host([variant='headless']) { border: none; background: transparent; @@ -7357,7 +7357,7 @@ merch-card[variant="full-pricing-express"] mas-mnemonic { :host([variant='headless']) .headless-value::slotted(*) { display: inline; } - `);import{css as fi,html as vi}from"./lit-all.min.js";var ea=` + `);import{css as bi,html as yi}from"./lit-all.min.js";var ta=` merch-card[variant="mini"] { color: var(--spectrum-body-color); width: 400px; @@ -7390,7 +7390,7 @@ merch-card[variant="mini"] span.promo-duration-text, merch-card[variant="mini"] span.renewal-text { display: block; } -`;var ta={title:{tag:"p",slot:"title"},prices:{tag:"p",slot:"prices"},description:{tag:"p",slot:"description"},planType:!0,ctas:{slot:"ctas",size:"S"}},_e=class extends x{constructor(){super(...arguments);d(this,"legal")}async postCardUpdateHook(){await this.card.updateComplete,this.adjustLegal()}getGlobalCSS(){return ea}get headingSelector(){return'[slot="title"]'}priceOptionsProvider(e,r){r.literals={...r.literals,strikethroughAriaLabel:"",alternativePriceAriaLabel:""},r.space=!0,r.displayAnnual=this.card.settings?.displayAnnual??!1}adjustLegal(){if(this.legal!==void 0)return;let e=this.card.querySelector(`${b}[data-template="price"]`);if(!e)return;let r=e.cloneNode(!0);this.legal=r,e.dataset.displayTax="false",e.dataset.displayPerUnit="false",r.dataset.template="legal",r.dataset.displayPlanType=this.card?.settings?.displayPlanType??!0,r.setAttribute("slot","legal"),this.card.appendChild(r)}renderLayout(){return vi` +`;var ra={title:{tag:"p",slot:"title"},prices:{tag:"p",slot:"prices"},description:{tag:"p",slot:"description"},planType:!0,ctas:{slot:"ctas",size:"S"}},_e=class extends x{constructor(){super(...arguments);d(this,"legal")}async postCardUpdateHook(){await this.card.updateComplete,this.adjustLegal()}getGlobalCSS(){return ta}get headingSelector(){return'[slot="title"]'}priceOptionsProvider(e,r){r.literals={...r.literals,strikethroughAriaLabel:"",alternativePriceAriaLabel:""},r.space=!0,r.displayAnnual=this.card.settings?.displayAnnual??!1}adjustLegal(){if(this.legal!==void 0)return;let e=this.card.querySelector(`${b}[data-template="price"]`);if(!e)return;let r=e.cloneNode(!0);this.legal=r,e.dataset.displayTax="false",e.dataset.displayPerUnit="false",r.dataset.template="legal",r.dataset.displayPlanType=this.card?.settings?.displayPlanType??!0,r.setAttribute("slot","legal"),this.card.appendChild(r)}renderLayout(){return yi` ${this.badge}
@@ -7399,14 +7399,14 @@ merch-card[variant="mini"] span.renewal-text {
- `}};d(_e,"variantStyle",fi` + `}};d(_e,"variantStyle",bi` :host([variant='mini']) { min-width: 209px; min-height: 103px; background-color: var(--spectrum-background-base-color); border: 1px solid var(--consonant-merch-card-border-color, #dadada); } - `);var xt=new Map,ra=new WeakMap,aa=new Map,k=(a,t,e=null,r=null,i)=>{xt.set(a,{class:t,fragmentMapping:e,style:r,collectionOptions:i})};k("catalog",we,Sr,we.variantStyle);k("image",ne);k("inline-heading",mt);k("mini-compare-chart",Ee,_r,Ee.variantStyle);k("mini-compare-chart-mweb",ke,Or,ke.variantStyle);k("plans",_,ft,_.variantStyle,_.collectionOptions);k("plans-students",_,Fr,_.variantStyle,_.collectionOptions);k("plans-education",_,Dr,_.variantStyle,_.collectionOptions);k("plans-v2",X,Br,X.variantStyle,X.collectionOptions);k("product",Se,Hr,Se.variantStyle);k("segment",Ce,jr,Ce.variantStyle);k("media",Ae,Vr,Ae.variantStyle);k("headless",Pe,Jr,Pe.variantStyle);k("special-offers",Te,Kr,Te.variantStyle);k("simplified-pricing-express",Le,Dt,Le.variantStyle);k("full-pricing-express",ze,Ft,ze.variantStyle);k("mini",_e,ta,_e.variantStyle);k("image",ne,Ar,ne.variantStyle);var xi=(a,t,e)=>{try{let r=aa.get(a.variant);if(r||(r=new CSSStyleSheet,r.replaceSync(t.cssText),aa.set(a.variant,r)),e?.styleSheet&&e.styleSheet!==r){let i=a.shadowRoot.adoptedStyleSheets.indexOf(e.styleSheet);i!==-1&&a.shadowRoot.adoptedStyleSheets.splice(i,1)}return a.shadowRoot.adoptedStyleSheets.includes(r)||a.shadowRoot.adoptedStyleSheets.push(r),{styleSheet:r}}catch{let i=document.createElement("style");i.textContent=t.cssText,i.setAttribute("data-variant-style",a.variant);let n=e?.styleElement||a.shadowRoot.querySelector("[data-variant-style]");return n&&n.remove(),a.shadowRoot.appendChild(i),{styleElement:i}}},$t=a=>{let t=xt.get(a.variant);if(!t)return;let{class:e,style:r}=t,i=ra.get(a);if(i?.appliedVariant===a.variant)return new e(a);let n=r?xi(a,r,i):{};return ra.set(a,{appliedVariant:a.variant,...n}),new e(a)};function pt(a){return xt.get(a)?.fragmentMapping}function ia(a){return xt.get(a)?.collectionOptions}var na=document.createElement("style");na.innerHTML=` + `);var bt=new Map,aa=new WeakMap,ia=new Map,k=(a,t,e=null,r=null,i)=>{bt.set(a,{class:t,fragmentMapping:e,style:r,collectionOptions:i})};k("catalog",we,Sr,we.variantStyle);k("image",ne);k("inline-heading",gt);k("mini-compare-chart",Ee,Mr,Ee.variantStyle);k("mini-compare-chart-mweb",ke,Nr,ke.variantStyle);k("plans",_,vt,_.variantStyle,_.collectionOptions);k("plans-students",_,Ir,_.variantStyle,_.collectionOptions);k("plans-education",_,Fr,_.variantStyle,_.collectionOptions);k("plans-v2",X,qr,X.variantStyle,X.collectionOptions);k("product",Ce,Ur,Ce.variantStyle);k("segment",Se,jr,Se.variantStyle);k("media",Ae,Wr,Ae.variantStyle);k("headless",Pe,ea,Pe.variantStyle);k("special-offers",Te,Yr,Te.variantStyle);k("simplified-pricing-express",Le,It,Le.variantStyle);k("full-pricing-express",ze,$t,ze.variantStyle);k("mini",_e,ra,_e.variantStyle);k("image",ne,Tr,ne.variantStyle);var wi=(a,t,e)=>{try{let r=ia.get(a.variant);if(r||(r=new CSSStyleSheet,r.replaceSync(t.cssText),ia.set(a.variant,r)),e?.styleSheet&&e.styleSheet!==r){let i=a.shadowRoot.adoptedStyleSheets.indexOf(e.styleSheet);i!==-1&&a.shadowRoot.adoptedStyleSheets.splice(i,1)}return a.shadowRoot.adoptedStyleSheets.includes(r)||a.shadowRoot.adoptedStyleSheets.push(r),{styleSheet:r}}catch{let i=document.createElement("style");i.textContent=t.cssText,i.setAttribute("data-variant-style",a.variant);let n=e?.styleElement||a.shadowRoot.querySelector("[data-variant-style]");return n&&n.remove(),a.shadowRoot.appendChild(i),{styleElement:i}}},qt=a=>{let t=bt.get(a.variant);if(!t)return;let{class:e,style:r}=t,i=aa.get(a);if(i?.appliedVariant===a.variant)return new e(a);let n=r?wi(a,r,i):{};return aa.set(a,{appliedVariant:a.variant,...n}),new e(a)};function mt(a){return bt.get(a)?.fragmentMapping}function na(a){return bt.get(a)?.collectionOptions}var oa=document.createElement("style");oa.innerHTML=` :root { --consonant-merch-card-detail-font-size: 12px; --consonant-merch-card-detail-font-weight: 500; @@ -8225,7 +8225,7 @@ merch-card[border-color="spectrum-red-700-plans"] { } } -@media screen and ${C} { +@media screen and ${S} { merch-card [slot='callout-content'] .icon-button::before { top: unset; left: unset; @@ -8293,10 +8293,10 @@ merch-card[border-color="spectrum-red-700-plans"] { } } -`;document.head.appendChild(na);function bt(a,t={},{metadata:e=!0,search:r=!0,storage:i=!0}={}){let n;if(r&&n==null){let o=new URLSearchParams(window.location.search),c=Bt(r)?r:a;n=o.get(c)}if(i&&n==null){let o=Bt(i)?i:a;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(e&&n==null){let o=yi(Bt(e)?e:a);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[a]}var bi=a=>typeof a=="boolean",yt=a=>typeof a=="function";var Bt=a=>typeof a=="string";function oa(a,t){if(bi(a))return a;let e=String(a);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:t}function yi(a=""){return String(a).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,e,r)=>`${e}-${r}`).replace(/\W+/gu,"-").toLowerCase()}var Z=class a extends Error{constructor(t,e,r){if(super(t,{cause:r}),this.name="MasError",e.response){let i=e.response.headers?.get(ct);i&&(e.requestId=i),e.response.status&&(e.status=e.response.status,e.statusText=e.response.statusText),e.response.url&&(e.url=e.response.url)}delete e.response,this.context=e,Error.captureStackTrace&&Error.captureStackTrace(this,a)}toString(){let t=Object.entries(this.context||{}).map(([r,i])=>`${r}: ${JSON.stringify(i)}`).join(", "),e=`${this.name}: ${this.message}`;return t&&(e+=` (${t})`),this.cause&&(e+=` -Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},ca=1e3;function wi(a){return a instanceof Error||typeof a?.originatingRequest=="string"}function sa(a){if(a==null)return;let t=typeof a;if(t==="function")return a.name?`function ${a.name}`:"function";if(t==="object"){if(a instanceof Error)return a.message;if(typeof a.originatingRequest=="string"){let{message:r,originatingRequest:i,status:n}=a;return[r,n,i].filter(Boolean).join(" ")}let e=a[Symbol.toStringTag]??Object.getPrototypeOf(a).constructor.name;if(!oe.serializableTypes.includes(e))return e}return a}function Ei(a,t){if(!oe.ignoredProperties.includes(a))return sa(t)}var qt={append(a){if(a.level!=="error")return;let{message:t,params:e}=a,r=[],i=[],n=t;e.forEach(p=>{p!=null&&(wi(p)?r:i).push(p)}),r.length&&(n+=" "+r.map(sa).join(" "));let{pathname:o,search:c}=window.location,l=`${oe.delimiter}page=${o}${c}`;l.length>ca&&(l=`${l.slice(0,ca)}`),n+=l,i.length&&(n+=`${oe.delimiter}facts=`,n+=JSON.stringify(i,Ei)),window.lana?.log(n,oe)}};function la(a){Object.assign(oe,Object.fromEntries(Object.entries(a).filter(([t,e])=>t in oe&&e!==""&&e!==null&&e!==void 0&&!Number.isNaN(e))))}var da={LOCAL:"local",PROD:"prod",STAGE:"stage"},Ht={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},Ut=new Set,jt=new Set,ha=new Map,pa={append({level:a,message:t,params:e,timestamp:r,source:i}){console[a](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...e)}},ma={filter:({level:a})=>a!==Ht.DEBUG},ki={filter:()=>!1};function Si(a,t,e,r,i){return{level:a,message:t,namespace:e,get params(){return r.length===1&&yt(r[0])&&(r=r[0](),Array.isArray(r)||(r=[r])),r},source:i,timestamp:performance.now().toFixed(3)}}function Ci(a){[...jt].every(t=>t(a))&&Ut.forEach(t=>t(a))}function ga(a){let t=(ha.get(a)??0)+1;ha.set(a,t);let e=`${a} #${t}`,r={id:e,namespace:a,module:i=>ga(`${r.namespace}/${i}`),updateConfig:la};return Object.values(Ht).forEach(i=>{r[i]=(n,...o)=>Ci(Si(i,n,a,o,e))}),Object.seal(r)}function wt(...a){a.forEach(t=>{let{append:e,filter:r}=t;yt(r)&&jt.add(r),yt(e)&&Ut.add(e)})}function Ai(a={}){let{name:t}=a,e=oa(bt("commerce.debug",{search:!0,storage:!0}),t===da.LOCAL);return wt(e?pa:ma),t===da.PROD&&wt(qt),Ke}function Ti(){Ut.clear(),jt.clear()}var Ke={...ga(yr),Level:Ht,Plugins:{consoleAppender:pa,debugFilter:ma,quietFilter:ki,lanaAppender:qt},init:Ai,reset:Ti,use:wt};var Li="mas-commerce-service",Hs=Ke.module("utilities"),zi={requestId:ct,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};var Et=a=>window.setTimeout(a);function Gt(){return document.getElementsByTagName(Li)?.[0]}function ua(a){let t={};if(!a?.headers)return t;let e=a.headers;for(let[r,i]of Object.entries(zi)){let n=e.get(i);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[r]=n)}return t}async function fa(a,t={},e=2,r=100){let i;for(let n=0;n<=e;n++)try{let o=await fetch(a,t);return o.retryCount=n,o}catch(o){if(i=o,i.retryCount=n,n>e)break;await new Promise(c=>setTimeout(c,r*(n+1)))}throw i}var va="fragment",xa="author",ba="preview",ya="loading",wa="timeout",Vt="aem-fragment",Ea="eager",ka="cache",Pi=[Ea,ka],U,ce,$,Wt=class{constructor(){g(this,U,new Map);g(this,ce,new Map);g(this,$,new Map)}clear(){s(this,U).clear(),s(this,ce).clear(),s(this,$).clear()}add(t,e=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(s(this,U).set(t.id,t),t.fields?.originalId&&s(this,U).set(t.fields.originalId,t),s(this,$).has(t.id)){let[,r]=s(this,$).get(t.id);r()}if(s(this,$).has(t.fields?.originalId)){let[,r]=s(this,$).get(t.fields?.originalId);r()}if(!(!e||typeof t.references!="object"||Array.isArray(t.references)))for(let r in t.references){let{type:i,value:n}=t.references[r];i==="content-fragment"&&(n.settings={...t?.settings,...n.settings},n.placeholders={...t?.placeholders,...n.placeholders},n.dictionary={...t?.dictionary,...n.dictionary},n.priceLiterals={...t?.priceLiterals,...n.priceLiterals},this.add(n,t))}}}has(t){return s(this,U).has(t)}entries(){return s(this,U).entries()}get(t){return s(this,U).get(t)}getAsPromise(t){let[e]=s(this,$).get(t)??[];if(e)return e;let r;return e=new Promise(i=>{r=i,this.has(t)&&i()}),s(this,$).set(t,[e,r]),e}getFetchInfo(t){let e=s(this,ce).get(t);return e||(e={url:null,retryCount:0,stale:!1,measure:null,status:null},s(this,ce).set(t,e)),e}remove(t){s(this,U).delete(t),s(this,ce).delete(t),s(this,$).delete(t)}};U=new WeakMap,ce=new WeakMap,$=new WeakMap;var J=new Wt,Me,B,V,D,M,S,Ye,Qe,q,Xe,Ze,Re,H,Sa,Ca,Kt,Aa,kt=class extends HTMLElement{constructor(){super(...arguments);g(this,H);d(this,"cache",J);g(this,Me);g(this,B,null);g(this,V,null);g(this,D,null);g(this,M);g(this,S);g(this,Ye,Ea);g(this,Qe,5e3);g(this,q);g(this,Xe,!1);g(this,Ze,0);g(this,Re)}static get observedAttributes(){return[va,ya,wa,xa,ba]}attributeChangedCallback(e,r,i){e===va&&(m(this,M,i),m(this,S,J.getFetchInfo(i))),e===ya&&Pi.includes(i)&&m(this,Ye,i),e===wa&&m(this,Qe,parseInt(i,10)),e===xa&&m(this,Xe,["","true"].includes(i)),e===ba&&m(this,Re,i)}connectedCallback(){if(!s(this,q)){if(s(this,D)??m(this,D,ae(this)),m(this,Re,s(this,D).settings?.preview),s(this,Me)??m(this,Me,s(this,D).log.module(`${Vt}[${s(this,M)}]`)),!s(this,M)||s(this,M)==="#"){s(this,S)??m(this,S,J.getFetchInfo("missing-fragment-id")),z(this,H,Kt).call(this,"Missing fragment id");return}this.refresh(!1)}}get fetchInfo(){return Object.fromEntries(Object.entries(s(this,S)).filter(([e,r])=>r!=null).map(([e,r])=>[`aem-fragment:${e}`,r]))}async refresh(e=!0){if(s(this,q)&&!await Promise.race([s(this,q),Promise.resolve(!1)]))return;e&&J.remove(s(this,M)),s(this,Ye)===ka&&await Promise.race([J.getAsPromise(s(this,M)),new Promise(c=>setTimeout(c,s(this,Qe)))]);try{m(this,q,z(this,H,Aa).call(this)),await s(this,q)}catch(c){return z(this,H,Kt).call(this,c.message),!1}let{references:r,referencesTree:i,placeholders:n,wcs:o}=s(this,B)||{};return o&&!bt("mas.disableWcsCache")&&s(this,D).prefillWcsCache(o),this.dispatchEvent(new CustomEvent(ue,{detail:{...this.data,references:r,referencesTree:i,placeholders:n,...s(this,S)},bubbles:!0,composed:!0})),s(this,q)}get updateComplete(){return s(this,q)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return s(this,V)?s(this,V):(s(this,Xe)?this.transformAuthorData():this.transformPublishData(),s(this,V))}get rawData(){return s(this,B)}transformAuthorData(){let{fields:e,id:r,tags:i,variationId:n,settings:o={},priceLiterals:c={},dictionary:l={},placeholders:p={}}=s(this,B);m(this,V,e.reduce((h,{name:v,multiple:A,values:R})=>(h.fields[v]=A?R:R[0],h),{fields:{},id:r,tags:i,settings:o,priceLiterals:c,dictionary:l,placeholders:p,variationId:n}))}transformPublishData(){let{fields:e,id:r,tags:i,settings:n={},priceLiterals:o={},dictionary:c={},placeholders:l={},variationId:p}=s(this,B);m(this,V,Object.entries(e).reduce((h,[v,A])=>(h.fields[v]=A?.mimeType?A.value:A??"",h),{fields:{},id:r,tags:i,settings:n,priceLiterals:o,dictionary:c,placeholders:l,variationId:p}))}getFragmentClientUrl(){let r=new URLSearchParams(window.location.search).get("maslibs");if(!r||r.trim()==="")return"https://mas.adobe.com/studio/libs/fragment-client.js";let i=r.trim().toLowerCase();if(i==="local")return"http://localhost:3000/studio/libs/fragment-client.js";let{hostname:n}=window.location,o=n.endsWith(".page")?"page":"live";return i.includes("--")?`https://${i}.aem.${o}/studio/libs/fragment-client.js`:`https://${i}--mas--adobecom.aem.${o}/studio/libs/fragment-client.js`}async generatePreview(){let e=this.getFragmentClientUrl(),{previewFragment:r}=await import(e);return await r(s(this,M),{locale:s(this,D).settings.locale,apiKey:s(this,D).settings.wcsApiKey,fullContext:!0})}};Me=new WeakMap,B=new WeakMap,V=new WeakMap,D=new WeakMap,M=new WeakMap,S=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,q=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,Re=new WeakMap,H=new WeakSet,Sa=async function(e){ir(this,Ze)._++;let r=`${Vt}:${s(this,M)}:${s(this,Ze)}`,i=`${r}${st}`,n=`${r}${lt}`;if(s(this,Re)){let c=await this.generatePreview();if(c.status===200)return c.body;throw new Z(`Failed to generate preview: ${c.message}`,{})}performance.mark(i);let o;try{if(s(this,S).stale=!1,s(this,S).url=e,o=await fa(e,{cache:"default",credentials:"omit"}),z(this,H,Ca).call(this,o),s(this,S).status=o?.status,s(this,S).measure=ve(performance.measure(n,i)),s(this,S).retryCount=o.retryCount,!o?.ok)throw new Z("Unexpected fragment response",{response:o,...s(this,D).duration});return await o.json()}catch(c){if(s(this,S).measure=ve(performance.measure(n,i)),s(this,S).retryCount=c.retryCount,s(this,B))return s(this,S).stale=!0,s(this,Me).error("Serving stale data",s(this,S)),s(this,B);let l=c.message??"unknown";throw new Z(`Failed to fetch fragment: ${l}`,{})}},Ca=function(e){Object.assign(s(this,S),ua(e))},Kt=function(e){m(this,q,null),s(this,S).message=e,this.classList.add("error");let r={...s(this,S),...s(this,D).duration};s(this,Me).error(e,r),this.dispatchEvent(new CustomEvent(fe,{detail:r,bubbles:!0,composed:!0}))},Aa=async function(){var l;this.classList.remove("error"),m(this,V,null);let e=J.get(s(this,M));if(e)return m(this,B,e),!0;let{masIOUrl:r,wcsApiKey:i,country:n,locale:o}=s(this,D).settings,c=`${r}/fragment?id=${s(this,M)}&api_key=${i}&locale=${o}`;return n&&!o.endsWith(`_${n}`)&&(c+=`&country=${n}`),e=await z(this,H,Sa).call(this,c),(l=e.fields).originalId??(l.originalId=s(this,M)),J.add(e),m(this,B,e),!0},d(kt,"cache",J);customElements.define(Vt,kt);import{LitElement as _i,html as Yt,css as Mi,nothing as Ri}from"./lit-all.min.js";import{unsafeHTML as Oi}from"./lit-all.min.js";var Ni=a=>a?a.startsWith("sp-icon-")?Yt`${Oi(`<${a} class="badge-icon">`)}`:Yt``:Ri,Oe=class extends _i{constructor(){super(),this.color="",this.variant="",this.backgroundColor="",this.borderColor="",this.text=this.textContent,this.icon=""}connectedCallback(){this.borderColor&&this.borderColor!=="transparent"?this.style.setProperty("--merch-badge-border",`1px solid var(--${this.borderColor})`):this.backgroundColor.startsWith("gradient-")||this.style.setProperty("--merch-badge-border",`1px solid var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-background-color",`var(--${this.backgroundColor})`),(!this.borderColor||this.borderColor==="transparent")&&this.backgroundColor.startsWith("gradient-")?this.style.setProperty("--merch-badge-padding","3px 11px 4px 11px"):this.style.setProperty("--merch-badge-padding","2px 10px 3px 10px"),this.style.setProperty("--merch-badge-color",this.color),this.style.setProperty("--merch-badge-font-size","var(--consonant-merch-card-body-xs-font-size)"),this.querySelector('span[is="inline-price"]')||(this.textContent="");let t=this.closest("merch-card"),e=t?.getAttribute("size"),r=t?.querySelectorAll(":scope > merch-icon").length||0;this.style.setProperty("--merch-badge-offset",r),this.style.setProperty("--merch-badge-with-offset",r?1:0),this.style.setProperty("--merch-badge-card-size",e?2:1),super.connectedCallback()}render(){return Yt`
- ${Ni(this.icon)}${this.text} -
`}};d(Oe,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"},icon:{type:String}}),d(Oe,"styles",Mi` +`;document.head.appendChild(oa);function yt(a,t={},{metadata:e=!0,search:r=!0,storage:i=!0}={}){let n;if(r&&n==null){let o=new URLSearchParams(window.location.search),c=Ht(r)?r:a;n=o.get(c)}if(i&&n==null){let o=Ht(i)?i:a;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(e&&n==null){let o=ki(Ht(e)?e:a);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[a]}var Ei=a=>typeof a=="boolean",wt=a=>typeof a=="function";var Ht=a=>typeof a=="string";function ca(a,t){if(Ei(a))return a;let e=String(a);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:t}function ki(a=""){return String(a).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,e,r)=>`${e}-${r}`).replace(/\W+/gu,"-").toLowerCase()}var Z=class a extends Error{constructor(t,e,r){if(super(t,{cause:r}),this.name="MasError",e.response){let i=e.response.headers?.get(st);i&&(e.requestId=i),e.response.status&&(e.status=e.response.status,e.statusText=e.response.statusText),e.response.url&&(e.url=e.response.url)}delete e.response,this.context=e,Error.captureStackTrace&&Error.captureStackTrace(this,a)}toString(){let t=Object.entries(this.context||{}).map(([r,i])=>`${r}: ${JSON.stringify(i)}`).join(", "),e=`${this.name}: ${this.message}`;return t&&(e+=` (${t})`),this.cause&&(e+=` +Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},sa=1e3;function Ci(a){return a instanceof Error||typeof a?.originatingRequest=="string"}function la(a){if(a==null)return;let t=typeof a;if(t==="function")return a.name?`function ${a.name}`:"function";if(t==="object"){if(a instanceof Error)return a.message;if(typeof a.originatingRequest=="string"){let{message:r,originatingRequest:i,status:n}=a;return[r,n,i].filter(Boolean).join(" ")}let e=a[Symbol.toStringTag]??Object.getPrototypeOf(a).constructor.name;if(!oe.serializableTypes.includes(e))return e}return a}function Si(a,t){if(!oe.ignoredProperties.includes(a))return la(t)}var Ut={append(a){if(a.level!=="error")return;let{message:t,params:e}=a,r=[],i=[],n=t;e.forEach(p=>{p!=null&&(Ci(p)?r:i).push(p)}),r.length&&(n+=" "+r.map(la).join(" "));let{pathname:o,search:c}=window.location,l=`${oe.delimiter}page=${o}${c}`;l.length>sa&&(l=`${l.slice(0,sa)}`),n+=l,i.length&&(n+=`${oe.delimiter}facts=`,n+=JSON.stringify(i,Si)),window.lana?.log(n,oe)}};function da(a){Object.assign(oe,Object.fromEntries(Object.entries(a).filter(([t,e])=>t in oe&&e!==""&&e!==null&&e!==void 0&&!Number.isNaN(e))))}var ha={LOCAL:"local",PROD:"prod",STAGE:"stage"},Gt={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},jt=new Set,Vt=new Set,pa=new Map,ma={append({level:a,message:t,params:e,timestamp:r,source:i}){console[a](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...e)}},ga={filter:({level:a})=>a!==Gt.DEBUG},Ai={filter:()=>!1};function Ti(a,t,e,r,i){return{level:a,message:t,namespace:e,get params(){return r.length===1&&wt(r[0])&&(r=r[0](),Array.isArray(r)||(r=[r])),r},source:i,timestamp:performance.now().toFixed(3)}}function Li(a){[...Vt].every(t=>t(a))&&jt.forEach(t=>t(a))}function ua(a){let t=(pa.get(a)??0)+1;pa.set(a,t);let e=`${a} #${t}`,r={id:e,namespace:a,module:i=>ua(`${r.namespace}/${i}`),updateConfig:da};return Object.values(Gt).forEach(i=>{r[i]=(n,...o)=>Li(Ti(i,n,a,o,e))}),Object.seal(r)}function Et(...a){a.forEach(t=>{let{append:e,filter:r}=t;wt(r)&&Vt.add(r),wt(e)&&jt.add(e)})}function zi(a={}){let{name:t}=a,e=ca(yt("commerce.debug",{search:!0,storage:!0}),t===ha.LOCAL);return Et(e?ma:ga),t===ha.PROD&&Et(Ut),Ke}function Pi(){jt.clear(),Vt.clear()}var Ke={...ua(wr),Level:Gt,Plugins:{consoleAppender:ma,debugFilter:ga,quietFilter:Ai,lanaAppender:Ut},init:zi,reset:Pi,use:Et};var _i="mas-commerce-service",js=Ke.module("utilities"),Mi={requestId:st,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};var kt=a=>window.setTimeout(a);function Wt(){return document.getElementsByTagName(_i)?.[0]}function fa(a){let t={};if(!a?.headers)return t;let e=a.headers;for(let[r,i]of Object.entries(Mi)){let n=e.get(i);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[r]=n)}return t}async function va(a,t={},e=2,r=100){let i;for(let n=0;n<=e;n++)try{let o=await fetch(a,t);return o.retryCount=n,o}catch(o){if(i=o,i.retryCount=n,n>e)break;await new Promise(c=>setTimeout(c,r*(n+1)))}throw i}var xa="fragment",ba="author",ya="preview",wa="loading",Ea="timeout",Kt="aem-fragment",ka="eager",Ca="cache",Ri=[ka,Ca],U,ce,$,Yt=class{constructor(){g(this,U,new Map);g(this,ce,new Map);g(this,$,new Map)}clear(){s(this,U).clear(),s(this,ce).clear(),s(this,$).clear()}add(t,e=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(s(this,U).set(t.id,t),t.fields?.originalId&&s(this,U).set(t.fields.originalId,t),s(this,$).has(t.id)){let[,r]=s(this,$).get(t.id);r()}if(s(this,$).has(t.fields?.originalId)){let[,r]=s(this,$).get(t.fields?.originalId);r()}if(!(!e||typeof t.references!="object"||Array.isArray(t.references)))for(let r in t.references){let{type:i,value:n}=t.references[r];i==="content-fragment"&&(n.settings={...t?.settings,...n.settings},n.placeholders={...t?.placeholders,...n.placeholders},n.dictionary={...t?.dictionary,...n.dictionary},n.priceLiterals={...t?.priceLiterals,...n.priceLiterals},this.add(n,t))}}}has(t){return s(this,U).has(t)}entries(){return s(this,U).entries()}get(t){return s(this,U).get(t)}getAsPromise(t){let[e]=s(this,$).get(t)??[];if(e)return e;let r;return e=new Promise(i=>{r=i,this.has(t)&&i()}),s(this,$).set(t,[e,r]),e}getFetchInfo(t){let e=s(this,ce).get(t);return e||(e={url:null,retryCount:0,stale:!1,measure:null,status:null},s(this,ce).set(t,e)),e}remove(t){s(this,U).delete(t),s(this,ce).delete(t),s(this,$).delete(t)}};U=new WeakMap,ce=new WeakMap,$=new WeakMap;var J=new Yt,Me,B,V,D,M,C,Ye,Qe,q,Xe,Ze,Re,H,Sa,Aa,Qt,Ta,Ct=class extends HTMLElement{constructor(){super(...arguments);g(this,H);d(this,"cache",J);g(this,Me);g(this,B,null);g(this,V,null);g(this,D,null);g(this,M);g(this,C);g(this,Ye,ka);g(this,Qe,5e3);g(this,q);g(this,Xe,!1);g(this,Ze,0);g(this,Re)}static get observedAttributes(){return[xa,wa,Ea,ba,ya]}attributeChangedCallback(e,r,i){e===xa&&(m(this,M,i),m(this,C,J.getFetchInfo(i))),e===wa&&Ri.includes(i)&&m(this,Ye,i),e===Ea&&m(this,Qe,parseInt(i,10)),e===ba&&m(this,Xe,["","true"].includes(i)),e===ya&&m(this,Re,i)}connectedCallback(){if(!s(this,q)){if(s(this,D)??m(this,D,ae(this)),m(this,Re,s(this,D).settings?.preview),s(this,Me)??m(this,Me,s(this,D).log.module(`${Kt}[${s(this,M)}]`)),!s(this,M)||s(this,M)==="#"){s(this,C)??m(this,C,J.getFetchInfo("missing-fragment-id")),z(this,H,Qt).call(this,"Missing fragment id");return}this.refresh(!1)}}get fetchInfo(){return Object.fromEntries(Object.entries(s(this,C)).filter(([e,r])=>r!=null).map(([e,r])=>[`aem-fragment:${e}`,r]))}async refresh(e=!0){if(s(this,q)&&!await Promise.race([s(this,q),Promise.resolve(!1)]))return;e&&J.remove(s(this,M)),s(this,Ye)===Ca&&await Promise.race([J.getAsPromise(s(this,M)),new Promise(c=>setTimeout(c,s(this,Qe)))]);try{m(this,q,z(this,H,Ta).call(this)),await s(this,q)}catch(c){return z(this,H,Qt).call(this,c.message),!1}let{references:r,referencesTree:i,placeholders:n,wcs:o}=s(this,B)||{};return o&&!yt("mas.disableWcsCache")&&s(this,D).prefillWcsCache(o),this.dispatchEvent(new CustomEvent(ue,{detail:{...this.data,references:r,referencesTree:i,placeholders:n,...s(this,C)},bubbles:!0,composed:!0})),s(this,q)}get updateComplete(){return s(this,q)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return s(this,V)?s(this,V):(s(this,Xe)?this.transformAuthorData():this.transformPublishData(),s(this,V))}get rawData(){return s(this,B)}transformAuthorData(){let{fields:e,id:r,tags:i,variationId:n,settings:o={},priceLiterals:c={},dictionary:l={},placeholders:p={}}=s(this,B);m(this,V,e.reduce((h,{name:v,multiple:A,values:R})=>(h.fields[v]=A?R:R[0],h),{fields:{},id:r,tags:i,settings:o,priceLiterals:c,dictionary:l,placeholders:p,variationId:n}))}transformPublishData(){let{fields:e,id:r,tags:i,settings:n={},priceLiterals:o={},dictionary:c={},placeholders:l={},variationId:p}=s(this,B);m(this,V,Object.entries(e).reduce((h,[v,A])=>(h.fields[v]=A?.mimeType?A.value:A??"",h),{fields:{},id:r,tags:i,settings:n,priceLiterals:o,dictionary:c,placeholders:l,variationId:p}))}getFragmentClientUrl(){let r=new URLSearchParams(window.location.search).get("maslibs");if(!r||r.trim()==="")return"https://mas.adobe.com/studio/libs/fragment-client.js";let i=r.trim().toLowerCase();if(i==="local")return"http://localhost:3000/studio/libs/fragment-client.js";let{hostname:n}=window.location,o=n.endsWith(".page")?"page":"live";return i.includes("--")?`https://${i}.aem.${o}/studio/libs/fragment-client.js`:`https://${i}--mas--adobecom.aem.${o}/studio/libs/fragment-client.js`}async generatePreview(){let e=this.getFragmentClientUrl(),{previewFragment:r}=await import(e);return await r(s(this,M),{locale:s(this,D).settings.locale,apiKey:s(this,D).settings.wcsApiKey,fullContext:!0})}};Me=new WeakMap,B=new WeakMap,V=new WeakMap,D=new WeakMap,M=new WeakMap,C=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,q=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,Re=new WeakMap,H=new WeakSet,Sa=async function(e){nr(this,Ze)._++;let r=`${Kt}:${s(this,M)}:${s(this,Ze)}`,i=`${r}${lt}`,n=`${r}${dt}`;if(s(this,Re)){let c=await this.generatePreview();if(c.status===200)return c.body;throw new Z(`Failed to generate preview: ${c.message}`,{})}performance.mark(i);let o;try{if(s(this,C).stale=!1,s(this,C).url=e,o=await va(e,{cache:"default",credentials:"omit"}),z(this,H,Aa).call(this,o),s(this,C).status=o?.status,s(this,C).measure=ve(performance.measure(n,i)),s(this,C).retryCount=o.retryCount,!o?.ok)throw new Z("Unexpected fragment response",{response:o,...s(this,D).duration});return await o.json()}catch(c){if(s(this,C).measure=ve(performance.measure(n,i)),s(this,C).retryCount=c.retryCount,s(this,B))return s(this,C).stale=!0,s(this,Me).error("Serving stale data",s(this,C)),s(this,B);let l=c.message??"unknown";throw new Z(`Failed to fetch fragment: ${l}`,{})}},Aa=function(e){Object.assign(s(this,C),fa(e))},Qt=function(e){m(this,q,null),s(this,C).message=e,this.classList.add("error");let r={...s(this,C),...s(this,D).duration};s(this,Me).error(e,r),this.dispatchEvent(new CustomEvent(fe,{detail:r,bubbles:!0,composed:!0}))},Ta=async function(){var l;this.classList.remove("error"),m(this,V,null);let e=J.get(s(this,M));if(e)return m(this,B,e),!0;let{masIOUrl:r,wcsApiKey:i,country:n,locale:o}=s(this,D).settings,c=`${r}/fragment?id=${s(this,M)}&api_key=${i}&locale=${o}`;return n&&!o.endsWith(`_${n}`)&&(c+=`&country=${n}`),e=await z(this,H,Sa).call(this,c),(l=e.fields).originalId??(l.originalId=s(this,M)),J.add(e),m(this,B,e),!0},d(Ct,"cache",J);customElements.define(Kt,Ct);import{LitElement as Oi,html as Xt,css as Ni,nothing as Di}from"./lit-all.min.js";import{unsafeHTML as Fi}from"./lit-all.min.js";var Ii=a=>a?a.startsWith("sp-icon-")?Xt`${Fi(`<${a} class="badge-icon">`)}`:Xt``:Di,Oe=class extends Oi{constructor(){super(),this.color="",this.variant="",this.backgroundColor="",this.borderColor="",this.text=this.textContent,this.icon=""}connectedCallback(){this.borderColor&&this.borderColor!=="transparent"?this.style.setProperty("--merch-badge-border",`1px solid var(--${this.borderColor})`):this.backgroundColor.startsWith("gradient-")||this.style.setProperty("--merch-badge-border",`1px solid var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-background-color",`var(--${this.backgroundColor})`),(!this.borderColor||this.borderColor==="transparent")&&this.backgroundColor.startsWith("gradient-")?this.style.setProperty("--merch-badge-padding","3px 11px 4px 11px"):this.style.setProperty("--merch-badge-padding","2px 10px 3px 10px"),this.style.setProperty("--merch-badge-color",this.color),this.style.setProperty("--merch-badge-font-size","var(--consonant-merch-card-body-xs-font-size)"),this.querySelector('span[is="inline-price"]')||(this.textContent="");let t=this.closest("merch-card"),e=t?.getAttribute("size"),r=t?.querySelectorAll(":scope > merch-icon").length||0;this.style.setProperty("--merch-badge-offset",r),this.style.setProperty("--merch-badge-with-offset",r?1:0),this.style.setProperty("--merch-badge-card-size",e?2:1),super.connectedCallback()}render(){return Xt`
+ ${Ii(this.icon)}${this.text} +
`}};d(Oe,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"},icon:{type:String}}),d(Oe,"styles",Ni` :host { display: block; background: var(--merch-badge-background-color); @@ -8317,10 +8317,10 @@ Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6 height: 18px; width: 18px; } - `);customElements.define("merch-badge",Oe);import{html as Di,css as Fi,LitElement as Ii}from"./lit-all.min.js";var Je=class extends Ii{constructor(){super()}render(){return Di` + `);customElements.define("merch-badge",Oe);import{html as $i,css as Bi,LitElement as qi}from"./lit-all.min.js";var Je=class extends qi{constructor(){super()}render(){return $i` ${this.description} - `}};d(Je,"styles",Fi` + `}};d(Je,"styles",Bi` :host { display: flex; flex-wrap: nowrap; @@ -8345,12 +8345,12 @@ Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6 :host .hidden { display: none; } - `),d(Je,"properties",{description:{type:String,attribute:!0}});customElements.define("merch-mnemonic-list",Je);import{html as Qt,css as $i,LitElement as Bi,nothing as Ta}from"./lit-all.min.js";var et=class extends Bi{updated(){this.hideSeeMoreEls()}hideSeeMoreEls(){this.isMobile&&this.rows.forEach((t,e)=>{e>=5&&(t.style.display=this.showAll?"flex":"none")})}constructor(){super(),this.showAll=!1,this.mobileRows=this.mobileRows===void 0?5:this.mobileRows}toggle(){this.showAll=!this.showAll,this.dispatchEvent(new CustomEvent("hide-see-more-elements",{bubbles:!0,composed:!0})),this.requestUpdate()}render(){return Qt` + `),d(Je,"properties",{description:{type:String,attribute:!0}});customElements.define("merch-mnemonic-list",Je);import{html as Zt,css as Hi,LitElement as Ui,nothing as La}from"./lit-all.min.js";var et=class extends Ui{updated(){this.hideSeeMoreEls()}hideSeeMoreEls(){this.isMobile&&this.rows.forEach((t,e)=>{e>=5&&(t.style.display=this.showAll?"flex":"none")})}constructor(){super(),this.showAll=!1,this.mobileRows=this.mobileRows===void 0?5:this.mobileRows}toggle(){this.showAll=!this.showAll,this.dispatchEvent(new CustomEvent("hide-see-more-elements",{bubbles:!0,composed:!0})),this.requestUpdate()}render(){return Zt` - ${!this.isMobile||!this.bulletsAdded?Qt``:Ta} - ${this.isMobile&&this.rows.length>this.mobileRows&&!this.bulletsAdded?Qt`
+ ${!this.isMobile||!this.bulletsAdded?Zt``:La} + ${this.isMobile&&this.rows.length>this.mobileRows&&!this.bulletsAdded?Zt`
${this.showAll?"- See less":"+ See more"} -
`:Ta}`}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}get rows(){return this.querySelectorAll('[slot="content"] merch-mnemonic-list')}get bulletsAdded(){return!!this.querySelector('[slot="contentBullets"] merch-mnemonic-list')}};d(et,"styles",$i` +
`:La}`}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}get rows(){return this.querySelectorAll('[slot="content"] merch-mnemonic-list')}get bulletsAdded(){return!!this.querySelector('[slot="contentBullets"] merch-mnemonic-list')}};d(et,"styles",Hi` :host { display: flex; flex-wrap: wrap; @@ -8391,4 +8391,4 @@ Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6 text-decoration: underline; color: var(--link-color-dark); } - `),d(et,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",et);var qi={[K]:fr,[re]:vr,[Y]:xr},Hi={[K]:br,[Y]:Be},tt,St=class{constructor(t){g(this,tt);d(this,"changes",new Map);d(this,"connected",!1);d(this,"error");d(this,"log");d(this,"options");d(this,"promises",[]);d(this,"state",re);d(this,"timer",null);d(this,"value");d(this,"version",0);d(this,"wrapperElement");this.wrapperElement=t,this.log=Ke.module("mas-element")}update(){[K,re,Y].forEach(t=>{this.wrapperElement.classList.toggle(qi[t],t===this.state)})}notify(){(this.state===Y||this.state===K)&&(this.state===Y?this.promises.forEach(({resolve:e})=>e(this.wrapperElement)):this.state===K&&this.promises.forEach(({reject:e})=>e(this.error)),this.promises=[]);let t=this.error;this.error instanceof Z&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(Hi[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,e,r){this.changes.set(t,r),this.requestUpdate()}connectedCallback(){m(this,tt,Gt()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:e,state:r}=this;return Y===r?Promise.resolve(this.wrapperElement):K===r?Promise.reject(t):new Promise((i,n)=>{e.push({resolve:i,reject:n})})}toggleResolved(t,e,r){return t!==this.version?!1:(r!==void 0&&(this.options=r),this.state=Y,this.value=e,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:e}),Et(()=>this.notify()),!0)}toggleFailed(t,e,r){if(t!==this.version)return!1;r!==void 0&&(this.options=r),this.error=e,this.state=K,this.update();let i=this.wrapperElement.getAttribute("is");return this.log?.error(`${i}: Failed to render: ${e.message}`,{element:this.wrapperElement,...e.context,...s(this,tt)?.duration}),Et(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=re,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Gt()||this.timer)return;let{error:e,options:r,state:i,value:n,version:o}=this;this.state=re,this.timer=Et(async()=>{this.timer=null;let c=null;if(this.changes.size&&(c=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:c}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:c})),c||t)try{await this.wrapperElement.render?.()===!1&&this.state===re&&this.version===o&&(this.state=i,this.error=e,this.value=n,this.update(),this.notify())}catch(l){this.toggleFailed(this.version,l,r)}})}};tt=new WeakMap;function Ui(a){return`https://${a==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var le,se=class se extends HTMLAnchorElement{constructor(){super();d(this,"masElement",new St(this));g(this,le);this.setAttribute("is",se.is)}get isUptLink(){return!0}initializeWcsData(e,r){this.setAttribute("data-wcs-osi",e),r&&this.setAttribute("data-promotion-code",r)}attributeChangedCallback(e,r,i){this.masElement.attributeChangedCallback(e,r,i)}connectedCallback(){this.masElement.connectedCallback(),m(this,le,ae()),s(this,le)&&(this.log=s(this,le).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),m(this,le,void 0)}requestUpdate(e=!1){this.masElement.requestUpdate(e)}onceSettled(){return this.masElement.onceSettled()}async render(){let e=ae();if(!e)return!1;this.dataset.imsCountry||e.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let r=e.collectCheckoutOptions({},this);if(!r.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let i=this.masElement.togglePending(r),n=e.resolveOfferSelectors(r);try{let[[o]]=await Promise.all(n),{country:c,language:l,env:p}=r,h=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,v=this.getAttribute("data-promotion-code");v&&(h+=`&promotion_code=${encodeURIComponent(v)}`),this.href=`${Ui(p)}?${h}`,this.masElement.toggleResolved(i,o,r)}catch(o){let c=new Error(`Could not resolve offer selectors for id: ${r.wcsOsi}.`,o.message);return this.masElement.toggleFailed(i,c,r),!1}}static createFrom(e){let r=new se;for(let i of e.attributes)i.name!=="is"&&(i.name==="class"&&i.value.includes("upt-link")?r.setAttribute("class",i.value.replace("upt-link","").trim()):r.setAttribute(i.name,i.value));return r.innerHTML=e.innerHTML,r.setAttribute("tabindex",0),r}};le=new WeakMap,d(se,"is","upt-link"),d(se,"tag","a"),d(se,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var ee=se;window.customElements.get(ee.is)||window.customElements.define(ee.is,ee,{extends:ee.tag});var ji="#000000",Xt="#F8D904",Gi="#EAEAEA",Vi="#31A547",Wi=/(accent|primary|secondary)(-(outline|link))?/,Ki="mas:product_code/",Yi="daa-ll",Ct="daa-lh",Qi=["XL","L","M","S"],Zt="...",Xi=new Set(["free-trial","start-free-trial","seven-day-trial","fourteen-day-trial","thirty-day-trial"]);function F(a,t,e,r){let i=r[a];if(t[a]&&i){let n={slot:i?.slot,...i?.attributes},o=t[a];if(i.maxCount&&typeof o=="string"){let[l,p]=un(o,i.maxCount,i.withSuffix);l!==o&&(n.title=p,o=l)}let c=L(i.tag,n,o);e.append(c)}}function Zi(a,t,e){let i=(a.mnemonicIcon||[]).filter(o=>o).map((o,c)=>({icon:o,alt:a.mnemonicAlt?.[c]??"",link:a.mnemonicLink?.[c]??""}));i?.forEach(({icon:o,alt:c,link:l})=>{if(l&&!/^https?:/.test(l))try{l=new URL(`https://${l}`).href.toString()}catch{l="#"}let p={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(p.alt=c),l&&(p.href=l);let h=L("merch-icon",p);t.append(h)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function Ji(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}F("badge",a,t,e)}else a.badge?(t.setAttribute("badge-text",a.badge),e.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",a.badgeColor||ji),e.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",a.badgeBackgroundColor||Xt),t.setAttribute("border-color",a.badgeBackgroundColor||Xt)):t.setAttribute("border-color",a.borderColor||Gi)}function en(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}F("trialBadge",a,t,e)}}function tn(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function rn(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function an(a,t,e){a.cardTitle&&(a.cardTitle=Ne(a.cardTitle)),F("cardTitle",a,t,{cardTitle:e})}function nn(a,t,e){F("subtitle",a,t,e)}function on(a,t,e,r){if(!a.backgroundColor||a.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}e?.[a.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${e[a.backgroundColor]})`),t.setAttribute("background-color",a.backgroundColor)):r?.attribute&&a.backgroundColor&&(t.setAttribute(r.attribute,a.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function cn(a,t,e){let r=e?.borderColor,i="--consonant-merch-card-border-color";if(a.borderColor?.toLowerCase()==="transparent")t.style.setProperty(i,"transparent");else if(a.borderColor&&r){let o=r?.specialValues?.[a.borderColor]?.includes("gradient")||/-gradient/.test(a.borderColor),c=/^spectrum-.*-(plans|special-offers)$/.test(a.borderColor);if(o){t.setAttribute("gradient-border","true");let l=a.borderColor;if(r?.specialValues){for(let[p,h]of Object.entries(r.specialValues))if(h===a.borderColor){l=p;break}}t.setAttribute("border-color",l),t.style.removeProperty(i)}else c?(t.setAttribute("border-color",a.borderColor),t.style.setProperty(i,`var(--${a.borderColor})`)):t.style.setProperty(i,`var(--${a.borderColor})`)}}function sn(a,t,e){if(a.backgroundImage){let r={loading:t.loading??"lazy",src:a.backgroundImage};if(a.backgroundImageAltText?r.alt=a.backgroundImageAltText:r.role="none",!e)return;if(e?.attribute){t.setAttribute(e.attribute,a.backgroundImage);return}t.append(L(e.tag,{slot:e.slot},L("img",r)))}}function Ne(a){return!a||typeof a!="string"||a.includes("(zt(),Lt)).catch(console.error),a}function ln(a,t,e){a.prices&&(a.prices=Ne(a.prices)),F("prices",a,t,e)}function za(a,t,e){let r=a.hasAttribute("data-wcs-osi")&&!!a.getAttribute("data-wcs-osi"),i=a.className||"",n=Wi.exec(i)?.[0]??"accent",o=n.includes("accent"),c=n.includes("primary"),l=n.includes("secondary"),p=n.includes("-outline"),h=n.includes("-link");a.classList.remove("accent","primary","secondary");let v;if(t.consonant)v=bn(a,o,r,h,c,l,e?.ctas?.size);else if(h)v=a;else{let A;o?A="accent":c?A="primary":l&&(A="secondary"),v=t.spectrum==="swc"?xn(a,e,p,A,r):vn(a,e,p,A,r)}return v}function dn(a,t){let{slot:e}=t?.description,r=a.querySelectorAll(`[slot="${e}"] a[data-wcs-osi]`);r.length&&r.forEach(i=>{let n=za(i,a,t);i.replaceWith(n)})}function hn(a,t,e){a.description&&(a.description=Ne(a.description)),a.promoText&&(a.promoText=Ne(a.promoText)),a.shortDescription&&(a.shortDescription=Ne(a.shortDescription)),F("promoText",a,t,e),F("description",a,t,e),F("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),dn(t,e),F("callout",a,t,e),F("quantitySelect",a,t,e),F("whatsIncluded",a,t,e)}function pn(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=L("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(b)].forEach(c=>{let l=c.parentElement;l?.nodeName==="P"&&l.setAttribute("data-plan-type","")}),t.append(o)}function mn(a,t,e){a.addonConfirmation&&F("addonConfirmation",a,t,e)}function gn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function un(a,t,e=!0){try{let r=typeof a!="string"?"":a,i=La(r);if(i.length<=t)return[r,i];let n=0,o=!1,c=e?t-Zt.length<1?1:t-Zt.length:t,l=[];for(let v of r){if(n++,v==="<")if(o=!0,r[n]==="/")l.pop();else{let A="";for(let R of r.substring(n)){if(R===" "||R===">")break;A+=R}l.push(A)}if(v==="/"&&r[n]===">"&&l.pop(),v===">"){o=!1;continue}if(!o&&(c--,c===0))break}let p=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let v of l.reverse())p+=``}return[`${p}${e?Zt:""}`,i]}catch{let i=typeof a=="string"?a:"",n=La(i);return[i,n]}}function La(a){if(!a)return"";let t="",e=!1;for(let r of a){if(r==="<"&&(e=!0),r===">"){e=!1;continue}e||(t+=r)}return t}function fn(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function vn(a,t,e,r,i){let n=a;i?n=customElements.get("checkout-button").createCheckoutButton({},a.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let h of a.attributes)["class","is"].includes(h.name)||n.setAttribute(h.name,h.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",c=`spectrum-Button--${r}`,l=Qi.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",p=["spectrum-Button",c,l];return e&&p.push("spectrum-Button--outline"),n.classList.add(...p),n}function xn(a,t,e,r,i){let n=a;i&&(n=customElements.get("checkout-button").createCheckoutButton(a.dataset),n.connectedCallback(),n.render());let o="fill";e&&(o="outline");let c=L("sp-button",{treatment:o,variant:r,tabIndex:0,size:t?.ctas?.size??"m",...a.dataset.analyticsId&&{"data-analytics-id":a.dataset.analyticsId}},a.innerHTML);return c.source=n,(i?n.onceSettled():Promise.resolve(n)).then(l=>{c.setAttribute("data-navigation-url",l.href)}),c.addEventListener("click",l=>{l.defaultPrevented||n.click()}),c}function bn(a,t,e,r,i,n,o){let c=a;if(e)try{let l=customElements.get("checkout-link");l&&(c=l.createCheckoutLink(a.dataset,a.innerHTML)??a)}catch{}return r||(c.classList.add("button","con-button"),o&&o!=="m"&&c.classList.add(`button-${o}`),t&&c.classList.add("blue"),i&&c.classList.add("primary"),n&&c.classList.add("secondary")),c}function yn(a,t,e,r,i){if(a.ctas){a.ctas=Ne(a.ctas);let{slot:n}=e.ctas,o=L("div",{slot:n},a.ctas),c=[...o.querySelectorAll("a")],l=i?.hideTrialCTAs?c.filter(h=>!Xi.has(h.dataset.analyticsId)):c,p=(l.length>0?l:c).map(h=>za(h,t,e));o.textContent="",o.append(...p),t.append(o),i?.hideTrialCTAs&&l.length>0&&p.forEach(h=>{let v=h.source??h;v.onceSettled&&(h.hidden=!0,v.onceSettled().then(()=>{v.value?.[0]?.offerType==="TRIAL"&&p.some(R=>R!==h&&!R.hidden)?h.remove():h.hidden=!1}).catch(()=>{h.hidden=!1}))})}}function wn(a,t){let{tags:e}=a,r=e?.find(n=>typeof n=="string"&&n.startsWith(Ki))?.split("/").pop();if(!r)return;t.setAttribute(Ct,r),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,o)=>{n.setAttribute(Yi,`${n.dataset.analyticsId}-${o+1}`)})}function En(a){a.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,e])=>{a.querySelectorAll(`a.${t}`).forEach(r=>{r.classList.remove(t),r.classList.add("spectrum-Link",`spectrum-Link--${e}`)})})}function kn(a){a.querySelectorAll("[slot]").forEach(r=>{r.remove()}),a.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Ct].forEach(r=>a.removeAttribute(r));let e=["wide-strip","thin-strip"];a.classList.remove(...e)}async function Pa(a,t){if(!a){let l=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${l}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${l}).`)}if(!a.fields){let l=a.id||"unknown",p=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${p}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${p}) is missing 'fields'.`)}let{id:e,fields:r,settings:i={},priceLiterals:n}=a,{variant:o}=r;if(!o)throw new Error(`hydrate: no variant found in payload ${e}`);kn(t),t.settings=i,n&&(t.priceLiterals=n),t.id??(t.id=a.id),a.variationId&&t.setAttribute("variation-id",a.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:c}=t.variantLayout;if(!c)throw new Error(`hydrate: variant mapping not found for ${e}`);c.style==="consonant"&&t.setAttribute("consonant",!0),Zi(r,t,c.mnemonics),en(r,t,c),tn(r,t,c.size),rn(r,t),an(r,t,c.title),Ji(r,t,c),nn(r,t,c),ln(r,t,c),sn(r,t,c.backgroundImage),on(r,t,c.allowedColors,c.backgroundColor),cn(r,t,c),hn(r,t,c),pn(r,t,c,i),mn(r,t,c),gn(r,t,c,i);try{fn(r,t)}catch{}yn(r,t,c,o,i),wn(r,t),En(t)}var tr="merch-card",Jt=2e4,_a="merch-card:",Ra=["full-pricing-express","simplified-pricing-express"],Oa=["segment","product"];function Ma(a,t){let e=a.closest(tr);if(!e)return t;e.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,e.priceLiterals)),e.aemFragment&&(t[wr]=!0),e.variantLayout?.priceOptionsProvider?.(a,t)}function Cn(a){a.providers.has(Ma)||a.providers.price(Ma)}var rt=new IntersectionObserver(a=>{a.forEach(t=>{let e=t.target;if(Ra.includes(e.variant)){if(e.clientHeight===0)return;rt.unobserve(e),e.requestUpdate();return}if(Oa.includes(e.variant)){if(t.boundingClientRect.width===0)return;if(e.variant==="product"&&e.querySelector('merch-icon[slot="icons"]')){rt.unobserve(e);return}let r=e.getBoundingClientRect().width,n=e.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(r===0||n===0){rt.unobserve(e);return}e.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(r-n-16)}px`),rt.unobserve(e)}})}),An=0,De,Fe,Ie,j,he,I,pe,E,de,at,er,At,te=class extends Sn{constructor(){super();g(this,E);g(this,De);g(this,Fe);g(this,Ie);g(this,j);g(this,he);g(this,I);g(this,pe,new Promise(e=>{m(this,I,e)}));d(this,"customerSegment");d(this,"marketSegment");d(this,"variantLayout");this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this),this.handleMerchOfferSelectReady=this.handleMerchOfferSelectReady.bind(this)}firstUpdated(){this.variantLayout=$t(this),this.variantLayout?.connectedCallbackHook()}willUpdate(e){(e.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=$t(this),this.variantLayout?.connectedCallbackHook())}updated(e){!this.style.getPropertyValue("--consonant-merch-card-border-color")&&this.computedBorderColor&&(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border-color",this.computedBorderColor),e.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(e)}catch(r){z(this,E,de).call(this,`Error in postCardUpdateHook: ${r.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderColor(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":this.borderColor?this.borderColor:this.badgeBackgroundColor}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get descriptionSlot(){return this.shadowRoot.querySelector('slot[name="body-xs"')?.assignedElements()[0]}get descriptionSlotCompare(){return this.shadowRoot.querySelector('slot[name="body-m"')?.assignedElements()[0]}get iconButton(){return this.querySelector('[slot="callout-content"] .icon-button')}get price(){return this.headingmMSlot?.querySelector(b)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(W)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(W)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(W)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:e}){if(!this.stockOfferOsis)return;let r=this.checkoutLinks;if(r.length!==0)for(let i of r){await i.onceSettled();let n=i.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let c=i.dataset.wcsOsi.split(",").filter(l=>l!==o);e.checked&&c.push(o),i.dataset.wcsOsi=c.join(",")}}changeHandler(e){e.target.tagName==="MERCH-ADDON"&&this.toggleAddon(e.target)}toggleAddon(e){this.variantLayout?.toggleAddon?.(e);let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length===0)return;let i=n=>{let{offerType:o,planType:c}=n.value?.[0]??{};if(!o||!c)return;let l=e.getOsi(c,o),p=(n.dataset.wcsOsi||"").split(",").filter(h=>h&&h!==l);e.checked&&p.push(l),n.dataset.wcsOsi=p.join(",")};r.forEach(i)}handleQuantitySelection(e){let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length!==0)for(let i of r)i.dataset.quantity=e.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(e){let r={...this.filters};Object.keys(r).forEach(i=>{if(e){r[i].order=Math.min(r[i].order||2,2);return}let n=r[i].order;n===1||isNaN(n)||(r[i].order=Number(n)+1)}),this.filters=r}showInfoTooltip(e,r){let i="tooltip-left",n="tooltip-right";window.screen.width<600&&e.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(i),this.iconButton.classList.remove(n),e.getBoundingClientRect().x<100&&this.iconButton.classList.add(i),e.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(r)}handleInfoIconEvents(){let e="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(r=>this.iconButton.addEventListener(r,i=>this.showInfoTooltip(i.target,e),!1)),["mouseleave","blur"].forEach(r=>this.iconButton.addEventListener(r,()=>this.iconButton.classList.remove(e),!1)),this.iconButton.addEventListener("keydown",r=>{r.key==="Escape"&&this.iconButton.classList.remove(e)}))}includes(e){return this.textContent.match(new RegExp(e,"i"))!==null}connectedCallback(){var r;super.connectedCallback(),s(this,Fe)||m(this,Fe,An++),this.aemFragment||((r=s(this,I))==null||r.call(this),m(this,I,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let e=this.id??s(this,Fe);m(this,he,`${_a}${e}${st}`),m(this,De,`${_a}${e}${lt}`),performance.mark(s(this,he)),m(this,j,ae()),Cn(s(this,j)),m(this,Ie,s(this,j).Log.module(tr)),this.addEventListener(O,this.handleQuantitySelection),this.addEventListener(Pt,this.handleAddonAndQuantityUpdate),this.addEventListener(pr,this.handleMerchOfferSelectReady),this.addEventListener(fe,this.handleAemFragmentEvents),this.addEventListener(ue,this.handleAemFragmentEvents),this.addEventListener(ot,this.handleInfoIconEvents),this.addEventListener("change",this.changeHandler),this.variantLayout&&this.variantLayout.connectedCallbackHook(),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(O,this.handleQuantitySelection),this.removeEventListener(fe,this.handleAemFragmentEvents),this.removeEventListener(ue,this.handleAemFragmentEvents),this.removeEventListener(ot,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(Pt,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(e){var r;if(this.isConnected&&(e.type===fe&&z(this,E,de).call(this,"AEM fragment cannot be loaded"),e.type===ue&&(this.failed=!1,e.target.nodeName==="AEM-FRAGMENT"))){let i=e.detail;try{s(this,I)||m(this,pe,new Promise(n=>{m(this,I,n)})),Pa(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,I))==null||r.call(this),m(this,I,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected||this.failed)return;s(this,pe)&&(await s(this,pe),(Ra.includes(this.variant)||Oa.includes(this.variant))&&rt.observe(this),m(this,pe,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let e=new Promise(o=>setTimeout(()=>o("timeout"),Jt));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,e]);if(o===!1||o==="timeout"){let c=o==="timeout"?`AEM fragment was not resolved within ${Jt} timeout`:"AEM fragment cannot be loaded";z(this,E,de).call(this,c,{},!1);return}}let r=[...this.querySelectorAll(hr)],i=Promise.all(r.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(c=>c.classList.contains("placeholder-resolved"))),n=await Promise.race([i,e]);if(n===!0){this.measure=performance.measure(s(this,De),s(this,he));let o={...this.aemFragment?.fetchInfo,...s(this,j).duration,measure:ve(this.measure)};return this.dispatchEvent(new CustomEvent(ot,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(s(this,De),s(this,he));let o={measure:ve(this.measure),...s(this,j).duration};n==="timeout"?z(this,E,de).call(this,`Contains offers that were not resolved within ${Jt} timeout`,o):z(this,E,de).call(this,"Contains unresolved offers",o)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let e=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(W)).length===2&&e&&e.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:e,items:r}}){if(!e||!r?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(h=>h.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(h=>h.productArrangementCode===c)?.quantity,p=!!r.find(h=>h.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(gr,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==p){this.toggleStockOffer({target:this.addonCheckbox});let h=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(h,"target",{writable:!1,value:{checked:p}}),this.addonCheckbox.handleChange(h)}}get prices(){return Array.from(this.querySelectorAll(b))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let e=this.querySelector(".price.price-alternative");if(e||(e=this.querySelector(`${b}[data-template="price"] > span`)),!!e)return e=e.innerText,e}get regularPrice(){return s(this,E,at)?.innerText}get promotionCode(){let e=[...this.querySelectorAll(`${b}[data-promotion-code],${W}[data-promotion-code]`)].map(i=>i.dataset.promotionCode),r=[...new Set(e)];return r.length>1&&s(this,Ie)?.warn(`Multiple different promotion codes found: ${r.join(", ")}`),e[0]}get annualPrice(){return this.querySelector(`${b}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(s(this,E,er)??s(this,E,at))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return s(this,E,at)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let e=".price-unit-type";return s(this,E,er)?.querySelector(e)?.textContent?.trim()??s(this,E,at)?.querySelector(e)?.textContent?.trim()??this.querySelector(e)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let e=this.querySelector('a[is="upt-link"]');if(e)return z(this,E,At).call(this,e)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let e=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${W}, a`);return Array.from(e??[])}get primaryCta(){return z(this,E,At).call(this,this.ctas.find(e=>e.variant==="accent"||e.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return z(this,E,At).call(this,this.ctas.find(e=>e.variant!=="accent"&&!e.matches(".spectrum-Button--accent,.con-button.blue")))}};De=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,j=new WeakMap,he=new WeakMap,I=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){var l;if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,j).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,(l=s(this,I))==null||l.call(this),m(this,I,void 0),s(this,j).isPreview()||(this.style.display="none"),i&&this.dispatchEvent(new CustomEvent(ur,{bubbles:!0,composed:!0,detail:c}))},at=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${b}[data-template="price"] > span`)},er=function(){return this.querySelector(`${b}[data-template="legal"]`)},At=function(e){if(e)return{text:e.innerText.trim(),analyticsId:e.dataset.analyticsId,href:e.getAttribute("href")??e.dataset.href}},d(te,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},heightSync:{type:Boolean,attribute:"height-sync"},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:e=>{if(!e)return;let[r,i,n]=e.split(",");return{PUF:r,ABM:i,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:e=>Object.fromEntries(e.split(",").map(r=>{let[i,n,o]=r.split(":"),c=Number(n);return[i,{order:isNaN(c)?void 0:c,size:o}]})),toAttribute:e=>Object.entries(e).map(([r,{order:i,size:n}])=>[r,i,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Ct,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),d(te,"styles",[sr,...lr()]),d(te,"registerVariant",k),d(te,"getCollectionOptions",ia),d(te,"getFragmentMapping",pt);customElements.define(tr,te);export{te as MerchCard}; + `),d(et,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",et);var Gi={[K]:vr,[re]:xr,[Y]:br},ji={[K]:yr,[Y]:Be},tt,St=class{constructor(t){g(this,tt);d(this,"changes",new Map);d(this,"connected",!1);d(this,"error");d(this,"log");d(this,"options");d(this,"promises",[]);d(this,"state",re);d(this,"timer",null);d(this,"value");d(this,"version",0);d(this,"wrapperElement");this.wrapperElement=t,this.log=Ke.module("mas-element")}update(){[K,re,Y].forEach(t=>{this.wrapperElement.classList.toggle(Gi[t],t===this.state)})}notify(){(this.state===Y||this.state===K)&&(this.state===Y?this.promises.forEach(({resolve:e})=>e(this.wrapperElement)):this.state===K&&this.promises.forEach(({reject:e})=>e(this.error)),this.promises=[]);let t=this.error;this.error instanceof Z&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(ji[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,e,r){this.changes.set(t,r),this.requestUpdate()}connectedCallback(){m(this,tt,Wt()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:e,state:r}=this;return Y===r?Promise.resolve(this.wrapperElement):K===r?Promise.reject(t):new Promise((i,n)=>{e.push({resolve:i,reject:n})})}toggleResolved(t,e,r){return t!==this.version?!1:(r!==void 0&&(this.options=r),this.state=Y,this.value=e,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:e}),kt(()=>this.notify()),!0)}toggleFailed(t,e,r){if(t!==this.version)return!1;r!==void 0&&(this.options=r),this.error=e,this.state=K,this.update();let i=this.wrapperElement.getAttribute("is");return this.log?.error(`${i}: Failed to render: ${e.message}`,{element:this.wrapperElement,...e.context,...s(this,tt)?.duration}),kt(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=re,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Wt()||this.timer)return;let{error:e,options:r,state:i,value:n,version:o}=this;this.state=re,this.timer=kt(async()=>{this.timer=null;let c=null;if(this.changes.size&&(c=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:c}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:c})),c||t)try{await this.wrapperElement.render?.()===!1&&this.state===re&&this.version===o&&(this.state=i,this.error=e,this.value=n,this.update(),this.notify())}catch(l){this.toggleFailed(this.version,l,r)}})}};tt=new WeakMap;function Vi(a){return`https://${a==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var le,se=class se extends HTMLAnchorElement{constructor(){super();d(this,"masElement",new St(this));g(this,le);this.setAttribute("is",se.is)}get isUptLink(){return!0}initializeWcsData(e,r){this.setAttribute("data-wcs-osi",e),r&&this.setAttribute("data-promotion-code",r)}attributeChangedCallback(e,r,i){this.masElement.attributeChangedCallback(e,r,i)}connectedCallback(){this.masElement.connectedCallback(),m(this,le,ae()),s(this,le)&&(this.log=s(this,le).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),m(this,le,void 0)}requestUpdate(e=!1){this.masElement.requestUpdate(e)}onceSettled(){return this.masElement.onceSettled()}async render(){let e=ae();if(!e)return!1;this.dataset.imsCountry||e.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let r=e.collectCheckoutOptions({},this);if(!r.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let i=this.masElement.togglePending(r),n=e.resolveOfferSelectors(r);try{let[[o]]=await Promise.all(n),{country:c,language:l,env:p}=r,h=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,v=this.getAttribute("data-promotion-code");v&&(h+=`&promotion_code=${encodeURIComponent(v)}`),this.href=`${Vi(p)}?${h}`,this.masElement.toggleResolved(i,o,r)}catch(o){let c=new Error(`Could not resolve offer selectors for id: ${r.wcsOsi}.`,o.message);return this.masElement.toggleFailed(i,c,r),!1}}static createFrom(e){let r=new se;for(let i of e.attributes)i.name!=="is"&&(i.name==="class"&&i.value.includes("upt-link")?r.setAttribute("class",i.value.replace("upt-link","").trim()):r.setAttribute(i.name,i.value));return r.innerHTML=e.innerHTML,r.setAttribute("tabindex",0),r}};le=new WeakMap,d(se,"is","upt-link"),d(se,"tag","a"),d(se,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var ee=se;window.customElements.get(ee.is)||window.customElements.define(ee.is,ee,{extends:ee.tag});var Wi="#000000",Jt="#F8D904",Ki="#EAEAEA",Yi="#31A547",Qi=/(accent|primary|secondary)(-(outline|link))?/,Xi="mas:product_code/",Zi="daa-ll",At="daa-lh",Ji=["XL","L","M","S"],er="...",en=new Set(["free-trial","start-free-trial","seven-day-trial","fourteen-day-trial","thirty-day-trial"]);function F(a,t,e,r){let i=r[a];if(t[a]&&i){let n={slot:i?.slot,...i?.attributes},o=t[a];if(i.maxCount&&typeof o=="string"){let[l,p]=xn(o,i.maxCount,i.withSuffix);l!==o&&(n.title=p,o=l)}let c=L(i.tag,n,o);e.append(c)}}function tn(a,t,e){let i=(a.mnemonicIcon||[]).filter(o=>o).map((o,c)=>({icon:o,alt:a.mnemonicAlt?.[c]??"",link:a.mnemonicLink?.[c]??""}));i?.forEach(({icon:o,alt:c,link:l})=>{if(l&&!/^https?:/.test(l))try{l=new URL(`https://${l}`).href.toString()}catch{l="#"}let p={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(p.alt=c),l&&(p.href=l);let h=L("merch-icon",p);t.append(h)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function rn(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}F("badge",a,t,e)}else a.badge?(t.setAttribute("badge-text",a.badge),e.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",a.badgeColor||Wi),e.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",a.badgeBackgroundColor||Jt),t.setAttribute("border-color",a.badgeBackgroundColor||Jt)):t.setAttribute("border-color",a.borderColor||Ki)}function an(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}F("trialBadge",a,t,e)}}function nn(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function on(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function cn(a,t,e){a.cardTitle&&(a.cardTitle=Ne(a.cardTitle)),F("cardTitle",a,t,{cardTitle:e})}function sn(a,t,e){F("subtitle",a,t,e)}function ln(a,t,e,r){if(!a.backgroundColor||a.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}e?.[a.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${e[a.backgroundColor]})`),t.setAttribute("background-color",a.backgroundColor)):r?.attribute&&a.backgroundColor&&(t.setAttribute(r.attribute,a.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function dn(a,t,e){let r=e?.borderColor,i="--consonant-merch-card-border-color";if(a.borderColor?.toLowerCase()==="transparent")t.style.setProperty(i,"transparent");else if(a.borderColor&&r){let o=r?.specialValues?.[a.borderColor]?.includes("gradient")||/-gradient/.test(a.borderColor),c=/^spectrum-.*-(plans|special-offers)$/.test(a.borderColor);if(o){t.setAttribute("gradient-border","true");let l=a.borderColor;if(r?.specialValues){for(let[p,h]of Object.entries(r.specialValues))if(h===a.borderColor){l=p;break}}t.setAttribute("border-color",l),t.style.removeProperty(i)}else c?(t.setAttribute("border-color",a.borderColor),t.style.setProperty(i,`var(--${a.borderColor})`)):t.style.setProperty(i,`var(--${a.borderColor})`)}}function hn(a,t,e){if(a.backgroundImage){let r={loading:t.loading??"lazy",src:a.backgroundImage};if(a.backgroundImageAltText?r.alt=a.backgroundImageAltText:r.role="none",!e)return;if(e?.attribute){t.setAttribute(e.attribute,a.backgroundImage);return}t.append(L(e.tag,{slot:e.slot},L("img",r)))}}function Ne(a){return!a||typeof a!="string"||a.includes("(_t(),Pt)).catch(console.error),a}function pn(a,t,e){a.prices&&(a.prices=Ne(a.prices)),F("prices",a,t,e)}function Pa(a,t,e){let r=a.hasAttribute("data-wcs-osi")&&!!a.getAttribute("data-wcs-osi"),i=a.className||"",n=Qi.exec(i)?.[0]??"accent",o=n.includes("accent"),c=n.includes("primary"),l=n.includes("secondary"),p=n.includes("-outline"),h=n.includes("-link");a.classList.remove("accent","primary","secondary");let v;if(t.consonant)v=En(a,o,r,h,c,l,e?.ctas?.size);else if(h)v=a;else{let A;o?A="accent":c?A="primary":l&&(A="secondary"),v=t.spectrum==="swc"?wn(a,e,p,A,r):yn(a,e,p,A,r)}return v}function mn(a,t){let{slot:e}=t?.description,r=a.querySelectorAll(`[slot="${e}"] a[data-wcs-osi]`);r.length&&r.forEach(i=>{let n=Pa(i,a,t);i.replaceWith(n)})}function gn(a,t,e){a.description&&(a.description=Ne(a.description)),a.promoText&&(a.promoText=Ne(a.promoText)),a.shortDescription&&(a.shortDescription=Ne(a.shortDescription)),F("promoText",a,t,e),F("description",a,t,e),F("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),mn(t,e),F("callout",a,t,e),F("quantitySelect",a,t,e),F("whatsIncluded",a,t,e)}function un(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=L("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(b)].forEach(c=>{let l=c.parentElement;l?.nodeName==="P"&&l.setAttribute("data-plan-type","")}),t.append(o)}function fn(a,t,e){a.addonConfirmation&&F("addonConfirmation",a,t,e)}function vn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function xn(a,t,e=!0){try{let r=typeof a!="string"?"":a,i=za(r);if(i.length<=t)return[r,i];let n=0,o=!1,c=e?t-er.length<1?1:t-er.length:t,l=[];for(let v of r){if(n++,v==="<")if(o=!0,r[n]==="/")l.pop();else{let A="";for(let R of r.substring(n)){if(R===" "||R===">")break;A+=R}l.push(A)}if(v==="/"&&r[n]===">"&&l.pop(),v===">"){o=!1;continue}if(!o&&(c--,c===0))break}let p=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let v of l.reverse())p+=``}return[`${p}${e?er:""}`,i]}catch{let i=typeof a=="string"?a:"",n=za(i);return[i,n]}}function za(a){if(!a)return"";let t="",e=!1;for(let r of a){if(r==="<"&&(e=!0),r===">"){e=!1;continue}e||(t+=r)}return t}function bn(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function yn(a,t,e,r,i){let n=a;i?n=customElements.get("checkout-button").createCheckoutButton({},a.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let h of a.attributes)["class","is"].includes(h.name)||n.setAttribute(h.name,h.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",c=`spectrum-Button--${r}`,l=Ji.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",p=["spectrum-Button",c,l];return e&&p.push("spectrum-Button--outline"),n.classList.add(...p),n}function wn(a,t,e,r,i){let n=a;i&&(n=customElements.get("checkout-button").createCheckoutButton(a.dataset),n.connectedCallback(),n.render());let o="fill";e&&(o="outline");let c=L("sp-button",{treatment:o,variant:r,tabIndex:0,size:t?.ctas?.size??"m",...a.dataset.analyticsId&&{"data-analytics-id":a.dataset.analyticsId}},a.innerHTML);return c.source=n,(i?n.onceSettled():Promise.resolve(n)).then(l=>{c.setAttribute("data-navigation-url",l.href)}),c.addEventListener("click",l=>{l.defaultPrevented||n.click()}),c}function En(a,t,e,r,i,n,o){let c=a;if(e)try{let l=customElements.get("checkout-link");l&&(c=l.createCheckoutLink(a.dataset,a.innerHTML)??a)}catch{}return r||(c.classList.add("button","con-button"),o&&o!=="m"&&c.classList.add(`button-${o}`),t&&c.classList.add("blue"),i&&c.classList.add("primary"),n&&c.classList.add("secondary")),c}function kn(a,t,e,r,i){if(a.ctas){a.ctas=Ne(a.ctas);let{slot:n}=e.ctas,o=L("div",{slot:n},a.ctas),c=[...o.querySelectorAll("a")],l=i?.hideTrialCTAs?c.filter(h=>!en.has(h.dataset.analyticsId)):c,p=(l.length>0?l:c).map(h=>Pa(h,t,e));o.textContent="",o.append(...p),t.append(o),i?.hideTrialCTAs&&l.length>0&&p.forEach(h=>{let v=h.source??h;v.onceSettled&&(h.hidden=!0,v.onceSettled().then(()=>{v.value?.[0]?.offerType==="TRIAL"&&p.some(R=>R!==h&&!R.hidden)?h.remove():h.hidden=!1}).catch(()=>{h.hidden=!1}))})}}function Cn(a,t){let{tags:e}=a,r=e?.find(n=>typeof n=="string"&&n.startsWith(Xi))?.split("/").pop();if(!r)return;t.setAttribute(At,r),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,o)=>{n.setAttribute(Zi,`${n.dataset.analyticsId}-${o+1}`)})}function Sn(a){a.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,e])=>{a.querySelectorAll(`a.${t}`).forEach(r=>{r.classList.remove(t),r.classList.add("spectrum-Link",`spectrum-Link--${e}`)})})}function An(a){a.querySelectorAll("[slot]").forEach(r=>{r.remove()}),a.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",At].forEach(r=>a.removeAttribute(r));let e=["wide-strip","thin-strip"];a.classList.remove(...e)}async function _a(a,t){if(!a){let l=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${l}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${l}).`)}if(!a.fields){let l=a.id||"unknown",p=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${p}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${p}) is missing 'fields'.`)}let{id:e,fields:r,settings:i={},priceLiterals:n}=a,{variant:o}=r;if(!o)throw new Error(`hydrate: no variant found in payload ${e}`);An(t),t.compatVersion=r.compatVersion,t.contextPromotionCode=r.promoCode,t.settings=i,n&&(t.priceLiterals=n),t.id??(t.id=a.id),a.variationId&&t.setAttribute("variation-id",a.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:c}=t.variantLayout;if(!c)throw new Error(`hydrate: variant mapping not found for ${e}`);c.style==="consonant"&&t.setAttribute("consonant",!0),tn(r,t,c.mnemonics),an(r,t,c),nn(r,t,c.size),on(r,t),cn(r,t,c.title),rn(r,t,c),sn(r,t,c),pn(r,t,c),hn(r,t,c.backgroundImage),ln(r,t,c.allowedColors,c.backgroundColor),dn(r,t,c),gn(r,t,c),un(r,t,c,i),fn(r,t,c),vn(r,t,c,i);try{bn(r,t)}catch{}kn(r,t,c,o,i),Cn(r,t),Sn(t)}var Lt="merch-card",tr=2e4,Ma="merch-card:",Da=["full-pricing-express","simplified-pricing-express"],Fa=["segment","product"];function Ra(a,t){let e=a.closest(Lt);if(!e)return t;e.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,e.priceLiterals)),!t.promotionCode&&e.compatVersion>=1&&(t.promotionCode=e.promotionCode),e.aemFragment&&(t[Er]=!0),e.variantLayout?.priceOptionsProvider?.(a,t)}function Oa(a,t){let e=a.closest(Lt);if(!e)return t;!t.promotionCode&&e.compatVersion>=1&&(t.promotionCode=e.promotionCode)}function Ln(a){a.providers.has(Ra)||a.providers.price(Ra),a.providers.has(Oa)||a.providers.checkout(Oa)}var rt=new IntersectionObserver(a=>{a.forEach(t=>{let e=t.target;if(Da.includes(e.variant)){if(e.clientHeight===0)return;rt.unobserve(e),e.requestUpdate();return}if(Fa.includes(e.variant)){if(t.boundingClientRect.width===0)return;if(e.variant==="product"&&e.querySelector('merch-icon[slot="icons"]')){rt.unobserve(e);return}let r=e.getBoundingClientRect().width,n=e.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(r===0||n===0){rt.unobserve(e);return}e.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(r-n-16)}px`),rt.unobserve(e)}})}),zn=0,it,De,Fe,Ie,G,he,I,pe,E,de,at,rr,Tt,te=class extends Tn{constructor(){super();g(this,E);g(this,it);g(this,De);g(this,Fe);g(this,Ie);g(this,G);g(this,he);g(this,I);g(this,pe,new Promise(e=>{m(this,I,e)}));d(this,"compatVersion");d(this,"customerSegment");d(this,"marketSegment");d(this,"variantLayout");this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this),this.handleMerchOfferSelectReady=this.handleMerchOfferSelectReady.bind(this)}set contextPromotionCode(e){m(this,it,e)}firstUpdated(){this.variantLayout=qt(this),this.variantLayout?.connectedCallbackHook()}willUpdate(e){(e.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=qt(this),this.variantLayout?.connectedCallbackHook())}updated(e){!this.style.getPropertyValue("--consonant-merch-card-border-color")&&this.computedBorderColor&&(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border-color",this.computedBorderColor),e.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(e)}catch(r){z(this,E,de).call(this,`Error in postCardUpdateHook: ${r.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderColor(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":this.borderColor?this.borderColor:this.badgeBackgroundColor}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get descriptionSlot(){return this.shadowRoot.querySelector('slot[name="body-xs"')?.assignedElements()[0]}get descriptionSlotCompare(){return this.shadowRoot.querySelector('slot[name="body-m"')?.assignedElements()[0]}get iconButton(){return this.querySelector('[slot="callout-content"] .icon-button')}get price(){return this.headingmMSlot?.querySelector(b)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(W)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(W)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(W)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:e}){if(!this.stockOfferOsis)return;let r=this.checkoutLinks;if(r.length!==0)for(let i of r){await i.onceSettled();let n=i.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let c=i.dataset.wcsOsi.split(",").filter(l=>l!==o);e.checked&&c.push(o),i.dataset.wcsOsi=c.join(",")}}changeHandler(e){e.target.tagName==="MERCH-ADDON"&&this.toggleAddon(e.target)}toggleAddon(e){this.variantLayout?.toggleAddon?.(e);let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length===0)return;let i=n=>{let{offerType:o,planType:c}=n.value?.[0]??{};if(!o||!c)return;let l=e.getOsi(c,o),p=(n.dataset.wcsOsi||"").split(",").filter(h=>h&&h!==l);e.checked&&p.push(l),n.dataset.wcsOsi=p.join(",")};r.forEach(i)}handleQuantitySelection(e){let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length!==0)for(let i of r)i.dataset.quantity=e.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(e){let r={...this.filters};Object.keys(r).forEach(i=>{if(e){r[i].order=Math.min(r[i].order||2,2);return}let n=r[i].order;n===1||isNaN(n)||(r[i].order=Number(n)+1)}),this.filters=r}showInfoTooltip(e,r){let i="tooltip-left",n="tooltip-right";window.screen.width<600&&e.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(i),this.iconButton.classList.remove(n),e.getBoundingClientRect().x<100&&this.iconButton.classList.add(i),e.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(r)}handleInfoIconEvents(){let e="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(r=>this.iconButton.addEventListener(r,i=>this.showInfoTooltip(i.target,e),!1)),["mouseleave","blur"].forEach(r=>this.iconButton.addEventListener(r,()=>this.iconButton.classList.remove(e),!1)),this.iconButton.addEventListener("keydown",r=>{r.key==="Escape"&&this.iconButton.classList.remove(e)}))}includes(e){return this.textContent.match(new RegExp(e,"i"))!==null}connectedCallback(){var r;super.connectedCallback(),s(this,Fe)||m(this,Fe,zn++),this.aemFragment||((r=s(this,I))==null||r.call(this),m(this,I,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let e=this.id??s(this,Fe);m(this,he,`${Ma}${e}${lt}`),m(this,De,`${Ma}${e}${dt}`),performance.mark(s(this,he)),m(this,G,ae()),Ln(s(this,G)),m(this,Ie,s(this,G).Log.module(Lt)),this.addEventListener(O,this.handleQuantitySelection),this.addEventListener(Mt,this.handleAddonAndQuantityUpdate),this.addEventListener(mr,this.handleMerchOfferSelectReady),this.addEventListener(fe,this.handleAemFragmentEvents),this.addEventListener(ue,this.handleAemFragmentEvents),this.addEventListener(ct,this.handleInfoIconEvents),this.addEventListener("change",this.changeHandler),this.variantLayout&&this.variantLayout.connectedCallbackHook(),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(O,this.handleQuantitySelection),this.removeEventListener(fe,this.handleAemFragmentEvents),this.removeEventListener(ue,this.handleAemFragmentEvents),this.removeEventListener(ct,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(Mt,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(e){var r;if(this.isConnected&&(e.type===fe&&z(this,E,de).call(this,"AEM fragment cannot be loaded"),e.type===ue&&(this.failed=!1,e.target.nodeName==="AEM-FRAGMENT"))){let i=e.detail;try{s(this,I)||m(this,pe,new Promise(n=>{m(this,I,n)})),_a(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,I))==null||r.call(this),m(this,I,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected||this.failed)return;s(this,pe)&&(await s(this,pe),(Da.includes(this.variant)||Fa.includes(this.variant))&&rt.observe(this),m(this,pe,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let e=new Promise(o=>setTimeout(()=>o("timeout"),tr));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,e]);if(o===!1||o==="timeout"){let c=o==="timeout"?`AEM fragment was not resolved within ${tr} timeout`:"AEM fragment cannot be loaded";z(this,E,de).call(this,c,{},!1);return}}let r=[...this.querySelectorAll(pr)],i=Promise.all(r.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(c=>c.classList.contains("placeholder-resolved"))),n=await Promise.race([i,e]);if(n===!0){this.measure=performance.measure(s(this,De),s(this,he));let o={...this.aemFragment?.fetchInfo,...s(this,G).duration,measure:ve(this.measure)};return this.dispatchEvent(new CustomEvent(ct,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(s(this,De),s(this,he));let o={measure:ve(this.measure),...s(this,G).duration};n==="timeout"?z(this,E,de).call(this,`Contains offers that were not resolved within ${tr} timeout`,o):z(this,E,de).call(this,"Contains unresolved offers",o)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let e=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(W)).length===2&&e&&e.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:e,items:r}}){if(!e||!r?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(h=>h.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(h=>h.productArrangementCode===c)?.quantity,p=!!r.find(h=>h.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(ur,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==p){this.toggleStockOffer({target:this.addonCheckbox});let h=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(h,"target",{writable:!1,value:{checked:p}}),this.addonCheckbox.handleChange(h)}}get prices(){return Array.from(this.querySelectorAll(b))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let e=this.querySelector(".price.price-alternative");if(e||(e=this.querySelector(`${b}[data-template="price"] > span`)),!!e)return e=e.innerText,e}get regularPrice(){return s(this,E,at)?.innerText}get promotionCode(){let e=[...this.querySelectorAll(`${b}[data-promotion-code],${W}[data-promotion-code]`)].map(i=>i.dataset.promotionCode).filter(i=>![void 0,"cancel-context"].includes(i));if(e.length===0)return s(this,it);let r=[...new Set(e)];return r.length>1&&s(this,Ie)?.warn(`Multiple different promotion codes found: ${r.join(", ")}`),e[0]}get annualPrice(){return this.querySelector(`${b}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(s(this,E,rr)??s(this,E,at))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return s(this,E,at)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let e=".price-unit-type";return s(this,E,rr)?.querySelector(e)?.textContent?.trim()??s(this,E,at)?.querySelector(e)?.textContent?.trim()??this.querySelector(e)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let e=this.querySelector('a[is="upt-link"]');if(e)return z(this,E,Tt).call(this,e)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let e=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${W}, a`);return Array.from(e??[])}get primaryCta(){return z(this,E,Tt).call(this,this.ctas.find(e=>e.variant==="accent"||e.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return z(this,E,Tt).call(this,this.ctas.find(e=>e.variant!=="accent"&&!e.matches(".spectrum-Button--accent,.con-button.blue")))}};it=new WeakMap,De=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,G=new WeakMap,he=new WeakMap,I=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){var l;if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,G).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,(l=s(this,I))==null||l.call(this),m(this,I,void 0),s(this,G).isPreview()||(this.style.display="none"),i&&this.dispatchEvent(new CustomEvent(fr,{bubbles:!0,composed:!0,detail:c}))},at=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${b}[data-template="price"] > span`)},rr=function(){return this.querySelector(`${b}[data-template="legal"]`)},Tt=function(e){if(e)return{text:e.innerText.trim(),analyticsId:e.dataset.analyticsId,href:e.getAttribute("href")??e.dataset.href}},d(te,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},heightSync:{type:Boolean,attribute:"height-sync"},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:e=>{if(!e)return;let[r,i,n]=e.split(",");return{PUF:r,ABM:i,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:e=>Object.fromEntries(e.split(",").map(r=>{let[i,n,o]=r.split(":"),c=Number(n);return[i,{order:isNaN(c)?void 0:c,size:o}]})),toAttribute:e=>Object.entries(e).map(([r,{order:i,size:n}])=>[r,i,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:At,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),d(te,"styles",[lr,...dr()]),d(te,"registerVariant",k),d(te,"getCollectionOptions",na),d(te,"getFragmentMapping",mt);customElements.define(Lt,te);export{te as MerchCard}; diff --git a/web-components/src/compat-version.js b/web-components/src/compat-version.js new file mode 100644 index 000000000..268eea3ee --- /dev/null +++ b/web-components/src/compat-version.js @@ -0,0 +1,4 @@ +/** + * Compat version of the card where fragment level promo code applies to prices and checkout links as global promo code. + */ +export const COMPAT_VERSION_GLOBAL_PROMO_CODE = 1; diff --git a/web-components/src/hydrate.js b/web-components/src/hydrate.js index 38b7511e3..4e975994b 100644 --- a/web-components/src/hydrate.js +++ b/web-components/src/hydrate.js @@ -830,6 +830,8 @@ export async function hydrate(fragment, merchCard) { const { variant } = fields; if (!variant) throw new Error(`hydrate: no variant found in payload ${id}`); cleanup(merchCard); + merchCard.compatVersion = fields.compatVersion; + merchCard.contextPromotionCode = fields.promoCode; merchCard.settings = settings; if (priceLiterals) merchCard.priceLiterals = priceLiterals; merchCard.id ??= fragment.id; diff --git a/web-components/src/merch-card.js b/web-components/src/merch-card.js index cd5abe780..00167c90d 100644 --- a/web-components/src/merch-card.js +++ b/web-components/src/merch-card.js @@ -34,6 +34,7 @@ import { import { VariantLayout } from './variants/variant-layout.js'; import { hydrate, ANALYTICS_SECTION_ATTR } from './hydrate.js'; import { getService, printMeasure } from './utils.js'; +import { COMPAT_VERSION_GLOBAL_PROMO_CODE } from './compat-version.js'; const MERCH_CARD = 'merch-card'; @@ -56,15 +57,36 @@ function priceOptionsProvider(element, options) { options.literals ??= {}; Object.assign(options.literals, card.priceLiterals); } + if ( + !options.promotionCode && + card.compatVersion >= COMPAT_VERSION_GLOBAL_PROMO_CODE + ) { + options.promotionCode = card.promotionCode; + } if (card.aemFragment) { options[FF_DEFAULTS] = true; } card.variantLayout?.priceOptionsProvider?.(element, options); } -function registerPriceOptionsProvider(masCommerceService) { - if (masCommerceService.providers.has(priceOptionsProvider)) return; - masCommerceService.providers.price(priceOptionsProvider); +function checkoutOptionsProvider(element, options) { + const card = element.closest(MERCH_CARD); + if (!card) return options; + if ( + !options.promotionCode && + card.compatVersion >= COMPAT_VERSION_GLOBAL_PROMO_CODE + ) { + options.promotionCode = card.promotionCode; + } +} + +function registerOptionsProviders(masCommerceService) { + if (!masCommerceService.providers.has(priceOptionsProvider)) { + masCommerceService.providers.price(priceOptionsProvider); + } + if (!masCommerceService.providers.has(checkoutOptionsProvider)) { + masCommerceService.providers.checkout(checkoutOptionsProvider); + } } const intersectionObserver = new IntersectionObserver((entries) => { @@ -209,6 +231,7 @@ export class MerchCard extends LitElement { static getCollectionOptions = getCollectionOptions; + #contextPromotionCode; #durationMarkName; #internalId; // internal unique card identifier #log; @@ -219,6 +242,12 @@ export class MerchCard extends LitElement { this.#resolveHydration = resolve; }); + /** + * Compat version of the card. + * @type {number} + */ + compatVersion; + customerSegment; marketSegment; /** @@ -242,6 +271,10 @@ export class MerchCard extends LitElement { static getFragmentMapping = getFragmentMapping; + set contextPromotionCode(value) { + this.#contextPromotionCode = value; + } + firstUpdated() { this.variantLayout = getVariantLayout(this); this.variantLayout?.connectedCallbackHook(); @@ -553,7 +586,7 @@ export class MerchCard extends LitElement { this.#durationMarkName = `${MARK_MERCH_CARD_PREFIX}${logId}${MARK_DURATION_SUFFIX}`; performance.mark(this.#startMarkName); this.#service = getService(); - registerPriceOptionsProvider(this.#service); + registerOptionsProviders(this.#service); this.#log = this.#service.Log.module(MERCH_CARD); this.addEventListener( EVENT_MERCH_QUANTITY_SELECTOR_CHANGE, @@ -865,8 +898,15 @@ export class MerchCard extends LitElement { ...this.querySelectorAll( `${SELECTOR_MAS_INLINE_PRICE}[data-promotion-code],${SELECTOR_MAS_CHECKOUT_LINK}[data-promotion-code]`, ), - ].map((el) => el.dataset.promotionCode); - // Check if all promotion codes are the same + ] + .map((el) => el.dataset.promotionCode) + .filter( + (promotionCode) => + ![undefined, 'cancel-context'].includes(promotionCode), + ); + if (promotionCodes.length === 0) { + return this.#contextPromotionCode; + } const uniqueCodes = [...new Set(promotionCodes)]; if (uniqueCodes.length > 1) { this.#log?.warn( diff --git a/web-components/test/hydrate.test.js b/web-components/test/hydrate.test.js index 1044f9589..ca0000073 100644 --- a/web-components/test/hydrate.test.js +++ b/web-components/test/hydrate.test.js @@ -628,6 +628,122 @@ describe('hydrate', () => { expect(litCard.addon.getAttribute('slot')).to.equal('addon'); litCard.remove(); }); + + it('passes through missing compatVersion as undefined', async () => { + const fragment = { + fields: { + variant: 'ccd-slice', + mnemonicIcon: [], + mnemonicAlt: [], + mnemonicLink: [], + }, + }; + merchCard.variantLayout = { + aemFragmentMapping: CCD_SLICE_AEM_FRAGMENT_MAPPING, + }; + await hydrate(fragment, merchCard); + expect(merchCard.compatVersion).to.equal(undefined); + }); + + it('reads compatVersion from fragment fields', async () => { + const fragment = { + fields: { + variant: 'ccd-slice', + compatVersion: 1, + mnemonicIcon: [], + mnemonicAlt: [], + mnemonicLink: [], + }, + }; + merchCard.variantLayout = { + aemFragmentMapping: CCD_SLICE_AEM_FRAGMENT_MAPPING, + }; + await hydrate(fragment, merchCard); + expect(merchCard.compatVersion).to.equal(1); + }); + + it('passes through string compatVersion from fragment fields unchanged', async () => { + const fragment = { + fields: { + variant: 'ccd-slice', + compatVersion: '1', + mnemonicIcon: [], + mnemonicAlt: [], + mnemonicLink: [], + }, + }; + merchCard.variantLayout = { + aemFragmentMapping: CCD_SLICE_AEM_FRAGMENT_MAPPING, + }; + await hydrate(fragment, merchCard); + expect(merchCard.compatVersion).to.equal('1'); + }); + + it('copies fragment promoCode into contextPromotionCode', async () => { + const litCard = document.createElement('merch-card'); + document.body.appendChild(litCard); + await customElements.whenDefined('merch-card'); + const fragment = { + id: 'context-promo-card', + fields: { + variant: 'ccd-slice', + promoCode: 'CTX_PROMO', + mnemonicIcon: [], + mnemonicAlt: [], + mnemonicLink: [], + }, + }; + await hydrate(fragment, litCard); + // contextPromotionCode is a setter only; it surfaces via promotionCode getter + // when no price/checkout descendant carries a data-promotion-code. + expect(litCard.promotionCode).to.equal('CTX_PROMO'); + litCard.remove(); + }); +}); + +describe('MerchCard promotionCode getter', () => { + let card; + + beforeEach(async () => { + await customElements.whenDefined('merch-card'); + card = document.createElement('merch-card'); + document.body.appendChild(card); + }); + + afterEach(() => { + card.remove(); + }); + + function addPriceChild(promotionCode) { + const span = document.createElement('span'); + span.setAttribute('is', 'inline-price'); + span.dataset.wcsOsi = 'abm'; + if (promotionCode !== undefined) + span.dataset.promotionCode = promotionCode; + card.appendChild(span); + return span; + } + + it('returns contextPromotionCode when no descendant carries a promotion code', () => { + card.contextPromotionCode = 'CTX_PROMO'; + expect(card.promotionCode).to.equal('CTX_PROMO'); + }); + + it('ignores descendants with data-promotion-code="cancel-context" and falls back to contextPromotionCode', () => { + card.contextPromotionCode = 'CTX_PROMO'; + addPriceChild('cancel-context'); + expect(card.promotionCode).to.equal('CTX_PROMO'); + }); + + it('returns a descendant promotion code when present', () => { + card.contextPromotionCode = 'CTX_PROMO'; + addPriceChild('CHILD_PROMO'); + expect(card.promotionCode).to.equal('CHILD_PROMO'); + }); + + it('returns undefined when no descendant and no contextPromotionCode is set', () => { + expect(card.promotionCode).to.be.undefined; + }); }); describe('processDescription', async () => { diff --git a/web-components/test/merch-card.mini.test.html.js b/web-components/test/merch-card.mini.test.html.js index fb5442486..0d75df940 100644 --- a/web-components/test/merch-card.mini.test.html.js +++ b/web-components/test/merch-card.mini.test.html.js @@ -219,7 +219,7 @@ runTests(async () => { await card.checkReady(); const promoCode = card.promotionCode; expect(promoCode).to.equal('PROMO_ABC'); - expect(logSpy.calledOnce).to.be.true; + expect(logSpy.called).to.be.true; expect(logSpy.args[0][0]).to.include( 'Multiple different promotion codes found: PROMO_ABC, PROMO_XYZ', );