From edb4791fa118fdc1329e8a63c9863458e9c53776 Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Sun, 5 Apr 2026 23:34:55 -0600 Subject: [PATCH 01/27] MWPW-189894: fix: Lingo placeholders in Studio card preview (dictionary merge, cache race, locale/region) - Merge Odin dictionary with Studio prefetch; prefer external on key clash - Treat empty {} as no external dict in fragment-client; tighten replace init - Align preview dictionary locale with Store.localeOrRegion(); reload on region - Fragment editor: surface from path, region sync for variations, init order - Preview store: stay unresolved until placeholders exist - Router: do not clear region override on fragment editor hash sync - aem-fragment: after fetch, prefer cache entry if add() was a no-op - Forward immediate flag from SourceFragmentStore.resolvePreviewFragment --- io/www/src/fragment/transformers/replace.js | 23 ++++-- io/www/test/fragment/replace.test.js | 41 ++++++++++ studio/libs/fragment-client.js | 4 +- studio/src/mas-fragment-editor.js | 79 +++++++++++++------ studio/src/mas-repository.js | 14 ++-- .../src/reactivity/preview-fragment-store.js | 9 ++- .../src/reactivity/source-fragment-store.js | 4 +- studio/src/router.js | 6 +- studio/test/mas-fragment-editor.test.js | 22 +++++- web-components/dist/mas.js | 44 +++++------ web-components/dist/merch-card.js | 42 +++++----- web-components/src/aem-fragment.js | 5 +- 12 files changed, 204 insertions(+), 89 deletions(-) diff --git a/io/www/src/fragment/transformers/replace.js b/io/www/src/fragment/transformers/replace.js index 28adf0425..6518588a6 100644 --- a/io/www/src/fragment/transformers/replace.js +++ b/io/www/src/fragment/transformers/replace.js @@ -95,8 +95,19 @@ function collectDictionariesEntries(fragmentId, rootFragment, references, dictio } export async function getDictionary(context) { - /* c8 ignore next 1 */ - if (context.hasExternalDictionary) return context.dictionary; + const external = + context.hasExternalDictionary && context.dictionary && Object.keys(context.dictionary).length > 0 + ? context.dictionary + : null; + + if (external) { + // Studio (and similar) may prefetch a dictionary that is incomplete for the current surface/locale. + // Still load Odin so missing Lingo keys resolve; external entries win on the same key. + const odinContext = { ...context, hasExternalDictionary: false, dictionary: {} }; + const fromOdin = await getDictionary(odinContext); + return { ...fromOdin, ...external }; + } + const cachedDictionary = await getCachedDictionary(context); if (cachedDictionary && !cachedDictionary.isExpired) return cachedDictionary.dictionary; const dictionary = context.dictionary || {}; @@ -132,8 +143,7 @@ function replaceValues(input, dictionary, calls) { let replaced = ''; let nextIndex = 0; for (const match of placeholders) { - //match without {{ }} - const key = match[1]; + const key = match[2] ?? match[1]; //we concatenate everything from last iteration to index of placeholder replaced = replaced + input.slice(nextIndex, match.index); //value will be key in case of undefined or circular reference @@ -167,9 +177,8 @@ async function replace(context) { let bodyString = JSON.stringify(body); if (bodyString.match(PH_REGEXP)) { let dictionary = await context?.promises?.[TRANSFORMER_NAME]; - if (dictionary) { - //we need to merge init dictionary with the one initiated in context - dictionary = { ...dictionary, ...context.dictionary }; + if (dictionary && Object.keys(dictionary).length > 0) { + dictionary = { ...dictionary, ...(context.dictionary || {}) }; } else { dictionary = await getDictionary(context); } diff --git a/io/www/test/fragment/replace.test.js b/io/www/test/fragment/replace.test.js index 429b84119..cbeac6cb8 100644 --- a/io/www/test/fragment/replace.test.js +++ b/io/www/test/fragment/replace.test.js @@ -260,6 +260,47 @@ describe('replace', () => { expect(response.body.fields.description).to.equal('foo: lfr bar'); }); }); + + describe('hasExternalDictionary (Studio preview)', () => { + it('merges Odin dictionary so partial external map still resolves placeholders', async () => { + mockDictionary(false, fetchStub, true); + const context = { + surface: DEFAULT_SURFACE, + locale: DEFAULT_LOCALE, + loggedTransformer: 'replace', + requestId: 'mas-replace-ut', + hasExternalDictionary: true, + dictionary: { 'editor-only-key': 'from studio' }, + promises: {}, + body: odinResponse('please {{view-account}}', '{{buy-now}}'), + }; + context.promises.replace = replace.init(context); + await context.promises.replace; + const response = await replace.process(context); + expect(response.body.fields.cta).to.equal('Buy now'); + expect(response.body.fields.description).to.equal( + 'please View account for An AI tool was not used in creating this image region', + ); + }); + + it('external dictionary overrides Odin for the same key', async () => { + mockDictionary(false, fetchStub, true); + const context = { + surface: DEFAULT_SURFACE, + locale: DEFAULT_LOCALE, + loggedTransformer: 'replace', + requestId: 'mas-replace-ut', + hasExternalDictionary: true, + dictionary: { 'buy-now': 'Studio CTA' }, + promises: {}, + body: odinResponse('x', '{{buy-now}}'), + }; + context.promises.replace = replace.init(context); + await context.promises.replace; + const response = await replace.process(context); + expect(response.body.fields.cta).to.equal('Studio CTA'); + }); + }); }); export { mockDictionary }; diff --git a/studio/libs/fragment-client.js b/studio/libs/fragment-client.js index 7ab71ca18..84954efb2 100644 --- a/studio/libs/fragment-client.js +++ b/studio/libs/fragment-client.js @@ -123,7 +123,9 @@ async function previewStudioFragment(body, options) { }), }; context.fragmentsIds = context.fragmentsIds || {}; - context.hasExternalDictionary = Boolean(context.dictionary); + context.hasExternalDictionary = Boolean( + context.dictionary && Object.keys(context.dictionary).length > 0, + ); for (const transformer of [settings, replace, corrector]) { if (transformer.init) { const initContext = { diff --git a/studio/src/mas-fragment-editor.js b/studio/src/mas-fragment-editor.js index 7bf2edbc3..8b88888e1 100644 --- a/studio/src/mas-fragment-editor.js +++ b/studio/src/mas-fragment-editor.js @@ -8,7 +8,14 @@ import StoreController from './reactivity/store-controller.js'; import { CARD_MODEL_PATH, COLLECTION_MODEL_PATH, ODIN_PREVIEW_ORIGIN, PAGE_NAMES, TAG_PROMOTION_PREFIX } from './constants.js'; import router from './router.js'; import { VARIANTS } from './editors/variant-picker.js'; -import { extractLocaleFromPath, generateCodeToUse, getFragmentMapping, replaceLocaleInPath, showToast } from './utils.js'; +import { + extractLocaleFromPath, + extractSurfaceFromPath, + generateCodeToUse, + getFragmentMapping, + replaceLocaleInPath, + showToast, +} from './utils.js'; import { getSpectrumVersion } from './constants/icon-library.js'; import './editors/merch-card-editor.js'; import './editors/merch-card-collection-editor.js'; @@ -627,15 +634,46 @@ export default class MasFragmentEditor extends LitElement { return attrs; } + #ensureSearchSurfaceFromFragmentPath(fragmentPath) { + const surface = extractSurfaceFromPath(fragmentPath); + if (surface && !Store.search.value.path) { + Store.search.set((prev) => ({ ...prev, path: surface })); + } + } + // Derives locale from fragment path and applies a region override when it is safe to do so. #updateLocaleIfNeeded(path) { const locale = extractLocaleFromPath(path); - // Only update region if the current locale filter is the default (en_US) - // This preserves the locale when viewing missing variations (e.g., locale=tr_TR with en_US fragment) - if (locale && Store.filters.value.locale === 'en_US' && Store.localeOrRegion() !== locale) { + if (!locale) return; + + const filterLocale = Store.filters.value.locale; + if (locale === filterLocale) { + if (Store.search.value.region) { + Store.search.set((prev) => ({ ...prev, region: null })); + } + return; + } + + const pathLang = locale.split('_')[0]; + const filterLang = filterLocale.split('_')[0]; + const sameLanguageDifferentRegion = pathLang === filterLang && locale !== filterLocale; + + if (filterLocale === 'en_US' && Store.localeOrRegion() !== locale) { + Store.search.set((prev) => ({ ...prev, region: locale })); + return; + } + + if (sameLanguageDifferentRegion && Store.localeOrRegion() !== locale) { Store.search.set((prev) => ({ ...prev, region: locale })); } - return locale; + } + + #syncPreviewRegionForVariation(fragmentPath, isVariation) { + if (!isVariation) return; + const fragmentLocale = extractLocaleFromPath(fragmentPath); + if (fragmentLocale && fragmentLocale !== Store.localeOrRegion()) { + Store.search.set((prev) => ({ ...prev, region: fragmentLocale })); + } } // Activates a fragment store in the editor and wires reactive dependencies. @@ -689,6 +727,7 @@ export default class MasFragmentEditor extends LitElement { // Initializes editor state when the fragment already exists in the list store cache. async #initializeFromCachedStore(fragmentId, existingStore) { const fragmentPath = existingStore.get().path; + this.#ensureSearchSurfaceFromFragmentPath(fragmentPath); this.#updateLocaleIfNeeded(fragmentPath); // Reload context to correctly determine if this fragment is a variation @@ -705,15 +744,19 @@ export default class MasFragmentEditor extends LitElement { this.localeDefaultFragment = existingStore.parentFragment; } + const treatAsVariation = isVariationAfterContext && !skipVariation; + this.#syncPreviewRegionForVariation(fragmentPath, treatAsVariation); + + await this.repository.loadPreviewPlaceholders().catch(() => null); + this.updateTranslatedLocalesStore(isVariationAfterContext, fragmentPath); // no need to await - // Use existing store - just refresh it if (existingStore.previewStore) { existingStore.previewStore.resolved = false; } - this.repository.refreshFragment(existingStore).then(() => { - this.dispatchFragmentLoaded(); - }); + await this.repository.refreshFragment(existingStore); + existingStore.resolvePreviewFragment(true); + this.dispatchFragmentLoaded(); this.#activateEditorStore(existingStore, { resetChanges: true }); this.#markInitReady(); @@ -751,11 +794,10 @@ export default class MasFragmentEditor extends LitElement { // Initializes editor state for fragments that are not yet present in list store cache. async #initializeFromRepository(fragmentId) { try { - // Start loading placeholders early - const placeholdersPromise = this.repository.loadPreviewPlaceholders().catch(() => null); const fragmentData = await this.repository.aem.sites.cf.fragments.getById(fragmentId); const fragment = new Fragment(fragmentData); + this.#ensureSearchSurfaceFromFragmentPath(fragment.path); this.#updateLocaleIfNeeded(fragment.path); await this.editorContextStore.loadFragmentContext(fragmentId, fragment.path); @@ -763,8 +805,9 @@ export default class MasFragmentEditor extends LitElement { const parentFragment = await this.#resolveParentForFetchedVariation(fragmentId, fragment, isVariationAfterContext); const isVariationForStore = isVariationAfterContext || !!parentFragment; - // Wait for placeholders before creating stores (needed for preview resolution) - await placeholdersPromise; + this.#syncPreviewRegionForVariation(fragment.path, isVariationForStore); + + await this.repository.loadPreviewPlaceholders().catch(() => null); const fragmentStore = generateFragmentStore(fragment, parentFragment); // Only add to main list if not a variation (variations appear under parent's variations panel) @@ -775,16 +818,6 @@ export default class MasFragmentEditor extends LitElement { this.#activateEditorStore(fragmentStore); this.dispatchFragmentLoaded(); - // Handle locale-specific placeholder reload for variations - if (isVariationForStore) { - const fragmentLocale = extractLocaleFromPath(fragment.path); - if (fragmentLocale && fragmentLocale !== Store.localeOrRegion()) { - Store.search.set((prev) => ({ ...prev, region: fragmentLocale })); - await this.repository.loadPreviewPlaceholders(); - fragmentStore.resolvePreviewFragment(); - } - } - Store.editor.resetChanges(); this.updateTranslatedLocalesStore(isVariationForStore, fragment.path); // no need to await this.#markInitReady(); diff --git a/studio/src/mas-repository.js b/studio/src/mas-repository.js index 2e2e67ddc..cb152c6d4 100644 --- a/studio/src/mas-repository.js +++ b/studio/src/mas-repository.js @@ -150,9 +150,12 @@ export class MasRepository extends LitElement { this.#searchCursor = null; } }); - Store.search.subscribe(() => { + Store.search.subscribe((value, oldValue) => { this.dictionaryCache.clear(); this.#searchCursor = null; + if (value.region !== oldValue?.region && this.page.value === PAGE_NAMES.FRAGMENT_EDITOR) { + this.loadPreviewPlaceholders(); + } }); this.loadFolders(); @@ -646,7 +649,8 @@ export class MasRepository extends LitElement { async loadPreviewPlaceholders() { if (!this.search.value.path) return; - const cacheKey = `${this.filters.value.locale}_${this.search.value.path}`; + const previewLocale = Store.localeOrRegion(); + const cacheKey = `${previewLocale}_${this.search.value.path}`; // Return cached result if available if (this.dictionaryCache.has(cacheKey)) { @@ -671,10 +675,10 @@ export class MasRepository extends LitElement { const result = await promise; // Verify cache key hasn't changed during fetch (prevents stale data) - const currentKey = `${this.filters.value.locale}_${this.search.value.path}`; + const currentKey = `${Store.localeOrRegion()}_${this.search.value.path}`; if (currentKey === cacheKey) { // If result is empty and locale isn't en_US, try fallback - if ((!result || Object.keys(result).length === 0) && this.filters.value.locale !== 'en_US') { + if ((!result || Object.keys(result).length === 0) && Store.localeOrRegion() !== 'en_US') { const fallbackContext = { preview: { url: 'https://odinpreview.corp.adobe.com/adobe/sites/cf/fragments', @@ -707,7 +711,7 @@ export class MasRepository extends LitElement { preview: { url: 'https://odinpreview.corp.adobe.com/adobe/sites/cf/fragments', }, - locale: this.filters.value.locale, + locale: Store.localeOrRegion(), surface: this.search.value.path, networkConfig: { mainTimeout: 15000, diff --git a/studio/src/reactivity/preview-fragment-store.js b/studio/src/reactivity/preview-fragment-store.js index 112ad8cf2..1adf06711 100644 --- a/studio/src/reactivity/preview-fragment-store.js +++ b/studio/src/reactivity/preview-fragment-store.js @@ -171,13 +171,20 @@ export class PreviewFragmentStore extends FragmentStore { return; } - if (this.isCollection || !Store.placeholders.preview.value) { + if (this.isCollection) { this.resolved = true; this.refreshAemFragment(true); this.notify(); return; } + if (!Store.placeholders.preview.value) { + this.resolved = false; + this.refreshAemFragment(true); + this.notify(); + return; + } + if (!Store.surface()) { this.resolved = true; this.refreshAemFragment(true); diff --git a/studio/src/reactivity/source-fragment-store.js b/studio/src/reactivity/source-fragment-store.js index 15d6f3a99..0e5d38b42 100644 --- a/studio/src/reactivity/source-fragment-store.js +++ b/studio/src/reactivity/source-fragment-store.js @@ -81,8 +81,8 @@ export class SourceFragmentStore extends FragmentStore { return success; } - resolvePreviewFragment() { - this.previewStore.resolveFragment(); + resolvePreviewFragment(immediate = false) { + this.previewStore.resolveFragment(immediate); } refreshAemFragment() { diff --git a/studio/src/router.js b/studio/src/router.js index 3e60e5cef..29aeeebf4 100644 --- a/studio/src/router.js +++ b/studio/src/router.js @@ -498,8 +498,6 @@ export class Router extends EventTarget { } } - Store.removeRegionOverride(); - // Sync all linked stores from the current hash this.linkedStores.forEach(({ store, keysArray, defaultValue }) => { const currentValue = store.get(); @@ -507,6 +505,10 @@ export class Router extends EventTarget { this.syncStoreFromHash(store, currentValue, isObject, keysArray, defaultValue); }); + if (Store.page.value !== PAGE_NAMES.FRAGMENT_EDITOR) { + Store.removeRegionOverride(); + } + this.previousHash = this.location.hash; }); diff --git a/studio/test/mas-fragment-editor.test.js b/studio/test/mas-fragment-editor.test.js index 271c849d6..d5c28ebcc 100644 --- a/studio/test/mas-fragment-editor.test.js +++ b/studio/test/mas-fragment-editor.test.js @@ -4,7 +4,7 @@ import '../src/mas-fragment-editor.js'; import MasFragmentEditor from '../src/mas-fragment-editor.js'; import Store from '../src/store.js'; import { Fragment } from '../src/aem/fragment.js'; -import generateFragmentStore, { SourceFragmentStore } from '../src/reactivity/source-fragment-store.js'; +import generateFragmentStore from '../src/reactivity/source-fragment-store.js'; import { PAGE_NAMES, CARD_MODEL_PATH, ODIN_PREVIEW_ORIGIN } from '../src/constants.js'; import router from '../src/router.js'; import Events from '../src/events.js'; @@ -357,7 +357,6 @@ describe('MasFragmentEditor', () => { it('reloads locale placeholders for variations when active locale differs', async () => { const fragmentData = createFragmentData({ id: 'variation-id', locale: 'fr_FR', slug: 'variation' }); - const resolvePreviewSpy = sandbox.spy(SourceFragmentStore.prototype, 'resolvePreviewFragment'); Store.filters.value = { locale: 'tr_TR' }; mockRepo.aem.sites.cf.fragments.getById.resolves(fragmentData); @@ -367,11 +366,26 @@ describe('MasFragmentEditor', () => { await el.initFragment(); - expect(mockRepo.loadPreviewPlaceholders.callCount).to.equal(2); - expect(resolvePreviewSpy.calledOnce).to.be.true; + expect(mockRepo.loadPreviewPlaceholders.callCount).to.equal(1); expect(Store.search.get().region).to.equal('fr_FR'); }); + it('sets region to path locale for same-language regional variations', async () => { + Store.filters.value = { locale: 'fr_FR' }; + const variationData = createFragmentData({ id: 'fr-ch-var', locale: 'fr_CH', slug: 'regional' }); + const existingStore = generateFragmentStore(new Fragment(variationData)); + Store.fragments.list.data.value = [existingStore]; + Store.fragmentEditor.fragmentId.value = 'fr-ch-var'; + el.editorContextStore.isVariation.returns(true); + sandbox.stub(el, 'resolveVariationParentFragment').resolves( + new Fragment(createFragmentData({ id: 'parent-id', locale: 'fr_FR', slug: 'parent' })), + ); + + await el.initFragment(); + + expect(Store.search.get().region).to.equal('fr_CH'); + }); + it('uses pending parent from create variation event when context is not ready', async () => { const parentData = createFragmentData({ id: 'parent-id', locale: 'en_US', slug: 'parent' }); const variationData = createFragmentData({ id: 'new-variation-id', locale: 'fr_FR', slug: 'variation' }); diff --git a/web-components/dist/mas.js b/web-components/dist/mas.js index be6a6a0b5..2e2ab214b 100644 --- a/web-components/dist/mas.js +++ b/web-components/dist/mas.js @@ -501,9 +501,9 @@ 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 h=(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 h(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,Be,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",Be=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){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((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===Fe)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,lf,Fe,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=`[ +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 h=(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 h(e,t,i)}});var Ii,zi,hn,Gs,zr,ue,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}},ue=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 ue(r)})(e):e});var un,$i,qs,Hh,Vs,fn,js,gn,xn,Be,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",Be=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){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((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===Fe)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,Ke,ec,Bh,bt,$r,Hr,tc,Fh,bn,Dr,Ys,Xs,xt,Ks,Qs,rc,ic,g,lf,Fe,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$",Ke=`lit$${(Math.random()+"").slice(9)}$`,ec="?"+Ke,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),lf=ic(2),Fe=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,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]==='"'?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:p>=0?(i.push(l),c.slice(0,p)+yn+c.slice(p)+Xe+f):c+Xe+(p===-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 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=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!==Fe,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 Be{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 Fe}};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`=]|("|')|))|$)`,"g"),Ks=/'/g,Qs=/"/g,rc=/^(?:script|style|textarea|title)$/i,ic=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),g=ic(1),lf=ic(2),Fe=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,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]==='"'?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:p>=0?(i.push(l),c.slice(0,p)+yn+c.slice(p)+Ke+f):c+Ke+(p===-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 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=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!==Fe,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 Be{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 Fe}};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 ge,Gr,Ui=et(()=>{P();ge=class ge 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();ge.activeTooltip===this&&!r.includes(this)&&this.hideTooltip()}showTooltip(){ge.activeTooltip&&ge.activeTooltip!==this&&(ge.activeTooltip.closeOverlay(),ge.activeTooltip.tooltipVisible=!1,ge.activeTooltip.requestUpdate()),ge.activeTooltip=this,this.tooltipVisible=!0}hideTooltip(){ge.activeTooltip===this&&(ge.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` @@ -533,7 +533,7 @@ var Kn=Object.defineProperty;var Qn=e=>{throw TypeError(e)};var _l=(e,t,r)=>t in > ${this.renderIcon()} - `:this.renderIcon()}};m(ue,"activeTooltip",null),m(ue,"properties",{content:{type:String},placement:{type:String},variant:{type:String},src:{type:String},size:{type:String},tooltipText:{type:String,attribute:"tooltip-text"},tooltipPlacement:{type:String,attribute:"tooltip-placement"},mnemonicText:{type:String,attribute:"mnemonic-text"},mnemonicPlacement:{type:String,attribute:"mnemonic-placement"},tooltipVisible:{type:Boolean,state:!0}}),m(ue,"styles",b` + `:this.renderIcon()}};m(ge,"activeTooltip",null),m(ge,"properties",{content:{type:String},placement:{type:String},variant:{type:String},src:{type:String},size:{type:String},tooltipText:{type:String,attribute:"tooltip-text"},tooltipPlacement:{type:String,attribute:"tooltip-placement"},mnemonicText:{type:String,attribute:"mnemonic-text"},mnemonicPlacement:{type:String,attribute:"mnemonic-placement"},tooltipVisible:{type:Boolean,state:!0}}),m(ge,"styles",b` :host { display: contents; overflow: visible; @@ -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:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,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:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>ze,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]',Se='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},${Se},${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",Ce="failed",qe="pending",ze="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",Me=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",Te="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},Gp={[_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 p=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==p&&ud.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=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 Re=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={[Ce]:oa,[qe]:sa,[ze]:ca},xd={[Ce]:ha,[ze]: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(){[Ce,qe,ze].forEach(t=>{this.wrapperElement.classList.toggle(fd[t],t===this.state)})}notify(){(this.state===ze||this.state===Ce)&&(this.state===ze?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Ce&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Re&&(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 ze===i?Promise.resolve(this.wrapperElement):Ce===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=ze,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=Ce,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}),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<=p},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),p=r?2:0,u=n(t,{currencySymbol:o}),f=i?u.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):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 p=parseInt(d.replace("P","").replace("M",""));if(isNaN(p))return Da(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,()=>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:p,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:p,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: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(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:p,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:p,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 De=Ar;window.customElements.get(De.is)||window.customElements.define(De.is,De,{extends:De.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:p,...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};p?.toLowerCase()==="edu"?f.searchParams.set("ms","EDU"):p?.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:Me.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: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=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: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 Ho($)}let{createCheckoutLink:a}=De;return{CheckoutLink:De,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,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(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,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),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(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var u=oh(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&&as(l?.style,"::",0)){var S=nh(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=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 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: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 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,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&&(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:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,HEADER_X_REQUEST_ID:()=>xr,LOG_NAMESPACE:()=>pa,Landscape:()=>je,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:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>Ve,STATE_RESOLVED:()=>ze,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]',Se='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},${Se},${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",Ce="failed",Ve="pending",ze="resolved",je={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",Me=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",Te="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},Gp={[_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 p=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==p&&ud.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=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 me(){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 Re=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={[Ce]:oa,[Ve]:sa,[ze]:ca},xd={[Ce]:ha,[ze]:Lt},Er,We=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",Ve);m(this,"timer",null);m(this,"value");m(this,"version",0);m(this,"wrapperElement");this.wrapperElement=t,this.log=le.module("mas-element")}update(){[Ce,Ve,ze].forEach(t=>{this.wrapperElement.classList.toggle(fd[t],t===this.state)})}notify(){(this.state===ze||this.state===Ce)&&(this.state===ze?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Ce&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Re&&(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,me()),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 ze===i?Promise.resolve(this.wrapperElement):Ce===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=ze,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=Ce,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}),fi(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=Ve,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!me()||this.timer)return;let{error:r,options:i,state:a,value:n,version:o}=this;this.state=Ve,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===Ve&&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<=p},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),p=r?2:0,u=n(t,{currencySymbol:o}),f=i?u.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):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 p=parseInt(d.replace("P","").replace("M",""));if(isNaN(p))return Da(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,()=>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=me();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=bi(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 wi(e){return class extends e{constructor(){super(...arguments);m(this,"checkoutActionHandler");m(this,"masElement",new We(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=me();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=me();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: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(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=me();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 Eo(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 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 De=Ar;window.customElements.get(De.is)||window.customElements.define(De.is,De,{extends:De.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:p,...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===je.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};p?.toLowerCase()==="edu"?f.searchParams.set("ms","EDU"):p?.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:Me.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:je.PUBLISHED});function Bo({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:he,promotionCode:ie=p,wcsOsi:W,extraOptions:$,...pe}=Object.assign(v,o?.dataset??{},n??{}),be=br(z,ce,N.checkoutWorkflowStep);return v=pi({...pe,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(he),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: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:he}]=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:he,productArrangementCode:q,workflowStep:p,landscape:c,...I},pe=x[0]>1?x[0]:void 0;if(n.length===1){let{offerId:be}=n[0];$.items.push({id:be,quantity:pe})}else $.items.push(...n.map(({offerId:be,productArrangementCode:Tt})=>({id:be,quantity:pe,...O?{productArrangementCode:Tt}:{}})));return Ho($)}let{createCheckoutLink:a}=De;return{CheckoutLink:De,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,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(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,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),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(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var u=oh(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&&as(l?.style,"::",0)){var S=nh(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=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 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: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 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,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;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 $e(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(([Tl,kl])=>{if(kl==null)throw new Error(`Argument "${Tl}" is missing for osi ${z?.toString()}, country ${o}, language ${p}`)});let W={...tn,...u},$=`${p.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=$e(W,$,We.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=$e(W,$,We.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=$e(W,$,K===rn?We.taxExclusiveLabel:We.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=$e(W,$,We.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=$e(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},p=`${a.toLowerCase()}-${e.toUpperCase()}`,u="";T(t)&&(u=$e(d,p,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=$e(d,p,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=$e(d,p,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","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Lh={[Ns]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[nn]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Is]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[on]:["SG_en","KR_ko"]},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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!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:p,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: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===Ce}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=za(l);if(i.featureFlags[Te]||n[Te]){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 Oi(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=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 He=Mr;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.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: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=pi(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: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=He.createInlinePrice;return{InlinePrice:He,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[Te],{commerce:i={}}=e,a=Me.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),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(ua,i,{metadata:!1})?.toLowerCase()??i?.env)==="stage",O=br(F(ga,i),Ve,O)),C&&(a=Me.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===Me.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: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 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 Oe(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===Me.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 Re(I,{...x,...W,response:O,measure:Oe(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===Me.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=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:p,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 h(this,It)||y(this,It,{[Te]:Z(this,ut,dn).call(this,Te),[Mt]:Z(this,ut,dn).call(this,Mt)}),h(this,It)}activate(){let r=h(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")}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":Oe(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,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()),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=`${$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 Ja(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 fh(s)}function vh(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 bh(e,t){return t?Object.keys(e).reduce(function(r,i){return r[i]=vh(e[i],t[i]),r},L({},e)):e}function en(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function yh(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=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"},Ye={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 $e(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:he}={},ie={})=>{Object.entries({country:o,formatString:I,language:p,price:C}).forEach(([Tl,kl])=>{if(kl==null)throw new Error(`Argument "${Tl}" is missing for osi ${z?.toString()}, country ${o}, language ${p}`)});let W={...tn,...u},$=`${p.toLowerCase()}-${o.toUpperCase()}`,pe;he&&!v&&O?pe=e||i?C:O:r&&O?pe=O:pe=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:pe,promotion:he,quantity:f,term:Q,usePrecision:ee}),Zi="",Ji="",ea="";T(c)&&jn&&(ea=$e(W,$,Ye.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=$e(W,$,Ye.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=$e(W,$,K===rn?Ye.taxExclusiveLabel:Ye.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=$e(W,$,Ye.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=$e(W,$,Ye.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={...Ye,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},p=`${a.toLowerCase()}-${e.toUpperCase()}`,u="";T(t)&&(u=$e(d,p,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=$e(d,p,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=$e(d,p,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","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Lh={[Ns]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[nn]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Is]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[on]:["SG_en","KR_ko"]},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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!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 We(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=me();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 bi(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===Ce}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let i=me();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=za(l);if(i.featureFlags[Te]||n[Te]){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 Oi(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=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=me();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 He=Mr;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.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: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=pi(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: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=He.createInlinePrice;return{InlinePrice:He,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[Te],{commerce:i={}}=e,a=Me.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),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=je.PUBLISHED;["true",""].includes(i.allowOverride)&&(C=(F(ua,i,{metadata:!1})?.toLowerCase()??i?.env)==="stage",O=br(F(ga,i),je,O)),C&&(a=Me.STAGE,n=xa);let q=F(ma)??e.preview,Q=typeof q<"u"&&q!=="off"&&q!=="false",ee={};Q&&(ee={preview:Q});let he=F("mas-io-url")??e.masIOUrl??`https://www${a===Me.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: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:he,...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 Oe(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=me(),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}`,he=`${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===Me.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:$},pe)=>{let be=W.filter(({offerSelectorIds:Tt})=>Tt.includes(pe)).flat();be.length&&(K.delete(pe),v.delete(pe),$(be))})}else I=la}catch(W){I=`Network error: ${W.message}`}finally{ie=performance.measure(he,ee),performance.clearMarks(ee),performance.clearMeasures(he)}if(S&&v.size){t.debug("Missing:",{offerSelectorIds:[...v.keys()]});let W=vi(O);v.forEach($=>{$.reject(new Re(I,{...x,...W,response:O,measure:Oe(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===Me.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=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 he=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,he),he})}return{Commitment:rt,PlanType:po,Term:ye,applyPlanType:yr,resolveOfferSelectors:f,flushWcsCacheInternal:p,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 h(this,It)||y(this,It,{[Te]:Z(this,ut,dn).call(this,Te),[Mt]:Z(this,ut,dn).call(this,Mt)}),h(this,It)}activate(){let r=h(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")}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":Oe(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,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 We(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()),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=`${$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 Xe=gt;window.customElements.get(Xe.is)||window.customElements.define(Xe.is,Xe,{extends:Xe.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` :host { --consonant-merch-card-background-color: #fff; --consonant-merch-card-border: 1px solid @@ -905,7 +905,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" } `,hc=()=>[b` /* Tablet */ - @media screen and ${me(B)} { + @media screen and ${ue(B)} { :host([size='wide']), :host([size='super-wide']) { width: 100%; @@ -914,7 +914,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" } /* Laptop */ - @media screen and ${me(_)} { + @media screen and ${ue(_)} { :host([size='wide']) { grid-column: span 2; } @@ -2328,7 +2328,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { color: #505050; } - @media screen and ${me(re)} { + @media screen and ${ue(re)} { [class*'-merch-cards'] :host([variant='mini-compare-chart']) footer { @@ -2338,7 +2338,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { } } - @media screen and ${me(_)} { + @media screen and ${ue(_)} { :host([variant='mini-compare-chart']) footer { padding: var(--consonant-merch-spacing-xs) var(--consonant-merch-spacing-s) @@ -3279,7 +3279,7 @@ merch-card .footer-row-cell:nth-child(8) { padding-inline-start: var(--consonant-merch-spacing-xs); } - @media screen and ${me(re)} { + @media screen and ${ue(re)} { [class*'-merch-cards'] :host([variant='mini-compare-chart-mweb']) footer { @@ -3289,7 +3289,7 @@ merch-card .footer-row-cell:nth-child(8) { } } - @media screen and ${me(_)} { + @media screen and ${ue(_)} { :host([variant='mini-compare-chart-mweb']) footer { padding: 0; } @@ -3969,7 +3969,7 @@ 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 p=c.cloneNode(!0);n.prepend(p)}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 p=this.card.querySelector('[slot="heading-m"]');p&&(c+=8+Or(p));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`
+`;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 J=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(h=>{h!=null&&(wi(h)?r:i).push(h)}),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",qs=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],q,ce,F,Wt=class{constructor(){g(this,q,new Map);g(this,ce,new Map);g(this,F,new Map)}clear(){s(this,q).clear(),s(this,ce).clear(),s(this,F).clear()}add(t,e=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(s(this,q).set(t.id,t),t.fields?.originalId&&s(this,q).set(t.fields.originalId,t),s(this,F).has(t.id)){let[,r]=s(this,F).get(t.id);r()}if(s(this,F).has(t.fields?.originalId)){let[,r]=s(this,F).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,q).has(t)}entries(){return s(this,q).entries()}get(t){return s(this,q).get(t)}getAsPromise(t){let[e]=s(this,F).get(t)??[];if(e)return e;let r;return e=new Promise(i=>{r=i,this.has(t)&&i()}),s(this,F).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,q).delete(t),s(this,ce).delete(t),s(this,F).delete(t)}};q=new WeakMap,ce=new WeakMap,F=new WeakMap;var G=new Wt,Me,I,V,O,P,S,Ye,Qe,$,Xe,Ze,Re,B,Sa,Ca,Kt,Aa,kt=class extends HTMLElement{constructor(){super(...arguments);g(this,B);d(this,"cache",G);g(this,Me);g(this,I,null);g(this,V,null);g(this,O,null);g(this,P);g(this,S);g(this,Ye,Ea);g(this,Qe,5e3);g(this,$);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,P,i),m(this,S,G.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,$)){if(s(this,O)??m(this,O,ae(this)),m(this,Re,s(this,O).settings?.preview),s(this,Me)??m(this,Me,s(this,O).log.module(`${Vt}[${s(this,P)}]`)),!s(this,P)||s(this,P)==="#"){s(this,S)??m(this,S,G.getFetchInfo("missing-fragment-id")),z(this,B,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,$)&&!await Promise.race([s(this,$),Promise.resolve(!1)]))return;e&&G.remove(s(this,P)),s(this,Ye)===ka&&await Promise.race([G.getAsPromise(s(this,P)),new Promise(c=>setTimeout(c,s(this,Qe)))]);try{m(this,$,z(this,B,Aa).call(this)),await s(this,$)}catch(c){return z(this,B,Kt).call(this,c.message),!1}let{references:r,referencesTree:i,placeholders:n,wcs:o}=s(this,I)||{};return o&&!bt("mas.disableWcsCache")&&s(this,O).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,$)}get updateComplete(){return s(this,$)??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,I)}transformAuthorData(){let{fields:e,id:r,tags:i,variationId:n,settings:o={},priceLiterals:c={},dictionary:l={},placeholders:h={}}=s(this,I);m(this,V,e.reduce((p,{name:x,multiple:L,values:U})=>(p.fields[x]=L?U:U[0],p),{fields:{},id:r,tags:i,settings:o,priceLiterals:c,dictionary:l,placeholders:h,variationId:n}))}transformPublishData(){let{fields:e,id:r,tags:i,settings:n={},priceLiterals:o={},dictionary:c={},placeholders:l={},variationId:h}=s(this,I);m(this,V,Object.entries(e).reduce((p,[x,L])=>(p.fields[x]=L?.mimeType?L.value:L??"",p),{fields:{},id:r,tags:i,settings:n,priceLiterals:o,dictionary:c,placeholders:l,variationId:h}))}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,P),{locale:s(this,O).settings.locale,apiKey:s(this,O).settings.wcsApiKey,fullContext:!0})}};Me=new WeakMap,I=new WeakMap,V=new WeakMap,O=new WeakMap,P=new WeakMap,S=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,$=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,Re=new WeakMap,B=new WeakSet,Sa=async function(e){ir(this,Ze)._++;let r=`${Vt}:${s(this,P)}:${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 J(`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,B,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 J("Unexpected fragment response",{response:o,...s(this,O).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,I))return s(this,S).stale=!0,s(this,Me).error("Serving stale data",s(this,S)),s(this,I);let l=c.message??"unknown";throw new J(`Failed to fetch fragment: ${l}`,{})}},Ca=function(e){Object.assign(s(this,S),ua(e))},Kt=function(e){m(this,$,null),s(this,S).message=e,this.classList.add("error");let r={...s(this,S),...s(this,O).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=G.get(s(this,P));if(e)return m(this,I,e),!0;let{masIOUrl:r,wcsApiKey:i,country:n,locale:o}=s(this,O).settings,c=`${r}/fragment?id=${s(this,P)}&api_key=${i}&locale=${o}`;return n&&!o.endsWith(`_${n}`)&&(c+=`&country=${n}`),e=await z(this,B,Sa).call(this,c),(l=e.fields).originalId??(l.originalId=s(this,P)),G.add(e),m(this,I,G.get(s(this,P))??e),!0},d(kt,"cache",G);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 Ni}from"./lit-all.min.js";var Oi=a=>a?a.startsWith("sp-icon-")?Yt`${Ni(`<${a} class="badge-icon">`)}`:Yt``:Ri,Ne=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`
${Oi(this.icon)}${this.text}
`}};d(Ne,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"},icon:{type:String}}),d(Ne,"styles",Mi` :host { @@ -8354,4 +8354,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:h}=r,p=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,x=this.getAttribute("data-promotion-code");x&&(p+=`&promotion_code=${encodeURIComponent(x)}`),this.href=`${Ui(h)}?${p}`,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="...";function D(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,h]=gn(o,i.maxCount,i.withSuffix);l!==o&&(n.title=h,o=l)}let c=T(i.tag,n,o);e.append(c)}}function Xi(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 h={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(h.alt=c),l&&(h.href=l);let p=T("merch-icon",h);t.append(p)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function Zi(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}D("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 Ji(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}D("trialBadge",a,t,e)}}function en(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function tn(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function rn(a,t,e){a.cardTitle&&(a.cardTitle=Oe(a.cardTitle)),D("cardTitle",a,t,{cardTitle:e})}function an(a,t,e){D("subtitle",a,t,e)}function nn(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 on(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[h,p]of Object.entries(r.specialValues))if(p===a.borderColor){l=h;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 cn(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(T(e.tag,{slot:e.slot},T("img",r)))}}function Oe(a){return!a||typeof a!="string"||a.includes("(zt(),Lt)).catch(console.error),a}function sn(a,t,e){a.prices&&(a.prices=Oe(a.prices)),D("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"),h=n.includes("-outline"),p=n.includes("-link");a.classList.remove("accent","primary","secondary");let x;if(t.consonant)x=xn(a,o,r,p,c,l,e?.ctas?.size);else if(p)x=a;else{let L;o?L="accent":c?L="primary":l&&(L="secondary"),x=t.spectrum==="swc"?vn(a,e,h,L,r):fn(a,e,h,L,r)}return x}function ln(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 dn(a,t,e){a.description&&(a.description=Oe(a.description)),a.promoText&&(a.promoText=Oe(a.promoText)),a.shortDescription&&(a.shortDescription=Oe(a.shortDescription)),D("promoText",a,t,e),D("description",a,t,e),D("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),ln(t,e),D("callout",a,t,e),D("quantitySelect",a,t,e),D("whatsIncluded",a,t,e)}function hn(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=T("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 pn(a,t,e){a.addonConfirmation&&D("addonConfirmation",a,t,e)}function mn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function gn(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 x of r){if(n++,x==="<")if(o=!0,r[n]==="/")l.pop();else{let L="";for(let U of r.substring(n)){if(U===" "||U===">")break;L+=U}l.push(L)}if(x==="/"&&r[n]===">"&&l.pop(),x===">"){o=!1;continue}if(!o&&(c--,c===0))break}let h=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let x of l.reverse())h+=``}return[`${h}${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 un(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function fn(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 p of a.attributes)["class","is"].includes(p.name)||n.setAttribute(p.name,p.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",h=["spectrum-Button",c,l];return e&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function vn(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=T("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 xn(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 bn(a,t,e,r){if(a.ctas){a.ctas=Oe(a.ctas);let{slot:i}=e.ctas,n=T("div",{slot:i},a.ctas),o=[...n.querySelectorAll("a")].map(c=>za(c,t,e));n.innerHTML="",n.append(...o),t.append(n)}}function yn(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 wn(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 En(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",h=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) 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}`);En(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),Xi(r,t,c.mnemonics),Ji(r,t,c),en(r,t,c.size),tn(r,t),rn(r,t,c.title),Zi(r,t,c),an(r,t,c),sn(r,t,c),cn(r,t,c.backgroundImage),nn(r,t,c.allowedColors,c.backgroundColor),on(r,t,c),dn(r,t,c),hn(r,t,c,i),pn(r,t,c),mn(r,t,c,i);try{un(r,t)}catch{}bn(r,t,c,o),yn(r,t),wn(t)}var tr="merch-card",Jt=2e4,_a="merch-card:",Ra=["full-pricing-express","simplified-pricing-express"],Na=["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 Sn(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(Na.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)}})}),Cn=0,De,Fe,Ie,V,he,H,pe,E,de,at,er,At,te=class extends kn{constructor(){super();g(this,E);g(this,De);g(this,Fe);g(this,Ie);g(this,V);g(this,he);g(this,H);g(this,pe,new Promise(e=>{m(this,H,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){(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),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 computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${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),h=(n.dataset.wcsOsi||"").split(",").filter(p=>p&&p!==l);e.checked&&h.push(l),n.dataset.wcsOsi=h.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,Cn++),this.aemFragment||((r=s(this,H))==null||r.call(this),m(this,H,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,V,ae()),Sn(s(this,V)),m(this,Ie,s(this,V).Log.module(tr)),this.addEventListener(R,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(R,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,H)||m(this,pe,new Promise(n=>{m(this,H,n)})),Pa(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,H))==null||r.call(this),m(this,H,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;s(this,pe)&&(await s(this,pe),(Ra.includes(this.variant)||Na.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,V).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,V).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(p=>p.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(p=>p.productArrangementCode===c)?.quantity,h=!!r.find(p=>p.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(gr,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==h){this.toggleStockOffer({target:this.addonCheckbox});let p=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(p,"target",{writable:!1,value:{checked:h}}),this.addonCheckbox.handleChange(p)}}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,V=new WeakMap,he=new WeakMap,H=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,V).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,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 qi={[Y]:fr,[re]:vr,[Q]:xr},Hi={[Y]:br,[Q]: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(){[Y,re,Q].forEach(t=>{this.wrapperElement.classList.toggle(qi[t],t===this.state)})}notify(){(this.state===Q||this.state===Y)&&(this.state===Q?this.promises.forEach(({resolve:e})=>e(this.wrapperElement)):this.state===Y&&this.promises.forEach(({reject:e})=>e(this.error)),this.promises=[]);let t=this.error;this.error instanceof J&&(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 Q===r?Promise.resolve(this.wrapperElement):Y===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=Q,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=Y,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:h}=r,p=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,x=this.getAttribute("data-promotion-code");x&&(p+=`&promotion_code=${encodeURIComponent(x)}`),this.href=`${Ui(h)}?${p}`,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="...";function D(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,h]=gn(o,i.maxCount,i.withSuffix);l!==o&&(n.title=h,o=l)}let c=T(i.tag,n,o);e.append(c)}}function Xi(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 h={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(h.alt=c),l&&(h.href=l);let p=T("merch-icon",h);t.append(p)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function Zi(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}D("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 Ji(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}D("trialBadge",a,t,e)}}function en(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function tn(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function rn(a,t,e){a.cardTitle&&(a.cardTitle=Oe(a.cardTitle)),D("cardTitle",a,t,{cardTitle:e})}function an(a,t,e){D("subtitle",a,t,e)}function nn(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 on(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[h,p]of Object.entries(r.specialValues))if(p===a.borderColor){l=h;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 cn(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(T(e.tag,{slot:e.slot},T("img",r)))}}function Oe(a){return!a||typeof a!="string"||a.includes("(zt(),Lt)).catch(console.error),a}function sn(a,t,e){a.prices&&(a.prices=Oe(a.prices)),D("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"),h=n.includes("-outline"),p=n.includes("-link");a.classList.remove("accent","primary","secondary");let x;if(t.consonant)x=xn(a,o,r,p,c,l,e?.ctas?.size);else if(p)x=a;else{let L;o?L="accent":c?L="primary":l&&(L="secondary"),x=t.spectrum==="swc"?vn(a,e,h,L,r):fn(a,e,h,L,r)}return x}function ln(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 dn(a,t,e){a.description&&(a.description=Oe(a.description)),a.promoText&&(a.promoText=Oe(a.promoText)),a.shortDescription&&(a.shortDescription=Oe(a.shortDescription)),D("promoText",a,t,e),D("description",a,t,e),D("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),ln(t,e),D("callout",a,t,e),D("quantitySelect",a,t,e),D("whatsIncluded",a,t,e)}function hn(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=T("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 pn(a,t,e){a.addonConfirmation&&D("addonConfirmation",a,t,e)}function mn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function gn(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 x of r){if(n++,x==="<")if(o=!0,r[n]==="/")l.pop();else{let L="";for(let U of r.substring(n)){if(U===" "||U===">")break;L+=U}l.push(L)}if(x==="/"&&r[n]===">"&&l.pop(),x===">"){o=!1;continue}if(!o&&(c--,c===0))break}let h=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let x of l.reverse())h+=``}return[`${h}${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 un(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function fn(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 p of a.attributes)["class","is"].includes(p.name)||n.setAttribute(p.name,p.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",h=["spectrum-Button",c,l];return e&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function vn(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=T("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 xn(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 bn(a,t,e,r){if(a.ctas){a.ctas=Oe(a.ctas);let{slot:i}=e.ctas,n=T("div",{slot:i},a.ctas),o=[...n.querySelectorAll("a")].map(c=>za(c,t,e));n.innerHTML="",n.append(...o),t.append(n)}}function yn(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 wn(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 En(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",h=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) 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}`);En(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),Xi(r,t,c.mnemonics),Ji(r,t,c),en(r,t,c.size),tn(r,t),rn(r,t,c.title),Zi(r,t,c),an(r,t,c),sn(r,t,c),cn(r,t,c.backgroundImage),nn(r,t,c.allowedColors,c.backgroundColor),on(r,t,c),dn(r,t,c),hn(r,t,c,i),pn(r,t,c),mn(r,t,c,i);try{un(r,t)}catch{}bn(r,t,c,o),yn(r,t),wn(t)}var tr="merch-card",Jt=2e4,_a="merch-card:",Ra=["full-pricing-express","simplified-pricing-express"],Na=["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 Sn(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(Na.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)}})}),Cn=0,De,Fe,Ie,W,he,H,pe,E,de,at,er,At,te=class extends kn{constructor(){super();g(this,E);g(this,De);g(this,Fe);g(this,Ie);g(this,W);g(this,he);g(this,H);g(this,pe,new Promise(e=>{m(this,H,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){(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),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 computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${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(K)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(K)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(K)??[]]}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),h=(n.dataset.wcsOsi||"").split(",").filter(p=>p&&p!==l);e.checked&&h.push(l),n.dataset.wcsOsi=h.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,Cn++),this.aemFragment||((r=s(this,H))==null||r.call(this),m(this,H,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,W,ae()),Sn(s(this,W)),m(this,Ie,s(this,W).Log.module(tr)),this.addEventListener(R,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(R,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,H)||m(this,pe,new Promise(n=>{m(this,H,n)})),Pa(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,H))==null||r.call(this),m(this,H,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;s(this,pe)&&(await s(this,pe),(Ra.includes(this.variant)||Na.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,W).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,W).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(K)).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(p=>p.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(p=>p.productArrangementCode===c)?.quantity,h=!!r.find(p=>p.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(gr,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==h){this.toggleStockOffer({target:this.addonCheckbox});let p=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(p,"target",{writable:!1,value:{checked:h}}),this.addonCheckbox.handleChange(p)}}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],${K}[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(`${K}, 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,W=new WeakMap,he=new WeakMap,H=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,W).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,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}; diff --git a/web-components/src/aem-fragment.js b/web-components/src/aem-fragment.js index 02b6cb0a4..cf4f9ab64 100644 --- a/web-components/src/aem-fragment.js +++ b/web-components/src/aem-fragment.js @@ -367,7 +367,10 @@ export class AemFragment extends HTMLElement { fragment = await this.#getFragmentById(endpoint); fragment.fields.originalId ??= this.#fragmentId; cache.add(fragment); - this.#rawData = fragment; + // If add() no-ops (id already present), another writer (e.g. Studio preview) + // may have populated the cache while this fetch was in flight. Always prefer + // the cached entry so we do not overwrite resolved preview data with raw IO. + this.#rawData = cache.get(this.#fragmentId) ?? fragment; return true; } From 9ef385d33fc9e572196823e3af9ea253702da31a Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Mon, 6 Apr 2026 09:05:12 -0600 Subject: [PATCH 02/27] Revert "MWPW-189894: fix: Lingo placeholders in Studio card preview (dictionary merge, cache race, locale/region)" This reverts commit edb4791fa118fdc1329e8a63c9863458e9c53776. --- io/www/src/fragment/transformers/replace.js | 23 ++---- io/www/test/fragment/replace.test.js | 41 ---------- studio/libs/fragment-client.js | 4 +- studio/src/mas-fragment-editor.js | 79 ++++++------------- studio/src/mas-repository.js | 14 ++-- .../src/reactivity/preview-fragment-store.js | 9 +-- .../src/reactivity/source-fragment-store.js | 4 +- studio/src/router.js | 6 +- studio/test/mas-fragment-editor.test.js | 22 +----- web-components/dist/mas.js | 44 +++++------ web-components/dist/merch-card.js | 42 +++++----- web-components/src/aem-fragment.js | 5 +- 12 files changed, 89 insertions(+), 204 deletions(-) diff --git a/io/www/src/fragment/transformers/replace.js b/io/www/src/fragment/transformers/replace.js index 6518588a6..28adf0425 100644 --- a/io/www/src/fragment/transformers/replace.js +++ b/io/www/src/fragment/transformers/replace.js @@ -95,19 +95,8 @@ function collectDictionariesEntries(fragmentId, rootFragment, references, dictio } export async function getDictionary(context) { - const external = - context.hasExternalDictionary && context.dictionary && Object.keys(context.dictionary).length > 0 - ? context.dictionary - : null; - - if (external) { - // Studio (and similar) may prefetch a dictionary that is incomplete for the current surface/locale. - // Still load Odin so missing Lingo keys resolve; external entries win on the same key. - const odinContext = { ...context, hasExternalDictionary: false, dictionary: {} }; - const fromOdin = await getDictionary(odinContext); - return { ...fromOdin, ...external }; - } - + /* c8 ignore next 1 */ + if (context.hasExternalDictionary) return context.dictionary; const cachedDictionary = await getCachedDictionary(context); if (cachedDictionary && !cachedDictionary.isExpired) return cachedDictionary.dictionary; const dictionary = context.dictionary || {}; @@ -143,7 +132,8 @@ function replaceValues(input, dictionary, calls) { let replaced = ''; let nextIndex = 0; for (const match of placeholders) { - const key = match[2] ?? match[1]; + //match without {{ }} + const key = match[1]; //we concatenate everything from last iteration to index of placeholder replaced = replaced + input.slice(nextIndex, match.index); //value will be key in case of undefined or circular reference @@ -177,8 +167,9 @@ async function replace(context) { let bodyString = JSON.stringify(body); if (bodyString.match(PH_REGEXP)) { let dictionary = await context?.promises?.[TRANSFORMER_NAME]; - if (dictionary && Object.keys(dictionary).length > 0) { - dictionary = { ...dictionary, ...(context.dictionary || {}) }; + if (dictionary) { + //we need to merge init dictionary with the one initiated in context + dictionary = { ...dictionary, ...context.dictionary }; } else { dictionary = await getDictionary(context); } diff --git a/io/www/test/fragment/replace.test.js b/io/www/test/fragment/replace.test.js index cbeac6cb8..429b84119 100644 --- a/io/www/test/fragment/replace.test.js +++ b/io/www/test/fragment/replace.test.js @@ -260,47 +260,6 @@ describe('replace', () => { expect(response.body.fields.description).to.equal('foo: lfr bar'); }); }); - - describe('hasExternalDictionary (Studio preview)', () => { - it('merges Odin dictionary so partial external map still resolves placeholders', async () => { - mockDictionary(false, fetchStub, true); - const context = { - surface: DEFAULT_SURFACE, - locale: DEFAULT_LOCALE, - loggedTransformer: 'replace', - requestId: 'mas-replace-ut', - hasExternalDictionary: true, - dictionary: { 'editor-only-key': 'from studio' }, - promises: {}, - body: odinResponse('please {{view-account}}', '{{buy-now}}'), - }; - context.promises.replace = replace.init(context); - await context.promises.replace; - const response = await replace.process(context); - expect(response.body.fields.cta).to.equal('Buy now'); - expect(response.body.fields.description).to.equal( - 'please View account for An AI tool was not used in creating this image region', - ); - }); - - it('external dictionary overrides Odin for the same key', async () => { - mockDictionary(false, fetchStub, true); - const context = { - surface: DEFAULT_SURFACE, - locale: DEFAULT_LOCALE, - loggedTransformer: 'replace', - requestId: 'mas-replace-ut', - hasExternalDictionary: true, - dictionary: { 'buy-now': 'Studio CTA' }, - promises: {}, - body: odinResponse('x', '{{buy-now}}'), - }; - context.promises.replace = replace.init(context); - await context.promises.replace; - const response = await replace.process(context); - expect(response.body.fields.cta).to.equal('Studio CTA'); - }); - }); }); export { mockDictionary }; diff --git a/studio/libs/fragment-client.js b/studio/libs/fragment-client.js index 84954efb2..7ab71ca18 100644 --- a/studio/libs/fragment-client.js +++ b/studio/libs/fragment-client.js @@ -123,9 +123,7 @@ async function previewStudioFragment(body, options) { }), }; context.fragmentsIds = context.fragmentsIds || {}; - context.hasExternalDictionary = Boolean( - context.dictionary && Object.keys(context.dictionary).length > 0, - ); + context.hasExternalDictionary = Boolean(context.dictionary); for (const transformer of [settings, replace, corrector]) { if (transformer.init) { const initContext = { diff --git a/studio/src/mas-fragment-editor.js b/studio/src/mas-fragment-editor.js index 8b88888e1..7bf2edbc3 100644 --- a/studio/src/mas-fragment-editor.js +++ b/studio/src/mas-fragment-editor.js @@ -8,14 +8,7 @@ import StoreController from './reactivity/store-controller.js'; import { CARD_MODEL_PATH, COLLECTION_MODEL_PATH, ODIN_PREVIEW_ORIGIN, PAGE_NAMES, TAG_PROMOTION_PREFIX } from './constants.js'; import router from './router.js'; import { VARIANTS } from './editors/variant-picker.js'; -import { - extractLocaleFromPath, - extractSurfaceFromPath, - generateCodeToUse, - getFragmentMapping, - replaceLocaleInPath, - showToast, -} from './utils.js'; +import { extractLocaleFromPath, generateCodeToUse, getFragmentMapping, replaceLocaleInPath, showToast } from './utils.js'; import { getSpectrumVersion } from './constants/icon-library.js'; import './editors/merch-card-editor.js'; import './editors/merch-card-collection-editor.js'; @@ -634,46 +627,15 @@ export default class MasFragmentEditor extends LitElement { return attrs; } - #ensureSearchSurfaceFromFragmentPath(fragmentPath) { - const surface = extractSurfaceFromPath(fragmentPath); - if (surface && !Store.search.value.path) { - Store.search.set((prev) => ({ ...prev, path: surface })); - } - } - // Derives locale from fragment path and applies a region override when it is safe to do so. #updateLocaleIfNeeded(path) { const locale = extractLocaleFromPath(path); - if (!locale) return; - - const filterLocale = Store.filters.value.locale; - if (locale === filterLocale) { - if (Store.search.value.region) { - Store.search.set((prev) => ({ ...prev, region: null })); - } - return; - } - - const pathLang = locale.split('_')[0]; - const filterLang = filterLocale.split('_')[0]; - const sameLanguageDifferentRegion = pathLang === filterLang && locale !== filterLocale; - - if (filterLocale === 'en_US' && Store.localeOrRegion() !== locale) { - Store.search.set((prev) => ({ ...prev, region: locale })); - return; - } - - if (sameLanguageDifferentRegion && Store.localeOrRegion() !== locale) { + // Only update region if the current locale filter is the default (en_US) + // This preserves the locale when viewing missing variations (e.g., locale=tr_TR with en_US fragment) + if (locale && Store.filters.value.locale === 'en_US' && Store.localeOrRegion() !== locale) { Store.search.set((prev) => ({ ...prev, region: locale })); } - } - - #syncPreviewRegionForVariation(fragmentPath, isVariation) { - if (!isVariation) return; - const fragmentLocale = extractLocaleFromPath(fragmentPath); - if (fragmentLocale && fragmentLocale !== Store.localeOrRegion()) { - Store.search.set((prev) => ({ ...prev, region: fragmentLocale })); - } + return locale; } // Activates a fragment store in the editor and wires reactive dependencies. @@ -727,7 +689,6 @@ export default class MasFragmentEditor extends LitElement { // Initializes editor state when the fragment already exists in the list store cache. async #initializeFromCachedStore(fragmentId, existingStore) { const fragmentPath = existingStore.get().path; - this.#ensureSearchSurfaceFromFragmentPath(fragmentPath); this.#updateLocaleIfNeeded(fragmentPath); // Reload context to correctly determine if this fragment is a variation @@ -744,19 +705,15 @@ export default class MasFragmentEditor extends LitElement { this.localeDefaultFragment = existingStore.parentFragment; } - const treatAsVariation = isVariationAfterContext && !skipVariation; - this.#syncPreviewRegionForVariation(fragmentPath, treatAsVariation); - - await this.repository.loadPreviewPlaceholders().catch(() => null); - this.updateTranslatedLocalesStore(isVariationAfterContext, fragmentPath); // no need to await + // Use existing store - just refresh it if (existingStore.previewStore) { existingStore.previewStore.resolved = false; } - await this.repository.refreshFragment(existingStore); - existingStore.resolvePreviewFragment(true); - this.dispatchFragmentLoaded(); + this.repository.refreshFragment(existingStore).then(() => { + this.dispatchFragmentLoaded(); + }); this.#activateEditorStore(existingStore, { resetChanges: true }); this.#markInitReady(); @@ -794,10 +751,11 @@ export default class MasFragmentEditor extends LitElement { // Initializes editor state for fragments that are not yet present in list store cache. async #initializeFromRepository(fragmentId) { try { + // Start loading placeholders early + const placeholdersPromise = this.repository.loadPreviewPlaceholders().catch(() => null); const fragmentData = await this.repository.aem.sites.cf.fragments.getById(fragmentId); const fragment = new Fragment(fragmentData); - this.#ensureSearchSurfaceFromFragmentPath(fragment.path); this.#updateLocaleIfNeeded(fragment.path); await this.editorContextStore.loadFragmentContext(fragmentId, fragment.path); @@ -805,9 +763,8 @@ export default class MasFragmentEditor extends LitElement { const parentFragment = await this.#resolveParentForFetchedVariation(fragmentId, fragment, isVariationAfterContext); const isVariationForStore = isVariationAfterContext || !!parentFragment; - this.#syncPreviewRegionForVariation(fragment.path, isVariationForStore); - - await this.repository.loadPreviewPlaceholders().catch(() => null); + // Wait for placeholders before creating stores (needed for preview resolution) + await placeholdersPromise; const fragmentStore = generateFragmentStore(fragment, parentFragment); // Only add to main list if not a variation (variations appear under parent's variations panel) @@ -818,6 +775,16 @@ export default class MasFragmentEditor extends LitElement { this.#activateEditorStore(fragmentStore); this.dispatchFragmentLoaded(); + // Handle locale-specific placeholder reload for variations + if (isVariationForStore) { + const fragmentLocale = extractLocaleFromPath(fragment.path); + if (fragmentLocale && fragmentLocale !== Store.localeOrRegion()) { + Store.search.set((prev) => ({ ...prev, region: fragmentLocale })); + await this.repository.loadPreviewPlaceholders(); + fragmentStore.resolvePreviewFragment(); + } + } + Store.editor.resetChanges(); this.updateTranslatedLocalesStore(isVariationForStore, fragment.path); // no need to await this.#markInitReady(); diff --git a/studio/src/mas-repository.js b/studio/src/mas-repository.js index cb152c6d4..2e2e67ddc 100644 --- a/studio/src/mas-repository.js +++ b/studio/src/mas-repository.js @@ -150,12 +150,9 @@ export class MasRepository extends LitElement { this.#searchCursor = null; } }); - Store.search.subscribe((value, oldValue) => { + Store.search.subscribe(() => { this.dictionaryCache.clear(); this.#searchCursor = null; - if (value.region !== oldValue?.region && this.page.value === PAGE_NAMES.FRAGMENT_EDITOR) { - this.loadPreviewPlaceholders(); - } }); this.loadFolders(); @@ -649,8 +646,7 @@ export class MasRepository extends LitElement { async loadPreviewPlaceholders() { if (!this.search.value.path) return; - const previewLocale = Store.localeOrRegion(); - const cacheKey = `${previewLocale}_${this.search.value.path}`; + const cacheKey = `${this.filters.value.locale}_${this.search.value.path}`; // Return cached result if available if (this.dictionaryCache.has(cacheKey)) { @@ -675,10 +671,10 @@ export class MasRepository extends LitElement { const result = await promise; // Verify cache key hasn't changed during fetch (prevents stale data) - const currentKey = `${Store.localeOrRegion()}_${this.search.value.path}`; + const currentKey = `${this.filters.value.locale}_${this.search.value.path}`; if (currentKey === cacheKey) { // If result is empty and locale isn't en_US, try fallback - if ((!result || Object.keys(result).length === 0) && Store.localeOrRegion() !== 'en_US') { + if ((!result || Object.keys(result).length === 0) && this.filters.value.locale !== 'en_US') { const fallbackContext = { preview: { url: 'https://odinpreview.corp.adobe.com/adobe/sites/cf/fragments', @@ -711,7 +707,7 @@ export class MasRepository extends LitElement { preview: { url: 'https://odinpreview.corp.adobe.com/adobe/sites/cf/fragments', }, - locale: Store.localeOrRegion(), + locale: this.filters.value.locale, surface: this.search.value.path, networkConfig: { mainTimeout: 15000, diff --git a/studio/src/reactivity/preview-fragment-store.js b/studio/src/reactivity/preview-fragment-store.js index 1adf06711..112ad8cf2 100644 --- a/studio/src/reactivity/preview-fragment-store.js +++ b/studio/src/reactivity/preview-fragment-store.js @@ -171,20 +171,13 @@ export class PreviewFragmentStore extends FragmentStore { return; } - if (this.isCollection) { + if (this.isCollection || !Store.placeholders.preview.value) { this.resolved = true; this.refreshAemFragment(true); this.notify(); return; } - if (!Store.placeholders.preview.value) { - this.resolved = false; - this.refreshAemFragment(true); - this.notify(); - return; - } - if (!Store.surface()) { this.resolved = true; this.refreshAemFragment(true); diff --git a/studio/src/reactivity/source-fragment-store.js b/studio/src/reactivity/source-fragment-store.js index 0e5d38b42..15d6f3a99 100644 --- a/studio/src/reactivity/source-fragment-store.js +++ b/studio/src/reactivity/source-fragment-store.js @@ -81,8 +81,8 @@ export class SourceFragmentStore extends FragmentStore { return success; } - resolvePreviewFragment(immediate = false) { - this.previewStore.resolveFragment(immediate); + resolvePreviewFragment() { + this.previewStore.resolveFragment(); } refreshAemFragment() { diff --git a/studio/src/router.js b/studio/src/router.js index 29aeeebf4..3e60e5cef 100644 --- a/studio/src/router.js +++ b/studio/src/router.js @@ -498,6 +498,8 @@ export class Router extends EventTarget { } } + Store.removeRegionOverride(); + // Sync all linked stores from the current hash this.linkedStores.forEach(({ store, keysArray, defaultValue }) => { const currentValue = store.get(); @@ -505,10 +507,6 @@ export class Router extends EventTarget { this.syncStoreFromHash(store, currentValue, isObject, keysArray, defaultValue); }); - if (Store.page.value !== PAGE_NAMES.FRAGMENT_EDITOR) { - Store.removeRegionOverride(); - } - this.previousHash = this.location.hash; }); diff --git a/studio/test/mas-fragment-editor.test.js b/studio/test/mas-fragment-editor.test.js index d5c28ebcc..271c849d6 100644 --- a/studio/test/mas-fragment-editor.test.js +++ b/studio/test/mas-fragment-editor.test.js @@ -4,7 +4,7 @@ import '../src/mas-fragment-editor.js'; import MasFragmentEditor from '../src/mas-fragment-editor.js'; import Store from '../src/store.js'; import { Fragment } from '../src/aem/fragment.js'; -import generateFragmentStore from '../src/reactivity/source-fragment-store.js'; +import generateFragmentStore, { SourceFragmentStore } from '../src/reactivity/source-fragment-store.js'; import { PAGE_NAMES, CARD_MODEL_PATH, ODIN_PREVIEW_ORIGIN } from '../src/constants.js'; import router from '../src/router.js'; import Events from '../src/events.js'; @@ -357,6 +357,7 @@ describe('MasFragmentEditor', () => { it('reloads locale placeholders for variations when active locale differs', async () => { const fragmentData = createFragmentData({ id: 'variation-id', locale: 'fr_FR', slug: 'variation' }); + const resolvePreviewSpy = sandbox.spy(SourceFragmentStore.prototype, 'resolvePreviewFragment'); Store.filters.value = { locale: 'tr_TR' }; mockRepo.aem.sites.cf.fragments.getById.resolves(fragmentData); @@ -366,26 +367,11 @@ describe('MasFragmentEditor', () => { await el.initFragment(); - expect(mockRepo.loadPreviewPlaceholders.callCount).to.equal(1); + expect(mockRepo.loadPreviewPlaceholders.callCount).to.equal(2); + expect(resolvePreviewSpy.calledOnce).to.be.true; expect(Store.search.get().region).to.equal('fr_FR'); }); - it('sets region to path locale for same-language regional variations', async () => { - Store.filters.value = { locale: 'fr_FR' }; - const variationData = createFragmentData({ id: 'fr-ch-var', locale: 'fr_CH', slug: 'regional' }); - const existingStore = generateFragmentStore(new Fragment(variationData)); - Store.fragments.list.data.value = [existingStore]; - Store.fragmentEditor.fragmentId.value = 'fr-ch-var'; - el.editorContextStore.isVariation.returns(true); - sandbox.stub(el, 'resolveVariationParentFragment').resolves( - new Fragment(createFragmentData({ id: 'parent-id', locale: 'fr_FR', slug: 'parent' })), - ); - - await el.initFragment(); - - expect(Store.search.get().region).to.equal('fr_CH'); - }); - it('uses pending parent from create variation event when context is not ready', async () => { const parentData = createFragmentData({ id: 'parent-id', locale: 'en_US', slug: 'parent' }); const variationData = createFragmentData({ id: 'new-variation-id', locale: 'fr_FR', slug: 'variation' }); diff --git a/web-components/dist/mas.js b/web-components/dist/mas.js index 2e2ab214b..be6a6a0b5 100644 --- a/web-components/dist/mas.js +++ b/web-components/dist/mas.js @@ -501,9 +501,9 @@ 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 h=(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 h(e,t,i)}});var Ii,zi,hn,Gs,zr,ue,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}},ue=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 ue(r)})(e):e});var un,$i,qs,Hh,Vs,fn,js,gn,xn,Be,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",Be=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){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((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===Fe)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,Ke,ec,Bh,bt,$r,Hr,tc,Fh,bn,Dr,Ys,Xs,xt,Ks,Qs,rc,ic,g,lf,Fe,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$",Ke=`lit$${(Math.random()+"").slice(9)}$`,ec="?"+Ke,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=`[ +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 h=(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 h(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,Be,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",Be=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){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((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===Fe)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,lf,Fe,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),lf=ic(2),Fe=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,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]==='"'?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:p>=0?(i.push(l),c.slice(0,p)+yn+c.slice(p)+Ke+f):c+Ke+(p===-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 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=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!==Fe,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 Be{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 Fe}};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 ge,Gr,Ui=et(()=>{P();ge=class ge 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();ge.activeTooltip===this&&!r.includes(this)&&this.hideTooltip()}showTooltip(){ge.activeTooltip&&ge.activeTooltip!==this&&(ge.activeTooltip.closeOverlay(),ge.activeTooltip.tooltipVisible=!1,ge.activeTooltip.requestUpdate()),ge.activeTooltip=this,this.tooltipVisible=!0}hideTooltip(){ge.activeTooltip===this&&(ge.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"),Ks=/'/g,Qs=/"/g,rc=/^(?:script|style|textarea|title)$/i,ic=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),g=ic(1),lf=ic(2),Fe=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,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]==='"'?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:p>=0?(i.push(l),c.slice(0,p)+yn+c.slice(p)+Xe+f):c+Xe+(p===-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 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=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!==Fe,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 Be{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 Fe}};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``:g``}render(){let t=this.effectiveContent,r=this.effectivePlacement;return t?qh()?g` @@ -533,7 +533,7 @@ var Kn=Object.defineProperty;var Qn=e=>{throw TypeError(e)};var _l=(e,t,r)=>t in > ${this.renderIcon()} - `:this.renderIcon()}};m(ge,"activeTooltip",null),m(ge,"properties",{content:{type:String},placement:{type:String},variant:{type:String},src:{type:String},size:{type:String},tooltipText:{type:String,attribute:"tooltip-text"},tooltipPlacement:{type:String,attribute:"tooltip-placement"},mnemonicText:{type:String,attribute:"mnemonic-text"},mnemonicPlacement:{type:String,attribute:"mnemonic-placement"},tooltipVisible:{type:Boolean,state:!0}}),m(ge,"styles",b` + `:this.renderIcon()}};m(ue,"activeTooltip",null),m(ue,"properties",{content:{type:String},placement:{type:String},variant:{type:String},src:{type:String},size:{type:String},tooltipText:{type:String,attribute:"tooltip-text"},tooltipPlacement:{type:String,attribute:"tooltip-placement"},mnemonicText:{type:String,attribute:"mnemonic-text"},mnemonicPlacement:{type:String,attribute:"mnemonic-placement"},tooltipVisible:{type:Boolean,state:!0}}),m(ue,"styles",b` :host { display: contents; overflow: visible; @@ -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=ge;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:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,HEADER_X_REQUEST_ID:()=>xr,LOG_NAMESPACE:()=>pa,Landscape:()=>je,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:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>Ve,STATE_RESOLVED:()=>ze,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]',Se='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},${Se},${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",Ce="failed",Ve="pending",ze="resolved",je={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",Me=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",Te="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},Gp={[_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 p=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==p&&ud.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=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 me(){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 Re=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={[Ce]:oa,[Ve]:sa,[ze]:ca},xd={[Ce]:ha,[ze]:Lt},Er,We=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",Ve);m(this,"timer",null);m(this,"value");m(this,"version",0);m(this,"wrapperElement");this.wrapperElement=t,this.log=le.module("mas-element")}update(){[Ce,Ve,ze].forEach(t=>{this.wrapperElement.classList.toggle(fd[t],t===this.state)})}notify(){(this.state===ze||this.state===Ce)&&(this.state===ze?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Ce&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Re&&(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,me()),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 ze===i?Promise.resolve(this.wrapperElement):Ce===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=ze,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=Ce,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}),fi(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=Ve,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!me()||this.timer)return;let{error:r,options:i,state:a,value:n,version:o}=this;this.state=Ve,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===Ve&&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<=p},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),p=r?2:0,u=n(t,{currencySymbol:o}),f=i?u.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):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 p=parseInt(d.replace("P","").replace("M",""));if(isNaN(p))return Da(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,()=>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=me();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=bi(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 wi(e){return class extends e{constructor(){super(...arguments);m(this,"checkoutActionHandler");m(this,"masElement",new We(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=me();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=me();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: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(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=me();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 Eo(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 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 De=Ar;window.customElements.get(De.is)||window.customElements.define(De.is,De,{extends:De.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:p,...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===je.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};p?.toLowerCase()==="edu"?f.searchParams.set("ms","EDU"):p?.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:Me.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:je.PUBLISHED});function Bo({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:he,promotionCode:ie=p,wcsOsi:W,extraOptions:$,...pe}=Object.assign(v,o?.dataset??{},n??{}),be=br(z,ce,N.checkoutWorkflowStep);return v=pi({...pe,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(he),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: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:he}]=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:he,productArrangementCode:q,workflowStep:p,landscape:c,...I},pe=x[0]>1?x[0]:void 0;if(n.length===1){let{offerId:be}=n[0];$.items.push({id:be,quantity:pe})}else $.items.push(...n.map(({offerId:be,productArrangementCode:Tt})=>({id:be,quantity:pe,...O?{productArrangementCode:Tt}:{}})));return Ho($)}let{createCheckoutLink:a}=De;return{CheckoutLink:De,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,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(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,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),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(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var u=oh(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&&as(l?.style,"::",0)){var S=nh(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=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 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: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 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,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&&(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:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,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:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>ze,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]',Se='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},${Se},${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",Ce="failed",qe="pending",ze="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",Me=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",Te="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},Gp={[_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 p=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==p&&ud.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=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 Re=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={[Ce]:oa,[qe]:sa,[ze]:ca},xd={[Ce]:ha,[ze]: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(){[Ce,qe,ze].forEach(t=>{this.wrapperElement.classList.toggle(fd[t],t===this.state)})}notify(){(this.state===ze||this.state===Ce)&&(this.state===ze?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Ce&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Re&&(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 ze===i?Promise.resolve(this.wrapperElement):Ce===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=ze,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=Ce,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}),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<=p},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),p=r?2:0,u=n(t,{currencySymbol:o}),f=i?u.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):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 p=parseInt(d.replace("P","").replace("M",""));if(isNaN(p))return Da(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,()=>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:p,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:p,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: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(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:p,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:p,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 De=Ar;window.customElements.get(De.is)||window.customElements.define(De.is,De,{extends:De.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:p,...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};p?.toLowerCase()==="edu"?f.searchParams.set("ms","EDU"):p?.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:Me.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: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=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: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 Ho($)}let{createCheckoutLink:a}=De;return{CheckoutLink:De,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,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(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,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),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(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var u=oh(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&&as(l?.style,"::",0)){var S=nh(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=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 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: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 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,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;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"},Ye={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 $e(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:he}={},ie={})=>{Object.entries({country:o,formatString:I,language:p,price:C}).forEach(([Tl,kl])=>{if(kl==null)throw new Error(`Argument "${Tl}" is missing for osi ${z?.toString()}, country ${o}, language ${p}`)});let W={...tn,...u},$=`${p.toLowerCase()}-${o.toUpperCase()}`,pe;he&&!v&&O?pe=e||i?C:O:r&&O?pe=O:pe=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:pe,promotion:he,quantity:f,term:Q,usePrecision:ee}),Zi="",Ji="",ea="";T(c)&&jn&&(ea=$e(W,$,Ye.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=$e(W,$,Ye.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=$e(W,$,K===rn?Ye.taxExclusiveLabel:Ye.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=$e(W,$,Ye.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=$e(W,$,Ye.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={...Ye,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},p=`${a.toLowerCase()}-${e.toUpperCase()}`,u="";T(t)&&(u=$e(d,p,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=$e(d,p,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=$e(d,p,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","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Lh={[Ns]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[nn]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Is]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[on]:["SG_en","KR_ko"]},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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!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 We(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=me();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 bi(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===Ce}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let i=me();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=za(l);if(i.featureFlags[Te]||n[Te]){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 Oi(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=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=me();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 He=Mr;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.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: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=pi(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: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=He.createInlinePrice;return{InlinePrice:He,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[Te],{commerce:i={}}=e,a=Me.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),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=je.PUBLISHED;["true",""].includes(i.allowOverride)&&(C=(F(ua,i,{metadata:!1})?.toLowerCase()??i?.env)==="stage",O=br(F(ga,i),je,O)),C&&(a=Me.STAGE,n=xa);let q=F(ma)??e.preview,Q=typeof q<"u"&&q!=="off"&&q!=="false",ee={};Q&&(ee={preview:Q});let he=F("mas-io-url")??e.masIOUrl??`https://www${a===Me.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: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:he,...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 Oe(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=me(),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}`,he=`${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===Me.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:$},pe)=>{let be=W.filter(({offerSelectorIds:Tt})=>Tt.includes(pe)).flat();be.length&&(K.delete(pe),v.delete(pe),$(be))})}else I=la}catch(W){I=`Network error: ${W.message}`}finally{ie=performance.measure(he,ee),performance.clearMarks(ee),performance.clearMeasures(he)}if(S&&v.size){t.debug("Missing:",{offerSelectorIds:[...v.keys()]});let W=vi(O);v.forEach($=>{$.reject(new Re(I,{...x,...W,response:O,measure:Oe(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===Me.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=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 he=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,he),he})}return{Commitment:rt,PlanType:po,Term:ye,applyPlanType:yr,resolveOfferSelectors:f,flushWcsCacheInternal:p,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 h(this,It)||y(this,It,{[Te]:Z(this,ut,dn).call(this,Te),[Mt]:Z(this,ut,dn).call(this,Mt)}),h(this,It)}activate(){let r=h(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")}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":Oe(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,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 We(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()),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=`${$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 Xe=gt;window.customElements.get(Xe.is)||window.customElements.define(Xe.is,Xe,{extends:Xe.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 Ja(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 fh(s)}function vh(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 bh(e,t){return t?Object.keys(e).reduce(function(r,i){return r[i]=vh(e[i],t[i]),r},L({},e)):e}function en(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function yh(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=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 $e(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(([Tl,kl])=>{if(kl==null)throw new Error(`Argument "${Tl}" is missing for osi ${z?.toString()}, country ${o}, language ${p}`)});let W={...tn,...u},$=`${p.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=$e(W,$,We.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=$e(W,$,We.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=$e(W,$,K===rn?We.taxExclusiveLabel:We.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=$e(W,$,We.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=$e(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},p=`${a.toLowerCase()}-${e.toUpperCase()}`,u="";T(t)&&(u=$e(d,p,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=$e(d,p,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=$e(d,p,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","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Lh={[Ns]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[nn]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Is]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[on]:["SG_en","KR_ko"]},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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!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:p,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: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===Ce}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=za(l);if(i.featureFlags[Te]||n[Te]){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 Oi(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=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 He=Mr;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.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: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=pi(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: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=He.createInlinePrice;return{InlinePrice:He,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[Te],{commerce:i={}}=e,a=Me.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),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(ua,i,{metadata:!1})?.toLowerCase()??i?.env)==="stage",O=br(F(ga,i),Ve,O)),C&&(a=Me.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===Me.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: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 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 Oe(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===Me.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 Re(I,{...x,...W,response:O,measure:Oe(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===Me.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=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:p,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 h(this,It)||y(this,It,{[Te]:Z(this,ut,dn).call(this,Te),[Mt]:Z(this,ut,dn).call(this,Mt)}),h(this,It)}activate(){let r=h(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")}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":Oe(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,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()),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=`${$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` :host { --consonant-merch-card-background-color: #fff; --consonant-merch-card-border: 1px solid @@ -905,7 +905,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" } `,hc=()=>[b` /* Tablet */ - @media screen and ${ue(B)} { + @media screen and ${me(B)} { :host([size='wide']), :host([size='super-wide']) { width: 100%; @@ -914,7 +914,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" } /* Laptop */ - @media screen and ${ue(_)} { + @media screen and ${me(_)} { :host([size='wide']) { grid-column: span 2; } @@ -2328,7 +2328,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { color: #505050; } - @media screen and ${ue(re)} { + @media screen and ${me(re)} { [class*'-merch-cards'] :host([variant='mini-compare-chart']) footer { @@ -2338,7 +2338,7 @@ merch-card[variant="mini-compare-chart"] merch-mnemonic-list:nth-child(8) { } } - @media screen and ${ue(_)} { + @media screen and ${me(_)} { :host([variant='mini-compare-chart']) footer { padding: var(--consonant-merch-spacing-xs) var(--consonant-merch-spacing-s) @@ -3279,7 +3279,7 @@ merch-card .footer-row-cell:nth-child(8) { padding-inline-start: var(--consonant-merch-spacing-xs); } - @media screen and ${ue(re)} { + @media screen and ${me(re)} { [class*'-merch-cards'] :host([variant='mini-compare-chart-mweb']) footer { @@ -3289,7 +3289,7 @@ merch-card .footer-row-cell:nth-child(8) { } } - @media screen and ${ue(_)} { + @media screen and ${me(_)} { :host([variant='mini-compare-chart-mweb']) footer { padding: 0; } @@ -3969,7 +3969,7 @@ 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}()},fe=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 p=c.cloneNode(!0);n.prepend(p)}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 p=this.card.querySelector('[slot="heading-m"]');p&&(c+=8+Or(p));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`
${this.secureLabelFooter} - `}};m(fe,"variantStyle",b` + `}};m(ge,"variantStyle",b` :host([variant^='plans']) { min-height: 273px; --merch-card-plans-min-width: 244px; @@ -4101,7 +4101,7 @@ merch-card-collection:has([slot="subtitle"]) merch-card { line-height: 21px; padding: 2px 10px 3px; } - `),m(fe,"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``: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=` :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; @@ -4737,7 +4737,7 @@ 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"}},Qe=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`
+`;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(h=>{h!=null&&(wi(h)?r:i).push(h)}),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",qs=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],q,ce,F,Wt=class{constructor(){g(this,q,new Map);g(this,ce,new Map);g(this,F,new Map)}clear(){s(this,q).clear(),s(this,ce).clear(),s(this,F).clear()}add(t,e=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(s(this,q).set(t.id,t),t.fields?.originalId&&s(this,q).set(t.fields.originalId,t),s(this,F).has(t.id)){let[,r]=s(this,F).get(t.id);r()}if(s(this,F).has(t.fields?.originalId)){let[,r]=s(this,F).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,q).has(t)}entries(){return s(this,q).entries()}get(t){return s(this,q).get(t)}getAsPromise(t){let[e]=s(this,F).get(t)??[];if(e)return e;let r;return e=new Promise(i=>{r=i,this.has(t)&&i()}),s(this,F).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,q).delete(t),s(this,ce).delete(t),s(this,F).delete(t)}};q=new WeakMap,ce=new WeakMap,F=new WeakMap;var J=new Wt,Me,I,G,O,M,S,Ye,Qe,$,Xe,Ze,Re,B,Sa,Ca,Kt,Aa,kt=class extends HTMLElement{constructor(){super(...arguments);g(this,B);d(this,"cache",J);g(this,Me);g(this,I,null);g(this,G,null);g(this,O,null);g(this,M);g(this,S);g(this,Ye,Ea);g(this,Qe,5e3);g(this,$);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,$)){if(s(this,O)??m(this,O,ae(this)),m(this,Re,s(this,O).settings?.preview),s(this,Me)??m(this,Me,s(this,O).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,B,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,$)&&!await Promise.race([s(this,$),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,$,z(this,B,Aa).call(this)),await s(this,$)}catch(c){return z(this,B,Kt).call(this,c.message),!1}let{references:r,referencesTree:i,placeholders:n,wcs:o}=s(this,I)||{};return o&&!bt("mas.disableWcsCache")&&s(this,O).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,$)}get updateComplete(){return s(this,$)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return s(this,G)?s(this,G):(s(this,Xe)?this.transformAuthorData():this.transformPublishData(),s(this,G))}get rawData(){return s(this,I)}transformAuthorData(){let{fields:e,id:r,tags:i,variationId:n,settings:o={},priceLiterals:c={},dictionary:l={},placeholders:h={}}=s(this,I);m(this,G,e.reduce((p,{name:x,multiple:L,values:U})=>(p.fields[x]=L?U:U[0],p),{fields:{},id:r,tags:i,settings:o,priceLiterals:c,dictionary:l,placeholders:h,variationId:n}))}transformPublishData(){let{fields:e,id:r,tags:i,settings:n={},priceLiterals:o={},dictionary:c={},placeholders:l={},variationId:h}=s(this,I);m(this,G,Object.entries(e).reduce((p,[x,L])=>(p.fields[x]=L?.mimeType?L.value:L??"",p),{fields:{},id:r,tags:i,settings:n,priceLiterals:o,dictionary:c,placeholders:l,variationId:h}))}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,O).settings.locale,apiKey:s(this,O).settings.wcsApiKey,fullContext:!0})}};Me=new WeakMap,I=new WeakMap,G=new WeakMap,O=new WeakMap,M=new WeakMap,S=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,$=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,Re=new WeakMap,B=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,B,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,O).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,I))return s(this,S).stale=!0,s(this,Me).error("Serving stale data",s(this,S)),s(this,I);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,$,null),s(this,S).message=e,this.classList.add("error");let r={...s(this,S),...s(this,O).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,G,null);let e=J.get(s(this,M));if(e)return m(this,I,e),!0;let{masIOUrl:r,wcsApiKey:i,country:n,locale:o}=s(this,O).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,B,Sa).call(this,c),(l=e.fields).originalId??(l.originalId=s(this,M)),J.add(e),m(this,I,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 Ni}from"./lit-all.min.js";var Oi=a=>a?a.startsWith("sp-icon-")?Yt`${Ni(`<${a} class="badge-icon">`)}`:Yt``:Ri,Ne=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`
${Oi(this.icon)}${this.text}
`}};d(Ne,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"},icon:{type:String}}),d(Ne,"styles",Mi` :host { @@ -8354,4 +8354,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={[Y]:fr,[re]:vr,[Q]:xr},Hi={[Y]:br,[Q]: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(){[Y,re,Q].forEach(t=>{this.wrapperElement.classList.toggle(qi[t],t===this.state)})}notify(){(this.state===Q||this.state===Y)&&(this.state===Q?this.promises.forEach(({resolve:e})=>e(this.wrapperElement)):this.state===Y&&this.promises.forEach(({reject:e})=>e(this.error)),this.promises=[]);let t=this.error;this.error instanceof J&&(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 Q===r?Promise.resolve(this.wrapperElement):Y===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=Q,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=Y,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:h}=r,p=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,x=this.getAttribute("data-promotion-code");x&&(p+=`&promotion_code=${encodeURIComponent(x)}`),this.href=`${Ui(h)}?${p}`,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="...";function D(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,h]=gn(o,i.maxCount,i.withSuffix);l!==o&&(n.title=h,o=l)}let c=T(i.tag,n,o);e.append(c)}}function Xi(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 h={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(h.alt=c),l&&(h.href=l);let p=T("merch-icon",h);t.append(p)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function Zi(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}D("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 Ji(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}D("trialBadge",a,t,e)}}function en(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function tn(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function rn(a,t,e){a.cardTitle&&(a.cardTitle=Oe(a.cardTitle)),D("cardTitle",a,t,{cardTitle:e})}function an(a,t,e){D("subtitle",a,t,e)}function nn(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 on(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[h,p]of Object.entries(r.specialValues))if(p===a.borderColor){l=h;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 cn(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(T(e.tag,{slot:e.slot},T("img",r)))}}function Oe(a){return!a||typeof a!="string"||a.includes("(zt(),Lt)).catch(console.error),a}function sn(a,t,e){a.prices&&(a.prices=Oe(a.prices)),D("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"),h=n.includes("-outline"),p=n.includes("-link");a.classList.remove("accent","primary","secondary");let x;if(t.consonant)x=xn(a,o,r,p,c,l,e?.ctas?.size);else if(p)x=a;else{let L;o?L="accent":c?L="primary":l&&(L="secondary"),x=t.spectrum==="swc"?vn(a,e,h,L,r):fn(a,e,h,L,r)}return x}function ln(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 dn(a,t,e){a.description&&(a.description=Oe(a.description)),a.promoText&&(a.promoText=Oe(a.promoText)),a.shortDescription&&(a.shortDescription=Oe(a.shortDescription)),D("promoText",a,t,e),D("description",a,t,e),D("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),ln(t,e),D("callout",a,t,e),D("quantitySelect",a,t,e),D("whatsIncluded",a,t,e)}function hn(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=T("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 pn(a,t,e){a.addonConfirmation&&D("addonConfirmation",a,t,e)}function mn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function gn(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 x of r){if(n++,x==="<")if(o=!0,r[n]==="/")l.pop();else{let L="";for(let U of r.substring(n)){if(U===" "||U===">")break;L+=U}l.push(L)}if(x==="/"&&r[n]===">"&&l.pop(),x===">"){o=!1;continue}if(!o&&(c--,c===0))break}let h=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let x of l.reverse())h+=``}return[`${h}${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 un(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function fn(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 p of a.attributes)["class","is"].includes(p.name)||n.setAttribute(p.name,p.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",h=["spectrum-Button",c,l];return e&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function vn(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=T("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 xn(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 bn(a,t,e,r){if(a.ctas){a.ctas=Oe(a.ctas);let{slot:i}=e.ctas,n=T("div",{slot:i},a.ctas),o=[...n.querySelectorAll("a")].map(c=>za(c,t,e));n.innerHTML="",n.append(...o),t.append(n)}}function yn(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 wn(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 En(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",h=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) 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}`);En(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),Xi(r,t,c.mnemonics),Ji(r,t,c),en(r,t,c.size),tn(r,t),rn(r,t,c.title),Zi(r,t,c),an(r,t,c),sn(r,t,c),cn(r,t,c.backgroundImage),nn(r,t,c.allowedColors,c.backgroundColor),on(r,t,c),dn(r,t,c),hn(r,t,c,i),pn(r,t,c),mn(r,t,c,i);try{un(r,t)}catch{}bn(r,t,c,o),yn(r,t),wn(t)}var tr="merch-card",Jt=2e4,_a="merch-card:",Ra=["full-pricing-express","simplified-pricing-express"],Na=["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 Sn(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(Na.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)}})}),Cn=0,De,Fe,Ie,W,he,H,pe,E,de,at,er,At,te=class extends kn{constructor(){super();g(this,E);g(this,De);g(this,Fe);g(this,Ie);g(this,W);g(this,he);g(this,H);g(this,pe,new Promise(e=>{m(this,H,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){(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),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 computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${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(K)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(K)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(K)??[]]}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),h=(n.dataset.wcsOsi||"").split(",").filter(p=>p&&p!==l);e.checked&&h.push(l),n.dataset.wcsOsi=h.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,Cn++),this.aemFragment||((r=s(this,H))==null||r.call(this),m(this,H,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,W,ae()),Sn(s(this,W)),m(this,Ie,s(this,W).Log.module(tr)),this.addEventListener(R,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(R,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,H)||m(this,pe,new Promise(n=>{m(this,H,n)})),Pa(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,H))==null||r.call(this),m(this,H,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;s(this,pe)&&(await s(this,pe),(Ra.includes(this.variant)||Na.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,W).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,W).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(K)).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(p=>p.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(p=>p.productArrangementCode===c)?.quantity,h=!!r.find(p=>p.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(gr,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==h){this.toggleStockOffer({target:this.addonCheckbox});let p=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(p,"target",{writable:!1,value:{checked:h}}),this.addonCheckbox.handleChange(p)}}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],${K}[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(`${K}, 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,W=new WeakMap,he=new WeakMap,H=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,W).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,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 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:h}=r,p=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,x=this.getAttribute("data-promotion-code");x&&(p+=`&promotion_code=${encodeURIComponent(x)}`),this.href=`${Ui(h)}?${p}`,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="...";function D(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,h]=gn(o,i.maxCount,i.withSuffix);l!==o&&(n.title=h,o=l)}let c=T(i.tag,n,o);e.append(c)}}function Xi(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 h={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(h.alt=c),l&&(h.href=l);let p=T("merch-icon",h);t.append(p)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function Zi(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}D("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 Ji(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}D("trialBadge",a,t,e)}}function en(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function tn(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function rn(a,t,e){a.cardTitle&&(a.cardTitle=Oe(a.cardTitle)),D("cardTitle",a,t,{cardTitle:e})}function an(a,t,e){D("subtitle",a,t,e)}function nn(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 on(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[h,p]of Object.entries(r.specialValues))if(p===a.borderColor){l=h;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 cn(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(T(e.tag,{slot:e.slot},T("img",r)))}}function Oe(a){return!a||typeof a!="string"||a.includes("(zt(),Lt)).catch(console.error),a}function sn(a,t,e){a.prices&&(a.prices=Oe(a.prices)),D("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"),h=n.includes("-outline"),p=n.includes("-link");a.classList.remove("accent","primary","secondary");let x;if(t.consonant)x=xn(a,o,r,p,c,l,e?.ctas?.size);else if(p)x=a;else{let L;o?L="accent":c?L="primary":l&&(L="secondary"),x=t.spectrum==="swc"?vn(a,e,h,L,r):fn(a,e,h,L,r)}return x}function ln(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 dn(a,t,e){a.description&&(a.description=Oe(a.description)),a.promoText&&(a.promoText=Oe(a.promoText)),a.shortDescription&&(a.shortDescription=Oe(a.shortDescription)),D("promoText",a,t,e),D("description",a,t,e),D("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),ln(t,e),D("callout",a,t,e),D("quantitySelect",a,t,e),D("whatsIncluded",a,t,e)}function hn(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=T("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 pn(a,t,e){a.addonConfirmation&&D("addonConfirmation",a,t,e)}function mn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function gn(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 x of r){if(n++,x==="<")if(o=!0,r[n]==="/")l.pop();else{let L="";for(let U of r.substring(n)){if(U===" "||U===">")break;L+=U}l.push(L)}if(x==="/"&&r[n]===">"&&l.pop(),x===">"){o=!1;continue}if(!o&&(c--,c===0))break}let h=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let x of l.reverse())h+=``}return[`${h}${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 un(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function fn(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 p of a.attributes)["class","is"].includes(p.name)||n.setAttribute(p.name,p.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",h=["spectrum-Button",c,l];return e&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function vn(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=T("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 xn(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 bn(a,t,e,r){if(a.ctas){a.ctas=Oe(a.ctas);let{slot:i}=e.ctas,n=T("div",{slot:i},a.ctas),o=[...n.querySelectorAll("a")].map(c=>za(c,t,e));n.innerHTML="",n.append(...o),t.append(n)}}function yn(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 wn(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 En(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",h=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) 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}`);En(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),Xi(r,t,c.mnemonics),Ji(r,t,c),en(r,t,c.size),tn(r,t),rn(r,t,c.title),Zi(r,t,c),an(r,t,c),sn(r,t,c),cn(r,t,c.backgroundImage),nn(r,t,c.allowedColors,c.backgroundColor),on(r,t,c),dn(r,t,c),hn(r,t,c,i),pn(r,t,c),mn(r,t,c,i);try{un(r,t)}catch{}bn(r,t,c,o),yn(r,t),wn(t)}var tr="merch-card",Jt=2e4,_a="merch-card:",Ra=["full-pricing-express","simplified-pricing-express"],Na=["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 Sn(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(Na.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)}})}),Cn=0,De,Fe,Ie,V,he,H,pe,E,de,at,er,At,te=class extends kn{constructor(){super();g(this,E);g(this,De);g(this,Fe);g(this,Ie);g(this,V);g(this,he);g(this,H);g(this,pe,new Promise(e=>{m(this,H,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){(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),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 computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${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),h=(n.dataset.wcsOsi||"").split(",").filter(p=>p&&p!==l);e.checked&&h.push(l),n.dataset.wcsOsi=h.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,Cn++),this.aemFragment||((r=s(this,H))==null||r.call(this),m(this,H,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,V,ae()),Sn(s(this,V)),m(this,Ie,s(this,V).Log.module(tr)),this.addEventListener(R,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(R,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,H)||m(this,pe,new Promise(n=>{m(this,H,n)})),Pa(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,H))==null||r.call(this),m(this,H,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;s(this,pe)&&(await s(this,pe),(Ra.includes(this.variant)||Na.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,V).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,V).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(p=>p.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(p=>p.productArrangementCode===c)?.quantity,h=!!r.find(p=>p.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(gr,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==h){this.toggleStockOffer({target:this.addonCheckbox});let p=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(p,"target",{writable:!1,value:{checked:h}}),this.addonCheckbox.handleChange(p)}}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,V=new WeakMap,he=new WeakMap,H=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,V).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,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}; diff --git a/web-components/src/aem-fragment.js b/web-components/src/aem-fragment.js index cf4f9ab64..02b6cb0a4 100644 --- a/web-components/src/aem-fragment.js +++ b/web-components/src/aem-fragment.js @@ -367,10 +367,7 @@ export class AemFragment extends HTMLElement { fragment = await this.#getFragmentById(endpoint); fragment.fields.originalId ??= this.#fragmentId; cache.add(fragment); - // If add() no-ops (id already present), another writer (e.g. Studio preview) - // may have populated the cache while this fetch was in flight. Always prefer - // the cached entry so we do not overwrite resolved preview data with raw IO. - this.#rawData = cache.get(this.#fragmentId) ?? fragment; + this.#rawData = fragment; return true; } From 4c1e9ff897bebfe95e8d8cc35b0db23538cfd4e6 Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Tue, 7 Apr 2026 09:52:28 -0600 Subject: [PATCH 03/27] MWPW-189894: Fix - Lingo placeholders in Studio card preview --- studio/src/mas-fragment-editor.js | 83 +++++++++++++------ studio/src/mas-repository.js | 14 ++-- .../src/reactivity/source-fragment-store.js | 4 +- studio/src/router.js | 6 +- studio/test/mas-fragment-editor.test.js | 25 ++++-- 5 files changed, 94 insertions(+), 38 deletions(-) diff --git a/studio/src/mas-fragment-editor.js b/studio/src/mas-fragment-editor.js index 7bf2edbc3..47a9345bb 100644 --- a/studio/src/mas-fragment-editor.js +++ b/studio/src/mas-fragment-editor.js @@ -8,7 +8,14 @@ import StoreController from './reactivity/store-controller.js'; import { CARD_MODEL_PATH, COLLECTION_MODEL_PATH, ODIN_PREVIEW_ORIGIN, PAGE_NAMES, TAG_PROMOTION_PREFIX } from './constants.js'; import router from './router.js'; import { VARIANTS } from './editors/variant-picker.js'; -import { extractLocaleFromPath, generateCodeToUse, getFragmentMapping, replaceLocaleInPath, showToast } from './utils.js'; +import { + extractLocaleFromPath, + extractSurfaceFromPath, + generateCodeToUse, + getFragmentMapping, + replaceLocaleInPath, + showToast, +} from './utils.js'; import { getSpectrumVersion } from './constants/icon-library.js'; import './editors/merch-card-editor.js'; import './editors/merch-card-collection-editor.js'; @@ -627,15 +634,48 @@ export default class MasFragmentEditor extends LitElement { return attrs; } - // Derives locale from fragment path and applies a region override when it is safe to do so. + #ensureSearchSurfaceFromFragmentPath(fragmentPath) { + const surface = extractSurfaceFromPath(fragmentPath); + if (surface && !Store.search.value.path) { + Store.search.set((prev) => ({ ...prev, path: surface })); + } + } + + /** + * Sets `Store.search.region` when preview Lingo should follow the fragment path, not only the list filter. + */ #updateLocaleIfNeeded(path) { const locale = extractLocaleFromPath(path); - // Only update region if the current locale filter is the default (en_US) - // This preserves the locale when viewing missing variations (e.g., locale=tr_TR with en_US fragment) - if (locale && Store.filters.value.locale === 'en_US' && Store.localeOrRegion() !== locale) { + if (!locale) return; + + const filterLocale = Store.filters.value.locale; + if (locale === filterLocale) { + if (Store.search.value.region) { + Store.search.set((prev) => ({ ...prev, region: null })); + } + return; + } + + const pathLang = locale.split('_')[0]; + const filterLang = filterLocale.split('_')[0]; + const sameLanguageDifferentRegion = pathLang === filterLang && locale !== filterLocale; + + if (filterLocale === 'en_US' && Store.localeOrRegion() !== locale) { + Store.search.set((prev) => ({ ...prev, region: locale })); + return; + } + + if (sameLanguageDifferentRegion && Store.localeOrRegion() !== locale) { Store.search.set((prev) => ({ ...prev, region: locale })); } - return locale; + } + + #syncPreviewRegionForVariation(fragmentPath, isVariation) { + if (!isVariation) return; + const fragmentLocale = extractLocaleFromPath(fragmentPath); + if (fragmentLocale && fragmentLocale !== Store.localeOrRegion()) { + Store.search.set((prev) => ({ ...prev, region: fragmentLocale })); + } } // Activates a fragment store in the editor and wires reactive dependencies. @@ -689,6 +729,7 @@ export default class MasFragmentEditor extends LitElement { // Initializes editor state when the fragment already exists in the list store cache. async #initializeFromCachedStore(fragmentId, existingStore) { const fragmentPath = existingStore.get().path; + this.#ensureSearchSurfaceFromFragmentPath(fragmentPath); this.#updateLocaleIfNeeded(fragmentPath); // Reload context to correctly determine if this fragment is a variation @@ -705,15 +746,19 @@ export default class MasFragmentEditor extends LitElement { this.localeDefaultFragment = existingStore.parentFragment; } + const treatAsVariation = isVariationAfterContext && !skipVariation; + this.#syncPreviewRegionForVariation(fragmentPath, treatAsVariation); + + await this.repository.loadPreviewPlaceholders().catch(() => null); + this.updateTranslatedLocalesStore(isVariationAfterContext, fragmentPath); // no need to await - // Use existing store - just refresh it if (existingStore.previewStore) { existingStore.previewStore.resolved = false; } - this.repository.refreshFragment(existingStore).then(() => { - this.dispatchFragmentLoaded(); - }); + await this.repository.refreshFragment(existingStore); + existingStore.resolvePreviewFragment(true); + this.dispatchFragmentLoaded(); this.#activateEditorStore(existingStore, { resetChanges: true }); this.#markInitReady(); @@ -751,11 +796,10 @@ export default class MasFragmentEditor extends LitElement { // Initializes editor state for fragments that are not yet present in list store cache. async #initializeFromRepository(fragmentId) { try { - // Start loading placeholders early - const placeholdersPromise = this.repository.loadPreviewPlaceholders().catch(() => null); const fragmentData = await this.repository.aem.sites.cf.fragments.getById(fragmentId); const fragment = new Fragment(fragmentData); + this.#ensureSearchSurfaceFromFragmentPath(fragment.path); this.#updateLocaleIfNeeded(fragment.path); await this.editorContextStore.loadFragmentContext(fragmentId, fragment.path); @@ -763,8 +807,9 @@ export default class MasFragmentEditor extends LitElement { const parentFragment = await this.#resolveParentForFetchedVariation(fragmentId, fragment, isVariationAfterContext); const isVariationForStore = isVariationAfterContext || !!parentFragment; - // Wait for placeholders before creating stores (needed for preview resolution) - await placeholdersPromise; + this.#syncPreviewRegionForVariation(fragment.path, isVariationForStore); + + await this.repository.loadPreviewPlaceholders().catch(() => null); const fragmentStore = generateFragmentStore(fragment, parentFragment); // Only add to main list if not a variation (variations appear under parent's variations panel) @@ -775,16 +820,6 @@ export default class MasFragmentEditor extends LitElement { this.#activateEditorStore(fragmentStore); this.dispatchFragmentLoaded(); - // Handle locale-specific placeholder reload for variations - if (isVariationForStore) { - const fragmentLocale = extractLocaleFromPath(fragment.path); - if (fragmentLocale && fragmentLocale !== Store.localeOrRegion()) { - Store.search.set((prev) => ({ ...prev, region: fragmentLocale })); - await this.repository.loadPreviewPlaceholders(); - fragmentStore.resolvePreviewFragment(); - } - } - Store.editor.resetChanges(); this.updateTranslatedLocalesStore(isVariationForStore, fragment.path); // no need to await this.#markInitReady(); diff --git a/studio/src/mas-repository.js b/studio/src/mas-repository.js index 2e2e67ddc..cb152c6d4 100644 --- a/studio/src/mas-repository.js +++ b/studio/src/mas-repository.js @@ -150,9 +150,12 @@ export class MasRepository extends LitElement { this.#searchCursor = null; } }); - Store.search.subscribe(() => { + Store.search.subscribe((value, oldValue) => { this.dictionaryCache.clear(); this.#searchCursor = null; + if (value.region !== oldValue?.region && this.page.value === PAGE_NAMES.FRAGMENT_EDITOR) { + this.loadPreviewPlaceholders(); + } }); this.loadFolders(); @@ -646,7 +649,8 @@ export class MasRepository extends LitElement { async loadPreviewPlaceholders() { if (!this.search.value.path) return; - const cacheKey = `${this.filters.value.locale}_${this.search.value.path}`; + const previewLocale = Store.localeOrRegion(); + const cacheKey = `${previewLocale}_${this.search.value.path}`; // Return cached result if available if (this.dictionaryCache.has(cacheKey)) { @@ -671,10 +675,10 @@ export class MasRepository extends LitElement { const result = await promise; // Verify cache key hasn't changed during fetch (prevents stale data) - const currentKey = `${this.filters.value.locale}_${this.search.value.path}`; + const currentKey = `${Store.localeOrRegion()}_${this.search.value.path}`; if (currentKey === cacheKey) { // If result is empty and locale isn't en_US, try fallback - if ((!result || Object.keys(result).length === 0) && this.filters.value.locale !== 'en_US') { + if ((!result || Object.keys(result).length === 0) && Store.localeOrRegion() !== 'en_US') { const fallbackContext = { preview: { url: 'https://odinpreview.corp.adobe.com/adobe/sites/cf/fragments', @@ -707,7 +711,7 @@ export class MasRepository extends LitElement { preview: { url: 'https://odinpreview.corp.adobe.com/adobe/sites/cf/fragments', }, - locale: this.filters.value.locale, + locale: Store.localeOrRegion(), surface: this.search.value.path, networkConfig: { mainTimeout: 15000, diff --git a/studio/src/reactivity/source-fragment-store.js b/studio/src/reactivity/source-fragment-store.js index 15d6f3a99..0e5d38b42 100644 --- a/studio/src/reactivity/source-fragment-store.js +++ b/studio/src/reactivity/source-fragment-store.js @@ -81,8 +81,8 @@ export class SourceFragmentStore extends FragmentStore { return success; } - resolvePreviewFragment() { - this.previewStore.resolveFragment(); + resolvePreviewFragment(immediate = false) { + this.previewStore.resolveFragment(immediate); } refreshAemFragment() { diff --git a/studio/src/router.js b/studio/src/router.js index 3e60e5cef..29aeeebf4 100644 --- a/studio/src/router.js +++ b/studio/src/router.js @@ -498,8 +498,6 @@ export class Router extends EventTarget { } } - Store.removeRegionOverride(); - // Sync all linked stores from the current hash this.linkedStores.forEach(({ store, keysArray, defaultValue }) => { const currentValue = store.get(); @@ -507,6 +505,10 @@ export class Router extends EventTarget { this.syncStoreFromHash(store, currentValue, isObject, keysArray, defaultValue); }); + if (Store.page.value !== PAGE_NAMES.FRAGMENT_EDITOR) { + Store.removeRegionOverride(); + } + this.previousHash = this.location.hash; }); diff --git a/studio/test/mas-fragment-editor.test.js b/studio/test/mas-fragment-editor.test.js index 271c849d6..8d607033a 100644 --- a/studio/test/mas-fragment-editor.test.js +++ b/studio/test/mas-fragment-editor.test.js @@ -4,7 +4,7 @@ import '../src/mas-fragment-editor.js'; import MasFragmentEditor from '../src/mas-fragment-editor.js'; import Store from '../src/store.js'; import { Fragment } from '../src/aem/fragment.js'; -import generateFragmentStore, { SourceFragmentStore } from '../src/reactivity/source-fragment-store.js'; +import generateFragmentStore from '../src/reactivity/source-fragment-store.js'; import { PAGE_NAMES, CARD_MODEL_PATH, ODIN_PREVIEW_ORIGIN } from '../src/constants.js'; import router from '../src/router.js'; import Events from '../src/events.js'; @@ -283,10 +283,11 @@ describe('MasFragmentEditor', () => { await el.initFragment(); + expect(mockRepo.loadPreviewPlaceholders.calledOnce).to.be.true; expect(mockRepo.refreshFragment.calledOnce).to.be.true; expect(el.editorContextStore.loadFragmentContext.calledOnceWith('existing-id', existingData.path)).to.be.true; expect(el.inEdit.get()).to.equal(existingStore); - expect(existingStore.previewStore.resolved).to.equal(false); + expect(existingStore.previewStore.resolved).to.equal(true); expect(Store.search.get().region).to.equal('fr_FR'); expect(el.updateTranslatedLocalesStore.calledOnceWith(false, existingData.path)).to.be.true; expect(el.initState).to.equal(MasFragmentEditor.INIT_STATE.READY); @@ -357,7 +358,6 @@ describe('MasFragmentEditor', () => { it('reloads locale placeholders for variations when active locale differs', async () => { const fragmentData = createFragmentData({ id: 'variation-id', locale: 'fr_FR', slug: 'variation' }); - const resolvePreviewSpy = sandbox.spy(SourceFragmentStore.prototype, 'resolvePreviewFragment'); Store.filters.value = { locale: 'tr_TR' }; mockRepo.aem.sites.cf.fragments.getById.resolves(fragmentData); @@ -367,11 +367,26 @@ describe('MasFragmentEditor', () => { await el.initFragment(); - expect(mockRepo.loadPreviewPlaceholders.callCount).to.equal(2); - expect(resolvePreviewSpy.calledOnce).to.be.true; + expect(mockRepo.loadPreviewPlaceholders.callCount).to.equal(1); expect(Store.search.get().region).to.equal('fr_FR'); }); + it('sets region to path locale for same-language regional variations', async () => { + Store.filters.value = { locale: 'fr_FR' }; + const variationData = createFragmentData({ id: 'fr-ch-var', locale: 'fr_CH', slug: 'regional' }); + const existingStore = generateFragmentStore(new Fragment(variationData)); + Store.fragments.list.data.value = [existingStore]; + Store.fragmentEditor.fragmentId.value = 'fr-ch-var'; + el.editorContextStore.isVariation.returns(true); + sandbox.stub(el, 'resolveVariationParentFragment').resolves( + new Fragment(createFragmentData({ id: 'parent-id', locale: 'fr_FR', slug: 'parent' })), + ); + + await el.initFragment(); + + expect(Store.search.get().region).to.equal('fr_CH'); + }); + it('uses pending parent from create variation event when context is not ready', async () => { const parentData = createFragmentData({ id: 'parent-id', locale: 'en_US', slug: 'parent' }); const variationData = createFragmentData({ id: 'new-variation-id', locale: 'fr_FR', slug: 'variation' }); From 11c062f0140236c02f20272ec554f94597296c3e Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Wed, 8 Apr 2026 01:14:47 -0600 Subject: [PATCH 04/27] MWPW-189894: fix - align Lingo placeholders with Akamai country and regional locale --- io/www/src/fragment/pipeline.js | 1 + io/www/src/fragment/transformers/customize.js | 2 + io/www/src/fragment/transformers/replace.js | 9 +--- io/www/src/fragment/utils/cache.js | 10 ++++- io/www/test/fragment/customize.test.js | 1 + io/www/test/fragment/pipeline.test.js | 4 +- io/www/test/fragment/replace.test.js | 2 +- web-components/dist/commerce.js | 6 +-- web-components/dist/mas.js | 38 ++++++++-------- web-components/dist/merch-card-collection.js | 14 +++--- web-components/dist/merch-card.js | 2 +- web-components/src/aem-fragment.js | 2 +- web-components/src/settings.js | 44 ++++++++++++++++++- web-components/test/settings.test.js | 44 +++++++++++++++++++ 14 files changed, 135 insertions(+), 44 deletions(-) diff --git a/io/www/src/fragment/pipeline.js b/io/www/src/fragment/pipeline.js index 934c67b12..df368c0da 100644 --- a/io/www/src/fragment/pipeline.js +++ b/io/www/src/fragment/pipeline.js @@ -143,6 +143,7 @@ async function main(params) { } async function mainProcess(context) { + context.requestLocale = context.locale; const cachedMetadata = await getRequestMetadata(context); const metadataContext = extractContextFromMetadata(cachedMetadata); context = { ...context, ...metadataContext }; diff --git a/io/www/src/fragment/transformers/customize.js b/io/www/src/fragment/transformers/customize.js index 37ee7069c..d28d45aa2 100644 --- a/io/www/src/fragment/transformers/customize.js +++ b/io/www/src/fragment/transformers/customize.js @@ -304,6 +304,8 @@ async function customize(context) { ...context, status: 200, body: customizedFragment, + locale: regionLocale, + defaultLocale, }; } diff --git a/io/www/src/fragment/transformers/replace.js b/io/www/src/fragment/transformers/replace.js index 28adf0425..bb7cfacdb 100644 --- a/io/www/src/fragment/transformers/replace.js +++ b/io/www/src/fragment/transformers/replace.js @@ -153,14 +153,7 @@ function replaceValues(input, dictionary, calls) { return replaced; } -async function init(context) { - // we fetch dictionary at this stage only if id has already been cached - // because we can't know surface of fragment *before* first fetch - // if dictionaryId is present in cache - early load dictionary - // if nothing in cache - dictionaryId and dictionary itself will be loaded later, - // during process - return await getDictionary(context); -} +async function init() {} async function replace(context) { let body = context.body; diff --git a/io/www/src/fragment/utils/cache.js b/io/www/src/fragment/utils/cache.js index 38a77a7a1..6f016fa23 100644 --- a/io/www/src/fragment/utils/cache.js +++ b/io/www/src/fragment/utils/cache.js @@ -1,6 +1,14 @@ import { getJsonFromState, mark, measureTiming } from './common.js'; import { log } from './log.js'; -const getRequestMetadataKey = (context) => `req-${context.id}-${context.locale}`; +function getRequestMetadataKey(context) { + const id = context.id; + const locale = (context.requestLocale ?? context.locale) || 'no-locale'; + const raw = context.country; + if (raw != null && String(raw).trim() !== '') { + return `req-${id}-${locale}-${String(raw).trim().toUpperCase()}`; + } + return `req-${id}-${locale}`; +} async function getRequestMetadata(context) { const requestKey = getRequestMetadataKey(context); diff --git a/io/www/test/fragment/customize.test.js b/io/www/test/fragment/customize.test.js index bc87d2bcc..1ffb1d44a 100644 --- a/io/www/test/fragment/customize.test.js +++ b/io/www/test/fragment/customize.test.js @@ -720,6 +720,7 @@ describe('computeRegionLocale', function () { expect(computeRegionLocale({ locale: 'fr_FR', country: 'FR', ...CTX })).to.equal('fr_FR'); expect(computeRegionLocale({ locale: 'fr_FR', country: 'BE', ...CTX })).to.equal('fr_BE'); expect(computeRegionLocale({ locale: 'fr_FR', country: 'ca', ...CTX })).to.equal('fr_CA'); + expect(computeRegionLocale({ locale: 'fr_FR', country: 'CH', ...CTX })).to.equal('fr_CH'); expect(computeRegionLocale({ locale: 'fr_FR', country: 'IN', ...CTX })).to.equal('fr_FR'); expect(computeRegionLocale({ locale: 'fr_BE', country: undefined, ...CTX })).to.equal('fr_BE'); expect(computeRegionLocale({ locale: 'fr_BE', country: 'FR', ...CTX })).to.equal('fr_BE'); diff --git a/io/www/test/fragment/pipeline.test.js b/io/www/test/fragment/pipeline.test.js index 663a33e94..d74039d1d 100644 --- a/io/www/test/fragment/pipeline.test.js +++ b/io/www/test/fragment/pipeline.test.js @@ -275,8 +275,8 @@ describe('pipeline full use case', () => { expect(result.headers).to.have.property('Last-Modified'); expect(result.headers).to.have.property('ETag'); expect(Object.keys(state.store).length).to.equal(1); - expect(state.store).to.have.property('req-some-en-us-fragment-fr_FR'); - const json = JSON.parse(state.store['req-some-en-us-fragment-fr_FR']); + expect(state.store).to.have.property('req-some-en-us-fragment-fr_FR-CA'); + const json = JSON.parse(state.store['req-some-en-us-fragment-fr_FR-CA']); expect(json.fragmentsIds['dictionary-id']).to.not.equal('sandbox_fr_FR_dictionary'); expect(json.fragmentsIds['default-locale-id']).to.equal('some-fr-fr-fragment'); }); diff --git a/io/www/test/fragment/replace.test.js b/io/www/test/fragment/replace.test.js index 429b84119..ed6b3294f 100644 --- a/io/www/test/fragment/replace.test.js +++ b/io/www/test/fragment/replace.test.js @@ -102,7 +102,7 @@ describe('replace', () => { it('returns 200 & no placeholders', async () => { const response = await getResponse('foo', 'Buy now'); - const expected = expectedResponse('foo'); + const { fragmentsIds: _omit, ...expected } = expectedResponse('foo'); expect(response).to.deep.include(expected); }); it('returns 200 & replaced entries keys with text', async () => { diff --git a/web-components/dist/commerce.js b/web-components/dist/commerce.js index 17b1e1a15..a2bdde086 100644 --- a/web-components/dist/commerce.js +++ b/web-components/dist/commerce.js @@ -501,7 +501,7 @@ window.masPriceLiterals = { ":type": "sheet" } .data; -var kr=Object.defineProperty;var Fr=e=>{throw TypeError(e)};var Gi=(e,t,r)=>t in e?kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Vi=(e,t)=>{for(var r in t)kr(e,r,{get:t[r],enumerable:!0})};var P=(e,t,r)=>Gi(e,typeof t!="symbol"?t+"":t,r),bt=(e,t,r)=>t.has(e)||Fr("Cannot "+r);var K=(e,t,r)=>(bt(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(e,t,r)=>t.has(e)?Fr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r,n)=>(bt(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Pt=(e,t,r)=>(bt(e,t,"access private method"),r);var Yt={};Vi(Yt,{CLASS_NAME_FAILED:()=>Ct,CLASS_NAME_HIDDEN:()=>Yi,CLASS_NAME_PENDING:()=>Lt,CLASS_NAME_RESOLVED:()=>Rt,CheckoutWorkflow:()=>Yr,CheckoutWorkflowStep:()=>F,Commitment:()=>ue,ERROR_MESSAGE_BAD_REQUEST:()=>Nt,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>fo,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>wt,EVENT_AEM_ERROR:()=>lo,EVENT_AEM_LOAD:()=>co,EVENT_MAS_ERROR:()=>ho,EVENT_MAS_READY:()=>uo,EVENT_MERCH_ADDON_AND_QUANTITY_UPDATE:()=>to,EVENT_MERCH_CARD_ACTION_MENU_TOGGLE:()=>zi,EVENT_MERCH_CARD_COLLECTION_LITERALS_CHANGED:()=>io,EVENT_MERCH_CARD_COLLECTION_SHOWMORE:()=>so,EVENT_MERCH_CARD_COLLECTION_SIDENAV_ATTACHED:()=>oo,EVENT_MERCH_CARD_COLLECTION_SORT:()=>no,EVENT_MERCH_CARD_QUANTITY_CHANGE:()=>eo,EVENT_MERCH_OFFER_READY:()=>Xi,EVENT_MERCH_OFFER_SELECT_READY:()=>qi,EVENT_MERCH_QUANTITY_SELECTOR_CHANGE:()=>Ji,EVENT_MERCH_SEARCH_CHANGE:()=>ro,EVENT_MERCH_SIDENAV_SELECT:()=>ao,EVENT_MERCH_STOCK_CHANGE:()=>Zi,EVENT_MERCH_STORAGE_CHANGE:()=>Qi,EVENT_OFFER_SELECTED:()=>Ki,EVENT_TYPE_FAILED:()=>Ot,EVENT_TYPE_READY:()=>ze,EVENT_TYPE_RESOLVED:()=>It,Env:()=>Z,FF_ANNUAL_PRICE:()=>_e,FF_DEFAULTS:()=>J,HEADER_X_REQUEST_ID:()=>Ne,LOG_NAMESPACE:()=>Mt,Landscape:()=>se,MARK_DURATION_SUFFIX:()=>Vt,MARK_START_SUFFIX:()=>Gt,MODAL_TYPE_3_IN_1:()=>he,NAMESPACE:()=>$i,PARAM_AOS_API_KEY:()=>po,PARAM_ENV:()=>Dt,PARAM_LANDSCAPE:()=>Ut,PARAM_MAS_PREVIEW:()=>Ht,PARAM_WCS_API_KEY:()=>mo,PROVIDER_ENVIRONMENT:()=>Ft,SELECTOR_MAS_CHECKOUT_LINK:()=>Vr,SELECTOR_MAS_ELEMENT:()=>vt,SELECTOR_MAS_INLINE_PRICE:()=>Gr,SELECTOR_MAS_SP_BUTTON:()=>ji,SELECTOR_MAS_UPT_LINK:()=>$r,SORT_ORDER:()=>yo,STATE_FAILED:()=>z,STATE_PENDING:()=>oe,STATE_RESOLVED:()=>Q,SUPPORTED_COUNTRIES:()=>$t,TAG_NAME_SERVICE:()=>Wi,TEMPLATE_PRICE:()=>Eo,TEMPLATE_PRICE_ANNUAL:()=>xo,TEMPLATE_PRICE_LEGAL:()=>Ao,TEMPLATE_PRICE_STRIKETHROUGH:()=>go,Term:()=>X,WCS_PROD_URL:()=>Bt,WCS_STAGE_URL:()=>kt});var ue=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"}),X=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"}),$i="merch",Yi="hidden",ze="wcms:commerce:ready",Wi="mas-commerce-service",Gr='span[is="inline-price"][data-wcs-osi]',Vr='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]',ji="sp-button[data-wcs-osi]",$r='a[is="upt-link"]',vt=`${Gr},${Vr},${$r}`,Xi="merch-offer:ready",qi="merch-offer-select:ready",zi="merch-card:action-menu-toggle",Ki="merch-offer:selected",Zi="merch-stock:change",Qi="merch-storage:change",Ji="merch-quantity-selector:change",eo="merch-card-quantity:change",to="merch-modal:addon-and-quantity-update",ro="merch-search:change",no="merch-card-collection:sort",io="merch-card-collection:literals-changed",oo="merch-card-collection:sidenav-attached",so="merch-card-collection:showmore",ao="merch-sidenav:select",co="aem:load",lo="aem:error",uo="mas:ready",ho="mas:error",Ct="placeholder-failed",Lt="placeholder-pending",Rt="placeholder-resolved",Nt="Bad WCS request",wt="Commerce offer not found",fo="Literals URL not provided",Ot="mas:failed",It="mas:resolved",Mt="mas/commerce",Ht="mas.preview",Dt="commerce.env",Ut="commerce.landscape",po="commerce.aosKey",mo="commerce.wcsKey",Bt="https://www.adobe.com/web_commerce_artifact",kt="https://www.stage.adobe.com/web_commerce_artifact_stage",z="failed",oe="pending",Q="resolved",se={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"},Ne="X-Request-Id",F=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"}),Yr="UCv3",Z=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"}),Ft={PRODUCTION:"PRODUCTION"},he={TWP:"twp",D2P:"d2p",CRM:"crm"},Gt=":start",Vt=":duration",Eo="price",go="price-strikethrough",xo="annual",Ao="legal",J="mas-ff-defaults",_e="mas-ff-annual-price",yo={alphabetical:"alphabetical",authored:"authored"},$t=["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 Wr="tacocat.js";var Wt=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),jr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function N(e,t={},{metadata:r=!0,search:n=!0,storage:i=!0}={}){let o;if(n&&o==null){let s=new URLSearchParams(window.location.search),a=Se(n)?n:e;o=s.get(a)}if(i&&o==null){let s=Se(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=_o(Se(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var To=e=>typeof e=="boolean",Ke=e=>typeof e=="function",Ze=e=>typeof e=="number",Xr=e=>e!=null&&typeof e=="object";var Se=e=>typeof e=="string",qr=e=>Se(e)&&e,we=e=>Ze(e)&&Number.isFinite(e)&&e>0;function Qe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function x(e,t){if(To(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Oe(e,t,r){let n=Object.values(t);return n.find(i=>Wt(i,e))??r??n[0]}function _o(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function zr(e,t=1){return Ze(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var So=Date.now(),jt=()=>`(+${Date.now()-So}ms)`,Je=new Set,bo=x(N("tacocat.debug",{},{metadata:!1}),!1);function Kr(e){let t=`[${Wr}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=bo?(s,...a)=>{console.debug(`${t} ${s}`,...a,jt())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;Je.forEach(([u])=>u(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;Je.forEach(([,u])=>u(c,...a))}}}function Po(e,t){let r=[e,t];return Je.add(r),()=>{Je.delete(r)}}Po((e,...t)=>{console.error(e,...t,jt())},(e,...t)=>{console.warn(e,...t,jt())});var vo="no promo",Zr="promo-tag",Co="yellow",Lo="neutral",Ro=(e,t,r)=>{let n=o=>o||vo,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},No="cancel-context",et=(e,t)=>{let r=e===No,n=!r&&e?.length>0,i=(n||r)&&(t&&t!=e||!t&&!r),o=i&&n||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Zr:`${Zr} no-promo`,text:Ro(s,t,i),variant:o?Co:Lo,isOverriden:i}};var Xt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Xt||(Xt={}));var W;(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"})(W||(W={}));var q;(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"})(q||(q={}));var qt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(qt||(qt={}));var zt;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(zt||(zt={}));var Kt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Kt||(Kt={}));var Zt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Zt||(Zt={}));var Qt="ABM",Jt="PUF",er="M2M",tr="PERPETUAL",rr="P3Y",wo="TAX_INCLUSIVE_DETAILS",Oo="TAX_EXCLUSIVE",Qr={ABM:Qt,PUF:Jt,M2M:er,PERPETUAL:tr,P3Y:rr},La={[Qt]:{commitment:W.YEAR,term:q.MONTHLY},[Jt]:{commitment:W.YEAR,term:q.ANNUAL},[er]:{commitment:W.MONTH,term:q.MONTHLY},[tr]:{commitment:W.PERPETUAL,term:void 0},[rr]:{commitment:W.THREE_MONTHS,term:q.P3Y}},Jr="Value is not an offer",Ie=e=>{if(typeof e!="object")return Jr;let{commitment:t,term:r}=e,n=Io(t,r);return{...e,planType:n}};var Io=(e,t)=>{switch(e){case void 0:return Jr;case"":return"";case W.YEAR:return t===q.MONTHLY?Qt:t===q.ANNUAL?Jt:"";case W.MONTH:return t===q.MONTHLY?er:"";case W.PERPETUAL:return tr;case W.TERM_LICENSE:return t===q.P3Y?rr:"";default:return""}};function en(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==wo)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Oo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var fe={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},tn=1e3;function Mo(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function rn(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:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!fe.serializableTypes.includes(r))return r}return e}function Ho(e,t){if(!fe.ignoredProperties.includes(e))return rn(t)}var nr={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,n=[],i=[],o=t;r.forEach(u=>{u!=null&&(Mo(u)?n:i).push(u)}),n.length&&(o+=" "+n.map(rn).join(" "));let{pathname:s,search:a}=window.location,c=`${fe.delimiter}page=${s}${a}`;c.length>tn&&(c=`${c.slice(0,tn)}`),o+=c,i.length&&(o+=`${fe.delimiter}facts=`,o+=JSON.stringify(i,Ho)),window.lana?.log(o,fe)}};function tt(e){Object.assign(fe,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in fe&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var nn={LOCAL:"local",PROD:"prod",STAGE:"stage"},ir={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},or=new Set,sr=new Set,on=new Map,sn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},an={filter:({level:e})=>e!==ir.DEBUG},Do={filter:()=>!1};function Uo(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){return n.length===1&&Ke(n[0])&&(n=n[0](),Array.isArray(n)||(n=[n])),n},source:i,timestamp:performance.now().toFixed(3)}}function Bo(e){[...sr].every(t=>t(e))&&or.forEach(t=>t(e))}function cn(e){let t=(on.get(e)??0)+1;on.set(e,t);let r=`${e} #${t}`,n={id:r,namespace:e,module:i=>cn(`${n.namespace}/${i}`),updateConfig:tt};return Object.values(ir).forEach(i=>{n[i]=(o,...s)=>Bo(Uo(i,o,e,s,r))}),Object.seal(n)}function rt(...e){e.forEach(t=>{let{append:r,filter:n}=t;Ke(n)&&sr.add(n),Ke(r)&&or.add(r)})}function ko(e={}){let{name:t}=e,r=x(N("commerce.debug",{search:!0,storage:!0}),t===nn.LOCAL);return rt(r?sn:an),t===nn.PROD&&rt(nr),G}function Fo(){or.clear(),sr.clear()}var G={...cn(Mt),Level:ir,Plugins:{consoleAppender:sn,debugFilter:an,quietFilter:Do,lanaAppender:nr},init:ko,reset:Fo,use:rt};var Go="mas-commerce-service",Vo=G.module("utilities"),$o={requestId:Ne,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function Me(e,{country:t,forceTaxExclusive:r}){let n;if(e.length<2)n=e;else{let i=t==="GB"?"EN":"MULT";e.sort((o,s)=>o.language===i?-1:s.language===i?1:0),e.sort((o,s)=>!o.term&&s.term?-1:o.term&&!s.term?1:0),n=[e[0]]}return r&&(n=n.map(en)),n}var ln=(e,t)=>{let r=e.reduce((n,i)=>n+(t(i)||0),0);return r>0?Math.round(r*100)/100:void 0};function ar(e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let[t,...r]=e;for(let a of r){let c=[["commitment","commitment types"],["term","terms"],["priceDetails.formatString","currency formats"]];for(let[u,l]of c){let f=u.includes(".")?t.priceDetails?.formatString:t[u],p=u.includes(".")?a.priceDetails?.formatString:a[u];p!==f&&Vo.warn(`Offers have different ${l}, summing may produce unexpected results`,{expected:f,actual:p})}}let n=[["price",a=>a.priceDetails?.price],["priceWithoutDiscount",a=>a.priceDetails?.priceWithoutDiscount],["priceWithoutTax",a=>a.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",a=>a.priceDetails?.priceWithoutDiscountAndTax]],i={};for(let[a,c]of n){let u=ln(e,c);u!==void 0&&(i[a]=u)}let o=e.some(a=>a.priceDetails?.annualized),s;if(o){let a=[["annualizedPrice",c=>c.priceDetails?.annualized?.annualizedPrice],["annualizedPriceWithoutTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutTax],["annualizedPriceWithoutDiscount",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscount],["annualizedPriceWithoutDiscountAndTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscountAndTax]];s={};for(let[c,u]of a){let l=ln(e,u);l!==void 0&&(s[c]=l)}}return{...t,offerSelectorIds:e.flatMap(a=>a.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...i,...s&&{annualized:s}}}}var nt=e=>window.setTimeout(e);function be(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(zr).filter(we);return r.length||(r=[t]),r}function it(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(qr)}function Y(){return document.getElementsByTagName(Go)?.[0]}function un(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[n,i]of Object.entries($o)){let o=r.get(i);o&&(o=o.replace(/[,;]/g,"|"),o=o.replace(/[| ]+/g,"|"),t[n]=o)}return t}var Pe=class e extends Error{constructor(t,r,n){if(super(t,{cause:n}),this.name="MasError",r.response){let i=r.response.headers?.get(Ne);i&&(r.requestId=i),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(([n,i])=>`${n}: ${JSON.stringify(i)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` -Caused by: ${this.cause}`),r}};var Yo={[z]:Ct,[oe]:Lt,[Q]:Rt},Wo={[z]:Ot,[Q]:It},He,ae=class{constructor(t){ne(this,He);P(this,"changes",new Map);P(this,"connected",!1);P(this,"error");P(this,"log");P(this,"options");P(this,"promises",[]);P(this,"state",oe);P(this,"timer",null);P(this,"value");P(this,"version",0);P(this,"wrapperElement");this.wrapperElement=t,this.log=G.module("mas-element")}update(){[z,oe,Q].forEach(t=>{this.wrapperElement.classList.toggle(Yo[t],t===this.state)})}notify(){(this.state===Q||this.state===z)&&(this.state===Q?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===z&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Pe&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(Wo[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,r,n){this.changes.set(t,n),this.requestUpdate()}connectedCallback(){ie(this,He,Y()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:r,state:n}=this;return Q===n?Promise.resolve(this.wrapperElement):z===n?Promise.reject(t):new Promise((i,o)=>{r.push({resolve:i,reject:o})})}toggleResolved(t,r,n){return t!==this.version?!1:(n!==void 0&&(this.options=n),this.state=Q,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),nt(()=>this.notify()),!0)}toggleFailed(t,r,n){if(t!==this.version)return!1;n!==void 0&&(this.options=n),this.error=r,this.state=z,this.update();let i=this.wrapperElement.getAttribute("is");return this.log?.error(`${i}: Failed to render: ${r.message}`,{element:this.wrapperElement,...r.context,...K(this,He)?.duration}),nt(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=oe,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Y()||this.timer)return;let{error:r,options:n,state:i,value:o,version:s}=this;this.state=oe,this.timer=nt(async()=>{this.timer=null;let a=null;if(this.changes.size&&(a=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:a}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:a})),a||t)try{await this.wrapperElement.render?.()===!1&&this.state===oe&&this.version===s&&(this.state=i,this.error=r,this.value=o,this.update(),this.notify())}catch(c){this.toggleFailed(this.version,c,n)}})}};He=new WeakMap;function hn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function ot(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,hn(t)),i}function fn(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,hn(t)),e):null}var jo=/[0-9\-+#]/,Xo=/[^\d\-+#]/g;function pn(e){return e.search(jo)}function qo(e="#.##"){let t={},r=e.length,n=pn(e);t.prefix=n>0?e.substring(0,n):"";let i=pn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(Xo);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 zo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,Ko(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function Ko(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthe*12,me=(e,t,r=1)=>{if(!e)return!1;let{start:n,end:i,displaySummary:{amount:o,duration:s,minProductQuantity:a=1,outcomeType:c}={}}=e;if(!(o&&s&&c)||r=l&&u<=f},pe={MONTH:"MONTH",YEAR:"YEAR"},Jo={[X.ANNUAL]:12,[X.MONTHLY]:1,[X.THREE_YEARS]:36,[X.TWO_YEARS]:24},lr=(e,t)=>({accept:e,round:t}),es=[lr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),lr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),lr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ur={[ue.YEAR]:{[X.MONTHLY]:pe.MONTH,[X.ANNUAL]:pe.YEAR},[ue.MONTH]:{[X.MONTHLY]:pe.MONTH}},ts=(e,t)=>e.indexOf(`'${t}'`)===0,rs=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=yn(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+is(e)),r},ns=e=>{let t=os(e),r=ts(e,t),n=e.replace(/'.*?'/,""),i=gn.test(n)||xn.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},An=e=>e.replace(gn,En).replace(xn,En),is=e=>e.match(/#(.?)#/)?.[1]===dn?Qo:dn,os=e=>e.match(/'(.*?)'/)?.[1]??"",yn=e=>e.match(/0(.?)0/)?.[1]??"";function ve({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=ns(e),u=r?yn(e):"",l=rs(e,r),f=r?2:0,p=o(t,{currencySymbol:s}),h=n?p.toLocaleString("hi-IN",{minimumFractionDigits:f,maximumFractionDigits:f}):mn(l,p),m=r?h.lastIndexOf(u):h.length,d=h.substring(0,m),E=h.substring(m+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,h).replace(/SYMBOL/,s),currencySymbol:s,decimals:E,decimalsDelimiter:u,hasCurrencySpace:c,integer:d,isCurrencyFirst:a,recurrenceTerm:i}}var Tn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=Jo[r]??1;return ve(e,i>1?pe.MONTH:ur[t]?.[r],o=>{let s={divisor:i,price:o,usePrecision:n},{round:a}=es.find(({accept:c})=>c(s));if(!a)throw new Error(`Missing rounding rule for: ${JSON.stringify(s)}`);return a(s)})},_n=({commitment:e,term:t,...r})=>ve(r,ur[e]?.[t]),Sn=e=>{let{commitment:t,instant:r,price:n,originalPrice:i,priceWithoutDiscount:o,promotion:s,quantity:a=1,term:c}=e;if(t===ue.YEAR&&c===X.MONTHLY){if(!s)return ve(e,pe.YEAR,cr);let{displaySummary:{outcomeType:u,duration:l}={}}=s;switch(u){case"PERCENTAGE_DISCOUNT":if(me(s,r,a)){let f=parseInt(l.replace("P","").replace("M",""));if(isNaN(f))return cr(n);let p=i*f,h=o*(12-f),m=Math.round((p+h)*100)/100;return ve({...e,price:m},pe.YEAR)}default:return ve(e,pe.YEAR,()=>cr(o??n))}}return ve(e,ur[t]?.[c])};var bn="download",Pn="upgrade",vn={e:"EDU",t:"TEAM"};function st(e,t={},r=""){let n=Y();if(!n)return null;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:u,perpetual:l,promotionCode:f,quantity:p,wcsOsi:h,extraOptions:m,analyticsId:d}=n.collectCheckoutOptions(t),E=ot(e,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:u,perpetual:l,promotionCode:f,quantity:p,wcsOsi:h,extraOptions:m,analyticsId:d});return r&&(E.innerHTML=`${r}`),E}function at(e){return class extends e{constructor(){super(...arguments);P(this,"checkoutActionHandler");P(this,"masElement",new ae(this))}attributeChangedCallback(n,i,o){this.masElement.attributeChangedCallback(n,i,o)}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 n=this.options?.ms??this.value?.[0].marketSegments?.[0];return vn[n]??n}get customerSegment(){let n=this.options?.cs??this.value?.[0]?.customerSegment;return vn[n]??n}get is3in1Modal(){return Object.values(he).includes(this.getAttribute("data-modal"))}get isOpen3in1Modal(){let n=document.querySelector("meta[name=mas-ff-3in1]");return this.is3in1Modal&&(!n||n.content!=="off")}requestUpdate(n=!1){return this.masElement.requestUpdate(n)}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(n={}){let i=Y();if(!i)return!1;this.dataset.imsCountry||i.imsCountryPromise.then(h=>{h&&(this.dataset.imsCountry=h)}),n.imsCountry=null;let o=i.collectCheckoutOptions(n,this);if(!o.wcsOsi.length)return!1;let s;try{s=JSON.parse(o.extraOptions??"{}")}catch(h){this.masElement.log?.error("cannot parse exta checkout options",h)}let a=this.masElement.togglePending(o);this.setCheckoutUrl("");let c=i.resolveOfferSelectors(o),u=await Promise.all(c);u=u.map(h=>Me(h,o));let l=u.flat().find(h=>h.promotion);!me(l?.promotion,l?.promotion?.displaySummary?.instant,o.quantity[0])&&o.promotionCode&&delete o.promotionCode,o.country=this.dataset.imsCountry||o.country;let p=await i.buildCheckoutAction?.(u.flat(),{...s,...o},this);return this.renderOffers(u.flat(),o,{},p,a)}renderOffers(n,i,o={},s=void 0,a=void 0){let c=Y();if(!c)return!1;if(i={...JSON.parse(this.dataset.extraOptions??"{}"),...i,...o},a??(a=this.masElement.togglePending(i)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),s){this.classList.remove(bn,Pn),this.masElement.toggleResolved(a,n,i);let{url:l,text:f,className:p,handler:h}=s;l&&this.setCheckoutUrl(l),f&&(this.firstElementChild.innerHTML=f),p&&this.classList.add(...p.split(" ")),h&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=h.bind(this))}if(n.length){if(this.masElement.toggleResolved(a,n,i)){if(!this.classList.contains(bn)&&!this.classList.contains(Pn)){let l=c.buildCheckoutURL(n,i);this.setCheckoutUrl(i.modal==="true"?"#":l)}return!0}}else{let l=new Error(`Not provided: ${i?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(a,l,i))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(n){}updateOptions(n={}){let i=Y();if(!i)return!1;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:u,modal:l,perpetual:f,promotionCode:p,quantity:h,wcsOsi:m}=i.collectCheckoutOptions(n);return fn(this,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:u,modal:l,perpetual:f,promotionCode:p,quantity:h,wcsOsi:m}),!0}}}var De=class De extends at(HTMLAnchorElement){static createCheckoutLink(t={},r=""){return st(De,t,r)}setCheckoutUrl(t){this.setAttribute("href",t)}get isCheckoutLink(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}}};P(De,"is","checkout-link"),P(De,"tag","a");var ee=De;window.customElements.get(ee.is)||window.customElements.define(ee.is,ee,{extends:ee.tag});var ss="p_draft_landscape",as="/store/",cs=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"]]),hr=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"]),ls=["env","workflowStep","clientId","country"],Cn=new Set(["gid","gtoken","notifauditid","cohortid","productname","sdid","attimer","gcsrc","gcprog","gcprogcat","gcpagetype","mv","mv2"]),Ln=e=>cs.get(e)??e;function ct(e,t,r){for(let[n,i]of Object.entries(e)){let o=Ln(n);i!=null&&r.has(o)&&t.set(o,i)}}function us(e){switch(e){case Ft.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function hs(e,t){for(let r in e){let n=e[r];for(let[i,o]of Object.entries(n)){if(o==null)continue;let s=Ln(i);t.set(`items[${r}][${s}]`,o)}}}function fs({url:e,modal:t,is3in1:r}){if(!r||!e?.searchParams)return e;e.searchParams.set("rtc","t"),e.searchParams.set("lo","sl");let n=e.searchParams.get("af");return e.searchParams.set("af",[n,"uc_new_user_iframe","uc_new_system_close"].filter(Boolean).join(",")),e.searchParams.get("cli")!=="doc_cloud"&&e.searchParams.set("cli",t===he.CRM?"creative":"mini_plans"),e}function ps(e){let t=new URLSearchParams(window.location.search),r={};Cn.forEach(n=>{let i=t.get(n);i!==null&&(r[n]=i)}),Object.keys(r).length>0&&ct(r,e.searchParams,Cn)}function Rn(e){ms(e);let{env:t,items:r,workflowStep:n,marketSegment:i,customerSegment:o,offerType:s,productArrangementCode:a,landscape:c,modal:u,is3in1:l,preselectPlan:f,...p}=e,h=new URL(us(t));if(h.pathname=`${as}${n}`,n!==F.SEGMENTATION&&n!==F.CHANGE_PLAN_TEAM_PLANS&&hs(r,h.searchParams),ct({...p},h.searchParams,hr),ps(h),c===se.DRAFT&&ct({af:ss},h.searchParams,hr),n===F.SEGMENTATION){let m={marketSegment:i,offerType:s,customerSegment:o,productArrangementCode:a,quantity:r?.[0]?.quantity,addonProductArrangementCode:a?r?.find(d=>d.productArrangementCode!==a)?.productArrangementCode:r?.[1]?.productArrangementCode};f?.toLowerCase()==="edu"?h.searchParams.set("ms","EDU"):f?.toLowerCase()==="team"&&h.searchParams.set("cs","TEAM"),ct(m,h.searchParams,hr),h.searchParams.get("ot")==="PROMOTION"&&h.searchParams.delete("ot"),h=fs({url:h,modal:u,is3in1:l})}return h.toString()}function ms(e){for(let t of ls)if(!e[t])throw new Error(`Argument "checkoutData" is not valid, missing: ${t}`);if(e.workflowStep!==F.SEGMENTATION&&e.workflowStep!==F.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}var b=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflowStep:F.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,displayPlanType:!1,env:Z.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:se.PUBLISHED});function Nn({settings:e,providers:t}){function r(o,s){let{checkoutClientId:a,checkoutWorkflowStep:c,country:u,language:l,promotionCode:f,quantity:p,preselectPlan:h,env:m}=e,d={checkoutClientId:a,checkoutWorkflowStep:c,country:u,language:l,promotionCode:f,quantity:p,preselectPlan:h,env:m};if(s)for(let ye of t.checkout)ye(s,d);let{checkoutMarketSegment:E,checkoutWorkflowStep:y=c,imsCountry:v,country:g=v??u,language:S=l,quantity:M=p,entitlement:L,upgrade:H,modal:D,perpetual:V,promotionCode:U=f,wcsOsi:O,extraOptions:C,...$}=Object.assign(d,s?.dataset??{},o??{}),j=Oe(y,F,b.checkoutWorkflowStep);return d=Qe({...$,extraOptions:C,checkoutClientId:a,checkoutMarketSegment:E,country:g,quantity:be(M,b.quantity),checkoutWorkflowStep:j,language:S,entitlement:x(L),upgrade:x(H),modal:D,perpetual:x(V),promotionCode:et(U).effectivePromoCode,wcsOsi:it(O),preselectPlan:h}),d}function n(o,s){if(!Array.isArray(o)||!o.length||!s)return"";let{env:a,landscape:c}=e,{checkoutClientId:u,checkoutMarketSegment:l,checkoutWorkflowStep:f,country:p,promotionCode:h,quantity:m,preselectPlan:d,ms:E,cs:y,...v}=r(s),g=document.querySelector("meta[name=mas-ff-3in1]"),S=Object.values(he).includes(s.modal)&&(!g||g.content!=="off"),M=window.frameElement||S?"if":"fp",[{productArrangementCode:L,marketSegments:[H],customerSegment:D,offerType:V}]=o,U=E??H??l,O=y??D;d?.toLowerCase()==="edu"?U="EDU":d?.toLowerCase()==="team"&&(O="TEAM");let C={is3in1:S,checkoutPromoCode:h,clientId:u,context:M,country:p,env:a,items:[],marketSegment:U,customerSegment:O,offerType:V,productArrangementCode:L,workflowStep:f,landscape:c,...v},$=m[0]>1?m[0]:void 0;if(o.length===1){let{offerId:j}=o[0];C.items.push({id:j,quantity:$})}else C.items.push(...o.map(({offerId:j,productArrangementCode:ye})=>({id:j,quantity:$,...S?{productArrangementCode:ye}:{}})));return Rn(C)}let{createCheckoutLink:i}=ee;return{CheckoutLink:ee,CheckoutWorkflowStep:F,buildCheckoutURL:n,collectCheckoutOptions:r,createCheckoutLink:i}}function ds({interval:e=200,maxAttempts:t=25}={}){let r=G.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function Es(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function gs(e){let t=G.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function wn({}){let e=ds(),t=Es(e),r=gs(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}var On=window.masPriceLiterals;function In(e){if(Array.isArray(On)){let t=e.locale==="id_ID"?"in":e.language,r=i=>On.find(o=>Wt(o.lang,i)),n=r(t)??r(b.language);if(n)return Object.freeze(n)}return{}}var fr=function(e,t){return fr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},fr(e,t)};function Ue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(ys,function(c,u,l,f,p,h){if(u)t.minimumIntegerDigits=l.length;else{if(f&&p)throw new Error("We currently do not support maximum integer digits");if(h)throw new Error("We currently do not support exact integer digits")}return""});continue}if($n.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Bn.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Bn,function(c,u,l,f,p,h){return l==="*"?t.minimumFractionDigits=u.length:f&&f[0]==="#"?t.maximumFractionDigits=f.length:p&&h?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+h.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var o=i.options[0];o==="w"?t=T(T({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=T(T({},t),kn(o)));continue}if(Vn.test(i.stem)){t=T(T({},t),kn(i.stem));continue}var s=Yn(i.stem);s&&(t=T(T({},t),s));var a=Ts(i.stem);a&&(t=T(T({},t),a))}return t}var ke={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 jn(e,t){for(var r="",n=0;n>1),c="a",u=_s(t);for((u=="H"||u=="k")&&(a=0);a-- >0;)r+=c;for(;s-- >0;)r=u+r}else i==="J"?r+="H":r+=i}return r}function _s(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,n;r!=="root"&&(n=e.maximize().region);var i=ke[n||""]||ke[r||""]||ke["".concat(r,"-001")]||ke["001"];return i[0]}var dr,Ss=new RegExp("^".concat(mr.source,"*")),bs=new RegExp("".concat(mr.source,"*$"));function _(e,t){return{start:e,end:t}}var Ps=!!String.prototype.startsWith,vs=!!String.fromCodePoint,Cs=!!Object.fromEntries,Ls=!!String.prototype.codePointAt,Rs=!!String.prototype.trimStart,Ns=!!String.prototype.trimEnd,ws=!!Number.isSafeInteger,Os=ws?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},gr=!0;try{Xn=Zn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),gr=((dr=Xn.exec("a"))===null||dr===void 0?void 0:dr[0])==="a"}catch{gr=!1}var Xn,qn=Ps?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},xr=vs?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},zn=Cs?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Is=Rs?function(t){return t.trimStart()}:function(t){return t.replace(Ss,"")},Ms=Ns?function(t){return t.trimEnd()}:function(t){return t.replace(bs,"")};function Zn(e,t){return new RegExp(e,t)}var Ar;gr?(Er=Zn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ar=function(t,r){var n;Er.lastIndex=r;var i=Er.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Ar=function(t,r){for(var n=[];;){var i=Kn(t,r);if(i===void 0||Jn(i)||Us(i))break;n.push(i),r+=i>=65536?2:1}return xr.apply(void 0,n)};var Er,Qn=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,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:R.pound,location:_(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(A.UNMATCHED_CLOSING_TAG,_(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&yr(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:R.literal,value:"<".concat(i,"/>"),location:_(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:R.tag,value:i,children:s,location:_(n,this.clonePosition())},err:null}:this.error(A.INVALID_TAG,_(a,this.clonePosition())))}else return this.error(A.UNCLOSED_TAG,_(n,this.clonePosition()))}else return this.error(A.INVALID_TAG,_(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Ds(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=_(n,this.clonePosition());return{val:{type:R.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Hs(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return xr.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),xr(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(A.EMPTY_ARGUMENT,_(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(A.MALFORMED_ARGUMENT,_(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:R.argument,value:i,location:_(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(A.MALFORMED_ARGUMENT,_(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Ar(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=_(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(A.EXPECT_ARGUMENT_TYPE,_(s,c));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;var p=Ms(f.val);if(p.length===0)return this.error(A.EXPECT_ARGUMENT_STYLE,_(this.clonePosition(),this.clonePosition()));var h=_(l,this.clonePosition());u={style:p,styleLocation:h}}var m=this.tryParseArgumentClose(i);if(m.err)return m;var d=_(i,this.clonePosition());if(u&&qn(u?.style,"::",0)){var E=Is(u.style.slice(2));if(a==="number"){var f=this.parseNumberSkeletonFromString(E,u.styleLocation);return f.err?f:{val:{type:R.number,value:n,location:d,style:f.val},err:null}}else{if(E.length===0)return this.error(A.EXPECT_DATE_TIME_SKELETON,d);var y=E;this.locale&&(y=jn(E,this.locale));var p={type:de.dateTime,pattern:y,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?Dn(y):{}},v=a==="date"?R.date:R.time;return{val:{type:v,value:n,location:d,style:p},err:null}}}return{val:{type:a==="number"?R.number:a==="date"?R.date:R.time,value:n,location:d,style:(o=u?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var g=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(A.EXPECT_SELECT_ARGUMENT_OPTIONS,_(g,T({},g)));this.bumpSpace();var S=this.parseIdentifierIfPossible(),M=0;if(a!=="select"&&S.value==="offset"){if(!this.bumpIf(":"))return this.error(A.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,_(this.clonePosition(),this.clonePosition()));this.bumpSpace();var f=this.tryParseDecimalInteger(A.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,A.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(f.err)return f;this.bumpSpace(),S=this.parseIdentifierIfPossible(),M=f.val}var L=this.tryParsePluralOrSelectOptions(t,a,r,S);if(L.err)return L;var m=this.tryParseArgumentClose(i);if(m.err)return m;var H=_(i,this.clonePosition());return a==="select"?{val:{type:R.select,value:n,options:zn(L.val),location:H},err:null}:{val:{type:R.plural,value:n,options:zn(L.val),offset:M,pluralType:a==="plural"?"cardinal":"ordinal",location:H},err:null}}default:return this.error(A.INVALID_ARGUMENT_TYPE,_(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(A.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,_(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=Gn(t)}catch{return this.error(A.INVALID_NUMBER_SKELETON,r)}return{val:{type:de.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Wn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,u=i.value,l=i.location;;){if(u.length===0){var f=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var p=this.tryParseDecimalInteger(A.EXPECT_PLURAL_ARGUMENT_SELECTOR,A.INVALID_PLURAL_ARGUMENT_SELECTOR);if(p.err)return p;l=_(f,this.clonePosition()),u=this.message.slice(f.offset,this.offset())}else break}if(c.has(u))return this.error(r==="select"?A.DUPLICATE_SELECT_ARGUMENT_SELECTOR:A.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?A.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:A.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,_(this.clonePosition(),this.clonePosition()));var m=this.parseMessage(t+1,r,n);if(m.err)return m;var d=this.tryParseArgumentClose(h);if(d.err)return d;a.push([u,{value:m.val,location:_(h,this.clonePosition())}]),c.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,l=o.location}return a.length===0?this.error(r==="select"?A.EXPECT_SELECT_ARGUMENT_SELECTOR:A.EXPECT_PLURAL_ARGUMENT_SELECTOR,_(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(A.MISSING_OTHER_CLAUSE,_(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=_(i,this.clonePosition());return o?(s*=n,Os(s)?{val:s,err:null}:this.error(r,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=Kn(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(qn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".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()&&Jn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function yr(e){return e>=97&&e<=122||e>=65&&e<=90}function Hs(e){return yr(e)||e===47}function Ds(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 Jn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Us(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Tr(e){e.forEach(function(t){if(delete t.location,pt(t)||mt(t))for(var r in t.options)delete t.options[r].location,Tr(t.options[r].value);else ut(t)&&Et(t.style)||(ht(t)||ft(t))&&Be(t.style)?delete t.style.location:dt(t)&&Tr(t.children)})}function ei(e,t){t===void 0&&(t={}),t=T({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Qn(e,t).parse();if(r.err){var n=SyntaxError(A[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Tr(r.val),r.val}function Fe(e,t){var r=t&&t.cache?t.cache:$s,n=t&&t.serializer?t.serializer:Vs,i=t&&t.strategy?t.strategy:ks;return i(e,{cache:r,serializer:n})}function Bs(e){return e==null||typeof e=="number"||typeof e=="boolean"}function ti(e,t,r,n){var i=Bs(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function ri(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function _r(e,t,r,n,i){return r.bind(t,e,n,i)}function ks(e,t){var r=e.length===1?ti:ri;return _r(e,this,r,t.cache.create(),t.serializer)}function Fs(e,t){return _r(e,this,ri,t.cache.create(),t.serializer)}function Gs(e,t){return _r(e,this,ti,t.cache.create(),t.serializer)}var Vs=function(){return JSON.stringify(arguments)};function Sr(){this.cache=Object.create(null)}Sr.prototype.get=function(e){return this.cache[e]};Sr.prototype.set=function(e,t){this.cache[e]=t};var $s={create:function(){return new Sr}},gt={variadic:Fs,monadic:Gs};var Ee;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Ee||(Ee={}));var Ge=function(e){Ue(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var br=function(e){Ue(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Ee.INVALID_VALUE,o)||this}return t}(Ge);var ni=function(e){Ue(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Ee.INVALID_VALUE,i)||this}return t}(Ge);var ii=function(e){Ue(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Ee.MISSING_VALUE,n)||this}return t}(Ge);var k;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(k||(k={}));function Ys(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==k.literal||r.type!==k.literal?t.push(r):n.value+=r.value,t},[])}function Ws(e){return typeof e=="function"}function Ve(e,t,r,n,i,o,s){if(e.length===1&&pr(e[0]))return[{type:k.literal,value:e[0].value}];for(var a=[],c=0,u=e;c{throw TypeError(e)};var Gi=(e,t,r)=>t in e?kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Vi=(e,t)=>{for(var r in t)kr(e,r,{get:t[r],enumerable:!0})};var P=(e,t,r)=>Gi(e,typeof t!="symbol"?t+"":t,r),bt=(e,t,r)=>t.has(e)||Fr("Cannot "+r);var K=(e,t,r)=>(bt(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(e,t,r)=>t.has(e)?Fr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r,n)=>(bt(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Pt=(e,t,r)=>(bt(e,t,"access private method"),r);var Yt={};Vi(Yt,{CLASS_NAME_FAILED:()=>Ct,CLASS_NAME_HIDDEN:()=>Yi,CLASS_NAME_PENDING:()=>Lt,CLASS_NAME_RESOLVED:()=>wt,CheckoutWorkflow:()=>Yr,CheckoutWorkflowStep:()=>F,Commitment:()=>ue,ERROR_MESSAGE_BAD_REQUEST:()=>Rt,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>fo,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>Nt,EVENT_AEM_ERROR:()=>lo,EVENT_AEM_LOAD:()=>co,EVENT_MAS_ERROR:()=>ho,EVENT_MAS_READY:()=>uo,EVENT_MERCH_ADDON_AND_QUANTITY_UPDATE:()=>to,EVENT_MERCH_CARD_ACTION_MENU_TOGGLE:()=>zi,EVENT_MERCH_CARD_COLLECTION_LITERALS_CHANGED:()=>io,EVENT_MERCH_CARD_COLLECTION_SHOWMORE:()=>so,EVENT_MERCH_CARD_COLLECTION_SIDENAV_ATTACHED:()=>oo,EVENT_MERCH_CARD_COLLECTION_SORT:()=>no,EVENT_MERCH_CARD_QUANTITY_CHANGE:()=>eo,EVENT_MERCH_OFFER_READY:()=>Xi,EVENT_MERCH_OFFER_SELECT_READY:()=>qi,EVENT_MERCH_QUANTITY_SELECTOR_CHANGE:()=>Ji,EVENT_MERCH_SEARCH_CHANGE:()=>ro,EVENT_MERCH_SIDENAV_SELECT:()=>ao,EVENT_MERCH_STOCK_CHANGE:()=>Zi,EVENT_MERCH_STORAGE_CHANGE:()=>Qi,EVENT_OFFER_SELECTED:()=>Ki,EVENT_TYPE_FAILED:()=>Ot,EVENT_TYPE_READY:()=>ze,EVENT_TYPE_RESOLVED:()=>It,Env:()=>Z,FF_ANNUAL_PRICE:()=>_e,FF_DEFAULTS:()=>J,HEADER_X_REQUEST_ID:()=>Re,LOG_NAMESPACE:()=>Mt,Landscape:()=>se,MARK_DURATION_SUFFIX:()=>Vt,MARK_START_SUFFIX:()=>Gt,MODAL_TYPE_3_IN_1:()=>he,NAMESPACE:()=>$i,PARAM_AOS_API_KEY:()=>po,PARAM_ENV:()=>Dt,PARAM_LANDSCAPE:()=>Ut,PARAM_MAS_PREVIEW:()=>Ht,PARAM_WCS_API_KEY:()=>mo,PROVIDER_ENVIRONMENT:()=>Ft,SELECTOR_MAS_CHECKOUT_LINK:()=>Vr,SELECTOR_MAS_ELEMENT:()=>vt,SELECTOR_MAS_INLINE_PRICE:()=>Gr,SELECTOR_MAS_SP_BUTTON:()=>ji,SELECTOR_MAS_UPT_LINK:()=>$r,SORT_ORDER:()=>yo,STATE_FAILED:()=>z,STATE_PENDING:()=>oe,STATE_RESOLVED:()=>Q,SUPPORTED_COUNTRIES:()=>$t,TAG_NAME_SERVICE:()=>Wi,TEMPLATE_PRICE:()=>Eo,TEMPLATE_PRICE_ANNUAL:()=>xo,TEMPLATE_PRICE_LEGAL:()=>Ao,TEMPLATE_PRICE_STRIKETHROUGH:()=>go,Term:()=>X,WCS_PROD_URL:()=>Bt,WCS_STAGE_URL:()=>kt});var ue=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"}),X=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"}),$i="merch",Yi="hidden",ze="wcms:commerce:ready",Wi="mas-commerce-service",Gr='span[is="inline-price"][data-wcs-osi]',Vr='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]',ji="sp-button[data-wcs-osi]",$r='a[is="upt-link"]',vt=`${Gr},${Vr},${$r}`,Xi="merch-offer:ready",qi="merch-offer-select:ready",zi="merch-card:action-menu-toggle",Ki="merch-offer:selected",Zi="merch-stock:change",Qi="merch-storage:change",Ji="merch-quantity-selector:change",eo="merch-card-quantity:change",to="merch-modal:addon-and-quantity-update",ro="merch-search:change",no="merch-card-collection:sort",io="merch-card-collection:literals-changed",oo="merch-card-collection:sidenav-attached",so="merch-card-collection:showmore",ao="merch-sidenav:select",co="aem:load",lo="aem:error",uo="mas:ready",ho="mas:error",Ct="placeholder-failed",Lt="placeholder-pending",wt="placeholder-resolved",Rt="Bad WCS request",Nt="Commerce offer not found",fo="Literals URL not provided",Ot="mas:failed",It="mas:resolved",Mt="mas/commerce",Ht="mas.preview",Dt="commerce.env",Ut="commerce.landscape",po="commerce.aosKey",mo="commerce.wcsKey",Bt="https://www.adobe.com/web_commerce_artifact",kt="https://www.stage.adobe.com/web_commerce_artifact_stage",z="failed",oe="pending",Q="resolved",se={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"},Re="X-Request-Id",F=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"}),Yr="UCv3",Z=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"}),Ft={PRODUCTION:"PRODUCTION"},he={TWP:"twp",D2P:"d2p",CRM:"crm"},Gt=":start",Vt=":duration",Eo="price",go="price-strikethrough",xo="annual",Ao="legal",J="mas-ff-defaults",_e="mas-ff-annual-price",yo={alphabetical:"alphabetical",authored:"authored"},$t=["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 Wr="tacocat.js";var Wt=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),jr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function R(e,t={},{metadata:r=!0,search:n=!0,storage:i=!0}={}){let o;if(n&&o==null){let s=new URLSearchParams(window.location.search),a=Se(n)?n:e;o=s.get(a)}if(i&&o==null){let s=Se(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=_o(Se(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var To=e=>typeof e=="boolean",Ke=e=>typeof e=="function",Ze=e=>typeof e=="number",Xr=e=>e!=null&&typeof e=="object";var Se=e=>typeof e=="string",qr=e=>Se(e)&&e,Ne=e=>Ze(e)&&Number.isFinite(e)&&e>0;function Qe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function x(e,t){if(To(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Oe(e,t,r){let n=Object.values(t);return n.find(i=>Wt(i,e))??r??n[0]}function _o(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function zr(e,t=1){return Ze(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var So=Date.now(),jt=()=>`(+${Date.now()-So}ms)`,Je=new Set,bo=x(R("tacocat.debug",{},{metadata:!1}),!1);function Kr(e){let t=`[${Wr}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=bo?(s,...a)=>{console.debug(`${t} ${s}`,...a,jt())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;Je.forEach(([u])=>u(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;Je.forEach(([,u])=>u(c,...a))}}}function Po(e,t){let r=[e,t];return Je.add(r),()=>{Je.delete(r)}}Po((e,...t)=>{console.error(e,...t,jt())},(e,...t)=>{console.warn(e,...t,jt())});var vo="no promo",Zr="promo-tag",Co="yellow",Lo="neutral",wo=(e,t,r)=>{let n=o=>o||vo,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},Ro="cancel-context",et=(e,t)=>{let r=e===Ro,n=!r&&e?.length>0,i=(n||r)&&(t&&t!=e||!t&&!r),o=i&&n||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Zr:`${Zr} no-promo`,text:wo(s,t,i),variant:o?Co:Lo,isOverriden:i}};var Xt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Xt||(Xt={}));var W;(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"})(W||(W={}));var q;(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"})(q||(q={}));var qt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(qt||(qt={}));var zt;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(zt||(zt={}));var Kt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Kt||(Kt={}));var Zt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Zt||(Zt={}));var Qt="ABM",Jt="PUF",er="M2M",tr="PERPETUAL",rr="P3Y",No="TAX_INCLUSIVE_DETAILS",Oo="TAX_EXCLUSIVE",Qr={ABM:Qt,PUF:Jt,M2M:er,PERPETUAL:tr,P3Y:rr},Ra={[Qt]:{commitment:W.YEAR,term:q.MONTHLY},[Jt]:{commitment:W.YEAR,term:q.ANNUAL},[er]:{commitment:W.MONTH,term:q.MONTHLY},[tr]:{commitment:W.PERPETUAL,term:void 0},[rr]:{commitment:W.THREE_MONTHS,term:q.P3Y}},Jr="Value is not an offer",Ie=e=>{if(typeof e!="object")return Jr;let{commitment:t,term:r}=e,n=Io(t,r);return{...e,planType:n}};var Io=(e,t)=>{switch(e){case void 0:return Jr;case"":return"";case W.YEAR:return t===q.MONTHLY?Qt:t===q.ANNUAL?Jt:"";case W.MONTH:return t===q.MONTHLY?er:"";case W.PERPETUAL:return tr;case W.TERM_LICENSE:return t===q.P3Y?rr:"";default:return""}};function en(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==No)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Oo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var fe={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},tn=1e3;function Mo(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function rn(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:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!fe.serializableTypes.includes(r))return r}return e}function Ho(e,t){if(!fe.ignoredProperties.includes(e))return rn(t)}var nr={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,n=[],i=[],o=t;r.forEach(u=>{u!=null&&(Mo(u)?n:i).push(u)}),n.length&&(o+=" "+n.map(rn).join(" "));let{pathname:s,search:a}=window.location,c=`${fe.delimiter}page=${s}${a}`;c.length>tn&&(c=`${c.slice(0,tn)}`),o+=c,i.length&&(o+=`${fe.delimiter}facts=`,o+=JSON.stringify(i,Ho)),window.lana?.log(o,fe)}};function tt(e){Object.assign(fe,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in fe&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var nn={LOCAL:"local",PROD:"prod",STAGE:"stage"},ir={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},or=new Set,sr=new Set,on=new Map,sn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},an={filter:({level:e})=>e!==ir.DEBUG},Do={filter:()=>!1};function Uo(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){return n.length===1&&Ke(n[0])&&(n=n[0](),Array.isArray(n)||(n=[n])),n},source:i,timestamp:performance.now().toFixed(3)}}function Bo(e){[...sr].every(t=>t(e))&&or.forEach(t=>t(e))}function cn(e){let t=(on.get(e)??0)+1;on.set(e,t);let r=`${e} #${t}`,n={id:r,namespace:e,module:i=>cn(`${n.namespace}/${i}`),updateConfig:tt};return Object.values(ir).forEach(i=>{n[i]=(o,...s)=>Bo(Uo(i,o,e,s,r))}),Object.seal(n)}function rt(...e){e.forEach(t=>{let{append:r,filter:n}=t;Ke(n)&&sr.add(n),Ke(r)&&or.add(r)})}function ko(e={}){let{name:t}=e,r=x(R("commerce.debug",{search:!0,storage:!0}),t===nn.LOCAL);return rt(r?sn:an),t===nn.PROD&&rt(nr),G}function Fo(){or.clear(),sr.clear()}var G={...cn(Mt),Level:ir,Plugins:{consoleAppender:sn,debugFilter:an,quietFilter:Do,lanaAppender:nr},init:ko,reset:Fo,use:rt};var Go="mas-commerce-service",Vo=G.module("utilities"),$o={requestId:Re,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function Me(e,{country:t,forceTaxExclusive:r}){let n;if(e.length<2)n=e;else{let i=t==="GB"?"EN":"MULT";e.sort((o,s)=>o.language===i?-1:s.language===i?1:0),e.sort((o,s)=>!o.term&&s.term?-1:o.term&&!s.term?1:0),n=[e[0]]}return r&&(n=n.map(en)),n}var ln=(e,t)=>{let r=e.reduce((n,i)=>n+(t(i)||0),0);return r>0?Math.round(r*100)/100:void 0};function ar(e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let[t,...r]=e;for(let a of r){let c=[["commitment","commitment types"],["term","terms"],["priceDetails.formatString","currency formats"]];for(let[u,l]of c){let f=u.includes(".")?t.priceDetails?.formatString:t[u],p=u.includes(".")?a.priceDetails?.formatString:a[u];p!==f&&Vo.warn(`Offers have different ${l}, summing may produce unexpected results`,{expected:f,actual:p})}}let n=[["price",a=>a.priceDetails?.price],["priceWithoutDiscount",a=>a.priceDetails?.priceWithoutDiscount],["priceWithoutTax",a=>a.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",a=>a.priceDetails?.priceWithoutDiscountAndTax]],i={};for(let[a,c]of n){let u=ln(e,c);u!==void 0&&(i[a]=u)}let o=e.some(a=>a.priceDetails?.annualized),s;if(o){let a=[["annualizedPrice",c=>c.priceDetails?.annualized?.annualizedPrice],["annualizedPriceWithoutTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutTax],["annualizedPriceWithoutDiscount",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscount],["annualizedPriceWithoutDiscountAndTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscountAndTax]];s={};for(let[c,u]of a){let l=ln(e,u);l!==void 0&&(s[c]=l)}}return{...t,offerSelectorIds:e.flatMap(a=>a.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...i,...s&&{annualized:s}}}}var nt=e=>window.setTimeout(e);function be(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(zr).filter(Ne);return r.length||(r=[t]),r}function it(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(qr)}function Y(){return document.getElementsByTagName(Go)?.[0]}function un(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[n,i]of Object.entries($o)){let o=r.get(i);o&&(o=o.replace(/[,;]/g,"|"),o=o.replace(/[| ]+/g,"|"),t[n]=o)}return t}var Pe=class e extends Error{constructor(t,r,n){if(super(t,{cause:n}),this.name="MasError",r.response){let i=r.response.headers?.get(Re);i&&(r.requestId=i),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(([n,i])=>`${n}: ${JSON.stringify(i)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` +Caused by: ${this.cause}`),r}};var Yo={[z]:Ct,[oe]:Lt,[Q]:wt},Wo={[z]:Ot,[Q]:It},He,ae=class{constructor(t){ne(this,He);P(this,"changes",new Map);P(this,"connected",!1);P(this,"error");P(this,"log");P(this,"options");P(this,"promises",[]);P(this,"state",oe);P(this,"timer",null);P(this,"value");P(this,"version",0);P(this,"wrapperElement");this.wrapperElement=t,this.log=G.module("mas-element")}update(){[z,oe,Q].forEach(t=>{this.wrapperElement.classList.toggle(Yo[t],t===this.state)})}notify(){(this.state===Q||this.state===z)&&(this.state===Q?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===z&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Pe&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(Wo[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,r,n){this.changes.set(t,n),this.requestUpdate()}connectedCallback(){ie(this,He,Y()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:r,state:n}=this;return Q===n?Promise.resolve(this.wrapperElement):z===n?Promise.reject(t):new Promise((i,o)=>{r.push({resolve:i,reject:o})})}toggleResolved(t,r,n){return t!==this.version?!1:(n!==void 0&&(this.options=n),this.state=Q,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),nt(()=>this.notify()),!0)}toggleFailed(t,r,n){if(t!==this.version)return!1;n!==void 0&&(this.options=n),this.error=r,this.state=z,this.update();let i=this.wrapperElement.getAttribute("is");return this.log?.error(`${i}: Failed to render: ${r.message}`,{element:this.wrapperElement,...r.context,...K(this,He)?.duration}),nt(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=oe,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Y()||this.timer)return;let{error:r,options:n,state:i,value:o,version:s}=this;this.state=oe,this.timer=nt(async()=>{this.timer=null;let a=null;if(this.changes.size&&(a=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:a}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:a})),a||t)try{await this.wrapperElement.render?.()===!1&&this.state===oe&&this.version===s&&(this.state=i,this.error=r,this.value=o,this.update(),this.notify())}catch(c){this.toggleFailed(this.version,c,n)}})}};He=new WeakMap;function hn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function ot(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,hn(t)),i}function fn(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,hn(t)),e):null}var jo=/[0-9\-+#]/,Xo=/[^\d\-+#]/g;function pn(e){return e.search(jo)}function qo(e="#.##"){let t={},r=e.length,n=pn(e);t.prefix=n>0?e.substring(0,n):"";let i=pn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(Xo);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 zo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,Ko(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function Ko(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthe*12,me=(e,t,r=1)=>{if(!e)return!1;let{start:n,end:i,displaySummary:{amount:o,duration:s,minProductQuantity:a=1,outcomeType:c}={}}=e;if(!(o&&s&&c)||r=l&&u<=f},pe={MONTH:"MONTH",YEAR:"YEAR"},Jo={[X.ANNUAL]:12,[X.MONTHLY]:1,[X.THREE_YEARS]:36,[X.TWO_YEARS]:24},lr=(e,t)=>({accept:e,round:t}),es=[lr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),lr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),lr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ur={[ue.YEAR]:{[X.MONTHLY]:pe.MONTH,[X.ANNUAL]:pe.YEAR},[ue.MONTH]:{[X.MONTHLY]:pe.MONTH}},ts=(e,t)=>e.indexOf(`'${t}'`)===0,rs=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=yn(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+is(e)),r},ns=e=>{let t=os(e),r=ts(e,t),n=e.replace(/'.*?'/,""),i=gn.test(n)||xn.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},An=e=>e.replace(gn,En).replace(xn,En),is=e=>e.match(/#(.?)#/)?.[1]===dn?Qo:dn,os=e=>e.match(/'(.*?)'/)?.[1]??"",yn=e=>e.match(/0(.?)0/)?.[1]??"";function ve({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=ns(e),u=r?yn(e):"",l=rs(e,r),f=r?2:0,p=o(t,{currencySymbol:s}),h=n?p.toLocaleString("hi-IN",{minimumFractionDigits:f,maximumFractionDigits:f}):mn(l,p),m=r?h.lastIndexOf(u):h.length,d=h.substring(0,m),E=h.substring(m+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,h).replace(/SYMBOL/,s),currencySymbol:s,decimals:E,decimalsDelimiter:u,hasCurrencySpace:c,integer:d,isCurrencyFirst:a,recurrenceTerm:i}}var Tn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=Jo[r]??1;return ve(e,i>1?pe.MONTH:ur[t]?.[r],o=>{let s={divisor:i,price:o,usePrecision:n},{round:a}=es.find(({accept:c})=>c(s));if(!a)throw new Error(`Missing rounding rule for: ${JSON.stringify(s)}`);return a(s)})},_n=({commitment:e,term:t,...r})=>ve(r,ur[e]?.[t]),Sn=e=>{let{commitment:t,instant:r,price:n,originalPrice:i,priceWithoutDiscount:o,promotion:s,quantity:a=1,term:c}=e;if(t===ue.YEAR&&c===X.MONTHLY){if(!s)return ve(e,pe.YEAR,cr);let{displaySummary:{outcomeType:u,duration:l}={}}=s;switch(u){case"PERCENTAGE_DISCOUNT":if(me(s,r,a)){let f=parseInt(l.replace("P","").replace("M",""));if(isNaN(f))return cr(n);let p=i*f,h=o*(12-f),m=Math.round((p+h)*100)/100;return ve({...e,price:m},pe.YEAR)}default:return ve(e,pe.YEAR,()=>cr(o??n))}}return ve(e,ur[t]?.[c])};var bn="download",Pn="upgrade",vn={e:"EDU",t:"TEAM"};function st(e,t={},r=""){let n=Y();if(!n)return null;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:u,perpetual:l,promotionCode:f,quantity:p,wcsOsi:h,extraOptions:m,analyticsId:d}=n.collectCheckoutOptions(t),E=ot(e,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:u,perpetual:l,promotionCode:f,quantity:p,wcsOsi:h,extraOptions:m,analyticsId:d});return r&&(E.innerHTML=`${r}`),E}function at(e){return class extends e{constructor(){super(...arguments);P(this,"checkoutActionHandler");P(this,"masElement",new ae(this))}attributeChangedCallback(n,i,o){this.masElement.attributeChangedCallback(n,i,o)}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 n=this.options?.ms??this.value?.[0].marketSegments?.[0];return vn[n]??n}get customerSegment(){let n=this.options?.cs??this.value?.[0]?.customerSegment;return vn[n]??n}get is3in1Modal(){return Object.values(he).includes(this.getAttribute("data-modal"))}get isOpen3in1Modal(){let n=document.querySelector("meta[name=mas-ff-3in1]");return this.is3in1Modal&&(!n||n.content!=="off")}requestUpdate(n=!1){return this.masElement.requestUpdate(n)}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(n={}){let i=Y();if(!i)return!1;this.dataset.imsCountry||i.imsCountryPromise.then(h=>{h&&(this.dataset.imsCountry=h)}),n.imsCountry=null;let o=i.collectCheckoutOptions(n,this);if(!o.wcsOsi.length)return!1;let s;try{s=JSON.parse(o.extraOptions??"{}")}catch(h){this.masElement.log?.error("cannot parse exta checkout options",h)}let a=this.masElement.togglePending(o);this.setCheckoutUrl("");let c=i.resolveOfferSelectors(o),u=await Promise.all(c);u=u.map(h=>Me(h,o));let l=u.flat().find(h=>h.promotion);!me(l?.promotion,l?.promotion?.displaySummary?.instant,o.quantity[0])&&o.promotionCode&&delete o.promotionCode,o.country=this.dataset.imsCountry||o.country;let p=await i.buildCheckoutAction?.(u.flat(),{...s,...o},this);return this.renderOffers(u.flat(),o,{},p,a)}renderOffers(n,i,o={},s=void 0,a=void 0){let c=Y();if(!c)return!1;if(i={...JSON.parse(this.dataset.extraOptions??"{}"),...i,...o},a??(a=this.masElement.togglePending(i)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),s){this.classList.remove(bn,Pn),this.masElement.toggleResolved(a,n,i);let{url:l,text:f,className:p,handler:h}=s;l&&this.setCheckoutUrl(l),f&&(this.firstElementChild.innerHTML=f),p&&this.classList.add(...p.split(" ")),h&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=h.bind(this))}if(n.length){if(this.masElement.toggleResolved(a,n,i)){if(!this.classList.contains(bn)&&!this.classList.contains(Pn)){let l=c.buildCheckoutURL(n,i);this.setCheckoutUrl(i.modal==="true"?"#":l)}return!0}}else{let l=new Error(`Not provided: ${i?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(a,l,i))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(n){}updateOptions(n={}){let i=Y();if(!i)return!1;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:u,modal:l,perpetual:f,promotionCode:p,quantity:h,wcsOsi:m}=i.collectCheckoutOptions(n);return fn(this,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:u,modal:l,perpetual:f,promotionCode:p,quantity:h,wcsOsi:m}),!0}}}var De=class De extends at(HTMLAnchorElement){static createCheckoutLink(t={},r=""){return st(De,t,r)}setCheckoutUrl(t){this.setAttribute("href",t)}get isCheckoutLink(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}}};P(De,"is","checkout-link"),P(De,"tag","a");var ee=De;window.customElements.get(ee.is)||window.customElements.define(ee.is,ee,{extends:ee.tag});var ss="p_draft_landscape",as="/store/",cs=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"]]),hr=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"]),ls=["env","workflowStep","clientId","country"],Cn=new Set(["gid","gtoken","notifauditid","cohortid","productname","sdid","attimer","gcsrc","gcprog","gcprogcat","gcpagetype","mv","mv2"]),Ln=e=>cs.get(e)??e;function ct(e,t,r){for(let[n,i]of Object.entries(e)){let o=Ln(n);i!=null&&r.has(o)&&t.set(o,i)}}function us(e){switch(e){case Ft.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function hs(e,t){for(let r in e){let n=e[r];for(let[i,o]of Object.entries(n)){if(o==null)continue;let s=Ln(i);t.set(`items[${r}][${s}]`,o)}}}function fs({url:e,modal:t,is3in1:r}){if(!r||!e?.searchParams)return e;e.searchParams.set("rtc","t"),e.searchParams.set("lo","sl");let n=e.searchParams.get("af");return e.searchParams.set("af",[n,"uc_new_user_iframe","uc_new_system_close"].filter(Boolean).join(",")),e.searchParams.get("cli")!=="doc_cloud"&&e.searchParams.set("cli",t===he.CRM?"creative":"mini_plans"),e}function ps(e){let t=new URLSearchParams(window.location.search),r={};Cn.forEach(n=>{let i=t.get(n);i!==null&&(r[n]=i)}),Object.keys(r).length>0&&ct(r,e.searchParams,Cn)}function wn(e){ms(e);let{env:t,items:r,workflowStep:n,marketSegment:i,customerSegment:o,offerType:s,productArrangementCode:a,landscape:c,modal:u,is3in1:l,preselectPlan:f,...p}=e,h=new URL(us(t));if(h.pathname=`${as}${n}`,n!==F.SEGMENTATION&&n!==F.CHANGE_PLAN_TEAM_PLANS&&hs(r,h.searchParams),ct({...p},h.searchParams,hr),ps(h),c===se.DRAFT&&ct({af:ss},h.searchParams,hr),n===F.SEGMENTATION){let m={marketSegment:i,offerType:s,customerSegment:o,productArrangementCode:a,quantity:r?.[0]?.quantity,addonProductArrangementCode:a?r?.find(d=>d.productArrangementCode!==a)?.productArrangementCode:r?.[1]?.productArrangementCode};f?.toLowerCase()==="edu"?h.searchParams.set("ms","EDU"):f?.toLowerCase()==="team"&&h.searchParams.set("cs","TEAM"),ct(m,h.searchParams,hr),h.searchParams.get("ot")==="PROMOTION"&&h.searchParams.delete("ot"),h=fs({url:h,modal:u,is3in1:l})}return h.toString()}function ms(e){for(let t of ls)if(!e[t])throw new Error(`Argument "checkoutData" is not valid, missing: ${t}`);if(e.workflowStep!==F.SEGMENTATION&&e.workflowStep!==F.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}var b=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflowStep:F.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,displayPlanType:!1,env:Z.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:se.PUBLISHED});function Rn({settings:e,providers:t}){function r(o,s){let{checkoutClientId:a,checkoutWorkflowStep:c,country:u,language:l,promotionCode:f,quantity:p,preselectPlan:h,env:m}=e,d={checkoutClientId:a,checkoutWorkflowStep:c,country:u,language:l,promotionCode:f,quantity:p,preselectPlan:h,env:m};if(s)for(let ye of t.checkout)ye(s,d);let{checkoutMarketSegment:E,checkoutWorkflowStep:y=c,imsCountry:v,country:g=v??u,language:S=l,quantity:M=p,entitlement:L,upgrade:H,modal:D,perpetual:V,promotionCode:U=f,wcsOsi:O,extraOptions:C,...$}=Object.assign(d,s?.dataset??{},o??{}),j=Oe(y,F,b.checkoutWorkflowStep);return d=Qe({...$,extraOptions:C,checkoutClientId:a,checkoutMarketSegment:E,country:g,quantity:be(M,b.quantity),checkoutWorkflowStep:j,language:S,entitlement:x(L),upgrade:x(H),modal:D,perpetual:x(V),promotionCode:et(U).effectivePromoCode,wcsOsi:it(O),preselectPlan:h}),d}function n(o,s){if(!Array.isArray(o)||!o.length||!s)return"";let{env:a,landscape:c}=e,{checkoutClientId:u,checkoutMarketSegment:l,checkoutWorkflowStep:f,country:p,promotionCode:h,quantity:m,preselectPlan:d,ms:E,cs:y,...v}=r(s),g=document.querySelector("meta[name=mas-ff-3in1]"),S=Object.values(he).includes(s.modal)&&(!g||g.content!=="off"),M=window.frameElement||S?"if":"fp",[{productArrangementCode:L,marketSegments:[H],customerSegment:D,offerType:V}]=o,U=E??H??l,O=y??D;d?.toLowerCase()==="edu"?U="EDU":d?.toLowerCase()==="team"&&(O="TEAM");let C={is3in1:S,checkoutPromoCode:h,clientId:u,context:M,country:p,env:a,items:[],marketSegment:U,customerSegment:O,offerType:V,productArrangementCode:L,workflowStep:f,landscape:c,...v},$=m[0]>1?m[0]:void 0;if(o.length===1){let{offerId:j}=o[0];C.items.push({id:j,quantity:$})}else C.items.push(...o.map(({offerId:j,productArrangementCode:ye})=>({id:j,quantity:$,...S?{productArrangementCode:ye}:{}})));return wn(C)}let{createCheckoutLink:i}=ee;return{CheckoutLink:ee,CheckoutWorkflowStep:F,buildCheckoutURL:n,collectCheckoutOptions:r,createCheckoutLink:i}}function ds({interval:e=200,maxAttempts:t=25}={}){let r=G.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function Es(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function gs(e){let t=G.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function Nn({}){let e=ds(),t=Es(e),r=gs(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}var On=window.masPriceLiterals;function In(e){if(Array.isArray(On)){let t=e.locale==="id_ID"?"in":e.language,r=i=>On.find(o=>Wt(o.lang,i)),n=r(t)??r(b.language);if(n)return Object.freeze(n)}return{}}var fr=function(e,t){return fr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},fr(e,t)};function Ue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(ys,function(c,u,l,f,p,h){if(u)t.minimumIntegerDigits=l.length;else{if(f&&p)throw new Error("We currently do not support maximum integer digits");if(h)throw new Error("We currently do not support exact integer digits")}return""});continue}if($n.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Bn.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Bn,function(c,u,l,f,p,h){return l==="*"?t.minimumFractionDigits=u.length:f&&f[0]==="#"?t.maximumFractionDigits=f.length:p&&h?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+h.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var o=i.options[0];o==="w"?t=T(T({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=T(T({},t),kn(o)));continue}if(Vn.test(i.stem)){t=T(T({},t),kn(i.stem));continue}var s=Yn(i.stem);s&&(t=T(T({},t),s));var a=Ts(i.stem);a&&(t=T(T({},t),a))}return t}var ke={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 jn(e,t){for(var r="",n=0;n>1),c="a",u=_s(t);for((u=="H"||u=="k")&&(a=0);a-- >0;)r+=c;for(;s-- >0;)r=u+r}else i==="J"?r+="H":r+=i}return r}function _s(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,n;r!=="root"&&(n=e.maximize().region);var i=ke[n||""]||ke[r||""]||ke["".concat(r,"-001")]||ke["001"];return i[0]}var dr,Ss=new RegExp("^".concat(mr.source,"*")),bs=new RegExp("".concat(mr.source,"*$"));function _(e,t){return{start:e,end:t}}var Ps=!!String.prototype.startsWith,vs=!!String.fromCodePoint,Cs=!!Object.fromEntries,Ls=!!String.prototype.codePointAt,ws=!!String.prototype.trimStart,Rs=!!String.prototype.trimEnd,Ns=!!Number.isSafeInteger,Os=Ns?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},gr=!0;try{Xn=Zn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),gr=((dr=Xn.exec("a"))===null||dr===void 0?void 0:dr[0])==="a"}catch{gr=!1}var Xn,qn=Ps?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},xr=vs?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},zn=Cs?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Is=ws?function(t){return t.trimStart()}:function(t){return t.replace(Ss,"")},Ms=Rs?function(t){return t.trimEnd()}:function(t){return t.replace(bs,"")};function Zn(e,t){return new RegExp(e,t)}var Ar;gr?(Er=Zn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ar=function(t,r){var n;Er.lastIndex=r;var i=Er.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Ar=function(t,r){for(var n=[];;){var i=Kn(t,r);if(i===void 0||Jn(i)||Us(i))break;n.push(i),r+=i>=65536?2:1}return xr.apply(void 0,n)};var Er,Qn=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,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:w.pound,location:_(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(A.UNMATCHED_CLOSING_TAG,_(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&yr(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:w.literal,value:"<".concat(i,"/>"),location:_(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:w.tag,value:i,children:s,location:_(n,this.clonePosition())},err:null}:this.error(A.INVALID_TAG,_(a,this.clonePosition())))}else return this.error(A.UNCLOSED_TAG,_(n,this.clonePosition()))}else return this.error(A.INVALID_TAG,_(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Ds(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=_(n,this.clonePosition());return{val:{type:w.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Hs(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return xr.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),xr(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(A.EMPTY_ARGUMENT,_(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(A.MALFORMED_ARGUMENT,_(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:w.argument,value:i,location:_(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(A.MALFORMED_ARGUMENT,_(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Ar(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=_(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(A.EXPECT_ARGUMENT_TYPE,_(s,c));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;var p=Ms(f.val);if(p.length===0)return this.error(A.EXPECT_ARGUMENT_STYLE,_(this.clonePosition(),this.clonePosition()));var h=_(l,this.clonePosition());u={style:p,styleLocation:h}}var m=this.tryParseArgumentClose(i);if(m.err)return m;var d=_(i,this.clonePosition());if(u&&qn(u?.style,"::",0)){var E=Is(u.style.slice(2));if(a==="number"){var f=this.parseNumberSkeletonFromString(E,u.styleLocation);return f.err?f:{val:{type:w.number,value:n,location:d,style:f.val},err:null}}else{if(E.length===0)return this.error(A.EXPECT_DATE_TIME_SKELETON,d);var y=E;this.locale&&(y=jn(E,this.locale));var p={type:de.dateTime,pattern:y,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?Dn(y):{}},v=a==="date"?w.date:w.time;return{val:{type:v,value:n,location:d,style:p},err:null}}}return{val:{type:a==="number"?w.number:a==="date"?w.date:w.time,value:n,location:d,style:(o=u?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var g=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(A.EXPECT_SELECT_ARGUMENT_OPTIONS,_(g,T({},g)));this.bumpSpace();var S=this.parseIdentifierIfPossible(),M=0;if(a!=="select"&&S.value==="offset"){if(!this.bumpIf(":"))return this.error(A.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,_(this.clonePosition(),this.clonePosition()));this.bumpSpace();var f=this.tryParseDecimalInteger(A.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,A.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(f.err)return f;this.bumpSpace(),S=this.parseIdentifierIfPossible(),M=f.val}var L=this.tryParsePluralOrSelectOptions(t,a,r,S);if(L.err)return L;var m=this.tryParseArgumentClose(i);if(m.err)return m;var H=_(i,this.clonePosition());return a==="select"?{val:{type:w.select,value:n,options:zn(L.val),location:H},err:null}:{val:{type:w.plural,value:n,options:zn(L.val),offset:M,pluralType:a==="plural"?"cardinal":"ordinal",location:H},err:null}}default:return this.error(A.INVALID_ARGUMENT_TYPE,_(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(A.EXPECT_ARGUMENT_CLOSING_BRACE,_(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(A.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,_(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=Gn(t)}catch{return this.error(A.INVALID_NUMBER_SKELETON,r)}return{val:{type:de.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Wn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,u=i.value,l=i.location;;){if(u.length===0){var f=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var p=this.tryParseDecimalInteger(A.EXPECT_PLURAL_ARGUMENT_SELECTOR,A.INVALID_PLURAL_ARGUMENT_SELECTOR);if(p.err)return p;l=_(f,this.clonePosition()),u=this.message.slice(f.offset,this.offset())}else break}if(c.has(u))return this.error(r==="select"?A.DUPLICATE_SELECT_ARGUMENT_SELECTOR:A.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?A.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:A.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,_(this.clonePosition(),this.clonePosition()));var m=this.parseMessage(t+1,r,n);if(m.err)return m;var d=this.tryParseArgumentClose(h);if(d.err)return d;a.push([u,{value:m.val,location:_(h,this.clonePosition())}]),c.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,l=o.location}return a.length===0?this.error(r==="select"?A.EXPECT_SELECT_ARGUMENT_SELECTOR:A.EXPECT_PLURAL_ARGUMENT_SELECTOR,_(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(A.MISSING_OTHER_CLAUSE,_(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=_(i,this.clonePosition());return o?(s*=n,Os(s)?{val:s,err:null}:this.error(r,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=Kn(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(qn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".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()&&Jn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function yr(e){return e>=97&&e<=122||e>=65&&e<=90}function Hs(e){return yr(e)||e===47}function Ds(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 Jn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Us(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Tr(e){e.forEach(function(t){if(delete t.location,pt(t)||mt(t))for(var r in t.options)delete t.options[r].location,Tr(t.options[r].value);else ut(t)&&Et(t.style)||(ht(t)||ft(t))&&Be(t.style)?delete t.style.location:dt(t)&&Tr(t.children)})}function ei(e,t){t===void 0&&(t={}),t=T({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Qn(e,t).parse();if(r.err){var n=SyntaxError(A[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Tr(r.val),r.val}function Fe(e,t){var r=t&&t.cache?t.cache:$s,n=t&&t.serializer?t.serializer:Vs,i=t&&t.strategy?t.strategy:ks;return i(e,{cache:r,serializer:n})}function Bs(e){return e==null||typeof e=="number"||typeof e=="boolean"}function ti(e,t,r,n){var i=Bs(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function ri(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function _r(e,t,r,n,i){return r.bind(t,e,n,i)}function ks(e,t){var r=e.length===1?ti:ri;return _r(e,this,r,t.cache.create(),t.serializer)}function Fs(e,t){return _r(e,this,ri,t.cache.create(),t.serializer)}function Gs(e,t){return _r(e,this,ti,t.cache.create(),t.serializer)}var Vs=function(){return JSON.stringify(arguments)};function Sr(){this.cache=Object.create(null)}Sr.prototype.get=function(e){return this.cache[e]};Sr.prototype.set=function(e,t){this.cache[e]=t};var $s={create:function(){return new Sr}},gt={variadic:Fs,monadic:Gs};var Ee;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Ee||(Ee={}));var Ge=function(e){Ue(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var br=function(e){Ue(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Ee.INVALID_VALUE,o)||this}return t}(Ge);var ni=function(e){Ue(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Ee.INVALID_VALUE,i)||this}return t}(Ge);var ii=function(e){Ue(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Ee.MISSING_VALUE,n)||this}return t}(Ge);var k;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(k||(k={}));function Ys(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==k.literal||r.type!==k.literal?t.push(r):n.value+=r.value,t},[])}function Ws(e){return typeof e=="function"}function Ve(e,t,r,n,i,o,s){if(e.length===1&&pr(e[0]))return[{type:k.literal,value:e[0].value}];for(var a=[],c=0,u=e;c0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ei,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 si=oi;var vr={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 {}}"},zs=Kr("ConsonantTemplates/price"),Ks=/<\/?[^>]+(>|$)/g,w={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"},ce={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel",alternativePriceAriaLabel:"alternativePriceAriaLabel"},Cr="TAX_EXCLUSIVE",Zs=e=>Xr(e)?Object.entries(e).filter(([,t])=>Se(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+jr(n)+'"'}`,""):"",I=(e,t,r,n=!1)=>`${n?An(t):t??""}`;function Qs(e){e=e.replaceAll("
","</a>");let t=/]+(>|$)/g;return e.match(t)?.forEach(n=>{let i=n.replace("",">");e=e.replaceAll(n,i)}),e}function Js(e){e=e.replaceAll("</a>","");let t=/<a (?!>)(.*?)(>|$)/g;return e.match(t)?.forEach(n=>{let i=n.replace("<a ","");e=e.replaceAll(n,i)}),e}function te(e,t,r,n){let i=e[r];if(i==null)return"";let o=i.includes("<"),s=i.includes("${t}`:r&&(d=`${r}`),c&&(d+=h+m),d+=I(w.integer,a),d+=I(w.decimalsDelimiter,o),d+=I(w.decimals,i),c||(d+=m+h),d+=I(w.recurrence,u,null,!0),d+=I(w.unitType,l,null,!0),d+=I(w.taxInclusivity,f,!0),I(e,d,{...p})}var B=({isAlternativePrice:e=!1,displayOptical:t=!1,displayStrikethrough:r=!1,displayPromoStrikethrough:n=!1,displayAnnual:i=!1,instant:o=void 0}={})=>({country:s,displayFormatted:a=!0,displayRecurrence:c=!0,displayPerUnit:u=!1,displayTax:l=!1,language:f,literals:p={},quantity:h=1,space:m=!1,isPromoApplied:d=!1}={},{commitment:E,offerSelectorIds:y,formatString:v,price:g,priceWithoutDiscount:S,taxDisplay:M,taxTerm:L,term:H,usePrecision:D,promotion:V}={},U={})=>{Object.entries({country:s,formatString:v,language:f,price:g}).forEach(([ki,Fi])=>{if(Fi==null)throw new Error(`Argument "${ki}" is missing for osi ${y?.toString()}, country ${s}, language ${f}`)});let O={...vr,...p},C=`${f.toLowerCase()}-${s.toUpperCase()}`,$;V&&!d&&S?$=e||n?g:S:r&&S?$=S:$=g;let j=t?Tn:_n;i&&(j=Sn);let{accessiblePrice:ye,recurrenceTerm:Hr,...Dr}=j({commitment:E,formatString:v,instant:o,isIndianPrice:s==="IN",originalPrice:g,priceWithoutDiscount:S,price:t?g:$,promotion:V,quantity:h,term:H,usePrecision:D}),Tt="",_t="",St="";x(c)&&Hr&&(St=te(O,C,ce.recurrenceLabel,{recurrenceTerm:Hr}));let Xe="";x(u)&&(m&&(Xe+=" "),Xe+=te(O,C,ce.perUnitLabel,{perUnit:"LICENSE"}));let qe="";x(l)&&L&&(m&&(qe+=" "),qe+=te(O,C,M===Cr?ce.taxExclusiveLabel:ce.taxInclusiveLabel,{taxTerm:L})),r&&(Tt=te(O,C,ce.strikethroughAriaLabel,{strikethroughPrice:Tt})),e&&(_t=te(O,C,ce.alternativePriceAriaLabel,{alternativePrice:_t}));let le=w.container;if(t&&(le+=" "+w.containerOptical),r&&(le+=" "+w.containerStrikethrough),n&&(le+=" "+w.containerPromoStrikethrough),e&&(le+=" "+w.containerAlternative),i&&(le+=" "+w.containerAnnual),x(a))return ea(le,{...Dr,accessibleLabel:Tt,altAccessibleLabel:_t,recurrenceLabel:St,perUnitLabel:Xe,taxInclusivityLabel:qe},U);let{currencySymbol:Ur,decimals:Mi,decimalsDelimiter:Hi,hasCurrencySpace:Br,integer:Di,isCurrencyFirst:Ui}=Dr,Te=[Di,Hi,Mi];Ui?(Te.unshift(Br?"\xA0":""),Te.unshift(Ur)):(Te.push(Br?"\xA0":""),Te.push(Ur)),Te.push(St,Xe,qe);let Bi=Te.join("");return I(le,Bi,U)},ai=()=>(e,t,r)=>{let n=me(t.promotion,t.promotion?.displaySummary?.instant,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),o=(e.displayOldPrice===void 0||x(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price&&(!t.promotion||n);return`${o?B({displayStrikethrough:!0})({isPromoApplied:n,...e},t,r)+" ":""}${B({isAlternativePrice:o})({isPromoApplied:n,...e},t,r)}`},ci=()=>(e,t,r)=>{let{instant:n}=e;try{n||(n=new URLSearchParams(document.location.search).get("instant")),n&&(n=new Date(n))}catch{n=void 0}let i=me(t.promotion,n,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),o={...e,displayTax:!1,displayPerUnit:!1,isPromoApplied:i};if(!i)return B()(e,{...t,price:t.priceWithoutDiscount},r)+I(w.containerAnnualPrefix," (")+B({displayAnnual:!0,instant:n})(o,{...t,price:t.priceWithoutDiscount},r)+I(w.containerAnnualSuffix,")");let a=(e.displayOldPrice===void 0||x(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${a?B({displayStrikethrough:!0})(o,t,r)+" ":""}${B({isAlternativePrice:a})({isPromoApplied:i,...e},t,r)}${I(w.containerAnnualPrefix," (")}${B({displayAnnual:!0,instant:n})(o,t,r)}${I(w.containerAnnualSuffix,")")}`},li=()=>(e,t,r)=>{let n={...e,displayTax:!1,displayPerUnit:!1};return`${B({isAlternativePrice:e.displayOldPrice})(e,t,r)}${I(w.containerAnnualPrefix," (")}${B({displayAnnual:!0})(n,t,r)}${I(w.containerAnnualSuffix,")")}`};var $e={...w,containerLegal:"price-legal",planType:"price-plan-type"},xt={...ce,planTypeLabel:"planTypeLabel"};function ta(e,{perUnitLabel:t,taxInclusivityLabel:r,planTypeLabel:n},i={}){let o="";return o+=I($e.unitType,t,null,!0),r&&n&&(r+=". "),o+=I($e.taxInclusivity,r,!0),o+=I($e.planType,n,null),I(e,o,{...i})}var ui=({country:e,displayPerUnit:t=!1,displayTax:r=!1,displayPlanType:n=!1,language:i,literals:o={}}={},{taxDisplay:s,taxTerm:a,planType:c}={},u={})=>{let l={...vr,...o},f=`${i.toLowerCase()}-${e.toUpperCase()}`,p="";x(t)&&(p=te(l,f,xt.perUnitLabel,{perUnit:"LICENSE"}));let h="";e==="US"&&i==="en"&&(r=!1),x(r)&&a&&(h=te(l,f,s===Cr?xt.taxExclusiveLabel:xt.taxInclusiveLabel,{taxTerm:a}));let m="";x(n)&&c&&(m=te(l,f,xt.planTypeLabel,{planType:c}));let d=$e.container;return d+=" "+$e.containerLegal,ta(d,{perUnitLabel:p,taxInclusivityLabel:h,planTypeLabel:m},u)};var hi=B(),fi=ai(),pi=B({displayOptical:!0}),mi=B({displayStrikethrough:!0}),di=B({displayPromoStrikethrough:!0}),Ei=B({displayAnnual:!0}),gi=B({displayOptical:!0,isAlternativePrice:!0}),xi=B({isAlternativePrice:!0}),Ai=li(),yi=ci(),Ti=ui;var ra=(e,t)=>{if(!(!we(e)||!we(t)))return Math.floor((t-e)/t*100)},_i=()=>(e,t)=>{let{price:r,priceWithoutDiscount:n}=t,i=ra(r,n);return i===void 0?'':`${i}%`};var Si=_i();var bi="INDIVIDUAL_COM",Rr="TEAM_COM",Pi="INDIVIDUAL_EDU",Nr="TEAM_EDU",na=["AT_de","AU_en","BE_en","BE_fr","BE_nl","BG_bg","CH_de","CH_fr","CH_it","CZ_cs","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],ia={[bi]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[Rr]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Pi]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[Nr]:["SG_en","KR_ko"]},oa={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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!1,!1,!1,!1]},sa=[bi,Rr,Pi,Nr],aa=e=>[Rr,Nr].includes(e);function Lr(e,t,r,n){if(e[t])return e[t];let i=`${t}_${r}`;if(e[i])return e[i];let o;if(n)o=e.find(s=>s.startsWith(`${t}_`));else{let s=Object.keys(e).find(a=>a.startsWith(`${t}_`));o=s?e[s]:null}return o}var ca=(e,t,r,n)=>{let i=`${r}_${n}`,o=Lr(oa,e,t,!1);if(o){let s=sa.indexOf(i);return o[s]}return aa(i)},la=(e,t,r,n)=>{if(Lr(na,e,t,!0))return!0;let i=ia[`${r}_${n}`];return i?Lr(i,e,t,!0)?!0:b.displayTax:b.displayTax},At=async(e,t,r,n)=>{let i=la(e,t,r,n);return{displayTax:i,forceTaxExclusive:i?ca(e,t,r,n):b.forceTaxExclusive}},Ye=class Ye extends HTMLSpanElement{constructor(){super();P(this,"masElement",new ae(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 n=Y();if(!n)return null;let{displayOldPrice:i,displayPerUnit:o,displayRecurrence:s,displayTax:a,displayPlanType:c,displayAnnual:u,forceTaxExclusive:l,perpetual:f,promotionCode:p,quantity:h,alternativePrice:m,template:d,wcsOsi:E}=n.collectPriceOptions(r);return ot(Ye,{displayOldPrice:i,displayPerUnit:o,displayRecurrence:s,displayTax:a,displayPlanType:c,displayAnnual:u,forceTaxExclusive:l,perpetual:f,promotionCode:p,quantity:h,alternativePrice:m,template:d,wcsOsi:E})}get isInlinePrice(){return!0}attributeChangedCallback(r,n,i){this.masElement.attributeChangedCallback(r,n,i)}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===z}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let n=Y();if(!n)return!1;let i=n.collectPriceOptions(r,this),o={...n.settings,...i};if(!o.wcsOsi.length)return!1;try{let s=this.masElement.togglePending({});this.innerHTML="";let a=n.resolveOfferSelectors(o),c=await Promise.all(a),u=c.map(h=>{let m=Me(h,o);return m?.length?m[0]:null});if(u.some(h=>!h))throw new Error(`Failed to select offers for: ${o.wcsOsi}`);let l=u,f=ar(u);if(n.featureFlags[J]||o[J]){if(i.displayPerUnit===void 0&&(o.displayPerUnit=f.customerSegment!=="INDIVIDUAL"),i.displayTax===void 0||i.forceTaxExclusive===void 0){let{country:h,language:m}=o,[d=""]=f.marketSegments,E=await At(h,m,f.customerSegment,d);i.displayTax===void 0&&(o.displayTax=E?.displayTax||o.displayTax),i.forceTaxExclusive===void 0&&(o.forceTaxExclusive=E?.forceTaxExclusive||o.forceTaxExclusive),o.forceTaxExclusive&&(l=c.map(y=>{let v=Me(y,o);return v?.length?v[0]:null}))}}else i.displayOldPrice===void 0&&(o.displayOldPrice=!0);if(n.featureFlags[_e]&&o.displayAnnual!==!1&&(o.displayAnnual=!0),o.template==="discount"&&l.length===2){let[h,m]=l,d={...h,priceDetails:{...h.priceDetails,priceWithoutDiscount:m.priceDetails?.price}};return this.renderOffers([d],o,s)}let p=ar(l);return this.renderOffers([p],o,s)}catch(s){throw this.innerHTML="",s}}renderOffers(r,n,i=void 0){if(!this.isConnected)return;let o=Y();if(!o)return!1;if(i??(i=this.masElement.togglePending()),r.length){if(this.masElement.toggleResolved(i,r,n)){this.innerHTML=o.buildPriceHTML(r,this.options);let s=this.closest("p, h3, div");if(!s||!s.querySelector('span[data-template="strikethrough"]')||s.querySelector(".alt-aria-label"))return!0;let a=s?.querySelectorAll('span[is="inline-price"]');return a.length>1&&a.length===s.querySelectorAll('span[data-template="strikethrough"]').length*2&&a.forEach(c=>{c.dataset.template!=="strikethrough"&&c.options&&!c.options.alternativePrice&&!c.isFailed&&(c.options.alternativePrice=!0,c.innerHTML=o.buildPriceHTML(r,c.options))}),!0}}else{let s=new Error(`Not provided: ${this.options?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(i,s,this.options))return this.innerHTML="",!0}return!1}};P(Ye,"is","inline-price"),P(Ye,"tag","span");var re=Ye;window.customElements.get(re.is)||window.customElements.define(re.is,re,{extends:re.tag});function vi({literals:e,providers:t,settings:r}){function n(s,a=null){let c={country:r.country,language:r.language,locale:r.locale,literals:{...e.price}};if(a&&t?.price)for(let L of t.price)L(a,c);let{displayOldPrice:u,displayPerUnit:l,displayRecurrence:f,displayTax:p,displayPlanType:h,forceTaxExclusive:m,perpetual:d,displayAnnual:E,promotionCode:y,quantity:v,alternativePrice:g,wcsOsi:S,...M}=Object.assign(c,a?.dataset??{},s??{});return c=Qe(Object.assign({...c,...M,displayOldPrice:x(u),displayPerUnit:x(l),displayRecurrence:x(f),displayTax:x(p),displayPlanType:x(h),forceTaxExclusive:x(m),perpetual:x(d),displayAnnual:x(E),promotionCode:et(y).effectivePromoCode,quantity:be(v,b.quantity),alternativePrice:x(g),wcsOsi:it(S)})),c}function i(s,a){if(!Array.isArray(s)||!s.length||!a)return"";let{template:c}=a,u;switch(c){case"discount":u=Si;break;case"strikethrough":u=mi;break;case"promo-strikethrough":u=di;break;case"annual":u=Ei;break;case"legal":u=Ti;break;default:a.template==="optical"&&a.alternativePrice?u=gi:a.template==="optical"?u=pi:a.displayAnnual&&s[0].planType==="ABM"?u=a.promotionCode?yi:Ai:a.alternativePrice?u=xi:u=a.promotionCode?fi:hi}let[l]=s;return l={...l,...l.priceDetails},u({...r,...a},l)}let o=re.createInlinePrice;return{InlinePrice:re,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o}}function ua({locale:e=void 0,country:t=void 0,language:r=void 0}={}){return r??(r=e?.split("_")?.[0]||b.language),t??(t=e?.split("_")?.[1]||b.country),e??(e=`${r}_${t}`),{locale:e,country:t,language:r}}function Ci(e={},t){let r=t.featureFlags[J],{commerce:n={}}=e,i=Z.PRODUCTION,o=Bt,s=N("checkoutClientId",n)??b.checkoutClientId,a=Oe(N("checkoutWorkflowStep",n),F,b.checkoutWorkflowStep),c=x(N("displayOldPrice",n),b.displayOldPrice),u=b.displayPerUnit,l=x(N("displayRecurrence",n),b.displayRecurrence),f=x(N("displayTax",n),b.displayTax),p=x(N("displayPlanType",n),b.displayPlanType),h=x(N("entitlement",n),b.entitlement),m=x(N("modal",n),b.modal),d=x(N("forceTaxExclusive",n),b.forceTaxExclusive),E=N("promotionCode",n)??b.promotionCode,y=be(N("quantity",n)),v=N("wcsApiKey",n)??b.wcsApiKey,g=n?.env==="stage",S=se.PUBLISHED;["true",""].includes(n.allowOverride)&&(g=(N(Dt,n,{metadata:!1})?.toLowerCase()??n?.env)==="stage",S=Oe(N(Ut,n),se,S)),g&&(i=Z.STAGE,o=kt);let L=N(Ht)??e.preview,H=typeof L<"u"&&L!=="off"&&L!=="false",D={};H&&(D={preview:H});let V=N("mas-io-url")??e.masIOUrl??`https://www${i===Z.STAGE?".stage":""}.adobe.com/mas/io`,U=N("preselect-plan")??void 0;return{...ua(e),...D,displayOldPrice:c,checkoutClientId:s,checkoutWorkflowStep:a,displayPerUnit:u,displayRecurrence:l,displayTax:f,displayPlanType:p,entitlement:h,extraOptions:b.extraOptions,modal:m,env:i,forceTaxExclusive:d,promotionCode:E,quantity:y,alternativePrice:b.alternativePrice,wcsApiKey:v,wcsURL:o,landscape:S,masIOUrl:V,...U&&{preselectPlan:U}}}async function Li(e,t={},r=2,n=100){let i;for(let o=0;o<=r;o++)try{let s=await fetch(e,t);return s.retryCount=o,s}catch(s){if(i=s,i.retryCount=o,o>r)break;await new Promise(a=>setTimeout(a,n*(o+1)))}throw i}var ha="mas-commerce-service";function yt(e){return`startTime:${e.startTime.toFixed(2)}|duration:${e.duration.toFixed(2)}`}function wr(){return document.getElementsByTagName(ha)?.[0]}var Or="wcs";function Ri({settings:e}){let t=G.module(Or),{env:r,wcsApiKey:n}=e,i=new Map,o=new Map,s,a=new Map;async function c(m,d,E=!0){let y=Y(),v=wt;t.debug("Fetching:",m);let g="",S;if(m.offerSelectorIds.length>1)throw new Error("Multiple OSIs are not supported anymore");let M=new Map(d),[L]=m.offerSelectorIds,H=Date.now()+Math.random().toString(36).substring(2,7),D=`${Or}:${L}:${H}${Gt}`,V=`${Or}:${L}:${H}${Vt}`,U;try{if(performance.mark(D),g=new URL(e.wcsURL),g.searchParams.set("offer_selector_ids",L),g.searchParams.set("country",m.country),g.searchParams.set("locale",m.locale),g.searchParams.set("landscape",r===Z.STAGE?"ALL":e.landscape),g.searchParams.set("api_key",n),m.language&&g.searchParams.set("language",m.language),m.promotionCode&&g.searchParams.set("promotion_code",m.promotionCode),m.currency&&g.searchParams.set("currency",m.currency),S=await Li(g.toString(),{credentials:"omit"}),S.ok){let O=[];try{let C=await S.json();t.debug("Fetched:",m,C),O=C.resolvedOffers??[]}catch(C){t.error(`Error parsing JSON: ${C.message}`,{...C.context,...y?.duration})}O=O.map(Ie),d.forEach(({resolve:C},$)=>{let j=O.filter(({offerSelectorIds:ye})=>ye.includes($)).flat();j.length&&(M.delete($),d.delete($),C(j))})}else v=Nt}catch(O){v=`Network error: ${O.message}`}finally{U=performance.measure(V,D),performance.clearMarks(D),performance.clearMeasures(V)}if(E&&d.size){t.debug("Missing:",{offerSelectorIds:[...d.keys()]});let O=un(S);d.forEach(C=>{C.reject(new Pe(v,{...m,...O,response:S,measure:yt(U),...y?.duration}))})}}function u(){clearTimeout(s);let m=[...o.values()];o.clear(),m.forEach(({options:d,promises:E})=>c(d,E))}function l(m){if(!m||typeof m!="object")throw new TypeError("Cache must be a Map or similar object");let d=r===Z.STAGE?"stage":"prod",E=m[d];if(!E||typeof E!="object"){t.warn(`No cache found for environment: ${r}`);return}for(let[y,v]of Object.entries(E))i.set(y,Promise.resolve(v.map(Ie)));t.debug(`Prefilled WCS cache with ${E.size} entries`)}function f(){let m=i.size;a=new Map(i),i.clear(),t.debug(`Moved ${m} cache entries to stale cache`)}function p(m,d,E){let y=m!=="GB"&&!E?"MULT":"en",v=$t.includes(m)?m:b.country;return{validCountry:v,validLanguage:y,locale:`${d}_${v}`}}function h({country:m,language:d,perpetual:E=!1,promotionCode:y="",wcsOsi:v=[]}){let{validCountry:g,validLanguage:S,locale:M}=p(m,d,E),L=[g,S,y].filter(H=>H).join("-").toLowerCase();return v.map(H=>{let D=`${H}-${L}`;if(i.has(D))return i.get(D);let V=new Promise((U,O)=>{let C=o.get(L);C||(C={options:{country:g,locale:M,...S==="MULT"&&{language:S},offerSelectorIds:[]},promises:new Map},o.set(L,C)),y&&(C.options.promotionCode=y),C.options.offerSelectorIds.push(H),C.promises.set(H,{resolve:U,reject:O}),u()}).catch(U=>{if(a.has(D))return a.get(D);throw U});return i.set(D,V),V})}return{Commitment:ue,PlanType:Qr,Term:X,applyPlanType:Ie,resolveOfferSelectors:h,flushWcsCacheInternal:f,prefillWcsCache:l,normalizeCountryLanguageAndLocale:p}}var Ni="mas-commerce-service",wi="mas-commerce-service:start",Oi="mas-commerce-service:ready",We,Ce,ge,Ii,Mr,Ir=class extends HTMLElement{constructor(){super(...arguments);ne(this,ge);ne(this,We);ne(this,Ce);P(this,"lastLoggingTime",0)}async registerCheckoutAction(r){typeof r=="function"&&(this.buildCheckoutAction=async(n,i,o)=>{let s=await r?.(n,i,this.imsSignedInPromise,o);return s||null})}get featureFlags(){return K(this,Ce)||ie(this,Ce,{[J]:Pt(this,ge,Mr).call(this,J),[_e]:Pt(this,ge,Mr).call(this,_e)}),K(this,Ce)}activate(){let r=K(this,ge,Ii),n=Ci(r,this);tt(r.lana);let i=G.init(r.hostEnv).module("service");i.debug("Activating:",r);let s={price:In(n)},a={checkout:new Set,price:new Set},c={literals:s,providers:a,settings:n};Object.defineProperties(this,Object.getOwnPropertyDescriptors({...Nn(c),...wn(c),...vi(c),...Ri(c),...Yt,Log:G,resolvePriceTaxFlags:At,get defaults(){return b},get log(){return G},get providers(){return{checkout(l){return a.checkout.add(l),()=>a.checkout.delete(l)},price(l){return a.price.add(l),()=>a.price.delete(l)},has:l=>a.price.has(l)||a.checkout.has(l)}},get settings(){return n}})),i.debug("Activated:",{literals:s,settings:n});let u=new CustomEvent(ze,{bubbles:!0,cancelable:!1,detail:this});performance.mark(Oi),ie(this,We,performance.measure(Oi,wi)),this.dispatchEvent(u),setTimeout(()=>{this.logFailedRequests()},1e4)}connectedCallback(){performance.mark(wi),this.activate()}flushWcsCache(){this.flushWcsCacheInternal(),this.log.debug("Flushed WCS cache")}refreshOffers(){this.flushWcsCacheInternal(),document.querySelectorAll(vt).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":yt(K(this,We))}}logFailedRequests(){let r=[...performance.getEntriesByType("resource")].filter(({startTime:i})=>i>this.lastLoggingTime).filter(({transferSize:i,duration:o,responseStatus:s})=>i===0&&o===0&&s<200||s>=400),n=Array.from(new Map(r.map(i=>[i.name,i])).values());if(n.some(({name:i})=>/(\/fragment\?|web_commerce_artifact)/.test(i))){let i=n.map(({name:o})=>o);this.log.error("Failed requests:",{failedUrls:i,...this.duration})}this.lastLoggingTime=performance.now().toFixed(3)}};We=new WeakMap,Ce=new WeakMap,ge=new WeakSet,Ii=function(){let r=this.getAttribute("env")??"prod",n={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(i=>{let o=this.getAttribute(i);o&&(n[i]=o)}),["checkout-workflow-step","force-tax-exclusive","checkout-client-id","allow-override","wcs-api-key"].forEach(i=>{let o=this.getAttribute(i);if(o!=null){let s=i.replace(/-([a-z])/g,a=>a[1].toUpperCase());n.commerce[s]=o}}),n},Mr=function(r){return["on","true",!0].includes(this.getAttribute(`data-${r}`)||N(r))};window.customElements.get(Ni)||window.customElements.define(Ni,Ir);var je=class je extends at(HTMLButtonElement){static createCheckoutButton(t={},r=""){return st(je,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)}};P(je,"is","checkout-button"),P(je,"tag","button");var Le=je;window.customElements.get(Le.is)||window.customElements.define(Le.is,Le,{extends:Le.tag});function fa(e){return`https://${e==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var Ae,xe=class xe extends HTMLAnchorElement{constructor(){super();P(this,"masElement",new ae(this));ne(this,Ae);this.setAttribute("is",xe.is)}get isUptLink(){return!0}initializeWcsData(r,n){this.setAttribute("data-wcs-osi",r),n&&this.setAttribute("data-promotion-code",n)}attributeChangedCallback(r,n,i){this.masElement.attributeChangedCallback(r,n,i)}connectedCallback(){this.masElement.connectedCallback(),ie(this,Ae,wr()),K(this,Ae)&&(this.log=K(this,Ae).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),ie(this,Ae,void 0)}requestUpdate(r=!1){this.masElement.requestUpdate(r)}onceSettled(){return this.masElement.onceSettled()}async render(){let r=wr();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(s=>{s&&(this.dataset.imsCountry=s)});let n=r.collectCheckoutOptions({},this);if(!n.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let i=this.masElement.togglePending(n),o=r.resolveOfferSelectors(n);try{let[[s]]=await Promise.all(o),{country:a,language:c,env:u}=n,l=`locale=${c}_${a}&country=${a}&offer_id=${s.offerId}`,f=this.getAttribute("data-promotion-code");f&&(l+=`&promotion_code=${encodeURIComponent(f)}`),this.href=`${fa(u)}?${l}`,this.masElement.toggleResolved(i,s,n)}catch(s){let a=new Error(`Could not resolve offer selectors for id: ${n.wcsOsi}.`,s.message);return this.masElement.toggleFailed(i,a,n),!1}}static createFrom(r){let n=new xe;for(let i of r.attributes)i.name!=="is"&&(i.name==="class"&&i.value.includes("upt-link")?n.setAttribute("class",i.value.replace("upt-link","").trim()):n.setAttribute(i.name,i.value));return n.innerHTML=r.innerHTML,n.setAttribute("tabindex",0),n}};Ae=new WeakMap,P(xe,"is","upt-link"),P(xe,"tag","a"),P(xe,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var Re=xe;window.customElements.get(Re.is)||window.customElements.define(Re.is,Re,{extends:Re.tag});function pa(e){return new DOMParser().parseFromString(e,"text/html").body.textContent||""}function ma(e){return e.split("?")[0]}function da(e,t){return t==="ANNUAL"||e==="PERPETUAL"?"P1Y":"P1M"}function Ea(e){if(!Array.isArray(e)||e.length===0)return;let t="?format=png&width=800&height=800";return e.length===1?`${e[0]}${t}`:e.map(r=>`${r}${t}`)}function ga(e){try{return JSON.parse(e.analytics).currencyCode}catch{return}}function xa(e,t,r,n){if(!e?.cardTitle||!t)return null;let i=ga(t);if(!i)return console.warn("[json-ld] No currency code found in offer analytics \u2014 JSON-LD injection skipped"),null;let{price:o}=t?.priceDetails??{};if(o==null)return null;let s=ma(n),a=`json-ld-product-${s}`;if(document.head.querySelector(`script[data-id="${a}"]`))return null;let c=o,l=t?.priceDetails?.priceWithoutDiscount??r?.priceDetails?.price;l!=null&&t?.priceDetails?.priceWithoutDiscount==null&&l0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ei,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 si=oi;var vr={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 {}}"},zs=Kr("ConsonantTemplates/price"),Ks=/<\/?[^>]+(>|$)/g,N={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"},ce={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel",alternativePriceAriaLabel:"alternativePriceAriaLabel"},Cr="TAX_EXCLUSIVE",Zs=e=>Xr(e)?Object.entries(e).filter(([,t])=>Se(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+jr(n)+'"'}`,""):"",I=(e,t,r,n=!1)=>`${n?An(t):t??""}`;function Qs(e){e=e.replaceAll("","</a>");let t=/]+(>|$)/g;return e.match(t)?.forEach(n=>{let i=n.replace("",">");e=e.replaceAll(n,i)}),e}function Js(e){e=e.replaceAll("</a>","");let t=/<a (?!>)(.*?)(>|$)/g;return e.match(t)?.forEach(n=>{let i=n.replace("<a ","");e=e.replaceAll(n,i)}),e}function te(e,t,r,n){let i=e[r];if(i==null)return"";let o=i.includes("<"),s=i.includes("${t}`:r&&(d=`${r}`),c&&(d+=h+m),d+=I(N.integer,a),d+=I(N.decimalsDelimiter,o),d+=I(N.decimals,i),c||(d+=m+h),d+=I(N.recurrence,u,null,!0),d+=I(N.unitType,l,null,!0),d+=I(N.taxInclusivity,f,!0),I(e,d,{...p})}var B=({isAlternativePrice:e=!1,displayOptical:t=!1,displayStrikethrough:r=!1,displayPromoStrikethrough:n=!1,displayAnnual:i=!1,instant:o=void 0}={})=>({country:s,displayFormatted:a=!0,displayRecurrence:c=!0,displayPerUnit:u=!1,displayTax:l=!1,language:f,literals:p={},quantity:h=1,space:m=!1,isPromoApplied:d=!1}={},{commitment:E,offerSelectorIds:y,formatString:v,price:g,priceWithoutDiscount:S,taxDisplay:M,taxTerm:L,term:H,usePrecision:D,promotion:V}={},U={})=>{Object.entries({country:s,formatString:v,language:f,price:g}).forEach(([ki,Fi])=>{if(Fi==null)throw new Error(`Argument "${ki}" is missing for osi ${y?.toString()}, country ${s}, language ${f}`)});let O={...vr,...p},C=`${f.toLowerCase()}-${s.toUpperCase()}`,$;V&&!d&&S?$=e||n?g:S:r&&S?$=S:$=g;let j=t?Tn:_n;i&&(j=Sn);let{accessiblePrice:ye,recurrenceTerm:Hr,...Dr}=j({commitment:E,formatString:v,instant:o,isIndianPrice:s==="IN",originalPrice:g,priceWithoutDiscount:S,price:t?g:$,promotion:V,quantity:h,term:H,usePrecision:D}),Tt="",_t="",St="";x(c)&&Hr&&(St=te(O,C,ce.recurrenceLabel,{recurrenceTerm:Hr}));let Xe="";x(u)&&(m&&(Xe+=" "),Xe+=te(O,C,ce.perUnitLabel,{perUnit:"LICENSE"}));let qe="";x(l)&&L&&(m&&(qe+=" "),qe+=te(O,C,M===Cr?ce.taxExclusiveLabel:ce.taxInclusiveLabel,{taxTerm:L})),r&&(Tt=te(O,C,ce.strikethroughAriaLabel,{strikethroughPrice:Tt})),e&&(_t=te(O,C,ce.alternativePriceAriaLabel,{alternativePrice:_t}));let le=N.container;if(t&&(le+=" "+N.containerOptical),r&&(le+=" "+N.containerStrikethrough),n&&(le+=" "+N.containerPromoStrikethrough),e&&(le+=" "+N.containerAlternative),i&&(le+=" "+N.containerAnnual),x(a))return ea(le,{...Dr,accessibleLabel:Tt,altAccessibleLabel:_t,recurrenceLabel:St,perUnitLabel:Xe,taxInclusivityLabel:qe},U);let{currencySymbol:Ur,decimals:Mi,decimalsDelimiter:Hi,hasCurrencySpace:Br,integer:Di,isCurrencyFirst:Ui}=Dr,Te=[Di,Hi,Mi];Ui?(Te.unshift(Br?"\xA0":""),Te.unshift(Ur)):(Te.push(Br?"\xA0":""),Te.push(Ur)),Te.push(St,Xe,qe);let Bi=Te.join("");return I(le,Bi,U)},ai=()=>(e,t,r)=>{let n=me(t.promotion,t.promotion?.displaySummary?.instant,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),o=(e.displayOldPrice===void 0||x(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price&&(!t.promotion||n);return`${o?B({displayStrikethrough:!0})({isPromoApplied:n,...e},t,r)+" ":""}${B({isAlternativePrice:o})({isPromoApplied:n,...e},t,r)}`},ci=()=>(e,t,r)=>{let{instant:n}=e;try{n||(n=new URLSearchParams(document.location.search).get("instant")),n&&(n=new Date(n))}catch{n=void 0}let i=me(t.promotion,n,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),o={...e,displayTax:!1,displayPerUnit:!1,isPromoApplied:i};if(!i)return B()(e,{...t,price:t.priceWithoutDiscount},r)+I(N.containerAnnualPrefix," (")+B({displayAnnual:!0,instant:n})(o,{...t,price:t.priceWithoutDiscount},r)+I(N.containerAnnualSuffix,")");let a=(e.displayOldPrice===void 0||x(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${a?B({displayStrikethrough:!0})(o,t,r)+" ":""}${B({isAlternativePrice:a})({isPromoApplied:i,...e},t,r)}${I(N.containerAnnualPrefix," (")}${B({displayAnnual:!0,instant:n})(o,t,r)}${I(N.containerAnnualSuffix,")")}`},li=()=>(e,t,r)=>{let n={...e,displayTax:!1,displayPerUnit:!1};return`${B({isAlternativePrice:e.displayOldPrice})(e,t,r)}${I(N.containerAnnualPrefix," (")}${B({displayAnnual:!0})(n,t,r)}${I(N.containerAnnualSuffix,")")}`};var $e={...N,containerLegal:"price-legal",planType:"price-plan-type"},xt={...ce,planTypeLabel:"planTypeLabel"};function ta(e,{perUnitLabel:t,taxInclusivityLabel:r,planTypeLabel:n},i={}){let o="";return o+=I($e.unitType,t,null,!0),r&&n&&(r+=". "),o+=I($e.taxInclusivity,r,!0),o+=I($e.planType,n,null),I(e,o,{...i})}var ui=({country:e,displayPerUnit:t=!1,displayTax:r=!1,displayPlanType:n=!1,language:i,literals:o={}}={},{taxDisplay:s,taxTerm:a,planType:c}={},u={})=>{let l={...vr,...o},f=`${i.toLowerCase()}-${e.toUpperCase()}`,p="";x(t)&&(p=te(l,f,xt.perUnitLabel,{perUnit:"LICENSE"}));let h="";e==="US"&&i==="en"&&(r=!1),x(r)&&a&&(h=te(l,f,s===Cr?xt.taxExclusiveLabel:xt.taxInclusiveLabel,{taxTerm:a}));let m="";x(n)&&c&&(m=te(l,f,xt.planTypeLabel,{planType:c}));let d=$e.container;return d+=" "+$e.containerLegal,ta(d,{perUnitLabel:p,taxInclusivityLabel:h,planTypeLabel:m},u)};var hi=B(),fi=ai(),pi=B({displayOptical:!0}),mi=B({displayStrikethrough:!0}),di=B({displayPromoStrikethrough:!0}),Ei=B({displayAnnual:!0}),gi=B({displayOptical:!0,isAlternativePrice:!0}),xi=B({isAlternativePrice:!0}),Ai=li(),yi=ci(),Ti=ui;var ra=(e,t)=>{if(!(!Ne(e)||!Ne(t)))return Math.floor((t-e)/t*100)},_i=()=>(e,t)=>{let{price:r,priceWithoutDiscount:n}=t,i=ra(r,n);return i===void 0?'':`${i}%`};var Si=_i();var bi="INDIVIDUAL_COM",wr="TEAM_COM",Pi="INDIVIDUAL_EDU",Rr="TEAM_EDU",na=["AT_de","AU_en","BE_en","BE_fr","BE_nl","BG_bg","CH_de","CH_fr","CH_it","CZ_cs","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],ia={[bi]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[wr]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Pi]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[Rr]:["SG_en","KR_ko"]},oa={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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!1,!1,!1,!1]},sa=[bi,wr,Pi,Rr],aa=e=>[wr,Rr].includes(e);function Lr(e,t,r,n){if(e[t])return e[t];let i=`${t}_${r}`;if(e[i])return e[i];let o;if(n)o=e.find(s=>s.startsWith(`${t}_`));else{let s=Object.keys(e).find(a=>a.startsWith(`${t}_`));o=s?e[s]:null}return o}var ca=(e,t,r,n)=>{let i=`${r}_${n}`,o=Lr(oa,e,t,!1);if(o){let s=sa.indexOf(i);return o[s]}return aa(i)},la=(e,t,r,n)=>{if(Lr(na,e,t,!0))return!0;let i=ia[`${r}_${n}`];return i?Lr(i,e,t,!0)?!0:b.displayTax:b.displayTax},At=async(e,t,r,n)=>{let i=la(e,t,r,n);return{displayTax:i,forceTaxExclusive:i?ca(e,t,r,n):b.forceTaxExclusive}},Ye=class Ye extends HTMLSpanElement{constructor(){super();P(this,"masElement",new ae(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 n=Y();if(!n)return null;let{displayOldPrice:i,displayPerUnit:o,displayRecurrence:s,displayTax:a,displayPlanType:c,displayAnnual:u,forceTaxExclusive:l,perpetual:f,promotionCode:p,quantity:h,alternativePrice:m,template:d,wcsOsi:E}=n.collectPriceOptions(r);return ot(Ye,{displayOldPrice:i,displayPerUnit:o,displayRecurrence:s,displayTax:a,displayPlanType:c,displayAnnual:u,forceTaxExclusive:l,perpetual:f,promotionCode:p,quantity:h,alternativePrice:m,template:d,wcsOsi:E})}get isInlinePrice(){return!0}attributeChangedCallback(r,n,i){this.masElement.attributeChangedCallback(r,n,i)}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===z}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let n=Y();if(!n)return!1;let i=n.collectPriceOptions(r,this),o={...n.settings,...i};if(!o.wcsOsi.length)return!1;try{let s=this.masElement.togglePending({});this.innerHTML="";let a=n.resolveOfferSelectors(o),c=await Promise.all(a),u=c.map(h=>{let m=Me(h,o);return m?.length?m[0]:null});if(u.some(h=>!h))throw new Error(`Failed to select offers for: ${o.wcsOsi}`);let l=u,f=ar(u);if(n.featureFlags[J]||o[J]){if(i.displayPerUnit===void 0&&(o.displayPerUnit=f.customerSegment!=="INDIVIDUAL"),i.displayTax===void 0||i.forceTaxExclusive===void 0){let{country:h,language:m}=o,[d=""]=f.marketSegments,E=await At(h,m,f.customerSegment,d);i.displayTax===void 0&&(o.displayTax=E?.displayTax||o.displayTax),i.forceTaxExclusive===void 0&&(o.forceTaxExclusive=E?.forceTaxExclusive||o.forceTaxExclusive),o.forceTaxExclusive&&(l=c.map(y=>{let v=Me(y,o);return v?.length?v[0]:null}))}}else i.displayOldPrice===void 0&&(o.displayOldPrice=!0);if(n.featureFlags[_e]&&o.displayAnnual!==!1&&(o.displayAnnual=!0),o.template==="discount"&&l.length===2){let[h,m]=l,d={...h,priceDetails:{...h.priceDetails,priceWithoutDiscount:m.priceDetails?.price}};return this.renderOffers([d],o,s)}let p=ar(l);return this.renderOffers([p],o,s)}catch(s){throw this.innerHTML="",s}}renderOffers(r,n,i=void 0){if(!this.isConnected)return;let o=Y();if(!o)return!1;if(i??(i=this.masElement.togglePending()),r.length){if(this.masElement.toggleResolved(i,r,n)){this.innerHTML=o.buildPriceHTML(r,this.options);let s=this.closest("p, h3, div");if(!s||!s.querySelector('span[data-template="strikethrough"]')||s.querySelector(".alt-aria-label"))return!0;let a=s?.querySelectorAll('span[is="inline-price"]');return a.length>1&&a.length===s.querySelectorAll('span[data-template="strikethrough"]').length*2&&a.forEach(c=>{c.dataset.template!=="strikethrough"&&c.options&&!c.options.alternativePrice&&!c.isFailed&&(c.options.alternativePrice=!0,c.innerHTML=o.buildPriceHTML(r,c.options))}),!0}}else{let s=new Error(`Not provided: ${this.options?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(i,s,this.options))return this.innerHTML="",!0}return!1}};P(Ye,"is","inline-price"),P(Ye,"tag","span");var re=Ye;window.customElements.get(re.is)||window.customElements.define(re.is,re,{extends:re.tag});function vi({literals:e,providers:t,settings:r}){function n(s,a=null){let c={country:r.country,language:r.language,locale:r.locale,literals:{...e.price}};if(a&&t?.price)for(let L of t.price)L(a,c);let{displayOldPrice:u,displayPerUnit:l,displayRecurrence:f,displayTax:p,displayPlanType:h,forceTaxExclusive:m,perpetual:d,displayAnnual:E,promotionCode:y,quantity:v,alternativePrice:g,wcsOsi:S,...M}=Object.assign(c,a?.dataset??{},s??{});return c=Qe(Object.assign({...c,...M,displayOldPrice:x(u),displayPerUnit:x(l),displayRecurrence:x(f),displayTax:x(p),displayPlanType:x(h),forceTaxExclusive:x(m),perpetual:x(d),displayAnnual:x(E),promotionCode:et(y).effectivePromoCode,quantity:be(v,b.quantity),alternativePrice:x(g),wcsOsi:it(S)})),c}function i(s,a){if(!Array.isArray(s)||!s.length||!a)return"";let{template:c}=a,u;switch(c){case"discount":u=Si;break;case"strikethrough":u=mi;break;case"promo-strikethrough":u=di;break;case"annual":u=Ei;break;case"legal":u=Ti;break;default:a.template==="optical"&&a.alternativePrice?u=gi:a.template==="optical"?u=pi:a.displayAnnual&&s[0].planType==="ABM"?u=a.promotionCode?yi:Ai:a.alternativePrice?u=xi:u=a.promotionCode?fi:hi}let[l]=s;return l={...l,...l.priceDetails},u({...r,...a},l)}let o=re.createInlinePrice;return{InlinePrice:re,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o}}function ua({locale:e=void 0,country:t=void 0,language:r=void 0}={}){return r??(r=e?.split("_")?.[0]||b.language),t??(t=e?.split("_")?.[1]||b.country),e??(e=`${r}_${t}`),{locale:e,country:t,language:r}}function ha(){try{let e=window.sessionStorage?.getItem("akamai");if(!e)return null;let t=JSON.parse(e),r=t?.country??t?.country_iso??t?.countryCode??t?.country_code;return r?String(r).toUpperCase():null}catch{return null}}function fa(e={}){if(typeof window>"u")return e;let t=null;try{let s=new URLSearchParams(window.location.search).get("akamaiLocale");s?.trim()&&(t=s.trim().toUpperCase())}catch{}if(t)return{...e,country:t};let r=ha();if(!r)return e;let n=e.locale?.split("_")?.[1]?.toUpperCase(),i=e.country?.toUpperCase();return!i||n&&i===n?{...e,country:r}:e}function Ci(e={},t){let r=t.featureFlags[J],{commerce:n={}}=e,i=Z.PRODUCTION,o=Bt,s=R("checkoutClientId",n)??b.checkoutClientId,a=Oe(R("checkoutWorkflowStep",n),F,b.checkoutWorkflowStep),c=x(R("displayOldPrice",n),b.displayOldPrice),u=b.displayPerUnit,l=x(R("displayRecurrence",n),b.displayRecurrence),f=x(R("displayTax",n),b.displayTax),p=x(R("displayPlanType",n),b.displayPlanType),h=x(R("entitlement",n),b.entitlement),m=x(R("modal",n),b.modal),d=x(R("forceTaxExclusive",n),b.forceTaxExclusive),E=R("promotionCode",n)??b.promotionCode,y=be(R("quantity",n)),v=R("wcsApiKey",n)??b.wcsApiKey,g=n?.env==="stage",S=se.PUBLISHED;["true",""].includes(n.allowOverride)&&(g=(R(Dt,n,{metadata:!1})?.toLowerCase()??n?.env)==="stage",S=Oe(R(Ut,n),se,S)),g&&(i=Z.STAGE,o=kt);let L=R(Ht)??e.preview,H=typeof L<"u"&&L!=="off"&&L!=="false",D={};H&&(D={preview:H});let V=R("mas-io-url")??e.masIOUrl??`https://www${i===Z.STAGE?".stage":""}.adobe.com/mas/io`,U=R("preselect-plan")??void 0;return{...ua(fa(e)),...D,displayOldPrice:c,checkoutClientId:s,checkoutWorkflowStep:a,displayPerUnit:u,displayRecurrence:l,displayTax:f,displayPlanType:p,entitlement:h,extraOptions:b.extraOptions,modal:m,env:i,forceTaxExclusive:d,promotionCode:E,quantity:y,alternativePrice:b.alternativePrice,wcsApiKey:v,wcsURL:o,landscape:S,masIOUrl:V,...U&&{preselectPlan:U}}}async function Li(e,t={},r=2,n=100){let i;for(let o=0;o<=r;o++)try{let s=await fetch(e,t);return s.retryCount=o,s}catch(s){if(i=s,i.retryCount=o,o>r)break;await new Promise(a=>setTimeout(a,n*(o+1)))}throw i}var pa="mas-commerce-service";function yt(e){return`startTime:${e.startTime.toFixed(2)}|duration:${e.duration.toFixed(2)}`}function Nr(){return document.getElementsByTagName(pa)?.[0]}var Or="wcs";function wi({settings:e}){let t=G.module(Or),{env:r,wcsApiKey:n}=e,i=new Map,o=new Map,s,a=new Map;async function c(m,d,E=!0){let y=Y(),v=Nt;t.debug("Fetching:",m);let g="",S;if(m.offerSelectorIds.length>1)throw new Error("Multiple OSIs are not supported anymore");let M=new Map(d),[L]=m.offerSelectorIds,H=Date.now()+Math.random().toString(36).substring(2,7),D=`${Or}:${L}:${H}${Gt}`,V=`${Or}:${L}:${H}${Vt}`,U;try{if(performance.mark(D),g=new URL(e.wcsURL),g.searchParams.set("offer_selector_ids",L),g.searchParams.set("country",m.country),g.searchParams.set("locale",m.locale),g.searchParams.set("landscape",r===Z.STAGE?"ALL":e.landscape),g.searchParams.set("api_key",n),m.language&&g.searchParams.set("language",m.language),m.promotionCode&&g.searchParams.set("promotion_code",m.promotionCode),m.currency&&g.searchParams.set("currency",m.currency),S=await Li(g.toString(),{credentials:"omit"}),S.ok){let O=[];try{let C=await S.json();t.debug("Fetched:",m,C),O=C.resolvedOffers??[]}catch(C){t.error(`Error parsing JSON: ${C.message}`,{...C.context,...y?.duration})}O=O.map(Ie),d.forEach(({resolve:C},$)=>{let j=O.filter(({offerSelectorIds:ye})=>ye.includes($)).flat();j.length&&(M.delete($),d.delete($),C(j))})}else v=Rt}catch(O){v=`Network error: ${O.message}`}finally{U=performance.measure(V,D),performance.clearMarks(D),performance.clearMeasures(V)}if(E&&d.size){t.debug("Missing:",{offerSelectorIds:[...d.keys()]});let O=un(S);d.forEach(C=>{C.reject(new Pe(v,{...m,...O,response:S,measure:yt(U),...y?.duration}))})}}function u(){clearTimeout(s);let m=[...o.values()];o.clear(),m.forEach(({options:d,promises:E})=>c(d,E))}function l(m){if(!m||typeof m!="object")throw new TypeError("Cache must be a Map or similar object");let d=r===Z.STAGE?"stage":"prod",E=m[d];if(!E||typeof E!="object"){t.warn(`No cache found for environment: ${r}`);return}for(let[y,v]of Object.entries(E))i.set(y,Promise.resolve(v.map(Ie)));t.debug(`Prefilled WCS cache with ${E.size} entries`)}function f(){let m=i.size;a=new Map(i),i.clear(),t.debug(`Moved ${m} cache entries to stale cache`)}function p(m,d,E){let y=m!=="GB"&&!E?"MULT":"en",v=$t.includes(m)?m:b.country;return{validCountry:v,validLanguage:y,locale:`${d}_${v}`}}function h({country:m,language:d,perpetual:E=!1,promotionCode:y="",wcsOsi:v=[]}){let{validCountry:g,validLanguage:S,locale:M}=p(m,d,E),L=[g,S,y].filter(H=>H).join("-").toLowerCase();return v.map(H=>{let D=`${H}-${L}`;if(i.has(D))return i.get(D);let V=new Promise((U,O)=>{let C=o.get(L);C||(C={options:{country:g,locale:M,...S==="MULT"&&{language:S},offerSelectorIds:[]},promises:new Map},o.set(L,C)),y&&(C.options.promotionCode=y),C.options.offerSelectorIds.push(H),C.promises.set(H,{resolve:U,reject:O}),u()}).catch(U=>{if(a.has(D))return a.get(D);throw U});return i.set(D,V),V})}return{Commitment:ue,PlanType:Qr,Term:X,applyPlanType:Ie,resolveOfferSelectors:h,flushWcsCacheInternal:f,prefillWcsCache:l,normalizeCountryLanguageAndLocale:p}}var Ri="mas-commerce-service",Ni="mas-commerce-service:start",Oi="mas-commerce-service:ready",We,Ce,ge,Ii,Mr,Ir=class extends HTMLElement{constructor(){super(...arguments);ne(this,ge);ne(this,We);ne(this,Ce);P(this,"lastLoggingTime",0)}async registerCheckoutAction(r){typeof r=="function"&&(this.buildCheckoutAction=async(n,i,o)=>{let s=await r?.(n,i,this.imsSignedInPromise,o);return s||null})}get featureFlags(){return K(this,Ce)||ie(this,Ce,{[J]:Pt(this,ge,Mr).call(this,J),[_e]:Pt(this,ge,Mr).call(this,_e)}),K(this,Ce)}activate(){let r=K(this,ge,Ii),n=Ci(r,this);tt(r.lana);let i=G.init(r.hostEnv).module("service");i.debug("Activating:",r);let s={price:In(n)},a={checkout:new Set,price:new Set},c={literals:s,providers:a,settings:n};Object.defineProperties(this,Object.getOwnPropertyDescriptors({...Rn(c),...Nn(c),...vi(c),...wi(c),...Yt,Log:G,resolvePriceTaxFlags:At,get defaults(){return b},get log(){return G},get providers(){return{checkout(l){return a.checkout.add(l),()=>a.checkout.delete(l)},price(l){return a.price.add(l),()=>a.price.delete(l)},has:l=>a.price.has(l)||a.checkout.has(l)}},get settings(){return n}})),i.debug("Activated:",{literals:s,settings:n});let u=new CustomEvent(ze,{bubbles:!0,cancelable:!1,detail:this});performance.mark(Oi),ie(this,We,performance.measure(Oi,Ni)),this.dispatchEvent(u),setTimeout(()=>{this.logFailedRequests()},1e4)}connectedCallback(){performance.mark(Ni),this.activate()}flushWcsCache(){this.flushWcsCacheInternal(),this.log.debug("Flushed WCS cache")}refreshOffers(){this.flushWcsCacheInternal(),document.querySelectorAll(vt).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":yt(K(this,We))}}logFailedRequests(){let r=[...performance.getEntriesByType("resource")].filter(({startTime:i})=>i>this.lastLoggingTime).filter(({transferSize:i,duration:o,responseStatus:s})=>i===0&&o===0&&s<200||s>=400),n=Array.from(new Map(r.map(i=>[i.name,i])).values());if(n.some(({name:i})=>/(\/fragment\?|web_commerce_artifact)/.test(i))){let i=n.map(({name:o})=>o);this.log.error("Failed requests:",{failedUrls:i,...this.duration})}this.lastLoggingTime=performance.now().toFixed(3)}};We=new WeakMap,Ce=new WeakMap,ge=new WeakSet,Ii=function(){let r=this.getAttribute("env")??"prod",n={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(i=>{let o=this.getAttribute(i);o&&(n[i]=o)}),["checkout-workflow-step","force-tax-exclusive","checkout-client-id","allow-override","wcs-api-key"].forEach(i=>{let o=this.getAttribute(i);if(o!=null){let s=i.replace(/-([a-z])/g,a=>a[1].toUpperCase());n.commerce[s]=o}}),n},Mr=function(r){return["on","true",!0].includes(this.getAttribute(`data-${r}`)||R(r))};window.customElements.get(Ri)||window.customElements.define(Ri,Ir);var je=class je extends at(HTMLButtonElement){static createCheckoutButton(t={},r=""){return st(je,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)}};P(je,"is","checkout-button"),P(je,"tag","button");var Le=je;window.customElements.get(Le.is)||window.customElements.define(Le.is,Le,{extends:Le.tag});function ma(e){return`https://${e==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var Ae,xe=class xe extends HTMLAnchorElement{constructor(){super();P(this,"masElement",new ae(this));ne(this,Ae);this.setAttribute("is",xe.is)}get isUptLink(){return!0}initializeWcsData(r,n){this.setAttribute("data-wcs-osi",r),n&&this.setAttribute("data-promotion-code",n)}attributeChangedCallback(r,n,i){this.masElement.attributeChangedCallback(r,n,i)}connectedCallback(){this.masElement.connectedCallback(),ie(this,Ae,Nr()),K(this,Ae)&&(this.log=K(this,Ae).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),ie(this,Ae,void 0)}requestUpdate(r=!1){this.masElement.requestUpdate(r)}onceSettled(){return this.masElement.onceSettled()}async render(){let r=Nr();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(s=>{s&&(this.dataset.imsCountry=s)});let n=r.collectCheckoutOptions({},this);if(!n.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let i=this.masElement.togglePending(n),o=r.resolveOfferSelectors(n);try{let[[s]]=await Promise.all(o),{country:a,language:c,env:u}=n,l=`locale=${c}_${a}&country=${a}&offer_id=${s.offerId}`,f=this.getAttribute("data-promotion-code");f&&(l+=`&promotion_code=${encodeURIComponent(f)}`),this.href=`${ma(u)}?${l}`,this.masElement.toggleResolved(i,s,n)}catch(s){let a=new Error(`Could not resolve offer selectors for id: ${n.wcsOsi}.`,s.message);return this.masElement.toggleFailed(i,a,n),!1}}static createFrom(r){let n=new xe;for(let i of r.attributes)i.name!=="is"&&(i.name==="class"&&i.value.includes("upt-link")?n.setAttribute("class",i.value.replace("upt-link","").trim()):n.setAttribute(i.name,i.value));return n.innerHTML=r.innerHTML,n.setAttribute("tabindex",0),n}};Ae=new WeakMap,P(xe,"is","upt-link"),P(xe,"tag","a"),P(xe,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var we=xe;window.customElements.get(we.is)||window.customElements.define(we.is,we,{extends:we.tag});function da(e){return new DOMParser().parseFromString(e,"text/html").body.textContent||""}function Ea(e){return e.split("?")[0]}function ga(e,t){return t==="ANNUAL"||e==="PERPETUAL"?"P1Y":"P1M"}function xa(e){if(!Array.isArray(e)||e.length===0)return;let t="?format=png&width=800&height=800";return e.length===1?`${e[0]}${t}`:e.map(r=>`${r}${t}`)}function Aa(e){try{return JSON.parse(e.analytics).currencyCode}catch{return}}function ya(e,t,r,n){if(!e?.cardTitle||!t)return null;let i=Aa(t);if(!i)return console.warn("[json-ld] No currency code found in offer analytics \u2014 JSON-LD injection skipped"),null;let{price:o}=t?.priceDetails??{};if(o==null)return null;let s=Ea(n),a=`json-ld-product-${s}`;if(document.head.querySelector(`script[data-id="${a}"]`))return null;let c=o,l=t?.priceDetails?.priceWithoutDiscount??r?.priceDetails?.price;l!=null&&t?.priceDetails?.priceWithoutDiscount==null&&l{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,Be,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",Be=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){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((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===Fe)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,Fe,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=`[ +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,Fh,Vs,fn,js,gn,xn,Be,Hi=et(()=>{mn();mn();$i=window,qs=$i.trustedTypes,Fh=qs?qs.emptyScript:"",Vs=$i.reactiveElementPolyfillSupport,fn={toAttribute(e,t){switch(t){case Boolean:e=e?Fh: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",Be=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){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((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===Fe)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,Uh,bt,$r,Hr,tc,Gh,bn,Dr,Ys,Xs,xt,Ks,Qs,rc,ic,g,pf,Fe,w,Zs,vt,qh,Br,wn,Fr,Ht,En,Vh,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,Uh=`<${ec}>`,bt=document,$r=()=>bt.createComment(""),Hr=e=>e===null||typeof e!="object"&&typeof e!="function",tc=Array.isArray,Gh=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),Fe=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!==Fe,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 Be{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 Fe}};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`=]|("|')|))|$)`,"g"),Ks=/'/g,Qs=/"/g,rc=/^(?:script|style|textarea|title)$/i,ic=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),g=ic(1),pf=ic(2),Fe=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Zs=new WeakMap,vt=bt.createTreeWalker(bt,129,null,!1);qh=(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+Uh: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]=qh(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!==Fe,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 Be{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 Fe}};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 jh(){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``:g``}render(){let t=this.effectiveContent,r=this.effectivePlacement;return t?qh()?g` + >`:g``}render(){let t=this.effectiveContent,r=this.effectivePlacement;return t?jh()?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:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,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:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>ze,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]',Se='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},${Se},${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",Ce="failed",qe="pending",ze="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",Me=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",Te="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 Re=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+=` + `);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:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,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:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>ze,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]',Se='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},${Se},${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",Ce="failed",qe="pending",ze="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",Me=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",Te="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},jp={[_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 Re=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={[Ce]:oa,[qe]:sa,[ze]:ca},xd={[Ce]:ha,[ze]: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(){[Ce,qe,ze].forEach(t=>{this.wrapperElement.classList.toggle(fd[t],t===this.state)})}notify(){(this.state===ze||this.state===Ce)&&(this.state===ze?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Ce&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Re&&(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 ze===i?Promise.resolve(this.wrapperElement):Ce===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=ze,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=Ce,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 De=Ar;window.customElements.get(De.is)||window.customElements.define(De.is,De,{extends:De.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:Me.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}=De;return{CheckoutLink:De,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;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 $e(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=$e(W,$,We.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=$e(W,$,We.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=$e(W,$,K===rn?We.taxExclusiveLabel:We.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=$e(W,$,We.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=$e(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=$e(d,h,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=$e(d,h,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=$e(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","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Lh={[Ns]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[nn]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Is]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[on]:["SG_en","KR_ko"]},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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!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===Ce}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[Te]||n[Te]){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 He=Mr;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.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=He.createInlinePrice;return{InlinePrice:He,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[Te],{commerce:i={}}=e,a=Me.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=Me.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===Me.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 Oe(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===Me.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 Re(I,{...x,...W,response:O,measure:Oe(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===Me.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,{[Te]:Z(this,ut,dn).call(this,Te),[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")}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":Oe(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 Ja(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 fh(s)}function vh(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 bh(e,t){return t?Object.keys(e).reduce(function(r,i){return r[i]=vh(e[i],t[i]),r},L({},e)):e}function en(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function yh(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=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 $e(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=$e(W,$,We.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=$e(W,$,We.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=$e(W,$,K===rn?We.taxExclusiveLabel:We.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=$e(W,$,We.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=$e(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=$e(d,h,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=$e(d,h,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=$e(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","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Lh={[Ns]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[nn]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Is]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[on]:["SG_en","KR_ko"]},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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!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===Ce}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[Te]||n[Te]){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 He=Mr;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.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=He.createInlinePrice;return{InlinePrice:He,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 Dh(){try{let e=window.sessionStorage?.getItem("akamai");if(!e)return null;let t=JSON.parse(e),r=t?.country??t?.country_iso??t?.countryCode??t?.country_code;return r?String(r).toUpperCase():null}catch{return null}}function $h(e={}){if(typeof window>"u")return e;let t=null;try{let o=new URLSearchParams(window.location.search).get("akamaiLocale");o?.trim()&&(t=o.trim().toUpperCase())}catch{}if(t)return{...e,country:t};let r=Dh();if(!r)return e;let i=e.locale?.split("_")?.[1]?.toUpperCase(),a=e.country?.toUpperCase();return!a||i&&a===i?{...e,country:r}:e}function Ds(e={},t){let r=t.featureFlags[Te],{commerce:i={}}=e,a=Me.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=Me.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===Me.STAGE?".stage":""}.adobe.com/mas/io`,ie=F("preselect-plan")??void 0;return{...zh($h(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 Hh="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 Oe(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(Hh)?.[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===Me.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 Re(I,{...x,...W,response:O,measure:Oe(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===Me.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,{[Te]:Z(this,ut,dn).call(this,Te),[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")}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":Oe(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 Bh(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=`${Bh(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` :host { --consonant-merch-card-background-color: #fff; --consonant-merch-card-border: 1px solid @@ -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 Wh(){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(Wh())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` ${this.alt}`--consonant-merch-card-footer-row-${r}-min-height`);m(this,"getMiniCompareFooter",()=>{let r=this.card.secureLabel?g` +`;var Yh=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` ${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 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(Yh,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`
${this.badge}
@@ -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 Xh=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`
${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 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(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.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.badge}
${this.icons} @@ -7783,9 +7783,9 @@ merch-card[variant="full-pricing-express"] mas-mnemonic { flex-direction: column; padding: var(--consonant-merch-spacing-xs, 8px); } -`;var Dc={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"}},Yh=[{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"}],Jt=class extends A{constructor(t){super(t)}getGlobalCSS(){return zc}renderLayout(){return g` +`;var Dc={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"}},Kh=[{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"}],Jt=class extends A{constructor(t){super(t)}getGlobalCSS(){return zc}renderLayout(){return g`
- ${Yh.map(({slot:t,label:r})=>g` + ${Kh.map(({slot:t,label:r})=>g`
${r} @@ -7878,7 +7878,7 @@ merch-card[variant="mini"] span.renewal-text { background-color: var(--spectrum-background-base-color); border: 1px solid var(--consonant-merch-card-border-color, #dadada); } - `);var Wi=new Map,Bc=new WeakMap,Fc=new Map,G=(e,t,r=null,i=null,a)=>{Wi.set(e,{class:t,fragmentMapping:r,style:i,collectionOptions:a})};G("catalog",qt,mc,qt.variantStyle);G("image",wt);G("inline-heading",Vi);G("mini-compare-chart",Vt,vc,Vt.variantStyle);G("mini-compare-chart-mweb",jt,yc,jt.variantStyle);G("plans",ge,ji,ge.variantStyle,ge.collectionOptions);G("plans-students",ge,Ac,ge.variantStyle,ge.collectionOptions);G("plans-education",ge,Ec,ge.variantStyle,ge.collectionOptions);G("plans-v2",Ke,Cc,Ke.variantStyle,Ke.collectionOptions);G("product",Wt,kc,Wt.variantStyle);G("segment",Yt,Pc,Yt.variantStyle);G("media",Xt,Mc,Xt.variantStyle);G("headless",Jt,Dc,Jt.variantStyle);G("special-offers",Kt,Oc,Kt.variantStyle);G("simplified-pricing-express",Qt,Pn,Qt.variantStyle);G("full-pricing-express",Zt,Ln,Zt.variantStyle);G("mini",er,Hc,er.variantStyle);G("image",wt,gc,wt.variantStyle);var Xh=(e,t,r)=>{try{let i=Fc.get(e.variant);if(i||(i=new CSSStyleSheet,i.replaceSync(t.cssText),Fc.set(e.variant,i)),r?.styleSheet&&r.styleSheet!==i){let a=e.shadowRoot.adoptedStyleSheets.indexOf(r.styleSheet);a!==-1&&e.shadowRoot.adoptedStyleSheets.splice(a,1)}return e.shadowRoot.adoptedStyleSheets.includes(i)||e.shadowRoot.adoptedStyleSheets.push(i),{styleSheet:i}}catch{let a=document.createElement("style");a.textContent=t.cssText,a.setAttribute("data-variant-style",e.variant);let n=r?.styleElement||e.shadowRoot.querySelector("[data-variant-style]");return n&&n.remove(),e.shadowRoot.appendChild(a),{styleElement:a}}},Mn=e=>{let t=Wi.get(e.variant);if(!t)return;let{class:r,style:i}=t,a=Bc.get(e);if(a?.appliedVariant===e.variant)return new r(e);let n=i?Xh(e,i,a):{};return Bc.set(e,{appliedVariant:e.variant,...n}),new r(e)};function qi(e){return Wi.get(e)?.fragmentMapping}function Uc(e){return Wi.get(e)?.collectionOptions}var Gc=document.createElement("style");Gc.innerHTML=` + `);var Wi=new Map,Bc=new WeakMap,Fc=new Map,G=(e,t,r=null,i=null,a)=>{Wi.set(e,{class:t,fragmentMapping:r,style:i,collectionOptions:a})};G("catalog",qt,mc,qt.variantStyle);G("image",wt);G("inline-heading",Vi);G("mini-compare-chart",Vt,vc,Vt.variantStyle);G("mini-compare-chart-mweb",jt,yc,jt.variantStyle);G("plans",ge,ji,ge.variantStyle,ge.collectionOptions);G("plans-students",ge,Ac,ge.variantStyle,ge.collectionOptions);G("plans-education",ge,Ec,ge.variantStyle,ge.collectionOptions);G("plans-v2",Ke,Cc,Ke.variantStyle,Ke.collectionOptions);G("product",Wt,kc,Wt.variantStyle);G("segment",Yt,Pc,Yt.variantStyle);G("media",Xt,Mc,Xt.variantStyle);G("headless",Jt,Dc,Jt.variantStyle);G("special-offers",Kt,Oc,Kt.variantStyle);G("simplified-pricing-express",Qt,Pn,Qt.variantStyle);G("full-pricing-express",Zt,Ln,Zt.variantStyle);G("mini",er,Hc,er.variantStyle);G("image",wt,gc,wt.variantStyle);var Qh=(e,t,r)=>{try{let i=Fc.get(e.variant);if(i||(i=new CSSStyleSheet,i.replaceSync(t.cssText),Fc.set(e.variant,i)),r?.styleSheet&&r.styleSheet!==i){let a=e.shadowRoot.adoptedStyleSheets.indexOf(r.styleSheet);a!==-1&&e.shadowRoot.adoptedStyleSheets.splice(a,1)}return e.shadowRoot.adoptedStyleSheets.includes(i)||e.shadowRoot.adoptedStyleSheets.push(i),{styleSheet:i}}catch{let a=document.createElement("style");a.textContent=t.cssText,a.setAttribute("data-variant-style",e.variant);let n=r?.styleElement||e.shadowRoot.querySelector("[data-variant-style]");return n&&n.remove(),e.shadowRoot.appendChild(a),{styleElement:a}}},Mn=e=>{let t=Wi.get(e.variant);if(!t)return;let{class:r,style:i}=t,a=Bc.get(e);if(a?.appliedVariant===e.variant)return new r(e);let n=i?Qh(e,i,a):{};return Bc.set(e,{appliedVariant:e.variant,...n}),new r(e)};function qi(e){return Wi.get(e)?.fragmentMapping}function Uc(e){return Wi.get(e)?.collectionOptions}var Gc=document.createElement("style");Gc.innerHTML=` :root { --consonant-merch-card-detail-font-size: 12px; --consonant-merch-card-detail-font-weight: 500; @@ -8765,8 +8765,8 @@ merch-card[border-color="spectrum-red-700-plans"] { } } -`;document.head.appendChild(Gc);var qc="fragment",Vc="author",jc="preview",Wc="loading",Yc="timeout",Rn="aem-fragment",Xc="eager",Kc="cache",Kh=[Xc,Kc],Ne,Et,ke,On=class{constructor(){E(this,Ne,new Map);E(this,Et,new Map);E(this,ke,new Map)}clear(){p(this,Ne).clear(),p(this,Et).clear(),p(this,ke).clear()}add(t,r=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(p(this,Ne).set(t.id,t),t.fields?.originalId&&p(this,Ne).set(t.fields.originalId,t),p(this,ke).has(t.id)){let[,i]=p(this,ke).get(t.id);i()}if(p(this,ke).has(t.fields?.originalId)){let[,i]=p(this,ke).get(t.fields?.originalId);i()}if(!(!r||typeof t.references!="object"||Array.isArray(t.references)))for(let i in t.references){let{type:a,value:n}=t.references[i];a==="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 p(this,Ne).has(t)}entries(){return p(this,Ne).entries()}get(t){return p(this,Ne).get(t)}getAsPromise(t){let[r]=p(this,ke).get(t)??[];if(r)return r;let i;return r=new Promise(a=>{i=a,this.has(t)&&a()}),p(this,ke).set(t,[r,i]),r}getFetchInfo(t){let r=p(this,Et).get(t);return r||(r={url:null,retryCount:0,stale:!1,measure:null,status:null},p(this,Et).set(t,r)),r}remove(t){p(this,Ne).delete(t),p(this,Et).delete(t),p(this,ke).delete(t)}};Ne=new WeakMap,Et=new WeakMap,ke=new WeakMap;var Qe=new On,tr,_e,Ue,Ee,fe,J,Yr,Xr,Pe,Kr,Qr,rr,Le,Qc,Zc,Nn,Jc,Yi=class extends HTMLElement{constructor(){super(...arguments);E(this,Le);m(this,"cache",Qe);E(this,tr);E(this,_e,null);E(this,Ue,null);E(this,Ee,null);E(this,fe);E(this,J);E(this,Yr,Xc);E(this,Xr,5e3);E(this,Pe);E(this,Kr,!1);E(this,Qr,0);E(this,rr)}static get observedAttributes(){return[qc,Wc,Yc,Vc,jc]}attributeChangedCallback(r,i,a){r===qc&&(y(this,fe,a),y(this,J,Qe.getFetchInfo(a))),r===Wc&&Kh.includes(a)&&y(this,Yr,a),r===Yc&&y(this,Xr,parseInt(a,10)),r===Vc&&y(this,Kr,["","true"].includes(a)),r===jc&&y(this,rr,a)}connectedCallback(){if(!p(this,Pe)){if(p(this,Ee)??y(this,Ee,mt(this)),y(this,rr,p(this,Ee).settings?.preview),p(this,tr)??y(this,tr,p(this,Ee).log.module(`${Rn}[${p(this,fe)}]`)),!p(this,fe)||p(this,fe)==="#"){p(this,J)??y(this,J,Qe.getFetchInfo("missing-fragment-id")),Z(this,Le,Nn).call(this,"Missing fragment id");return}this.refresh(!1)}}get fetchInfo(){return Object.fromEntries(Object.entries(p(this,J)).filter(([r,i])=>i!=null).map(([r,i])=>[`aem-fragment:${r}`,i]))}async refresh(r=!0){if(p(this,Pe)&&!await Promise.race([p(this,Pe),Promise.resolve(!1)]))return;r&&Qe.remove(p(this,fe)),p(this,Yr)===Kc&&await Promise.race([Qe.getAsPromise(p(this,fe)),new Promise(s=>setTimeout(s,p(this,Xr)))]);try{y(this,Pe,Z(this,Le,Jc).call(this)),await p(this,Pe)}catch(s){return Z(this,Le,Nn).call(this,s.message),!1}let{references:i,referencesTree:a,placeholders:n,wcs:o}=p(this,_e)||{};return o&&!F("mas.disableWcsCache")&&p(this,Ee).prefillWcsCache(o),this.dispatchEvent(new CustomEvent(at,{detail:{...this.data,references:i,referencesTree:a,placeholders:n,...p(this,J)},bubbles:!0,composed:!0})),p(this,Pe)}get updateComplete(){return p(this,Pe)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return p(this,Ue)?p(this,Ue):(p(this,Kr)?this.transformAuthorData():this.transformPublishData(),p(this,Ue))}get rawData(){return p(this,_e)}transformAuthorData(){let{fields:r,id:i,tags:a,variationId:n,settings:o={},priceLiterals:s={},dictionary:c={},placeholders:l={}}=p(this,_e);y(this,Ue,r.reduce((d,{name:h,multiple:u,values:f})=>(d.fields[h]=u?f:f[0],d),{fields:{},id:i,tags:a,settings:o,priceLiterals:s,dictionary:c,placeholders:l,variationId:n}))}transformPublishData(){let{fields:r,id:i,tags:a,settings:n={},priceLiterals:o={},dictionary:s={},placeholders:c={},variationId:l}=p(this,_e);y(this,Ue,Object.entries(r).reduce((d,[h,u])=>(d.fields[h]=u?.mimeType?u.value:u??"",d),{fields:{},id:i,tags:a,settings:n,priceLiterals:o,dictionary:s,placeholders:c,variationId:l}))}getFragmentClientUrl(){let i=new URLSearchParams(window.location.search).get("maslibs");if(!i||i.trim()==="")return"https://mas.adobe.com/studio/libs/fragment-client.js";let a=i.trim().toLowerCase();if(a==="local")return"http://localhost:3000/studio/libs/fragment-client.js";let{hostname:n}=window.location,o=n.endsWith(".page")?"page":"live";return a.includes("--")?`https://${a}.aem.${o}/studio/libs/fragment-client.js`:`https://${a}--mas--adobecom.aem.${o}/studio/libs/fragment-client.js`}async generatePreview(){let r=this.getFragmentClientUrl(),{previewFragment:i}=await import(r);return await i(p(this,fe),{locale:p(this,Ee).settings.locale,apiKey:p(this,Ee).settings.wcsApiKey,fullContext:!0})}};tr=new WeakMap,_e=new WeakMap,Ue=new WeakMap,Ee=new WeakMap,fe=new WeakMap,J=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,Pe=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,rr=new WeakMap,Le=new WeakSet,Qc=async function(r){Jn(this,Qr)._++;let i=`${Rn}:${p(this,fe)}:${p(this,Qr)}`,a=`${i}${st}`,n=`${i}${ct}`;if(p(this,rr)){let s=await this.generatePreview();if(s.status===200)return s.body;throw new Re(`Failed to generate preview: ${s.message}`,{})}performance.mark(a);let o;try{if(p(this,J).stale=!1,p(this,J).url=r,o=await Ni(r,{cache:"default",credentials:"omit"}),Z(this,Le,Zc).call(this,o),p(this,J).status=o?.status,p(this,J).measure=Oe(performance.measure(n,a)),p(this,J).retryCount=o.retryCount,!o?.ok)throw new Re("Unexpected fragment response",{response:o,...p(this,Ee).duration});return await o.json()}catch(s){if(p(this,J).measure=Oe(performance.measure(n,a)),p(this,J).retryCount=s.retryCount,p(this,_e))return p(this,J).stale=!0,p(this,tr).error("Serving stale data",p(this,J)),p(this,_e);let c=s.message??"unknown";throw new Re(`Failed to fetch fragment: ${c}`,{})}},Zc=function(r){Object.assign(p(this,J),vi(r))},Nn=function(r){y(this,Pe,null),p(this,J).message=r,this.classList.add("error");let i={...p(this,J),...p(this,Ee).duration};p(this,tr).error(r,i),this.dispatchEvent(new CustomEvent(nt,{detail:i,bubbles:!0,composed:!0}))},Jc=async function(){var c;this.classList.remove("error"),y(this,Ue,null);let r=Qe.get(p(this,fe));if(r)return y(this,_e,r),!0;let{masIOUrl:i,wcsApiKey:a,country:n,locale:o}=p(this,Ee).settings,s=`${i}/fragment?id=${p(this,fe)}&api_key=${a}&locale=${o}`;return n&&!o.endsWith(`_${n}`)&&(s+=`&country=${n}`),r=await Z(this,Le,Qc).call(this,s),(c=r.fields).originalId??(c.originalId=p(this,fe)),Qe.add(r),y(this,_e,r),!0},m(Yi,"cache",Qe);customElements.define(Rn,Yi);P();Ur();var el={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},tl=e=>(...t)=>({_$litDirective$:e,values:t}),Xi=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,i){this._$Ct=t,this._$AM=r,this._$Ci=i}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};var Zr=class extends Xi{constructor(t){if(super(t),this.et=w,t.type!==el.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===w||t==null)return this.ft=void 0,this.et=t;if(t===Fe)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;let r=[t];return r.raw=r,this.ft={_$litType$:this.constructor.resultType,strings:r,values:[]}}};Zr.directiveName="unsafeHTML",Zr.resultType=1;var rl=tl(Zr);var Qh=e=>e?e.startsWith("sp-icon-")?g`${rl(`<${e} class="badge-icon">`)}`:g``:w,ir=class extends U{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"),r=t?.getAttribute("size"),i=t?.querySelectorAll(":scope > merch-icon").length||0;this.style.setProperty("--merch-badge-offset",i),this.style.setProperty("--merch-badge-with-offset",i?1:0),this.style.setProperty("--merch-badge-card-size",r?2:1),super.connectedCallback()}render(){return g`
- ${Qh(this.icon)}${this.text} +`;document.head.appendChild(Gc);var qc="fragment",Vc="author",jc="preview",Wc="loading",Yc="timeout",Rn="aem-fragment",Xc="eager",Kc="cache",Zh=[Xc,Kc],Ne,Et,ke,On=class{constructor(){E(this,Ne,new Map);E(this,Et,new Map);E(this,ke,new Map)}clear(){p(this,Ne).clear(),p(this,Et).clear(),p(this,ke).clear()}add(t,r=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(p(this,Ne).set(t.id,t),t.fields?.originalId&&p(this,Ne).set(t.fields.originalId,t),p(this,ke).has(t.id)){let[,i]=p(this,ke).get(t.id);i()}if(p(this,ke).has(t.fields?.originalId)){let[,i]=p(this,ke).get(t.fields?.originalId);i()}if(!(!r||typeof t.references!="object"||Array.isArray(t.references)))for(let i in t.references){let{type:a,value:n}=t.references[i];a==="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 p(this,Ne).has(t)}entries(){return p(this,Ne).entries()}get(t){return p(this,Ne).get(t)}getAsPromise(t){let[r]=p(this,ke).get(t)??[];if(r)return r;let i;return r=new Promise(a=>{i=a,this.has(t)&&a()}),p(this,ke).set(t,[r,i]),r}getFetchInfo(t){let r=p(this,Et).get(t);return r||(r={url:null,retryCount:0,stale:!1,measure:null,status:null},p(this,Et).set(t,r)),r}remove(t){p(this,Ne).delete(t),p(this,Et).delete(t),p(this,ke).delete(t)}};Ne=new WeakMap,Et=new WeakMap,ke=new WeakMap;var Qe=new On,tr,_e,Ue,Ee,fe,J,Yr,Xr,Pe,Kr,Qr,rr,Le,Qc,Zc,Nn,Jc,Yi=class extends HTMLElement{constructor(){super(...arguments);E(this,Le);m(this,"cache",Qe);E(this,tr);E(this,_e,null);E(this,Ue,null);E(this,Ee,null);E(this,fe);E(this,J);E(this,Yr,Xc);E(this,Xr,5e3);E(this,Pe);E(this,Kr,!1);E(this,Qr,0);E(this,rr)}static get observedAttributes(){return[qc,Wc,Yc,Vc,jc]}attributeChangedCallback(r,i,a){r===qc&&(y(this,fe,a),y(this,J,Qe.getFetchInfo(a))),r===Wc&&Zh.includes(a)&&y(this,Yr,a),r===Yc&&y(this,Xr,parseInt(a,10)),r===Vc&&y(this,Kr,["","true"].includes(a)),r===jc&&y(this,rr,a)}connectedCallback(){if(!p(this,Pe)){if(p(this,Ee)??y(this,Ee,mt(this)),y(this,rr,p(this,Ee).settings?.preview),p(this,tr)??y(this,tr,p(this,Ee).log.module(`${Rn}[${p(this,fe)}]`)),!p(this,fe)||p(this,fe)==="#"){p(this,J)??y(this,J,Qe.getFetchInfo("missing-fragment-id")),Z(this,Le,Nn).call(this,"Missing fragment id");return}this.refresh(!1)}}get fetchInfo(){return Object.fromEntries(Object.entries(p(this,J)).filter(([r,i])=>i!=null).map(([r,i])=>[`aem-fragment:${r}`,i]))}async refresh(r=!0){if(p(this,Pe)&&!await Promise.race([p(this,Pe),Promise.resolve(!1)]))return;r&&Qe.remove(p(this,fe)),p(this,Yr)===Kc&&await Promise.race([Qe.getAsPromise(p(this,fe)),new Promise(s=>setTimeout(s,p(this,Xr)))]);try{y(this,Pe,Z(this,Le,Jc).call(this)),await p(this,Pe)}catch(s){return Z(this,Le,Nn).call(this,s.message),!1}let{references:i,referencesTree:a,placeholders:n,wcs:o}=p(this,_e)||{};return o&&!F("mas.disableWcsCache")&&p(this,Ee).prefillWcsCache(o),this.dispatchEvent(new CustomEvent(at,{detail:{...this.data,references:i,referencesTree:a,placeholders:n,...p(this,J)},bubbles:!0,composed:!0})),p(this,Pe)}get updateComplete(){return p(this,Pe)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return p(this,Ue)?p(this,Ue):(p(this,Kr)?this.transformAuthorData():this.transformPublishData(),p(this,Ue))}get rawData(){return p(this,_e)}transformAuthorData(){let{fields:r,id:i,tags:a,variationId:n,settings:o={},priceLiterals:s={},dictionary:c={},placeholders:l={}}=p(this,_e);y(this,Ue,r.reduce((d,{name:h,multiple:u,values:f})=>(d.fields[h]=u?f:f[0],d),{fields:{},id:i,tags:a,settings:o,priceLiterals:s,dictionary:c,placeholders:l,variationId:n}))}transformPublishData(){let{fields:r,id:i,tags:a,settings:n={},priceLiterals:o={},dictionary:s={},placeholders:c={},variationId:l}=p(this,_e);y(this,Ue,Object.entries(r).reduce((d,[h,u])=>(d.fields[h]=u?.mimeType?u.value:u??"",d),{fields:{},id:i,tags:a,settings:n,priceLiterals:o,dictionary:s,placeholders:c,variationId:l}))}getFragmentClientUrl(){let i=new URLSearchParams(window.location.search).get("maslibs");if(!i||i.trim()==="")return"https://mas.adobe.com/studio/libs/fragment-client.js";let a=i.trim().toLowerCase();if(a==="local")return"http://localhost:3000/studio/libs/fragment-client.js";let{hostname:n}=window.location,o=n.endsWith(".page")?"page":"live";return a.includes("--")?`https://${a}.aem.${o}/studio/libs/fragment-client.js`:`https://${a}--mas--adobecom.aem.${o}/studio/libs/fragment-client.js`}async generatePreview(){let r=this.getFragmentClientUrl(),{previewFragment:i}=await import(r);return await i(p(this,fe),{locale:p(this,Ee).settings.locale,apiKey:p(this,Ee).settings.wcsApiKey,fullContext:!0})}};tr=new WeakMap,_e=new WeakMap,Ue=new WeakMap,Ee=new WeakMap,fe=new WeakMap,J=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,Pe=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,rr=new WeakMap,Le=new WeakSet,Qc=async function(r){Jn(this,Qr)._++;let i=`${Rn}:${p(this,fe)}:${p(this,Qr)}`,a=`${i}${st}`,n=`${i}${ct}`;if(p(this,rr)){let s=await this.generatePreview();if(s.status===200)return s.body;throw new Re(`Failed to generate preview: ${s.message}`,{})}performance.mark(a);let o;try{if(p(this,J).stale=!1,p(this,J).url=r,o=await Ni(r,{cache:"default",credentials:"omit"}),Z(this,Le,Zc).call(this,o),p(this,J).status=o?.status,p(this,J).measure=Oe(performance.measure(n,a)),p(this,J).retryCount=o.retryCount,!o?.ok)throw new Re("Unexpected fragment response",{response:o,...p(this,Ee).duration});return await o.json()}catch(s){if(p(this,J).measure=Oe(performance.measure(n,a)),p(this,J).retryCount=s.retryCount,p(this,_e))return p(this,J).stale=!0,p(this,tr).error("Serving stale data",p(this,J)),p(this,_e);let c=s.message??"unknown";throw new Re(`Failed to fetch fragment: ${c}`,{})}},Zc=function(r){Object.assign(p(this,J),vi(r))},Nn=function(r){y(this,Pe,null),p(this,J).message=r,this.classList.add("error");let i={...p(this,J),...p(this,Ee).duration};p(this,tr).error(r,i),this.dispatchEvent(new CustomEvent(nt,{detail:i,bubbles:!0,composed:!0}))},Jc=async function(){var c;this.classList.remove("error"),y(this,Ue,null);let r=Qe.get(p(this,fe));if(r)return y(this,_e,r),!0;let{masIOUrl:i,wcsApiKey:a,locale:n,country:o}=p(this,Ee).settings,s=`${i}/fragment?id=${p(this,fe)}&api_key=${a}&locale=${n}`;return o&&!n.endsWith(`_${o}`)&&(s+=`&country=${o}`),r=await Z(this,Le,Qc).call(this,s),(c=r.fields).originalId??(c.originalId=p(this,fe)),Qe.add(r),y(this,_e,r),!0},m(Yi,"cache",Qe);customElements.define(Rn,Yi);P();Ur();var el={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},tl=e=>(...t)=>({_$litDirective$:e,values:t}),Xi=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,i){this._$Ct=t,this._$AM=r,this._$Ci=i}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};var Zr=class extends Xi{constructor(t){if(super(t),this.et=w,t.type!==el.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===w||t==null)return this.ft=void 0,this.et=t;if(t===Fe)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;let r=[t];return r.raw=r,this.ft={_$litType$:this.constructor.resultType,strings:r,values:[]}}};Zr.directiveName="unsafeHTML",Zr.resultType=1;var rl=tl(Zr);var Jh=e=>e?e.startsWith("sp-icon-")?g`${rl(`<${e} class="badge-icon">`)}`:g``:w,ir=class extends U{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"),r=t?.getAttribute("size"),i=t?.querySelectorAll(":scope > merch-icon").length||0;this.style.setProperty("--merch-badge-offset",i),this.style.setProperty("--merch-badge-with-offset",i?1:0),this.style.setProperty("--merch-badge-card-size",r?2:1),super.connectedCallback()}render(){return g`
+ ${Jh(this.icon)}${this.text}
`}};m(ir,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"},icon:{type:String}}),m(ir,"styles",b` :host { display: block; @@ -8862,7 +8862,7 @@ merch-card[border-color="spectrum-red-700-plans"] { text-decoration: underline; color: var(--link-color-dark); } - `),m(ei,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",ei);var Zh="#000000",In="#F8D904",Jh="#EAEAEA",ep="#31A547",tp=/(accent|primary|secondary)(-(outline|link))?/,rp="mas:product_code/",ip="daa-ll",Ki="daa-lh",ap=["XL","L","M","S"],zn="...",np=new Set(["free-trial","start-free-trial","seven-day-trial","fourteen-day-trial","thirty-day-trial"]);function Ae(e,t,r,i){let a=i[e];if(t[e]&&a){let n={slot:a?.slot,...a?.attributes},o=t[e];if(a.maxCount&&typeof o=="string"){let[c,l]=Ep(o,a.maxCount,a.withSuffix);c!==o&&(n.title=l,o=c)}let s=ne(a.tag,n,o);r.append(s)}}function op(e,t,r){let a=(e.mnemonicIcon||[]).filter(o=>o).map((o,s)=>({icon:o,alt:e.mnemonicAlt?.[s]??"",link:e.mnemonicLink?.[s]??""}));a?.forEach(({icon:o,alt:s,link:c})=>{if(c&&!/^https?:/.test(c))try{c=new URL(`https://${c}`).href.toString()}catch{c="#"}let l={slot:"icons",src:o,loading:t.loading,size:r?.size??"l"};s&&(l.alt=s),c&&(l.href=c);let d=ne("merch-icon",l);t.append(d)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=a?.length?null:"none")}function sp(e,t,r){if(r.badge?.slot){if(e.badge?.length&&!e.badge?.startsWith("${e.badge}`}Ae("badge",e,t,r)}else e.badge?(t.setAttribute("badge-text",e.badge),r.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",e.badgeColor||Zh),r.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",e.badgeBackgroundColor||In),t.setAttribute("border-color",e.badgeBackgroundColor||In)):t.setAttribute("border-color",e.borderColor||Jh)}function cp(e,t,r){if(r.trialBadge&&e.trialBadge){if(!e.trialBadge.startsWith("${e.trialBadge}`}Ae("trialBadge",e,t,r)}}function lp(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function dp(e,t){e.cardName&&t.setAttribute("name",e.cardName)}function hp(e,t,r){e.cardTitle&&(e.cardTitle=ar(e.cardTitle)),Ae("cardTitle",e,t,{cardTitle:r})}function pp(e,t,r){Ae("subtitle",e,t,r)}function mp(e,t,r,i){if(!e.backgroundColor||e.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}r?.[e.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${r[e.backgroundColor]})`),t.setAttribute("background-color",e.backgroundColor)):i?.attribute&&e.backgroundColor&&(t.setAttribute(i.attribute,e.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function up(e,t,r){let i=r?.borderColor,a="--consonant-merch-card-border-color";if(e.borderColor?.toLowerCase()==="transparent")t.style.setProperty(a,"transparent");else if(e.borderColor&&i){let o=i?.specialValues?.[e.borderColor]?.includes("gradient")||/-gradient/.test(e.borderColor),s=/^spectrum-.*-(plans|special-offers)$/.test(e.borderColor);if(o){t.setAttribute("gradient-border","true");let c=e.borderColor;if(i?.specialValues){for(let[l,d]of Object.entries(i.specialValues))if(d===e.borderColor){c=l;break}}t.setAttribute("border-color",c),t.style.removeProperty(a)}else s?(t.setAttribute("border-color",e.borderColor),t.style.setProperty(a,`var(--${e.borderColor})`)):t.style.setProperty(a,`var(--${e.borderColor})`)}}function gp(e,t,r){if(e.backgroundImage){let i={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?i.alt=e.backgroundImageAltText:i.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(ne(r.tag,{slot:r.slot},ne("img",i)))}}function ar(e){return!e||typeof e!="string"||e.includes("(Ui(),_n)).catch(console.error),e}function fp(e,t,r){e.prices&&(e.prices=ar(e.prices)),Ae("prices",e,t,r)}function al(e,t,r){let i=e.hasAttribute("data-wcs-osi")&&!!e.getAttribute("data-wcs-osi"),a=e.className||"",n=tp.exec(a)?.[0]??"accent",o=n.includes("accent"),s=n.includes("primary"),c=n.includes("secondary"),l=n.includes("-outline"),d=n.includes("-link");e.classList.remove("accent","primary","secondary");let h;if(t.consonant)h=Tp(e,o,i,d,s,c,r?.ctas?.size);else if(d)h=e;else{let u;o?u="accent":s?u="primary":c&&(u="secondary"),h=t.spectrum==="swc"?Cp(e,r,l,u,i):Sp(e,r,l,u,i)}return h}function xp(e,t){let{slot:r}=t?.description,i=e.querySelectorAll(`[slot="${r}"] a[data-wcs-osi]`);i.length&&i.forEach(a=>{let n=al(a,e,t);a.replaceWith(n)})}function vp(e,t,r){e.description&&(e.description=ar(e.description)),e.promoText&&(e.promoText=ar(e.promoText)),e.shortDescription&&(e.shortDescription=ar(e.shortDescription)),Ae("promoText",e,t,r),Ae("description",e,t,r),Ae("shortDescription",e,t,r),e.shortDescription&&(t.setAttribute("action-menu","true"),e.actionMenuLabel||t.setAttribute("action-menu-label","More options")),xp(t,r),Ae("callout",e,t,r),Ae("quantitySelect",e,t,r),Ae("whatsIncluded",e,t,r)}function bp(e,t,r,i={}){if(!r.addon)return;let n=(e.addon??i.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=ne("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(D)].forEach(s=>{let c=s.parentElement;c?.nodeName==="P"&&c.setAttribute("data-plan-type","")}),t.append(o)}function yp(e,t,r){e.addonConfirmation&&Ae("addonConfirmation",e,t,r)}function wp(e,t,r,i){i?.secureLabel&&r?.secureLabel&&t.setAttribute("secure-label",i.secureLabel)}function Ep(e,t,r=!0){try{let i=typeof e!="string"?"":e,a=il(i);if(a.length<=t)return[i,a];let n=0,o=!1,s=r?t-zn.length<1?1:t-zn.length:t,c=[];for(let h of i){if(n++,h==="<")if(o=!0,i[n]==="/")c.pop();else{let u="";for(let f of i.substring(n)){if(f===" "||f===">")break;u+=f}c.push(u)}if(h==="/"&&i[n]===">"&&c.pop(),h===">"){o=!1;continue}if(!o&&(s--,s===0))break}let l=i.substring(0,n).trim();if(c.length>0){c[0]==="p"&&c.shift();for(let h of c.reverse())l+=``}return[`${l}${r?zn:""}`,a]}catch{let a=typeof e=="string"?e:"",n=il(a);return[a,n]}}function il(e){if(!e)return"";let t="",r=!1;for(let i of e){if(i==="<"&&(r=!0),i===">"){r=!1;continue}r||(t+=i)}return t}function Ap(e,t){t.querySelectorAll("a.upt-link").forEach(i=>{let a=Ye.createFrom(i);i.replaceWith(a),a.initializeWcsData(e.osi,e.promoCode)})}function Sp(e,t,r,i,a){let n=e;a?n=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let d of e.attributes)["class","is"].includes(d.name)||n.setAttribute(d.name,d.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",s=`spectrum-Button--${i}`,c=ap.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",l=["spectrum-Button",s,c];return r&&l.push("spectrum-Button--outline"),n.classList.add(...l),n}function Cp(e,t,r,i,a){let n=e;a&&(n=customElements.get("checkout-button").createCheckoutButton(e.dataset),n.connectedCallback(),n.render());let o="fill";r&&(o="outline");let s=ne("sp-button",{treatment:o,variant:i,tabIndex:0,size:t?.ctas?.size??"m",...e.dataset.analyticsId&&{"data-analytics-id":e.dataset.analyticsId}},e.innerHTML);return s.source=n,(a?n.onceSettled():Promise.resolve(n)).then(c=>{s.setAttribute("data-navigation-url",c.href)}),s.addEventListener("click",c=>{c.defaultPrevented||n.click()}),s}function Tp(e,t,r,i,a,n,o){let s=e;if(r)try{let c=customElements.get("checkout-link");c&&(s=c.createCheckoutLink(e.dataset,e.innerHTML)??e)}catch{}return i||(s.classList.add("button","con-button"),o&&o!=="m"&&s.classList.add(`button-${o}`),t&&s.classList.add("blue"),a&&s.classList.add("primary"),n&&s.classList.add("secondary")),s}function kp(e,t,r,i,a){if(e.ctas){e.ctas=ar(e.ctas);let{slot:n}=r.ctas,o=ne("div",{slot:n},e.ctas),s=[...o.querySelectorAll("a")],c=a?.hideTrialCTAs?s.filter(d=>!np.has(d.dataset.analyticsId)):s,l=(c.length>0?c:s).map(d=>al(d,t,r));o.textContent="",o.append(...l),t.append(o),a?.hideTrialCTAs&&c.length>0&&l.forEach(d=>{let h=d.source??d;h.onceSettled&&(d.hidden=!0,h.onceSettled().then(()=>{h.value?.[0]?.offerType==="TRIAL"&&l.some(f=>f!==d&&!f.hidden)?d.remove():d.hidden=!1}).catch(()=>{d.hidden=!1}))})}}function _p(e,t){let{tags:r}=e,i=r?.find(n=>typeof n=="string"&&n.startsWith(rp))?.split("/").pop();if(!i)return;t.setAttribute(Ki,i),[...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(ip,`${n.dataset.analyticsId}-${o+1}`)})}function Pp(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(i=>{i.classList.remove(t),i.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}function Lp(e){e.querySelectorAll("[slot]").forEach(i=>{i.remove()}),e.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",Ki].forEach(i=>e.removeAttribute(i));let r=["wide-strip","thin-strip"];e.classList.remove(...r)}async function nl(e,t){if(!e){let c=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${c}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${c}).`)}if(!e.fields){let c=e.id||"unknown",l=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'.`)}let{id:r,fields:i,settings:a={},priceLiterals:n}=e,{variant:o}=i;if(!o)throw new Error(`hydrate: no variant found in payload ${r}`);Lp(t),t.settings=a,n&&(t.priceLiterals=n),t.id??(t.id=e.id),e.variationId&&t.setAttribute("variation-id",e.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:s}=t.variantLayout;if(!s)throw new Error(`hydrate: variant mapping not found for ${r}`);s.style==="consonant"&&t.setAttribute("consonant",!0),op(i,t,s.mnemonics),cp(i,t,s),lp(i,t,s.size),dp(i,t),hp(i,t,s.title),sp(i,t,s),pp(i,t,s),fp(i,t,s),gp(i,t,s.backgroundImage),mp(i,t,s.allowedColors,s.backgroundColor),up(i,t,s),vp(i,t,s),bp(i,t,s,a),yp(i,t,s),wp(i,t,s,a);try{Ap(i,t)}catch{}kp(i,t,s,o,a),_p(i,t),Pp(t)}var Hn="merch-card",Dn=2e4,ol="merch-card:",cl=["full-pricing-express","simplified-pricing-express"],ll=["segment","product"];function sl(e,t){let r=e.closest(Hn);if(!r)return t;r.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,r.priceLiterals)),r.aemFragment&&(t[Te]=!0),r.variantLayout?.priceOptionsProvider?.(e,t)}function Mp(e){e.providers.has(sl)||e.providers.price(sl)}var ti=new IntersectionObserver(e=>{e.forEach(t=>{let r=t.target;if(cl.includes(r.variant)){if(r.clientHeight===0)return;ti.unobserve(r),r.requestUpdate();return}if(ll.includes(r.variant)){if(t.boundingClientRect.width===0)return;if(r.variant==="product"&&r.querySelector('merch-icon[slot="icons"]')){ti.unobserve(r);return}let i=r.getBoundingClientRect().width,n=r.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(i===0||n===0){ti.unobserve(r);return}r.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(i-n-16)}px`),ti.unobserve(r)}})}),Rp=0,nr,or,sr,Ge,St,Ie,Ct,X,At,ri,$n,Qi,Ze=class extends U{constructor(){super();E(this,X);E(this,nr);E(this,or);E(this,sr);E(this,Ge);E(this,St);E(this,Ie);E(this,Ct,new Promise(r=>{y(this,Ie,r)}));m(this,"customerSegment");m(this,"marketSegment");m(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=Mn(this),this.variantLayout?.connectedCallbackHook()}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=Mn(this),this.variantLayout?.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),r.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(r)}catch(i){Z(this,X,At).call(this,`Error in postCardUpdateHook: ${i.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 computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${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(D)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(Se)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(Se)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(Se)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let i=this.checkoutLinks;if(i.length!==0)for(let a of i){await a.onceSettled();let n=a.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let s=a.dataset.wcsOsi.split(",").filter(c=>c!==o);r.checked&&s.push(o),a.dataset.wcsOsi=s.join(",")}}changeHandler(r){r.target.tagName==="MERCH-ADDON"&&this.toggleAddon(r.target)}toggleAddon(r){this.variantLayout?.toggleAddon?.(r);let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length===0)return;let a=n=>{let{offerType:o,planType:s}=n.value?.[0]??{};if(!o||!s)return;let c=r.getOsi(s,o),l=(n.dataset.wcsOsi||"").split(",").filter(d=>d&&d!==c);r.checked&&l.push(c),n.dataset.wcsOsi=l.join(",")};i.forEach(a)}handleQuantitySelection(r){let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length!==0)for(let a of i)a.dataset.quantity=r.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(r){let i={...this.filters};Object.keys(i).forEach(a=>{if(r){i[a].order=Math.min(i[a].order||2,2);return}let n=i[a].order;n===1||isNaN(n)||(i[a].order=Number(n)+1)}),this.filters=i}showInfoTooltip(r,i){let a="tooltip-left",n="tooltip-right";window.screen.width<600&&r.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(a),this.iconButton.classList.remove(n),r.getBoundingClientRect().x<100&&this.iconButton.classList.add(a),r.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(i)}handleInfoIconEvents(){let r="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(i=>this.iconButton.addEventListener(i,a=>this.showInfoTooltip(a.target,r),!1)),["mouseleave","blur"].forEach(i=>this.iconButton.addEventListener(i,()=>this.iconButton.classList.remove(r),!1)),this.iconButton.addEventListener("keydown",i=>{i.key==="Escape"&&this.iconButton.classList.remove(r)}))}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){var i;super.connectedCallback(),p(this,or)||y(this,or,Rp++),this.aemFragment||((i=p(this,Ie))==null||i.call(this),y(this,Ie,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let r=this.id??p(this,or);y(this,St,`${ol}${r}${st}`),y(this,nr,`${ol}${r}${ct}`),performance.mark(p(this,St)),y(this,Ge,mt()),Mp(p(this,Ge)),y(this,sr,p(this,Ge).Log.module(Hn)),this.addEventListener(te,this.handleQuantitySelection),this.addEventListener(li,this.handleAddonAndQuantityUpdate),this.addEventListener(gr,this.handleMerchOfferSelectReady),this.addEventListener(nt,this.handleAemFragmentEvents),this.addEventListener(at,this.handleAemFragmentEvents),this.addEventListener(fr,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(te,this.handleQuantitySelection),this.removeEventListener(nt,this.handleAemFragmentEvents),this.removeEventListener(at,this.handleAemFragmentEvents),this.removeEventListener(fr,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(li,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(r){var i;if(this.isConnected&&(r.type===nt&&Z(this,X,At).call(this,"AEM fragment cannot be loaded"),r.type===at&&(this.failed=!1,r.target.nodeName==="AEM-FRAGMENT"))){let a=r.detail;try{p(this,Ie)||y(this,Ct,new Promise(n=>{y(this,Ie,n)})),nl(a,this)}catch(n){Z(this,X,At).call(this,`hydration has failed: ${n.message}`)}finally{(i=p(this,Ie))==null||i.call(this),y(this,Ie,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;p(this,Ct)&&(await p(this,Ct),(cl.includes(this.variant)||ll.includes(this.variant))&&ti.observe(this),y(this,Ct,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let r=new Promise(o=>setTimeout(()=>o("timeout"),Dn));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,r]);if(o===!1||o==="timeout"){let s=o==="timeout"?`AEM fragment was not resolved within ${Dn} timeout`:"AEM fragment cannot be loaded";Z(this,X,At).call(this,s,{},!1);return}}let i=[...this.querySelectorAll(ur)],a=Promise.all(i.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(s=>s.classList.contains("placeholder-resolved"))),n=await Promise.race([a,r]);if(n===!0){this.measure=performance.measure(p(this,nr),p(this,St));let o={...this.aemFragment?.fetchInfo,...p(this,Ge).duration,measure:Oe(this.measure)};return this.dispatchEvent(new CustomEvent(fr,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(p(this,nr),p(this,St));let o={measure:Oe(this.measure),...p(this,Ge).duration};n==="timeout"?Z(this,X,At).call(this,`Contains offers that were not resolved within ${Dn} timeout`,o):Z(this,X,At).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 r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(Se)).length===2&&r&&r.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:r,items:i}}){if(!r||!i?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(d=>d.getAttribute("data-modal-id")===r);if(!n)return;let s=new URL(n.getAttribute("href")).searchParams.get("pa"),c=i.find(d=>d.productArrangementCode===s)?.quantity,l=!!i.find(d=>d.productArrangementCode!==s);if(c&&this.quantitySelect?.dispatchEvent(new CustomEvent(Pt,{detail:{quantity:c},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==l){this.toggleStockOffer({target:this.addonCheckbox});let d=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(d,"target",{writable:!1,value:{checked:l}}),this.addonCheckbox.handleChange(d)}}get prices(){return Array.from(this.querySelectorAll(D))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let r=this.querySelector(".price.price-alternative");if(r||(r=this.querySelector(`${D}[data-template="price"] > span`)),!!r)return r=r.innerText,r}get regularPrice(){return p(this,X,ri)?.innerText}get promotionCode(){let r=[...this.querySelectorAll(`${D}[data-promotion-code],${Se}[data-promotion-code]`)].map(a=>a.dataset.promotionCode),i=[...new Set(r)];return i.length>1&&p(this,sr)?.warn(`Multiple different promotion codes found: ${i.join(", ")}`),r[0]}get annualPrice(){return this.querySelector(`${D}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(p(this,X,$n)??p(this,X,ri))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return p(this,X,ri)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let r=".price-unit-type";return p(this,X,$n)?.querySelector(r)?.textContent?.trim()??p(this,X,ri)?.querySelector(r)?.textContent?.trim()??this.querySelector(r)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let r=this.querySelector('a[is="upt-link"]');if(r)return Z(this,X,Qi).call(this,r)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let r=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${Se}, a`);return Array.from(r??[])}get primaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant==="accent"||r.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant!=="accent"&&!r.matches(".spectrum-Button--accent,.con-button.blue")))}};nr=new WeakMap,or=new WeakMap,sr=new WeakMap,Ge=new WeakMap,St=new WeakMap,Ie=new WeakMap,Ct=new WeakMap,X=new WeakSet,At=function(r,i={},a=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let s={...this.aemFragment.fetchInfo,...p(this,Ge).duration,...i,message:r};p(this,sr).error(`merch-card${o}: ${r}`,s),this.failed=!0,a&&this.dispatchEvent(new CustomEvent(na,{bubbles:!0,composed:!0,detail:s}))},ri=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${D}[data-template="price"] > span`)},$n=function(){return this.querySelector(`${D}[data-template="legal"]`)},Qi=function(r){if(r)return{text:r.innerText.trim(),analyticsId:r.dataset.analyticsId,href:r.getAttribute("href")??r.dataset.href}},m(Ze,"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:r=>{if(!r)return;let[i,a,n]=r.split(",");return{PUF:i,ABM:a,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(i=>{let[a,n,o]=i.split(":"),s=Number(n);return[a,{order:isNaN(s)?void 0:s,size:o}]})),toAttribute:r=>Object.entries(r).map(([i,{order:a,size:n}])=>[i,a,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Ki,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),m(Ze,"styles",[dc,...hc()]),m(Ze,"registerVariant",G),m(Ze,"getCollectionOptions",Uc),m(Ze,"getFragmentMapping",qi);customElements.define(Hn,Ze);P();var cr,ii=class extends U{constructor(){super();E(this,cr);this.defaults={},this.variant="plans"}saveContainerDefaultValues(){let r=this.closest(this.getAttribute("container")),i=r?.querySelector('[slot="description"]:not(merch-offer > *)')?.cloneNode(!0),a=r?.badgeText;return{description:i,badgeText:a}}getSlottedElement(r,i){return(i||this.closest(this.getAttribute("container"))).querySelector(`[slot="${r}"]:not(merch-offer > *)`)}updateSlot(r,i){let a=this.getSlottedElement(r,i);if(!a)return;let n=this.selectedOffer.getOptionValue(r)?this.selectedOffer.getOptionValue(r):this.defaults[r];n&&a.replaceWith(n.cloneNode(!0))}handleOfferSelection(r){let i=r.detail;this.selectOffer(i)}handleOfferSelectionByQuantity(r){let i=r.detail.option,a=Number.parseInt(i),n=this.findAppropriateOffer(a);this.selectOffer(n),this.getSlottedElement("cta").setAttribute("data-quantity",a)}selectOffer(r){if(!r)return;let i=this.selectedOffer;i&&(i.selected=!1),r.selected=!0,this.selectedOffer=r,this.planType=r.planType,this.updateContainer(),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(aa,{detail:this,bubbles:!0}))})}findAppropriateOffer(r){let i=null;return this.offers.find(n=>{let o=Number.parseInt(n.getAttribute("value"));if(o===r)return!0;if(o>r)return!1;i=n})||i}updateBadgeText(r){this.selectedOffer.badgeText===""?r.badgeText=null:this.selectedOffer.badgeText?r.badgeText=this.selectedOffer.badgeText:r.badgeText=this.defaults.badgeText}updateContainer(){let r=this.closest(this.getAttribute("container"));!r||!this.selectedOffer||(this.updateSlot("cta",r),this.updateSlot("secondary-cta",r),this.updateSlot("price",r),!this.manageableMode&&(this.updateSlot("description",r),this.updateBadgeText(r)))}render(){return g`
`}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.handleFocusin),this.addEventListener("click",this.handleFocusin),this.addEventListener(_t,this.handleOfferSelectReady);let r=this.closest("merch-quantity-select");this.manageableMode=r,this.offers=[...this.querySelectorAll("merch-offer")],y(this,cr,this.handleOfferSelectionByQuantity.bind(this)),this.manageableMode?r.addEventListener(te,p(this,cr)):this.defaults=this.saveContainerDefaultValues(),this.selectedOffer=this.offers[0],this.planType&&this.updateContainer()}get miniCompareMobileCard(){return(this.merchCard?.variant==="mini-compare-chart"||this.merchCard?.variant==="mini-compare-chart-mweb")&&this.isMobile}get merchCard(){return this.closest("merch-card")}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(te,p(this,cr)),this.removeEventListener(_t,this.handleOfferSelectReady),this.removeEventListener("focusin",this.handleFocusin),this.removeEventListener("click",this.handleFocusin)}get price(){return this.querySelector('merch-offer[aria-selected] [is="inline-price"]')}get customerSegment(){return this.selectedOffer?.customerSegment}get marketSegment(){return this.selectedOffer?.marketSegment}handleFocusin(r){r.target?.nodeName==="MERCH-OFFER"&&(r.preventDefault(),r.stopImmediatePropagation(),this.selectOffer(r.target))}async handleOfferSelectReady(){this.planType||this.querySelector("merch-offer:not([plan-type])")||(this.planType=this.selectedOffer.planType,await this.updateComplete,this.selectOffer(this.selectedOffer??this.querySelector("merch-offer[aria-selected]")??this.querySelector("merch-offer")),this.dispatchEvent(new CustomEvent(gr,{bubbles:!0})))}};cr=new WeakMap,m(ii,"styles",b` + `),m(ei,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",ei);var ep="#000000",In="#F8D904",tp="#EAEAEA",rp="#31A547",ip=/(accent|primary|secondary)(-(outline|link))?/,ap="mas:product_code/",np="daa-ll",Ki="daa-lh",op=["XL","L","M","S"],zn="...",sp=new Set(["free-trial","start-free-trial","seven-day-trial","fourteen-day-trial","thirty-day-trial"]);function Ae(e,t,r,i){let a=i[e];if(t[e]&&a){let n={slot:a?.slot,...a?.attributes},o=t[e];if(a.maxCount&&typeof o=="string"){let[c,l]=Sp(o,a.maxCount,a.withSuffix);c!==o&&(n.title=l,o=c)}let s=ne(a.tag,n,o);r.append(s)}}function cp(e,t,r){let a=(e.mnemonicIcon||[]).filter(o=>o).map((o,s)=>({icon:o,alt:e.mnemonicAlt?.[s]??"",link:e.mnemonicLink?.[s]??""}));a?.forEach(({icon:o,alt:s,link:c})=>{if(c&&!/^https?:/.test(c))try{c=new URL(`https://${c}`).href.toString()}catch{c="#"}let l={slot:"icons",src:o,loading:t.loading,size:r?.size??"l"};s&&(l.alt=s),c&&(l.href=c);let d=ne("merch-icon",l);t.append(d)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=a?.length?null:"none")}function lp(e,t,r){if(r.badge?.slot){if(e.badge?.length&&!e.badge?.startsWith("${e.badge}`}Ae("badge",e,t,r)}else e.badge?(t.setAttribute("badge-text",e.badge),r.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",e.badgeColor||ep),r.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",e.badgeBackgroundColor||In),t.setAttribute("border-color",e.badgeBackgroundColor||In)):t.setAttribute("border-color",e.borderColor||tp)}function dp(e,t,r){if(r.trialBadge&&e.trialBadge){if(!e.trialBadge.startsWith("${e.trialBadge}`}Ae("trialBadge",e,t,r)}}function hp(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function pp(e,t){e.cardName&&t.setAttribute("name",e.cardName)}function mp(e,t,r){e.cardTitle&&(e.cardTitle=ar(e.cardTitle)),Ae("cardTitle",e,t,{cardTitle:r})}function up(e,t,r){Ae("subtitle",e,t,r)}function gp(e,t,r,i){if(!e.backgroundColor||e.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}r?.[e.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${r[e.backgroundColor]})`),t.setAttribute("background-color",e.backgroundColor)):i?.attribute&&e.backgroundColor&&(t.setAttribute(i.attribute,e.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function fp(e,t,r){let i=r?.borderColor,a="--consonant-merch-card-border-color";if(e.borderColor?.toLowerCase()==="transparent")t.style.setProperty(a,"transparent");else if(e.borderColor&&i){let o=i?.specialValues?.[e.borderColor]?.includes("gradient")||/-gradient/.test(e.borderColor),s=/^spectrum-.*-(plans|special-offers)$/.test(e.borderColor);if(o){t.setAttribute("gradient-border","true");let c=e.borderColor;if(i?.specialValues){for(let[l,d]of Object.entries(i.specialValues))if(d===e.borderColor){c=l;break}}t.setAttribute("border-color",c),t.style.removeProperty(a)}else s?(t.setAttribute("border-color",e.borderColor),t.style.setProperty(a,`var(--${e.borderColor})`)):t.style.setProperty(a,`var(--${e.borderColor})`)}}function xp(e,t,r){if(e.backgroundImage){let i={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?i.alt=e.backgroundImageAltText:i.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(ne(r.tag,{slot:r.slot},ne("img",i)))}}function ar(e){return!e||typeof e!="string"||e.includes("(Ui(),_n)).catch(console.error),e}function vp(e,t,r){e.prices&&(e.prices=ar(e.prices)),Ae("prices",e,t,r)}function al(e,t,r){let i=e.hasAttribute("data-wcs-osi")&&!!e.getAttribute("data-wcs-osi"),a=e.className||"",n=ip.exec(a)?.[0]??"accent",o=n.includes("accent"),s=n.includes("primary"),c=n.includes("secondary"),l=n.includes("-outline"),d=n.includes("-link");e.classList.remove("accent","primary","secondary");let h;if(t.consonant)h=_p(e,o,i,d,s,c,r?.ctas?.size);else if(d)h=e;else{let u;o?u="accent":s?u="primary":c&&(u="secondary"),h=t.spectrum==="swc"?kp(e,r,l,u,i):Tp(e,r,l,u,i)}return h}function bp(e,t){let{slot:r}=t?.description,i=e.querySelectorAll(`[slot="${r}"] a[data-wcs-osi]`);i.length&&i.forEach(a=>{let n=al(a,e,t);a.replaceWith(n)})}function yp(e,t,r){e.description&&(e.description=ar(e.description)),e.promoText&&(e.promoText=ar(e.promoText)),e.shortDescription&&(e.shortDescription=ar(e.shortDescription)),Ae("promoText",e,t,r),Ae("description",e,t,r),Ae("shortDescription",e,t,r),e.shortDescription&&(t.setAttribute("action-menu","true"),e.actionMenuLabel||t.setAttribute("action-menu-label","More options")),bp(t,r),Ae("callout",e,t,r),Ae("quantitySelect",e,t,r),Ae("whatsIncluded",e,t,r)}function wp(e,t,r,i={}){if(!r.addon)return;let n=(e.addon??i.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=ne("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(D)].forEach(s=>{let c=s.parentElement;c?.nodeName==="P"&&c.setAttribute("data-plan-type","")}),t.append(o)}function Ep(e,t,r){e.addonConfirmation&&Ae("addonConfirmation",e,t,r)}function Ap(e,t,r,i){i?.secureLabel&&r?.secureLabel&&t.setAttribute("secure-label",i.secureLabel)}function Sp(e,t,r=!0){try{let i=typeof e!="string"?"":e,a=il(i);if(a.length<=t)return[i,a];let n=0,o=!1,s=r?t-zn.length<1?1:t-zn.length:t,c=[];for(let h of i){if(n++,h==="<")if(o=!0,i[n]==="/")c.pop();else{let u="";for(let f of i.substring(n)){if(f===" "||f===">")break;u+=f}c.push(u)}if(h==="/"&&i[n]===">"&&c.pop(),h===">"){o=!1;continue}if(!o&&(s--,s===0))break}let l=i.substring(0,n).trim();if(c.length>0){c[0]==="p"&&c.shift();for(let h of c.reverse())l+=``}return[`${l}${r?zn:""}`,a]}catch{let a=typeof e=="string"?e:"",n=il(a);return[a,n]}}function il(e){if(!e)return"";let t="",r=!1;for(let i of e){if(i==="<"&&(r=!0),i===">"){r=!1;continue}r||(t+=i)}return t}function Cp(e,t){t.querySelectorAll("a.upt-link").forEach(i=>{let a=Ye.createFrom(i);i.replaceWith(a),a.initializeWcsData(e.osi,e.promoCode)})}function Tp(e,t,r,i,a){let n=e;a?n=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let d of e.attributes)["class","is"].includes(d.name)||n.setAttribute(d.name,d.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",s=`spectrum-Button--${i}`,c=op.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",l=["spectrum-Button",s,c];return r&&l.push("spectrum-Button--outline"),n.classList.add(...l),n}function kp(e,t,r,i,a){let n=e;a&&(n=customElements.get("checkout-button").createCheckoutButton(e.dataset),n.connectedCallback(),n.render());let o="fill";r&&(o="outline");let s=ne("sp-button",{treatment:o,variant:i,tabIndex:0,size:t?.ctas?.size??"m",...e.dataset.analyticsId&&{"data-analytics-id":e.dataset.analyticsId}},e.innerHTML);return s.source=n,(a?n.onceSettled():Promise.resolve(n)).then(c=>{s.setAttribute("data-navigation-url",c.href)}),s.addEventListener("click",c=>{c.defaultPrevented||n.click()}),s}function _p(e,t,r,i,a,n,o){let s=e;if(r)try{let c=customElements.get("checkout-link");c&&(s=c.createCheckoutLink(e.dataset,e.innerHTML)??e)}catch{}return i||(s.classList.add("button","con-button"),o&&o!=="m"&&s.classList.add(`button-${o}`),t&&s.classList.add("blue"),a&&s.classList.add("primary"),n&&s.classList.add("secondary")),s}function Pp(e,t,r,i,a){if(e.ctas){e.ctas=ar(e.ctas);let{slot:n}=r.ctas,o=ne("div",{slot:n},e.ctas),s=[...o.querySelectorAll("a")],c=a?.hideTrialCTAs?s.filter(d=>!sp.has(d.dataset.analyticsId)):s,l=(c.length>0?c:s).map(d=>al(d,t,r));o.textContent="",o.append(...l),t.append(o),a?.hideTrialCTAs&&c.length>0&&l.forEach(d=>{let h=d.source??d;h.onceSettled&&(d.hidden=!0,h.onceSettled().then(()=>{h.value?.[0]?.offerType==="TRIAL"&&l.some(f=>f!==d&&!f.hidden)?d.remove():d.hidden=!1}).catch(()=>{d.hidden=!1}))})}}function Lp(e,t){let{tags:r}=e,i=r?.find(n=>typeof n=="string"&&n.startsWith(ap))?.split("/").pop();if(!i)return;t.setAttribute(Ki,i),[...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(np,`${n.dataset.analyticsId}-${o+1}`)})}function Mp(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(i=>{i.classList.remove(t),i.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}function Rp(e){e.querySelectorAll("[slot]").forEach(i=>{i.remove()}),e.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",Ki].forEach(i=>e.removeAttribute(i));let r=["wide-strip","thin-strip"];e.classList.remove(...r)}async function nl(e,t){if(!e){let c=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${c}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${c}).`)}if(!e.fields){let c=e.id||"unknown",l=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'.`)}let{id:r,fields:i,settings:a={},priceLiterals:n}=e,{variant:o}=i;if(!o)throw new Error(`hydrate: no variant found in payload ${r}`);Rp(t),t.settings=a,n&&(t.priceLiterals=n),t.id??(t.id=e.id),e.variationId&&t.setAttribute("variation-id",e.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:s}=t.variantLayout;if(!s)throw new Error(`hydrate: variant mapping not found for ${r}`);s.style==="consonant"&&t.setAttribute("consonant",!0),cp(i,t,s.mnemonics),dp(i,t,s),hp(i,t,s.size),pp(i,t),mp(i,t,s.title),lp(i,t,s),up(i,t,s),vp(i,t,s),xp(i,t,s.backgroundImage),gp(i,t,s.allowedColors,s.backgroundColor),fp(i,t,s),yp(i,t,s),wp(i,t,s,a),Ep(i,t,s),Ap(i,t,s,a);try{Cp(i,t)}catch{}Pp(i,t,s,o,a),Lp(i,t),Mp(t)}var Hn="merch-card",Dn=2e4,ol="merch-card:",cl=["full-pricing-express","simplified-pricing-express"],ll=["segment","product"];function sl(e,t){let r=e.closest(Hn);if(!r)return t;r.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,r.priceLiterals)),r.aemFragment&&(t[Te]=!0),r.variantLayout?.priceOptionsProvider?.(e,t)}function Op(e){e.providers.has(sl)||e.providers.price(sl)}var ti=new IntersectionObserver(e=>{e.forEach(t=>{let r=t.target;if(cl.includes(r.variant)){if(r.clientHeight===0)return;ti.unobserve(r),r.requestUpdate();return}if(ll.includes(r.variant)){if(t.boundingClientRect.width===0)return;if(r.variant==="product"&&r.querySelector('merch-icon[slot="icons"]')){ti.unobserve(r);return}let i=r.getBoundingClientRect().width,n=r.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(i===0||n===0){ti.unobserve(r);return}r.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(i-n-16)}px`),ti.unobserve(r)}})}),Np=0,nr,or,sr,Ge,St,Ie,Ct,X,At,ri,$n,Qi,Ze=class extends U{constructor(){super();E(this,X);E(this,nr);E(this,or);E(this,sr);E(this,Ge);E(this,St);E(this,Ie);E(this,Ct,new Promise(r=>{y(this,Ie,r)}));m(this,"customerSegment");m(this,"marketSegment");m(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=Mn(this),this.variantLayout?.connectedCallbackHook()}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=Mn(this),this.variantLayout?.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),r.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(r)}catch(i){Z(this,X,At).call(this,`Error in postCardUpdateHook: ${i.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 computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${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(D)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(Se)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(Se)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(Se)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let i=this.checkoutLinks;if(i.length!==0)for(let a of i){await a.onceSettled();let n=a.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let s=a.dataset.wcsOsi.split(",").filter(c=>c!==o);r.checked&&s.push(o),a.dataset.wcsOsi=s.join(",")}}changeHandler(r){r.target.tagName==="MERCH-ADDON"&&this.toggleAddon(r.target)}toggleAddon(r){this.variantLayout?.toggleAddon?.(r);let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length===0)return;let a=n=>{let{offerType:o,planType:s}=n.value?.[0]??{};if(!o||!s)return;let c=r.getOsi(s,o),l=(n.dataset.wcsOsi||"").split(",").filter(d=>d&&d!==c);r.checked&&l.push(c),n.dataset.wcsOsi=l.join(",")};i.forEach(a)}handleQuantitySelection(r){let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length!==0)for(let a of i)a.dataset.quantity=r.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(r){let i={...this.filters};Object.keys(i).forEach(a=>{if(r){i[a].order=Math.min(i[a].order||2,2);return}let n=i[a].order;n===1||isNaN(n)||(i[a].order=Number(n)+1)}),this.filters=i}showInfoTooltip(r,i){let a="tooltip-left",n="tooltip-right";window.screen.width<600&&r.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(a),this.iconButton.classList.remove(n),r.getBoundingClientRect().x<100&&this.iconButton.classList.add(a),r.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(i)}handleInfoIconEvents(){let r="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(i=>this.iconButton.addEventListener(i,a=>this.showInfoTooltip(a.target,r),!1)),["mouseleave","blur"].forEach(i=>this.iconButton.addEventListener(i,()=>this.iconButton.classList.remove(r),!1)),this.iconButton.addEventListener("keydown",i=>{i.key==="Escape"&&this.iconButton.classList.remove(r)}))}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){var i;super.connectedCallback(),p(this,or)||y(this,or,Np++),this.aemFragment||((i=p(this,Ie))==null||i.call(this),y(this,Ie,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let r=this.id??p(this,or);y(this,St,`${ol}${r}${st}`),y(this,nr,`${ol}${r}${ct}`),performance.mark(p(this,St)),y(this,Ge,mt()),Op(p(this,Ge)),y(this,sr,p(this,Ge).Log.module(Hn)),this.addEventListener(te,this.handleQuantitySelection),this.addEventListener(li,this.handleAddonAndQuantityUpdate),this.addEventListener(gr,this.handleMerchOfferSelectReady),this.addEventListener(nt,this.handleAemFragmentEvents),this.addEventListener(at,this.handleAemFragmentEvents),this.addEventListener(fr,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(te,this.handleQuantitySelection),this.removeEventListener(nt,this.handleAemFragmentEvents),this.removeEventListener(at,this.handleAemFragmentEvents),this.removeEventListener(fr,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(li,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(r){var i;if(this.isConnected&&(r.type===nt&&Z(this,X,At).call(this,"AEM fragment cannot be loaded"),r.type===at&&(this.failed=!1,r.target.nodeName==="AEM-FRAGMENT"))){let a=r.detail;try{p(this,Ie)||y(this,Ct,new Promise(n=>{y(this,Ie,n)})),nl(a,this)}catch(n){Z(this,X,At).call(this,`hydration has failed: ${n.message}`)}finally{(i=p(this,Ie))==null||i.call(this),y(this,Ie,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;p(this,Ct)&&(await p(this,Ct),(cl.includes(this.variant)||ll.includes(this.variant))&&ti.observe(this),y(this,Ct,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let r=new Promise(o=>setTimeout(()=>o("timeout"),Dn));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,r]);if(o===!1||o==="timeout"){let s=o==="timeout"?`AEM fragment was not resolved within ${Dn} timeout`:"AEM fragment cannot be loaded";Z(this,X,At).call(this,s,{},!1);return}}let i=[...this.querySelectorAll(ur)],a=Promise.all(i.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(s=>s.classList.contains("placeholder-resolved"))),n=await Promise.race([a,r]);if(n===!0){this.measure=performance.measure(p(this,nr),p(this,St));let o={...this.aemFragment?.fetchInfo,...p(this,Ge).duration,measure:Oe(this.measure)};return this.dispatchEvent(new CustomEvent(fr,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(p(this,nr),p(this,St));let o={measure:Oe(this.measure),...p(this,Ge).duration};n==="timeout"?Z(this,X,At).call(this,`Contains offers that were not resolved within ${Dn} timeout`,o):Z(this,X,At).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 r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(Se)).length===2&&r&&r.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:r,items:i}}){if(!r||!i?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(d=>d.getAttribute("data-modal-id")===r);if(!n)return;let s=new URL(n.getAttribute("href")).searchParams.get("pa"),c=i.find(d=>d.productArrangementCode===s)?.quantity,l=!!i.find(d=>d.productArrangementCode!==s);if(c&&this.quantitySelect?.dispatchEvent(new CustomEvent(Pt,{detail:{quantity:c},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==l){this.toggleStockOffer({target:this.addonCheckbox});let d=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(d,"target",{writable:!1,value:{checked:l}}),this.addonCheckbox.handleChange(d)}}get prices(){return Array.from(this.querySelectorAll(D))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let r=this.querySelector(".price.price-alternative");if(r||(r=this.querySelector(`${D}[data-template="price"] > span`)),!!r)return r=r.innerText,r}get regularPrice(){return p(this,X,ri)?.innerText}get promotionCode(){let r=[...this.querySelectorAll(`${D}[data-promotion-code],${Se}[data-promotion-code]`)].map(a=>a.dataset.promotionCode),i=[...new Set(r)];return i.length>1&&p(this,sr)?.warn(`Multiple different promotion codes found: ${i.join(", ")}`),r[0]}get annualPrice(){return this.querySelector(`${D}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(p(this,X,$n)??p(this,X,ri))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return p(this,X,ri)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let r=".price-unit-type";return p(this,X,$n)?.querySelector(r)?.textContent?.trim()??p(this,X,ri)?.querySelector(r)?.textContent?.trim()??this.querySelector(r)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let r=this.querySelector('a[is="upt-link"]');if(r)return Z(this,X,Qi).call(this,r)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let r=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${Se}, a`);return Array.from(r??[])}get primaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant==="accent"||r.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant!=="accent"&&!r.matches(".spectrum-Button--accent,.con-button.blue")))}};nr=new WeakMap,or=new WeakMap,sr=new WeakMap,Ge=new WeakMap,St=new WeakMap,Ie=new WeakMap,Ct=new WeakMap,X=new WeakSet,At=function(r,i={},a=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let s={...this.aemFragment.fetchInfo,...p(this,Ge).duration,...i,message:r};p(this,sr).error(`merch-card${o}: ${r}`,s),this.failed=!0,a&&this.dispatchEvent(new CustomEvent(na,{bubbles:!0,composed:!0,detail:s}))},ri=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${D}[data-template="price"] > span`)},$n=function(){return this.querySelector(`${D}[data-template="legal"]`)},Qi=function(r){if(r)return{text:r.innerText.trim(),analyticsId:r.dataset.analyticsId,href:r.getAttribute("href")??r.dataset.href}},m(Ze,"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:r=>{if(!r)return;let[i,a,n]=r.split(",");return{PUF:i,ABM:a,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(i=>{let[a,n,o]=i.split(":"),s=Number(n);return[a,{order:isNaN(s)?void 0:s,size:o}]})),toAttribute:r=>Object.entries(r).map(([i,{order:a,size:n}])=>[i,a,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Ki,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),m(Ze,"styles",[dc,...hc()]),m(Ze,"registerVariant",G),m(Ze,"getCollectionOptions",Uc),m(Ze,"getFragmentMapping",qi);customElements.define(Hn,Ze);P();var cr,ii=class extends U{constructor(){super();E(this,cr);this.defaults={},this.variant="plans"}saveContainerDefaultValues(){let r=this.closest(this.getAttribute("container")),i=r?.querySelector('[slot="description"]:not(merch-offer > *)')?.cloneNode(!0),a=r?.badgeText;return{description:i,badgeText:a}}getSlottedElement(r,i){return(i||this.closest(this.getAttribute("container"))).querySelector(`[slot="${r}"]:not(merch-offer > *)`)}updateSlot(r,i){let a=this.getSlottedElement(r,i);if(!a)return;let n=this.selectedOffer.getOptionValue(r)?this.selectedOffer.getOptionValue(r):this.defaults[r];n&&a.replaceWith(n.cloneNode(!0))}handleOfferSelection(r){let i=r.detail;this.selectOffer(i)}handleOfferSelectionByQuantity(r){let i=r.detail.option,a=Number.parseInt(i),n=this.findAppropriateOffer(a);this.selectOffer(n),this.getSlottedElement("cta").setAttribute("data-quantity",a)}selectOffer(r){if(!r)return;let i=this.selectedOffer;i&&(i.selected=!1),r.selected=!0,this.selectedOffer=r,this.planType=r.planType,this.updateContainer(),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(aa,{detail:this,bubbles:!0}))})}findAppropriateOffer(r){let i=null;return this.offers.find(n=>{let o=Number.parseInt(n.getAttribute("value"));if(o===r)return!0;if(o>r)return!1;i=n})||i}updateBadgeText(r){this.selectedOffer.badgeText===""?r.badgeText=null:this.selectedOffer.badgeText?r.badgeText=this.selectedOffer.badgeText:r.badgeText=this.defaults.badgeText}updateContainer(){let r=this.closest(this.getAttribute("container"));!r||!this.selectedOffer||(this.updateSlot("cta",r),this.updateSlot("secondary-cta",r),this.updateSlot("price",r),!this.manageableMode&&(this.updateSlot("description",r),this.updateBadgeText(r)))}render(){return g`
`}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.handleFocusin),this.addEventListener("click",this.handleFocusin),this.addEventListener(_t,this.handleOfferSelectReady);let r=this.closest("merch-quantity-select");this.manageableMode=r,this.offers=[...this.querySelectorAll("merch-offer")],y(this,cr,this.handleOfferSelectionByQuantity.bind(this)),this.manageableMode?r.addEventListener(te,p(this,cr)):this.defaults=this.saveContainerDefaultValues(),this.selectedOffer=this.offers[0],this.planType&&this.updateContainer()}get miniCompareMobileCard(){return(this.merchCard?.variant==="mini-compare-chart"||this.merchCard?.variant==="mini-compare-chart-mweb")&&this.isMobile}get merchCard(){return this.closest("merch-card")}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(te,p(this,cr)),this.removeEventListener(_t,this.handleOfferSelectReady),this.removeEventListener("focusin",this.handleFocusin),this.removeEventListener("click",this.handleFocusin)}get price(){return this.querySelector('merch-offer[aria-selected] [is="inline-price"]')}get customerSegment(){return this.selectedOffer?.customerSegment}get marketSegment(){return this.selectedOffer?.marketSegment}handleFocusin(r){r.target?.nodeName==="MERCH-OFFER"&&(r.preventDefault(),r.stopImmediatePropagation(),this.selectOffer(r.target))}async handleOfferSelectReady(){this.planType||this.querySelector("merch-offer:not([plan-type])")||(this.planType=this.selectedOffer.planType,await this.updateComplete,this.selectOffer(this.selectedOffer??this.querySelector("merch-offer[aria-selected]")??this.querySelector("merch-offer")),this.dispatchEvent(new CustomEvent(gr,{bubbles:!0})))}};cr=new WeakMap,m(ii,"styles",b` :host { display: inline-block; } @@ -9092,7 +9092,7 @@ merch-card[border-color="spectrum-red-700-plans"] { position: relative; height: 40px; } -`;var Op="merch-offer",ai=class extends U{constructor(){super();m(this,"tr");this.type="radio",this.selected=!1}getOptionValue(r){return this.querySelector(`[slot="${r}"]`)}connectedCallback(){super.connectedCallback(),this.initOffer(),this.configuration=this.closest("quantity-selector"),!this.hasAttribute("tabindex")&&!this.configuration&&(this.tabIndex=0),!this.hasAttribute("role")&&!this.configuration&&(this.role="radio")}get asRadioOption(){return g`
+`;var Ip="merch-offer",ai=class extends U{constructor(){super();m(this,"tr");this.type="radio",this.selected=!1}getOptionValue(r){return this.querySelector(`[slot="${r}"]`)}connectedCallback(){super.connectedCallback(),this.initOffer(),this.configuration=this.closest("quantity-selector"),!this.hasAttribute("tabindex")&&!this.configuration&&(this.tabIndex=0),!this.hasAttribute("role")&&!this.configuration&&(this.role="radio")}get asRadioOption(){return g`
${this.text} @@ -9109,7 +9109,7 @@ merch-card[border-color="spectrum-red-700-plans"] { > -
`}render(){return this.configuration||!this.price?"":this.type==="subscription-option"?this.asSubscriptionOption:this.asRadioOption}get price(){return this.querySelector('span[is="inline-price"]:not([data-template="strikethrough"])')}get cta(){return this.querySelector(Se)}get prices(){return this.querySelectorAll('span[is="inline-price"]')}get customerSegment(){return this.price?.value?.[0].customerSegment}get marketSegment(){return this.price?.value?.[0].marketSegments[0]}async initOffer(){if(!this.price)return;this.prices.forEach(i=>i.setAttribute("slot","price")),await this.updateComplete,await Promise.all([...this.prices].map(i=>i.onceSettled()));let{value:[r]}=this.price;this.planType=r.planType,await this.updateComplete,this.dispatchEvent(new CustomEvent(_t,{bubbles:!0}))}};m(ai,"properties",{text:{type:String},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},badgeText:{type:String,attribute:"badge-text"},type:{type:String,attribute:"type",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0}}),m(ai,"styles",[dl]);customElements.define(Op,ai);P();P();var hl=b` +
`}render(){return this.configuration||!this.price?"":this.type==="subscription-option"?this.asSubscriptionOption:this.asRadioOption}get price(){return this.querySelector('span[is="inline-price"]:not([data-template="strikethrough"])')}get cta(){return this.querySelector(Se)}get prices(){return this.querySelectorAll('span[is="inline-price"]')}get customerSegment(){return this.price?.value?.[0].customerSegment}get marketSegment(){return this.price?.value?.[0].marketSegments[0]}async initOffer(){if(!this.price)return;this.prices.forEach(i=>i.setAttribute("slot","price")),await this.updateComplete,await Promise.all([...this.prices].map(i=>i.onceSettled()));let{value:[r]}=this.price;this.planType=r.planType,await this.updateComplete,this.dispatchEvent(new CustomEvent(_t,{bubbles:!0}))}};m(ai,"properties",{text:{type:String},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},badgeText:{type:String,attribute:"badge-text"},type:{type:String,attribute:"type",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0}}),m(ai,"styles",[dl]);customElements.define(Ip,ai);P();P();var hl=b` :host { box-sizing: border-box; --background-color: var(--qs-background-color, #f6f6f6); @@ -9268,7 +9268,7 @@ merch-card[border-color="spectrum-red-700-plans"] { :host(:dir(rtl)) .item.selected { background-position: left 7px center; } -`;var[w0,E0,Bn,Fn,pl,ml]=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Tab"];var Un=class extends U{static get properties(){return{closed:{type:Boolean,reflect:!0},selected:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},maxInput:{type:Number,attribute:"max-input"},options:{type:Array},highlightedIndex:{type:Number},defaultValue:{type:Number,attribute:"default-value",reflect:!0},title:{type:String}}}static get styles(){return hl}constructor(){super(),this.options=[],this.title="",this.closed=!0,this.min=0,this.max=0,this.step=0,this.maxInput=void 0,this.defaultValue=void 0,this.selectedValue=0,this.highlightedIndex=0,this.toggleMenu=this.toggleMenu.bind(this),this.closeMenu=this.closeMenu.bind(this),this.openMenu=this.openMenu.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this),this.boundKeydownListener=this.handleKeydown.bind(this),this.handleKeyupDebounced=Rr(this.handleKeyup.bind(this),500),this.debouncedQuantityUpdate=Rr(this.handleQuantityUpdate.bind(this),500)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.boundKeydownListener),window.addEventListener("mousedown",this.handleClickOutside),this.addEventListener(Pt,this.debouncedQuantityUpdate)}get button(){return this.shadowRoot.querySelector("button")}handleKeyup(t){t.key===Fn||t.key===Bn||(this.handleInput(),this.sendEvent())}selectValue(){if(!this.closed){let t=this.options[this.highlightedIndex];if(!t){this.closed=!0;return}this.selectedValue=t,this.handleMenuOption(this.selectedValue),this.closed=!0}}handleKeydown(t){switch(t.key){case" ":this.selectValue();break;case"Escape":this.closed=!0;break;case ml:this.selectValue();break;case Fn:this.closed?this.openMenu():this.highlightedIndex=(this.highlightedIndex+1)%this.options.length,t.preventDefault();break;case Bn:this.closed||(this.highlightedIndex=(this.highlightedIndex-1+this.options.length)%this.options.length),t.preventDefault();break;case pl:this.selectValue(),this.button.classList.contains("focused")&&t.preventDefault();break}t.composedPath().includes(this)&&t.stopPropagation()}adjustInput(t,r){this.selectedValue=r,t.value=r,this.highlightedIndex=this.options.indexOf(r)}handleInput(){let t=this.shadowRoot.querySelector(".text-field-input"),r=t.value.replace(/\D/g,"");t.value=r;let i=parseInt(r);if(!isNaN(i))if(i>0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return g`
0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return g`
{Fi.set(e,{class:t,fragmentMapping:r,style:a,collectionOptions:i})};V("catalog",Ye,ci,Ye.variantStyle);V("image",Oe);V("inline-heading",Yt);V("mini-compare-chart",Xe,gi,Xe.variantStyle);V("mini-compare-chart-mweb",Ke,xi,Ke.variantStyle);V("plans",te,Zt,te.variantStyle,te.collectionOptions);V("plans-students",te,wi,te.variantStyle,te.collectionOptions);V("plans-education",te,yi,te.variantStyle,te.collectionOptions);V("plans-v2",_e,Si,_e.variantStyle,_e.collectionOptions);V("product",Ze,Ci,Ze.variantStyle);V("segment",Qe,Pi,Qe.variantStyle);V("media",Je,ki,Je.variantStyle);V("headless",at,Hi,at.variantStyle);V("special-offers",et,Ri,et.variantStyle);V("simplified-pricing-express",tt,aa,tt.variantStyle);V("full-pricing-express",rt,ia,rt.variantStyle);V("mini",it,Bi,it.variantStyle);V("image",Oe,di,Oe.variantStyle);function Wt(e){return Fi.get(e)?.fragmentMapping}var Ui="tacocat.js";var oa=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),$i=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function H(e,t={},{metadata:r=!0,search:a=!0,storage:i=!0}={}){let n;if(a&&n==null){let o=new URLSearchParams(window.location.search),s=nt(a)?a:e;n=o.get(s)}if(i&&n==null){let o=nt(i)?i:e;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(r&&n==null){let o=Fs(nt(r)?r:e);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[e]}var Bs=e=>typeof e=="boolean",Jt=e=>typeof e=="function",er=e=>typeof e=="number",Gi=e=>e!=null&&typeof e=="object";var nt=e=>typeof e=="string",qi=e=>nt(e)&&e,St=e=>er(e)&&Number.isFinite(e)&&e>0;function tr(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,a])=>{t(a)&&delete e[r]}),e}function y(e,t){if(Bs(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Tt(e,t,r){let a=Object.values(t);return a.find(i=>oa(i,e))??r??a[0]}function Fs(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,a)=>`${r}-${a}`).replace(/\W+/gu,"-").toLowerCase()}function Vi(e,t=1){return er(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Us=Date.now(),sa=()=>`(+${Date.now()-Us}ms)`,rr=new Set,$s=y(H("tacocat.debug",{},{metadata:!1}),!1);function ji(e){let t=`[${Ui}/${e}]`,r=(o,s,...c)=>o?!0:(i(s,...c),!1),a=$s?(o,...s)=>{console.debug(`${t} ${o}`,...s,sa())}:()=>{},i=(o,...s)=>{let c=`${t} ${o}`;rr.forEach(([l])=>l(c,...s))};return{assert:r,debug:a,error:i,warn:(o,...s)=>{let c=`${t} ${o}`;rr.forEach(([,l])=>l(c,...s))}}}function Gs(e,t){let r=[e,t];return rr.add(r),()=>{rr.delete(r)}}Gs((e,...t)=>{console.error(e,...t,sa())},(e,...t)=>{console.warn(e,...t,sa())});var qs="no promo",Wi="promo-tag",Vs="yellow",js="neutral",Ws=(e,t,r)=>{let a=n=>n||qs,i=r?` (was "${a(t)}")`:"";return`${a(e)}${i}`},Ys="cancel-context",ar=(e,t)=>{let r=e===Ys,a=!r&&e?.length>0,i=(a||r)&&(t&&t!=e||!t&&!r),n=i&&a||!i&&!!t,o=n?e||t:void 0;return{effectivePromoCode:o,overridenPromoCode:e,className:n?Wi:`${Wi} no-promo`,text:Ws(o,t,i),variant:n?Vs:js,isOverriden:i}};var ca;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(ca||(ca={}));var oe;(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"})(oe||(oe={}));var le;(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"})(le||(le={}));var la;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(la||(la={}));var da;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(da||(da={}));var ha;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(ha||(ha={}));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 ma="ABM",ua="PUF",ga="M2M",fa="PERPETUAL",va="P3Y",Xs="TAX_INCLUSIVE_DETAILS",Ks="TAX_EXCLUSIVE",Yi={ABM:ma,PUF:ua,M2M:ga,PERPETUAL:fa,P3Y:va},Op={[ma]:{commitment:oe.YEAR,term:le.MONTHLY},[ua]:{commitment:oe.YEAR,term:le.ANNUAL},[ga]:{commitment:oe.MONTH,term:le.MONTHLY},[fa]:{commitment:oe.PERPETUAL,term:void 0},[va]:{commitment:oe.THREE_MONTHS,term:le.P3Y}},Xi="Value is not an offer",ir=e=>{if(typeof e!="object")return Xi;let{commitment:t,term:r}=e,a=Zs(t,r);return{...e,planType:a}};var Zs=(e,t)=>{switch(e){case void 0:return Xi;case"":return"";case oe.YEAR:return t===le.MONTHLY?ma:t===le.ANNUAL?ua:"";case oe.MONTH:return t===le.MONTHLY?ga:"";case oe.PERPETUAL:return fa;case oe.TERM_LICENSE:return t===le.P3Y?va:"";default:return""}};function Ki(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:a,priceWithoutTax:i,priceWithoutDiscountAndTax:n,taxDisplay:o}=t;if(o!==Xs)return e;let s={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:n??a,taxDisplay:Ks}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var Ie={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},Zi=1e3;function Qs(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function Qi(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:a,originatingRequest:i,status:n}=e;return[a,n,i].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Ie.serializableTypes.includes(r))return r}return e}function Js(e,t){if(!Ie.ignoredProperties.includes(e))return Qi(t)}var xa={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,a=[],i=[],n=t;r.forEach(l=>{l!=null&&(Qs(l)?a:i).push(l)}),a.length&&(n+=" "+a.map(Qi).join(" "));let{pathname:o,search:s}=window.location,c=`${Ie.delimiter}page=${o}${s}`;c.length>Zi&&(c=`${c.slice(0,Zi)}`),n+=c,i.length&&(n+=`${Ie.delimiter}facts=`,n+=JSON.stringify(i,Js)),window.lana?.log(n,Ie)}};function nr(e){Object.assign(Ie,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in Ie&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var Ji={LOCAL:"local",PROD:"prod",STAGE:"stage"},ba={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},ya=new Set,wa=new Set,en=new Map,tn={append({level:e,message:t,params:r,timestamp:a,source:i}){console[e](`${a}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},rn={filter:({level:e})=>e!==ba.DEBUG},ec={filter:()=>!1};function tc(e,t,r,a,i){return{level:e,message:t,namespace:r,get params(){return a.length===1&&Jt(a[0])&&(a=a[0](),Array.isArray(a)||(a=[a])),a},source:i,timestamp:performance.now().toFixed(3)}}function rc(e){[...wa].every(t=>t(e))&&ya.forEach(t=>t(e))}function an(e){let t=(en.get(e)??0)+1;en.set(e,t);let r=`${e} #${t}`,a={id:r,namespace:e,module:i=>an(`${a.namespace}/${i}`),updateConfig:nr};return Object.values(ba).forEach(i=>{a[i]=(n,...o)=>rc(tc(i,n,e,o,r))}),Object.seal(a)}function or(...e){e.forEach(t=>{let{append:r,filter:a}=t;Jt(a)&&wa.add(a),Jt(r)&&ya.add(r)})}function ac(e={}){let{name:t}=e,r=y(H("commerce.debug",{search:!0,storage:!0}),t===Ji.LOCAL);return or(r?tn:rn),t===Ji.PROD&&or(xa),re}function ic(){ya.clear(),wa.clear()}var re={...an(Ur),Level:ba,Plugins:{consoleAppender:tn,debugFilter:rn,quietFilter:ec,lanaAppender:xa},init:ac,reset:ic,use:or};var nc="mas-commerce-service",oc=re.module("utilities"),sc={requestId:vt,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function Ct(e,{country:t,forceTaxExclusive:r}){let a;if(e.length<2)a=e;else{let i=t==="GB"?"EN":"MULT";e.sort((n,o)=>n.language===i?-1:o.language===i?1:0),e.sort((n,o)=>!n.term&&o.term?-1:n.term&&!o.term?1:0),a=[e[0]]}return r&&(a=a.map(Ki)),a}var nn=(e,t)=>{let r=e.reduce((a,i)=>a+(t(i)||0),0);return r>0?Math.round(r*100)/100:void 0};function Ea(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&&oc.warn(`Offers have different ${d}, summing may produce unexpected results`,{expected:p,actual:u})}}let a=[["price",s=>s.priceDetails?.price],["priceWithoutDiscount",s=>s.priceDetails?.priceWithoutDiscount],["priceWithoutTax",s=>s.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",s=>s.priceDetails?.priceWithoutDiscountAndTax]],i={};for(let[s,c]of a){let l=nn(e,c);l!==void 0&&(i[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=nn(e,l);d!==void 0&&(o[c]=d)}}return{...t,offerSelectorIds:e.flatMap(s=>s.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...i,...o&&{annualized:o}}}}var sr=e=>window.setTimeout(e);function ot(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Vi).filter(St);return r.length||(r=[t]),r}function cr(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(qi)}function ae(){return document.getElementsByTagName(nc)?.[0]}function on(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[a,i]of Object.entries(sc)){let n=r.get(i);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[a]=n)}return t}var st=class e extends Error{constructor(t,r,a){if(super(t,{cause:a}),this.name="MasError",r.response){let i=r.response.headers?.get(vt);i&&(r.requestId=i),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(([a,i])=>`${a}: ${JSON.stringify(i)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` + `);var Fi=new Map;var V=(e,t,r=null,a=null,i)=>{Fi.set(e,{class:t,fragmentMapping:r,style:a,collectionOptions:i})};V("catalog",Ye,ci,Ye.variantStyle);V("image",Oe);V("inline-heading",Yt);V("mini-compare-chart",Xe,gi,Xe.variantStyle);V("mini-compare-chart-mweb",Ke,xi,Ke.variantStyle);V("plans",te,Zt,te.variantStyle,te.collectionOptions);V("plans-students",te,wi,te.variantStyle,te.collectionOptions);V("plans-education",te,yi,te.variantStyle,te.collectionOptions);V("plans-v2",_e,Si,_e.variantStyle,_e.collectionOptions);V("product",Ze,Ci,Ze.variantStyle);V("segment",Qe,Pi,Qe.variantStyle);V("media",Je,ki,Je.variantStyle);V("headless",at,Hi,at.variantStyle);V("special-offers",et,Ri,et.variantStyle);V("simplified-pricing-express",tt,aa,tt.variantStyle);V("full-pricing-express",rt,ia,rt.variantStyle);V("mini",it,Bi,it.variantStyle);V("image",Oe,di,Oe.variantStyle);function Wt(e){return Fi.get(e)?.fragmentMapping}var Ui="tacocat.js";var oa=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),$i=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function H(e,t={},{metadata:r=!0,search:a=!0,storage:i=!0}={}){let n;if(a&&n==null){let o=new URLSearchParams(window.location.search),s=nt(a)?a:e;n=o.get(s)}if(i&&n==null){let o=nt(i)?i:e;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(r&&n==null){let o=Fs(nt(r)?r:e);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[e]}var Bs=e=>typeof e=="boolean",Jt=e=>typeof e=="function",er=e=>typeof e=="number",Gi=e=>e!=null&&typeof e=="object";var nt=e=>typeof e=="string",qi=e=>nt(e)&&e,St=e=>er(e)&&Number.isFinite(e)&&e>0;function tr(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,a])=>{t(a)&&delete e[r]}),e}function y(e,t){if(Bs(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Tt(e,t,r){let a=Object.values(t);return a.find(i=>oa(i,e))??r??a[0]}function Fs(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,a)=>`${r}-${a}`).replace(/\W+/gu,"-").toLowerCase()}function Vi(e,t=1){return er(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Us=Date.now(),sa=()=>`(+${Date.now()-Us}ms)`,rr=new Set,$s=y(H("tacocat.debug",{},{metadata:!1}),!1);function ji(e){let t=`[${Ui}/${e}]`,r=(o,s,...c)=>o?!0:(i(s,...c),!1),a=$s?(o,...s)=>{console.debug(`${t} ${o}`,...s,sa())}:()=>{},i=(o,...s)=>{let c=`${t} ${o}`;rr.forEach(([l])=>l(c,...s))};return{assert:r,debug:a,error:i,warn:(o,...s)=>{let c=`${t} ${o}`;rr.forEach(([,l])=>l(c,...s))}}}function Gs(e,t){let r=[e,t];return rr.add(r),()=>{rr.delete(r)}}Gs((e,...t)=>{console.error(e,...t,sa())},(e,...t)=>{console.warn(e,...t,sa())});var qs="no promo",Wi="promo-tag",Vs="yellow",js="neutral",Ws=(e,t,r)=>{let a=n=>n||qs,i=r?` (was "${a(t)}")`:"";return`${a(e)}${i}`},Ys="cancel-context",ar=(e,t)=>{let r=e===Ys,a=!r&&e?.length>0,i=(a||r)&&(t&&t!=e||!t&&!r),n=i&&a||!i&&!!t,o=n?e||t:void 0;return{effectivePromoCode:o,overridenPromoCode:e,className:n?Wi:`${Wi} no-promo`,text:Ws(o,t,i),variant:n?Vs:js,isOverriden:i}};var ca;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(ca||(ca={}));var oe;(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"})(oe||(oe={}));var le;(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"})(le||(le={}));var la;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(la||(la={}));var da;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(da||(da={}));var ha;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(ha||(ha={}));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 ma="ABM",ua="PUF",ga="M2M",fa="PERPETUAL",va="P3Y",Xs="TAX_INCLUSIVE_DETAILS",Ks="TAX_EXCLUSIVE",Yi={ABM:ma,PUF:ua,M2M:ga,PERPETUAL:fa,P3Y:va},Dp={[ma]:{commitment:oe.YEAR,term:le.MONTHLY},[ua]:{commitment:oe.YEAR,term:le.ANNUAL},[ga]:{commitment:oe.MONTH,term:le.MONTHLY},[fa]:{commitment:oe.PERPETUAL,term:void 0},[va]:{commitment:oe.THREE_MONTHS,term:le.P3Y}},Xi="Value is not an offer",ir=e=>{if(typeof e!="object")return Xi;let{commitment:t,term:r}=e,a=Zs(t,r);return{...e,planType:a}};var Zs=(e,t)=>{switch(e){case void 0:return Xi;case"":return"";case oe.YEAR:return t===le.MONTHLY?ma:t===le.ANNUAL?ua:"";case oe.MONTH:return t===le.MONTHLY?ga:"";case oe.PERPETUAL:return fa;case oe.TERM_LICENSE:return t===le.P3Y?va:"";default:return""}};function Ki(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:a,priceWithoutTax:i,priceWithoutDiscountAndTax:n,taxDisplay:o}=t;if(o!==Xs)return e;let s={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:n??a,taxDisplay:Ks}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var Ie={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},Zi=1e3;function Qs(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function Qi(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:a,originatingRequest:i,status:n}=e;return[a,n,i].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Ie.serializableTypes.includes(r))return r}return e}function Js(e,t){if(!Ie.ignoredProperties.includes(e))return Qi(t)}var xa={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,a=[],i=[],n=t;r.forEach(l=>{l!=null&&(Qs(l)?a:i).push(l)}),a.length&&(n+=" "+a.map(Qi).join(" "));let{pathname:o,search:s}=window.location,c=`${Ie.delimiter}page=${o}${s}`;c.length>Zi&&(c=`${c.slice(0,Zi)}`),n+=c,i.length&&(n+=`${Ie.delimiter}facts=`,n+=JSON.stringify(i,Js)),window.lana?.log(n,Ie)}};function nr(e){Object.assign(Ie,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in Ie&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var Ji={LOCAL:"local",PROD:"prod",STAGE:"stage"},ba={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},ya=new Set,wa=new Set,en=new Map,tn={append({level:e,message:t,params:r,timestamp:a,source:i}){console[e](`${a}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},rn={filter:({level:e})=>e!==ba.DEBUG},ec={filter:()=>!1};function tc(e,t,r,a,i){return{level:e,message:t,namespace:r,get params(){return a.length===1&&Jt(a[0])&&(a=a[0](),Array.isArray(a)||(a=[a])),a},source:i,timestamp:performance.now().toFixed(3)}}function rc(e){[...wa].every(t=>t(e))&&ya.forEach(t=>t(e))}function an(e){let t=(en.get(e)??0)+1;en.set(e,t);let r=`${e} #${t}`,a={id:r,namespace:e,module:i=>an(`${a.namespace}/${i}`),updateConfig:nr};return Object.values(ba).forEach(i=>{a[i]=(n,...o)=>rc(tc(i,n,e,o,r))}),Object.seal(a)}function or(...e){e.forEach(t=>{let{append:r,filter:a}=t;Jt(a)&&wa.add(a),Jt(r)&&ya.add(r)})}function ac(e={}){let{name:t}=e,r=y(H("commerce.debug",{search:!0,storage:!0}),t===Ji.LOCAL);return or(r?tn:rn),t===Ji.PROD&&or(xa),re}function ic(){ya.clear(),wa.clear()}var re={...an(Ur),Level:ba,Plugins:{consoleAppender:tn,debugFilter:rn,quietFilter:ec,lanaAppender:xa},init:ac,reset:ic,use:or};var nc="mas-commerce-service",oc=re.module("utilities"),sc={requestId:vt,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function Ct(e,{country:t,forceTaxExclusive:r}){let a;if(e.length<2)a=e;else{let i=t==="GB"?"EN":"MULT";e.sort((n,o)=>n.language===i?-1:o.language===i?1:0),e.sort((n,o)=>!n.term&&o.term?-1:n.term&&!o.term?1:0),a=[e[0]]}return r&&(a=a.map(Ki)),a}var nn=(e,t)=>{let r=e.reduce((a,i)=>a+(t(i)||0),0);return r>0?Math.round(r*100)/100:void 0};function Ea(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&&oc.warn(`Offers have different ${d}, summing may produce unexpected results`,{expected:p,actual:u})}}let a=[["price",s=>s.priceDetails?.price],["priceWithoutDiscount",s=>s.priceDetails?.priceWithoutDiscount],["priceWithoutTax",s=>s.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",s=>s.priceDetails?.priceWithoutDiscountAndTax]],i={};for(let[s,c]of a){let l=nn(e,c);l!==void 0&&(i[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=nn(e,l);d!==void 0&&(o[c]=d)}}return{...t,offerSelectorIds:e.flatMap(s=>s.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...i,...o&&{annualized:o}}}}var sr=e=>window.setTimeout(e);function ot(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Vi).filter(St);return r.length||(r=[t]),r}function cr(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(qi)}function ae(){return document.getElementsByTagName(nc)?.[0]}function on(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[a,i]of Object.entries(sc)){let n=r.get(i);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[a]=n)}return t}var st=class e extends Error{constructor(t,r,a){if(super(t,{cause:a}),this.name="MasError",r.response){let i=r.response.headers?.get(vt);i&&(r.requestId=i),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(([a,i])=>`${a}: ${JSON.stringify(i)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` Caused by: ${this.cause}`),r}};var cc={[he]:Or,[Se]:Ir,[ve]:Dr},lc={[he]:Br,[ve]:Fr},_t,Pe=class{constructor(t){G(this,_t);f(this,"changes",new Map);f(this,"connected",!1);f(this,"error");f(this,"log");f(this,"options");f(this,"promises",[]);f(this,"state",Se);f(this,"timer",null);f(this,"value");f(this,"version",0);f(this,"wrapperElement");this.wrapperElement=t,this.log=re.module("mas-element")}update(){[he,Se,ve].forEach(t=>{this.wrapperElement.classList.toggle(cc[t],t===this.state)})}notify(){(this.state===ve||this.state===he)&&(this.state===ve?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===he&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof st&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(lc[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,r,a){this.changes.set(t,a),this.requestUpdate()}connectedCallback(){W(this,_t,ae()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:r,state:a}=this;return ve===a?Promise.resolve(this.wrapperElement):he===a?Promise.reject(t):new Promise((i,n)=>{r.push({resolve:i,reject:n})})}toggleResolved(t,r,a){return t!==this.version?!1:(a!==void 0&&(this.options=a),this.state=ve,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),sr(()=>this.notify()),!0)}toggleFailed(t,r,a){if(t!==this.version)return!1;a!==void 0&&(this.options=a),this.error=r,this.state=he,this.update();let i=this.wrapperElement.getAttribute("is");return this.log?.error(`${i}: Failed to render: ${r.message}`,{element:this.wrapperElement,...r.context,...T(this,_t)?.duration}),sr(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=Se,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!ae()||this.timer)return;let{error:r,options:a,state:i,value:n,version:o}=this;this.state=Se,this.timer=sr(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===Se&&this.version===o&&(this.state=i,this.error=r,this.value=n,this.update(),this.notify())}catch(c){this.toggleFailed(this.version,c,a)}})}};_t=new WeakMap;function sn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function lr(e,t={}){let{tag:r,is:a}=e,i=document.createElement(r,{is:a});return i.setAttribute("is",a),Object.assign(i.dataset,sn(t)),i}function cn(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,sn(t)),e):null}function dc(e){return`https://${e==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var ze,De=class De extends HTMLAnchorElement{constructor(){super();f(this,"masElement",new Pe(this));G(this,ze);this.setAttribute("is",De.is)}get isUptLink(){return!0}initializeWcsData(r,a){this.setAttribute("data-wcs-osi",r),a&&this.setAttribute("data-promotion-code",a)}attributeChangedCallback(r,a,i){this.masElement.attributeChangedCallback(r,a,i)}connectedCallback(){this.masElement.connectedCallback(),W(this,ze,bt()),T(this,ze)&&(this.log=T(this,ze).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),W(this,ze,void 0)}requestUpdate(r=!1){this.masElement.requestUpdate(r)}onceSettled(){return this.masElement.onceSettled()}async render(){let r=bt();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let a=r.collectCheckoutOptions({},this);if(!a.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let i=this.masElement.togglePending(a),n=r.resolveOfferSelectors(a);try{let[[o]]=await Promise.all(n),{country:s,language:c,env:l}=a,d=`locale=${c}_${s}&country=${s}&offer_id=${o.offerId}`,p=this.getAttribute("data-promotion-code");p&&(d+=`&promotion_code=${encodeURIComponent(p)}`),this.href=`${dc(l)}?${d}`,this.masElement.toggleResolved(i,o,a)}catch(o){let s=new Error(`Could not resolve offer selectors for id: ${a.wcsOsi}.`,o.message);return this.masElement.toggleFailed(i,s,a),!1}}static createFrom(r){let a=new De;for(let i of r.attributes)i.name!=="is"&&(i.name==="class"&&i.value.includes("upt-link")?a.setAttribute("class",i.value.replace("upt-link","").trim()):a.setAttribute(i.name,i.value));return a.innerHTML=r.innerHTML,a.setAttribute("tabindex",0),a}};ze=new WeakMap,f(De,"is","upt-link"),f(De,"tag","a"),f(De,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var He=De;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.tag});function ln(e){return e&&(e.startsWith("plans")?"plans":e)}var hc=/[0-9\-+#]/,pc=/[^\d\-+#]/g;function dn(e){return e.search(hc)}function mc(e="#.##"){let t={},r=e.length,a=dn(e);t.prefix=a>0?e.substring(0,a):"";let i=dn(e.split("").reverse().join("")),n=r-i,o=e.substring(n,n+1),s=n+(o==="."||o===","?1:0);t.suffix=i>0?e.substring(s,r):"",t.mask=e.substring(a,s),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(pc);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 uc(e,t,r){let a=!1,i={value:e};e<0&&(a=!0,i.value=-i.value),i.sign=a?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let n=t.fraction&&t.fraction.lastIndexOf("0"),[o="0",s=""]=i.value.split(".");return(!s||s&&s.length<=n)&&(s=n<0?"":(+("0."+s)).toFixed(n+1).replace("0.","")),i.integer=o,i.fraction=s,gc(i,t),(i.result==="0"||i.result==="")&&(a=!1,i.sign=""),!a&&t.maskHasPositiveSign?i.sign="+":a&&t.maskHasPositiveSign?i.sign="-":a&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function gc(e,t){e.result="";let r=t.integer.split(t.separator),a=r.join(""),i=a&&a.indexOf("0");if(i>-1)for(;e.integer.lengthe*12,Fe=(e,t,r=1)=>{if(!e)return!1;let{start:a,end:i,displaySummary:{amount:n,duration:o,minProductQuantity:s=1,outcomeType:c}={}}=e;if(!(n&&o&&c)||r=d&&l<=p},Be={MONTH:"MONTH",YEAR:"YEAR"},xc={[ce.ANNUAL]:12,[ce.MONTHLY]:1,[ce.THREE_YEARS]:36,[ce.TWO_YEARS]:24},Sa=(e,t)=>({accept:e,round:t}),bc=[Sa(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),Sa(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),Sa(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],Ta={[Re.YEAR]:{[ce.MONTHLY]:Be.MONTH,[ce.ANNUAL]:Be.YEAR},[Re.MONTH]:{[ce.MONTHLY]:Be.MONTH}},yc=(e,t)=>e.indexOf(`'${t}'`)===0,wc=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),a=vn(r);return!!a?t||(r=r.replace(/[,\.]0+/,a)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+Ac(e)),r},Ec=e=>{let t=Sc(e),r=yc(e,t),a=e.replace(/'.*?'/,""),i=un.test(a)||gn.test(a);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},fn=e=>e.replace(un,mn).replace(gn,mn),Ac=e=>e.match(/#(.?)#/)?.[1]===pn?vc:pn,Sc=e=>e.match(/'(.*?)'/)?.[1]??"",vn=e=>e.match(/0(.?)0/)?.[1]??"";function ct({formatString:e,price:t,usePrecision:r,isIndianPrice:a=!1},i,n=o=>o){let{currencySymbol:o,isCurrencyFirst:s,hasCurrencySpace:c}=Ec(e),l=r?vn(e):"",d=wc(e,r),p=r?2:0,u=n(t,{currencySymbol:o}),h=a?u.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):hn(d,u),m=r?h.lastIndexOf(l):h.length,g=h.substring(0,m),x=h.substring(m+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,h).replace(/SYMBOL/,o),currencySymbol:o,decimals:x,decimalsDelimiter:l,hasCurrencySpace:c,integer:g,isCurrencyFirst:s,recurrenceTerm:i}}var xn=e=>{let{commitment:t,term:r,usePrecision:a}=e,i=xc[r]??1;return ct(e,i>1?Be.MONTH:Ta[t]?.[r],n=>{let o={divisor:i,price:n,usePrecision:a},{round:s}=bc.find(({accept:c})=>c(o));if(!s)throw new Error(`Missing rounding rule for: ${JSON.stringify(o)}`);return s(o)})},bn=({commitment:e,term:t,...r})=>ct(r,Ta[e]?.[t]),yn=e=>{let{commitment:t,instant:r,price:a,originalPrice:i,priceWithoutDiscount:n,promotion:o,quantity:s=1,term:c}=e;if(t===Re.YEAR&&c===ce.MONTHLY){if(!o)return ct(e,Be.YEAR,Aa);let{displaySummary:{outcomeType:l,duration:d}={}}=o;switch(l){case"PERCENTAGE_DISCOUNT":if(Fe(o,r,s)){let p=parseInt(d.replace("P","").replace("M",""));if(isNaN(p))return Aa(a);let u=i*p,h=n*(12-p),m=Math.round((u+h)*100)/100;return ct({...e,price:m},Be.YEAR)}default:return ct(e,Be.YEAR,()=>Aa(n??a))}}return ct(e,Ta[t]?.[c])};var wn="download",En="upgrade",An={e:"EDU",t:"TEAM"};function Sn(e,t={},r=""){let a=ae();if(!a)return null;let{checkoutMarketSegment:i,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:p,quantity:u,wcsOsi:h,extraOptions:m,analyticsId:g}=a.collectCheckoutOptions(t),x=lr(e,{checkoutMarketSegment:i,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:p,quantity:u,wcsOsi:h,extraOptions:m,analyticsId:g});return r&&(x.innerHTML=`${r}`),x}function Tn(e){return class extends e{constructor(){super(...arguments);f(this,"checkoutActionHandler");f(this,"masElement",new Pe(this))}attributeChangedCallback(a,i,n){this.masElement.attributeChangedCallback(a,i,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 a=this.options?.ms??this.value?.[0].marketSegments?.[0];return An[a]??a}get customerSegment(){let a=this.options?.cs??this.value?.[0]?.customerSegment;return An[a]??a}get is3in1Modal(){return Object.values(Ne).includes(this.getAttribute("data-modal"))}get isOpen3in1Modal(){let a=document.querySelector("meta[name=mas-ff-3in1]");return this.is3in1Modal&&(!a||a.content!=="off")}requestUpdate(a=!1){return this.masElement.requestUpdate(a)}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(a={}){let i=ae();if(!i)return!1;this.dataset.imsCountry||i.imsCountryPromise.then(h=>{h&&(this.dataset.imsCountry=h)}),a.imsCountry=null;let n=i.collectCheckoutOptions(a,this);if(!n.wcsOsi.length)return!1;let o;try{o=JSON.parse(n.extraOptions??"{}")}catch(h){this.masElement.log?.error("cannot parse exta checkout options",h)}let s=this.masElement.togglePending(n);this.setCheckoutUrl("");let c=i.resolveOfferSelectors(n),l=await Promise.all(c);l=l.map(h=>Ct(h,n));let d=l.flat().find(h=>h.promotion);!Fe(d?.promotion,d?.promotion?.displaySummary?.instant,n.quantity[0])&&n.promotionCode&&delete n.promotionCode,n.country=this.dataset.imsCountry||n.country;let u=await i.buildCheckoutAction?.(l.flat(),{...o,...n},this);return this.renderOffers(l.flat(),n,{},u,s)}renderOffers(a,i,n={},o=void 0,s=void 0){let c=ae();if(!c)return!1;if(i={...JSON.parse(this.dataset.extraOptions??"{}"),...i,...n},s??(s=this.masElement.togglePending(i)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),o){this.classList.remove(wn,En),this.masElement.toggleResolved(s,a,i);let{url:d,text:p,className:u,handler:h}=o;d&&this.setCheckoutUrl(d),p&&(this.firstElementChild.innerHTML=p),u&&this.classList.add(...u.split(" ")),h&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=h.bind(this))}if(a.length){if(this.masElement.toggleResolved(s,a,i)){if(!this.classList.contains(wn)&&!this.classList.contains(En)){let d=c.buildCheckoutURL(a,i);this.setCheckoutUrl(i.modal==="true"?"#":d)}return!0}}else{let d=new Error(`Not provided: ${i?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(s,d,i))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(a){}updateOptions(a={}){let i=ae();if(!i)return!1;let{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:p,promotionCode:u,quantity:h,wcsOsi:m}=i.collectCheckoutOptions(a);return cn(this,{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:p,promotionCode:u,quantity:h,wcsOsi:m}),!0}}}var Pt=class Pt extends Tn(HTMLAnchorElement){static createCheckoutLink(t={},r=""){return Sn(Pt,t,r)}setCheckoutUrl(t){this.setAttribute("href",t)}get isCheckoutLink(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}}};f(Pt,"is","checkout-link"),f(Pt,"tag","a");var ye=Pt;window.customElements.get(ye.is)||window.customElements.define(ye.is,ye,{extends:ye.tag});var Tc="p_draft_landscape",Cc="/store/",_c=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"]]),Ca=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"]),Pc=["env","workflowStep","clientId","country"],Cn=new Set(["gid","gtoken","notifauditid","cohortid","productname","sdid","attimer","gcsrc","gcprog","gcprogcat","gcpagetype","mv","mv2"]),_n=e=>_c.get(e)??e;function dr(e,t,r){for(let[a,i]of Object.entries(e)){let n=_n(a);i!=null&&r.has(n)&&t.set(n,i)}}function Lc(e){switch(e){case Wr.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function kc(e,t){for(let r in e){let a=e[r];for(let[i,n]of Object.entries(a)){if(n==null)continue;let o=_n(i);t.set(`items[${r}][${o}]`,n)}}}function Mc({url:e,modal:t,is3in1:r}){if(!r||!e?.searchParams)return e;e.searchParams.set("rtc","t"),e.searchParams.set("lo","sl");let a=e.searchParams.get("af");return e.searchParams.set("af",[a,"uc_new_user_iframe","uc_new_system_close"].filter(Boolean).join(",")),e.searchParams.get("cli")!=="doc_cloud"&&e.searchParams.set("cli",t===Ne.CRM?"creative":"mini_plans"),e}function Rc(e){let t=new URLSearchParams(window.location.search),r={};Cn.forEach(a=>{let i=t.get(a);i!==null&&(r[a]=i)}),Object.keys(r).length>0&&dr(r,e.searchParams,Cn)}function Pn(e){Nc(e);let{env:t,items:r,workflowStep:a,marketSegment:i,customerSegment:n,offerType:o,productArrangementCode:s,landscape:c,modal:l,is3in1:d,preselectPlan:p,...u}=e,h=new URL(Lc(t));if(h.pathname=`${Cc}${a}`,a!==ee.SEGMENTATION&&a!==ee.CHANGE_PLAN_TEAM_PLANS&&kc(r,h.searchParams),dr({...u},h.searchParams,Ca),Rc(h),c===Te.DRAFT&&dr({af:Tc},h.searchParams,Ca),a===ee.SEGMENTATION){let m={marketSegment:i,offerType:o,customerSegment:n,productArrangementCode:s,quantity:r?.[0]?.quantity,addonProductArrangementCode:s?r?.find(g=>g.productArrangementCode!==s)?.productArrangementCode:r?.[1]?.productArrangementCode};p?.toLowerCase()==="edu"?h.searchParams.set("ms","EDU"):p?.toLowerCase()==="team"&&h.searchParams.set("cs","TEAM"),dr(m,h.searchParams,Ca),h.searchParams.get("ot")==="PROMOTION"&&h.searchParams.delete("ot"),h=Mc({url:h,modal:l,is3in1:d})}return h.toString()}function Nc(e){for(let t of Pc)if(!e[t])throw new Error(`Argument "checkoutData" is not valid, missing: ${t}`);if(e.workflowStep!==ee.SEGMENTATION&&e.workflowStep!==ee.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}var k=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflowStep:ee.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,displayPlanType:!1,env:ge.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:Te.PUBLISHED});function Ln({settings:e,providers:t}){function r(n,o){let{checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:p,quantity:u,preselectPlan:h,env:m}=e,g={checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:p,quantity:u,preselectPlan:h,env:m};if(o)for(let qe of t.checkout)qe(o,g);let{checkoutMarketSegment:x,checkoutWorkflowStep:b=c,imsCountry:E,country:v=E??l,language:A=d,quantity:N=u,entitlement:M,upgrade:z,modal:$,perpetual:Q,promotionCode:j=p,wcsOsi:F,extraOptions:R,...J}=Object.assign(g,o?.dataset??{},n??{}),se=Tt(b,ee,k.checkoutWorkflowStep);return g=tr({...J,extraOptions:R,checkoutClientId:s,checkoutMarketSegment:x,country:v,quantity:ot(N,k.quantity),checkoutWorkflowStep:se,language:A,entitlement:y(M),upgrade:y(z),modal:$,perpetual:y(Q),promotionCode:ar(j).effectivePromoCode,wcsOsi:cr(F),preselectPlan:h}),g}function a(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:h,quantity:m,preselectPlan:g,ms:x,cs:b,...E}=r(o),v=document.querySelector("meta[name=mas-ff-3in1]"),A=Object.values(Ne).includes(o.modal)&&(!v||v.content!=="off"),N=window.frameElement||A?"if":"fp",[{productArrangementCode:M,marketSegments:[z],customerSegment:$,offerType:Q}]=n,j=x??z??d,F=b??$;g?.toLowerCase()==="edu"?j="EDU":g?.toLowerCase()==="team"&&(F="TEAM");let R={is3in1:A,checkoutPromoCode:h,clientId:l,context:N,country:u,env:s,items:[],marketSegment:j,customerSegment:F,offerType:Q,productArrangementCode:M,workflowStep:p,landscape:c,...E},J=m[0]>1?m[0]:void 0;if(n.length===1){let{offerId:se}=n[0];R.items.push({id:se,quantity:J})}else R.items.push(...n.map(({offerId:se,productArrangementCode:qe})=>({id:se,quantity:J,...A?{productArrangementCode:qe}:{}})));return Pn(R)}let{createCheckoutLink:i}=ye;return{CheckoutLink:ye,CheckoutWorkflowStep:ee,buildCheckoutURL:a,collectCheckoutOptions:r,createCheckoutLink:i}}function Oc({interval:e=200,maxAttempts:t=25}={}){let r=re.module("ims");return new Promise(a=>{r.debug("Waing for IMS to be ready");let i=0;function n(){window.adobeIMS?.initialized?a():++i>t?(r.debug("Timeout"),a()):setTimeout(n,e)}n()})}function Ic(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function Dc(e){let t=re.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:a})=>(t.debug("Got user country:",a),a),a=>{t.error("Unable to get user country:",a)}):null)}function kn({}){let e=Oc(),t=Ic(e),r=Dc(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}var Mn=window.masPriceLiterals;function Rn(e){if(Array.isArray(Mn)){let t=e.locale==="id_ID"?"in":e.language,r=i=>Mn.find(n=>oa(n.lang,i)),a=r(t)??r(k.language);if(a)return Object.freeze(a)}return{}}var _a=function(e,t){return _a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(r[i]=a[i])},_a(e,t)};function Lt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");_a(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var _=function(){return _=Object.assign||function(t){for(var r,a=1,i=arguments.length;a0}),r=[],a=0,i=t;a1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Bc,function(c,l,d,p,u,h){if(l)t.minimumIntegerDigits=d.length;else{if(p&&u)throw new Error("We currently do not support maximum integer digits");if(h)throw new Error("We currently do not support exact integer digits")}return""});continue}if($n.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Hn.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Hn,function(c,l,d,p,u,h){return d==="*"?t.minimumFractionDigits=l.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:u&&h?(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length+h.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var n=i.options[0];n==="w"?t=_(_({},t),{trailingZeroDisplay:"stripIfInteger"}):n&&(t=_(_({},t),zn(n)));continue}if(Un.test(i.stem)){t=_(_({},t),zn(i.stem));continue}var o=Gn(i.stem);o&&(t=_(_({},t),o));var s=Fc(i.stem);s&&(t=_(_({},t),s))}return t}var Mt={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 Vn(e,t){for(var r="",a=0;a>1),c="a",l=Uc(t);for((l=="H"||l=="k")&&(s=0);s-- >0;)r+=c;for(;o-- >0;)r=l+r}else i==="J"?r+="H":r+=i}return r}function Uc(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,a;r!=="root"&&(a=e.maximize().region);var i=Mt[a||""]||Mt[r||""]||Mt["".concat(r,"-001")]||Mt["001"];return i[0]}var ka,$c=new RegExp("^".concat(La.source,"*")),Gc=new RegExp("".concat(La.source,"*$"));function P(e,t){return{start:e,end:t}}var qc=!!String.prototype.startsWith,Vc=!!String.fromCodePoint,jc=!!Object.fromEntries,Wc=!!String.prototype.codePointAt,Yc=!!String.prototype.trimStart,Xc=!!String.prototype.trimEnd,Kc=!!Number.isSafeInteger,Zc=Kc?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ra=!0;try{jn=Kn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ra=((ka=jn.exec("a"))===null||ka===void 0?void 0:ka[0])==="a"}catch{Ra=!1}var jn,Wn=qc?function(t,r,a){return t.startsWith(r,a)}:function(t,r,a){return t.slice(a,a+r.length)===r},Na=Vc?String.fromCodePoint:function(){for(var t=[],r=0;rn;){if(o=t[n++],o>1114111)throw RangeError(o+" is not a valid code point");a+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return a},Yn=jc?Object.fromEntries:function(t){for(var r={},a=0,i=t;a=a)){var i=t.charCodeAt(r),n;return i<55296||i>56319||r+1===a||(n=t.charCodeAt(r+1))<56320||n>57343?i:(i-55296<<10)+(n-56320)+65536}},Qc=Yc?function(t){return t.trimStart()}:function(t){return t.replace($c,"")},Jc=Xc?function(t){return t.trimEnd()}:function(t){return t.replace(Gc,"")};function Kn(e,t){return new RegExp(e,t)}var Oa;Ra?(Ma=Kn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Oa=function(t,r){var a;Ma.lastIndex=r;var i=Ma.exec(t);return(a=i[1])!==null&&a!==void 0?a:""}):Oa=function(t,r){for(var a=[];;){var i=Xn(t,r);if(i===void 0||Qn(i)||rl(i))break;a.push(i),r+=i>=65536?2:1}return Na.apply(void 0,a)};var Ma,Zn=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,a){for(var i=[];!this.isEOF();){var n=this.char();if(n===123){var o=this.parseArgument(t,a);if(o.err)return o;i.push(o.val)}else{if(n===125&&t>0)break;if(n===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),i.push({type:D.pound,location:P(s,this.clonePosition())})}else if(n===60&&!this.ignoreTag&&this.peek()===47){if(a)break;return this.error(w.UNMATCHED_CLOSING_TAG,P(this.clonePosition(),this.clonePosition()))}else if(n===60&&!this.ignoreTag&&Ia(this.peek()||0)){var o=this.parseTag(t,r);if(o.err)return o;i.push(o.val)}else{var o=this.parseLiteral(t,r);if(o.err)return o;i.push(o.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var a=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:D.literal,value:"<".concat(i,"/>"),location:P(a,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:D.tag,value:i,children:o,location:P(a,this.clonePosition())},err:null}:this.error(w.INVALID_TAG,P(s,this.clonePosition())))}else return this.error(w.UNCLOSED_TAG,P(a,this.clonePosition()))}else return this.error(w.INVALID_TAG,P(a,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&tl(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var a=this.clonePosition(),i="";;){var n=this.tryParseQuote(r);if(n){i+=n;continue}var o=this.tryParseUnquoted(t,r);if(o){i+=o;continue}var s=this.tryParseLeftAngleBracket();if(s){i+=s;continue}break}var c=P(a,this.clonePosition());return{val:{type:D.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!el(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 a=this.char();if(a===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(a);this.bump()}return Na.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var a=this.char();return a===60||a===123||a===35&&(r==="plural"||r==="selectordinal")||a===125&&t>0?null:(this.bump(),Na(a))},e.prototype.parseArgument=function(t,r){var a=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,P(a,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(w.EMPTY_ARGUMENT,P(a,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(w.MALFORMED_ARGUMENT,P(a,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,P(a,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:D.argument,value:i,location:P(a,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,P(a,this.clonePosition())):this.parseArgumentOptions(t,r,i,a);default:return this.error(w.MALFORMED_ARGUMENT,P(a,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),a=Oa(this.message,r),i=r+a.length;this.bumpTo(i);var n=this.clonePosition(),o=P(t,n);return{value:a,location:o}},e.prototype.parseArgumentOptions=function(t,r,a,i){var n,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(s){case"":return this.error(w.EXPECT_ARGUMENT_TYPE,P(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=Jc(p.val);if(u.length===0)return this.error(w.EXPECT_ARGUMENT_STYLE,P(this.clonePosition(),this.clonePosition()));var h=P(d,this.clonePosition());l={style:u,styleLocation:h}}var m=this.tryParseArgumentClose(i);if(m.err)return m;var g=P(i,this.clonePosition());if(l&&Wn(l?.style,"::",0)){var x=Qc(l.style.slice(2));if(s==="number"){var p=this.parseNumberSkeletonFromString(x,l.styleLocation);return p.err?p:{val:{type:D.number,value:a,location:g,style:p.val},err:null}}else{if(x.length===0)return this.error(w.EXPECT_DATE_TIME_SKELETON,g);var b=x;this.locale&&(b=Vn(x,this.locale));var u={type:Ue.dateTime,pattern:b,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?In(b):{}},E=s==="date"?D.date:D.time;return{val:{type:E,value:a,location:g,style:u},err:null}}}return{val:{type:s==="number"?D.number:s==="date"?D.date:D.time,value:a,location:g,style:(n=l?.style)!==null&&n!==void 0?n:null},err:null}}case"plural":case"selectordinal":case"select":{var v=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(w.EXPECT_SELECT_ARGUMENT_OPTIONS,P(v,_({},v)));this.bumpSpace();var A=this.parseIdentifierIfPossible(),N=0;if(s!=="select"&&A.value==="offset"){if(!this.bumpIf(":"))return this.error(w.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,P(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(w.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,w.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),A=this.parseIdentifierIfPossible(),N=p.val}var M=this.tryParsePluralOrSelectOptions(t,s,r,A);if(M.err)return M;var m=this.tryParseArgumentClose(i);if(m.err)return m;var z=P(i,this.clonePosition());return s==="select"?{val:{type:D.select,value:a,options:Yn(M.val),location:z},err:null}:{val:{type:D.plural,value:a,options:Yn(M.val),offset:N,pluralType:s==="plural"?"cardinal":"ordinal",location:z},err:null}}default:return this.error(w.INVALID_ARGUMENT_TYPE,P(o,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,P(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var a=this.char();switch(a){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(w.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,P(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var a=[];try{a=Fn(t)}catch{return this.error(w.INVALID_NUMBER_SKELETON,r)}return{val:{type:Ue.number,tokens:a,location:r,parsedOptions:this.shouldParseSkeletons?qn(a):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,a,i){for(var n,o=!1,s=[],c=new Set,l=i.value,d=i.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var u=this.tryParseDecimalInteger(w.EXPECT_PLURAL_ARGUMENT_SELECTOR,w.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;d=P(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?w.DUPLICATE_SELECT_ARGUMENT_SELECTOR:w.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);l==="other"&&(o=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?w.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:w.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,P(this.clonePosition(),this.clonePosition()));var m=this.parseMessage(t+1,r,a);if(m.err)return m;var g=this.tryParseArgumentClose(h);if(g.err)return g;s.push([l,{value:m.val,location:P(h,this.clonePosition())}]),c.add(l),this.bumpSpace(),n=this.parseIdentifierIfPossible(),l=n.value,d=n.location}return s.length===0?this.error(r==="select"?w.EXPECT_SELECT_ARGUMENT_SELECTOR:w.EXPECT_PLURAL_ARGUMENT_SELECTOR,P(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(w.MISSING_OTHER_CLAUSE,P(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var a=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(a=-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=P(i,this.clonePosition());return n?(o*=a,Zc(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=Xn(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(Wn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(a),!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()&&Qn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),a=this.message.charCodeAt(r+(t>=65536?2:1));return a??null},e}();function Ia(e){return e>=97&&e<=122||e>=65&&e<=90}function el(e){return Ia(e)||e===47}function tl(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 Qn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function rl(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 Da(e){e.forEach(function(t){if(delete t.location,gr(t)||fr(t))for(var r in t.options)delete t.options[r].location,Da(t.options[r].value);else pr(t)&&xr(t.style)||(mr(t)||ur(t))&&kt(t.style)?delete t.style.location:vr(t)&&Da(t.children)})}function Jn(e,t){t===void 0&&(t={}),t=_({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Zn(e,t).parse();if(r.err){var a=SyntaxError(w[r.err.kind]);throw a.location=r.err.location,a.originalMessage=r.err.message,a}return t?.captureLocation||Da(r.val),r.val}function Rt(e,t){var r=t&&t.cache?t.cache:cl,a=t&&t.serializer?t.serializer:sl,i=t&&t.strategy?t.strategy:il;return i(e,{cache:r,serializer:a})}function al(e){return e==null||typeof e=="number"||typeof e=="boolean"}function eo(e,t,r,a){var i=al(a)?a:r(a),n=t.get(i);return typeof n>"u"&&(n=e.call(this,a),t.set(i,n)),n}function to(e,t,r){var a=Array.prototype.slice.call(arguments,3),i=r(a),n=t.get(i);return typeof n>"u"&&(n=e.apply(this,a),t.set(i,n)),n}function Ha(e,t,r,a,i){return r.bind(t,e,a,i)}function il(e,t){var r=e.length===1?eo:to;return Ha(e,this,r,t.cache.create(),t.serializer)}function nl(e,t){return Ha(e,this,to,t.cache.create(),t.serializer)}function ol(e,t){return Ha(e,this,eo,t.cache.create(),t.serializer)}var sl=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 cl={create:function(){return new za}},br={variadic:nl,monadic:ol};var $e;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})($e||($e={}));var Nt=function(e){Lt(t,e);function t(r,a,i){var n=e.call(this,r)||this;return n.code=a,n.originalMessage=i,n}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Ba=function(e){Lt(t,e);function t(r,a,i,n){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(a,'". Options are "').concat(Object.keys(i).join('", "'),'"'),$e.INVALID_VALUE,n)||this}return t}(Nt);var ro=function(e){Lt(t,e);function t(r,a,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(a),$e.INVALID_VALUE,i)||this}return t}(Nt);var ao=function(e){Lt(t,e);function t(r,a){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(a,'"'),$e.MISSING_VALUE,a)||this}return t}(Nt);var K;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(K||(K={}));function ll(e){return e.length<2?e:e.reduce(function(t,r){var a=t[t.length-1];return!a||a.type!==K.literal||r.type!==K.literal?t.push(r):a.value+=r.value,t},[])}function dl(e){return typeof e=="function"}function Ot(e,t,r,a,i,n,o){if(e.length===1&&Pa(e[0]))return[{type:K.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=Jn,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 no=io;var Ua={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 {}}"},ul=ji("ConsonantTemplates/price"),gl=/<\/?[^>]+(>|$)/g,B={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"},Le={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel",alternativePriceAriaLabel:"alternativePriceAriaLabel"},$a="TAX_EXCLUSIVE",fl=e=>Gi(e)?Object.entries(e).filter(([,t])=>nt(t)||er(t)||t===!0).reduce((t,[r,a])=>t+` ${r}${a===!0?"":'="'+$i(a)+'"'}`,""):"",U=(e,t,r,a=!1)=>`${a?fn(t):t??""}`;function vl(e){e=e.replaceAll("","</a>");let t=/]+(>|$)/g;return e.match(t)?.forEach(a=>{let i=a.replace("",">");e=e.replaceAll(a,i)}),e}function xl(e){e=e.replaceAll("</a>","");let t=/<a (?!>)(.*?)(>|$)/g;return e.match(t)?.forEach(a=>{let i=a.replace("<a ","");e=e.replaceAll(a,i)}),e}function we(e,t,r,a){let i=e[r];if(i==null)return"";let n=i.includes("<"),o=i.includes("${t}`:r&&(g=`${r}`),c&&(g+=h+m),g+=U(B.integer,s),g+=U(B.decimalsDelimiter,n),g+=U(B.decimals,i),c||(g+=m+h),g+=U(B.recurrence,l,null,!0),g+=U(B.unitType,d,null,!0),g+=U(B.taxInclusivity,p,!0),U(e,g,{...u})}var Y=({isAlternativePrice:e=!1,displayOptical:t=!1,displayStrikethrough:r=!1,displayPromoStrikethrough:a=!1,displayAnnual:i=!1,instant:n=void 0}={})=>({country:o,displayFormatted:s=!0,displayRecurrence:c=!0,displayPerUnit:l=!1,displayTax:d=!1,language:p,literals:u={},quantity:h=1,space:m=!1,isPromoApplied:g=!1}={},{commitment:x,offerSelectorIds:b,formatString:E,price:v,priceWithoutDiscount:A,taxDisplay:N,taxTerm:M,term:z,usePrecision:$,promotion:Q}={},j={})=>{Object.entries({country:o,formatString:E,language:p,price:v}).forEach(([qo,Vo])=>{if(Vo==null)throw new Error(`Argument "${qo}" is missing for osi ${b?.toString()}, country ${o}, language ${p}`)});let F={...Ua,...u},R=`${p.toLowerCase()}-${o.toUpperCase()}`,J;Q&&!g&&A?J=e||a?v:A:r&&A?J=A:J=v;let se=t?xn:bn;i&&(se=yn);let{accessiblePrice:qe,recurrenceTerm:Ka,...Za}=se({commitment:x,formatString:E,instant:n,isIndianPrice:o==="IN",originalPrice:v,priceWithoutDiscount:A,price:t?v:J,promotion:Q,quantity:h,term:z,usePrecision:$}),Er="",Ar="",Sr="";y(c)&&Ka&&(Sr=we(F,R,Le.recurrenceLabel,{recurrenceTerm:Ka}));let Ut="";y(l)&&(m&&(Ut+=" "),Ut+=we(F,R,Le.perUnitLabel,{perUnit:"LICENSE"}));let $t="";y(d)&&M&&(m&&($t+=" "),$t+=we(F,R,N===$a?Le.taxExclusiveLabel:Le.taxInclusiveLabel,{taxTerm:M})),r&&(Er=we(F,R,Le.strikethroughAriaLabel,{strikethroughPrice:Er})),e&&(Ar=we(F,R,Le.alternativePriceAriaLabel,{alternativePrice:Ar}));let Me=B.container;if(t&&(Me+=" "+B.containerOptical),r&&(Me+=" "+B.containerStrikethrough),a&&(Me+=" "+B.containerPromoStrikethrough),e&&(Me+=" "+B.containerAlternative),i&&(Me+=" "+B.containerAnnual),y(s))return bl(Me,{...Za,accessibleLabel:Er,altAccessibleLabel:Ar,recurrenceLabel:Sr,perUnitLabel:Ut,taxInclusivityLabel:$t},j);let{currencySymbol:Qa,decimals:Bo,decimalsDelimiter:Fo,hasCurrencySpace:Ja,integer:Uo,isCurrencyFirst:$o}=Za,Ve=[Uo,Fo,Bo];$o?(Ve.unshift(Ja?"\xA0":""),Ve.unshift(Qa)):(Ve.push(Ja?"\xA0":""),Ve.push(Qa)),Ve.push(Sr,Ut,$t);let Go=Ve.join("");return U(Me,Go,j)},oo=()=>(e,t,r)=>{let a=Fe(t.promotion,t.promotion?.displaySummary?.instant,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n=(e.displayOldPrice===void 0||y(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price&&(!t.promotion||a);return`${n?Y({displayStrikethrough:!0})({isPromoApplied:a,...e},t,r)+" ":""}${Y({isAlternativePrice:n})({isPromoApplied:a,...e},t,r)}`},so=()=>(e,t,r)=>{let{instant:a}=e;try{a||(a=new URLSearchParams(document.location.search).get("instant")),a&&(a=new Date(a))}catch{a=void 0}let i=Fe(t.promotion,a,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n={...e,displayTax:!1,displayPerUnit:!1,isPromoApplied:i};if(!i)return Y()(e,{...t,price:t.priceWithoutDiscount},r)+U(B.containerAnnualPrefix," (")+Y({displayAnnual:!0,instant:a})(n,{...t,price:t.priceWithoutDiscount},r)+U(B.containerAnnualSuffix,")");let s=(e.displayOldPrice===void 0||y(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${s?Y({displayStrikethrough:!0})(n,t,r)+" ":""}${Y({isAlternativePrice:s})({isPromoApplied:i,...e},t,r)}${U(B.containerAnnualPrefix," (")}${Y({displayAnnual:!0,instant:a})(n,t,r)}${U(B.containerAnnualSuffix,")")}`},co=()=>(e,t,r)=>{let a={...e,displayTax:!1,displayPerUnit:!1};return`${Y({isAlternativePrice:e.displayOldPrice})(e,t,r)}${U(B.containerAnnualPrefix," (")}${Y({displayAnnual:!0})(a,t,r)}${U(B.containerAnnualSuffix,")")}`};var It={...B,containerLegal:"price-legal",planType:"price-plan-type"},yr={...Le,planTypeLabel:"planTypeLabel"};function yl(e,{perUnitLabel:t,taxInclusivityLabel:r,planTypeLabel:a},i={}){let n="";return n+=U(It.unitType,t,null,!0),r&&a&&(r+=". "),n+=U(It.taxInclusivity,r,!0),n+=U(It.planType,a,null),U(e,n,{...i})}var lo=({country:e,displayPerUnit:t=!1,displayTax:r=!1,displayPlanType:a=!1,language:i,literals:n={}}={},{taxDisplay:o,taxTerm:s,planType:c}={},l={})=>{let d={...Ua,...n},p=`${i.toLowerCase()}-${e.toUpperCase()}`,u="";y(t)&&(u=we(d,p,yr.perUnitLabel,{perUnit:"LICENSE"}));let h="";e==="US"&&i==="en"&&(r=!1),y(r)&&s&&(h=we(d,p,o===$a?yr.taxExclusiveLabel:yr.taxInclusiveLabel,{taxTerm:s}));let m="";y(a)&&c&&(m=we(d,p,yr.planTypeLabel,{planType:c}));let g=It.container;return g+=" "+It.containerLegal,yl(g,{perUnitLabel:u,taxInclusivityLabel:h,planTypeLabel:m},l)};var ho=Y(),po=oo(),mo=Y({displayOptical:!0}),uo=Y({displayStrikethrough:!0}),go=Y({displayPromoStrikethrough:!0}),fo=Y({displayAnnual:!0}),vo=Y({displayOptical:!0,isAlternativePrice:!0}),xo=Y({isAlternativePrice:!0}),bo=co(),yo=so(),wo=lo;var wl=(e,t)=>{if(!(!St(e)||!St(t)))return Math.floor((t-e)/t*100)},Eo=()=>(e,t)=>{let{price:r,priceWithoutDiscount:a}=t,i=wl(r,a);return i===void 0?'':`${i}%`};var Ao=Eo();var So="INDIVIDUAL_COM",qa="TEAM_COM",To="INDIVIDUAL_EDU",Va="TEAM_EDU",El=["AT_de","AU_en","BE_en","BE_fr","BE_nl","BG_bg","CH_de","CH_fr","CH_it","CZ_cs","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","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Al={[So]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[qa]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[To]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[Va]:["SG_en","KR_ko"]},Sl={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],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!1,!1,!1,!1]},Tl=[So,qa,To,Va],Cl=e=>[qa,Va].includes(e);function Ga(e,t,r,a){if(e[t])return e[t];let i=`${t}_${r}`;if(e[i])return e[i];let n;if(a)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 _l=(e,t,r,a)=>{let i=`${r}_${a}`,n=Ga(Sl,e,t,!1);if(n){let o=Tl.indexOf(i);return n[o]}return Cl(i)},Pl=(e,t,r,a)=>{if(Ga(El,e,t,!0))return!0;let i=Al[`${r}_${a}`];return i?Ga(i,e,t,!0)?!0:k.displayTax:k.displayTax},ja=async(e,t,r,a)=>{let i=Pl(e,t,r,a);return{displayTax:i,forceTaxExclusive:i?_l(e,t,r,a):k.forceTaxExclusive}},Dt=class Dt extends HTMLSpanElement{constructor(){super();f(this,"masElement",new Pe(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 a=ae();if(!a)return null;let{displayOldPrice:i,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:p,promotionCode:u,quantity:h,alternativePrice:m,template:g,wcsOsi:x}=a.collectPriceOptions(r);return lr(Dt,{displayOldPrice:i,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:p,promotionCode:u,quantity:h,alternativePrice:m,template:g,wcsOsi:x})}get isInlinePrice(){return!0}attributeChangedCallback(r,a,i){this.masElement.attributeChangedCallback(r,a,i)}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===he}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let a=ae();if(!a)return!1;let i=a.collectPriceOptions(r,this),n={...a.settings,...i};if(!n.wcsOsi.length)return!1;try{let o=this.masElement.togglePending({});this.innerHTML="";let s=a.resolveOfferSelectors(n),c=await Promise.all(s),l=c.map(h=>{let m=Ct(h,n);return m?.length?m[0]:null});if(l.some(h=>!h))throw new Error(`Failed to select offers for: ${n.wcsOsi}`);let d=l,p=Ea(l);if(a.featureFlags[xe]||n[xe]){if(i.displayPerUnit===void 0&&(n.displayPerUnit=p.customerSegment!=="INDIVIDUAL"),i.displayTax===void 0||i.forceTaxExclusive===void 0){let{country:h,language:m}=n,[g=""]=p.marketSegments,x=await ja(h,m,p.customerSegment,g);i.displayTax===void 0&&(n.displayTax=x?.displayTax||n.displayTax),i.forceTaxExclusive===void 0&&(n.forceTaxExclusive=x?.forceTaxExclusive||n.forceTaxExclusive),n.forceTaxExclusive&&(d=c.map(b=>{let E=Ct(b,n);return E?.length?E[0]:null}))}}else i.displayOldPrice===void 0&&(n.displayOldPrice=!0);if(a.featureFlags[je]&&n.displayAnnual!==!1&&(n.displayAnnual=!0),n.template==="discount"&&d.length===2){let[h,m]=d,g={...h,priceDetails:{...h.priceDetails,priceWithoutDiscount:m.priceDetails?.price}};return this.renderOffers([g],n,o)}let u=Ea(d);return this.renderOffers([u],n,o)}catch(o){throw this.innerHTML="",o}}renderOffers(r,a,i=void 0){if(!this.isConnected)return;let n=ae();if(!n)return!1;if(i??(i=this.masElement.togglePending()),r.length){if(this.masElement.toggleResolved(i,r,a)){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(i,o,this.options))return this.innerHTML="",!0}return!1}};f(Dt,"is","inline-price"),f(Dt,"tag","span");var Ee=Dt;window.customElements.get(Ee.is)||window.customElements.define(Ee.is,Ee,{extends:Ee.tag});function Co({literals:e,providers:t,settings:r}){function a(o,s=null){let c={country:r.country,language:r.language,locale:r.locale,literals:{...e.price}};if(s&&t?.price)for(let M of t.price)M(s,c);let{displayOldPrice:l,displayPerUnit:d,displayRecurrence:p,displayTax:u,displayPlanType:h,forceTaxExclusive:m,perpetual:g,displayAnnual:x,promotionCode:b,quantity:E,alternativePrice:v,wcsOsi:A,...N}=Object.assign(c,s?.dataset??{},o??{});return c=tr(Object.assign({...c,...N,displayOldPrice:y(l),displayPerUnit:y(d),displayRecurrence:y(p),displayTax:y(u),displayPlanType:y(h),forceTaxExclusive:y(m),perpetual:y(g),displayAnnual:y(x),promotionCode:ar(b).effectivePromoCode,quantity:ot(E,k.quantity),alternativePrice:y(v),wcsOsi:cr(A)})),c}function i(o,s){if(!Array.isArray(o)||!o.length||!s)return"";let{template:c}=s,l;switch(c){case"discount":l=Ao;break;case"strikethrough":l=uo;break;case"promo-strikethrough":l=go;break;case"annual":l=fo;break;case"legal":l=wo;break;default:s.template==="optical"&&s.alternativePrice?l=vo:s.template==="optical"?l=mo:s.displayAnnual&&o[0].planType==="ABM"?l=s.promotionCode?yo:bo:s.alternativePrice?l=xo:l=s.promotionCode?po:ho}let[d]=o;return d={...d,...d.priceDetails},l({...r,...s},d)}let n=Ee.createInlinePrice;return{InlinePrice:Ee,buildPriceHTML:i,collectPriceOptions:a,createInlinePrice:n}}function Ll({locale:e=void 0,country:t=void 0,language:r=void 0}={}){return r??(r=e?.split("_")?.[0]||k.language),t??(t=e?.split("_")?.[1]||k.country),e??(e=`${r}_${t}`),{locale:e,country:t,language:r}}function _o(e={},t){let r=t.featureFlags[xe],{commerce:a={}}=e,i=ge.PRODUCTION,n=Vr,o=H("checkoutClientId",a)??k.checkoutClientId,s=Tt(H("checkoutWorkflowStep",a),ee,k.checkoutWorkflowStep),c=y(H("displayOldPrice",a),k.displayOldPrice),l=k.displayPerUnit,d=y(H("displayRecurrence",a),k.displayRecurrence),p=y(H("displayTax",a),k.displayTax),u=y(H("displayPlanType",a),k.displayPlanType),h=y(H("entitlement",a),k.entitlement),m=y(H("modal",a),k.modal),g=y(H("forceTaxExclusive",a),k.forceTaxExclusive),x=H("promotionCode",a)??k.promotionCode,b=ot(H("quantity",a)),E=H("wcsApiKey",a)??k.wcsApiKey,v=a?.env==="stage",A=Te.PUBLISHED;["true",""].includes(a.allowOverride)&&(v=(H(Gr,a,{metadata:!1})?.toLowerCase()??a?.env)==="stage",A=Tt(H(qr,a),Te,A)),v&&(i=ge.STAGE,n=jr);let M=H($r)??e.preview,z=typeof M<"u"&&M!=="off"&&M!=="false",$={};z&&($={preview:z});let Q=H("mas-io-url")??e.masIOUrl??`https://www${i===ge.STAGE?".stage":""}.adobe.com/mas/io`,j=H("preselect-plan")??void 0;return{...Ll(e),...$,displayOldPrice:c,checkoutClientId:o,checkoutWorkflowStep:s,displayPerUnit:l,displayRecurrence:d,displayTax:p,displayPlanType:u,entitlement:h,extraOptions:k.extraOptions,modal:m,env:i,forceTaxExclusive:g,promotionCode:x,quantity:b,alternativePrice:k.alternativePrice,wcsApiKey:E,wcsURL:n,landscape:A,masIOUrl:Q,...j&&{preselectPlan:j}}}async function Po(e,t={},r=2,a=100){let i;for(let n=0;n<=r;n++)try{let o=await fetch(e,t);return o.retryCount=n,o}catch(o){if(i=o,i.retryCount=n,n>r)break;await new Promise(s=>setTimeout(s,a*(n+1)))}throw i}var Wa="wcs";function Lo({settings:e}){let t=re.module(Wa),{env:r,wcsApiKey:a}=e,i=new Map,n=new Map,o,s=new Map;async function c(m,g,x=!0){let b=ae(),E=zr;t.debug("Fetching:",m);let v="",A;if(m.offerSelectorIds.length>1)throw new Error("Multiple OSIs are not supported anymore");let N=new Map(g),[M]=m.offerSelectorIds,z=Date.now()+Math.random().toString(36).substring(2,7),$=`${Wa}:${M}:${z}${Yr}`,Q=`${Wa}:${M}:${z}${Xr}`,j;try{if(performance.mark($),v=new URL(e.wcsURL),v.searchParams.set("offer_selector_ids",M),v.searchParams.set("country",m.country),v.searchParams.set("locale",m.locale),v.searchParams.set("landscape",r===ge.STAGE?"ALL":e.landscape),v.searchParams.set("api_key",a),m.language&&v.searchParams.set("language",m.language),m.promotionCode&&v.searchParams.set("promotion_code",m.promotionCode),m.currency&&v.searchParams.set("currency",m.currency),A=await Po(v.toString(),{credentials:"omit"}),A.ok){let F=[];try{let R=await A.json();t.debug("Fetched:",m,R),F=R.resolvedOffers??[]}catch(R){t.error(`Error parsing JSON: ${R.message}`,{...R.context,...b?.duration})}F=F.map(ir),g.forEach(({resolve:R},J)=>{let se=F.filter(({offerSelectorIds:qe})=>qe.includes(J)).flat();se.length&&(N.delete(J),g.delete(J),R(se))})}else E=Hr}catch(F){E=`Network error: ${F.message}`}finally{j=performance.measure(Q,$),performance.clearMarks($),performance.clearMeasures(Q)}if(x&&g.size){t.debug("Missing:",{offerSelectorIds:[...g.keys()]});let F=on(A);g.forEach(R=>{R.reject(new st(E,{...m,...F,response:A,measure:Vt(j),...b?.duration}))})}}function l(){clearTimeout(o);let m=[...n.values()];n.clear(),m.forEach(({options:g,promises:x})=>c(g,x))}function d(m){if(!m||typeof m!="object")throw new TypeError("Cache must be a Map or similar object");let g=r===ge.STAGE?"stage":"prod",x=m[g];if(!x||typeof x!="object"){t.warn(`No cache found for environment: ${r}`);return}for(let[b,E]of Object.entries(x))i.set(b,Promise.resolve(E.map(ir)));t.debug(`Prefilled WCS cache with ${x.size} entries`)}function p(){let m=i.size;s=new Map(i),i.clear(),t.debug(`Moved ${m} cache entries to stale cache`)}function u(m,g,x){let b=m!=="GB"&&!x?"MULT":"en",E=Kr.includes(m)?m:k.country;return{validCountry:E,validLanguage:b,locale:`${g}_${E}`}}function h({country:m,language:g,perpetual:x=!1,promotionCode:b="",wcsOsi:E=[]}){let{validCountry:v,validLanguage:A,locale:N}=u(m,g,x),M=[v,A,b].filter(z=>z).join("-").toLowerCase();return E.map(z=>{let $=`${z}-${M}`;if(i.has($))return i.get($);let Q=new Promise((j,F)=>{let R=n.get(M);R||(R={options:{country:v,locale:N,...A==="MULT"&&{language:A},offerSelectorIds:[]},promises:new Map},n.set(M,R)),b&&(R.options.promotionCode=b),R.options.offerSelectorIds.push(z),R.promises.set(z,{resolve:j,reject:F}),l()}).catch(j=>{if(s.has($))return s.get($);throw j});return i.set($,Q),Q})}return{Commitment:Re,PlanType:Yi,Term:ce,applyPlanType:ir,resolveOfferSelectors:h,flushWcsCacheInternal:p,prefillWcsCache:d,normalizeCountryLanguageAndLocale:u}}var ko="mas-commerce-service",Mo="mas-commerce-service:start",Ro="mas-commerce-service:ready",Ht,lt,Ge,No,Xa,Ya=class extends HTMLElement{constructor(){super(...arguments);G(this,Ge);G(this,Ht);G(this,lt);f(this,"lastLoggingTime",0)}async registerCheckoutAction(r){typeof r=="function"&&(this.buildCheckoutAction=async(a,i,n)=>{let o=await r?.(a,i,this.imsSignedInPromise,n);return o||null})}get featureFlags(){return T(this,lt)||W(this,lt,{[xe]:mt(this,Ge,Xa).call(this,xe),[je]:mt(this,Ge,Xa).call(this,je)}),T(this,lt)}activate(){let r=T(this,Ge,No),a=_o(r,this);nr(r.lana);let i=re.init(r.hostEnv).module("service");i.debug("Activating:",r);let o={price:Rn(a)},s={checkout:new Set,price:new Set},c={literals:o,providers:s,settings:a};Object.defineProperties(this,Object.getOwnPropertyDescriptors({...Ln(c),...kn(c),...Co(c),...Lo(c),...Zr,Log:re,resolvePriceTaxFlags:ja,get defaults(){return k},get log(){return re},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 a}})),i.debug("Activated:",{literals:o,settings:a});let l=new CustomEvent(qt,{bubbles:!0,cancelable:!1,detail:this});performance.mark(Ro),W(this,Ht,performance.measure(Ro,Mo)),this.dispatchEvent(l),setTimeout(()=>{this.logFailedRequests()},1e4)}connectedCallback(){performance.mark(Mo),this.activate()}flushWcsCache(){this.flushWcsCacheInternal(),this.log.debug("Flushed WCS cache")}refreshOffers(){this.flushWcsCacheInternal(),document.querySelectorAll(Cr).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":Vt(T(this,Ht))}}logFailedRequests(){let r=[...performance.getEntriesByType("resource")].filter(({startTime:i})=>i>this.lastLoggingTime).filter(({transferSize:i,duration:n,responseStatus:o})=>i===0&&n===0&&o<200||o>=400),a=Array.from(new Map(r.map(i=>[i.name,i])).values());if(a.some(({name:i})=>/(\/fragment\?|web_commerce_artifact)/.test(i))){let i=a.map(({name:n})=>n);this.log.error("Failed requests:",{failedUrls:i,...this.duration})}this.lastLoggingTime=performance.now().toFixed(3)}};Ht=new WeakMap,lt=new WeakMap,Ge=new WeakSet,No=function(){let r=this.getAttribute("env")??"prod",a={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(i=>{let n=this.getAttribute(i);n&&(a[i]=n)}),["checkout-workflow-step","force-tax-exclusive","checkout-client-id","allow-override","wcs-api-key"].forEach(i=>{let n=this.getAttribute(i);if(n!=null){let o=i.replace(/-([a-z])/g,s=>s[1].toUpperCase());a.commerce[o]=n}}),a},Xa=function(r){return["on","true",!0].includes(this.getAttribute(`data-${r}`)||H(r))};window.customElements.get(ko)||window.customElements.define(ko,Ya);var Ho="merch-card-collection",kl=3e4,Ml={catalog:["four-merch-cards"],plans:["four-merch-cards"],plansThreeColumns:["three-merch-cards"],product:["four-merch-cards"],productTwoColumns:["two-merch-cards"],productThreeColumns:["three-merch-cards"],segment:["four-merch-cards"],segmentTwoColumns:["two-merch-cards"],segmentThreeColumns:["three-merch-cards"],"special-offers":["three-merch-cards"],image:["three-merch-cards"],"mini-compare-chart":["three-merch-cards"],"mini-compare-chartTwoColumns":["two-merch-cards"],"mini-compare-chart-mweb":["three-merch-cards"],"mini-compare-chart-mwebTwoColumns":["two-merch-cards"]},Rl={plans:!0},Nl=(e,{filter:t})=>e.filter(r=>r?.filters&&r?.filters.hasOwnProperty(t)),Ol=(e,{types:t})=>t?(t=t.split(","),e.filter(r=>t.some(a=>r.types.includes(a)))):e,Il=e=>e.sort((t,r)=>(t.title??"").localeCompare(r.title??"","en",{sensitivity:"base"})),Dl=(e,{filter:t})=>e.sort((r,a)=>a.filters[t]?.order==null||isNaN(a.filters[t]?.order)?-1:r.filters[t]?.order==null||isNaN(r.filters[t]?.order)?1:r.filters[t].order-a.filters[t].order),Hl=(e,{search:t})=>t?.length?(t=t.toLowerCase(),e.filter(r=>(r.title??"").toLowerCase().includes(t))):e,ke,ht,Bt,Ft,wr,zo,dt=class extends Io{constructor(){super();G(this,wr);G(this,ke,{});G(this,ht);G(this,Bt);G(this,Ft);this.id=null,this.filter="all",this.hasMore=!1,this.resultCount=void 0,this.displayResult=!1,this.data=null,this.variant=null,this.hydrating=!1,this.hydrationReady=null,this.literalsHandlerAttached=!1,this.onUnmount=[]}render(){return Ae` - ${this.footer}`}checkReady(){if(!this.querySelector("aem-fragment"))return Promise.resolve(!0);let a=new Promise(i=>setTimeout(()=>i(!1),kl));return Promise.race([this.hydrationReady,a])}updated(r){if(!this.querySelector("merch-card"))return;let a=window.scrollY||document.documentElement.scrollTop,i=[...this.children].filter(l=>l.tagName==="MERCH-CARD");if(i.length===0)return;r.has("singleApp")&&this.singleApp&&i.forEach(l=>{l.updateFilters(l.name===this.singleApp)});let n=this.sort===pe.alphabetical?Il:Dl,s=[Nl,Ol,Hl,n].reduce((l,d)=>d(l,this),i).map((l,d)=>[l,d]);if(this.resultCount=s.length,this.page&&this.limit){let l=this.page*this.limit;this.hasMore=s.length>l,s=s.filter(([,d])=>d{c.has(l)?(l.size=l.filters[this.filter]?.size,l.style.removeProperty("display"),l.requestUpdate()):(l.style.display="none",l.size=void 0)}),window.scrollTo(0,a),this.updateComplete.then(()=>{this.dispatchLiteralsChanged(),this.sidenav&&!this.literalsHandlerAttached&&(this.sidenav.addEventListener(kr,()=>{this.dispatchLiteralsChanged()}),this.literalsHandlerAttached=!0)})}dispatchLiteralsChanged(){this.dispatchEvent(new CustomEvent(de,{detail:{resultCount:this.resultCount,searchTerm:this.search,filter:this.sidenav?.filters?.selectedText}}))}buildOverrideMap(){W(this,ke,{}),this.overrides?.split(",").forEach(r=>{let[a,i]=r?.split(":");a&&i&&(T(this,ke)[a]=i)})}connectedCallback(){super.connectedCallback(),W(this,ht,bt()),T(this,ht)&&W(this,Bt,T(this,ht).Log.module(Ho)),W(this,Ft,customElements.get("merch-card")),this.buildOverrideMap(),this.init()}async init(){await this.hydrate(),this.sidenav=this.parentElement.querySelector("merch-sidenav"),this.filtered?(this.filter=this.filtered,this.page=1):this.startDeeplink(),this.initializePlaceholders()}disconnectedCallback(){super.disconnectedCallback(),this.stopDeeplink?.();for(let r of this.onUnmount)r()}initializeHeader(){let r=document.createElement("merch-card-collection-header");r.collection=this,r.classList.add(this.variant),this.parentElement.insertBefore(r,this),this.header=r,this.querySelectorAll("[placeholder]").forEach(i=>{let n=i.getAttribute("slot");this.header.placeholderKeys.includes(n)&&this.header.append(i)})}initializePlaceholders(){let r=this.data?.placeholders||{};!r.searchText&&this.data?.sidenavSettings?.searchText&&(r.searchText=this.data.sidenavSettings.searchText);for(let a of Object.keys(r)){let i=r[a],n=i.includes("

")?"div":"p",o=document.createElement(n);o.setAttribute("slot",a),o.setAttribute("placeholder",""),o.innerHTML=i,this.append(o)}}attachSidenav(r,a=!0){if(!r)return;a&&this.parentElement.prepend(r),this.sidenav=r,this.sidenav.variant=this.variant,this.sidenav.classList.add(this.variant),Rl[this.variant]&&this.sidenav.setAttribute("autoclose",""),this.initializeHeader(),this.dispatchEvent(new CustomEvent(ft));let i=T(this,Ft)?.getCollectionOptions(this.variant)?.onSidenavAttached;i&&i(this)}async hydrate(){if(this.hydrating)return!1;let r=this.querySelector("aem-fragment");if(!r)return;this.id=r.getAttribute("fragment"),this.hydrating=!0;let a;this.hydrationReady=new Promise(s=>{a=s});let i=this;function n(s){let c;return s.fields?.checkboxGroups?c=s.fields.checkboxGroups:s.fields?.tagFilters&&(c=[{title:s.fields?.tagFiltersTitle,label:"types",deeplink:"types",checkboxes:s.fields.tagFilters.map(l=>{let d=l.split("/").pop(),p=s.settings?.tagLabels?.[d]||d;return p=p.startsWith("coll-tag-filter")?d.charAt(0).toUpperCase()+d.slice(1):p,{name:d,label:p}})}]),{searchText:s.fields?.searchText,tagFilters:c,linksTitle:s.fields?.linksTitle,link:s.fields?.link,linkText:s.fields?.linkText,linkIcon:s.fields?.linkIcon}}function o(s,c){let l={cards:[],hierarchy:[],placeholders:s.placeholders,sidenavSettings:n(s)};function d(p,u){for(let h of u){if(h.fieldName==="variations")continue;if(h.fieldName==="cards"){if(l.cards.findIndex(v=>v.id===h.identifier)!==-1)continue;l.cards.push(s.references[h.identifier].value);continue}let m=s.references[h.identifier]?.value,g=h.referencesTree,x=c[h.identifier];if(x){let v=document.querySelector(`aem-fragment[fragment="${x}"]`)?.rawData;v?.fields&&(m=v,g=v.referencesTree,s.references={...s.references,...v.references})}if(!m?.fields)continue;let{fields:b}=m,E={label:b.label||"",icon:b.icon,iconLight:b.iconLight,queryLabel:b.queryLabel,cards:b.cards?b.cards.map(v=>c[v]||v):[],collections:[]};b.defaultchild&&(E.defaultchild=c[b.defaultchild]||b.defaultchild),p.push(E),d(E.collections,g)}}return d(l.hierarchy,s.referencesTree),l.hierarchy.length===0&&(i.filtered="all"),l}r.addEventListener(Rr,s=>{mt(this,wr,zo).call(this,"Error loading AEM fragment",s.detail),this.hydrating=!1,r.remove()}),r.addEventListener(Mr,async s=>{this.limit=27,this.data=o(s.detail,T(this,ke)),s.detail.variationId&&this.setAttribute("variation-id",s.detail.variationId);let{cards:c,hierarchy:l}=this.data,d=l.length===0&&s.detail.fields?.defaultchild?T(this,ke)[s.detail.fields.defaultchild]||s.detail.fields.defaultchild:null;r.cache.add(...c);let p=(m,g)=>{for(let x of m)if(x.defaultchild===g||x.collections&&p(x.collections,g))return!0;return!1};for(let m of c){let v=function(N){for(let M of N){let z=M.cards.indexOf(x);if(z===-1)continue;let $=M.queryLabel??M?.label?.toLowerCase()??"";g.filters[$]={order:z+1,size:m.fields.size},v(M.collections)}},g=document.createElement("merch-card"),x=T(this,ke)[m.id]||m.id;g.setAttribute("consonant",""),g.setAttribute("style","");let b=m.fields.tags?.filter(N=>N.startsWith("mas:types/")).map(N=>N.split("/")[1]).join(",");b&&g.setAttribute("types",b),Wt(m.fields.variant)?.supportsDefaultChild&&(d?x===d:p(l,x))&&g.setAttribute("data-default-card","true"),v(l);let A=document.createElement("aem-fragment");A.setAttribute("fragment",x),g.append(A),Object.keys(g.filters).length===0&&(g.filters={all:{order:c.indexOf(m)+1,size:m.fields.size}}),this.append(g)}let u="",h=ln(c[0]?.fields?.variant);this.variant=h,h==="plans"&&c.length===3&&!c.some(m=>m.fields?.size?.includes("wide"))?u="ThreeColumns":(h==="segment"||h==="product")&&(c.length===2||c.length===3)?u=c.length===2?"TwoColumns":"ThreeColumns":(h==="mini-compare-chart"||h==="mini-compare-chart-mweb")&&c.length<=2&&(u=c.length===1?"":"TwoColumns"),h&&this.classList.add("merch-card-collection",h,...Ml[`${h}${u}`]||[]),this.displayResult=!0,this.hydrating=!1,r.remove(),a(!0)}),await this.hydrationReady}get footer(){if(!this.filtered)return Ae`