From dffdd22432e01c674f8958a61d584d2fc2651271 Mon Sep 17 00:00:00 2001 From: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Date: Thu, 11 Jan 2024 11:21:23 -0700 Subject: [PATCH 1/9] MWPW-140267 Update MEP PZN tags (#1724) * MWPW-140267 Update PZN tags * update mobile definition * add windows and mac * base phone vs tablet on screen size * switch to OR * alert to debug on iphone * tyring to test version * remove comment now that I see update * trying to differentiate between safari and chrome * reverting changes for Chrome Safari differentiating * adding feedback to debug safari on ipad * fix false positive on logged out * remove debug line * changing msedge to edge * update device type tags to all be singular * update reference for mobile --------- Co-authored-by: vivgoodrich --- .../personalization/personalization.js | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index 7bdbb84dda..bb583b821f 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -3,20 +3,27 @@ import { createTag, getConfig, loadLink, loadScript, updateConfig } from '../../utils/utils.js'; import { ENTITLEMENT_MAP } from './entitlements.js'; -/* c8 ignore start */ +/* c20 ignore start */ +const PHONE_SIZE = window.screen.width < 768 || window.screen.height < 768; export const PERSONALIZATION_TAGS = { all: () => true, - chrome: () => navigator.userAgent.includes('Chrome') && !navigator.userAgent.includes('Mobile'), - firefox: () => navigator.userAgent.includes('Firefox') && !navigator.userAgent.includes('Mobile'), + chrome: () => navigator.userAgent.includes('Chrome') && !navigator.userAgent.includes('Edg'), + firefox: () => navigator.userAgent.includes('Firefox'), + safari: () => navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome'), + edge: () => navigator.userAgent.includes('Edg'), android: () => navigator.userAgent.includes('Android'), ios: () => /iPad|iPhone|iPod/.test(navigator.userAgent), + windows: () => navigator.userAgent.includes('Windows'), + mac: () => navigator.userAgent.includes('Macintosh'), + 'mobile-device': () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Touch/i.test(navigator.userAgent), + phone: () => PERSONALIZATION_TAGS['mobile-device']() && PHONE_SIZE, + tablet: () => PERSONALIZATION_TAGS['mobile-device']() && !PHONE_SIZE, + desktop: () => !PERSONALIZATION_TAGS['mobile-device'](), loggedout: () => !window.adobeIMS?.isSignedInUser(), - loggedin: () => window.adobeIMS?.isSignedInUser(), - darkmode: () => window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches, - lightmode: () => !PERSONALIZATION_TAGS.darkmode(), + loggedin: () => !!window.adobeIMS?.isSignedInUser(), }; const PERSONALIZATION_KEYS = Object.keys(PERSONALIZATION_TAGS); -/* c8 ignore stop */ +/* c20 ignore stop */ const CLASS_EL_DELETE = 'p13n-deleted'; const CLASS_EL_REPLACE = 'p13n-replaced'; From 25e2e563b24f0f5bcc38802759d0c175d532315d Mon Sep 17 00:00:00 2001 From: Suhani Jain <110388864+suhjainadobe@users.noreply.github.com> Date: Fri, 12 Jan 2024 09:08:56 +0530 Subject: [PATCH 2/9] MWPW-140467 Integrate round-corners for brick block (#1664) * Update blocks.js * rounded-corner-brick block * rounded-corner-brick block * rounded-corner-brick block * minor change * review suggestion --------- Co-authored-by: Suhani Jain Co-authored-by: Suhani Jain --- libs/blocks/brick/brick.js | 9 +++++++-- libs/blocks/media/media.js | 7 +++---- test/blocks/brick/mocks/body.html | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libs/blocks/brick/brick.js b/libs/blocks/brick/brick.js index 90799735e7..b4b692b135 100644 --- a/libs/blocks/brick/brick.js +++ b/libs/blocks/brick/brick.js @@ -1,5 +1,5 @@ import { decorateTextOverrides, decorateBlockText, decorateBlockBg, decorateIconStack, decorateButtons } from '../../utils/decorate.js'; -import { createTag } from '../../utils/utils.js'; +import { createTag, getConfig, loadStyle } from '../../utils/utils.js'; const blockTypeSizes = { large: ['xxl', 'm', 'l'], @@ -72,7 +72,7 @@ function decorateBricks(el) { decorateBlockBg(el, elems[elems.length - 2], { useHandleFocalpoint: true }); } if (elems.length > 2) { - el.querySelector('.background').style.background = elems[0].textContent; + el.style.background = elems[0].textContent; elems[0].remove(); } const foreground = elems[elems.length - 1]; @@ -90,6 +90,11 @@ function decorateBricks(el) { } export default async function init(el) { + if (el.className.includes('rounded-corners')) { + const { miloLibs, codeRoot } = getConfig(); + const base = miloLibs || codeRoot; + loadStyle(`${base}/styles/rounded-corners.css`); + } decorateBricks(el); decorateTextOverrides(el); decorateSupplementalText(el); diff --git a/libs/blocks/media/media.js b/libs/blocks/media/media.js index 93de7c2405..d225bbea5e 100644 --- a/libs/blocks/media/media.js +++ b/libs/blocks/media/media.js @@ -20,10 +20,9 @@ function decorateAvatar(el) { } export default function init(el) { - const { miloLibs, codeRoot } = getConfig(); - const regex = /rounded-corners/g; - const base = miloLibs || codeRoot; - if ([...el.classList].some((c) => regex.test(c))) { + if (el.className.includes('rounded-corners')) { + const { miloLibs, codeRoot } = getConfig(); + const base = miloLibs || codeRoot; loadStyle(`${base}/styles/rounded-corners.css`); } el.classList.add('con-block'); diff --git a/test/blocks/brick/mocks/body.html b/test/blocks/brick/mocks/body.html index 7820dbf2ef..3a49530d27 100644 --- a/test/blocks/brick/mocks/body.html +++ b/test/blocks/brick/mocks/body.html @@ -1,6 +1,6 @@
-
+
linear-gradient(to right, #d7d2cc 0%, #304352 100%)
@@ -40,7 +40,7 @@

Heading XXL 44/55 Lorem ipsum.

-
+
linear-gradient(to right, #d7d2cc 0%, #304352 100%)
From 4784da2e470cafd698d95169c6ba47c469164ebf Mon Sep 17 00:00:00 2001 From: Robert Bogos <146744221+robert-bogos@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:27:26 +0200 Subject: [PATCH 3/9] MWPW-140953: Updated twitter logo (#1732) ui: updated twitter logo --- libs/blocks/global-footer/icons.svg | 4 ++-- test/blocks/global-footer/mocks/icons.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/blocks/global-footer/icons.svg b/libs/blocks/global-footer/icons.svg index 28440ad8bc..87121f2908 100644 --- a/libs/blocks/global-footer/icons.svg +++ b/libs/blocks/global-footer/icons.svg @@ -17,8 +17,8 @@ - - + + diff --git a/test/blocks/global-footer/mocks/icons.js b/test/blocks/global-footer/mocks/icons.js index d6179cb566..49520b19d5 100644 --- a/test/blocks/global-footer/mocks/icons.js +++ b/test/blocks/global-footer/mocks/icons.js @@ -18,8 +18,8 @@ export default ` - - + + From a4a73202f618d08768c922c34db8160fb2254c7e Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Fri, 12 Jan 2024 12:53:29 +0100 Subject: [PATCH 4/9] MWPW-140836: Switch Milo Commerce to own country/language mapping (#1728) * bring mapping for all wcs locales --- libs/deps/commerce.js | 6 +++--- test/blocks/ost/mocks/ost-utils.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/deps/commerce.js b/libs/deps/commerce.js index 922c8aed1e..ffe678470a 100644 --- a/libs/deps/commerce.js +++ b/libs/deps/commerce.js @@ -1,5 +1,5 @@ -// Tue, 09 Jan 2024 11:11:14 GMT -var Pr=Object.defineProperty;var zn=(e,t,r)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Zn=(e,t)=>{for(var r in t)Pr(e,r,{get:t[r],enumerable:!0})};var me=(e,t,r)=>(zn(e,typeof t!="symbol"?t+"":t,r),r);var _e;(function(e){e.ServerError="ServerError",e.ClientError="ClientError",e.UnexpectedError="UnexpectedError"})(_e||(_e={}));var Ar=(e,t,r)=>({type:(i=>i>=500?_e.ServerError:i<400?_e.UnexpectedError:_e.ClientError)(e),message:t,originatingRequest:r,status:e});var Qn=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Ge;(function(e){e.AUTHORIZATION="Authorization",e.X_API_KEY="X-Api-Key"})(Ge||(Ge={}));var Tt=class{constructor(t){this.fetchOptions=t}commonHeaders(){let t={};return this.fetchOptions.apiKey&&(t[Ge.X_API_KEY]=this.fetchOptions.apiKey),this.fetchOptions.accessToken&&(t[Ge.AUTHORIZATION]=`Bearer ${this.fetchOptions.accessToken}`),t}transformData(t,r){return r?t.map(n=>r(n)):t.map(n=>this.identifyTransform(n))}transformDatum(t,r){return r?r(t):this.identifyTransform(t)}identifyTransform(t){return t}failOnBadStatusOrParseBody(t,r){return Qn(this,void 0,void 0,function*(){if(t.ok)return t.json().then(i=>({headers:t.headers,status:t.status,statusText:t.statusText,data:i}));let n=yield t.text();return Promise.reject(Ar(t.status,n,r))})}buildUrl(t,r,n,i,o){var s;let a=(s=this.fetchOptions.baseUrl)!==null&&s!==void 0?s:i(this.fetchOptions.env),c=o(r,n);return this.generateUrl(a,t,c)}generateUrl(t,r,n){let i=new URL(r,t);return n&&(i.search=this.convertToSearchParams(n).toString()),i.toString()}convertToSearchParams(t){return new URLSearchParams(t)}setParams(t,r,n){n!=null&&typeof n=="boolean"?t[r]=String(n):n&&(t[r]=n)}},St=Tt;var V;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(V||(V={}));var we;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(we||(we={}));var ie;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(ie||(ie={}));var oe;(function(e){e.V2="UCv2",e.V3="UCv3"})(oe||(oe={}));var te;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})(te||(te={}));var Pt=function(e){var t;return(t=Jn.get(e))!==null&&t!==void 0?t:e},Jn=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var _r=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o};function Oe(e,t,r){var n,i;try{for(var o=_r(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=wr(s.value,2),c=a[0],l=a[1];l!=null&&r.has(c)&&t.set(Pt(c),l)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}function Fe(e){switch(e){case V.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function Ve(e,t){var r,n;for(var i in e){var o=e[i];try{for(var s=(r=void 0,_r(Object.entries(o))),a=s.next();!a.done;a=s.next()){var c=wr(a.value,2),l=c[0],u=c[1];if(u!=null){var p=Pt(l);t.set("items["+i+"]["+p+"]",u)}}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}var Kn=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Or(e){ni(e);var t=e.env,r=e.items,n=e.workflowStep,i=Kn(e,["env","items","workflowStep"]),o=new URL(Fe(t));return o.pathname=n+"/",Ve(r,o.searchParams),Oe(i,o.searchParams,ti),o.toString()}var ti=new Set(["clientId","country","language","context","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","authCode","campaignid","appctxid"]),ri=["env","workflowStep","clientId","country","items"];function ni(e){var t,r;try{for(var n=ei(ri),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!0}var ii=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},si="/store/";function At(e){ci(e);var t=e.env,r=e.items,n=e.workflowStep,i=e.marketSegment,o=e.offerType,s=e.productArrangementCode,a=ii(e,["env","items","workflowStep","marketSegment","offerType","productArrangementCode"]),c={marketSegment:i,offerType:o,productArrangementCode:s},l=new URL(Fe(t));return l.pathname=""+si+n,n!==te.SEGMENTATION?Ve(r,l.searchParams):Oe(c,l.searchParams,Lr),Oe(a,l.searchParams,Lr),l.toString()}var Lr=new Set(["clientId","country","language","context","landscape","ctxRtUrl","jit","productArrangementCode","marketSegment","offerType","checkoutPromoCode","svar","usid","rUrl","otac","nglwfdata","appctxid","promoid","sdid","trackingid","mv","ai","sc","csm","th","thm","lo","gsp","so.su","so.ca","so.va","so.tr","context.guid","af","rf"]),ai=["env","workflowStep","clientId","country"];function ci(e){var t,r;try{for(var n=oi(ai),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(e.workflowStep!==te.SEGMENTATION&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function _t(e,t){switch(e){case oe.V2:return Or(t);case oe.V3:return At(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),At(t)}}var wt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(wt||(wt={}));var N;(function(e){e.MONTH="MONTH",e.YEAR="YEAR",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.PERPETUAL="PERPETUAL"})(N||(N={}));var L;(function(e){e.ANNUAL="ANNUAL",e.MONTHLY="MONTHLY",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS"})(L||(L={}));var Ot;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Ot||(Ot={}));var Lt;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Lt||(Lt={}));var Ct;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Ct||(Ct={}));var Nt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Nt||(Nt={}));var ui=ie.PUBLISHED,Cr=e=>{switch(e){case V.PRODUCTION:return"https://wcs.adobe.io";case V.STAGE:return"https://wcs-stage.adobe.io";case V.LOCAL:return"http://localhost:3002";default:return"https://wcs-stage.adobe.io"}},Nr=(e,t)=>{var r;return e.api_key=t.apiKey,e.landscape=(r=t.landscape)!==null&&r!==void 0?r:ui,e};var li=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},It=class extends St{constructor(t){super(t),this.apiPaths={getWebCommerceArtifact:"web_commerce_artifact"},this.getWebCommerceArtifact=(r,n,i,o)=>li(this,void 0,void 0,function*(){let s=this.buildUrl(this.apiPaths.getWebCommerceArtifact,n,r,a=>Cr(a),(a,c)=>this.evaluateGetWebCommerceArtifactParams(a,c));return this.fetchOptions.fetch(s,{signal:o,headers:Object.assign({},this.commonHeaders()),mode:"cors"}).then(a=>this.failOnBadStatusOrParseBody(a,`GET ${s}`)).then(a=>{let l=a.data;return{data:this.transformDatum(l,i)}})})}evaluateGetWebCommerceArtifactParams(t,r){let n={};return this.setParams(n,"offer_selector_ids",r.offerSelectorIds.join(",")),this.setParams(n,"country",r.country),this.setParams(n,"language",r.language),this.setParams(n,"currency",r.currency),this.setParams(n,"locale",r.locale),this.setParams(n,"promotion_code",r.promotionCode),Nr(n,t)}},Ir=It;var We=e=>new Ir(e).getWebCommerceArtifact;var Rr="tacocat.js";var de=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),Ur=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function O(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=he(n)?n:e;o=s.get(a)}if(i&&o==null){let s=he(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=kr(he(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var Ee=()=>{};var Dr=e=>typeof e=="boolean",se=e=>typeof e=="function",je=e=>typeof e=="number",Mr=e=>e!=null&&typeof e=="object";var he=e=>typeof e=="string",Rt=e=>he(e)&&e,ge=e=>je(e)&&Number.isFinite(e)&&e>0;function xe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function T(e,t){if(Dr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Q(e,t,r){let n=Object.values(t);return n.find(i=>de(i,e))??r??n[0]}function kr(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function ye(e,t=1){return je(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var fi=Date.now(),Ut=()=>`(+${Date.now()-fi}ms)`,He=new Set,pi=T(O("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Gr(e){let t=`[${Rr}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=pi?(s,...a)=>{console.debug(`${t} ${s}`,...a,Ut())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;He.forEach(([l])=>l(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;He.forEach(([,l])=>l(c,...a))}}}function mi(e,t){let r=[e,t];return He.add(r),()=>{He.delete(r)}}mi((e,...t)=>{console.error(e,...t,Ut())},(e,...t)=>{console.warn(e,...t,Ut())});var hi="no promo",Fr="promo-tag",di="yellow",Ei="neutral",gi=(e,t,r)=>{let n=o=>o||hi,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},xi="cancel-context",Le=(e,t)=>{let r=e===xi,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?Fr:`${Fr} no-promo`,text:gi(s,t,i),variant:o?di:Ei,isOverriden:i}};var Dt=function(e,t){return Dt=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])},Dt(e,t)};function Ce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Dt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var g=function(){return g=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(bi,function(a,c,l,u,p,f){if(c)t.minimumIntegerDigits=l.length;else{if(u&&p)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(zr.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Xr.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Xr,function(a,c,l,u,p,f){return l==="*"?t.minimumFractionDigits=c.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""}),i.options.length&&(t=g(g({},t),Br(i.options[0])));continue}if(Yr.test(i.stem)){t=g(g({},t),Br(i.stem));continue}var o=Zr(i.stem);o&&(t=g(g({},t),o));var s=Ti(i.stem);s&&(t=g(g({},t),s))}return t}var Gt,Si=new RegExp("^"+kt.source+"*"),Pi=new RegExp(kt.source+"*$");function E(e,t){return{start:e,end:t}}var Ai=!!String.prototype.startsWith,_i=!!String.fromCodePoint,wi=!!Object.fromEntries,Oi=!!String.prototype.codePointAt,Li=!!String.prototype.trimStart,Ci=!!String.prototype.trimEnd,Ni=!!Number.isSafeInteger,Ii=Ni?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Vt=!0;try{Jr=rn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Vt=((Gt=Jr.exec("a"))===null||Gt===void 0?void 0:Gt[0])==="a"}catch{Vt=!1}var Jr,Kr=Ai?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Wt=_i?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},en=wi?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Ri=Li?function(t){return t.trimStart()}:function(t){return t.replace(Si,"")},Ui=Ci?function(t){return t.trimEnd()}:function(t){return t.replace(Pi,"")};function rn(e,t){return new RegExp(e,t)}var jt;Vt?(Ft=rn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),jt=function(t,r){var n;Ft.lastIndex=r;var i=Ft.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):jt=function(t,r){for(var n=[];;){var i=tn(t,r);if(i===void 0||on(i)||ki(i))break;n.push(i),r+=i>=65536?2:1}return Wt.apply(void 0,n)};var Ft,nn=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:S.pound,location:E(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(d.UNMATCHED_CLOSING_TAG,E(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&Ht(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:S.literal,value:"<"+i+"/>",location:E(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:S.tag,value:i,children:s,location:E(n,this.clonePosition())},err:null}:this.error(d.INVALID_TAG,E(a,this.clonePosition())))}else return this.error(d.UNCLOSED_TAG,E(n,this.clonePosition()))}else return this.error(d.INVALID_TAG,E(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Mi(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=E(n,this.clonePosition());return{val:{type:S.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Di(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 Wt.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(),Wt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(d.EMPTY_ARGUMENT,E(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(d.MALFORMED_ARGUMENT,E(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:S.argument,value:i,location:E(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(d.MALFORMED_ARGUMENT,E(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=jt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=E(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(d.EXPECT_ARGUMENT_TYPE,E(s,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=Ui(p.val);if(f.length===0)return this.error(d.EXPECT_ARGUMENT_STYLE,E(this.clonePosition(),this.clonePosition()));var m=E(u,this.clonePosition());l={style:f,styleLocation:m}}var h=this.tryParseArgumentClose(i);if(h.err)return h;var v=E(i,this.clonePosition());if(l&&Kr(l?.style,"::",0)){var x=Ri(l.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(x,l.styleLocation);return p.err?p:{val:{type:S.number,value:n,location:v,style:p.val},err:null}}else{if(x.length===0)return this.error(d.EXPECT_DATE_TIME_SKELETON,v);var f={type:ae.dateTime,pattern:x,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?jr(x):{}},w=a==="date"?S.date:S.time;return{val:{type:w,value:n,location:v,style:f},err:null}}}return{val:{type:a==="number"?S.number:a==="date"?S.date:S.time,value:n,location:v,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var A=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(d.EXPECT_SELECT_ARGUMENT_OPTIONS,E(A,g({},A)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),_=0;if(a!=="select"&&y.value==="offset"){if(!this.bumpIf(":"))return this.error(d.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,E(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(d.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,d.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),y=this.parseIdentifierIfPossible(),_=p.val}var P=this.tryParsePluralOrSelectOptions(t,a,r,y);if(P.err)return P;var h=this.tryParseArgumentClose(i);if(h.err)return h;var D=E(i,this.clonePosition());return a==="select"?{val:{type:S.select,value:n,options:en(P.val),location:D},err:null}:{val:{type:S.plural,value:n,options:en(P.val),offset:_,pluralType:a==="plural"?"cardinal":"ordinal",location:D},err:null}}default:return this.error(d.INVALID_ARGUMENT_TYPE,E(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(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(d.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,E(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=qr(t)}catch{return this.error(d.INVALID_NUMBER_SKELETON,r)}return{val:{type:ae.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Qr(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,l=i.value,u=i.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(d.EXPECT_PLURAL_ARGUMENT_SELECTOR,d.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=E(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?d.DUPLICATE_SELECT_ARGUMENT_SELECTOR:d.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(s=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?d.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:d.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,E(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(t+1,r,n);if(h.err)return h;var v=this.tryParseArgumentClose(m);if(v.err)return v;a.push([l,{value:h.val,location:E(m,this.clonePosition())}]),c.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,u=o.location}return a.length===0?this.error(r==="select"?d.EXPECT_SELECT_ARGUMENT_SELECTOR:d.EXPECT_PLURAL_ARGUMENT_SELECTOR,E(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(d.MISSING_OTHER_CLAUSE,E(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=E(i,this.clonePosition());return o?(s*=n,Ii(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=tn(this.message,t);if(r===void 0)throw Error("Offset "+t+" is at invalid UTF-16 code unit boundary");return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Kr(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&on(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 Ht(e){return e>=97&&e<=122||e>=65&&e<=90}function Di(e){return Ht(e)||e===47}function Mi(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 on(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ki(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 Xt(e){e.forEach(function(t){if(delete t.location,Ye(t)||ze(t))for(var r in t.options)delete t.options[r].location,Xt(t.options[r].value);else Be(t)&&Qe(t.style)||($e(t)||qe(t))&&Ne(t.style)?delete t.style.location:Ze(t)&&Xt(t.children)})}function sn(e,t){t===void 0&&(t={}),t=g({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new nn(e,t).parse();if(r.err){var n=SyntaxError(d[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Xt(r.val),r.val}function Ie(e,t){var r=t&&t.cache?t.cache:Hi,n=t&&t.serializer?t.serializer:ji,i=t&&t.strategy?t.strategy:Fi;return i(e,{cache:r,serializer:n})}function Gi(e){return e==null||typeof e=="number"||typeof e=="boolean"}function an(e,t,r,n){var i=Gi(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function cn(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 Bt(e,t,r,n,i){return r.bind(t,e,n,i)}function Fi(e,t){var r=e.length===1?an:cn;return Bt(e,this,r,t.cache.create(),t.serializer)}function Vi(e,t){return Bt(e,this,cn,t.cache.create(),t.serializer)}function Wi(e,t){return Bt(e,this,an,t.cache.create(),t.serializer)}var ji=function(){return JSON.stringify(arguments)};function $t(){this.cache=Object.create(null)}$t.prototype.get=function(e){return this.cache[e]};$t.prototype.set=function(e,t){this.cache[e]=t};var Hi={create:function(){return new $t}},Je={variadic:Vi,monadic:Wi};var ce;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(ce||(ce={}));var Re=function(e){Ce(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var qt=function(e){Ce(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'+r+'": "'+n+'". Options are "'+Object.keys(i).join('", "')+'"',ce.INVALID_VALUE,o)||this}return t}(Re);var un=function(e){Ce(t,e);function t(r,n,i){return e.call(this,'Value for "'+r+'" must be of type '+n,ce.INVALID_VALUE,i)||this}return t}(Re);var ln=function(e){Ce(t,e);function t(r,n){return e.call(this,'The intl string context variable "'+r+'" was not provided to the string "'+n+'"',ce.MISSING_VALUE,n)||this}return t}(Re);var I;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(I||(I={}));function Xi(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==I.literal||r.type!==I.literal?t.push(r):n.value+=r.value,t},[])}function Bi(e){return typeof e=="function"}function Ue(e,t,r,n,i,o,s){if(e.length===1&&Mt(e[0]))return[{type:I.literal,value:e[0].value}];for(var a=[],c=0,l=e;ct in e?Sr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Zn=(e,t)=>{for(var r in t)Sr(e,r,{get:t[r],enumerable:!0})};var me=(e,t,r)=>(zn(e,typeof t!="symbol"?t+"":t,r),r);var Pe;(function(e){e.ServerError="ServerError",e.ClientError="ClientError",e.UnexpectedError="UnexpectedError"})(Pe||(Pe={}));var Pr=(e,t,r)=>({type:(i=>i>=500?Pe.ServerError:i<400?Pe.UnexpectedError:Pe.ClientError)(e),message:t,originatingRequest:r,status:e});var Qn=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},ke;(function(e){e.AUTHORIZATION="Authorization",e.X_API_KEY="X-Api-Key"})(ke||(ke={}));var bt=class{constructor(t){this.fetchOptions=t}commonHeaders(){let t={};return this.fetchOptions.apiKey&&(t[ke.X_API_KEY]=this.fetchOptions.apiKey),this.fetchOptions.accessToken&&(t[ke.AUTHORIZATION]=`Bearer ${this.fetchOptions.accessToken}`),t}transformData(t,r){return r?t.map(n=>r(n)):t.map(n=>this.identifyTransform(n))}transformDatum(t,r){return r?r(t):this.identifyTransform(t)}identifyTransform(t){return t}failOnBadStatusOrParseBody(t,r){return Qn(this,void 0,void 0,function*(){if(t.ok)return t.json().then(i=>({headers:t.headers,status:t.status,statusText:t.statusText,data:i}));let n=yield t.text();return Promise.reject(Pr(t.status,n,r))})}buildUrl(t,r,n,i,o){var s;let a=(s=this.fetchOptions.baseUrl)!==null&&s!==void 0?s:i(this.fetchOptions.env),c=o(r,n);return this.generateUrl(a,t,c)}generateUrl(t,r,n){let i=new URL(r,t);return n&&(i.search=this.convertToSearchParams(n).toString()),i.toString()}convertToSearchParams(t){return new URLSearchParams(t)}setParams(t,r,n){n!=null&&typeof n=="boolean"?t[r]=String(n):n&&(t[r]=n)}},_t=bt;var V;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(V||(V={}));var Ae;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(Ae||(Ae={}));var ie;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(ie||(ie={}));var oe;(function(e){e.V2="UCv2",e.V3="UCv3"})(oe||(oe={}));var te;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})(te||(te={}));var St=function(e){var t;return(t=Jn.get(e))!==null&&t!==void 0?t:e},Jn=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var Ar=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o};function we(e,t,r){var n,i;try{for(var o=Ar(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=wr(s.value,2),c=a[0],l=a[1];l!=null&&r.has(c)&&t.set(St(c),l)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}function Ge(e){switch(e){case V.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function Fe(e,t){var r,n;for(var i in e){var o=e[i];try{for(var s=(r=void 0,Ar(Object.entries(o))),a=s.next();!a.done;a=s.next()){var c=wr(a.value,2),l=c[0],u=c[1];if(u!=null){var p=St(l);t.set("items["+i+"]["+p+"]",u)}}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}var Kn=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Or(e){ni(e);var t=e.env,r=e.items,n=e.workflowStep,i=Kn(e,["env","items","workflowStep"]),o=new URL(Ge(t));return o.pathname=n+"/",Fe(r,o.searchParams),we(i,o.searchParams,ti),o.toString()}var ti=new Set(["clientId","country","language","context","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","authCode","campaignid","appctxid"]),ri=["env","workflowStep","clientId","country","items"];function ni(e){var t,r;try{for(var n=ei(ri),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!0}var ii=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},si="/store/";function Pt(e){ci(e);var t=e.env,r=e.items,n=e.workflowStep,i=e.marketSegment,o=e.offerType,s=e.productArrangementCode,a=ii(e,["env","items","workflowStep","marketSegment","offerType","productArrangementCode"]),c={marketSegment:i,offerType:o,productArrangementCode:s},l=new URL(Ge(t));return l.pathname=""+si+n,n!==te.SEGMENTATION?Fe(r,l.searchParams):we(c,l.searchParams,Lr),we(a,l.searchParams,Lr),l.toString()}var Lr=new Set(["clientId","country","language","context","landscape","ctxRtUrl","jit","productArrangementCode","marketSegment","offerType","checkoutPromoCode","svar","usid","rUrl","otac","nglwfdata","appctxid","promoid","sdid","trackingid","mv","ai","sc","csm","th","thm","lo","gsp","so.su","so.ca","so.va","so.tr","context.guid","af","rf"]),ai=["env","workflowStep","clientId","country"];function ci(e){var t,r;try{for(var n=oi(ai),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(e.workflowStep!==te.SEGMENTATION&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function At(e,t){switch(e){case oe.V2:return Or(t);case oe.V3:return Pt(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Pt(t)}}var wt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(wt||(wt={}));var N;(function(e){e.MONTH="MONTH",e.YEAR="YEAR",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.PERPETUAL="PERPETUAL"})(N||(N={}));var L;(function(e){e.ANNUAL="ANNUAL",e.MONTHLY="MONTHLY",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS"})(L||(L={}));var Ot;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Ot||(Ot={}));var Lt;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Lt||(Lt={}));var Ct;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Ct||(Ct={}));var Nt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Nt||(Nt={}));var ui=ie.PUBLISHED,Cr=e=>{switch(e){case V.PRODUCTION:return"https://wcs.adobe.io";case V.STAGE:return"https://wcs-stage.adobe.io";case V.LOCAL:return"http://localhost:3002";default:return"https://wcs-stage.adobe.io"}},Nr=(e,t)=>{var r;return e.api_key=t.apiKey,e.landscape=(r=t.landscape)!==null&&r!==void 0?r:ui,e};var li=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},It=class extends _t{constructor(t){super(t),this.apiPaths={getWebCommerceArtifact:"web_commerce_artifact"},this.getWebCommerceArtifact=(r,n,i,o)=>li(this,void 0,void 0,function*(){let s=this.buildUrl(this.apiPaths.getWebCommerceArtifact,n,r,a=>Cr(a),(a,c)=>this.evaluateGetWebCommerceArtifactParams(a,c));return this.fetchOptions.fetch(s,{signal:o,headers:Object.assign({},this.commonHeaders()),mode:"cors"}).then(a=>this.failOnBadStatusOrParseBody(a,`GET ${s}`)).then(a=>{let l=a.data;return{data:this.transformDatum(l,i)}})})}evaluateGetWebCommerceArtifactParams(t,r){let n={};return this.setParams(n,"offer_selector_ids",r.offerSelectorIds.join(",")),this.setParams(n,"country",r.country),this.setParams(n,"language",r.language),this.setParams(n,"currency",r.currency),this.setParams(n,"locale",r.locale),this.setParams(n,"promotion_code",r.promotionCode),Nr(n,t)}},Ir=It;var Ve=e=>new Ir(e).getWebCommerceArtifact;var Rr="tacocat.js";var je=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),Ur=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function O(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=he(n)?n:e;o=s.get(a)}if(i&&o==null){let s=he(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=kr(he(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var de=()=>{};var Dr=e=>typeof e=="boolean",se=e=>typeof e=="function",We=e=>typeof e=="number",Mr=e=>e!=null&&typeof e=="object";var he=e=>typeof e=="string",Rt=e=>he(e)&&e,Ee=e=>We(e)&&Number.isFinite(e)&&e>0;function ge(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function b(e,t){if(Dr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Q(e,t,r){let n=Object.values(t);return n.find(i=>je(i,e))??r??n[0]}function kr(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function xe(e,t=1){return We(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var fi=Date.now(),Ut=()=>`(+${Date.now()-fi}ms)`,He=new Set,pi=b(O("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Gr(e){let t=`[${Rr}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=pi?(s,...a)=>{console.debug(`${t} ${s}`,...a,Ut())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;He.forEach(([l])=>l(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;He.forEach(([,l])=>l(c,...a))}}}function mi(e,t){let r=[e,t];return He.add(r),()=>{He.delete(r)}}mi((e,...t)=>{console.error(e,...t,Ut())},(e,...t)=>{console.warn(e,...t,Ut())});var hi="no promo",Fr="promo-tag",di="yellow",Ei="neutral",gi=(e,t,r)=>{let n=o=>o||hi,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},xi="cancel-context",Oe=(e,t)=>{let r=e===xi,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?Fr:`${Fr} no-promo`,text:gi(s,t,i),variant:o?di:Ei,isOverriden:i}};var Dt=function(e,t){return Dt=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])},Dt(e,t)};function Le(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Dt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var g=function(){return g=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(Ti,function(a,c,l,u,p,f){if(c)t.minimumIntegerDigits=l.length;else{if(u&&p)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(zr.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Xr.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Xr,function(a,c,l,u,p,f){return l==="*"?t.minimumFractionDigits=c.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""}),i.options.length&&(t=g(g({},t),Br(i.options[0])));continue}if(Yr.test(i.stem)){t=g(g({},t),Br(i.stem));continue}var o=Zr(i.stem);o&&(t=g(g({},t),o));var s=bi(i.stem);s&&(t=g(g({},t),s))}return t}var Gt,_i=new RegExp("^"+kt.source+"*"),Si=new RegExp(kt.source+"*$");function E(e,t){return{start:e,end:t}}var Pi=!!String.prototype.startsWith,Ai=!!String.fromCodePoint,wi=!!Object.fromEntries,Oi=!!String.prototype.codePointAt,Li=!!String.prototype.trimStart,Ci=!!String.prototype.trimEnd,Ni=!!Number.isSafeInteger,Ii=Ni?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Vt=!0;try{Jr=rn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Vt=((Gt=Jr.exec("a"))===null||Gt===void 0?void 0:Gt[0])==="a"}catch{Vt=!1}var Jr,Kr=Pi?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},jt=Ai?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},en=wi?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Ri=Li?function(t){return t.trimStart()}:function(t){return t.replace(_i,"")},Ui=Ci?function(t){return t.trimEnd()}:function(t){return t.replace(Si,"")};function rn(e,t){return new RegExp(e,t)}var Wt;Vt?(Ft=rn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Wt=function(t,r){var n;Ft.lastIndex=r;var i=Ft.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Wt=function(t,r){for(var n=[];;){var i=tn(t,r);if(i===void 0||on(i)||ki(i))break;n.push(i),r+=i>=65536?2:1}return jt.apply(void 0,n)};var Ft,nn=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:_.pound,location:E(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(d.UNMATCHED_CLOSING_TAG,E(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&Ht(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:_.literal,value:"<"+i+"/>",location:E(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:_.tag,value:i,children:s,location:E(n,this.clonePosition())},err:null}:this.error(d.INVALID_TAG,E(a,this.clonePosition())))}else return this.error(d.UNCLOSED_TAG,E(n,this.clonePosition()))}else return this.error(d.INVALID_TAG,E(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Mi(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=E(n,this.clonePosition());return{val:{type:_.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Di(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return jt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),jt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(d.EMPTY_ARGUMENT,E(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(d.MALFORMED_ARGUMENT,E(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:_.argument,value:i,location:E(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(d.MALFORMED_ARGUMENT,E(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Wt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=E(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(d.EXPECT_ARGUMENT_TYPE,E(s,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=Ui(p.val);if(f.length===0)return this.error(d.EXPECT_ARGUMENT_STYLE,E(this.clonePosition(),this.clonePosition()));var m=E(u,this.clonePosition());l={style:f,styleLocation:m}}var h=this.tryParseArgumentClose(i);if(h.err)return h;var T=E(i,this.clonePosition());if(l&&Kr(l?.style,"::",0)){var x=Ri(l.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(x,l.styleLocation);return p.err?p:{val:{type:_.number,value:n,location:T,style:p.val},err:null}}else{if(x.length===0)return this.error(d.EXPECT_DATE_TIME_SKELETON,T);var f={type:ae.dateTime,pattern:x,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Wr(x):{}},w=a==="date"?_.date:_.time;return{val:{type:w,value:n,location:T,style:f},err:null}}}return{val:{type:a==="number"?_.number:a==="date"?_.date:_.time,value:n,location:T,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var P=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(d.EXPECT_SELECT_ARGUMENT_OPTIONS,E(P,g({},P)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),A=0;if(a!=="select"&&y.value==="offset"){if(!this.bumpIf(":"))return this.error(d.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,E(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(d.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,d.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),y=this.parseIdentifierIfPossible(),A=p.val}var S=this.tryParsePluralOrSelectOptions(t,a,r,y);if(S.err)return S;var h=this.tryParseArgumentClose(i);if(h.err)return h;var D=E(i,this.clonePosition());return a==="select"?{val:{type:_.select,value:n,options:en(S.val),location:D},err:null}:{val:{type:_.plural,value:n,options:en(S.val),offset:A,pluralType:a==="plural"?"cardinal":"ordinal",location:D},err:null}}default:return this.error(d.INVALID_ARGUMENT_TYPE,E(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(d.EXPECT_ARGUMENT_CLOSING_BRACE,E(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(d.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,E(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=qr(t)}catch{return this.error(d.INVALID_NUMBER_SKELETON,r)}return{val:{type:ae.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Qr(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,l=i.value,u=i.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(d.EXPECT_PLURAL_ARGUMENT_SELECTOR,d.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=E(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?d.DUPLICATE_SELECT_ARGUMENT_SELECTOR:d.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(s=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?d.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:d.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,E(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(t+1,r,n);if(h.err)return h;var T=this.tryParseArgumentClose(m);if(T.err)return T;a.push([l,{value:h.val,location:E(m,this.clonePosition())}]),c.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,u=o.location}return a.length===0?this.error(r==="select"?d.EXPECT_SELECT_ARGUMENT_SELECTOR:d.EXPECT_PLURAL_ARGUMENT_SELECTOR,E(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(d.MISSING_OTHER_CLAUSE,E(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=E(i,this.clonePosition());return o?(s*=n,Ii(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=tn(this.message,t);if(r===void 0)throw Error("Offset "+t+" is at invalid UTF-16 code unit boundary");return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Kr(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&on(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 Ht(e){return e>=97&&e<=122||e>=65&&e<=90}function Di(e){return Ht(e)||e===47}function Mi(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 on(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ki(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 Xt(e){e.forEach(function(t){if(delete t.location,Ye(t)||ze(t))for(var r in t.options)delete t.options[r].location,Xt(t.options[r].value);else Be(t)&&Qe(t.style)||($e(t)||qe(t))&&Ce(t.style)?delete t.style.location:Ze(t)&&Xt(t.children)})}function sn(e,t){t===void 0&&(t={}),t=g({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new nn(e,t).parse();if(r.err){var n=SyntaxError(d[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Xt(r.val),r.val}function Ne(e,t){var r=t&&t.cache?t.cache:Hi,n=t&&t.serializer?t.serializer:Wi,i=t&&t.strategy?t.strategy:Fi;return i(e,{cache:r,serializer:n})}function Gi(e){return e==null||typeof e=="number"||typeof e=="boolean"}function an(e,t,r,n){var i=Gi(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function cn(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 Bt(e,t,r,n,i){return r.bind(t,e,n,i)}function Fi(e,t){var r=e.length===1?an:cn;return Bt(e,this,r,t.cache.create(),t.serializer)}function Vi(e,t){return Bt(e,this,cn,t.cache.create(),t.serializer)}function ji(e,t){return Bt(e,this,an,t.cache.create(),t.serializer)}var Wi=function(){return JSON.stringify(arguments)};function $t(){this.cache=Object.create(null)}$t.prototype.get=function(e){return this.cache[e]};$t.prototype.set=function(e,t){this.cache[e]=t};var Hi={create:function(){return new $t}},Je={variadic:Vi,monadic:ji};var ce;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(ce||(ce={}));var Ie=function(e){Le(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var qt=function(e){Le(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'+r+'": "'+n+'". Options are "'+Object.keys(i).join('", "')+'"',ce.INVALID_VALUE,o)||this}return t}(Ie);var un=function(e){Le(t,e);function t(r,n,i){return e.call(this,'Value for "'+r+'" must be of type '+n,ce.INVALID_VALUE,i)||this}return t}(Ie);var ln=function(e){Le(t,e);function t(r,n){return e.call(this,'The intl string context variable "'+r+'" was not provided to the string "'+n+'"',ce.MISSING_VALUE,n)||this}return t}(Ie);var I;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(I||(I={}));function Xi(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==I.literal||r.type!==I.literal?t.push(r):n.value+=r.value,t},[])}function Bi(e){return typeof e=="function"}function Re(e,t,r,n,i,o,s){if(e.length===1&&Mt(e[0]))return[{type:I.literal,value:e[0].value}];for(var a=[],c=0,l=e;c0?e.substring(0,n):"";let i=mn(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(Zi);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 Ji(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,Ki(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 Ki(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},zt=(e,t)=>({accept:e,round:t}),io=[zt(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),zt(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),zt(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],yn={[N.YEAR]:{[L.MONTHLY]:Ke.MONTH,[L.ANNUAL]:Ke.YEAR},[N.MONTH]:{[L.MONTHLY]:Ke.MONTH}},oo=(e,t)=>e.indexOf(`'${t}'`)===0,so=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=bn(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+co(e)),r},ao=e=>{let t=uo(e),r=oo(e,t),n=e.replace(/'.*?'/,""),i=gn.test(n)||xn.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},vn=e=>e.replace(gn,En).replace(xn,En),co=e=>e.match(/#(.?)#/)?.[1]===dn?to:dn,uo=e=>e.match(/'(.*?)'/)?.[1]??"",bn=e=>e.match(/0(.?)0/)?.[1]??"";function Tn({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=ao(e),l=r?bn(e):"",u=so(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),m=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):hn(u,f),h=r?m.lastIndexOf(l):m.length,v=m.substring(0,h),x=m.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,m).replace(/SYMBOL/,s),currencySymbol:s,decimals:x,decimalsDelimiter:l,hasCurrencySpace:c,integer:v,isCurrencyFirst:a,recurrenceTerm:i}}var Sn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=ro[r]??1;return Tn(e,i>1?Ke.MONTH:yn[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=io.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(no[s]??(u=>u))(c(a))})},Pn=({commitment:e,term:t,...r})=>Tn(r,yn[e]?.[t]);var lo={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},fo=Gr("ConsonantTemplates/price"),po=/<.+?>/g,M={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",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"},ue={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},mo="TAX_EXCLUSIVE",ho=e=>Mr(e)?Object.entries(e).filter(([,t])=>he(t)||je(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+Ur(n)+'"'}`,""):"",j=(e,t,r,n=!1)=>`${n?vn(t):t??""}`;function Eo(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=j(M.currencySymbol,r),m=j(M.currencySpace,o?" ":""),h="";return a&&(h+=f+m),h+=j(M.integer,s),h+=j(M.decimalsDelimiter,i),h+=j(M.decimals,n),a||(h+=m+f),h+=j(M.recurrence,c,null,!0),h+=j(M.unitType,l,null,!0),h+=j(M.taxInclusivity,u,!0),j(e,h,{...p,"aria-label":t})}var ve=({displayOptical:e=!1,displayStrikethrough:t=!1}={})=>({country:r,displayFormatted:n=!0,displayRecurrence:i=!0,displayPerUnit:o=!1,displayTax:s=!1,language:a,literals:c={}}={},{commitment:l,formatString:u,price:p,priceWithoutDiscount:f,taxDisplay:m,taxTerm:h,term:v,usePrecision:x}={},w={})=>{Object.entries({country:r,formatString:u,language:a,price:p}).forEach(([Z,vt])=>{if(vt==null)throw new Error(`Argument "${Z}" is missing`)});let A={...lo,...c},y=`${a.toLowerCase()}-${r.toUpperCase()}`;function _(Z,vt){let bt=A[Z];if(bt==null)return"";try{return new pn(bt.replace(po,""),y).format(vt)}catch{return fo.error("Failed to format literal:",bt),""}}let P=t&&f?f:p,{accessiblePrice:D,recurrenceTerm:G,...C}=(e?Sn:Pn)({commitment:l,formatString:u,term:v,price:e?p:P,usePrecision:x,isIndianPrice:r==="IN"}),F=D,K="";if(T(i)&&G){let Z=_(ue.recurrenceAriaLabel,{recurrenceTerm:G});Z&&(F+=" "+Z),K=_(ue.recurrenceLabel,{recurrenceTerm:G})}let ee="";if(T(o)){ee=_(ue.perUnitLabel,{perUnit:"LICENSE"});let Z=_(ue.perUnitAriaLabel,{perUnit:"LICENSE"});Z&&(F+=" "+Z)}let W="";T(s)&&h&&(W=_(m===mo?ue.taxExclusiveLabel:ue.taxInclusiveLabel,{taxTerm:h}),W&&(F+=" "+W)),t&&(F=_(ue.strikethroughAriaLabel,{strikethroughPrice:F}));let z=M.container;if(e&&(z+=" "+M.containerOptical),t&&(z+=" "+M.containerStrikethrough),T(n))return Eo(z,{...C,accessibleLabel:F,recurrenceLabel:K,perUnitLabel:ee,taxInclusivityLabel:W},w);let{currencySymbol:fe,decimals:ke,decimalsDelimiter:yt,hasCurrencySpace:Sr,integer:$n,isCurrencyFirst:qn}=C,pe=[$n,yt,ke];qn?(pe.unshift(Sr?"\xA0":""),pe.unshift(fe)):(pe.push(Sr?"\xA0":""),pe.push(fe)),pe.push(K,ee,W);let Yn=pe.join("");return j(z,Yn,w)},An=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||T(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${ve()(e,t,r)}${i?" "+ve({displayStrikethrough:!0})(e,t,r):""}`};var Zt=ve(),Qt=An(),Jt=ve({displayOptical:!0}),Kt=ve({displayStrikethrough:!0});var go=(e,t)=>{if(!(!ge(e)||!ge(t)))return Math.floor((t-e)/t*100)},_n=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=go(n,i);return o===void 0?'':`${o}%`};var er=_n();var tr="ABM",rr="PUF",nr="M2M",ir="PERPETUAL",xo="TAX_INCLUSIVE_DETAILS",yo="TAX_EXCLUSIVE",wn={ABM:tr,PUF:rr,M2M:nr,PERPETUAL:ir},Ia={[tr]:{commitment:N.YEAR,term:L.MONTHLY},[rr]:{commitment:N.YEAR,term:L.ANNUAL},[nr]:{commitment:N.MONTH,term:L.MONTHLY},[ir]:{commitment:N.PERPETUAL,term:void 0}},On="Value is not an offer",or=e=>{if(typeof e!="object")return On;let{commitment:t,term:r}=e,n=vo(t,r);return{...e,planType:n}};var vo=(e,t)=>{if(e===void 0)return On;if(e===""&&t==="")return"";let r="";return e===N.YEAR?t===L.MONTHLY?r=tr:t===L.ANNUAL&&(r=rr):e===N.MONTH?t===L.MONTHLY&&(r=nr):e===N.PERPETUAL&&(r=ir),r};function sr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==xo)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:yo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:re}=Object,H=re({...oe}),X=re({...te}),B=re({...V}),ar=re({...N}),be=re({...we}),De=re({...ie}),cr=re({...wn}),ur=re({...L});var hr={};Zn(hr,{CLASS_NAME_FAILED:()=>et,CLASS_NAME_PENDING:()=>tt,CLASS_NAME_RESOLVED:()=>rt,ERROR_MESSAGE_BAD_REQUEST:()=>lr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>pr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>fr,EVENT_TYPE_ERROR:()=>bo,EVENT_TYPE_FAILED:()=>nt,EVENT_TYPE_PENDING:()=>it,EVENT_TYPE_READY:()=>le,EVENT_TYPE_RESOLVED:()=>ot,LOG_NAMESPACE:()=>mr,STATE_FAILED:()=>$,STATE_PENDING:()=>q,STATE_RESOLVED:()=>Y,TAG_NAME_SERVICE:()=>J});var et="placeholder-failed",tt="placeholder-pending",rt="placeholder-resolved",lr="Bad WCS request",fr="Commerce offer not found",pr="Literals URL not provided",bo="wcms:commerce:error",nt="wcms:placeholder:failed",it="wcms:placeholder:pending",le="wcms:commerce:ready",ot="wcms:placeholder:resolved",mr="wcms/commerce",$="failed",q="pending",Y="resolved",J="wcms-commerce";var dr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Ln=new Set,To=e=>e instanceof Error||typeof e.originatingRequest=="string";function Cn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!dr.serializableTypes.includes(r))return r}return e}function So(e,t){if(!dr.ignoredProperties.includes(e))return Cn(t)}var Er={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=dr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(To(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Cn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,So)),Ln.has(c)||(Ln.add(c),window.lana.log(c,{sampleRate:r,tags:n,clientId:i}))}};var b=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:H.V3,checkoutWorkflowStep:X.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:B.PRODUCTION,forceTaxExclusive:!1,language:"en",promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:be.PRODUCTION,wcsLandscape:De.PUBLISHED,wcsBufferLimit:1});function Nn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(J);i!==r&&(r=i,i&&e(i))}return document.addEventListener(le,n,{once:t}),ne(n),()=>document.removeEventListener(le,n)}function In(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(sr)),i}var ne=e=>window.setTimeout(e);function Te(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(ye).filter(ge);return r.length||(r=[t]),r}function st(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Rt)}function k(){return document.head.querySelector(J)}var Po="en-US",Ao={africa:"en-ZA",mena_en:"en-DZ",il_he:"iw-IL",mena_ar:"ar-DZ",id_id:"in-ID",no:"nb-NO",cis_en:"en-AZ",cis_ru:"ru-AZ",sea:"en-SG",la:"es-DO"},Se=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"}),_o=["ar","bg","cs","da","de","en","es","et","fi","fr","he","hu","it","ja","ko","lt","lv","nb","nl","pl","pt","ro","ru","sk","sl","sv","tr","uk","zh_CN","zh_TW"];function Rn({locale:e={}}={}){let t=Ao[e.prefix?.replace("/","")??""]??e.ietf??Po,[r=b.language,n=b.country]=t.split("-",2);return n=n.toUpperCase(),r=(_o.some(i=>de(i,r))?r:b.language).toLowerCase(),{country:n,language:r,locale:`${r}_${n}`}}function gr({commerce:e={},locale:t=void 0}={}){let n=Q(O("commerce.env",e,{metadata:!1}),Se,Se.PROD)===Se.PROD?B.PRODUCTION:B.STAGE,i=O("checkoutClientId",e)??b.checkoutClientId,o=Q(O("checkoutWorkflow",e),H,b.checkoutWorkflow),s=X.CHECKOUT;o===H.V3&&(s=Q(O("checkoutWorkflowStep",e),X,b.checkoutWorkflowStep));let a=T(O("displayOldPrice",e),b.displayOldPrice),c=T(O("displayPerUnit",e),b.displayPerUnit),l=T(O("displayRecurrence",e),b.displayRecurrence),u=T(O("displayTax",e),b.displayTax),p=T(O("forceTaxExclusive",e),b.forceTaxExclusive),f=O("promotionCode",e)??b.promotionCode,m=Te(O("quantity",e)),h=O("wcsApiKey",e)??b.wcsApiKey,v=Q(O("wcsLandscape",e),De,b.wcsLandscape),x=ye(O("wcsBufferDelay",e),b.wcsBufferDelay),w=ye(O("wcsBufferLimit",e),b.wcsBufferLimit);return{...Rn({locale:t}),displayOldPrice:a,checkoutClientId:i,checkoutWorkflow:o,checkoutWorkflowStep:s,displayPerUnit:c,displayRecurrence:l,displayTax:u,env:n,forceTaxExclusive:p,priceLiteralsURL:e.priceLiteralsURL,promotionCode:f,quantity:m,wcsApiKey:h,wcsBufferDelay:x,wcsBufferLimit:w,wcsEnv:n===B.STAGE?be.STAGE:be.PRODUCTION,wcsLandscape:v}}var Dn="debug",wo="error",Oo="info",Lo="warn",Co=Date.now(),xr=new Set,yr=new Set,Un=new Map,Me=Object.freeze({DEBUG:Dn,ERROR:wo,INFO:Oo,WARN:Lo}),Mn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},kn={filter:({level:e})=>e!==Dn},No={filter:()=>!1};function Io(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;se(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Co}}function Ro(e){[...yr].every(t=>t(e))&&xr.forEach(t=>t(e))}function Gn(e){let t=(Un.get(e)??0)+1;Un.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>Ro(Io(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Gn(`${i.namespace}/${o}`)},debug:n(Me.DEBUG),error:n(Me.ERROR),info:n(Me.INFO),warn:n(Me.WARN)});return i}function at(...e){e.forEach(t=>{let{append:r,filter:n}=t;se(n)?yr.add(n):se(r)&&xr.add(r)})}function Uo(e={}){let{name:t}=e,r=T(O("commerce.debug",{search:!0,storage:!0}),t===Se.LOCAL);return at(r?Mn:kn),t===Se.PROD&&at(Er),U}function Do(){xr.clear(),yr.clear()}var U={...Gn(mr),Level:Me,Plugins:{consoleAppender:Mn,debugFilter:kn,quietFilter:No,lanaAppender:Er},init:Uo,reset:Do,use:at};var Mo={CLASS_NAME_FAILED:et,CLASS_NAME_PENDING:tt,CLASS_NAME_RESOLVED:rt,EVENT_TYPE_FAILED:nt,EVENT_TYPE_PENDING:it,EVENT_TYPE_RESOLVED:ot,STATE_FAILED:$,STATE_PENDING:q,STATE_RESOLVED:Y},ko={[$]:et,[q]:tt,[Y]:rt},Go={[$]:nt,[q]:it,[Y]:ot},lt=new WeakMap;function R(e){if(!lt.has(e)){let t=U.module(e.constructor.is);lt.set(e,{changes:new Map,connected:!1,controlled:!1,dispose:Ee,error:void 0,log:t,options:void 0,promises:[],state:q,timer:null,value:void 0,version:0})}return lt.get(e)}function ct(e){let t=R(e),{error:r,promises:n,state:i}=t;(i===Y||i===$)&&(t.promises=[],i===Y?n.forEach(({resolve:o})=>o(e)):i===$&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(Go[i],{bubbles:!0}))}function ut(e){let t=lt.get(e);[$,q,Y].forEach(r=>{e.classList.toggle(ko[r],r===t.state)})}var Fo={get controlled(){return R(this).controlled},get error(){return R(this).error},get log(){return R(this).log},get options(){return R(this).options},get state(){return R(this).state},get value(){return R(this).value},attributeChangedCallback(e,t,r){R(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){R(this).dispose=Nn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=R(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=Ee},onceSettled(){let{error:e,promises:t,state:r}=R(this);return Y===r?Promise.resolve(this):$===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=R(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=Y,n.value=t,ut(this),this.log.debug("Resolved:",{element:this,value:t}),ne(()=>ct(this)),!0)},toggleFailed(e,t,r){let n=R(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=$,ut(this),n.log.error("Failed:",{element:this,error:t}),ne(()=>ct(this)),!0)},togglePending(e){let t=R(this);return t.version++,e&&(t.options=e),t.state=q,ut(this),ne(()=>ct(this)),t.version},stopUpdates(){R(this).controlled=!0},requestUpdate(e=!1){if(!this.isConnected||!k())return;let t=R(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=q,t.timer=ne(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===q&&t.version===s&&(t.state=i,t.error=r,t.value=o,ut(this),ct(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Fn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function ft(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Fn(t)),i}function pt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(Fo)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Mo)),window.customElements.define(r,i,{extends:t})),i}function mt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function ht(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Fn(t)),e):null}var Pe=class Pe extends HTMLAnchorElement{static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi"]}static createCheckoutLink(t={},r=""){let n=k();if(!n)return null;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,perpetual:a,promotionCode:c,quantity:l,wcsOsi:u}=n.collectCheckoutOptions(t),p=ft(Pe,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,perpetual:a,promotionCode:c,quantity:l,wcsOsi:u});return r&&(p.innerHTML=r),p}static getCheckoutLinks(t){return mt(Pe,t)}get isCheckoutLink(){return!0}get placeholder(){return this}async render(t={}){if(!this.isConnected||this.placeholder.controlled)return!1;let r=k();if(!r)return!1;this.dataset.imsCountry||r.imsCountry.then(s=>{s&&(this.dataset.imsCountry=s)},Ee);let n=r.collectCheckoutOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.href="";let o=r.resolveOfferSelectors(n);return this.renderOffers((await Promise.all(o)).flat(),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return!1;let i=k();if(!i)return!1;let o=i.collectCheckoutOptions(r,this.placeholder);if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.href=i.buildCheckoutURL(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.href="",!0}return!1}updateOptions(t={}){let r=k();if(!r)return!1;let{checkoutMarketSegment:n,checkoutWorkflow:i,checkoutWorkflowStep:o,perpetual:s,promotionCode:a,quantity:c,wcsOsi:l}=r.collectCheckoutOptions(t);return ht(this,{checkoutMarketSegment:n,checkoutWorkflow:i,checkoutWorkflowStep:o,perpetual:s,promotionCode:a,quantity:c,wcsOsi:l}),!0}};me(Pe,"is","checkout-link"),me(Pe,"tag","a");var vr=Pe,dt=pt(vr);var Ae=class Ae extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let r=k();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return ft(Ae,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return mt(Ae,t)}get isInlinePrice(){return!0}get placeholder(){return this}async render(t={}){if(!this.isConnected||this.placeholder.controlled)return!1;let r=k();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(In(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=k();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=k();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return ht(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};me(Ae,"is","inline-price"),me(Ae,"tag","span");var br=Ae,Et=pt(br);function Vn({providers:e,settings:t}){let r=U.module("checkout");function n(a,c){let{checkoutClientId:l,checkoutWorkflow:u,checkoutWorkflowStep:p,country:f,language:m,promotionCode:h,quantity:v}=t,{checkoutMarketSegment:x,checkoutWorkflow:w=u,checkoutWorkflowStep:A=p,imsCountry:y,country:_=y??f,language:P=m,quantity:D=v,perpetual:G,promotionCode:C=h,wcsOsi:F,...K}=Object.assign({},c?.dataset??{},a??{}),ee=Q(w,H,b.checkoutWorkflow),W=X.CHECKOUT;ee===H.V3&&(W=Q(A,X,b.checkoutWorkflowStep));let z=xe({...K,checkoutClientId:l,checkoutMarketSegment:x,country:_,quantity:Te(D,b.quantity),checkoutWorkflow:ee,checkoutWorkflowStep:W,language:P,perpetual:T(G),promotionCode:Le(C).effectivePromoCode,wcsOsi:st(F)});if(c)for(let fe of e.checkout)fe(c,z);return z}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{env:l}=t,{checkoutClientId:u,checkoutMarketSegment:p,checkoutWorkflow:f,checkoutWorkflowStep:m,country:h,promotionCode:v,quantity:x,...w}=n(c),A=window.frameElement?"if":"fp",y={checkoutPromoCode:v,clientId:u,context:A,country:h,env:l,items:[],marketSegment:p,workflowStep:m,...w};if(a.length===1){let{offerId:P,offerType:D,productArrangementCode:G}=a[0],{marketSegments:[C]}=a[0];Object.assign(y,{marketSegment:C,offerType:D,productArrangementCode:G}),y.items.push(x[0]===1?{id:P}:{id:P,quantity:x[0]})}else y.items.push(...a.map(({offerId:P},D)=>({id:P,quantity:x[D]??b.quantity})));return _t(f,y)}let{createCheckoutLink:o,getCheckoutLinks:s}=dt;return{CheckoutLink:dt,CheckoutWorkflow:H,CheckoutWorkflowStep:X,buildCheckoutURL:i,collectCheckoutOptions:n,createCheckoutLink:o,getCheckoutLinks:s}}function Vo({interval:e=200,maxAttempts:t=25}={}){let r=U.module("ims");return new Promise(n=>{r.debug("Getting user country");let i=0;function o(){window.adobeIMS?window.adobeIMS.isSignedInUser()?window.adobeIMS.getProfile().then(({countryCode:s})=>{r.debug("Got user country:",s),n(s)},s=>{r.error("Unable to get user country:",s),n()}):(r.debug("User is not signed in"),n()):++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function Wn({}){return{imsCountry:Vo()}}async function jn(e){if(!e.priceLiteralsURL)throw new Error(pr);let t=await window.fetch(e.priceLiteralsURL),{data:r}=await t.json();if(Array.isArray(r)){let n=o=>r.find(s=>de(s.lang,o)),i=n(e.language)??n(b.language);if(i)return Object.freeze(i)}return{}}function Hn({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:m,forceTaxExclusive:h,language:v,promotionCode:x,quantity:w}=r,{displayOldPrice:A=u,displayPerUnit:y=p,displayRecurrence:_=f,displayTax:P=m,forceTaxExclusive:D=h,country:G=l,language:C=v,perpetual:F,promotionCode:K=x,quantity:ee=w,template:W,wcsOsi:z,...fe}=Object.assign({},c?.dataset??{},a??{}),ke=xe({...fe,country:G,displayOldPrice:T(A),displayPerUnit:T(y),displayRecurrence:T(_),displayTax:T(P),forceTaxExclusive:T(D),language:C,perpetual:T(F),promotionCode:Le(K).effectivePromoCode,quantity:Te(ee,b.quantity),template:W,wcsOsi:st(z)});if(c)for(let yt of t.price)yt(c,ke);return ke}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=er;break;case"strikethrough":u=Kt;break;case"optical":u=Jt;break;default:u=c.promotionCode?Qt:Zt}let p=n(c);p.literals=Object.assign({},e.price,xe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Et;return{InlinePrice:Et,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Wo={[B.PRODUCTION]:"https://wcs.adobe.com",[B.STAGE]:"https://wcs.stage.adobe.com"};function Xn({settings:e}){let t=U.module("wcs"),{env:r,wcsApiKey:n}=e,i={apiKey:n,baseUrl:Wo[r],fetch:window.fetch.bind(window)},o=We(i),s=new Map,a=new Map,c;async function l(f,m,h=!0){let v=fr;try{t.debug("Fetching:",f),f.offerSelectorIds=f.offerSelectorIds.sort();let{data:x}=await o(f,{apiKey:n,environment:e.wcsEnv,landscape:r===B.STAGE?"ALL":e.wcsLandscape},({resolvedOffers:A})=>({offers:A.map(or)}));t.debug("Fetched:",f,x);let{offers:w}=x??{};m.forEach(({resolve:A},y)=>{let _=w.filter(({offerSelectorIds:P})=>P.includes(y)).flat();_.length&&(m.delete(y),A(_))})}catch(x){x.status===404&&f.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(f.offerSelectorIds.map(w=>l({...f,offerSelectorIds:[w]},m,!1)))):(t.error("Failed:",f,x),v=lr)}h&&m.size&&(t.debug("Missing:",{offerSelectorIds:[...m.keys()]}),m.forEach(x=>{x.reject(new Error(v))}))}function u(){clearTimeout(c);let f=[...a.values()];a.clear(),f.forEach(({options:m,promises:h})=>l(m,h))}function p({country:f,language:m,perpetual:h=!1,promotionCode:v="",wcsOsi:x=[]}){let w=`${m}_${f}`;f!=="GB"&&(m=h?"EN":"MULT");let A=[f,m,v].filter(y=>y).join("-").toLowerCase();return x.map(y=>{let _=`${y}-${A}`;if(!s.has(_)){let P=new Promise((D,G)=>{let C=a.get(A);C||(C={options:{country:f,language:m,locale:w,offerSelectorIds:[]},promises:new Map},a.set(A,C)),v&&(C.options.promotionCode=v),C.options.offerSelectorIds.push(y),C.promises.set(y,{resolve:D,reject:G}),C.options.offerSelectorIds.length>=e.wcsBufferLimit?u():(t.debug("Queued:",C.options),c||(c=setTimeout(u,e.wcsBufferDelay)))});s.set(_,P)}return s.get(_)})}return{WcsCommitment:ar,WcsPlanType:cr,WcsTerm:ur,resolveOfferSelectors:p}}var gt,xt=null,Tr=class extends HTMLElement{get isWcmsCommerce(){return!0}};window.customElements.define(J,Tr);async function jo(e){let t=U.init(e.env).module("service");t.debug("Activating:",e);let r={price:{}},n=Object.freeze(gr(e));try{r.price=await jn(n)}catch(a){t.warn("Price literals were not fetched:",a)}let i={checkout:new Set,price:new Set},o=document.createElement(J),s={literals:r,providers:i,settings:n};return gt=Object.defineProperties(o,Object.getOwnPropertyDescriptors({...Vn(s),...Wn(s),...Hn(s),...Xn(s),...hr,Log:U,get defaults(){return b},get literals(){return r},get log(){return U},get providers(){return{checkout(a){return i.checkout.add(a),()=>i.checkout.delete(a)},price(a){return i.price.add(a),()=>i.price.delete(a)}}},get settings(){return n}})),t.debug("Activated:",{literals:r,settings:n,element:o}),document.head.append(o),ne(()=>{let a=new CustomEvent(le,{bubbles:!0,cancelable:!1,detail:gt});gt.dispatchEvent(a)}),gt}function Bn(){document.head.querySelector(J)?.remove(),xt=null,U.reset()}function Ho(e,t=!1){return se(e)?(t&&Bn(),xt??(xt=jo(e()))):xt||new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(le,n,{once:!0})})}export{dt as CheckoutLink,H as CheckoutWorkflow,X as CheckoutWorkflowStep,b as Defaults,Et as InlinePrice,U as Log,J as TAG_NAME_SERVICE,ar as WcsCommitment,be as WcsEnv,De as WcsLandscape,cr as WcsPlanType,ur as WcsTerm,Rn as getLocaleSettings,gr as getSettings,Ho as init,Bn as reset}; +`,ce.MISSING_INTL_API,s);var A=r.getPluralRules(t,{type:u.pluralType}).select(f-(u.offset||0));y=u.options[A]||u.options.other}if(!y)throw new qt(u.value,f,Object.keys(u.options),s);a.push.apply(a,Re(y.value,t,r,n,i,f-(u.offset||0)));continue}}return Xi(a)}function $i(e,t){return t?g(g(g({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=g(g({},e[n]),t[n]||{}),r},{})):e}function qi(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=$i(e[n],t[n]),r},g({},e)):e}function Yt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function Yi(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ne(function(){for(var t,r=[],n=0;n0?e.substring(0,n):"";let i=mn(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(Zi);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 Ji(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,Ki(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 Ki(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},zt=(e,t)=>({accept:e,round:t}),io=[zt(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),zt(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),zt(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],yn={[N.YEAR]:{[L.MONTHLY]:Ke.MONTH,[L.ANNUAL]:Ke.YEAR},[N.MONTH]:{[L.MONTHLY]:Ke.MONTH}},oo=(e,t)=>e.indexOf(`'${t}'`)===0,so=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Tn(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+co(e)),r},ao=e=>{let t=uo(e),r=oo(e,t),n=e.replace(/'.*?'/,""),i=gn.test(n)||xn.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},vn=e=>e.replace(gn,En).replace(xn,En),co=e=>e.match(/#(.?)#/)?.[1]===dn?to:dn,uo=e=>e.match(/'(.*?)'/)?.[1]??"",Tn=e=>e.match(/0(.?)0/)?.[1]??"";function bn({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=ao(e),l=r?Tn(e):"",u=so(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),m=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):hn(u,f),h=r?m.lastIndexOf(l):m.length,T=m.substring(0,h),x=m.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,m).replace(/SYMBOL/,s),currencySymbol:s,decimals:x,decimalsDelimiter:l,hasCurrencySpace:c,integer:T,isCurrencyFirst:a,recurrenceTerm:i}}var _n=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=ro[r]??1;return bn(e,i>1?Ke.MONTH:yn[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=io.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(no[s]??(u=>u))(c(a))})},Sn=({commitment:e,term:t,...r})=>bn(r,yn[e]?.[t]);var lo={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},fo=Gr("ConsonantTemplates/price"),po=/<.+?>/g,M={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",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"},ue={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},mo="TAX_EXCLUSIVE",ho=e=>Mr(e)?Object.entries(e).filter(([,t])=>he(t)||We(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+Ur(n)+'"'}`,""):"",W=(e,t,r,n=!1)=>`${n?vn(t):t??""}`;function Eo(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=W(M.currencySymbol,r),m=W(M.currencySpace,o?" ":""),h="";return a&&(h+=f+m),h+=W(M.integer,s),h+=W(M.decimalsDelimiter,i),h+=W(M.decimals,n),a||(h+=m+f),h+=W(M.recurrence,c,null,!0),h+=W(M.unitType,l,null,!0),h+=W(M.taxInclusivity,u,!0),W(e,h,{...p,"aria-label":t})}var ye=({displayOptical:e=!1,displayStrikethrough:t=!1}={})=>({country:r,displayFormatted:n=!0,displayRecurrence:i=!0,displayPerUnit:o=!1,displayTax:s=!1,language:a,literals:c={}}={},{commitment:l,formatString:u,price:p,priceWithoutDiscount:f,taxDisplay:m,taxTerm:h,term:T,usePrecision:x}={},w={})=>{Object.entries({country:r,formatString:u,language:a,price:p}).forEach(([Z,vt])=>{if(vt==null)throw new Error(`Argument "${Z}" is missing`)});let P={...lo,...c},y=`${a.toLowerCase()}-${r.toUpperCase()}`;function A(Z,vt){let Tt=P[Z];if(Tt==null)return"";try{return new pn(Tt.replace(po,""),y).format(vt)}catch{return fo.error("Failed to format literal:",Tt),""}}let S=t&&f?f:p,{accessiblePrice:D,recurrenceTerm:G,...C}=(e?_n:Sn)({commitment:l,formatString:u,term:T,price:e?p:S,usePrecision:x,isIndianPrice:r==="IN"}),F=D,K="";if(b(i)&&G){let Z=A(ue.recurrenceAriaLabel,{recurrenceTerm:G});Z&&(F+=" "+Z),K=A(ue.recurrenceLabel,{recurrenceTerm:G})}let ee="";if(b(o)){ee=A(ue.perUnitLabel,{perUnit:"LICENSE"});let Z=A(ue.perUnitAriaLabel,{perUnit:"LICENSE"});Z&&(F+=" "+Z)}let j="";b(s)&&h&&(j=A(m===mo?ue.taxExclusiveLabel:ue.taxInclusiveLabel,{taxTerm:h}),j&&(F+=" "+j)),t&&(F=A(ue.strikethroughAriaLabel,{strikethroughPrice:F}));let z=M.container;if(e&&(z+=" "+M.containerOptical),t&&(z+=" "+M.containerStrikethrough),b(n))return Eo(z,{...C,accessibleLabel:F,recurrenceLabel:K,perUnitLabel:ee,taxInclusivityLabel:j},w);let{currencySymbol:fe,decimals:Me,decimalsDelimiter:yt,hasCurrencySpace:_r,integer:$n,isCurrencyFirst:qn}=C,pe=[$n,yt,Me];qn?(pe.unshift(_r?"\xA0":""),pe.unshift(fe)):(pe.push(_r?"\xA0":""),pe.push(fe)),pe.push(K,ee,j);let Yn=pe.join("");return W(z,Yn,w)},Pn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||b(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${ye()(e,t,r)}${i?" "+ye({displayStrikethrough:!0})(e,t,r):""}`};var Zt=ye(),Qt=Pn(),Jt=ye({displayOptical:!0}),Kt=ye({displayStrikethrough:!0});var go=(e,t)=>{if(!(!Ee(e)||!Ee(t)))return Math.floor((t-e)/t*100)},An=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=go(n,i);return o===void 0?'':`${o}%`};var er=An();var tr="ABM",rr="PUF",nr="M2M",ir="PERPETUAL",xo="TAX_INCLUSIVE_DETAILS",yo="TAX_EXCLUSIVE",wn={ABM:tr,PUF:rr,M2M:nr,PERPETUAL:ir},Na={[tr]:{commitment:N.YEAR,term:L.MONTHLY},[rr]:{commitment:N.YEAR,term:L.ANNUAL},[nr]:{commitment:N.MONTH,term:L.MONTHLY},[ir]:{commitment:N.PERPETUAL,term:void 0}},On="Value is not an offer",or=e=>{if(typeof e!="object")return On;let{commitment:t,term:r}=e,n=vo(t,r);return{...e,planType:n}};var vo=(e,t)=>{if(e===void 0)return On;if(e===""&&t==="")return"";let r="";return e===N.YEAR?t===L.MONTHLY?r=tr:t===L.ANNUAL&&(r=rr):e===N.MONTH?t===L.MONTHLY&&(r=nr):e===N.PERPETUAL&&(r=ir),r};function sr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==xo)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:yo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:re}=Object,H=re({...oe}),X=re({...te}),B=re({...V}),ar=re({...N}),ve=re({...Ae}),Ue=re({...ie}),cr=re({...wn}),ur=re({...L});var hr={};Zn(hr,{CLASS_NAME_FAILED:()=>et,CLASS_NAME_PENDING:()=>tt,CLASS_NAME_RESOLVED:()=>rt,ERROR_MESSAGE_BAD_REQUEST:()=>lr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>pr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>fr,EVENT_TYPE_ERROR:()=>To,EVENT_TYPE_FAILED:()=>nt,EVENT_TYPE_PENDING:()=>it,EVENT_TYPE_READY:()=>le,EVENT_TYPE_RESOLVED:()=>ot,LOG_NAMESPACE:()=>mr,STATE_FAILED:()=>$,STATE_PENDING:()=>q,STATE_RESOLVED:()=>Y,TAG_NAME_SERVICE:()=>J});var et="placeholder-failed",tt="placeholder-pending",rt="placeholder-resolved",lr="Bad WCS request",fr="Commerce offer not found",pr="Literals URL not provided",To="wcms:commerce:error",nt="wcms:placeholder:failed",it="wcms:placeholder:pending",le="wcms:commerce:ready",ot="wcms:placeholder:resolved",mr="wcms/commerce",$="failed",q="pending",Y="resolved",J="wcms-commerce";var dr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Ln=new Set,bo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Cn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!dr.serializableTypes.includes(r))return r}return e}function _o(e,t){if(!dr.ignoredProperties.includes(e))return Cn(t)}var Er={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=dr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(bo(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Cn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,_o)),Ln.has(c)||(Ln.add(c),window.lana.log(c,{sampleRate:r,tags:n,clientId:i}))}};var v=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:H.V3,checkoutWorkflowStep:X.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:B.PRODUCTION,forceTaxExclusive:!1,language:"en",promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:ve.PRODUCTION,wcsLandscape:Ue.PUBLISHED,wcsBufferLimit:1});function Nn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(J);i!==r&&(r=i,i&&e(i))}return document.addEventListener(le,n,{once:t}),ne(n),()=>document.removeEventListener(le,n)}function In(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(sr)),i}var ne=e=>window.setTimeout(e);function Te(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(xe).filter(Ee);return r.length||(r=[t]),r}function st(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Rt)}function k(){return document.head.querySelector(J)}var So="en_US",Po={ar:"AR_es",br:"BR_pt",ca:"CA_en",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"ZA_en",dk:"DK_da",de:"DE_de",ee:"EE_et",es:"ES_es",fr:"FR_fr",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in:"IN_en",id_id:"ID_in",nz:"NZ_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th:"TH_en"},be=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Rn({locale:e={}}={}){if(!e.prefix)return{country:v.country,language:v.language,locale:So};let t=e.prefix.replace("/","")??"",[r=v.country,n=v.language]=(Po[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function gr({commerce:e={},locale:t=void 0}={}){let n=Q(O("commerce.env",e,{metadata:!1}),be,be.PROD)===be.PROD?B.PRODUCTION:B.STAGE,i=O("checkoutClientId",e)??v.checkoutClientId,o=Q(O("checkoutWorkflow",e),H,v.checkoutWorkflow),s=X.CHECKOUT;o===H.V3&&(s=Q(O("checkoutWorkflowStep",e),X,v.checkoutWorkflowStep));let a=b(O("displayOldPrice",e),v.displayOldPrice),c=b(O("displayPerUnit",e),v.displayPerUnit),l=b(O("displayRecurrence",e),v.displayRecurrence),u=b(O("displayTax",e),v.displayTax),p=b(O("forceTaxExclusive",e),v.forceTaxExclusive),f=O("promotionCode",e)??v.promotionCode,m=Te(O("quantity",e)),h=O("wcsApiKey",e)??v.wcsApiKey,T=Q(O("wcsLandscape",e),Ue,v.wcsLandscape),x=xe(O("wcsBufferDelay",e),v.wcsBufferDelay),w=xe(O("wcsBufferLimit",e),v.wcsBufferLimit);return{...Rn({locale:t}),displayOldPrice:a,checkoutClientId:i,checkoutWorkflow:o,checkoutWorkflowStep:s,displayPerUnit:c,displayRecurrence:l,displayTax:u,env:n,forceTaxExclusive:p,priceLiteralsURL:e.priceLiteralsURL,promotionCode:f,quantity:m,wcsApiKey:h,wcsBufferDelay:x,wcsBufferLimit:w,wcsEnv:n===B.STAGE?ve.STAGE:ve.PRODUCTION,wcsLandscape:T}}var Dn="debug",Ao="error",wo="info",Oo="warn",Lo=Date.now(),xr=new Set,yr=new Set,Un=new Map,De=Object.freeze({DEBUG:Dn,ERROR:Ao,INFO:wo,WARN:Oo}),Mn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},kn={filter:({level:e})=>e!==Dn},Co={filter:()=>!1};function No(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;se(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Lo}}function Io(e){[...yr].every(t=>t(e))&&xr.forEach(t=>t(e))}function Gn(e){let t=(Un.get(e)??0)+1;Un.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>Io(No(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Gn(`${i.namespace}/${o}`)},debug:n(De.DEBUG),error:n(De.ERROR),info:n(De.INFO),warn:n(De.WARN)});return i}function at(...e){e.forEach(t=>{let{append:r,filter:n}=t;se(n)?yr.add(n):se(r)&&xr.add(r)})}function Ro(e={}){let{name:t}=e,r=b(O("commerce.debug",{search:!0,storage:!0}),t===be.LOCAL);return at(r?Mn:kn),t===be.PROD&&at(Er),U}function Uo(){xr.clear(),yr.clear()}var U={...Gn(mr),Level:De,Plugins:{consoleAppender:Mn,debugFilter:kn,quietFilter:Co,lanaAppender:Er},init:Ro,reset:Uo,use:at};var Do={CLASS_NAME_FAILED:et,CLASS_NAME_PENDING:tt,CLASS_NAME_RESOLVED:rt,EVENT_TYPE_FAILED:nt,EVENT_TYPE_PENDING:it,EVENT_TYPE_RESOLVED:ot,STATE_FAILED:$,STATE_PENDING:q,STATE_RESOLVED:Y},Mo={[$]:et,[q]:tt,[Y]:rt},ko={[$]:nt,[q]:it,[Y]:ot},lt=new WeakMap;function R(e){if(!lt.has(e)){let t=U.module(e.constructor.is);lt.set(e,{changes:new Map,connected:!1,controlled:!1,dispose:de,error:void 0,log:t,options:void 0,promises:[],state:q,timer:null,value:void 0,version:0})}return lt.get(e)}function ct(e){let t=R(e),{error:r,promises:n,state:i}=t;(i===Y||i===$)&&(t.promises=[],i===Y?n.forEach(({resolve:o})=>o(e)):i===$&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(ko[i],{bubbles:!0}))}function ut(e){let t=lt.get(e);[$,q,Y].forEach(r=>{e.classList.toggle(Mo[r],r===t.state)})}var Go={get controlled(){return R(this).controlled},get error(){return R(this).error},get log(){return R(this).log},get options(){return R(this).options},get state(){return R(this).state},get value(){return R(this).value},attributeChangedCallback(e,t,r){R(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){R(this).dispose=Nn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=R(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=de},onceSettled(){let{error:e,promises:t,state:r}=R(this);return Y===r?Promise.resolve(this):$===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=R(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=Y,n.value=t,ut(this),this.log.debug("Resolved:",{element:this,value:t}),ne(()=>ct(this)),!0)},toggleFailed(e,t,r){let n=R(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=$,ut(this),n.log.error("Failed:",{element:this,error:t}),ne(()=>ct(this)),!0)},togglePending(e){let t=R(this);return t.version++,e&&(t.options=e),t.state=q,ut(this),ne(()=>ct(this)),t.version},stopUpdates(){R(this).controlled=!0},requestUpdate(e=!1){if(!this.isConnected||!k())return;let t=R(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=q,t.timer=ne(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===q&&t.version===s&&(t.state=i,t.error=r,t.value=o,ut(this),ct(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Fn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function ft(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Fn(t)),i}function pt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(Go)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Do)),window.customElements.define(r,i,{extends:t})),i}function mt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function ht(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Fn(t)),e):null}var _e=class _e extends HTMLAnchorElement{static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi"]}static createCheckoutLink(t={},r=""){let n=k();if(!n)return null;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,perpetual:a,promotionCode:c,quantity:l,wcsOsi:u}=n.collectCheckoutOptions(t),p=ft(_e,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,perpetual:a,promotionCode:c,quantity:l,wcsOsi:u});return r&&(p.innerHTML=r),p}static getCheckoutLinks(t){return mt(_e,t)}get isCheckoutLink(){return!0}get placeholder(){return this}async render(t={}){if(!this.isConnected||this.placeholder.controlled)return!1;let r=k();if(!r)return!1;this.dataset.imsCountry||r.imsCountry.then(s=>{s&&(this.dataset.imsCountry=s)},de);let n=r.collectCheckoutOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.href="";let o=r.resolveOfferSelectors(n);return this.renderOffers((await Promise.all(o)).flat(),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return!1;let i=k();if(!i)return!1;let o=i.collectCheckoutOptions(r,this.placeholder);if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.href=i.buildCheckoutURL(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.href="",!0}return!1}updateOptions(t={}){let r=k();if(!r)return!1;let{checkoutMarketSegment:n,checkoutWorkflow:i,checkoutWorkflowStep:o,perpetual:s,promotionCode:a,quantity:c,wcsOsi:l}=r.collectCheckoutOptions(t);return ht(this,{checkoutMarketSegment:n,checkoutWorkflow:i,checkoutWorkflowStep:o,perpetual:s,promotionCode:a,quantity:c,wcsOsi:l}),!0}};me(_e,"is","checkout-link"),me(_e,"tag","a");var vr=_e,dt=pt(vr);var Se=class Se extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let r=k();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return ft(Se,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return mt(Se,t)}get isInlinePrice(){return!0}get placeholder(){return this}async render(t={}){if(!this.isConnected||this.placeholder.controlled)return!1;let r=k();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(In(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=k();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=k();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return ht(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};me(Se,"is","inline-price"),me(Se,"tag","span");var Tr=Se,Et=pt(Tr);function Vn({providers:e,settings:t}){let r=U.module("checkout");function n(a,c){let{checkoutClientId:l,checkoutWorkflow:u,checkoutWorkflowStep:p,country:f,language:m,promotionCode:h,quantity:T}=t,{checkoutMarketSegment:x,checkoutWorkflow:w=u,checkoutWorkflowStep:P=p,imsCountry:y,country:A=y??f,language:S=m,quantity:D=T,perpetual:G,promotionCode:C=h,wcsOsi:F,...K}=Object.assign({},c?.dataset??{},a??{}),ee=Q(w,H,v.checkoutWorkflow),j=X.CHECKOUT;ee===H.V3&&(j=Q(P,X,v.checkoutWorkflowStep));let z=ge({...K,checkoutClientId:l,checkoutMarketSegment:x,country:A,quantity:Te(D,v.quantity),checkoutWorkflow:ee,checkoutWorkflowStep:j,language:S,perpetual:b(G),promotionCode:Oe(C).effectivePromoCode,wcsOsi:st(F)});if(c)for(let fe of e.checkout)fe(c,z);return z}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{env:l}=t,{checkoutClientId:u,checkoutMarketSegment:p,checkoutWorkflow:f,checkoutWorkflowStep:m,country:h,promotionCode:T,quantity:x,...w}=n(c),P=window.frameElement?"if":"fp",y={checkoutPromoCode:T,clientId:u,context:P,country:h,env:l,items:[],marketSegment:p,workflowStep:m,...w};if(a.length===1){let{offerId:S,offerType:D,productArrangementCode:G}=a[0],{marketSegments:[C]}=a[0];Object.assign(y,{marketSegment:C,offerType:D,productArrangementCode:G}),y.items.push(x[0]===1?{id:S}:{id:S,quantity:x[0]})}else y.items.push(...a.map(({offerId:S},D)=>({id:S,quantity:x[D]??v.quantity})));return At(f,y)}let{createCheckoutLink:o,getCheckoutLinks:s}=dt;return{CheckoutLink:dt,CheckoutWorkflow:H,CheckoutWorkflowStep:X,buildCheckoutURL:i,collectCheckoutOptions:n,createCheckoutLink:o,getCheckoutLinks:s}}function Fo({interval:e=200,maxAttempts:t=25}={}){let r=U.module("ims");return new Promise(n=>{r.debug("Getting user country");let i=0;function o(){window.adobeIMS?window.adobeIMS.isSignedInUser()?window.adobeIMS.getProfile().then(({countryCode:s})=>{r.debug("Got user country:",s),n(s)},s=>{r.error("Unable to get user country:",s),n()}):(r.debug("User is not signed in"),n()):++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function jn({}){return{imsCountry:Fo()}}async function Wn(e){if(!e.priceLiteralsURL)throw new Error(pr);let t=await window.fetch(e.priceLiteralsURL),{data:r}=await t.json();if(Array.isArray(r)){let n=o=>r.find(s=>je(s.lang,o)),i=n(e.language)??n(v.language);if(i)return Object.freeze(i)}return{}}function Hn({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:m,forceTaxExclusive:h,language:T,promotionCode:x,quantity:w}=r,{displayOldPrice:P=u,displayPerUnit:y=p,displayRecurrence:A=f,displayTax:S=m,forceTaxExclusive:D=h,country:G=l,language:C=T,perpetual:F,promotionCode:K=x,quantity:ee=w,template:j,wcsOsi:z,...fe}=Object.assign({},c?.dataset??{},a??{}),Me=ge({...fe,country:G,displayOldPrice:b(P),displayPerUnit:b(y),displayRecurrence:b(A),displayTax:b(S),forceTaxExclusive:b(D),language:C,perpetual:b(F),promotionCode:Oe(K).effectivePromoCode,quantity:Te(ee,v.quantity),template:j,wcsOsi:st(z)});if(c)for(let yt of t.price)yt(c,Me);return Me}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=er;break;case"strikethrough":u=Kt;break;case"optical":u=Jt;break;default:u=c.promotionCode?Qt:Zt}let p=n(c);p.literals=Object.assign({},e.price,ge(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Et;return{InlinePrice:Et,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Vo={[B.PRODUCTION]:"https://wcs.adobe.com",[B.STAGE]:"https://wcs.stage.adobe.com"};function Xn({settings:e}){let t=U.module("wcs"),{env:r,wcsApiKey:n}=e,i={apiKey:n,baseUrl:Vo[r],fetch:window.fetch.bind(window)},o=Ve(i),s=new Map,a=new Map,c;async function l(f,m,h=!0){let T=fr;try{t.debug("Fetching:",f),f.offerSelectorIds=f.offerSelectorIds.sort();let{data:x}=await o(f,{apiKey:n,environment:e.wcsEnv,landscape:r===B.STAGE?"ALL":e.wcsLandscape},({resolvedOffers:P})=>({offers:P.map(or)}));t.debug("Fetched:",f,x);let{offers:w}=x??{};m.forEach(({resolve:P},y)=>{let A=w.filter(({offerSelectorIds:S})=>S.includes(y)).flat();A.length&&(m.delete(y),P(A))})}catch(x){x.status===404&&f.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(f.offerSelectorIds.map(w=>l({...f,offerSelectorIds:[w]},m,!1)))):(t.error("Failed:",f,x),T=lr)}h&&m.size&&(t.debug("Missing:",{offerSelectorIds:[...m.keys()]}),m.forEach(x=>{x.reject(new Error(T))}))}function u(){clearTimeout(c);let f=[...a.values()];a.clear(),f.forEach(({options:m,promises:h})=>l(m,h))}function p({country:f,language:m,perpetual:h=!1,promotionCode:T="",wcsOsi:x=[]}){let w=`${m}_${f}`;f!=="GB"&&(m=h?"EN":"MULT");let P=[f,m,T].filter(y=>y).join("-").toLowerCase();return x.map(y=>{let A=`${y}-${P}`;if(!s.has(A)){let S=new Promise((D,G)=>{let C=a.get(P);C||(C={options:{country:f,language:m,locale:w,offerSelectorIds:[]},promises:new Map},a.set(P,C)),T&&(C.options.promotionCode=T),C.options.offerSelectorIds.push(y),C.promises.set(y,{resolve:D,reject:G}),C.options.offerSelectorIds.length>=e.wcsBufferLimit?u():(t.debug("Queued:",C.options),c||(c=setTimeout(u,e.wcsBufferDelay)))});s.set(A,S)}return s.get(A)})}return{WcsCommitment:ar,WcsPlanType:cr,WcsTerm:ur,resolveOfferSelectors:p}}var gt,xt=null,br=class extends HTMLElement{get isWcmsCommerce(){return!0}};window.customElements.define(J,br);async function jo(e){let t=U.init(e.env).module("service");t.debug("Activating:",e);let r={price:{}},n=Object.freeze(gr(e));try{r.price=await Wn(n)}catch(a){t.warn("Price literals were not fetched:",a)}let i={checkout:new Set,price:new Set},o=document.createElement(J),s={literals:r,providers:i,settings:n};return gt=Object.defineProperties(o,Object.getOwnPropertyDescriptors({...Vn(s),...jn(s),...Hn(s),...Xn(s),...hr,Log:U,get defaults(){return v},get literals(){return r},get log(){return U},get providers(){return{checkout(a){return i.checkout.add(a),()=>i.checkout.delete(a)},price(a){return i.price.add(a),()=>i.price.delete(a)}}},get settings(){return n}})),t.debug("Activated:",{literals:r,settings:n,element:o}),document.head.append(o),ne(()=>{let a=new CustomEvent(le,{bubbles:!0,cancelable:!1,detail:gt});gt.dispatchEvent(a)}),gt}function Bn(){document.head.querySelector(J)?.remove(),xt=null,U.reset()}function Wo(e,t=!1){return se(e)?(t&&Bn(),xt??(xt=jo(e()))):xt||new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(le,n,{once:!0})})}export{dt as CheckoutLink,H as CheckoutWorkflow,X as CheckoutWorkflowStep,v as Defaults,Et as InlinePrice,U as Log,J as TAG_NAME_SERVICE,ar as WcsCommitment,ve as WcsEnv,Ue as WcsLandscape,cr as WcsPlanType,ur as WcsTerm,Rn as getLocaleSettings,gr as getSettings,Wo as init,Bn as reset}; //# sourceMappingURL=commerce.js.map diff --git a/test/blocks/ost/mocks/ost-utils.js b/test/blocks/ost/mocks/ost-utils.js index 394b7e5e68..eb333e66c2 100644 --- a/test/blocks/ost/mocks/ost-utils.js +++ b/test/blocks/ost/mocks/ost-utils.js @@ -6,8 +6,8 @@ const ogUrl = window.location.href; const getConfig = () => ({ env: { name: 'local' }, locales: { - '': { ietf: 'en-US', tk: 'hah7vzn.css' }, - ch_de: { ietf: 'de-CH', tk: 'vin7zsi.css' }, + '': { prefix: '', ietf: 'en-US', tk: 'hah7vzn.css' }, + ch_de: { prefix: '/ch_de', ietf: 'de-CH', tk: 'vin7zsi.css' }, }, }); From 30ae5d1029fb67452909433b453ae3c7a75279a4 Mon Sep 17 00:00:00 2001 From: Rares Munteanu Date: Fri, 12 Jan 2024 15:09:37 +0100 Subject: [PATCH 5/9] Revert "MWPW-139379 Improve Tab Scrolling for Mobile" (#1733) --- libs/blocks/tabs/tabs.css | 72 +------------------ libs/blocks/tabs/tabs.js | 114 +++++-------------------------- test/blocks/tabs/mocks/body.html | 45 ------------ test/blocks/tabs/tabs.test.js | 63 +---------------- 4 files changed, 20 insertions(+), 274 deletions(-) diff --git a/libs/blocks/tabs/tabs.css b/libs/blocks/tabs/tabs.css index 363a28b2a8..8be15c4fed 100644 --- a/libs/blocks/tabs/tabs.css +++ b/libs/blocks/tabs/tabs.css @@ -12,7 +12,6 @@ --tabs-pill-bg-color-hover: #dadada; --tabs-pill-bg-color-active: #c6c6c6; --tabs-pill-text-color: #131313; - --tabs-paddle-bs-color: #0000001a; } :root .dark { @@ -26,7 +25,6 @@ --tabs-pill-bg-color-hover: #666; --tabs-pill-bg-color-active: #444; --tabs-pill-text-color: #fff; - --tabs-paddle-bs-color: #ffffff1a; } .tabs { @@ -61,7 +59,6 @@ box-shadow: 0 -1px 0 inset var(--tabs-border-color); display: flex; z-index: 2; - margin: 0 var(--spacing-m); /* ScrollProps - If content exceeds height of container, overflow! */ overflow: auto; @@ -84,11 +81,12 @@ } .tabs.center .tab-headline { - text-align: center; + text-align: center; } .tabs div[role="tablist"] .tab-list-container { display: flex; + padding: 0 8.3%; width: var(--grid-container-width); margin: 0 auto; box-sizing: content-box; @@ -103,6 +101,7 @@ .tabs.center div[role="tablist"] .tab-list-container { width: auto; + margin: 0; } .tabs .tab-content { @@ -265,63 +264,6 @@ height: 24px; } -.tabs .tab-paddles { - position: relative; - z-index: 3; -} - -.tabs .tab-paddles .paddle { - position: absolute; - width: 32px; - height: 48px; - bottom: 0; - background: var(--tabs-active-bg-color); - border: 0; - padding: 14px 0 12px; - display: flex; - align-items: center; -} - -.tabs .tab-paddles .paddle:hover { - cursor: pointer; -} - -.tabs .tab-paddles .paddle:disabled { - box-shadow: 0 -1px 0 inset var(--tabs-border-color); - background: var(--tabs-list-bg-gradient); -} - -.tabs .tab-paddles .paddle-left { - box-shadow: 0 -1px 0 inset var(--tabs-border-color), 4px 0 4px -2px var(--tabs-paddle-bs-color); - left: 0; -} - -.tabs .tab-paddles .paddle-right { - box-shadow: 0 -1px 0 inset var(--tabs-border-color), -4px 0 4px -2px var(--tabs-paddle-bs-color); - right: 0; -} - -.tabs .tab-paddles .paddle svg { - opacity: 1; - width: 8px; - height: 14px; - margin: 0 auto; - transition: opacity 150ms ease; - color: var(--tabs-text-color); -} - -.tabs .tab-paddles .paddle-left svg { - transform: rotate(180deg); -} - -.tabs .tab-paddles .paddle:hover svg { - color: var(--tabs-active-text-color); -} - -.tabs .tab-paddles .paddle:disabled svg { - opacity: 0; -} - /* Section Metadata */ .tabs-background-transparent .tabs, .tabs-background-transparent .tabs div[role="tablist"], @@ -348,12 +290,4 @@ padding-top: 18px; padding-bottom: 18px; } - - .tabs .tab-paddles .paddle { - height: 62px; - } - - .tabs .tab-paddles .paddle svg { - top: 24px; - } } diff --git a/libs/blocks/tabs/tabs.js b/libs/blocks/tabs/tabs.js index 28365295b4..1101f218a7 100644 --- a/libs/blocks/tabs/tabs.js +++ b/libs/blocks/tabs/tabs.js @@ -4,39 +4,36 @@ */ import { createTag, MILO_EVENTS } from '../../utils/utils.js'; -const RIGHT_PADDLE = ''; - -const isTabInTabListView = (tab) => { - const tabList = tab.closest('[role="tablist"]'); - const tabRect = tab.getBoundingClientRect(); - const tabListRect = tabList.getBoundingClientRect(); - - const tabLeft = Math.round(tabRect.left); - const tabRight = Math.round(tabRect.right); - const tabListLeft = Math.round(tabListRect.left); - const tabListRight = Math.round(tabListRect.right); - - return (tabLeft >= tabListLeft && tabRight <= tabListRight); +const isElementInContainerView = (targetEl) => { + const rect = targetEl.getBoundingClientRect(); + const docEl = document.documentElement; + return ( + rect.top >= 0 + && rect.left >= 0 + && rect.bottom <= (window.innerHeight || /* c8 ignore next */ docEl.clientHeight) + && rect.right <= (window.innerWidth || /* c8 ignore next */ docEl.clientWidth) + ); }; -const scrollTabIntoView = (e, inline = 'center') => { - const isElInView = isTabInTabListView(e); - if (!isElInView) e.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline }); +const scrollTabIntoView = (e) => { + const isElInView = isElementInContainerView(e); + /* c8 ignore next */ + if (!isElInView) e.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' }); }; function changeTabs(e) { const { target } = e; const parent = target.parentNode; - const content = parent.parentNode.parentNode.lastElementChild; + const grandparent = parent.parentNode.nextElementSibling; parent .querySelectorAll('[aria-selected="true"]') .forEach((t) => t.setAttribute('aria-selected', false)); target.setAttribute('aria-selected', true); scrollTabIntoView(target); - content + grandparent .querySelectorAll('[role="tabpanel"]') .forEach((p) => p.setAttribute('hidden', true)); - content + grandparent.parentNode .querySelector(`#${target.getAttribute('aria-controls')}`) .removeAttribute('hidden'); } @@ -87,77 +84,6 @@ function initTabs(elm, config, rootElem) { if (config) configTabs(config, rootElem); } -// Check if current tab is not visible and next tab is visible -function previousTab(item, i, arr) { - const next = arr[i + 1]; - return (!isTabInTabListView(item) && next && isTabInTabListView(next)); -} - -// Check if previous tab is visible and current tab is not visible -function nextTab(item, i, arr) { - const previous = arr[i - 1]; - return (previous && isTabInTabListView(previous) && !isTabInTabListView(item)); -} - -function initPaddles(tabList, tabPaddles) { - const left = tabPaddles.firstElementChild; - const right = tabPaddles.lastElementChild; - const tabListItems = tabList.querySelectorAll('[role="tab"]'); - const tabListItemsArray = [...tabListItems]; - const firstTab = tabListItemsArray[0]; - const lastTab = tabListItemsArray[tabListItemsArray.length - 1]; - - left.addEventListener('click', () => { - const previous = tabListItemsArray.find(previousTab); - if (previous) { - scrollTabIntoView(previous, 'end'); - } else { - /* c8 ignore next 3 */ - const { width } = tabList.getBoundingClientRect(); - tabList.scrollBy({ left: -(width / 2), behavior: 'smooth' }); - } - }); - right.addEventListener('click', () => { - const next = tabListItemsArray.find(nextTab); - if (next) { - scrollTabIntoView(next, 'start'); - } else { - /* c8 ignore next 3 */ - const { width } = tabList.getBoundingClientRect(); - tabList.scrollBy({ left: width / 2, behavior: 'smooth' }); - } - }); - - const options = { - root: tabList, - rootMargin: '0px', - threshold: 0.9, - }; - - const callback = (entries) => { - entries.forEach((entry) => { - if (entry.target === firstTab) { - if (entry.isIntersecting) { - left.setAttribute('disabled', ''); - } else { - left.removeAttribute('disabled'); - } - } else if (entry.target === lastTab) { - if (entry.isIntersecting) { - right.setAttribute('disabled', ''); - } else { - right.removeAttribute('disabled'); - } - } - }); - }; - - const observer = new IntersectionObserver(callback, options); - - observer.observe(firstTab); - observer.observe(lastTab); -} - const handleDeferredImages = (block) => { /* c8 ignore next 6 */ const loadLazyImages = () => { @@ -242,14 +168,6 @@ const init = (block) => { tabListItems[0].parentElement.remove(); } - // Tab Paddles - const tabPaddles = createTag('div', { class: 'tab-paddles', role: 'scrollbar' }); - const paddleLeft = createTag('button', { class: 'paddle paddle-left', disabled: '' }, RIGHT_PADDLE); - const paddleRight = createTag('button', { class: 'paddle paddle-right', disabled: '' }, RIGHT_PADDLE); - tabPaddles.append(paddleLeft, paddleRight); - tabList.after(tabPaddles); - initPaddles(tabList, tabPaddles); - // Tab Sections const allSections = Array.from(rootElem.querySelectorAll('div.section')); allSections.forEach((e) => { diff --git a/test/blocks/tabs/mocks/body.html b/test/blocks/tabs/mocks/body.html index 2763172d12..7930de7bec 100644 --- a/test/blocks/tabs/mocks/body.html +++ b/test/blocks/tabs/mocks/body.html @@ -196,51 +196,6 @@

Tab by index label free

- -
-

Longer tabs for scrolling

-
-
-
-
    -
  • Long Tab Text, 1
  • -
  • Long Tab Text, 2
  • -
  • Long Tab Text, 3
  • -
-
-
-
-
-
-

Here is Long Tab Text, 1 content

-

- - - -

- -
-
-

Here is Long Tab Text, 2 content

- -
-
-

Here is Long Tab Text, 3 content

- -
-

Tab by index label free

diff --git a/test/blocks/tabs/tabs.test.js b/test/blocks/tabs/tabs.test.js index acf3fd8a04..8f58185358 100644 --- a/test/blocks/tabs/tabs.test.js +++ b/test/blocks/tabs/tabs.test.js @@ -1,15 +1,8 @@ -import { readFile, sendKeys, setViewport } from '@web/test-runner-commands'; +import { readFile, sendKeys } from '@web/test-runner-commands'; import { expect } from '@esm-bundle/chai'; -import { delay } from '../../helpers/waitfor.js'; -import { loadStyle } from '../../../libs/utils/utils.js'; - -const DESKTOP_WIDTH = 1200; -const MOBILE_WIDTH = 375; -const HEIGHT = 1500; document.body.innerHTML = await readFile({ path: './mocks/body.html' }); const { default: init } = await import('../../../libs/blocks/tabs/tabs.js'); -loadStyle('../../../libs/blocks/tabs/tabs.css'); describe('tabs', () => { const allTabs = document.querySelectorAll('.tabs'); @@ -42,58 +35,4 @@ describe('tabs', () => { await sendKeys({ press: 'Space' }); expect(unSelectedBtn2.ariaSelected).to.equal('false'); }); - - it('paddles are disabled when tabList is not scrollable', async () => { - setViewport({ width: DESKTOP_WIDTH, height: HEIGHT }); - window.dispatchEvent(new Event('resize')); - await delay(200); - const leftPaddle = allTabs[0].querySelector('.paddle-left'); - const rightPaddle = allTabs[0].querySelector('.paddle-right'); - - expect(leftPaddle.getAttribute('disabled')).to.equal(''); - expect(rightPaddle.getAttribute('disabled')).to.equal(''); - }); - - it('right paddle is visible when tabList is scrollable', async () => { - setViewport({ width: MOBILE_WIDTH, height: HEIGHT }); - window.dispatchEvent(new Event('resize')); - const rightPaddle = allTabs[0].querySelector('.paddle-right'); - - console.log(rightPaddle.getAttribute('disabled')); - expect(rightPaddle.getAttribute('disabled')).to.equal(''); - }); - - it('left paddle scrolls tabList', async () => { - setViewport({ width: MOBILE_WIDTH, height: HEIGHT }); - window.innerWidth = MOBILE_WIDTH; - window.dispatchEvent(new Event('resize')); - const tabList = allTabs[3].querySelector('[role="tablist"]'); - const leftPaddle = allTabs[3].querySelector('.paddle-left'); - tabList.scrollLeft = 50; - await delay(200); - - expect(tabList.scrollLeft).to.not.equal(0); - expect(leftPaddle.getAttribute('disabled')).to.equal(null); - leftPaddle.click(); - await delay(300); - - expect(tabList.scrollLeft).to.equal(0); - }); - - it('right paddle scrolls tabList', async () => { - setViewport({ width: MOBILE_WIDTH, height: HEIGHT }); - window.innerWidth = MOBILE_WIDTH; - window.dispatchEvent(new Event('resize')); - const tabList = allTabs[3].querySelector('[role="tablist"]'); - const rightPaddle = allTabs[3].querySelector('.paddle-right'); - tabList.scrollLeft = 0; - await delay(200); - - expect(tabList.scrollLeft).to.equal(0); - expect(rightPaddle.getAttribute('disabled')).to.equal(null); - rightPaddle.click(); - await delay(300); - - expect(tabList.scrollLeft).to.not.equal(0); - }); }); From f26396e9a40005569c293058eb00c7b0da7c6ae0 Mon Sep 17 00:00:00 2001 From: Rares Munteanu Date: Fri, 12 Jan 2024 16:45:13 +0100 Subject: [PATCH 6/9] [MWPW-140624] Footer layout with few columns (#1730) --- libs/blocks/global-footer/global-footer.css | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/blocks/global-footer/global-footer.css b/libs/blocks/global-footer/global-footer.css index 0ffa9efb09..1a240cf2c0 100644 --- a/libs/blocks/global-footer/global-footer.css +++ b/libs/blocks/global-footer/global-footer.css @@ -253,7 +253,7 @@ .feds-footer-wrapper .feds-menu-content { flex-wrap: wrap; width: auto; - max-width: auto; + column-gap: 12px; } .feds-footer-wrapper .feds-menu-headline { @@ -264,6 +264,21 @@ row-gap: 15px; } + .feds-footer-wrapper .feds-menu-column:nth-child(-n+3):last-child { + flex-grow: 1; + } + + .feds-footer-wrapper .feds-menu-column:nth-last-child(-n+3):first-child .feds-menu-section, + .feds-footer-wrapper .feds-menu-column:nth-child(-n+3):last-child .feds-menu-section, + .feds-footer-wrapper .feds-menu-column:nth-child(2):nth-last-child(2) .feds-menu-section { + width: fit-content; + } + + .feds-footer-wrapper .feds-menu-column:nth-last-child(-n+3):first-child, + .feds-footer-wrapper .feds-menu-column:nth-child(2):nth-last-child(2) { + min-width: 20%; + } + /* Featured products */ .feds-featuredProducts { display: flex; From 27db2b89dfd575b5baa418087c9cb5f4419ac461 Mon Sep 17 00:00:00 2001 From: Erich Champion Date: Fri, 12 Jan 2024 09:23:58 -0800 Subject: [PATCH 7/9] MWPW-140916, MWPW-141124: Adding result to quiz analytics; update merch card width (#1717) * MWPW-140499: fix multiple merch card width issue on result page (#1660) fix multiple merch card width issue on result page Co-authored-by: xiasun * MWPW-140706: Quiz options should use Adobe Clean (#1682) * MWPW-140916: Adding result to analytics (#1715) * MWPW-140916: Adding result to analytics * MWPW-140916: Fixing lint errors * MWPW-141124: match widths used by standard merch cards (#1725) Co-authored-by: xiasun * Incorporating comments from Rares * Updating handleResultFlow test --------- Co-authored-by: Jacky Sun <67350368+JackySun9@users.noreply.github.com> Co-authored-by: xiasun Co-authored-by: xiasun --- libs/blocks/quiz-results/quiz-results.css | 6 ++- libs/blocks/quiz/utils.js | 45 +++++++++++++---- test/blocks/quiz/quiz.test.js | 4 +- test/blocks/quiz/utils.test.js | 61 ++++++++++++++++++++--- 4 files changed, 95 insertions(+), 21 deletions(-) diff --git a/libs/blocks/quiz-results/quiz-results.css b/libs/blocks/quiz-results/quiz-results.css index e97a5ae3c6..3b2652c460 100644 --- a/libs/blocks/quiz-results/quiz-results.css +++ b/libs/blocks/quiz-results/quiz-results.css @@ -20,7 +20,7 @@ justify-content: center; width: 100%; max-width: 100%; - grid-template-columns: repeat(auto-fit, 378px); + grid-template-columns: repeat(auto-fit, 300px); gap: 32px; padding-bottom: 32px; } @@ -48,6 +48,10 @@ .quiz-results .big-desktop-up { display: none; } + + .quiz-results .quiz-card-list { + grid-template-columns: repeat(auto-fit, 378px); + } } @media screen and (min-width: 1200px) { diff --git a/libs/blocks/quiz/utils.js b/libs/blocks/quiz/utils.js index 93e81c9279..a149651d5d 100644 --- a/libs/blocks/quiz/utils.js +++ b/libs/blocks/quiz/utils.js @@ -67,8 +67,8 @@ export const defaultRedirect = (url) => { }; export const handleResultFlow = async (answers = [], redirectFunc = defaultRedirect) => { - const { destinationPage, primaryProductCodes } = await findAndStoreResultData(answers); - const redirectUrl = getRedirectUrl(destinationPage, primaryProductCodes, answers); + const { destinationPage } = await findAndStoreResultData(answers); + const redirectUrl = getRedirectUrl(destinationPage); redirectFunc(redirectUrl); }; @@ -123,6 +123,13 @@ export const storeResultInLocalStorage = ( const structureFragsArray = structureFrags?.split(','); const nestedFragsPrimaryArray = nestedFragsPrimary?.split(','); const nestedFragsSecondaryArray = nestedFragsSecondary?.split(','); + const analyticsConfig = { + answers, + umbrellaProduct, + primaryProducts, + analyticsType, + analyticsQuiz, + }; const resultToDelegate = { primaryProducts, secondaryProducts: secondaryProductCodes, @@ -141,7 +148,7 @@ export const storeResultInLocalStorage = ( secondaryProductCodes, umbrellaProduct, ), - pageloadHash: getAnalyticsDataForLocalStorage(answers), + pageloadHash: getAnalyticsDataForLocalStorage(analyticsConfig), }; localStorage.setItem(quizKey, JSON.stringify(resultToDelegate)); return resultToDelegate; @@ -161,7 +168,7 @@ export const structuredFragments = ( if (umbrellaProduct && row.product === umbrellaProduct) { structureFragments.push(row[fragment]); } - } else if (primaryProducts.length > 0 && primaryProducts.includes(row.product) + } else if (primaryProducts?.length > 0 && primaryProducts.includes(row.product) && row[fragment]) { structureFragments.push(row[fragment]); } @@ -232,9 +239,9 @@ const getNestedFragments = (resultResources, productCodes, fragKey) => { return fragArray; }; -export const getRedirectUrl = (destinationPage, primaryProducts) => { +export const getRedirectUrl = (destinationPage) => { const separator = destinationPage.includes('?') ? '&' : '?'; - return `${destinationPage}${separator}primary=${primaryProducts}&quizKey=${quizKey}`; + return `${destinationPage}${separator}quizKey=${quizKey}`; }; export const parseResultData = async (answers) => { @@ -429,13 +436,31 @@ export const getAnalyticsDataForBtn = (selectedQuestion, selectedCards) => { return ''; }; -export const getAnalyticsDataForLocalStorage = (answers) => { +export const getAnalyticsDataForLocalStorage = (config) => { + const { + answers = [], + umbrellaProduct = '', + primaryProducts = [], + // eslint-disable-next-line no-shadow + analyticsType = '', + // eslint-disable-next-line no-shadow + analyticsQuiz = '', + } = config; + + let formattedResultString = ''; let formattedAnswerString = ''; - answers.forEach((answer) => { + if (umbrellaProduct) { + formattedResultString = umbrellaProduct; + } else { + primaryProducts?.forEach((product) => { + formattedResultString = formattedResultString ? `${formattedResultString}|${product}` : product; + }); + } + answers?.forEach((answer) => { const eachAnswer = `${answer[0]}/${answer[1].join('/')}`; - formattedAnswerString = formattedAnswerString === '' ? eachAnswer : formattedAnswerString.concat('|', eachAnswer); + formattedAnswerString = formattedAnswerString ? `${formattedAnswerString}|${eachAnswer}` : eachAnswer; }); - const analyticsHash = `type=${analyticsType}&quiz=${analyticsQuiz}&selectedOptions=${formattedAnswerString}`; + const analyticsHash = `type=${analyticsType}&quiz=${analyticsQuiz}&result=${formattedResultString}&selectedOptions=${formattedAnswerString}`; return analyticsHash; }; diff --git a/test/blocks/quiz/quiz.test.js b/test/blocks/quiz/quiz.test.js index 782d609a01..02fda0c265 100644 --- a/test/blocks/quiz/quiz.test.js +++ b/test/blocks/quiz/quiz.test.js @@ -178,10 +178,10 @@ describe('Quiz URL Parameter Tests', () => { replaceStateSpy.restore(); }); - it('should redirect to results page with results parameter', async () => { + it('should redirect to results page with quizKey parameter', async () => { const redirectStub = sinon.stub(); await handleResultFlow(test, redirectStub); - const expectedUrl = '/path/to/result?primary=&quizKey=cc-quiz-en-US'; + const expectedUrl = '/path/to/result?quizKey=cc-quiz-en-US'; sinon.assert.calledWith(redirectStub, expectedUrl); }); }); diff --git a/test/blocks/quiz/utils.test.js b/test/blocks/quiz/utils.test.js index 98f3f2c0f8..416a9f5a64 100644 --- a/test/blocks/quiz/utils.test.js +++ b/test/blocks/quiz/utils.test.js @@ -110,10 +110,56 @@ describe('Quiz', () => { expect(analyticsDataForBtnQCat).to.equal('Filters|cc:app-reco|q-category/photo'); }); + it('Checking analytics data for local storage with null input', async () => { + const analyticsConfig = { + answers, + umbrellaProduct: null, + primaryProducts: null, + analyticsType: 'cc:app-reco', + analyticsQuiz: 'uarv3', + }; + const analyticsDataForBtnQCat = getAnalyticsDataForLocalStorage(analyticsConfig); + expect(analyticsDataForBtnQCat).to.be.not.empty; + expect(analyticsDataForBtnQCat).to.equal('type=cc:app-reco&quiz=uarv3&result=&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'); + }); + it('Checking analytics data for local storage', async () => { - const analyticsDataForBtnQCat = getAnalyticsDataForLocalStorage(answers); + const analyticsConfig = { + answers, + umbrellaProduct: '', + primaryProducts: [], + analyticsType: 'cc:app-reco', + analyticsQuiz: 'uarv3', + }; + const analyticsDataForBtnQCat = getAnalyticsDataForLocalStorage(analyticsConfig); + expect(analyticsDataForBtnQCat).to.be.not.empty; + expect(analyticsDataForBtnQCat).to.equal('type=cc:app-reco&quiz=uarv3&result=&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'); + }); + + it('Checking analytics data for local storage with umbrella product', async () => { + const analyticsConfig = { + answers, + umbrellaProduct: 'cc-ind', + primaryProducts: [], + analyticsType: 'cc:app-reco', + analyticsQuiz: 'uarv3', + }; + const analyticsDataForBtnQCat = getAnalyticsDataForLocalStorage(analyticsConfig); expect(analyticsDataForBtnQCat).to.be.not.empty; - expect(analyticsDataForBtnQCat).to.equal('type=cc:app-reco&quiz=uarv3&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'); + expect(analyticsDataForBtnQCat).to.equal('type=cc:app-reco&quiz=uarv3&result=cc-ind&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'); + }); + + it('Checking analytics data for local storage with other products', async () => { + const analyticsConfig = { + answers, + umbrellaProduct: '', + primaryProducts: ['ps-ind', 'ai-ind'], + analyticsType: 'cc:app-reco', + analyticsQuiz: 'uarv3', + }; + const analyticsDataForBtnQCat = getAnalyticsDataForLocalStorage(analyticsConfig); + expect(analyticsDataForBtnQCat).to.be.not.empty; + expect(analyticsDataForBtnQCat).to.equal('type=cc:app-reco&quiz=uarv3&result=ps-ind|ai-ind&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'); }); it('Testing structured fragments', async () => { @@ -145,10 +191,9 @@ describe('Quiz', () => { }); it('Testing redirect url', async () => { - const primaryProducts = ['express']; - const structuredFrags = getRedirectUrl('https://mockdata/path/to/quiz/uar-results', primaryProducts); - expect(structuredFrags).to.be.an('string'); - expect(structuredFrags).to.include('express'); + const redirectUrl = getRedirectUrl('https://mockdata/path/to/quiz/uar-results'); + expect(redirectUrl).to.be.an('string'); + expect(redirectUrl).to.include('cc-quiz-en-US'); }); it('Testing result flow with invalid selections', async () => { @@ -198,7 +243,7 @@ describe('Quiz', () => { const primaryProductCodes = []; const secondaryProductCodes = []; const umbrellaProductCode = ''; - const pageLoad = 'type=cc:app-reco&quiz=uarv3&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'; + const pageLoad = 'type=cc:app-reco&quiz=uarv3&result=&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'; before(async () => { const resultResourcesData = await readFile({ path: './mocks/result-resources.json' }); const resultResources = JSON.parse(resultResourcesData); @@ -236,7 +281,7 @@ describe('Quiz', () => { 'au-ind', ]; const umbrellaProductCode = 'cc'; - const pageLoad = 'type=cc:app-reco&quiz=uarv3&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'; + const pageLoad = 'type=cc:app-reco&quiz=uarv3&result=cc&selectedOptions=q-category/photo/video|q-rather/custom|q-photo/organize|q-video/social|q-customer/individual'; before(async () => { const resultResourcesData = await readFile({ path: './mocks/result-resources.json' }); const resultResources = JSON.parse(resultResourcesData); From 06f116f7b2879a8ec88495fdf9f094c452cf2cea Mon Sep 17 00:00:00 2001 From: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:24:38 -0700 Subject: [PATCH 8/9] MWPW-140268 Icon duplicates if nested in multiple sections (#1731) * MWPW-140268 Icon duplicates if nested in multiple sections * Update libs/features/icons/icons.js Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com> * Update unit test to check for duplicates --------- Co-authored-by: vivgoodrich Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com> --- libs/features/icons/icons.js | 3 ++- test/features/icons/icons.test.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/features/icons/icons.js b/libs/features/icons/icons.js index 5726e48798..8645fb225b 100644 --- a/libs/features/icons/icons.js +++ b/libs/features/icons/icons.js @@ -56,7 +56,8 @@ export default async function loadIcons(icons, config) { const { classList } = icon; if (classList.contains('icon-tooltip')) decorateToolTip(icon); const iconName = icon.classList[1].replace('icon-', ''); - if (!iconSVGs[iconName]) return; + const existingIcon = icon.querySelector('svg'); + if (!iconSVGs[iconName] || existingIcon) return; const parent = icon.parentElement; if (parent.childNodes.length > 1) { if (parent.lastChild === icon) { diff --git a/test/features/icons/icons.test.js b/test/features/icons/icons.test.js index 26d3655642..a0a4c7afd4 100644 --- a/test/features/icons/icons.test.js +++ b/test/features/icons/icons.test.js @@ -17,6 +17,7 @@ describe('Icon Suppprt', () => { before(async () => { icons = document.querySelectorAll('span.icon'); await loadIcons(icons, config); + await loadIcons(icons, config); // Test duplicate icon not created if run twice }); it('Replaces span.icon', async () => { @@ -24,6 +25,11 @@ describe('Icon Suppprt', () => { expect(selector).to.exist; }); + it('No duplicate icon', async () => { + const svgs = icons[0].querySelectorAll(':scope svg'); + expect(svgs.length).to.equal(1); + }); + it('Creates default tooltip', async () => { const tooltip = document.querySelector('.milo-tooltip.right'); expect(tooltip).to.exist; From 0c8a1ab4be42d5deef280d12ec944c4acb054092 Mon Sep 17 00:00:00 2001 From: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:30:23 -0700 Subject: [PATCH 9/9] MWPW-141139 Parameter PZN tags don't match if user uses uppercase characters (#1726) * MWPW-141139 Parameter PZN tags don't match if user uses upercase characters * conditional chaining and param name not case sensitive * Update libs/features/personalization/personalization.js Co-authored-by: Chris Peyer --------- Co-authored-by: vivgoodrich Co-authored-by: Chris Peyer --- libs/features/personalization/personalization.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index bb583b821f..9b8537467f 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -318,7 +318,10 @@ function parsePlaceholders(placeholders, config, selectedVariantName = '') { const checkForParamMatch = (paramStr) => { const [name, val] = paramStr.split('param-')[1].split('='); if (!name) return false; - const searchParamVal = PAGE_URL.searchParams.get(name); + const params = new URLSearchParams( + Array.from(PAGE_URL.searchParams, ([key, value]) => [key.toLowerCase(), value?.toLowerCase()]), + ); + const searchParamVal = params.get(name.toLowerCase()); if (searchParamVal !== null) { if (val) return val === searchParamVal; return true; // if no val is set, just check for existence of param