/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 724:
/***/ (() => {

(()=>{"use strict";class e extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"})}updateStyles(e){return Object.keys(e).map((t=>{const{cssVar:n,defaultValue:s}=e[t];return`${n}: ${this.getAttribute(t)||s};`})).join(" ")}}customElements.get("cl-custom-button")||customElements.define("cl-custom-button",class extends e{boundHandleClick=this.handleClick.bind(this);constructor(){super(),this.render()}static get observedAttributes(){return["disabled"]}attributeChangedCallback(e,t,n){"disabled"===e&&this.updateDisabledState()}get disabled(){const e=this.shadowRoot?.querySelector("button");return e?.hasAttribute("disabled")}set disabled(e){const t=this.shadowRoot?.querySelector("button");e?t?.setAttribute("disabled",""):t?.removeAttribute("disabled")}updateDisabledState(){const e=this.shadowRoot?.querySelector("button");this.hasAttribute("disabled")?e?.setAttribute("disabled",""):e?.removeAttribute("disabled")}handleClick(e){this.disabled?e.preventDefault():this.dispatchEvent(new CustomEvent("custom-button-click",{bubbles:!0,composed:!0}))}render(){this.shadowRoot.innerHTML='\n      <style>\n        :host {\n  --classy-padding-vertical: 16px;\n  --classy-padding-horizontal: 8px;\n  --classy-font-size: var(--classy-font__paragraph-md-bold--font-size, 20px);\n  --classy-line-height: var(--classy-font__paragraph-md-bold--line-height, 1.5);\n  --classy-font-weight: var(--classy-font__paragraph-md-bold--font-weight, 700);\n  --classy-font-family: var(--classy-font__font-family--base, sans-serif);\n  --classy-background-hover: var(--theme-color__brand-primary-darker, #364fc7); /* Assuming */\n  --classy-background-disabled: var(--theme-color__brand-primary-muted, #cccccc); /* Assuming */\n  --classy-border-focus: var(--classy-color__border--focus, #41a7ff);\n  --classy-filter-hover: brightness(0.88);\n  --classy-opacity-disabled: 0.5;\n  --classy-box-shadow: var(--classy-shadow__button);\n  --classy-box-shadow-active: none;\n  --classy-outline-focus-visible: 2px dotted var(--classy-border-focus);\n  --classy-outline-offset-focus-visible: 2px;\n  width: 100%;\n  display: block; /* Full width requires block display */\n  box-sizing: border-box; /* Padding included in width */\n}\n\nbutton {\n  font-family: var(--classy-font-family);\n  font-size: var(--classy-font-size);\n  line-height: var(--classy-line-height);\n  font-weight: var(--classy-font-weight);\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  color: inherit;\n  padding: var(--classy-padding-vertical) var(--classy-padding-horizontal);\n  overflow: hidden;\n  transition:\n    background-color 0.24s cubic-bezier(0.645, 0.045, 0.355, 1),\n    box-shadow 0.24s cubic-bezier(0.645, 0.045, 0.355, 1),\n    transform 0.24s cubic-bezier(0.645, 0.045, 0.355, 1),\n    opacity 0.24s cubic-bezier(0.645, 0.045, 0.355, 1);\n  background-color: var(--classy-background);\n  border-radius: var(--classy-border-radius, inherit);\n  border: none;\n  cursor: pointer;\n  text-decoration: none;\n\n  width: 100%;\n  height: 100%;\n}\n\nbutton:hover {\n  filter: var(--classy-filter-hover);\n}\n\nbutton:active {\n  box-shadow: var(--classy-box-shadow-active);\n  transform: scale(0.95);\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\nbutton:disabled {\n  background-color: var(--classy-background-disabled);\n  cursor: not-allowed;\n  opacity: var(--classy-opacity-disabled);\n  box-shadow: none;\n}\n\nbutton:focus-visible {\n  outline: var(--classy-outline-focus-visible);\n  outline-offset: var(--classy-outline-offset-focus-visible);\n}\n\nbutton:hover:not(:active) {\n  background-image: linear-gradient(\n    var(--computed-color__brand-primary--tint, rgba(66, 92, 205, 0.12)) 0 0\n  );\n}\n\n      </style>\n\n      <button part="button">\n  <slot part="button-slot-content"></slot>\n</button>\n\n    ';const e=this.shadowRoot.querySelector("button");e.removeEventListener("click",this.boundHandleClick),e.addEventListener("click",this.boundHandleClick)}});customElements.get("cl-hyperlink")||customElements.define("cl-hyperlink",class extends e{constructor(){super(),this.render()}static get observedAttributes(){return["href","text"]}href="";text="";attributeChangedCallback(e,t,n){"href"===e&&(this.href=n,this.updateLink()),"text"===e&&(this.text=n,this.updateLink())}updateLink(){const e=this.shadowRoot?.querySelector("a.link");e&&(e.setAttribute("href",this.href),e.textContent=this.text)}render(){this.shadowRoot.innerHTML='\n      <style>.link {\n    cursor: pointer;\n    text-decoration: none;\n  \n    font-family: var(--classy-font__font-family--base);\n    font-size: var(--classy-font__label--font-size);\n    font-weight: var(--classy-font__label--font-weight);\n    line-height: var(--classy-font__label--line-height);\n    color: inherit;\n  }\n  \n.link:hover {\n    text-decoration: underline;\n}</style>\n      <a part="link" class="link" target="_blank" rel="noopener noreferrer"></a>\n\n    ',this.updateLink()}});class t extends e{#e="";constructor(){super(),this.render()}static get observedAttributes(){return["value","placeholder","aria-label","data-id","disabled","type","step"]}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case"value":this.#e=n,this.updateInputValue();break;case"placeholder":case"aria-label":case"data-id":case"type":case"step":case"disabled":this.updateInputAttributes(e,n)}}get value(){return this.#e}set value(e){this.#e=e,this.updateInputValue()}handleInput(e){const t=e.target;this.#e=t.value,this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.#e}}))}updateInputValue(){const e=this.shadowRoot.querySelector("input");e&&(e.value=this.#e)}updateInputAttributes(e,t){const n=this.shadowRoot.querySelector("input");n&&(null===t?n.removeAttribute(e):n.setAttribute(e,t))}initializeAttributesAndListeners(){this.updateInputValue(),t.observedAttributes.forEach((e=>{this.updateInputAttributes(e,this.getAttribute(e))})),this.initializeEventListeners()}initializeEventListeners(){const e=this.shadowRoot.querySelector("input");e&&e.addEventListener("input",this.handleInput.bind(this))}render(){this.shadowRoot.innerHTML='\n      <style>\n        input {\n  padding: 0px;\n  width: 100%;\n  border: 1px solid var(--classy-color__border--input, #ccc);\n  border-radius: var(--classy-custom-grid-radius, 4px); /* Apply grid border radius */\n  font-family: var(--classy-font__font-family--base, sans-serif);\n  font-size: var(--classy-font__paragraph-md--font-size, 16px);\n  line-height: 1.5;\n  font-weight: 400;\n  color: var(--classy-color__text, #000);\n  background-color: var(--classy-color__background, #fff);\n  box-sizing: border-box;\n  box-shadow: none; /* Ensure no drop shadow is applied */\n}\n\ninput[type="date"] {\n  appearance: none;\n  box-shadow: 0px 2px 2px rgba(27, 25, 24, 0.12);\n  cursor: pointer;\n  min-height: 40px;\n  padding: 10px;\n  margin-top: 4px;\n  margin-bottom: 24px;\n}\n\n      </style>\n\n      <input type="text" part="classy-input-textfield">\n\n    ',this.initializeAttributesAndListeners()}}customElements.get("cl-custom-input")||customElements.define("cl-custom-input",t);const{slice:n,forEach:s}=[],o=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,i={create(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),s&&(i.domain=s),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!o.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!o.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}(e,encodeURIComponent(t),i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return null},remove(e){this.create(e,"",-1)}};var r={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return i.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:s,cookieDomain:o,cookieOptions:r}=t;n&&"undefined"!=typeof document&&i.create(n,e,s,o,r)}},a={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const s=e.substring(1).split("&");for(let e=0;e<s.length;e++){const o=s[e].indexOf("=");o>0&&s[e].substring(0,o)===n&&(t=s[e].substring(o+1))}}return t}};let l=null;const c=()=>{if(null!==l)return l;try{if(l="undefined"!=typeof window&&null!==window.localStorage,!l)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){l=!1}return l};var u={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&c())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&c()&&window.localStorage.setItem(n,e)}};let h=null;const d=()=>{if(null!==h)return h;try{if(h="undefined"!=typeof window&&null!==window.sessionStorage,!h)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){h=!1}return h};var g={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&d())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&d()&&window.sessionStorage.setItem(n,e)}},p={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:s}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),s&&t.push(s)}return t.length>0?t:void 0}},f={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const s=n||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(t=s.getAttribute("lang")),t}},m={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const s="number"==typeof t?t:0;return n[s]?.replace("/","")}},y={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[n]}};let b=!1;try{document.cookie,b=!0}catch(e){}const v=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];b||v.splice(1,1);class x{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return s.call(n.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:v,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(r),this.addDetector(a),this.addDetector(u),this.addDetector(g),this.addDetector(p),this.addDetector(f),this.addDetector(m),this.addDetector(y)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach((e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}})),t=t.map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}x.type="languageDetector";const w=e=>"string"==typeof e,S=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},k=e=>null==e?"":""+e,C=/###/g,A=e=>e&&e.indexOf("###")>-1?e.replace(C,"."):e,_=e=>!e||w(e),R=(e,t,n)=>{const s=w(t)?t.split("."):t;let o=0;for(;o<s.length-1;){if(_(e))return{};const t=A(s[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return _(e)?{}:{obj:e,k:A(s[o])}},E=(e,t,n)=>{const{obj:s,k:o}=R(e,t,Object);if(void 0!==s||1===t.length)return void(s[o]=n);let i=t[t.length-1],r=t.slice(0,t.length-1),a=R(e,r,Object);for(;void 0===a.obj&&r.length;)i=`${r[r.length-1]}.${i}`,r=r.slice(0,r.length-1),a=R(e,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},L=(e,t)=>{const{obj:n,k:s}=R(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},q=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?w(e[s])||e[s]instanceof String||w(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):q(e[s],t[s],n):e[s]=t[s]);return e},O=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var N={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const D=e=>w(e)?e.replace(/[&<>"'\/]/g,(e=>N[e])):e,F=[" ",",","?","!",";"],M=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),$=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(n);let o=e;for(let e=0;e<s.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let r=e;r<s.length;++r)if(r!==e&&(i+=n),i+=s[r],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&r<s.length-1)continue;e+=r-e+1;break}o=t}return o},P=e=>e?.replace("_","-"),I={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class T{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||I,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(w(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new T(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new T(this.logger,e)}}var j=new T;class z{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach((e=>{let[t,s]=e;for(let e=0;e<s;e++)t(...n)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((t=>{let[s,o]=t;for(let t=0;t<o;t++)s.apply(s,[e,...n])}))}}class H extends z{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,i=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],n&&(Array.isArray(n)?r.push(...n):w(n)&&o?r.push(...n.split(o)):r.push(n)));const a=L(this.data,r);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=r[0],t=r[1],n=r.slice(2).join(".")),!a&&i&&w(n)?$(this.data?.[e]?.[t],n,o):a}addResource(e,t,n,s){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let r=[e,t];n&&(r=r.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=e.split("."),s=t,t=r[1]),this.addNamespaces(t),E(this.data,r,s),o.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in n)(w(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},r=[e,t];e.indexOf(".")>-1&&(r=e.split("."),s=n,n=t,t=r[1]),this.addNamespaces(t);let a=L(this.data,r)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?q(a,n,o):a={...a,...n},E(this.data,r,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var U={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,o){return e.forEach((e=>{t=this.processors[e]?.process(t,n,s,o)??t})),t}};const V={},B=e=>!w(e)&&"boolean"!=typeof e&&"number"!=typeof e;class K extends z{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,s;super(),n=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((e=>{n[e]&&(s[e]=n[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=j.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return void 0!==n?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=F.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===s.length)return!0;const o=M.getRegExp(`(${s.map((e=>"?"===e?"\\?":e)).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,s));if(i&&!r){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:w(o)?[o]:o};const i=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(s)}return{key:e,namespaces:w(o)?[o]:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:r}=this.extractFromKey(e[e.length-1],t),a=r[r.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===l?.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${a}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${i}`}return s?{res:i,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:i}const u=this.resolve(e,t);let h=u?.res;const d=u?.usedKey||i,g=u?.exactUsedKey||i,p=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject,m=void 0!==t.count&&!w(t.count),y=K.hasDefaultValue(t),b=m?this.pluralResolver.getSuffix(l,t.count,t):"",v=t.ordinal&&m?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",x=m&&!t.ordinal&&0===t.count,S=x&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${b}`]||t[`defaultValue${v}`]||t.defaultValue;let k=h;f&&!h&&y&&(k=S);const C=B(k),A=Object.prototype.toString.apply(k);if(!(f&&k&&C&&["[object Number]","[object Function]","[object RegExp]"].indexOf(A)<0)||w(p)&&Array.isArray(k))if(f&&w(p)&&Array.isArray(h))h=h.join(p),h&&(h=this.extendTranslation(h,e,t,n));else{let s=!1,r=!1;!this.isValidLookup(h)&&y&&(s=!0,h=S),this.isValidLookup(h)||(r=!0,h=i);const c=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:h,d=y&&S!==h&&this.options.updateMissing;if(r||s||d){if(this.logger.log(d?"updateKey":"missingKey",l,a,i,d?S:h),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const s=(e,n,s)=>{const o=y&&s!==h?s:c;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,n,o,d,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,a,n,o,d,t),this.emit("missingKey",e,a,n,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&m?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);x&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{s([e],i+n,t[`defaultValue${n}`]||S)}))})):s(e,i,S))}h=this.extendTranslation(h,e,t,u,n),r&&h===i&&this.options.appendNamespaceToMissingKey&&(h=`${a}:${i}`),(r||s)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${i}`:i,s?h:void 0))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,k,{...t,ns:r}):`key '${i} (${this.language})' returned an object instead of string.`;return s?(u.res=e,u.usedParams=this.getUsedParamsDetails(t),u):e}if(o){const e=Array.isArray(k),n=e?[]:{},s=e?g:d;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const i=`${s}${o}${e}`;n[e]=y&&!h?this.translate(i,{...t,defaultValue:B(S)?S[e]:void 0,joinArrays:!1,ns:r}):this.translate(i,{...t,joinArrays:!1,ns:r}),n[e]===i&&(n[e]=k[e])}h=n}}return s?(u.res=h,u.usedParams=this.getUsedParamsDetails(t),u):h}extendTranslation(e,t,n,s,o){var i=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const r=w(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(r){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=n.replace&&!w(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||s.usedLng,n),r){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,s=new Array(e),r=0;r<e;r++)s[r]=arguments[r];return o?.[0]!==s[0]||n.context?i.translate(...s,t):(i.logger.warn(`It seems you are nesting recursively key: ${s[0]} in key: ${t[0]}`),null)}),n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,a=w(r)?[r]:r;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=U.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,s,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,r),l=a.key;n=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==r.count&&!w(r.count),h=u&&!r.ordinal&&0===r.count,d=void 0!==r.context&&(w(r.context)||"number"==typeof r.context)&&""!==r.context,g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(i=e,V[`${g[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(i)||(V[`${g[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${g.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach((n=>{if(this.isValidLookup(t))return;o=n;const i=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,l,n,e,r);else{let e;u&&(e=this.pluralResolver.getSuffix(n,r.count,r));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(i.push(l+e),r.ordinal&&0===e.indexOf(s)&&i.push(l+e.replace(s,this.options.pluralSeparator)),h&&i.push(l+t)),d){const n=`${l}${this.options.contextSeparator}${r.context}`;i.push(n),u&&(i.push(n+e),r.ordinal&&0===e.indexOf(s)&&i.push(n+e.replace(s,this.options.pluralSeparator)),h&&i.push(n+t))}}let a;for(;a=i.pop();)this.isValidLookup(t)||(s=a,t=this.getResource(n,e,a,r))})))}))})),{res:t,usedKey:n,exactUsedKey:s,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!w(e.replace);let s=n?e.replace:e;if(n&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class Y{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=j.create("languageUtils")}getScriptPartFromCode(e){if(!(e=P(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=P(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(w(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),w(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],o=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return w(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):w(e)&&o(this.formatLanguageCode(e)),n.forEach((e=>{s.indexOf(e)<0&&o(this.formatLanguageCode(e))})),s}}const J={zero:0,one:1,two:2,few:3,many:4,other:5},W={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Q{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=j.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=P("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:s})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),W;if(!e.match(/-|_/))return W;const s=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(s,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>J[e]-J[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const G=function(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((e,t,n)=>{const s=L(e,n);return void 0!==s?s:L(t,n)})(e,t,n);return!i&&o&&w(n)&&(i=$(e,n,s),void 0===i&&(i=$(t,n,s))),i},Z=e=>e.replace(/\$/g,"$$$$");class X{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=j.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:o,prefixEscaped:i,suffix:r,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:h,nestingPrefixEscaped:d,nestingSuffix:g,nestingSuffixEscaped:p,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:D,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=o?O(o):i||"{{",this.suffix=r?O(r):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?O(h):d||O("$t("),this.nestingSuffix=g?O(g):p||O(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let o,i,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=G(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...s,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),r=o.join(this.formatSeparator).trim();return this.format(G(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),r,n,{...s,...t,interpolationkey:i})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Z(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Z(this.escape(e)):Z(e)}].forEach((t=>{for(r=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,o,s);i=w(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))i="";else{if(u){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else w(i)||this.useRawValueToEscape||(i=k(i));const a=t.safeValue(i);if(e=e.replace(o[0],a),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),e}nest(e,t){let n,s,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const s=e.split(new RegExp(`${n}[ ]*{`));let i=`{${s[1]}`;e=s[0],i=this.interpolate(i,o);const r=i.match(/'/g),a=i.match(/"/g);((r?.length??0)%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let a=[];o={...i},o=o.replace&&!w(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),a=e,l=!0}if(s=t(r.call(this,n[1].trim(),o),o),s&&n[0]===e&&!w(s))return s;w(s)||(s=k(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),s=""),l&&(s=a.reduce(((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()})),s.trim())),e=e.replace(n[0],s),this.regexp.lastIndex=0}return e}}const ee=e=>{const t={};return(n,s,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const r=s+JSON.stringify(i);let a=t[r];return a||(a=e(P(s),o),t[r]=a),a(n)}};class te{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=j.create("formatter"),this.options=e,this.formats={number:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:ee(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:ee(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:ee(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ee(t)}format(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find((e=>e.indexOf(")")>-1))){const e=o.findIndex((e=>e.indexOf(")")>-1));o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce(((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const o=s[1].substring(0,s[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((e=>{if(e){const[t,...s]=e.split(":"),o=s.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const r=s?.formatParams?.[s.interpolationkey]||{},a=r.locale||r.lng||s.locale||s.lng||n;t=this.formats[o](e,a,{...i,...s,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e}),e)}}class ne extends z{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=j.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const o={},i={},r={},a={};return e.forEach((e=>{let s=!0;t.forEach((t=>{const r=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===i[r]&&(i[r]=!0):(this.state[r]=1,s=!1,void 0===i[r]&&(i[r]=!0),void 0===o[r]&&(o[r]=!0),void 0===a[t]&&(a[t]=!0)))})),s||(r[e]=!0)})),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const s=e.split("|"),o=s[0],i=s[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const r={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:s,k:o}=R(e,t,Object);s[o]=s[o]||[],s[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{r[e]||(r[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===r[e][t]&&(r[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:o,callback:i});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&a&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,s+1,2*o,i)}),o):i(r,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,r);try{const n=a(e,t);n&&"function"==typeof n.then?n.then((e=>r(null,e))).catch(r):r(null,n)}catch(e){r(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();w(e)&&(e=this.languageUtils.toResolveHierarchy(e)),w(t)&&(t=[t]);const o=this.queueLoad(e,t,n,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),s=n[0],o=n[1];this.read(s,o,"read",void 0,void 0,((n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${s} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${s}`,i),this.loaded(e,n,i)}))}saveMissing(e,t,n,s,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const a={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,s,a):l(e,t,n,s),o&&"function"==typeof o.then?o.then((e=>r(null,e))).catch(r):r(null,o)}catch(e){r(e)}else l(e,t,n,s,r,a)}e&&e[0]&&this.store.addResource(e[0],t,n,s)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const se=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),w(e[1])&&(t.defaultValue=e[1]),w(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),oe=e=>(w(e.ns)&&(e.ns=[e.ns]),w(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),w(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),ie=()=>{};class re extends z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=oe(e),this.services={},this.logger=j,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),null==t.defaultNS&&t.ns&&(w(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=se();this.options={...s,...this.options,...oe(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?j.init(o(this.modules.logger),this.options):j.init(null,this.options),t=this.modules.formatter?this.modules.formatter:te;const n=new Y(this.options);this.store=new H(this.options.resources,this.options);const i=this.services;i.logger=j,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Q(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new X(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new ne(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];e.emit(t,...s)})),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new K(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];e.emit(t,...s)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=ie),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const i=S(),r=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie;const n=w(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],s=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>s(e))),this.options.preload?.forEach?.((e=>s(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const s=S();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=ie),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),n(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&U.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=S();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,s.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},r=t=>{e||t||!this.services.languageDetector||(t=[]);const n=w(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(e=>{i(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),s}getFixedT(e,t,n){var s=this;const o=function(e,t){let i;if("object"!=typeof t){for(var r=arguments.length,a=new Array(r>2?r-2:0),l=2;l<r;l++)a[l-2]=arguments[l];i=s.options.overloadTranslationOptionHandler([e,t].concat(a))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const c=s.options.keySeparator||".";let u;return u=i.keyPrefix&&Array.isArray(e)?e.map((e=>`${i.keyPrefix}${c}${e}`)):i.keyPrefix?`${i.keyPrefix}${c}${e}`:e,s.t(u,i)};return w(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.translate(...t)}exists(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!i(n,e)||s&&!i(o,e)))}loadNamespaces(e,t){const n=S();return this.options.ns?(w(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=S();w(e)&&(e=[e]);const s=this.options.preload||[],o=e.filter((e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return o.length?(this.options.preload=s.concat(o),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new Y(se());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new re(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},o=new re(s);if(void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e)),["store","services","language"].forEach((e=>{o[e]=this[e]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),{}))),{});o.store=new H(e,s),o.services.resourceStore=o.store}return o.translator=new K(o.services,s),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];o.emit(e,...n)})),o.init(s,t),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=re.createInstance();ae.createInstance=re.createInstance,ae.createInstance,ae.dir,ae.init,ae.loadResources,ae.reloadResources,ae.use,ae.changeLanguage,ae.getFixedT,ae.t,ae.exists,ae.setDefaultNamespace,ae.hasLoadedNamespace,ae.loadNamespaces,ae.loadLanguages;const le={defaultNS:"common",fallbackLng:["en"],initAsync:!1,interpolation:{escapeValue:!1},ns:["common"]};class ce{i18n=(()=>ae.createInstance())();loadedNamespaces=(()=>new Set)();constructor(){this.i18n.use(x),this.i18n.init({...le,detection:{order:["cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"]}})}static getInstance(){return ce.instance||(ce.instance=new ce),ce.instance}addNamespaceResources(e,t){this.loadedNamespaces.has(e)||(Object.keys(t).forEach((n=>{this.i18n.addResourceBundle(n,e,t[n],!0,!0)})),this.loadedNamespaces.add(e))}translate(e,t){return this.i18n.t(e,t)}getLanguage(){return this.i18n.language}}class ue extends e{loadI18nResources(e,t){this.namespace=e,ce.getInstance().addNamespaceResources(e,t)}t(e,t,n){if(!this.namespace&&!n?.ns)throw new Error("Namespace is not set. Call `this.loadI18nResources()` with a namespace first, or provide a namespace in the options parameter.");return ce.getInstance().translate(e,{ns:this.namespace||n.ns,defaultValue:t,...n??{}})}getLanguage(){return ce.getInstance().getLanguage()}}const he=JSON.parse('{"custom-amount-placeholder":"Other","donation-amount":"Donation amount {{amountString}}","greater-amount-error-message":"Amount must be smaller than or equal to {{maxValue}}","less-amount-error-message":"Amount cannot be less than {{minValue}}"}'),de=JSON.parse('{"custom-amount-placeholder":"Otro","donation-amount":"Cantidad de la donación {{amountString}}","greater-amount-error-message":"La cantidad debe ser menor o igual a {{maxValue}}","less-amount-error-message":"La cantidad no puede ser menor que {{minValue}}"}'),ge={USD:"$",EUR:"€",GBP:"£",JPY:"¥",AUD:"A$",CAD:"CA$",CHF:"CHF",CNY:"¥",HKD:"HK$",NZD:"NZ$",SEK:"kr",KRW:"₩",SGD:"S$",NOK:"kr",MXN:"$",INR:"₹",RUB:"₽",ZAR:"R",TRY:"₺",BRL:"R$",TWD:"NT$",DKK:"kr",PLN:"zł",THB:"฿",IDR:"Rp",HUF:"Ft",CZK:"Kč",ILS:"₪",PHP:"₱",AED:"د.إ",COP:"$",SAR:"﷼",MYR:"RM"},pe=e=>ge[e]||e,fe=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"USD",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en";if(!e)return null;try{if(Number.isNaN(Number(e)))return`$${e}`;const o=pe(n),i=t?.maximumFractionDigits??2,r=t?.minimumFractionDigits??i;return`${o}${o!==n?"":" "}${new Intl.NumberFormat(s,{...t,style:"decimal",minimumFractionDigits:r,maximumFractionDigits:i}).format(Number(e))}`}catch(e){return console.error("Error formatting currency: ",e),"Curr. format err"}};customElements.get("cl-amount-selector")||customElements.define("cl-amount-selector",class extends ue{#t;#n;#s;#o;#i={presetAmounts:[],showCustomAmountsInput:!1,minimumDonationAmount:1};constructor(){super(),this.loadI18nResources("AmountSelector",{en:he,es:de}),this.#t=null,this.#s=!1,this.#o=!1,this.#n="USD",this.handleAmountClick=this.handleAmountClick.bind(this),this.handleCustomAmountChange=this.handleCustomAmountChange.bind(this),this.updateActiveStates=this.updateActiveStates.bind(this),this.render()}connectedCallback(){this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}handleCurrencyChange=e=>{const t=e.target;this.updateCurrencySymbol(t.value),this.updateCurrencyCodeDisplay(t.value),this.dispatchEvent(new CustomEvent("currency-selection-change",{detail:{selectedCurrency:t.value},bubbles:!0,composed:!0}))};updateCurrencyCodeDisplay(e){const t=this.shadowRoot.querySelector(".currency-code-display");t&&(t.textContent=e)}updateCurrencySymbol(e){const t=pe(e),n=this.shadowRoot.querySelector(".currency-symbol");n&&(n.textContent=t);const s=this.shadowRoot.querySelector('fieldset[aria-label="donation amount"]');s.innerHTML="",s.classList.remove("buttons-1","buttons-2","buttons-3","buttons-4");const o=this.#i.presetAmounts.filter((e=>{let{name:t}=e;return"other"!==t}));let i=0;o.forEach((t=>{let{amount:n,isVisible:o}=t;if(o){const t=document.createElement("cl-custom-button"),o=n.toString();t.setAttribute("value",o),t.textContent=fe(o,{maximumFractionDigits:0},e,this.getLanguage());const r=t.shadowRoot?.querySelector("button");r?.setAttribute("aria-label",`Donation amount $${o}`),i+=1,s.appendChild(t)}})),s.classList.add(`buttons-${i}`),this.updateActiveStates()}removeEventListeners(){const e=this.shadowRoot?.querySelector("cl-custom-input");e&&(e.removeEventListener("value-change",this.handleCustomAmountChange),e.removeEventListener("blur",this.handleCustomAmountChange));const t=this.shadowRoot?.querySelector(".currency-select");t&&t.removeEventListener("change",this.handleCurrencyChange)}setupEventListeners(){this.shadowRoot?.addEventListener("custom-button-click",this.handleAmountClick);const e=this.shadowRoot?.querySelector("cl-custom-input");e&&e.addEventListener("blur",this.handleCustomAmountChange);const t=this.shadowRoot?.querySelector(".currency-select");t&&t.addEventListener("change",this.handleCurrencyChange)}handleAmountClick(e){const t=e.target,n=Number(t.getAttribute("value")),s=this.#i.minimumDonationAmount;if(n){if(n<s){this.selectedAmount=null,this.displayErrorMessage(this.t("less-amount-error-message","Amount cannot be less than {{minValue}}",{minValue:s}));const e=this.shadowRoot.querySelector("cl-custom-input"),t=this.shadowRoot.querySelector(".currency-custom-amount-container");return t?.classList.add("error"),e.value="",void(this.#t=null)}this.#s=!1,this.selectedAmount=n;const e=this.shadowRoot.querySelector("cl-custom-input");e&&(e.value=n.toString()),this.dispatchEvent(new CustomEvent("amount-selection-change",{detail:{selectedAmount:n},bubbles:!0,composed:!0}))}}handleCustomAmountChange(e){const t=e.target,n=parseFloat(t.value);this.#s=!0;const s=1e7,o=this.#i.minimumDonationAmount,i=this.shadowRoot.querySelector("cl-custom-input"),r=this.shadowRoot.querySelector(".currency-custom-amount-container");n>s?(this.selectedAmount=null,this.displayErrorMessage(this.t("greater-amount-error-message","Amount must be smaller than or equal to {{maxValue}}",{maxValue:s})),r?.classList.add("error"),i.value="",this.#t=null):n<o?(this.selectedAmount=null,this.displayErrorMessage(this.t("less-amount-error-message","Amount cannot be less than {{minValue}}",{minValue:o})),r?.classList.add("error"),i.value="",this.#t=null):(this.selectedAmount=n,r?.classList.remove("error"),this.dispatchEvent(new CustomEvent("amount-selection-change",{detail:{selectedAmount:n},bubbles:!0,composed:!0})),this.updateActiveStates())}static get observedAttributes(){return["selected-amount"]}set config(e){this.#i=e,this.applyDynamicConfiguration()}updateActiveStates(){const e=this.shadowRoot.querySelectorAll("cl-custom-button"),t=this.shadowRoot.querySelector("cl-custom-input"),n=this.shadowRoot.querySelector(".currency-custom-amount-container"),s=this.#i.minimumDonationAmount??0;e.forEach((e=>{const t=e.getAttribute("value"),n=null!==t?Number(t):Number.NaN,o=Number.isNaN(n)||n>=s,i=!this.#s&&o&&n===this.#t,r=e.shadowRoot?.querySelector("button");r?.setAttribute("aria-pressed",i.toString()),e.toggleAttribute("active",i)})),this.#s?(n?.classList.add("active"),t?.setAttribute("active","")):(n?.classList.remove("active"),t?.removeAttribute("active"))}applyDynamicConfiguration(){const e=this.shadowRoot.querySelector('fieldset[aria-label="donation amount"]'),t=this.#o;let n;this.#o=!1,this.#i.currencies&&(n=this.#i.currencies?.find((e=>e.selected)),this.#n=pe(n?.value||"USD")),e.innerHTML="",e.classList.remove("buttons-1","buttons-2","buttons-3","buttons-4");const s=this.#i.presetAmounts.filter((e=>{let{name:t}=e;return"other"!==t}));let o=0;s.forEach(((i,r)=>{let{amount:a,isVisible:l,isDefault:c}=i;if(l){const i=document.createElement("cl-custom-button"),l=a.toString();if(i.setAttribute("value",l),i.textContent=fe(l,{maximumFractionDigits:0},n?.value||"USD",this.getLanguage()),c){const e=Number(l);t||null!==this.#t&&0!==this.#t?this.#t===e&&i.setAttribute("active",""):(this.selectedAmount=e,i.setAttribute("active",""))}const u=i.shadowRoot?.querySelector("button");u?.setAttribute("aria-label",this.t("donation-amount","Donation amount {{amountString}}",{amountString:l})),4===o&&4===r&&5===s.length&&i.classList.add("full-width"),o+=1,e.appendChild(i)}})),e.classList.add(`buttons-${o}`);const i=this.#i.presetAmounts.find((e=>{let{name:t}=e;return"other"===t})),r=this.shadowRoot.querySelector(".currency-custom-amount-container"),a=this.shadowRoot.querySelector("cl-custom-input");r.style.visibility=i?.isVisible?"":"hidden",i?.isDefault?(this.#s=!0,a.setAttribute("active",""),a.value=null,this.selectedAmount=i.amount):this.#s||(a.removeAttribute("active"),a.value="",r.style.visibility=i?.isVisible?"":"hidden");const l=this.shadowRoot.querySelector(".currency-select");this.#i.currencies&&l&&(l.innerHTML="",this.#i.currencies.forEach((e=>{let{label:t,value:n,selected:s}=e;const o=document.createElement("option");o.value=n,o.textContent=t,o.selected=s,l.appendChild(o),s&&this.updateCurrencyCodeDisplay(n)})));const c=this.#i.minimumDonationAmount,u=this.#i.presetAmounts.find((e=>e.isDefault)),h=null!==this.#t&&this.#t<c,d=!t&&!this.#s&&void 0!==u&&u.amount<c;if(h||d){d&&!h&&(this.selectedAmount=null),this.displayErrorMessage(this.t("less-amount-error-message","Amount cannot be less than {{minValue}}",{minValue:c}));const e=this.shadowRoot.querySelector(".currency-custom-amount-container");e?.classList.add("error")}this.updateActiveStates()}attributeChangedCallback(e,t,n){if("selected-amount"===e&&t!==n){const e=null===n?null:Number(n);this.#t=null===e?null:e,this.updateActiveStates()}}get selectedAmount(){return this.#t}set selectedAmount(e){this.#t=Number(e),this.updateActiveStates(),this.clearErrorMessage()}get isCustomAmountActive(){return this.#s}set isCustomAmountActive(e){this.#s=e}setCustomInputValue(e){const t=this.shadowRoot.querySelector("cl-custom-input");t&&(t.value=e)}setSelectedAmountSilently(e){this.#t=null===e?null:Number(e),this.#o=!0}resetSelectedAmountSilently(){this.#t=null}displayErrorMessage(e){const t=this.shadowRoot.querySelector(".error-message");t&&(t.textContent=`⚠ ${e}`,t.style.display="block")}clearErrorMessage(){const e=this.shadowRoot.querySelector(".error-message"),t=this.shadowRoot.querySelector(".currency-custom-amount-container");e&&(e.textContent="",e.style.display="none"),t&&t.classList.remove("error")}updateCurrencyLabel(){const e=this.shadowRoot.querySelector("#currency-label");e&&(e.textContent="USD")}updateAmountPlaceholder(){const e=this.shadowRoot.querySelector("#custom-amount");e&&e.setAttribute("placeholder",this.t("custom-amount-placeholder","Other"))}render(){this.shadowRoot.innerHTML='\n      <style>\n        :host {\n  display: grid;\n  gap: 4px;\n  /* Spacing between grid items */\n  /* Remove this comment at will */\n}\n\n.currency-custom-amount-container {\n  border-radius: var(--classy-custom-grid-radius, 8px);\n  /* Apply grid border radius */\n  height: 56px;\n  display: flex;\n  overflow: hidden;\n  /* Ensure inner elements do not affect the container\'s border radius */\n}\n\n.currency-select {\n  height: 100%;\n  display: flex;\n  align-items: center;\n  border: none;\n  width: 85px;\n  appearance: none; /* Remove default arrow (for most browsers) */\n  -webkit-appearance: none; /* Safari */\n  -moz-appearance: none; /* Firefox */\n\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-theme-font__paragraph-md--font-size);\n  line-height: var(--classy-theme-font__paragraph-md--line-height);\n  font-weight: var(--classy-font__paragraph-md--font-weight);\n  padding: 16px 12px;\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Use secondary color */\n\n  /* Respect the border radius for the top-left and bottom-left corners */\n  border-top-left-radius: var(--classy-custom-grid-radius, 8px);\n  border-bottom-left-radius: var(--classy-custom-grid-radius, 8px);\n\n  /* Always hide the select text in the button area (we\'ll show it via overlay) */\n  /* The dropdown options will still show the full text */\n  text-indent: -9999px;\n}\n\n/* Make sure dropdown options show the full text */\n.currency-select option {\n  text-indent: 0;\n  direction: ltr;\n}\n\n.currency-select-wrapper {\n  position: relative;\n  display: inline-block;\n}\n\n/* Overlay to display only the currency code */\n.currency-code-display {\n  position: absolute;\n  left: 12px;\n  top: 50%;\n  transform: translateY(-50%);\n  pointer-events: none;\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-theme-font__paragraph-md--font-size);\n  line-height: var(--classy-theme-font__paragraph-md--line-height);\n  font-weight: var(--classy-font__paragraph-md--font-weight);\n  color: var(--classy-color__neutral--10);\n}\n\n/* Custom arrow */\n.currency-select-wrapper::after {\n  content: \'▾\';\n  font-size: 20px;\n  position: absolute;\n  right: 0.4rem;\n  top: 50%;\n  transform: translateY(-55%);\n  font-weight: bold;\n  pointer-events: none;\n  background: var(--classy-custom-secondary-color, #e8ebf9);\n  padding: 1px 4px 1px 4px;\n  font-family: \'Domine\';\n}\n\n.currency-input-container {\n  border-left: 1px solid white;\n  flex-grow: 1;\n  width: 100%;\n  color: var(--classy-color__neutral--10);\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Use secondary color */\n  gap: 4px;\n  padding: 0;\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight);\n  padding-left: 12px;\n  display: flex;\n  align-items: center;\n}\n\n.currency-custom-amount-container.active {\n  outline: 2px solid var(--classy-custom-primary-color, #425cc7);\n  /* Use primary color */\n  margin-left: 0px;\n  outline-offset: -2px;\n}\n\n.currency-custom-amount-container.active .currency-label {\n  background-color: var(--classy-custom-primary-color, #425cc7);\n  /* Use primary color */\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\n.currency-custom-amount-container.error {\n  border: 2px solid var(--classy-color__status--error-base);\n  margin-left: 0px;\n}\n\n.currency-custom-amount-container.error .currency-label {\n  background-color: var(--classy-color__status--error-base);\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\n.error-message {\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__label--font-size);\n  line-height: var(--classy-font__label--line-height);\n  font-weight: var(--classy-font__label--font-weight);\n  color: var(--classy-color__status--error-base);\n}\n\ncl-custom-input {\n  flex-grow: 1;\n}\n\ncl-custom-input::part(classy-input-textfield) {\n  width: 100%;\n  color: rgba(0, 0, 0, 0.9);\n  background: transparent;\n  border: unset;\n  font-family: var(--classy-font__font-family--base, sans-serif);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size, 20px);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height, 1.5);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight, 700);\n}\n\ncl-custom-input::part(classy-input-textfield):focus-visible {\n  outline: none;\n}\n\ncl-custom-input::part(classy-input-textfield)::placeholder {\n  color: var(--classy-color__neutral--10);\n}\n\nfieldset {\n  display: grid;\n  gap: 4px;\n  border: none;\n  padding: 0;\n  margin: 0;\n}\n\nfieldset.buttons-6 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-5 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-4 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-3 {\n  grid-template-columns: repeat(3, 1fr);\n}\n\nfieldset.buttons-2 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-1 {\n  grid-template-columns: 1fr;\n}\n\ncl-custom-button::part(button),\ncl-custom-button {\n  font-family: var(--classy-font__font-family--base, \'Arial\', sans-serif);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size, \'20px\');\n  line-height: var(--classy-font__paragraph-lg-bold--line-height, \'30px\');\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight, \'700\');\n\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n\n  border-radius: var(--classy-custom-grid-radius, 8px);\n  /* Apply frequency border radius */\n  border: unset;\n  max-height: 56px;\n  /* Set the max height for each button */\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0;\n  /* Remove any extra padding to ensure the button size reflects its content */\n  height: 56px;\n  /* Ensure each button has a consistent height */\n  overflow: hidden;\n  /* Ensure content doesn\'t overflow the button */\n  box-sizing: border-box;\n  /* Include padding and border in the element\'s width and height */\n}\n\ncl-custom-button:focus-visible {\n  border-radius: var(--classy-custom-grid-radius, 8px);\n  /* Apply frequency border radius */\n}\n\ncl-custom-button[active] {\n  background-color: var(--classy-custom-primary-color, #425cc7);\n  /* Use primary color */\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\ncl-custom-button:not([active]) {\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Use secondary color */\n  color: var(--classy-color__neutral--10);\n}\n\ncl-custom-button.full-width {\n  grid-column: 1 / span 2;\n}\n\n      </style>\n    \n      <fieldset aria-label="donation amount"></fieldset>\n\n<div class="currency-custom-amount-container">\n  <div class="currency-select-wrapper">\n    <select class="currency-select"></select>\n    <span class="currency-code-display"></span>\n  </div>\n  <span class="currency-input-container">\n    <span class="currency-symbol"></span>\n    <cl-custom-input\n      data-id="custom-amount"\n      type="number"\n      step="1.00"\n      id="custom-amount"\n    ></cl-custom-input>\n  </span>\n</div>\n\n<div class="error-message" style="display: none; color: red" />\n    ',this.updateActiveStates(),this.applyDynamicConfiguration(),this.updateCurrencyLabel(),this.updateCurrencySymbol("USD"),this.updateAmountPlaceholder()}});const me=JSON.parse('{"higher-impact-title":"Higher Impact"}'),ye=JSON.parse('{"higher-impact-title":"Mayor impacto"}');customElements.get("cl-toggle-group")||customElements.define("cl-toggle-group",class extends ue{#i={showRecurringTag:!1};#r;constructor(){super(),this.loadI18nResources("ToggleGroup",{en:me,es:ye}),this.#r="one-time",this.render()}get config(){return this.#i}set config(e){this.#i=e,this.applyDynamicConfiguration()}applyDynamicConfiguration(){const e=this.shadowRoot.querySelector("cl-tag");if(e){const t=this.shadowRoot.querySelector("#higherImpact");t&&(t.textContent=` ${this.t("higher-impact-title","Higher Impact")} `),e.setAttribute("class",this.#i.showRecurringTag?"":"hidden")}}connectedCallback(){this.shadowRoot.addEventListener("click",this.handleToggleClick),this.updateButtonStates()}disconnectedCallback(){this.shadowRoot.removeEventListener("click",this.handleToggleClick)}handleToggleClick=e=>{const t=e.composedPath().find((e=>"cl-custom-button"===e?.tagName?.toLowerCase()));if(t){const e=t.getAttribute("value");e&&(this.selected=e)}};static get observedAttributes(){return["selected"]}attributeChangedCallback(e,t,n){"selected"===e&&t!==n&&(this.#r=n,this.updateButtonStates())}get selected(){return this.#r}set selected(e){this.#r!==e&&(this.#r=e,this.setAttribute("selected",e),this.updateButtonStates(),this.dispatchEvent(new CustomEvent("selection-change",{detail:{selected:e},bubbles:!0,composed:!0})))}updateButtonStates(){const e=this.shadowRoot.querySelectorAll("cl-custom-button");setTimeout((()=>{e.forEach((e=>{const t=e.getAttribute("value")===this.#r;e.toggleAttribute("active",t);const n=e.shadowRoot?.querySelector("button");n&&(t?(n.style.display="flex",n.style.gap="6px"):(n.style.display="",n.style.gap=""),n?.setAttribute("aria-pressed",t.toString()));const s=e.querySelector("svg");if(t){if(!s){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("viewBox","6 7 13 10"),t.setAttribute("width","12"),t.setAttribute("height","12");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M10.5 16.5c-.1 0-.2-.02-.4-.07-.12-.05-.23-.12-.34-.23L6.27 12.7c-.19-.19-.28-.43-.27-.72.01-.28.1-.51.3-.7.19-.19.43-.28.72-.28s.53.09.72.28l2.83 2.83L17.35 7.3c.19-.19.42-.28.72-.28.28-.01.52.09.74.3.19.19.28.42.28.7 0 .28-.09.52-.28.71l-7.54 7.54c-.11.11-.23.18-.34.23-.13.05-.25.07-.39.07z"),n.setAttribute("fill","var(--computed-color__brand-primary--contrast, #ffffff)"),t.appendChild(n),e.prepend(t)}}else s&&s.remove()}))}),5)}render(){this.shadowRoot.innerHTML='\n      <style>\n        fieldset {\n  display: flex;\n  border-radius: var(--classy-custom-frequency-radius, 24px);\n  /* Use the frequency border radius */\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Default secondary color for inactive state */\n  height: 42px;\n  justify-content: space-around;\n  padding: 0px;\n  border: 2px solid var(--classy-background);\n}\n\ncl-custom-button::part(button),\ncl-custom-button {\n  font-family: var(--classy-font__font-family--base, \'Arial\', sans-serif);\n  font-size: var(--classy-font__paragraph-md-bold--font-size, \'16px\');\n  line-height: var(--classy-font__paragraph-md-bold--line-height, \'1.5\');\n  font-weight: var(--classy-font__paragraph-md-bold--font-weight, \'700\');\n  border-radius: var(--classy-custom-frequency-radius, 24px);\n  cursor: pointer;\n  transition: all 0.24s cubic-bezier(0.645, 0.045, 0.355, 1);\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n}\n\ncl-custom-button[active] {\n  background-color: var(--classy-custom-primary-color, #425cc7);\n  /* Primary color when active */\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n  box-shadow: var(--classy-shadow__active, 0 2px 4px rgba(0, 0, 0, 0.2));\n}\n\ncl-custom-button:not([active]) {\n  background-color: rgba(0, 0, 0, 0);\n  /* No background when inactive */\n  color: var(--classy-color__neutral--10);\n}\n\ncl-tag::part(tag),\n.tag-children {\n  display: flex;\n  align-items: center;\n  gap: 2px;\n}\n\ncl-tag::part(tag),\n.heart-path {\n  fill: var(--classy-custom-primary-color, #425cc7);\n  stroke: var(--classy-custom-primary-color, #425cc7);\n}\n\ncl-tag::part(tag),\n.impact-icon {\n  fill: var(--classy-custom-primary-color, #425cc7);\n}\n\n.hidden {\n  display: none;\n}\n\n      </style>\n\n      <fieldset>\n  <cl-custom-button value="one-time"></cl-custom-button>\n  <div style="display: flex; width: 100%; position: relative">\n    <cl-tag position="top-center">\n      <div class="tag-children">\n        <span id="higherImpact"></span>\n        <svg\n          width="15"\n          height="14"\n          viewBox="0 0 15 14"\n          fill="none"\n          xmlns="http://www.w3.org/2000/svg"\n          class="impact-icon"\n        >\n          <path\n            d="M6.95832 3.5966L7.29167 3.98877L7.62502 3.5966C7.84932 3.33271 8.11408 3.13036 8.42214 2.98616C8.72952 2.84228 9.05119 2.77075 9.39167 2.77075C10.0138 2.77075 10.5109 2.97455 10.914 3.37761C11.317 3.78068 11.5208 4.27774 11.5208 4.89992C11.5208 5.20748 11.4692 5.50836 11.3649 5.80456C11.2634 6.09251 11.0773 6.42875 10.7905 6.81486C10.504 7.20051 10.1113 7.64486 9.60731 8.14889C9.10121 8.655 8.45783 9.25999 7.67574 9.96466C7.67565 9.96474 7.67557 9.96481 7.67548 9.96489L7.29167 10.309L6.90785 9.96489C6.90776 9.96481 6.90768 9.96474 6.90759 9.96466C6.1255 9.25999 5.48213 8.655 4.97603 8.14889C4.47199 7.64486 4.07935 7.20051 3.79287 6.81486C3.50605 6.42875 3.31991 6.09251 3.21848 5.80456C3.11414 5.50836 3.0625 5.20748 3.0625 4.89992C3.0625 4.27774 3.26629 3.78068 3.66936 3.37761C4.07243 2.97455 4.56949 2.77075 5.19167 2.77075C5.53215 2.77075 5.85382 2.84228 6.16119 2.98616C6.46926 3.13036 6.73401 3.33271 6.95832 3.5966Z"\n            class="heart-icon"\n          />\n        </svg>\n      </div>\n    </cl-tag>\n    <cl-custom-button value="recurring"></cl-custom-button>\n  </div>\n</fieldset>\n\n    ',this.updateButtonStates()}});function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}customElements.get("cl-tag")||customElements.define("cl-tag",class extends e{constructor(){super(),this.render()}static get observedAttributes(){return["text","position"]}attributeChangedCallback(e,t,n){if("text"===e){const e=this.shadowRoot?.querySelector(".tag-content");e&&(e.textContent=n)}if("position"===e){const e=this.shadowRoot?.querySelector(".tag");e&&e.setAttribute("data-position",n)}}render(){this.shadowRoot.innerHTML="\n      <style>:host {\n  display: inline-block;\n}\n\n.tag {\n  display: flex;\n  align-items: center;\n  position: absolute;\n\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__tag-bold--font-size, '12px');\n  line-height: var(--classy-font__tag-bold--line-height, '1');\n  font-weight: var(--classy-font__tag-bold--font-weight, '700');\n\n  color: var(--classy-color__text, #333333);\n  background-color: var(--classy-color__background-light, #ffffff);\n  padding: 0.25rem 0.5rem;\n  border: 2px solid var(--classy-color__border,);\n  border-radius: var(--classy-border-radius, 24px);\n  text-transform: uppercase;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  max-width: 100%;\n}\n\n/* Top positions */\n.tag[data-position='top-center'] {\n  top: -1.3rem;\n  right: 50%;\n  transform: translateX(50%);\n}\n\n.tag[data-position='top-right'] {\n  top: -1.3rem;\n  right: 0;\n}\n\n.tag[data-position='top-left'] {\n  top: -1.3rem;\n  left: 0;\n}\n\n/* Bottom positions */\n.tag[data-position='bottom-center'] {\n  bottom: -1.3rem;\n  right: 50%;\n  transform: translateX(50%);\n}\n\n.tag[data-position='bottom-right'] {\n  bottom: -1.3rem;\n  right: 0;\n}\n\n.tag[data-position='bottom-left'] {\n  bottom: -1.3rem;\n  left: 0;\n}\n\n/* Side positions */\n.tag[data-position='left-center'] {\n  left: -50%;\n  top: 50%;\n  transform: translateY(-50%);\n  transform-origin: right center;\n}\n\n.tag[data-position='right-center'] {\n  right: -50%;\n  top: 50%;\n  transform: translateY(-50%);\n  transform-origin: left center;\n}\n\n.hidden {\n  display: none;\n}\n</style>\n      <span class=\"tag\" part=\"tag\">\n  <slot></slot>\n</span>\n\n    "}});var ve=/^\s+/,xe=/\s+$/;function we(e,t){if(t=t||{},(e=e||"")instanceof we)return e;if(!(this instanceof we))return new we(e,t);var n=function(e){var t,n,s,o={r:0,g:0,b:0},i=1,r=null,a=null,l=null,c=!1,u=!1;return"string"==typeof e&&(e=function(e){e=e.replace(ve,"").replace(xe,"").toLowerCase();var t,n=!1;if(Ie[e])e=Ie[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=Ge.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Ge.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ge.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Ge.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ge.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Ge.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ge.hex8.exec(e))?{r:Ue(t[1]),g:Ue(t[2]),b:Ue(t[3]),a:Ye(t[4]),format:n?"name":"hex8"}:(t=Ge.hex6.exec(e))?{r:Ue(t[1]),g:Ue(t[2]),b:Ue(t[3]),format:n?"name":"hex"}:(t=Ge.hex4.exec(e))?{r:Ue(t[1]+""+t[1]),g:Ue(t[2]+""+t[2]),b:Ue(t[3]+""+t[3]),a:Ye(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=Ge.hex3.exec(e))&&{r:Ue(t[1]+""+t[1]),g:Ue(t[2]+""+t[2]),b:Ue(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==be(e)&&(Ze(e.r)&&Ze(e.g)&&Ze(e.b)?(t=e.r,n=e.g,s=e.b,o={r:255*ze(t,255),g:255*ze(n,255),b:255*ze(s,255)},c=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):Ze(e.h)&&Ze(e.s)&&Ze(e.v)?(r=Be(e.s),a=Be(e.v),o=function(e,t,n){e=6*ze(e,360),t=ze(t,100),n=ze(n,100);var s=Math.floor(e),o=e-s,i=n*(1-t),r=n*(1-o*t),a=n*(1-(1-o)*t),l=s%6;return{r:255*[n,r,i,i,a,n][l],g:255*[a,n,n,r,i,i][l],b:255*[i,i,a,n,n,r][l]}}(e.h,r,a),c=!0,u="hsv"):Ze(e.h)&&Ze(e.s)&&Ze(e.l)&&(r=Be(e.s),l=Be(e.l),o=function(e,t,n){var s,o,i;function r(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=ze(e,360),t=ze(t,100),n=ze(n,100),0===t)s=o=i=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=r(l,a,e+1/3),o=r(l,a,e),i=r(l,a,e-1/3)}return{r:255*s,g:255*o,b:255*i}}(e.h,r,l),c=!0,u="hsl"),e.hasOwnProperty("a")&&(i=e.a)),i=je(i),{ok:c,format:e.format||u,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a:i}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Se(e,t,n){e=ze(e,255),t=ze(t,255),n=ze(n,255);var s,o,i=Math.max(e,t,n),r=Math.min(e,t,n),a=(i+r)/2;if(i==r)s=o=0;else{var l=i-r;switch(o=a>.5?l/(2-i-r):l/(i+r),i){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:o,l:a}}function ke(e,t,n){e=ze(e,255),t=ze(t,255),n=ze(n,255);var s,o,i=Math.max(e,t,n),r=Math.min(e,t,n),a=i,l=i-r;if(o=0===i?0:l/i,i==r)s=0;else{switch(i){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:o,v:a}}function Ce(e,t,n,s){var o=[Ve(Math.round(e).toString(16)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16))];return s&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Ae(e,t,n,s){return[Ve(Ke(s)),Ve(Math.round(e).toString(16)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16))].join("")}function _e(e,t){t=0===t?0:t||10;var n=we(e).toHsl();return n.s-=t/100,n.s=He(n.s),we(n)}function Re(e,t){t=0===t?0:t||10;var n=we(e).toHsl();return n.s+=t/100,n.s=He(n.s),we(n)}function Ee(e){return we(e).desaturate(100)}function Le(e,t){t=0===t?0:t||10;var n=we(e).toHsl();return n.l+=t/100,n.l=He(n.l),we(n)}function qe(e,t){t=0===t?0:t||10;var n=we(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),we(n)}function Oe(e,t){t=0===t?0:t||10;var n=we(e).toHsl();return n.l-=t/100,n.l=He(n.l),we(n)}function Ne(e,t){var n=we(e).toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,we(n)}function De(e){var t=we(e).toHsl();return t.h=(t.h+180)%360,we(t)}function Fe(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=we(e).toHsl(),s=[we(e)],o=360/t,i=1;i<t;i++)s.push(we({h:(n.h+i*o)%360,s:n.s,l:n.l}));return s}function Me(e){var t=we(e).toHsl(),n=t.h;return[we(e),we({h:(n+72)%360,s:t.s,l:t.l}),we({h:(n+216)%360,s:t.s,l:t.l})]}function $e(e,t,n){t=t||6,n=n||30;var s=we(e).toHsl(),o=360/n,i=[we(e)];for(s.h=(s.h-(o*t>>1)+720)%360;--t;)s.h=(s.h+o)%360,i.push(we(s));return i}function Pe(e,t){t=t||6;for(var n=we(e).toHsv(),s=n.h,o=n.s,i=n.v,r=[],a=1/t;t--;)r.push(we({h:s,s:o,v:i})),i=(i+a)%1;return r}we.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=je(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=ke(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=ke(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=Se(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Se(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return Ce(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,o){var i=[Ve(Math.round(e).toString(16)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Ke(s))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*ze(this._r,255))+"%",g:Math.round(100*ze(this._g,255))+"%",b:Math.round(100*ze(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ze(this._r,255))+"%, "+Math.round(100*ze(this._g,255))+"%, "+Math.round(100*ze(this._b,255))+"%)":"rgba("+Math.round(100*ze(this._r,255))+"%, "+Math.round(100*ze(this._g,255))+"%, "+Math.round(100*ze(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Te[Ce(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Ae(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var o=we(e);n="#"+Ae(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return we(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Le,arguments)},brighten:function(){return this._applyModification(qe,arguments)},darken:function(){return this._applyModification(Oe,arguments)},desaturate:function(){return this._applyModification(_e,arguments)},saturate:function(){return this._applyModification(Re,arguments)},greyscale:function(){return this._applyModification(Ee,arguments)},spin:function(){return this._applyModification(Ne,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination($e,arguments)},complement:function(){return this._applyCombination(De,arguments)},monochromatic:function(){return this._applyCombination(Pe,arguments)},splitcomplement:function(){return this._applyCombination(Me,arguments)},triad:function(){return this._applyCombination(Fe,[3])},tetrad:function(){return this._applyCombination(Fe,[4])}},we.fromRatio=function(e,t){if("object"==be(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:Be(e[s]));e=n}return we(e,t)},we.equals=function(e,t){return!(!e||!t)&&we(e).toRgbString()==we(t).toRgbString()},we.random=function(){return we.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},we.mix=function(e,t,n){n=0===n?0:n||50;var s=we(e).toRgb(),o=we(t).toRgb(),i=n/100;return we({r:(o.r-s.r)*i+s.r,g:(o.g-s.g)*i+s.g,b:(o.b-s.b)*i+s.b,a:(o.a-s.a)*i+s.a})},we.readability=function(e,t){var n=we(e),s=we(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},we.isReadable=function(e,t,n){var s,o,i,r,a,l=we.readability(e,t);switch(o=!1,(i=n,"AA"!==(r=((i=i||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==r&&(r="AA"),"small"!==(a=(i.size||"small").toLowerCase())&&"large"!==a&&(a="small"),s={level:r,size:a}).level+s.size){case"AAsmall":case"AAAlarge":o=l>=4.5;break;case"AAlarge":o=l>=3;break;case"AAAsmall":o=l>=7}return o},we.mostReadable=function(e,t,n){var s,o,i,r,a=null,l=0;o=(n=n||{}).includeFallbackColors,i=n.level,r=n.size;for(var c=0;c<t.length;c++)(s=we.readability(e,t[c]))>l&&(l=s,a=we(t[c]));return we.isReadable(e,a,{level:i,size:r})||!o?a:(n.includeFallbackColors=!1,we.mostReadable(e,["#fff","#000"],n))};var Ie=we.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Te=we.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(Ie);function je(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ze(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function He(e){return Math.min(1,Math.max(0,e))}function Ue(e){return parseInt(e,16)}function Ve(e){return 1==e.length?"0"+e:""+e}function Be(e){return e<=1&&(e=100*e+"%"),e}function Ke(e){return Math.round(255*parseFloat(e)).toString(16)}function Ye(e){return Ue(e)/255}var Je,We,Qe,Ge=(We="[\\s|\\(]+("+(Je="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Je+")[,|\\s]+("+Je+")\\s*\\)?",Qe="[\\s|\\(]+("+Je+")[,|\\s]+("+Je+")[,|\\s]+("+Je+")[,|\\s]+("+Je+")\\s*\\)?",{CSS_UNIT:new RegExp(Je),rgb:new RegExp("rgb"+We),rgba:new RegExp("rgba"+Qe),hsl:new RegExp("hsl"+We),hsla:new RegExp("hsla"+Qe),hsv:new RegExp("hsv"+We),hsva:new RegExp("hsva"+Qe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Ze(e){return!!Ge.CSS_UNIT.exec(e)}class Xe extends e{#r;#i={options:[],selected:null};constructor(){super(),this.#r=null,this.render()}set config(e){this.#i=e,this.#r=e.selected,this.applyDynamicConfiguration()}connectedCallback(){this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}removeEventListeners(){}setupEventListeners(){const e=this.shadowRoot.querySelector("select");e&&e.addEventListener("change",this.handleChange.bind(this))}handleChange(e){const t=e.target;this.#r=t.value,this.dispatchEvent(new CustomEvent("select-change",{detail:{selected:this.#r}}))}applyDynamicConfiguration(){const e=this.shadowRoot.querySelector("select");e.innerHTML="",this.#i.options.forEach((t=>{let{value:n,label:s}=t;const o=document.createElement("option");o.value=n,o.innerText=s,this.#r===n&&(o.selected=!0),e.appendChild(o)}))}render(){this.shadowRoot.innerHTML='\n        <style>\n            div.select-container {\n    position: relative;\n}\n\nselect {\n    background: white;\n    appearance: none;\n    box-shadow: 0px 2px 2px rgba(27, 25, 24, 0.12);\n    cursor: pointer;\n    min-height: 40px;\n    padding: 10px;\n    width: 100%;\n    border: 1px solid var(--classy-color__border--input, #ccc);\n    border-radius: var(--classy-custom-grid-radius, 4px); /* Apply grid border radius */\n    font-family: var(--classy-font__font-family--base, sans-serif);\n    font-size: var(--classy-font__paragraph-md--font-size, 16px);\n    line-height: 1.5;\n    font-weight: 400;\n    color: var(--classy-color__text, #000);\n    background-color: var(--classy-color__background, #fff);\n    box-sizing: border-box;\n    margin-top: 4px;\n    margin-bottom: 24px;\n}\n\n.select-arrow {\n    position: absolute;\n    right: 10px;\n    top: 12px;\n}\n        </style>\n\n        <div class="select-container">\n    <select part="select">\n        <slot part="select-option"></slot>\n    </select>\n    <span class="select-arrow">\n        <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="24px">\n        <path d="M11.1786 14.9909L7.76625 11.5785C7.38091 11.1932 7.29205 10.7514 7.49966 10.2532C7.70727 9.75497 8.08209 9.50586 8.62412 9.50586H15.4425C15.9846 9.50586 16.3594 9.75497 16.567 10.2532C16.7746 10.7514 16.6858 11.1932 16.3005 11.5785L12.888 14.9909C12.7613 15.1177 12.6298 15.2099 12.4938 15.2676C12.3578 15.3253 12.2043 15.3542 12.0333 15.3542C11.8624 15.3542 11.7089 15.3253 11.5729 15.2676C11.4368 15.2099 11.3054 15.1177 11.1786 14.9909Z"/>\n        </svg>\n    </span>\n</div>\n\n        ',this.applyDynamicConfiguration()}}customElements.get("cl-select")||customElements.define("cl-select",Xe);const et=JSON.parse('{"choose-amount":"Choose an amount","continue":"Continue","donate":"Donate","donate-frequency":{"daily":"Donate daily","weekly":"Donate weekly","bi-weekly":"Donate every two weeks","monthly":"Donate monthly","bi-monthly":"Donate bi-monthly","quarterly":"Donate quarterly","semi-annually":"Donate every six months","yearly":"Donate yearly"},"frequency":{"bi-monthly":"Bi-monthly","bi-weekly":"Every two weeks","daily":"Daily","every":"Every","every-six-months":"every six months","every-two-weeks":"every two weeks","monthly":"Monthly","one-time":"One-time","quarterly":"Quarterly","recurring":"Recurring","semi-annually":"Every six months","weekly":"Weekly","yearly":"Yearly"},"frequency-select-label":"Donation Frequency","recurring-end-date-input-label":"End date (optional)","sub-heading-title":"Choose an amount to donate"}'),tt=JSON.parse('{"choose-amount":"Elige una cantidad","continue":"Continuar","donate":"Donar","donate-frequency":{"daily":"Donar diariamente","weekly":"Donar semanalmente","bi-weekly":"Donar quincenalmente","monthly":"Donar mensualmente","bi-monthly":"Donar bimestralmente","quarterly":"Donar trimestralmente","semi-annually":"Donar semestralmente","yearly":"Donar anualmente"},"frequency":{"bi-monthly":"Bimestral","bi-weekly":"Quincenal","daily":"Diaria","every":"Cada","every-six-months":"Cada seis meses","every-two-weeks":"Cada dos semanas","monthly":"Mensual","one-time":"Única","quarterly":"Trimestral","recurring":"Periódica","semi-annually":"Semestral","weekly":"Semanal","yearly":"Anual"},"frequency-select-label":"Frecuencia de donación","recurring-end-date-input-label":"Fecha de finalización (opcional)","sub-heading-title":"Elige una cantidad para donar"}');var nt=function(e){return e.ONE_TIME="one-time",e.DAILY="daily",e.WEEKLY="weekly",e.BI_WEEKLY="bi-weekly",e.MONTHLY="monthly",e.BI_MONTHLY="bi-monthly",e.QUARTERLY="quarterly",e.SEMI_ANNUALLY="semi-annually",e.YEARLY="yearly",e}(nt||{});customElements.get("cl-donation-form")||customElements.define("cl-donation-form",class extends ue{#a;#l;#t;#c;#u;#h;#i;#d;#g;#p;#f;constructor(){super(),this.loadI18nResources("DonationForm",{en:et,es:tt}),this.#a=null,this.#t=null,this.#u=null,this.#h=null,this.#i={},this.#g=new Map,this.#p=new Map,this.#f=new Map,this.#d={ONE_TIME:this.t("frequency.one-time","One-time"),DAILY:this.t("frequency.daily","Daily"),WEEKLY:this.t("frequency.weekly","Weekly"),BI_WEEKLY:this.t("frequency.bi-weekly","Every two weeks"),MONTHLY:this.t("frequency.monthly","Monthly"),BI_MONTHLY:this.t("frequency.bi-monthly","Bi-monthly"),QUARTERLY:this.t("frequency.quarterly","Quarterly"),SEMI_ANNUALLY:this.t("frequency.semi-annually","Every six months"),YEARLY:this.t("frequency.yearly","Yearly")},this.#l=[],this.#c="",this.onFrequencySelectionChange=this.onFrequencySelectionChange.bind(this),this.onToggleChange=this.onToggleChange.bind(this),this.onAmountSelectionChange=this.onAmountSelectionChange.bind(this),this.onRecurringEndDateChange=this.onRecurringEndDateChange.bind(this),this.onCurrencyChange=this.onCurrencyChange.bind(this),this.onSubmit=this.onSubmit.bind(this),this.render()}connectedCallback(){this.#h=this.getAttribute("campaign-id")||null,null===this.#h&&console.warn("Please provide a non-null value for the campaign ID. PLEASE"),this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}getCustomAmount(){const e=this.shadowRoot.querySelector("cl-amount-selector"),t=e?.shadowRoot?.querySelector("cl-custom-input");if(t&&t.value){const e=parseFloat(t.value);if(!Number.isNaN(e)&&e>0)return e}return null}getDefaultFrequency=e=>0===Object.keys(e).length?null:e.donationFrequencies.find((e=>e.isDefault));getTranslatedFrequency=e=>{const t=Object.entries(nt).find((t=>{let[n,s]=t;return s===e}))?.[0];return t?this.#d[t]:e};getCurrentCurrency(){const e=this.#i.currencies?.find((e=>e.selected))?.value;return this.#c||e||""}getFrequencyCurrencyKey(){return`${(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#a)||""}|${this.getCurrentCurrency()}`}initializeWithConfig(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return;const n=we(e).setAlpha(t);return n.isValid()?n.toRgbString():void 0}(this.#i.cssBackgroundColor??"transparent",this.#i.cssBackgroundColorOpacity??1);switch(t&&this.style.setProperty("--classy-custom-background-color",t),this.#i.borderRadius){case"sharp":this.style.setProperty("--classy-custom-border-radius","0px"),this.style.setProperty("--classy-custom-frequency-radius","0px"),this.style.setProperty("--classy-custom-grid-radius","0px"),this.style.setProperty("--classy-custom-cta-radius","0");break;case"rounded":this.style.setProperty("--classy-custom-border-radius","8px"),this.style.setProperty("--classy-custom-frequency-radius","8px"),this.style.setProperty("--classy-custom-grid-radius","8px"),this.style.setProperty("--classy-custom-cta-radius","8px");break;case"pill":this.style.setProperty("--classy-custom-border-radius","20px"),this.style.setProperty("--classy-custom-frequency-radius","20px"),this.style.setProperty("--classy-custom-grid-radius","8px"),this.style.setProperty("--classy-custom-cta-radius","48px");break;default:this.style.setProperty("--classy-custom-border-radius","0px"),this.style.setProperty("--classy-custom-frequency-radius","0px"),this.style.setProperty("--classy-custom-grid-radius","0px"),this.style.setProperty("--classy-custom-cta-radius","0px")}if(this.style.setProperty("--classy-custom-primary-color",this.#i.primaryColor||"#425cc7"),this.style.setProperty("--classy-custom-primary-color",this.#i.primaryColor||"var(--theme-color__brand-primary)"),this.style.setProperty("--classy-custom-secondary-color",this.#i.secondaryColor||"var(--theme-color__brand-secondary)"),this.style.setProperty("--classy-custom-cta-button-color",this.#i.ctaButtonColor||"#000"),this.style.setProperty("--classy-custom-drop-shadow",this.#i.dropShadow?"0 8px 16px 0 rgba(27,27,27,.1)":"none"),this.#i.primaryColor){const e=we(this.#i.primaryColor).isDark()?"#fff":"#000";this.style.setProperty("--computed-color__brand-primary--contrast",e)}else this.style.setProperty("--computed-color__brand-primary--contrast","var(--theme-color__brand-custom-text-color)");if(e){const e=this.getDefaultFrequency(this.#i);this.selectedFrequency=e?e.name:nt.ONE_TIME}const n=(this.#a===nt.ONE_TIME?this.#i.donationAmounts:this.#i.recurringAmounts).find((e=>e.isDefault));this.#t=n?n.amount:0;const{visibleFrequencies:s}=this,o=this.shadowRoot.querySelector("cl-toggle-group");0===this.visibleFrequencies.filter((e=>e.name===nt.ONE_TIME&&e.isVisible)).length||0===this.visibleRecurringFrequencies.length?o.style.display="none":o.style.display="block",1===s.length&&(this.selectedFrequency=s[0].name);const i=this.shadowRoot.querySelector("#recurring-end-date-container"),r=this.shadowRoot.querySelector("#recurring-end-date-input-label");r&&(r.textContent=this.t("recurring-end-date-input-label","End date (optional)")),this.shadowRoot.querySelector("cl-custom-input#recurring-end-date").shadowRoot.querySelector("input").setAttribute("min",(new Date).toISOString().split("T")[0]),this.#i.hideRecurringEndDate||this.#a===nt.ONE_TIME?i.style.display="none":i.style.display="block",this.updateDynamicContent()}updateDynamicContent(){this.updateHeading(),this.updateSubHeading(),this.updateSubmitButton(),this.updateAmountSelector(),this.updateRecurringFrequencySelect(),this.updateFaqHyperlink(),this.updateToggleTags()}updateRecurringFrequencySelect(){const e=this.shadowRoot.querySelector("cl-select#recurring-frequency-select"),t=this.visibleRecurringFrequencies.map((e=>{let{name:t}=e;return{value:t,label:(n=this.getTranslatedFrequency(t),n.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())))};var n}));e instanceof Xe&&(e.config={options:t,selected:this.#a});const n=this.shadowRoot.querySelector("#recurring-frequency-container"),s=this.shadowRoot.querySelector("#recurring-frequency-select-label");s&&(s.textContent=this.t("frequency-select-label","Donation Frequency")),this.#a===nt.ONE_TIME||this.visibleRecurringFrequencies.length<2?n.style.display="none":n.style.display="block"}updateToggleTags(){const e=this.shadowRoot?.querySelector("cl-toggle-group");e&&(e.config={showRecurringTag:this.#i.showRecurringUpsell})}updateAmountSelector(){const e=this.shadowRoot.querySelector("cl-amount-selector"),t=this.#a===nt.ONE_TIME?this.#i.donationAmounts:this.#i.recurringAmounts,n=this.#i.currencies?.map((e=>({...e,selected:this.#c?e.value===this.#c:e.selected})))??[],{minimumDonationAmount:s}=this.#i;this.getCurrentCurrency(),this.getFrequencyCurrencyKey();const o=this.#a||"",i=this.#g.get(o)??null,r=this.#p.get(o)??null,a=this.#f.get(o)??null;let l=null;if(null!==r)l=r;else if(null!==a){const e=t.find((e=>e.name===a&&e.isVisible));e?l=e.amount:null!==i&&(l=i)}else l=null!==i?i:t.find((e=>e.isDefault))?.amount??null;null!==r&&null!==l?(e.setCustomInputValue(r.toString()),e.isCustomAmountActive=!0,e.setSelectedAmountSilently(l)):(e.isCustomAmountActive=!1,null!==l?e.setSelectedAmountSilently(l):e.resetSelectedAmountSilently()),e.config={presetAmounts:t,currencies:n,minimumDonationAmount:s},null!==l&&(e.setCustomInputValue(l.toString()),this.selectedAmount=l)}setupEventListeners(){this.shadowRoot?.querySelector("cl-toggle-group")?.addEventListener("selection-change",this.onToggleChange),this.shadowRoot?.querySelector("cl-select#recurring-frequency-select")?.addEventListener("select-change",this.onFrequencySelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("amount-selection-change",this.onAmountSelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("currency-selection-change",this.onCurrencyChange),this.shadowRoot?.querySelector("cl-custom-input#recurring-end-date")?.addEventListener("value-change",this.onRecurringEndDateChange),this.shadowRoot?.querySelector(".submit-button")?.addEventListener("mousedown",this.onSubmit)}removeEventListeners(){this.shadowRoot?.querySelector("cl-toggle-group")?.removeEventListener("selection-change",this.onToggleChange),this.shadowRoot?.querySelector("cl-select#recurring-frequency-select")?.removeEventListener("select-change",this.onFrequencySelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.removeEventListener("amount-selection-change",this.onAmountSelectionChange),this.shadowRoot?.querySelector(".submit-button")?.removeEventListener("mousedown",this.onSubmit)}attributeChangedCallback(e,t,n){"campaign-id"===e&&(this.#h=n)}onFrequencySelectionChange(e){this.selectedFrequency=e.detail.selected}onToggleChange(e){const{selected:t}=e.detail,n=this.shadowRoot.querySelector("#recurring-end-date-container");if(t===nt.ONE_TIME)this.selectedFrequency=t,n.style.display="none";else{const e=this.visibleRecurringFrequencies.find((e=>e.isDefault))??this.visibleRecurringFrequencies[0];this.selectedFrequency=e.name,n.style.display=this.#i.hideRecurringEndDate?"none":"block"}this.updateRecurringFrequencySelect()}onAmountSelectionChange(e){const t=this.shadowRoot.querySelector("cl-amount-selector"),n=t?.isCustomAmountActive??!1,s=e.detail.selectedAmount;if(null!==this.#a){const e=this.#a||"",t=this.#a===nt.ONE_TIME?this.#i.donationAmounts:this.#i.recurringAmounts;if(n)this.#g.set(e,s),this.#p.set(e,s),this.#f.set(e,"other");else{this.#g.set(e,s),this.#p.set(e,null);const n=t.find((e=>e.amount===s&&"other"!==e.name));this.#f.set(e,n?.name??null)}}this.selectedAmount=s}onRecurringEndDateChange(e){this.recurringEndDate=e.detail.value}onCurrencyChange(e){this.selectedCurrency=e.detail.selectedCurrency}onSubmit(e){e.preventDefault();const t=this.shadowRoot.querySelector("cl-amount-selector"),n=t?.shadowRoot?.querySelector(".error-message");n?.textContent?.trim()&&n.offsetParent||this.dispatchEvent(new CustomEvent("classy-donation-submit",{detail:{frequency:this.#a,amount:this.getCustomAmount()??this.#t,recurringEndDate:this.#u,campaignId:this.#h,selectedCurrency:this.#c},bubbles:!0,composed:!0}))}static get observedAttributes(){return["campaign-id"]}set config(e){const t=this.getDefaultFrequency(this.#i),n=e=>(e||[]).map((e=>({...e,amount:"other"===e.name?e.amount:Math.round(e.amount)}))),s=n(e.donationAmounts),o=n(e.recurringAmounts);this.#i={...e,donationAmounts:s,recurringAmounts:o};const i=t!==this.getDefaultFrequency(this.#i);this.initializeWithConfig(i)}set externalCustomAmounts(e){if(!e)return;const t=this.#a;let n=!1;Object.entries(e).forEach((e=>{let[s,o]=e;const i=s,r=i||"";null==o?this.#p.set(r,null):(this.#g.set(r,o),this.#p.set(r,o),this.#f.set(r,"other")),t===i&&(n=!0)})),n&&this.updateAmountSelector()}set externalCustomAmount(e){e&&(this.externalCustomAmounts={[e.frequency]:e.amount})}get campaignId(){return this.#h}set campaignId(e){this.#h=e}get visibleFrequencies(){return this.#i.donationFrequencies.filter((e=>e.isVisible))}get visibleRecurringFrequencies(){return this.visibleFrequencies.filter((e=>e.name!==nt.ONE_TIME))}set selectedFrequency(e){if(this.#a!==e&&Object.keys(nt).map((e=>nt[e])).includes(e)){this.dispatchEvent(new CustomEvent("frequency_change",{detail:{from_frequency:this.#a,to_frequency:e},bubbles:!0,composed:!0})),this.#a=e;const t=this.shadowRoot.querySelector("cl-toggle-group"),n=this.#a===nt.ONE_TIME?"one-time":"recurring";t.setAttribute("selected",n),this.updateDynamicContent()}}set selectedAmount(e){if(this.#t!==e){this.dispatchEvent(new CustomEvent("amount_selected",{detail:{from_amount:this.#t,to_amount:e},bubbles:!0,composed:!0})),this.#t=e;const t=this.shadowRoot.querySelector("cl-amount-selector"),n=this.#a||"",s=this.#p.get(n)??null;null!==s&&s===e||t.setAttribute("selected-amount",this.#t.toString()),this.updateSubmitButton()}}set recurringEndDate(e){this.#u!==e&&(this.dispatchEvent(new CustomEvent("recurring_end_date_selected",{detail:{from_amount:this.#t,to_amount:e},bubbles:!0,composed:!0})),this.#u=e)}set selectedCurrency(e){this.#c!==e&&(this.dispatchEvent(new CustomEvent("currency_selected",{detail:{from_currency:this.#c,to_currency:e},bubbles:!0,composed:!0})),this.#c=e)}updateSubHeading(){const e=this.shadowRoot.querySelector(".sub-heading"),t=e?.querySelector("#sub-heading-title");t&&(t.textContent=this.t("sub-heading-title","Choose an amount to donate"));const n=e?.querySelector("#selected-frequency");if(n)switch(this.#a){case nt.ONE_TIME:n.textContent="";break;case nt.BI_WEEKLY:n.textContent=this.t("frequency.every-two-weeks","every two weeks");break;case nt.SEMI_ANNUALLY:n.textContent=this.t("frequency.every-six-months","every six months");break;default:n.textContent=this.getTranslatedFrequency(this.#a).toLowerCase()||""}const s=this.shadowRoot.querySelector("cl-toggle-group")?.shadowRoot?.querySelector('cl-custom-button[value="recurring"]'),{visibleRecurringFrequencies:o}=this;if(s&&1===o.length){const e=o[0].name;let t=this.getTranslatedFrequency(e);e!==nt.BI_WEEKLY&&e!==nt.SEMI_ANNUALLY||(t=this.t("frequency.every","Every")),s.innerHTML=`<span style="text-transform:capitalize">${t}</span>`}else s&&o.length>1&&(s.innerHTML=`<span>${this.t("frequency.recurring","Recurring")}</span>`);const i=this.shadowRoot.querySelector("cl-toggle-group")?.shadowRoot?.querySelector('cl-custom-button[value="one-time"]');i&&(i.innerHTML=`<span>${this.getTranslatedFrequency(nt.ONE_TIME)}</span>`)}updateHeading(){const e=this.shadowRoot.querySelector(".heading-logo");if(e&&this.#i.headingLogoUrl){e.style.display="block";const t=e.querySelector("img");t&&(t.src=this.#i.headingLogoUrl)}else e&&(e.style.display="none")}updateSubmitButton(){const e=this.shadowRoot.querySelector(".submit-button");if(!e)return;e.textContent="",e.disabled=null===this.#t;const t=document.createElement("span");if(null===this.#t)t.textContent=this.t("choose-amount","Choose an amount");else if(this.#a&&this.#a!==nt.ONE_TIME){const e=this.#a,n=this.getTranslatedFrequency(e).toLowerCase(),s=`${this.t("donate","Donate")} ${n}`;t.textContent=this.t(`donate-frequency.${e}`,s)}else t.textContent=this.t("donate","Donate");e.appendChild(t)}updateFaqHyperlink(){const e=this.shadowRoot?.querySelector(".faq-hyperlink-container");if(!e)return;if(this.#i.hideFaqSection)return void(e.style.display="none");e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center";const t=e.querySelector("cl-hyperlink");if(t&&e.removeChild(t),this.#i.hyperlink?.isEnabled&&this.#i.hyperlink.url&&this.#i.hyperlink.text){const t=document.createElement("cl-hyperlink");t.setAttribute("href",this.#i.hyperlink.url),t.setAttribute("text",this.#i.hyperlink.text),e.appendChild(t)}}render(){this.shadowRoot.innerHTML='\n      <style>\n        .donation-form-container {\n  /* Reset all CSS coming from the parent DOM */\n  all: initial;\n\n  box-sizing: border-box;\n  padding: 24px;\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  min-width: 235px;\n  width: 100%;\n  background: var(--classy-custom-background-color, #fff);\n  border-radius: var(--classy-custom-border-radius, 0);\n  /* Apply form border radius */\n  box-shadow: var(--classy-custom-drop-shadow, none);\n  /* Drop shadow only here */\n  font-family: var(--classy-font__font-family--base);\n}\n\n.heading,\n.sub-heading,\n.submit-button {\n  font-family: var(--classy-font__font-family--base);\n}\n\n.heading {\n  line-height: var(--classy-font__heading-xs--line-height);\n  font-weight: var(--classy-font__heading-xs--font-weight);\n  font-size: var(--classy-font__heading-xs--font-size);\n  text-align: center;\n}\n\n.heading-logo {\n  text-align: center;\n  padding: 20px 24px 20px 24px;\n}\n\n.sub-heading,\nlabel {\n  font-size: var(--classy-font__paragraph-md--font-size);\n  line-height: var(--classy-font__paragraph-md--line-height);\n  font-weight: var(--classy-font__paragraph-md--font-weight);\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n  text-align: center;\n  margin: 24px 0;\n}\n\n.sub-heading #selected-frequency {\n  font-size: var(--classy-font__paragraph-md-bold-font-size);\n  line-height: var(--classy-font__paragraph-md-bold-line-height);\n  font-weight: var(--classy-font__paragraph-md-bold--font-weight);\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n}\n\n.amount-selector-container {\n  display: grid;\n  gap: 4px;\n  margin-bottom: 64px;\n  flex-grow: 1;\n  /* Make this container take up remaining space */\n}\n\n.submit-button-container {\n  display: flex;\n  align-items: flex-end;\n  /* Ensure the button container stays at the bottom */\n  flex-shrink: 0;\n  /* Prevent the button container from shrinking */\n}\n\n.submit-button::part(button),\n.submit-button {\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight);\n  background-color: var(--classy-custom-cta-button-color);\n  border-radius: var(--classy-custom-cta-radius);\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n  cursor: pointer;\n  border: none;\n  transition: all 0.24s cubic-bezier(0.645, 0.045, 0.355, 1);\n  width: 100%;\n  min-height: 64px;\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n}\n\n.submit-button > span:first-of-type {\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight);\n}\n\n.submit-button span {\n  color: #ffffff;\n  display: block;\n}\n\n.submit-button-container > cl-custom-button::part(button) {\n  display: block;\n}\n\n.recurring-freq-end-date-container {\n  display: flex;\n  gap: 4px;\n}\n\n.recurring-freq-end-date-container div {\n  flex: 1 0 49%;\n}\n\ncl-amount-selector {\n  height: fit-content;\n}\n\n.faq-hyperlink-container {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  margin-top: 24px;\n}\n\n      </style>\n\n      <form class="donation-form-container">\n  <div class="heading"></div>\n  <div class="heading-logo">\n    <img src="" height="44" />\n  </div>\n\n  <cl-toggle-group id="frequency-toggle"></cl-toggle-group>\n\n  <div class="sub-heading">\n    <span id="sub-heading-title"></span>\n    <span id="selected-frequency"></span>\n  </div>\n\n  <div class="recurring-freq-end-date-container">\n    <div id="recurring-frequency-container">\n      <label id="recurring-frequency-select-label"></label>\n      <cl-select id="recurring-frequency-select"></cl-select>\n    </div>\n\n    <div id="recurring-end-date-container">\n      <label id="recurring-end-date-input-label"></label>\n      <cl-custom-input id="recurring-end-date" data-id="recurring-end-date" type="date" />\n    </div>\n  </div>\n\n  <div class="amount-selector-container">\n    <cl-amount-selector id="amount-selector"></cl-amount-selector>\n  </div>\n\n  <div class="submit-button-container">\n    <cl-custom-button class="submit-button">\n      <span id="donate-amount-text"></span>\n    </cl-custom-button>\n  </div>\n\n  \x3c!-- container for FAQ + hyperlink --\x3e\n  <div class="faq-hyperlink-container">\n    <cl-faq-drawer-opener></cl-faq-drawer-opener>\n  </div>\n</form>\n\n    '}})})();

/***/ }),

/***/ 49:
/***/ (() => {

(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t=/^\s+/,n=/\s+$/;function s(i,o){if(o=o||{},(i=i||"")instanceof s)return i;if(!(this instanceof s))return new s(i,o);var a=function(s){var i,o,a,r={r:0,g:0,b:0},l=1,h=null,c=null,u=null,d=!1,g=!1;return"string"==typeof s&&(s=function(e){e=e.replace(t,"").replace(n,"").toLowerCase();var s,i=!1;if(x[e])e=x[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(s=P.rgb.exec(e))?{r:s[1],g:s[2],b:s[3]}:(s=P.rgba.exec(e))?{r:s[1],g:s[2],b:s[3],a:s[4]}:(s=P.hsl.exec(e))?{h:s[1],s:s[2],l:s[3]}:(s=P.hsla.exec(e))?{h:s[1],s:s[2],l:s[3],a:s[4]}:(s=P.hsv.exec(e))?{h:s[1],s:s[2],v:s[3]}:(s=P.hsva.exec(e))?{h:s[1],s:s[2],v:s[3],a:s[4]}:(s=P.hex8.exec(e))?{r:C(s[1]),g:C(s[2]),b:C(s[3]),a:A(s[4]),format:i?"name":"hex8"}:(s=P.hex6.exec(e))?{r:C(s[1]),g:C(s[2]),b:C(s[3]),format:i?"name":"hex"}:(s=P.hex4.exec(e))?{r:C(s[1]+""+s[1]),g:C(s[2]+""+s[2]),b:C(s[3]+""+s[3]),a:A(s[4]+""+s[4]),format:i?"name":"hex8"}:!!(s=P.hex3.exec(e))&&{r:C(s[1]+""+s[1]),g:C(s[2]+""+s[2]),b:C(s[3]+""+s[3]),format:i?"name":"hex"}}(s)),"object"==e(s)&&(E(s.r)&&E(s.g)&&E(s.b)?(i=s.r,o=s.g,a=s.b,r={r:255*S(i,255),g:255*S(o,255),b:255*S(a,255)},d=!0,g="%"===String(s.r).substr(-1)?"prgb":"rgb"):E(s.h)&&E(s.s)&&E(s.v)?(h=R(s.s),c=R(s.v),r=function(e,t,n){e=6*S(e,360),t=S(t,100),n=S(n,100);var s=Math.floor(e),i=e-s,o=n*(1-t),a=n*(1-i*t),r=n*(1-(1-i)*t),l=s%6;return{r:255*[n,a,o,o,r,n][l],g:255*[r,n,n,a,o,o][l],b:255*[o,o,r,n,n,a][l]}}(s.h,h,c),d=!0,g="hsv"):E(s.h)&&E(s.s)&&E(s.l)&&(h=R(s.s),u=R(s.l),r=function(e,t,n){var s,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=S(e,360),t=S(t,100),n=S(n,100),0===t)s=i=o=n;else{var r=n<.5?n*(1+t):n+t-n*t,l=2*n-r;s=a(l,r,e+1/3),i=a(l,r,e),o=a(l,r,e-1/3)}return{r:255*s,g:255*i,b:255*o}}(s.h,h,u),d=!0,g="hsl"),s.hasOwnProperty("a")&&(l=s.a)),l=w(l),{ok:d,format:s.format||g,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:l}}(i);this._originalInput=i,this._r=a.r,this._g=a.g,this._b=a.b,this._a=a.a,this._roundA=Math.round(100*this._a)/100,this._format=o.format||a.format,this._gradientType=o.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=a.ok}function i(e,t,n){e=S(e,255),t=S(t,255),n=S(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=(o+a)/2;if(o==a)s=i=0;else{var l=o-a;switch(i=r>.5?l/(2-o-a):l/(o+a),o){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:i,l:r}}function o(e,t,n){e=S(e,255),t=S(t,255),n=S(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=o,l=o-a;if(i=0===o?0:l/o,o==a)s=0;else{switch(o){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:i,v:r}}function a(e,t,n,s){var i=[O(Math.round(e).toString(16)),O(Math.round(t).toString(16)),O(Math.round(n).toString(16))];return s&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function r(e,t,n,s){return[O(_(s)),O(Math.round(e).toString(16)),O(Math.round(t).toString(16)),O(Math.round(n).toString(16))].join("")}function l(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.s-=t/100,n.s=L(n.s),s(n)}function h(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.s+=t/100,n.s=L(n.s),s(n)}function c(e){return s(e).desaturate(100)}function u(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.l+=t/100,n.l=L(n.l),s(n)}function d(e,t){t=0===t?0:t||10;var n=s(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),s(n)}function g(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.l-=t/100,n.l=L(n.l),s(n)}function p(e,t){var n=s(e).toHsl(),i=(n.h+t)%360;return n.h=i<0?360+i:i,s(n)}function f(e){var t=s(e).toHsl();return t.h=(t.h+180)%360,s(t)}function m(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=s(e).toHsl(),i=[s(e)],o=360/t,a=1;a<t;a++)i.push(s({h:(n.h+a*o)%360,s:n.s,l:n.l}));return i}function b(e){var t=s(e).toHsl(),n=t.h;return[s(e),s({h:(n+72)%360,s:t.s,l:t.l}),s({h:(n+216)%360,s:t.s,l:t.l})]}function y(e,t,n){t=t||6,n=n||30;var i=s(e).toHsl(),o=360/n,a=[s(e)];for(i.h=(i.h-(o*t>>1)+720)%360;--t;)i.h=(i.h+o)%360,a.push(s(i));return a}function v(e,t){t=t||6;for(var n=s(e).toHsv(),i=n.h,o=n.s,a=n.v,r=[],l=1/t;t--;)r.push(s({h:i,s:o,v:a})),a=(a+l)%1;return r}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=w(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=o(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=o(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=i(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=i(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return a(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,i){var o=[O(Math.round(e).toString(16)),O(Math.round(t).toString(16)),O(Math.round(n).toString(16)),O(_(s))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*S(this._r,255))+"%",g:Math.round(100*S(this._g,255))+"%",b:Math.round(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%)":"rgba("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(k[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+r(this._r,this._g,this._b,this._a),n=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=s(e);n="#"+r(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return s(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(u,arguments)},brighten:function(){return this._applyModification(d,arguments)},darken:function(){return this._applyModification(g,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(f,arguments)},monochromatic:function(){return this._applyCombination(v,arguments)},splitcomplement:function(){return this._applyCombination(b,arguments)},triad:function(){return this._applyCombination(m,[3])},tetrad:function(){return this._applyCombination(m,[4])}},s.fromRatio=function(t,n){if("object"==e(t)){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]="a"===o?t[o]:R(t[o]));t=i}return s(t,n)},s.equals=function(e,t){return!(!e||!t)&&s(e).toRgbString()==s(t).toRgbString()},s.random=function(){return s.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},s.mix=function(e,t,n){n=0===n?0:n||50;var i=s(e).toRgb(),o=s(t).toRgb(),a=n/100;return s({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},s.readability=function(e,t){var n=s(e),i=s(t);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},s.isReadable=function(e,t,n){var i,o,a,r,l,h=s.readability(e,t);switch(o=!1,(a=n,"AA"!==(r=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==r&&(r="AA"),"small"!==(l=(a.size||"small").toLowerCase())&&"large"!==l&&(l="small"),i={level:r,size:l}).level+i.size){case"AAsmall":case"AAAlarge":o=h>=4.5;break;case"AAlarge":o=h>=3;break;case"AAAsmall":o=h>=7}return o},s.mostReadable=function(e,t,n){var i,o,a,r,l=null,h=0;o=(n=n||{}).includeFallbackColors,a=n.level,r=n.size;for(var c=0;c<t.length;c++)(i=s.readability(e,t[c]))>h&&(h=i,l=s(t[c]));return s.isReadable(e,l,{level:a,size:r})||!o?l:(n.includeFallbackColors=!1,s.mostReadable(e,["#fff","#000"],n))};var x=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=s.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(x);function w(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function S(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function L(e){return Math.min(1,Math.max(0,e))}function C(e){return parseInt(e,16)}function O(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function _(e){return Math.round(255*parseFloat(e)).toString(16)}function A(e){return C(e)/255}var M,$,N,P=($="[\\s|\\(]+("+(M="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",N="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+$),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+$),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+$),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function E(e){return!!P.CSS_UNIT.exec(e)}const j=JSON.parse('{"nudge-tray-content":"Finish your donation to create an impact today.","nudge-tray-cta":"Give Now","nudge-tray-title":"Make a difference!"}'),F=JSON.parse('{"nudge-tray-content":"Finaliza tu donación para crear un impacto hoy.","nudge-tray-cta":"Dona ahora","nudge-tray-title":"¡Haz la diferencia!"}');class I extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"})}updateStyles(e){return Object.keys(e).map((t=>{const{cssVar:n,defaultValue:s}=e[t];return`${n}: ${this.getAttribute(t)||s};`})).join(" ")}}const{slice:D,forEach:T}=[],V=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,H={create(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),s&&(i.domain=s),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!V.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!V.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}(e,encodeURIComponent(t),i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return null},remove(e){this.create(e,"",-1)}};var U={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return H.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:s,cookieDomain:i,cookieOptions:o}=t;n&&"undefined"!=typeof document&&H.create(n,e,s,i,o)}},z={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const s=e.substring(1).split("&");for(let e=0;e<s.length;e++){const i=s[e].indexOf("=");i>0&&s[e].substring(0,i)===n&&(t=s[e].substring(i+1))}}return t}};let K=null;const q=()=>{if(null!==K)return K;try{if(K="undefined"!=typeof window&&null!==window.localStorage,!K)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){K=!1}return K};var B={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&q())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&q()&&window.localStorage.setItem(n,e)}};let J=null;const G=()=>{if(null!==J)return J;try{if(J="undefined"!=typeof window&&null!==window.sessionStorage,!J)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){J=!1}return J};var Q={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&G())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&G()&&window.sessionStorage.setItem(n,e)}},W={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:s}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),s&&t.push(s)}return t.length>0?t:void 0}},Y={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const s=n||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(t=s.getAttribute("lang")),t}},X={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const s="number"==typeof t?t:0;return n[s]?.replace("/","")}},Z={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[n]}};let ee=!1;try{document.cookie,ee=!0}catch(e){}const te=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ee||te.splice(1,1);class ne{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return T.call(D.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:te,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(U),this.addDetector(z),this.addDetector(B),this.addDetector(Q),this.addDetector(W),this.addDetector(Y),this.addDetector(X),this.addDetector(Z)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach((e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}})),t=t.map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}ne.type="languageDetector";const se=e=>"string"==typeof e,ie=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},oe=e=>null==e?"":""+e,ae=/###/g,re=e=>e&&e.indexOf("###")>-1?e.replace(ae,"."):e,le=e=>!e||se(e),he=(e,t,n)=>{const s=se(t)?t.split("."):t;let i=0;for(;i<s.length-1;){if(le(e))return{};const t=re(s[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return le(e)?{}:{obj:e,k:re(s[i])}},ce=(e,t,n)=>{const{obj:s,k:i}=he(e,t,Object);if(void 0!==s||1===t.length)return void(s[i]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),r=he(e,a,Object);for(;void 0===r.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),r=he(e,a,Object),r?.obj&&void 0!==r.obj[`${r.k}.${o}`]&&(r.obj=void 0);r.obj[`${r.k}.${o}`]=n},ue=(e,t)=>{const{obj:n,k:s}=he(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},de=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?se(e[s])||e[s]instanceof String||se(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):de(e[s],t[s],n):e[s]=t[s]);return e},ge=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var pe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const fe=e=>se(e)?e.replace(/[&<>"'\/]/g,(e=>pe[e])):e,me=[" ",",","?","!",";"],be=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),ye=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(n);let i=e;for(let e=0;e<s.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let a=e;a<s.length;++a)if(a!==e&&(o+=n),o+=s[a],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<s.length-1)continue;e+=a-e+1;break}i=t}return i},ve=e=>e?.replace("_","-"),xe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class ke{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||xe,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(se(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ke(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new ke(this.logger,e)}}var we=new ke;class Se{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach((e=>{let[t,s]=e;for(let e=0;e<s;e++)t(...n)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((t=>{let[s,i]=t;for(let t=0;t<i;t++)s.apply(s,[e,...n])}))}}class Le extends Se{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):se(n)&&i?a.push(...n.split(i)):a.push(n)));const r=ue(this.data,a);return!r&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!r&&o&&se(n)?ye(this.data?.[e]?.[t],n,i):r}addResource(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),ce(this.data,a,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in n)(se(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=n,n=t,t=a[1]),this.addNamespaces(t);let r=ue(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?de(r,n,i):r={...r,...n},ce(this.data,a,r),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var Ce={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,i){return e.forEach((e=>{t=this.processors[e]?.process(t,n,s,i)??t})),t}};const Oe={},Re=e=>!se(e)&&"boolean"!=typeof e&&"number"!=typeof e;class _e extends Se{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,s;super(),n=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((e=>{n[e]&&(s[e]=n[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=we.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return void 0!==n?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=me.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===s.length)return!0;const i=be.getRegExp(`(${s.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,s));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:se(i)?[i]:i};const o=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(s)}return{key:e,namespaces:se(i)?[i]:i}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),r=a[a.length-1],l=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===l?.toLowerCase()){if(h){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${r}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:`${r}${e}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:o}const c=this.resolve(e,t);let u=c?.res;const d=c?.usedKey||o,g=c?.exactUsedKey||o,p=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject,m=void 0!==t.count&&!se(t.count),b=_e.hasDefaultValue(t),y=m?this.pluralResolver.getSuffix(l,t.count,t):"",v=t.ordinal&&m?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",x=m&&!t.ordinal&&0===t.count,k=x&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${y}`]||t[`defaultValue${v}`]||t.defaultValue;let w=u;f&&!u&&b&&(w=k);const S=Re(w),L=Object.prototype.toString.apply(w);if(!(f&&w&&S&&["[object Number]","[object Function]","[object RegExp]"].indexOf(L)<0)||se(p)&&Array.isArray(w))if(f&&se(p)&&Array.isArray(u))u=u.join(p),u&&(u=this.extendTranslation(u,e,t,n));else{let s=!1,a=!1;!this.isValidLookup(u)&&b&&(s=!0,u=k),this.isValidLookup(u)||(a=!0,u=o);const h=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:u,d=b&&k!==u&&this.options.updateMissing;if(a||s||d){if(this.logger.log(d?"updateKey":"missingKey",l,r,o,d?k:u),i){const e=this.resolve(o,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const s=(e,n,s)=>{const i=b&&s!==u?s:h;this.options.missingKeyHandler?this.options.missingKeyHandler(e,r,n,i,d,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,r,n,i,d,t),this.emit("missingKey",e,r,n,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&m?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);x&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{s([e],o+n,t[`defaultValue${n}`]||k)}))})):s(e,o,k))}u=this.extendTranslation(u,e,t,c,n),a&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${r}:${o}`),(a||s)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${r}:${o}`:o,s?u:void 0))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,w,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(i){const e=Array.isArray(w),n=e?[]:{},s=e?g:d;for(const e in w)if(Object.prototype.hasOwnProperty.call(w,e)){const o=`${s}${i}${e}`;n[e]=b&&!u?this.translate(o,{...t,defaultValue:Re(k)?k[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...t,joinArrays:!1,ns:a}),n[e]===o&&(n[e]=w[e])}u=n}}return s?(c.res=u,c.usedParams=this.getUsedParamsDetails(t),c):u}extendTranslation(e,t,n,s,i){var o=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=se(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(a){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let l=n.replace&&!se(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||s.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,s=new Array(e),a=0;a<e;a++)s[a]=arguments[a];return i?.[0]!==s[0]||n.context?o.translate(...s,t):(o.logger.warn(`It seems you are nesting recursively key: ${s[0]} in key: ${t[0]}`),null)}),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,r=se(a)?[a]:a;return null!=e&&r?.length&&!1!==n.applyPostProcessor&&(e=Ce.handle(r,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,s,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return se(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const r=this.extractFromKey(e,a),l=r.key;n=l;let h=r.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const c=void 0!==a.count&&!se(a.count),u=c&&!a.ordinal&&0===a.count,d=void 0!==a.context&&(se(a.context)||"number"==typeof a.context)&&""!==a.context,g=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);h.forEach((e=>{this.isValidLookup(t)||(o=e,Oe[`${g[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(Oe[`${g[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach((n=>{if(this.isValidLookup(t))return;i=n;const o=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,n,e,a);else{let e;c&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(o.push(l+e),a.ordinal&&0===e.indexOf(s)&&o.push(l+e.replace(s,this.options.pluralSeparator)),u&&o.push(l+t)),d){const n=`${l}${this.options.contextSeparator}${a.context}`;o.push(n),c&&(o.push(n+e),a.ordinal&&0===e.indexOf(s)&&o.push(n+e.replace(s,this.options.pluralSeparator)),u&&o.push(n+t))}}let r;for(;r=o.pop();)this.isValidLookup(t)||(s=r,t=this.getResource(n,e,r,a))})))}))})),{res:t,usedKey:n,exactUsedKey:s,usedLng:i,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!se(e.replace);let s=n?e.replace:e;if(n&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class Ae{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=we.create("languageUtils")}getScriptPartFromCode(e){if(!(e=ve(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ve(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(se(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),se(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],i=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return se(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):se(e)&&i(this.formatLanguageCode(e)),n.forEach((e=>{s.indexOf(e)<0&&i(this.formatLanguageCode(e))})),s}}const Me={zero:0,one:1,two:2,few:3,many:4,other:5},$e={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Ne{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=we.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=ve("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:s})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),$e;if(!e.match(/-|_/))return $e;const s=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(s,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>Me[e]-Me[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Pe=function(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=((e,t,n)=>{const s=ue(e,n);return void 0!==s?s:ue(t,n)})(e,t,n);return!o&&i&&se(n)&&(o=ye(e,n,s),void 0===o&&(o=ye(t,n,s))),o},Ee=e=>e.replace(/\$/g,"$$$$");class je{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=we.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:r,formatSeparator:l,unescapeSuffix:h,unescapePrefix:c,nestingPrefix:u,nestingPrefixEscaped:d,nestingSuffix:g,nestingSuffixEscaped:p,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:fe,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?ge(i):o||"{{",this.suffix=a?ge(a):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=h?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=u?ge(u):d||ge("$t("),this.nestingSuffix=g?ge(g):p||ge(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let i,o,a;const r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=Pe(t,r,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...s,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(Pe(t,r,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...s,...t,interpolationkey:o})};this.resetRegExp();const h=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Ee(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Ee(this.escape(e)):Ee(e)}].forEach((t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(o=l(n),void 0===o)if("function"==typeof h){const t=h(e,i,s);o=se(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))o="";else{if(c){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else se(o)||this.useRawValueToEscape||(o=oe(o));const r=t.safeValue(o);if(e=e.replace(i[0],r),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),e}nest(e,t){let n,s,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const s=e.split(new RegExp(`${n}[ ]*{`));let o=`{${s[1]}`;e=s[0],o=this.interpolate(o,i);const a=o.match(/'/g),r=o.match(/"/g);((a?.length??0)%2==0&&!r||r.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let r=[];i={...o},i=i.replace&&!se(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),r=e,l=!0}if(s=t(a.call(this,n[1].trim(),i),i),s&&n[0]===e&&!se(s))return s;se(s)||(s=oe(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),s=""),l&&(s=r.reduce(((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()})),s.trim())),e=e.replace(n[0],s),this.regexp.lastIndex=0}return e}}const Fe=e=>{const t={};return(n,s,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=s+JSON.stringify(o);let r=t[a];return r||(r=e(ve(s),i),t[a]=r),r(n)}};class Ie{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=we.create("formatter"),this.options=e,this.formats={number:Fe(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:Fe(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:Fe(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:Fe(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:Fe(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Fe(t)}format(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...s]=e.split(":"),i=s.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=s?.formatParams?.[s.interpolationkey]||{},r=a.locale||a.lng||s.locale||s.lng||n;t=this.formats[i](e,r,{...o,...s,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class De extends Se{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=we.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const i={},o={},a={},r={};return e.forEach((e=>{let s=!0;t.forEach((t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,s=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===r[t]&&(r[t]=!0)))})),s||(a[e]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(r)}}loaded(e,t,n){const s=e.split("|"),i=s[0],o=s[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:s,k:i}=he(e,t,Object);s[i]=s[i]||[],s[i].push(n)})(n.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:i,callback:o});this.readingCalls++;const a=(a,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&r&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,s+1,2*i,o)}),i):o(a,r)},r=this.backend[n].bind(this.backend);if(2!==r.length)return r(e,t,a);try{const n=r(e,t);n&&"function"==typeof n.then?n.then((e=>a(null,e))).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();se(e)&&(e=this.languageUtils.toResolveHierarchy(e)),se(t)&&(t=[t]);const i=this.queueLoad(e,t,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,((n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,o),this.loaded(e,n,o)}))}saveMissing(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const r={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,s,r):l(e,t,n,s),i&&"function"==typeof i.then?i.then((e=>a(null,e))).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,n,s,a,r)}e&&e[0]&&this.store.addResource(e[0],t,n,s)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Te=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),se(e[1])&&(t.defaultValue=e[1]),se(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Ve=e=>(se(e.ns)&&(e.ns=[e.ns]),se(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),se(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),He=()=>{};class Ue extends Se{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Ve(e),this.services={},this.logger=we,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),null==t.defaultNS&&t.ns&&(se(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=Te();this.options={...s,...this.options,...Ve(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?we.init(i(this.modules.logger),this.options):we.init(null,this.options),t=this.modules.formatter?this.modules.formatter:Ie;const n=new Ae(this.options);this.store=new Le(this.options.resources,this.options);const o=this.services;o.logger=we,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new Ne(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=i(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new je(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new De(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];e.emit(t,...s)})),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new _e(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];e.emit(t,...s)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=He),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const o=ie(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He;const n=se(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],s=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>s(e))),this.options.preload?.forEach?.((e=>s(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const s=ie();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=He),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),n(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ce.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=ie();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(e,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,s.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=se(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(e=>{o(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),s}getFixedT(e,t,n){var s=this;const i=function(e,t){let o;if("object"!=typeof t){for(var a=arguments.length,r=new Array(a>2?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];o=s.options.overloadTranslationOptionHandler([e,t].concat(r))}else o={...t};o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||i.keyPrefix);const h=s.options.keySeparator||".";let c;return c=o.keyPrefix&&Array.isArray(e)?e.map((e=>`${o.keyPrefix}${h}${e}`)):o.keyPrefix?`${o.keyPrefix}${h}${e}`:e,s.t(c,o)};return se(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.translate(...t)}exists(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(n,e)||s&&!o(i,e)))}loadNamespaces(e,t){const n=ie();return this.options.ns?(se(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=ie();se(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter((e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=s.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new Ae(Te());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Ue(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new Ue(s);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),{}))),{});i.store=new Le(e,s),i.services.resourceStore=i.store}return i.translator=new _e(i.services,s),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];i.emit(e,...n)})),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ze=Ue.createInstance();ze.createInstance=Ue.createInstance,ze.createInstance,ze.dir,ze.init,ze.loadResources,ze.reloadResources,ze.use,ze.changeLanguage,ze.getFixedT,ze.t,ze.exists,ze.setDefaultNamespace,ze.hasLoadedNamespace,ze.loadNamespaces,ze.loadLanguages;const Ke={defaultNS:"common",fallbackLng:["en"],initAsync:!1,interpolation:{escapeValue:!1},ns:["common"]};class qe{i18n=(()=>ze.createInstance())();loadedNamespaces=(()=>new Set)();constructor(){this.i18n.use(ne),this.i18n.init({...Ke,detection:{order:["cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"]}})}static getInstance(){return qe.instance||(qe.instance=new qe),qe.instance}addNamespaceResources(e,t){this.loadedNamespaces.has(e)||(Object.keys(t).forEach((n=>{this.i18n.addResourceBundle(n,e,t[n],!0,!0)})),this.loadedNamespaces.add(e))}translate(e,t){return this.i18n.t(e,t)}getLanguage(){return this.i18n.language}}class Be extends I{loadI18nResources(e,t){this.namespace=e,qe.getInstance().addNamespaceResources(e,t)}t(e,t,n){if(!this.namespace&&!n?.ns)throw new Error("Namespace is not set. Call `this.loadI18nResources()` with a namespace first, or provide a namespace in the options parameter.");return qe.getInstance().translate(e,{ns:this.namespace||n.ns,defaultValue:t,...n??{}})}getLanguage(){return qe.getInstance().getLanguage()}}const Je="title",Ge="content",Qe="open",We="cta-label",Ye="brand-color";class Xe extends Be{static observedAttributes=(()=>[We,Ye,Je,Ge,Qe])();constructor(){super(),this.loadI18nResources("NudgeTray",{en:j,es:F})}connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"}),this.render(),this.bindEvents()}attributeChangedCallback(e,t,n){switch(e){case We:this.updateCtaLabel(n);break;case Ye:this.updateCtaBG(n),this.updateIconColor(n);break;case Je:this.updateTitle(n);break;case Ge:this.updateContent(n);break;case Qe:this.updateOpen(n)}}render(){this.shadowRoot&&(this.shadowRoot.innerHTML='\n<style>\n.nudge-tray {\n  gap: 16px;\n  padding: 16px;\n  display: flex;\n  align-items: center;\n  font-family: sans-serif;\n  border-radius: 8px;\n  position: fixed;\n  bottom: 16px;\n  left: 16px;\n  width: 340px;\n  max-width: calc(100% - 72px);\n  background-color: #ffffff;\n  color: rgba(0, 0, 0, 0.9);\n  z-index: 2147483644; /* 1 smaller than the modal  */\n  box-shadow: 0px 2px 4px 0px rgba(27, 27, 27, 0.1);\n  transition: transform 0.3s ease-in-out;\n  transform: translateX(-200%); /* hide the nudge tray by offsetting it to the right */\n}\n\n.nudge-tray.open {\n  transform: translateX(0); /* show the nudge by removing its right offset */\n}\n\n.nudge-tray--icon {\n  transition:\n    transform 0.3s ease-in-out,\n    opacity 0.3s ease-in-out;\n  animation: inReveal 0.5s ease-in-out;\n}\n\n@keyframes inReveal {\n  0% {\n    transform: scale(0.25);\n    opacity: 1;\n  }\n\n  50% {\n    transform: scale(1.25);\n    opacity: 1;\n  }\n\n  100% {\n    transform: scale(1);\n    opacity: 1;\n  }\n}\n\n.nudge-tray--icon svg {\n  vertical-align: bottom;\n}\n\n.nudge-tray--text {\n  flex: 1;\n}\n\n.nudge-tray--title {\n  margin: 0 0 4px;\n  font-size: 14px;\n  font-weight: bold;\n}\n\n.nudge-tray--content {\n  margin: 0;\n  font-size: 12px;\n}\n\n.nudge-tray .nudge-tray--cta {\n  cursor: pointer;\n  font-size: 14px;\n  font-weight: bold;\n  color: #ffffff;\n  padding: 8px 16px;\n  border-radius: 8px;\n  border-width: 0;\n  background-color: #425ccd;\n}\n\n.nudge-tray--close {\n  cursor: pointer;\n  top: -14px;\n  right: -14px;\n  border: none;\n  position: absolute;\n  width: 28px;\n  height: 28px;\n  border-radius: 28px;\n  line-height: 28px;\n  border-radius: 999px;\n  background-color: #ffffff;\n  color: #000000e6;\n  box-shadow: 0px 2px 4px 0px rgba(27, 27, 27, 0.1);\n}\n\n</style>\n\n<div class="nudge-tray">\n  <button class="nudge-tray--close" role="button" aria-label="close">\n    <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">\n      <path\n        fill-rule="evenodd"\n        clip-rule="evenodd"\n        d="M5.00004 5.70714L8.70898 9.41609L9.41609 8.70898L5.70715 5.00004L9.41609 1.29109L8.70898 0.583984L5.00004 4.29293L1.29109 0.583984L0.583984 1.29109L4.29293 5.00004L0.583985 8.70898L1.29109 9.41609L5.00004 5.70714Z"\n        fill="#000000e6"\n      />\n    </svg>\n  </button>\n  <div class="nudge-tray--icon">\n    <svg\n      xmlns="http://www.w3.org/2000/svg"\n      xmlns:xlink="http://www.w3.org/1999/xlink"\n      viewBox="0 0 430 430"\n      width="48"\n      height="48"\n      preserveAspectRatio="xMidYMid meet"\n      style="\n        width: 100%;\n        height: 100%;\n        transform: translate3d(0px, 0px, 0px);\n        content-visibility: visible;\n      "\n    >\n      <defs>\n        <clipPath id="__lottie_element_2">\n          <rect width="430" height="430" x="0" y="0"></rect>\n        </clipPath>\n        <clipPath id="__lottie_element_4"><path d="M0,0 L430,0 L430,430 L0,430z"></path></clipPath>\n      </defs>\n      <g clip-path="url(#__lottie_element_2)">\n        <g\n          clip-path="url(#__lottie_element_4)"\n          transform="matrix(1,0,0,1,0,0)"\n          opacity="1"\n          style="display: block"\n        >\n          <g transform="matrix(1,0,0,1,215,215)" opacity="1" style="display: block">\n            <g opacity="1" transform="matrix(1,0,0,1,0,0)">\n              <path\n                stroke-linecap="round"\n                stroke-linejoin="round"\n                fill-opacity="0"\n                class="secondary"\n                stroke="rgb(248,210,209)"\n                stroke-opacity="1"\n                stroke-width="14"\n                d=" M-142.60400390625,-123.28299713134766 C-180.1909942626953,-84.56600189208984 -174.6439971923828,-40.32699966430664 -135.97900390625,-1.7760000228881836 C-135.96200561523438,-1.7760000228881836 -129.0469970703125,5.383999824523926 -118.34200286865234,16.479000091552734"\n              ></path>\n            </g>\n          </g>\n          <g transform="matrix(1,0,0,1,215,215)" opacity="1" style="display: block">\n            <g opacity="1" transform="matrix(1,0,0,1,0,0)">\n              <path\n                stroke-linecap="round"\n                stroke-linejoin="round"\n                fill-opacity="0"\n                class="primary"\n                stroke="rgb(250,10,10)"\n                stroke-opacity="1"\n                stroke-width="14"\n                d=" M164.48916625976562,16.985082626342773 C187.0865936279297,-5.612349987030029 198.43740844726562,-35.25269317626953 198.43740844726562,-64.84539794921875 C198.43740844726562,-94.48474884033203 187.07566833496094,-124.11316680908203 164.48916625976562,-146.72250366210938 C145.20230102539062,-166.02822875976562 120.80171966552734,-177.09622192382812 95.64395141601562,-179.92648315429688 C61.846534729003906,-183.72828674316406 26.699493408203125,-172.6593017578125 0.78652423620224,-146.72250366210938 C0.78652423620224,-146.72250366210938 0.6475982666015625,-146.5835723876953 0.6475982666015625,-146.5835723876953 C0.6475982666015625,-146.5835723876953 0.5056822896003723,-146.72250366210938 0.5056822896003723,-146.72250366210938 C-22.091751098632812,-169.3199462890625 -51.732093811035156,-180.67076110839844 -81.32479858398438,-180.67076110839844 C-110.96414947509766,-180.67076110839844 -140.58859252929688,-169.3080291748047 -163.19793701171875,-146.72250366210938 C-208.4444122314453,-101.5226821899414 -208.4444122314453,-28.21474266052246 -163.19793701171875,16.985082626342773 C-163.19793701171875,16.985082626342773 -55.54985046386719,124.62936401367188 -55.501708984375,124.67822265625 C-55.426177978515625,124.75489807128906 0.516339123249054,180.69833374023438 0.6505793929100037,180.6980438232422 C0.7854218482971191,180.69773864746094 57.13397216796875,124.33794403076172 57.214027404785156,124.26512145996094 C57.28014373779297,124.20498657226562 164.48916625976562,16.985082626342773 164.48916625976562,16.985082626342773z"\n              ></path>\n            </g>\n          </g>\n        </g>\n      </g>\n    </svg>\n  </div>\n  <div class="nudge-tray--text">\n    <p class="nudge-tray--title" role="text" aria-label="title"></p>\n    <p class="nudge-tray--content" role="text" aria-label="content">\n    </p>\n  </div>\n  <button class="nudge-tray--cta"></button>\n</div>\n\n    ',this.updateOpen(this.getAttribute(Qe)),this.updateCtaLabel(this.getAttribute(We)),this.updateCtaBG(this.getAttribute(Ye)),this.updateIconColor(this.getAttribute(Ye)),this.updateTitle(this.getAttribute(Je)),this.updateContent(this.getAttribute(Ge)))}updateOpen(e){const t=this.shadowRoot?.querySelector(".nudge-tray");t&&("true"===e?t.classList.contains("open")||t.classList.add("open"):t.classList.remove("open"))}updateTitle(e){const t=this.shadowRoot?.querySelector(".nudge-tray--title");t&&(t.textContent=e||this.t("nudge-tray-title","Make a difference!"))}updateContent(e){const t=this.shadowRoot?.querySelector(".nudge-tray--content");t&&(t.textContent=e||this.t("nudge-tray-content","Finish your donation to create an impact today."))}updateCtaLabel(e){const t=this.shadowRoot?.querySelector(".nudge-tray--cta");t&&(t.textContent=e||this.t("nudge-tray-cta","Give Now"))}updateCtaBG(e){if(!e)return;const t=this.shadowRoot?.querySelector(".nudge-tray--cta");t&&(t.style.backgroundColor=e)}updateIconColor(e){if(!e)return;const t=this.shadowRoot?.querySelector(".nudge-tray--icon path.primary"),n=this.shadowRoot?.querySelector(".nudge-tray--icon path.secondary");t&&n&&(t.style.stroke=e,n.style.stroke=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return;const n=s(e).setAlpha(t);return n.isValid()?n.toRgbString():void 0}(e,.5))}bindEvents(){this.bindCtaEvent(),this.bindCloseEvent()}bindCtaEvent(){const e=this.shadowRoot?.querySelector(".nudge-tray--cta");e&&e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("cl-nudge-tray--cta",{bubbles:!0,composed:!0}))}))}bindCloseEvent(){const e=this.shadowRoot?.querySelector(".nudge-tray--close");e&&e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("cl-nudge-tray--close",{bubbles:!0,composed:!0}))}))}}customElements.get("cl-nudge-tray")||customElements.define("cl-nudge-tray",Xe)})();

/***/ }),

/***/ 727:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(354);
/* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(314);
/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/* @import url('@classy/design-tokens/dist/tokens.css'); */

:root {
  /* Default and Web Safe Fonts */
  --classy-font__font-family--arial: Arial, sans-serif;
  --classy-font__font-family--georgia: Georgia, serif;
  --classy-font__font-family--impact: Impact, sans-serif;
  --classy-font__font-family--tahoma: Tahoma, sans-serif;
  --classy-font__font-family--times-new-roman: 'Times New Roman', serif;
  --classy-font__font-family--verdana: Verdana, sans-serif;

  /* Google Fonts */
  --classy-font__font-family--domine: 'Domine', serif;
  --classy-font__font-family--inter: 'Inter', sans-serif;
  --classy-font__font-family--karla: 'Karla', sans-serif;
  --classy-font__font-family--lato: 'Lato', sans-serif;
  --classy-font__font-family--merriweather: 'Merriweather', serif;
  --classy-font__font-family--montserrat: 'Montserrat', sans-serif;
  --classy-font__font-family--open-sans: 'Open Sans', sans-serif;
  --classy-font__font-family--oswald: 'Oswald', sans-serif;
  --classy-font__font-family--poppins: 'Poppins', sans-serif;
  --classy-font__font-family--pt-sans: 'PT Sans', sans-serif;
  --classy-font__font-family--raleway: 'Raleway', sans-serif;
  --classy-font__font-family--roboto: 'Roboto', sans-serif;
  --classy-font__font-family--slabo-13px: 'Slabo 13px', serif;
  --classy-font__font-family--slabo-27px: 'Slabo 27px', serif;
  --classy-font__font-family--source-sans-3: 'Source Sans 3', sans-serif;

  /* Theme Colors */
  --classy-theme-color__brand-primary: #425ccd;
  --classy-theme-color__brand-secondary: #e8ebf9;
  --classy-theme-color__brand-tertiary: #303030;
  --classy-theme-color__text-general: #2d2e31;
  --classy-theme-color__background: #ffffff;
  --classy-theme-color__background-accent: #f2f1ef;

  /* Base Font Family */
  --classy-font__font-family--base: system-ui, -apple-system, BlinkMacSystemFont, 'San Francisco',
    'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  /* Typography Variables */
  --classy-font__label--font-size: 12px;
  --classy-font__label--line-height: 1.5;
  --classy-font__label--font-weight: 400;
  --classy-font__label-bold--font-weight: 700;

  --classy-font__paragraph-sm--font-size: 14px;
  --classy-font__paragraph-sm--line-height: 1.5;
  --classy-font__paragraph-sm--font-weight: 400;
  --classy-font__paragraph-sm-bold--font-size: 14px;
  --classy-font__paragraph-sm-bold--line-height: 1.5;
  --classy-font__paragraph-sm-bold--font-weight: 700;

  --classy-font__paragraph-md--font-size: 16px;
  --classy-font__paragraph-md--line-height: 1.5;
  --classy-font__paragraph-md--font-weight: 400;
  --classy-font__paragraph-md-bold--font-size: 16px;
  --classy-font__paragraph-md-bold--line-height: 1.5;
  --classy-font__paragraph-md-bold--font-weight: 700;

  --classy-font__paragraph-lg--font-size: 20px;
  --classy-font__paragraph-lg--line-height: 1.5;
  --classy-font__paragraph-lg--font-weight: 400;
  --classy-font__paragraph-lg-bold--font-size: 20px;
  --classy-font__paragraph-lg-bold--line-height: 1.5;
  --classy-font__paragraph-lg-bold--font-weight: 700;

  --classy-font__heading-sm--font-size: 28px;
  --classy-font__heading-sm--line-height: 1.2;
  --classy-font__heading-sm--font-weight: 700;

  --classy-font__tag-bold--font-size: 12px;
  --classy-font__tag-bold--line-height: 1;
  --classy-font__tag-bold--font-weight: 700;

  /* General and Heading Font Family Aliases */
  --classy-theme-font__font-family--paragraph: var(--classy-font__font-family--base);
  --classy-theme-font__font-family--heading: var(--classy-font__font-family--base);

  --classy-font__heading-xs--font-size: 24px;
  --classy-font__heading-xs--line-height: 1.2;
  --classy-font__heading-xs--font-weight: 700;

  --classy-theme-font__paragraph-md--font-size: 16px;
  --classy-theme-font__paragraph-md--line-height: 1.5;
  --classy-theme-font__paragraph-md--font-weight: 400;

  /* Border Radius */
  --classy-border__radius-sm: 4px;
  --classy-border__radius-md: 8px;
  --classy-border__radius-lg: 12px;
  --classy-border__radius-xl: 16px;
  --classy-border__radius-xxl: 20px;

  /* Shadows */
  --classy-shadow__button: 0 2px 2px 0 rgba(27, 25, 24, 0.12);
  --classy-shadow__text: 0 1px 1px 0 rgba(0, 0, 0, 0.24);
  --classy-shadow__alert: 0 4px 8px 0 rgba(28, 25, 23, 0.12);
  --classy-shadow__modal: 0 16px 32px 0 rgba(27, 25, 24, 0.12);
  --classy-shadow__sheet: 0 0 16px 0 rgba(27, 25, 24, 0.24);
  --classy-shadow__active: 0px 2px 2px 0px rgba(0, 0, 0, 0.24) inset,
    1px 1px 1px 0px rgba(0, 0, 0, 0.24) inset;
  --classy-shadow__inactive: 0px -2px 4px 0px rgba(0, 0, 0, 0.12) inset,
    1px 2px 4px 0px rgba(255, 255, 255, 0.12) inset;

  /* Brand Colors */
  --classy-color__brand-primary--base: rgb(54, 81, 201);
  --classy-color__brand-primary--darker: rgb(27, 40, 101);
  --classy-color__brand-primary--dark: rgb(41, 61, 153);
  --classy-color__brand-primary--light: rgb(102, 123, 214);
  --classy-color__brand-primary--lighter: rgb(154, 168, 228);
  --classy-color__brand-primary--lightest: rgb(207, 213, 242);
  --classy-color__brand-secondary: rgb(232, 235, 248);
  --classy-color__brand-secondary-dark: rgb(206, 213, 242);
  --classy-color__brand-tertiary: rgb(26, 25, 24);

  /* Neutral Colors */
  --classy-color__neutral--10: rgb(27, 25, 24);
  --classy-color__neutral--20: rgb(49, 47, 45);
  --classy-color__neutral--30: rgb(80, 76, 73);
  --classy-color__neutral--40: rgb(106, 101, 98);
  --classy-color__neutral--45: rgb(120, 114, 110);
  --classy-color__neutral--50: rgb(133, 127, 122);
  --classy-color__neutral--60: rgb(157, 152, 149);
  --classy-color__neutral--70: rgb(181, 178, 176);
  --classy-color__neutral--80: rgb(206, 204, 202);
  --classy-color__neutral--90: rgb(230, 229, 229);
  --classy-color__neutral--95: rgb(243, 242, 242);
  --classy-color__neutral--100: rgb(255, 255, 255);

  /* Borders */
  --classy-color__border--input: var(--classy-color__neutral--50);
  --classy-color__border--input-hover: var(--classy-color__neutral--60);
  --classy-color__border--lightest: rgb(235, 234, 234);
  --classy-color__border--placeholder: rgb(248, 247, 247);
  --classy-color__border--focus: rgb(41, 114, 255);

  /* Backgrounds */
  --classy-color__background: rgb(255, 255, 255);
  --classy-color__background--accent: rgb(245, 245, 245);
  --classy-color__background--lightest: var(--classy-color__neutral--95);
  --classy-color__background--input: rgb(248, 247, 247);
  --classy-color__background--backdrop: rgba(255, 255, 255, 0.8);
  --classy-color__background--backdrop-dark: rgba(26, 25, 25, 0.8);

  /* Status Colors */
  --classy-color__status--error-base: rgb(169, 15, 15);
  --classy-color__status--error-lightest: rgb(254, 246, 246);
  --classy-color__status--success-base: rgb(46, 125, 50);

  /*
   * * Component-specific
   * ! FIXME align breakpoint names with design system, CL-27142
   */
  --classy-layout__max-width--tablet: 1280px;
  --classy-section__padding-inline--mobile: 24px;
  --classy-section__padding-block--mobile: 24px;
  --classy-section__padding-inline--tablet: 32px;
  --classy-section__padding-block--tablet: 48px;
  --classy-content__width--wide: 768px;
}

`, "",{"version":3,"sources":["webpack://./node_modules/@classy/embedded-components/dist/common.css"],"names":[],"mappings":"AAAA,0DAA0D;;AAE1D;EACE,+BAA+B;EAC/B,oDAAoD;EACpD,mDAAmD;EACnD,sDAAsD;EACtD,sDAAsD;EACtD,qEAAqE;EACrE,wDAAwD;;EAExD,iBAAiB;EACjB,mDAAmD;EACnD,sDAAsD;EACtD,sDAAsD;EACtD,oDAAoD;EACpD,+DAA+D;EAC/D,gEAAgE;EAChE,8DAA8D;EAC9D,wDAAwD;EACxD,0DAA0D;EAC1D,0DAA0D;EAC1D,0DAA0D;EAC1D,wDAAwD;EACxD,2DAA2D;EAC3D,2DAA2D;EAC3D,sEAAsE;;EAEtE,iBAAiB;EACjB,4CAA4C;EAC5C,8CAA8C;EAC9C,6CAA6C;EAC7C,2CAA2C;EAC3C,yCAAyC;EACzC,gDAAgD;;EAEhD,qBAAqB;EACrB;oDACkD;;EAElD,yBAAyB;EACzB,qCAAqC;EACrC,sCAAsC;EACtC,sCAAsC;EACtC,2CAA2C;;EAE3C,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,0CAA0C;EAC1C,2CAA2C;EAC3C,2CAA2C;;EAE3C,wCAAwC;EACxC,uCAAuC;EACvC,yCAAyC;;EAEzC,4CAA4C;EAC5C,kFAAkF;EAClF,gFAAgF;;EAEhF,0CAA0C;EAC1C,2CAA2C;EAC3C,2CAA2C;;EAE3C,kDAAkD;EAClD,mDAAmD;EACnD,mDAAmD;;EAEnD,kBAAkB;EAClB,+BAA+B;EAC/B,+BAA+B;EAC/B,gCAAgC;EAChC,gCAAgC;EAChC,iCAAiC;;EAEjC,YAAY;EACZ,2DAA2D;EAC3D,sDAAsD;EACtD,0DAA0D;EAC1D,4DAA4D;EAC5D,yDAAyD;EACzD;6CAC2C;EAC3C;mDACiD;;EAEjD,iBAAiB;EACjB,qDAAqD;EACrD,uDAAuD;EACvD,qDAAqD;EACrD,wDAAwD;EACxD,0DAA0D;EAC1D,2DAA2D;EAC3D,mDAAmD;EACnD,wDAAwD;EACxD,+CAA+C;;EAE/C,mBAAmB;EACnB,4CAA4C;EAC5C,4CAA4C;EAC5C,4CAA4C;EAC5C,8CAA8C;EAC9C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,gDAAgD;;EAEhD,YAAY;EACZ,+DAA+D;EAC/D,qEAAqE;EACrE,oDAAoD;EACpD,uDAAuD;EACvD,gDAAgD;;EAEhD,gBAAgB;EAChB,8CAA8C;EAC9C,sDAAsD;EACtD,sEAAsE;EACtE,qDAAqD;EACrD,8DAA8D;EAC9D,gEAAgE;;EAEhE,kBAAkB;EAClB,oDAAoD;EACpD,0DAA0D;EAC1D,sDAAsD;;EAEtD;;;IAGE;EACF,0CAA0C;EAC1C,8CAA8C;EAC9C,6CAA6C;EAC7C,8CAA8C;EAC9C,6CAA6C;EAC7C,oCAAoC;AACtC","sourcesContent":["/* @import url('@classy/design-tokens/dist/tokens.css'); */\n\n:root {\n  /* Default and Web Safe Fonts */\n  --classy-font__font-family--arial: Arial, sans-serif;\n  --classy-font__font-family--georgia: Georgia, serif;\n  --classy-font__font-family--impact: Impact, sans-serif;\n  --classy-font__font-family--tahoma: Tahoma, sans-serif;\n  --classy-font__font-family--times-new-roman: 'Times New Roman', serif;\n  --classy-font__font-family--verdana: Verdana, sans-serif;\n\n  /* Google Fonts */\n  --classy-font__font-family--domine: 'Domine', serif;\n  --classy-font__font-family--inter: 'Inter', sans-serif;\n  --classy-font__font-family--karla: 'Karla', sans-serif;\n  --classy-font__font-family--lato: 'Lato', sans-serif;\n  --classy-font__font-family--merriweather: 'Merriweather', serif;\n  --classy-font__font-family--montserrat: 'Montserrat', sans-serif;\n  --classy-font__font-family--open-sans: 'Open Sans', sans-serif;\n  --classy-font__font-family--oswald: 'Oswald', sans-serif;\n  --classy-font__font-family--poppins: 'Poppins', sans-serif;\n  --classy-font__font-family--pt-sans: 'PT Sans', sans-serif;\n  --classy-font__font-family--raleway: 'Raleway', sans-serif;\n  --classy-font__font-family--roboto: 'Roboto', sans-serif;\n  --classy-font__font-family--slabo-13px: 'Slabo 13px', serif;\n  --classy-font__font-family--slabo-27px: 'Slabo 27px', serif;\n  --classy-font__font-family--source-sans-3: 'Source Sans 3', sans-serif;\n\n  /* Theme Colors */\n  --classy-theme-color__brand-primary: #425ccd;\n  --classy-theme-color__brand-secondary: #e8ebf9;\n  --classy-theme-color__brand-tertiary: #303030;\n  --classy-theme-color__text-general: #2d2e31;\n  --classy-theme-color__background: #ffffff;\n  --classy-theme-color__background-accent: #f2f1ef;\n\n  /* Base Font Family */\n  --classy-font__font-family--base: system-ui, -apple-system, BlinkMacSystemFont, 'San Francisco',\n    'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n\n  /* Typography Variables */\n  --classy-font__label--font-size: 12px;\n  --classy-font__label--line-height: 1.5;\n  --classy-font__label--font-weight: 400;\n  --classy-font__label-bold--font-weight: 700;\n\n  --classy-font__paragraph-sm--font-size: 14px;\n  --classy-font__paragraph-sm--line-height: 1.5;\n  --classy-font__paragraph-sm--font-weight: 400;\n  --classy-font__paragraph-sm-bold--font-size: 14px;\n  --classy-font__paragraph-sm-bold--line-height: 1.5;\n  --classy-font__paragraph-sm-bold--font-weight: 700;\n\n  --classy-font__paragraph-md--font-size: 16px;\n  --classy-font__paragraph-md--line-height: 1.5;\n  --classy-font__paragraph-md--font-weight: 400;\n  --classy-font__paragraph-md-bold--font-size: 16px;\n  --classy-font__paragraph-md-bold--line-height: 1.5;\n  --classy-font__paragraph-md-bold--font-weight: 700;\n\n  --classy-font__paragraph-lg--font-size: 20px;\n  --classy-font__paragraph-lg--line-height: 1.5;\n  --classy-font__paragraph-lg--font-weight: 400;\n  --classy-font__paragraph-lg-bold--font-size: 20px;\n  --classy-font__paragraph-lg-bold--line-height: 1.5;\n  --classy-font__paragraph-lg-bold--font-weight: 700;\n\n  --classy-font__heading-sm--font-size: 28px;\n  --classy-font__heading-sm--line-height: 1.2;\n  --classy-font__heading-sm--font-weight: 700;\n\n  --classy-font__tag-bold--font-size: 12px;\n  --classy-font__tag-bold--line-height: 1;\n  --classy-font__tag-bold--font-weight: 700;\n\n  /* General and Heading Font Family Aliases */\n  --classy-theme-font__font-family--paragraph: var(--classy-font__font-family--base);\n  --classy-theme-font__font-family--heading: var(--classy-font__font-family--base);\n\n  --classy-font__heading-xs--font-size: 24px;\n  --classy-font__heading-xs--line-height: 1.2;\n  --classy-font__heading-xs--font-weight: 700;\n\n  --classy-theme-font__paragraph-md--font-size: 16px;\n  --classy-theme-font__paragraph-md--line-height: 1.5;\n  --classy-theme-font__paragraph-md--font-weight: 400;\n\n  /* Border Radius */\n  --classy-border__radius-sm: 4px;\n  --classy-border__radius-md: 8px;\n  --classy-border__radius-lg: 12px;\n  --classy-border__radius-xl: 16px;\n  --classy-border__radius-xxl: 20px;\n\n  /* Shadows */\n  --classy-shadow__button: 0 2px 2px 0 rgba(27, 25, 24, 0.12);\n  --classy-shadow__text: 0 1px 1px 0 rgba(0, 0, 0, 0.24);\n  --classy-shadow__alert: 0 4px 8px 0 rgba(28, 25, 23, 0.12);\n  --classy-shadow__modal: 0 16px 32px 0 rgba(27, 25, 24, 0.12);\n  --classy-shadow__sheet: 0 0 16px 0 rgba(27, 25, 24, 0.24);\n  --classy-shadow__active: 0px 2px 2px 0px rgba(0, 0, 0, 0.24) inset,\n    1px 1px 1px 0px rgba(0, 0, 0, 0.24) inset;\n  --classy-shadow__inactive: 0px -2px 4px 0px rgba(0, 0, 0, 0.12) inset,\n    1px 2px 4px 0px rgba(255, 255, 255, 0.12) inset;\n\n  /* Brand Colors */\n  --classy-color__brand-primary--base: rgb(54, 81, 201);\n  --classy-color__brand-primary--darker: rgb(27, 40, 101);\n  --classy-color__brand-primary--dark: rgb(41, 61, 153);\n  --classy-color__brand-primary--light: rgb(102, 123, 214);\n  --classy-color__brand-primary--lighter: rgb(154, 168, 228);\n  --classy-color__brand-primary--lightest: rgb(207, 213, 242);\n  --classy-color__brand-secondary: rgb(232, 235, 248);\n  --classy-color__brand-secondary-dark: rgb(206, 213, 242);\n  --classy-color__brand-tertiary: rgb(26, 25, 24);\n\n  /* Neutral Colors */\n  --classy-color__neutral--10: rgb(27, 25, 24);\n  --classy-color__neutral--20: rgb(49, 47, 45);\n  --classy-color__neutral--30: rgb(80, 76, 73);\n  --classy-color__neutral--40: rgb(106, 101, 98);\n  --classy-color__neutral--45: rgb(120, 114, 110);\n  --classy-color__neutral--50: rgb(133, 127, 122);\n  --classy-color__neutral--60: rgb(157, 152, 149);\n  --classy-color__neutral--70: rgb(181, 178, 176);\n  --classy-color__neutral--80: rgb(206, 204, 202);\n  --classy-color__neutral--90: rgb(230, 229, 229);\n  --classy-color__neutral--95: rgb(243, 242, 242);\n  --classy-color__neutral--100: rgb(255, 255, 255);\n\n  /* Borders */\n  --classy-color__border--input: var(--classy-color__neutral--50);\n  --classy-color__border--input-hover: var(--classy-color__neutral--60);\n  --classy-color__border--lightest: rgb(235, 234, 234);\n  --classy-color__border--placeholder: rgb(248, 247, 247);\n  --classy-color__border--focus: rgb(41, 114, 255);\n\n  /* Backgrounds */\n  --classy-color__background: rgb(255, 255, 255);\n  --classy-color__background--accent: rgb(245, 245, 245);\n  --classy-color__background--lightest: var(--classy-color__neutral--95);\n  --classy-color__background--input: rgb(248, 247, 247);\n  --classy-color__background--backdrop: rgba(255, 255, 255, 0.8);\n  --classy-color__background--backdrop-dark: rgba(26, 25, 25, 0.8);\n\n  /* Status Colors */\n  --classy-color__status--error-base: rgb(169, 15, 15);\n  --classy-color__status--error-lightest: rgb(254, 246, 246);\n  --classy-color__status--success-base: rgb(46, 125, 50);\n\n  /*\n   * * Component-specific\n   * ! FIXME align breakpoint names with design system, CL-27142\n   */\n  --classy-layout__max-width--tablet: 1280px;\n  --classy-section__padding-inline--mobile: 24px;\n  --classy-section__padding-block--mobile: 24px;\n  --classy-section__padding-inline--tablet: 32px;\n  --classy-section__padding-block--tablet: 48px;\n  --classy-content__width--wide: 768px;\n}\n\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 314:
/***/ ((module) => {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ 354:
/***/ ((module) => {

"use strict";


module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ }),

/***/ 910:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72);
/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(825);
/* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40);
/* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56);
/* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(540);
/* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(113);
/* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _css_loader_dist_cjs_js_common_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(727);

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_common_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A, options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_css_loader_dist_cjs_js_common_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A && _css_loader_dist_cjs_js_common_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.locals ? _css_loader_dist_cjs_js_common_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.locals : undefined);


/***/ }),

/***/ 72:
/***/ ((module) => {

"use strict";


var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),

/***/ 40:
/***/ ((module) => {

"use strict";


var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ }),

/***/ 540:
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ }),

/***/ 56:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =  true ? __webpack_require__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ }),

/***/ 825:
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ }),

/***/ 113:
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ }),

/***/ 60:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const abandon_cart_nudge_tray_model_1 = __importDefault(__webpack_require__(816));
const abandon_cart_nudge_tray_view_1 = __importDefault(__webpack_require__(468));
class AbandonCartNudgeTrayCtrl {
    constructor(props) {
        this.destroyed = false;
        this.init = () => __awaiter(this, void 0, void 0, function* () {
            const { modalSDK } = this.props;
            this.model = new abandon_cart_nudge_tray_model_1.default({
                win: this.props.win,
                msg: this.props.msg,
                configs: yield this.props.configs,
            });
            this.view = new abandon_cart_nudge_tray_view_1.default({
                win: this.props.win,
                onCta: this.subscribeToNudgeTrayCtaEvent,
                onClose: this.subscribeToNudgeTrayCloseEvent,
                /**
                 * PS. Open the nudge tray on page load only if there's nudge tray state
                 * and if the modal is NOT opened.
                 */
                isOpen: !!(yield this.model.get()) && !modalSDK.isOpen(),
            });
            modalSDK.subscribeToOpenEvent(this.subscribeToModalOpenEvent);
            modalSDK.subscribeToCloseEvent(this.subscribeToModalCloseEvent);
            if (modalSDK.isOpen()) {
                const campaign = modalSDK.getCampaign();
                if (campaign) {
                    this.model.set({ campaign, params: modalSDK.getParams() });
                }
            }
            else {
                const modelState = yield this.model.get();
                if (modelState) {
                    this.view.open(modelState);
                }
            }
        });
        this.subscribeToModalOpenEvent = (event) => {
            this.model.set(event.data);
            this.view.close();
        };
        this.subscribeToModalCloseEvent = () => __awaiter(this, void 0, void 0, function* () {
            const modelState = yield this.model.get();
            if (modelState) {
                this.view.open(modelState);
            }
        });
        this.subscribeToNudgeTrayCloseEvent = () => __awaiter(this, void 0, void 0, function* () {
            var _a, _b;
            const modelState = yield this.model.get();
            if (modelState === null || modelState === void 0 ? void 0 : modelState.nav.campaign) {
                (_b = (_a = this.props.win.eg) === null || _a === void 0 ? void 0 : _a.sendAnalyticsEvent) === null || _b === void 0 ? void 0 : _b.call(_a, 'abandon_cart_nudge', {
                    abandon_cart_nudge_status: false,
                    campaign_id: modelState.nav.campaign,
                });
            }
            this.model.reset();
            this.view.close();
        });
        this.subscribeToNudgeTrayCtaEvent = () => __awaiter(this, void 0, void 0, function* () {
            var _c, _d;
            const modelState = yield this.model.get();
            if (modelState === null || modelState === void 0 ? void 0 : modelState.nav.campaign) {
                this.props.modalSDK.open(modelState.nav.campaign, modelState.nav.params);
                (_d = (_c = this.props.win.eg) === null || _c === void 0 ? void 0 : _c.sendAnalyticsEvent) === null || _d === void 0 ? void 0 : _d.call(_c, 'abandon_cart_nudge', {
                    abandon_cart_nudge_status: true,
                    campaign_id: modelState.nav.campaign,
                });
            }
        });
        this.props = props;
        this.init();
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        if (this.view) {
            this.view.destroy();
        }
        if (this.model) {
            this.model.destroy();
        }
    }
}
exports["default"] = AbandonCartNudgeTrayCtrl;


/***/ }),

/***/ 816:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const NUDGE_TRAY_STATE_KEY = 'cl-nudge-tray';
const dao_1 = __importDefault(__webpack_require__(311));
class AbandonCartNudgeTrayModel {
    constructor(props) {
        this.destroyed = false;
        this.set = (state) => {
            this.props.win.localStorage.setItem(NUDGE_TRAY_STATE_KEY, JSON.stringify(state));
        };
        this.reset = () => {
            this.props.win.localStorage.removeItem(NUDGE_TRAY_STATE_KEY);
        };
        this.get = () => {
            try {
                const rawState = this.props.win.localStorage.getItem(NUDGE_TRAY_STATE_KEY);
                if (!rawState) {
                    return null;
                }
                const parsedNavState = JSON.parse(rawState);
                if (!this.isValidState(parsedNavState)) {
                    return null;
                }
                const campaignId = parsedNavState.campaign;
                if (!campaignId) {
                    return null;
                }
                const nav = parsedNavState;
                const config = this.getConfig(campaignId);
                if (!(config === null || config === void 0 ? void 0 : config.enabled)) {
                    return null;
                }
                return { nav, config };
            }
            catch (error) {
                return null;
            }
        };
        this.getConfig = (campaignId) => {
            const config = this.props.configs[campaignId];
            // If there is no config for this campaign, there is nothing to render
            // and the nudge tray should be disabled gracefully.
            if (!config) {
                return null;
            }
            const nudgeTrayComponent = Object.values(config.components).find((component) => component.type === 'nudge-tray');
            if (!nudgeTrayComponent) {
                return null;
            }
            return {
                enabled: nudgeTrayComponent.props.abandonCartNudgeEnabled,
                theme: config.theme,
            };
        };
        this.onDonationChanged = (event) => {
            if (event.data.payload.campaignId && event.data.payload.params) {
                this.set({
                    campaign: event.data.payload.campaignId,
                    params: event.data.payload.params,
                });
            }
        };
        this.onDonationCompleted = () => {
            this.reset();
        };
        this.isValidState = (state) => {
            return this.isValidStateCampaign(state.campaign) && this.isValidStateParams(state.params);
        };
        this.isValidStateCampaign = (value) => {
            return !!value && typeof value === 'string';
        };
        this.isValidStateParams = (value) => {
            return typeof value === 'object' && !Array.isArray(value) && value !== null;
        };
        this.props = props;
        this.dao = new dao_1.default({ win: this.props.win });
        this.props.msg.onDonationChanged(this.onDonationChanged);
        this.props.msg.onDonationCompleted(this.onDonationCompleted);
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
    }
}
exports["default"] = AbandonCartNudgeTrayModel;


/***/ }),

/***/ 468:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
class AbandonCartNudgeTrayView {
    constructor(props) {
        this.destroyed = false;
        this.open = (state) => {
            this.pendingState = state;
            if (!state.config.enabled) {
                return;
            }
            if (!this.el) {
                return;
            }
            this.setCtaBg(state);
            this.setContent(state);
            this.setOpen(true);
        };
        this.close = () => {
            this.setOpen(false);
        };
        this.init = () => __awaiter(this, void 0, void 0, function* () {
            try {
                yield Promise.resolve().then(() => __importStar(__webpack_require__(49)));
                this.el = this.props.win.document.createElement('cl-nudge-tray');
                this.props.win.document.body.appendChild(this.el);
                this.el.addEventListener('cl-nudge-tray--cta', this.props.onCta);
                this.el.addEventListener('cl-nudge-tray--close', this.props.onClose);
                // To be able to see the animation
                setTimeout(() => {
                    if (this.pendingState && this.pendingState.config.enabled) {
                        this.setCtaBg(this.pendingState);
                        this.setContent(this.pendingState);
                    }
                    this.setOpen(this.props.isOpen);
                }, 0);
            }
            catch (_) {
                console.log(_);
                console.error('unable to init the abandon cart nudge tray view');
            }
        });
        this.setContent = (state) => {
            if (!this.el) {
                return;
            }
            const amount = Number(state.nav.params.amount);
            if (isNaN(amount) || !isFinite(amount) || amount <= 0) {
                return;
            }
            this.el.setAttribute('content', `Finish your $${amount} gift to create an impact today.`);
        };
        this.setCtaBg = (state) => {
            if (!this.el) {
                return;
            }
            this.el.setAttribute('brand-color', state.config.theme['--theme-color__brand-primary']);
        };
        this.setOpen = (open) => {
            if (!this.el) {
                return;
            }
            this.el.setAttribute('open', open ? 'true' : 'false');
        };
        this.props = props;
        this.init();
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        if (this.el) {
            this.el.removeEventListener('cl-nudge-tray--cta', this.props.onCta);
            this.el.removeEventListener('cl-nudge-tray--close', this.props.onClose);
            this.el.remove();
            this.el = undefined;
        }
    }
}
exports["default"] = AbandonCartNudgeTrayView;


/***/ }),

/***/ 604:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const messenger_1 = __importDefault(__webpack_require__(963));
class AnalyticsManager {
    constructor(props) {
        this.GA4_ID = null;
        this.analyticsLoaded = false;
        this.eventQueue = [];
        this.messenger = null;
        this.destroyed = false;
        this.props = props;
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        this.processEventQueue();
        if (this.messenger) {
            this.messenger.destroy();
            this.messenger = null;
        }
        this.eventQueue = [];
        this.analyticsLoaded = false;
    }
    initialize() {
        return __awaiter(this, void 0, void 0, function* () {
            // Start by checking if GA4 or GTM is already available, otherwise fetch analytics
            yield this.initializeAnalytics();
        });
    }
    /**
     * Checks if GA4 is available either directly via gtag.js or indirectly via GTM.
     */
    isGA4Available() {
        return typeof window.gtag === 'function' || this.checkGA4InDataLayer();
    }
    /**
     * Checks if Google Tag Manager (GTM) is available by verifying the presence of the 'dataLayer'.
     */
    isGTMAvailable() {
        var _a;
        const gtmStartedEvent = (_a = window === null || window === void 0 ? void 0 : window.dataLayer) === null || _a === void 0 ? void 0 : _a.find((element) => element['gtm.start']);
        if (!gtmStartedEvent) {
            return false; // GTM has not started
        }
        if (!gtmStartedEvent['gtm.uniqueEventId']) {
            return false; // GTM config ran, but main GTM JS has not loaded (AdBlock, NoScript, etc.)
        }
        return true; // GTM is fully loaded and operational
    }
    /**
     * Helper function to check if GA4 has been set up via GTM.
     */
    checkGA4InDataLayer() {
        if (window.dataLayer) {
            for (const entry of window.dataLayer) {
                if (entry[0] === 'config' && entry[1] === this.GA4_ID) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Initializes analytics by checking if GA4 or GTM are already available.
     * If neither is available, it queues events and checks availability each time an event comes in.
     */
    initializeAnalytics() {
        return __awaiter(this, void 0, void 0, function* () {
            try {
                // Check if GA4 or GTM are already available
                const ga4Available = this.isGA4Available();
                const gtmAvailable = this.isGTMAvailable();
                if (ga4Available || gtmAvailable) {
                    console.log('GA4 or GTM is already available. Skipping fetch for analytics settings.');
                    this.analyticsLoaded = true;
                    this.processEventQueue(); // Process any queued events
                    return;
                }
            }
            catch (error) {
                console.error('Failed to initialize analytics:', error);
            }
        });
    }
    /**
     * Queues events if GA4/GTM are not yet loaded, or sends them if they are.
     * If GA4/GTM are not available, checks availability each time an event is queued.
     *
     * @param {string} eventName - The name of the event.
     * @param {AnalyticsEventData} eventData - The data associated with the event.
     */
    queueOrSendEvent(eventName, eventData) {
        if (this.analyticsLoaded) {
            this.handleAnalyticsEvent(eventName, eventData);
        }
        else {
            // Check for GA4 or GTM availability whenever an event is queued
            const ga4Available = this.isGA4Available();
            const gtmAvailable = this.isGTMAvailable();
            if (ga4Available || gtmAvailable) {
                console.log('GA4 or GTM is now available. Processing queued events...');
                this.analyticsLoaded = true; // Mark analytics as loaded
                this.processEventQueue(); // Process any queued events
                this.handleAnalyticsEvent(eventName, eventData); // Send the current event immediately
            }
            else {
                console.log('GA4 or GTM not available. Queueing event:', { eventName, eventData });
                this.eventQueue.push({ eventName, eventData });
            }
        }
    }
    /**
     * Processes queued events once GA4/GTM are loaded.
     */
    processEventQueue() {
        while (this.eventQueue.length > 0) {
            const eventItem = this.eventQueue.shift();
            if (eventItem) {
                const { eventName, eventData } = eventItem;
                this.handleAnalyticsEvent(eventName, eventData);
            }
        }
    }
    /**
     * Sends an event to GA4 using gtag.js.
     * @param {string} eventName - The name of the event to send.
     * @param {AnalyticsEventData} eventData - The data associated with the event.
     */
    sendEventToGA4(eventName, eventData) {
        if (this.isGA4Available()) {
            if (typeof window.gtag === 'function') {
                window.gtag('event', eventName, eventData);
            }
            else {
                console.warn('GA4 is not available to handle the event.');
            }
        }
    }
    /**
     * Sends an event to GTM by pushing it into the dataLayer.
     * @param {string} eventName - The name of the event to send.
     * @param {AnalyticsEventData} eventData - The data associated with the event.
     */
    sendEventToGTM(eventName, eventData) {
        if (this.isGTMAvailable()) {
            window.dataLayer.push(Object.assign({ event: eventName }, eventData));
        }
        else {
            console.warn('GTM is not available to handle the event.');
        }
    }
    /**
     * Handles an analytics event by routing it to either GA4 or GTM.
     * @param {string} eventName - The name of the event.
     * @param {AnalyticsEventData} eventData - The data associated with the event.
     */
    handleAnalyticsEvent(eventName, eventData) {
        if (this.isGA4Available()) {
            this.sendEventToGA4(eventName, eventData);
        }
        else if (this.isGTMAvailable()) {
            this.sendEventToGTM(eventName, eventData);
        }
        else {
            console.warn('Neither GA4 nor GTM are available to handle the event.');
        }
    }
    setupEventListener() {
        this.messenger = new messenger_1.default({ win: this.props.win });
        this.messenger.onAnalyticsEvent((event) => {
            const { event: eventName, data } = event.data.payload;
            this.queueOrSendEvent(eventName, data);
        });
    }
    /**
     * NOTE: TODO: We'll likely want to pass this event back across the iframe boundary
     * to the parent window for our own tracking purposes.
     *
     * Public method to send an event to GA4 or GTM directly.
     * This can be used to send events from the SDK.
     *
     * @param {string} eventName - The name of the event to send.
     * @param {AnalyticsEventData} eventData - The data associated with the event.
     */
    sendEvent(eventName, eventData) {
        this.queueOrSendEvent(eventName, eventData);
    }
}
exports["default"] = AnalyticsManager;


/***/ }),

/***/ 664:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const dao_1 = __importDefault(__webpack_require__(311));
const crawler_constants_1 = __webpack_require__(392);
class ConfigService {
    constructor(props) {
        this.destroyed = false;
        this.fetch = () => __awaiter(this, void 0, void 0, function* () {
            const ids = this.getIds();
            const configs = yield this.dao.fetchConfigs(ids, this.props.cookiesManager.getSessionCookie(), this.props.cookiesManager.getUserTrackingCookie());
            // Build a map with campaign_id as key and config as value
            return configs.reduce((acc, config) => {
                acc[config.campaignId] = config;
                return acc;
            }, {});
        });
        this.getIds = () => {
            const allIds = [...this.getIdsFromOrgElements(), ...this.getIdsFromClassyElements()];
            const nudgeTrayCampaignId = this.getIdFromNudgeTrayState();
            if (nudgeTrayCampaignId) {
                allIds.push(nudgeTrayCampaignId);
            }
            const uniqueIds = [...new Set(allIds)];
            return uniqueIds;
        };
        this.getIdFromNudgeTrayState = () => {
            try {
                const rawState = this.props.win.localStorage.getItem('cl-nudge-tray');
                if (!rawState) {
                    return null;
                }
                const parsedState = JSON.parse(rawState);
                if (typeof parsedState.campaign === 'string') {
                    return parsedState.campaign;
                }
                return null;
            }
            catch (_) {
                return null;
            }
        };
        this.getIdsFromOrgElements = () => {
            const els = document.querySelectorAll(`a[href*=${crawler_constants_1.CLASSY_HREF}]`);
            const campaignIds = [];
            els.forEach((el) => {
                const href = el.getAttribute('href');
                if (!href) {
                    return;
                }
                const campaignId = this._extractCampaignId(href);
                if (!campaignId) {
                    return;
                }
                campaignIds.push(campaignId);
            });
            return campaignIds;
        };
        this.getIdsFromClassyElements = () => {
            const els = document.querySelectorAll(`[${crawler_constants_1.CLASSY_ATTR}]`);
            const campaignIds = [];
            if (!els.length) {
                return campaignIds;
            }
            els.forEach((el) => {
                const campaignId = el.getAttribute(crawler_constants_1.CLASSY_ATTR);
                if (campaignId) {
                    campaignIds.push(campaignId);
                }
            });
            return campaignIds;
        };
        this._extractCampaignId = (url) => {
            // Check if the string starts directly with "campaign="
            if (url.startsWith(`${crawler_constants_1.CLASSY_HREF}=`)) {
                return url.split('=')[1] || null;
            }
            // Check if the string starts with "/?" or just "?"
            if (url.startsWith('/?') || url.startsWith('?')) {
                url = 'https://placeholder.com' + url;
            }
            // Parse the URL and attempt to retrieve the 'campaign' parameter
            try {
                const urlObj = new URL(url);
                return urlObj.searchParams.get(crawler_constants_1.CLASSY_HREF);
            }
            catch (_) {
                return null;
            }
        };
        this.props = props;
        this.dao = new dao_1.default({ win: props.win });
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        this.dao.destroy();
    }
}
exports["default"] = ConfigService;


/***/ }),

/***/ 862:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getComponentSectionByType = void 0;
const getComponentSectionByType = (componentType, sectionType, config) => {
    const component = Object.values(config.components).find((c) => c.type === componentType);
    if (!(component === null || component === void 0 ? void 0 : component.sections)) {
        return undefined;
    }
    const section = Object.values(component.sections).find((s) => s.type === sectionType);
    if (!section) {
        return undefined;
    }
    return section;
};
exports.getComponentSectionByType = getComponentSectionByType;


/***/ }),

/***/ 672:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const messenger_messages_1 = __webpack_require__(681);
class CookiesManager {
    constructor({ msg }) {
        this.destroyed = false;
        this.msg = msg;
        this.initializeCookiesAndSendMessages();
        this.listenForNewUserId();
        this.listenForIdentifyUser();
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
    }
    // Generate a session ID as a UUID
    generateSessionId() {
        return this.generateUUID();
    }
    // Helper function to generate UUID (Use crypto.randomUUID() if available)
    generateUUID() {
        return (crypto === null || crypto === void 0 ? void 0 : crypto.randomUUID) ? crypto.randomUUID() : this.fallbackUUID();
    }
    // Fallback UUID generator if crypto.randomUUID() is not available
    fallbackUUID() {
        return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16));
    }
    // Set a cookie (User ID or Session ID)
    setCookie(name, value, options = {}) {
        const cookieString = `${name}=${value}; Path=/; SameSite=Lax;${options.maxAge ? ` Max-Age=${options.maxAge};` : ''}`;
        document.cookie = cookieString + ( true ? ' Secure;' : 0);
    }
    // Set a user tracking cookie
    setUserTrackingCookie(userId) {
        this.setCookie('classy-user-id', userId, {
            maxAge: 13 * 30 * 24 * 60 * 60, // 13-month expiration
        });
    }
    // Set a session tracking cookie
    setSessionCookie(sessionId) {
        this.setCookie('classy-session-id', sessionId);
    }
    // Retrieve user tracking cookie
    getUserTrackingCookie() {
        return this.getCookie('classy-user-id');
    }
    // Retrieve session tracking cookie
    getSessionCookie() {
        return this.getCookie('classy-session-id');
    }
    // Clear a cookie by name
    clearCookie(name) {
        document.cookie = `${name}=; Max-Age=0; Path=/;`;
    }
    initializeCookiesAndSendMessages() {
        const sessionId = this.getSessionCookie();
        const userId = this.getUserTrackingCookie();
        // Check if a user ID exists; if so, send it to the app
        if (userId) {
            console.log('Sending User ID to the app:', userId);
            this.msg.iframe.sendMessage({
                type: messenger_messages_1.USER_ID_MSG_TO_APP,
                payload: { userId },
            });
        }
        // Check if session ID exists, if not create and send a new one
        if (!sessionId) {
            const newSessionId = this.generateSessionId();
            this.setSessionCookie(newSessionId);
            this.msg.iframe.sendMessage({
                type: messenger_messages_1.SESSION_ID_MSG_TO_APP,
                payload: { sessionId: newSessionId },
            });
        }
        else {
            // Send the existing session ID to the app
            this.msg.iframe.sendMessage({
                type: messenger_messages_1.SESSION_ID_MSG_TO_APP,
                payload: { sessionId },
            });
        }
    }
    // Function to set an identified user ID, overwriting any existing value
    listenForIdentifyUser() {
        this.msg.onIdentifyUser(({ data }) => {
            const { payload: { userId }, } = data;
            this.setUserTrackingCookie(userId);
        });
    }
    // Listen for the user ID message from the app and set it in the cookie if not already set
    listenForNewUserId() {
        this.msg.onNewUserId(({ data }) => {
            const { payload: { userId }, } = data;
            const currentUserId = this.getUserTrackingCookie();
            if (!currentUserId) {
                this.setUserTrackingCookie(userId);
            }
        });
    }
    getCookie(name) {
        const cookies = document.cookie.split('; ');
        for (const cookie of cookies) {
            const [cookieName, value] = cookie.split('=');
            if (cookieName === name) {
                return value;
            }
        }
        return null;
    }
}
exports["default"] = CookiesManager;


/***/ }),

/***/ 392:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CLASSY_HREF = exports.CLASSY_ATTR = void 0;
exports.CLASSY_ATTR = 'classy';
exports.CLASSY_HREF = 'campaign';


/***/ }),

/***/ 758:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.strategyHandlers = void 0;
const currency_1 = __webpack_require__(318);
const params_utils_1 = __webpack_require__(386);
const handleDonationForm = (element) => __awaiter(void 0, void 0, void 0, function* () {
    try {
        yield Promise.resolve().then(() => __importStar(__webpack_require__(724)));
        const updateSelectedCurrency = (currencies, selectedCurrency) => {
            return currencies.map((currency) => (Object.assign(Object.assign({}, currency), { selected: currency.value === selectedCurrency })));
        };
        const getExchangeRate = (fromCurrency, toCurrency) => __awaiter(void 0, void 0, void 0, function* () {
            const response = yield fetch(`${"https://giving.classy.org/embedded"}/api/currency?fromCurrency=${fromCurrency}&toCurrency=${toCurrency}`);
            if (!response) {
                throw new Error('Failed to fetch config');
            }
            return yield response.json();
        });
        const donationForm = document.createElement('cl-donation-form');
        donationForm.setAttribute('campaign-id', element.campaignId);
        // Store original amounts in the base currency for accurate conversions
        let originalDonationAmounts = [];
        let originalRecurringAmounts = [];
        let originalMinimumDonationAmount;
        let baseCurrency = '';
        // Track current selection and custom "Other" amounts so we can convert them on currency change
        const selectedPresetNameByFrequency = {};
        const customAmountByFrequencyAndCurrency = {};
        let currentFrequency = null;
        let currentCurrency = null;
        if (element.config) {
            // if disable-multi-currency exists in the org tags, only pass the default currency from the list
            const { options, default: defaultValue } = element.config.props.currencies;
            let hasCurrencyTag = false;
            if (element.config.props.orgTags) {
                hasCurrencyTag = element.config.props.orgTags.some((t) => t.name === 'disable-multi-currency');
            }
            const currenciesOptions = hasCurrencyTag
                ? options.filter((c) => c.value === defaultValue)
                : options;
            // Store the base currency BEFORE updating the currencies object
            baseCurrency = defaultValue;
            currentCurrency = defaultValue;
            originalDonationAmounts = JSON.parse(JSON.stringify(element.config.props.donationAmounts));
            originalRecurringAmounts = JSON.parse(JSON.stringify(element.config.props.recurringAmounts));
            originalMinimumDonationAmount = element.config.props.minimumDonationAmount;
            // Track initial selected frequency (fallback to 'one-time' when not configured)
            const frequencies = element.config.props.donationFrequencies || [];
            const defaultFrequency = frequencies.find((f) => f.isDefault) || frequencies[0];
            if (defaultFrequency === null || defaultFrequency === void 0 ? void 0 : defaultFrequency.name) {
                currentFrequency = defaultFrequency.name;
            }
            else {
                currentFrequency = 'one-time';
            }
            element.config.props.currencies = updateSelectedCurrency(currenciesOptions, defaultValue);
        }
        // @ts-expect-error | Custom element custom attribute
        donationForm.config = element.config.props;
        const updateAmountsByCurrencyExchange = (arr, rate, selectedCurrency) => {
            return arr.map((item) => (Object.assign(Object.assign({}, item), { amount: (item.amount * rate).toFixed((0, currency_1.getCurrencyDecimalPlaces)(selectedCurrency)) })));
        };
        // Helper: Resolve frequency and currency with fallbacks
        const resolveFrequencyAndCurrency = (eventFrequency, eventCurrency) => {
            var _a, _b;
            return {
                frequency: eventFrequency || currentFrequency || 'one-time',
                currency: eventCurrency ||
                    currentCurrency ||
                    ((_b = (_a = element.config) === null || _a === void 0 ? void 0 : _a.props.currencies) === null || _b === void 0 ? void 0 : _b.default) ||
                    'USD',
            };
        };
        // Helper: Update preset amounts for a new currency
        const updatePresetAmountsForCurrency = (targetCurrency) => __awaiter(void 0, void 0, void 0, function* () {
            if (!element.config) {
                return;
            }
            const baseFromCurrency = baseCurrency || 'USD';
            const exchangeRate = yield getExchangeRate(baseFromCurrency, targetCurrency);
            element.config.props.donationAmounts = updateAmountsByCurrencyExchange(originalDonationAmounts, exchangeRate.rate, targetCurrency);
            element.config.props.recurringAmounts = updateAmountsByCurrencyExchange(originalRecurringAmounts, exchangeRate.rate, targetCurrency);
            element.config.props.currencies = updateSelectedCurrency(element.config.props.currencies, targetCurrency);
            if (typeof originalMinimumDonationAmount === 'number') {
                const decimals = (0, currency_1.getCurrencyDecimalPlaces)(targetCurrency);
                const convertedMinimum = Number((originalMinimumDonationAmount * exchangeRate.rate).toFixed(decimals));
                element.config.props.minimumDonationAmount = convertedMinimum;
            }
        });
        // Helper: Convert custom "Other" amounts and apply to form
        const updateCustomOtherAmountsForCurrency = (previousCurrency, targetCurrency) => __awaiter(void 0, void 0, void 0, function* () {
            const externalCustomOverrides = {};
            const customExchange = yield getExchangeRate(previousCurrency, targetCurrency);
            const customDecimals = (0, currency_1.getCurrencyDecimalPlaces)(targetCurrency);
            Object.entries(selectedPresetNameByFrequency).forEach(([frequency, presetName]) => {
                if (presetName !== 'other') {
                    return;
                }
                const perCurrencyCustom = customAmountByFrequencyAndCurrency[frequency];
                const previousCustom = perCurrencyCustom === null || perCurrencyCustom === void 0 ? void 0 : perCurrencyCustom[previousCurrency];
                if (typeof previousCustom !== 'number') {
                    return;
                }
                const convertedCustom = Number((previousCustom * customExchange.rate).toFixed(customDecimals));
                if (!customAmountByFrequencyAndCurrency[frequency]) {
                    customAmountByFrequencyAndCurrency[frequency] = {};
                }
                customAmountByFrequencyAndCurrency[frequency][targetCurrency] = convertedCustom;
                externalCustomOverrides[frequency] = convertedCustom;
            });
            if (Object.keys(externalCustomOverrides).length > 0) {
                // eslint-disable-next-line @typescript-eslint/no-explicit-any
                const formWithCustomAmounts = donationForm;
                formWithCustomAmounts.externalCustomAmounts = externalCustomOverrides;
            }
        });
        element.el.replaceWith(donationForm);
        // Store the replacement so it can be restored on destroy
        element.setReplacement(donationForm);
        // Subscribe to donation form submission
        donationForm.addEventListener('classy-donation-submit', (event) => {
            event.preventDefault();
            event.stopPropagation();
            const donationDetails = event.detail;
            const params = {};
            if (donationDetails.frequency) {
                params.frequency = donationDetails.frequency;
            }
            if (donationDetails.amount) {
                params.amount = donationDetails.amount;
            }
            if (donationDetails.recurringEndDate) {
                params.recurringEndDate = donationDetails.recurringEndDate;
            }
            if (donationDetails.selectedCurrency) {
                params.currency = donationDetails.selectedCurrency;
            }
            element.modalSDK.open(element.campaignId, params);
        });
        // Subscribe to frequency changes
        donationForm.addEventListener('frequency_change', (event) => {
            var _a, _b;
            const { from_frequency, to_frequency } = event.detail;
            if (to_frequency) {
                currentFrequency = to_frequency;
            }
            // Send to analytics (GA4/GTM) via the modal SDK or directly
            (_b = (_a = window.eg) === null || _a === void 0 ? void 0 : _a.sendAnalyticsEvent) === null || _b === void 0 ? void 0 : _b.call(_a, 'studio_grid_frequency_change', {
                from_frequency,
                to_frequency,
            });
        });
        // Subscribe to amount selection changes
        donationForm.addEventListener('amount_selected', (event) => {
            var _a, _b;
            const { from_amount, to_amount, preset_name, frequency: eventFrequency, currency: eventCurrency, } = event.detail || {};
            // Send to analytics (GA4/GTM) via the modal SDK or directly
            (_b = (_a = window.eg) === null || _a === void 0 ? void 0 : _a.sendAnalyticsEvent) === null || _b === void 0 ? void 0 : _b.call(_a, 'studio_grid_amount_change', {
                from_amount,
                to_amount,
            });
            const { frequency, currency } = resolveFrequencyAndCurrency(eventFrequency, eventCurrency);
            if (!frequency || to_amount == null) {
                return;
            }
            let resolvedPresetName = preset_name;
            if (!resolvedPresetName && element.config) {
                const numericToAmount = typeof to_amount === 'string' ? Number(to_amount) : to_amount;
                const isOneTime = frequency === 'one-time';
                const amountsSource = isOneTime
                    ? element.config.props.donationAmounts
                    : element.config.props.recurringAmounts;
                // The DonationForm component rounds preset amounts to whole numbers for display,
                // but the SDK stores converted amounts with decimals (e.g., '1076.40').
                // We need to round both sides when comparing to handle this mismatch.
                const roundedToAmount = Math.round(numericToAmount);
                const match = amountsSource === null || amountsSource === void 0 ? void 0 : amountsSource.find((item) => Math.round(Number(item.amount)) === roundedToAmount);
                resolvedPresetName = match === null || match === void 0 ? void 0 : match.name;
            }
            if (!resolvedPresetName) {
                resolvedPresetName = 'other';
            }
            selectedPresetNameByFrequency[frequency] = resolvedPresetName;
            if (resolvedPresetName === 'other') {
                const numericTo = typeof to_amount === 'string' ? Number(to_amount) : to_amount;
                if (!Number.isNaN(numericTo)) {
                    if (!customAmountByFrequencyAndCurrency[frequency]) {
                        customAmountByFrequencyAndCurrency[frequency] = {};
                    }
                    customAmountByFrequencyAndCurrency[frequency][currency] = numericTo;
                }
            }
        });
        // Subscribe to currency selection changes
        donationForm.addEventListener('currency_selected', (event) => __awaiter(void 0, void 0, void 0, function* () {
            var _a, _b, _c;
            if (!element.config) {
                return;
            }
            const { from_currency, to_currency } = event.detail;
            const targetCurrency = to_currency;
            const previousCurrency = from_currency || currentCurrency || baseCurrency || 'USD';
            // Update currentCurrency BEFORE setting the config to ensure that any
            // amount_selected events dispatched by the form during config update
            // use the correct currency for tracking.
            currentCurrency = targetCurrency;
            yield updatePresetAmountsForCurrency(targetCurrency);
            // @ts-expect-error | Custom element custom attribute
            donationForm.config = ((_a = element.config) === null || _a === void 0 ? void 0 : _a.props) || {};
            // Send to analytics (GA4/GTM) via the modal SDK or directly
            (_c = (_b = window.eg) === null || _b === void 0 ? void 0 : _b.sendAnalyticsEvent) === null || _c === void 0 ? void 0 : _c.call(_b, 'studio_grid_currency_change', {
                from_currency,
                to_currency: targetCurrency,
            });
            // If there are frequencies where the selected preset is the custom "Other"
            // option, convert their stored custom values from the previous currency into
            // the new currency and push all of them into the web component via the
            // externalCustomAmounts API.
            try {
                yield updateCustomOtherAmountsForCurrency(previousCurrency, targetCurrency);
            }
            catch (_d) {
                // If conversion for the custom amounts fails, we still keep the rest
                // of the currency change behavior working.
            }
        }));
    }
    catch (error) {
        console.error('Error replacing element with donation form:', error);
    }
});
const handleClassyHref = (element) => {
    element.el.addEventListener('click', (event) => {
        event.preventDefault();
        const href = element.el.getAttribute('href');
        if (href) {
            const params = (0, params_utils_1.extractClassyParamsFromHref)(href);
            element.modalSDK.open(element.campaignId, params);
        }
    });
};
const handleDefault = () => {
    console.log('Default strategy: no specific action taken.');
};
exports.strategyHandlers = {
    donationForm: handleDonationForm,
    classyHref: handleClassyHref,
    default: handleDefault,
};


/***/ }),

/***/ 989:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const crawler_constants_1 = __webpack_require__(392);
const crawler_element_strategies_1 = __webpack_require__(758);
class CrawlerElement {
    constructor(props) {
        this.destroyed = false;
        this.originalElement = null;
        this.replacementElement = null;
        this.isClassyHref = () => {
            const href = this.props.el.getAttribute('href');
            return !!(href && href.indexOf(crawler_constants_1.CLASSY_HREF) !== -1);
        };
        this.props = props;
        this.applyStrategy();
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        // Restore the original element if it was replaced
        // This allows the Crawler to find it again on reinit
        if (this.originalElement && this.replacementElement && this.replacementElement.parentNode) {
            this.replacementElement.parentNode.replaceChild(this.originalElement, this.replacementElement);
        }
    }
    /**
     * Called by strategies when they replace the original element.
     * Stores references so we can restore on destroy.
     */
    setReplacement(replacement) {
        this.originalElement = this.props.el;
        this.replacementElement = replacement;
    }
    get campaignId() {
        return this.props.campaignId;
    }
    get config() {
        return this.props.config;
    }
    get el() {
        return this.props.el;
    }
    get modalSDK() {
        return this.props.modalSDK;
    }
    applyStrategy() {
        var _a;
        /**
         * We currently allow href elements (i.e a button) to be defined
         * by the client (i.e won't have a corresponding config saved).
         *
         * So we check for these style of components first otherwise we'll get the type
         * from the config.
         */
        if (this.isClassyHref()) {
            return crawler_element_strategies_1.strategyHandlers['classyHref'](this);
        }
        else if (((_a = this.props.config) === null || _a === void 0 ? void 0 : _a.type) === 'inline-donation-grid') {
            crawler_element_strategies_1.strategyHandlers['donationForm'](this);
        }
        else {
            crawler_element_strategies_1.strategyHandlers['default'](this);
        }
    }
}
exports["default"] = CrawlerElement;


/***/ }),

/***/ 560:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const crawler_constants_1 = __webpack_require__(392);
const crawler_element_1 = __importDefault(__webpack_require__(989));
const config_utils_1 = __webpack_require__(862);
class Crawler {
    constructor(props) {
        this.elements = [];
        this.destroyed = false;
        // Handle org. defined anchor elements with `?campaign` url parameter
        this._initOrgElements = () => {
            const els = document.querySelectorAll(`a[href*=${crawler_constants_1.CLASSY_HREF}]`);
            els.forEach((el) => {
                const href = el.getAttribute('href');
                if (!href) {
                    return;
                }
                const campaignId = this._extractCampaignId(href);
                if (!campaignId) {
                    return;
                }
                this.elements.push(new crawler_element_1.default({
                    el,
                    campaignId,
                    config: null,
                    win: this.props.win,
                    modalSDK: this.props.modalSDK,
                }));
            });
        };
        this._extractCampaignId = (url) => {
            // Check if the string starts directly with "campaign="
            if (url.startsWith(`${crawler_constants_1.CLASSY_HREF}=`)) {
                return url.split('=')[1] || null;
            }
            // Check if the string starts with "/?" or just "?"
            if (url.startsWith('/?') || url.startsWith('?')) {
                url = 'https://placeholder.com' + url;
            }
            // Parse the URL and attempt to retrieve the 'campaign' parameter
            try {
                const urlObj = new URL(url);
                return urlObj.searchParams.get(crawler_constants_1.CLASSY_HREF);
            }
            catch (_) {
                return null;
            }
        };
        // Handle classy elements
        this._initClassyElements = () => __awaiter(this, void 0, void 0, function* () {
            const els = document.querySelectorAll(`[${crawler_constants_1.CLASSY_ATTR}]`);
            if (!els.length) {
                return;
            }
            const configs = yield this.props.configs;
            els.forEach((el) => {
                const id = el.getAttribute('id');
                const campaignId = el.getAttribute(crawler_constants_1.CLASSY_ATTR);
                if (!id) {
                    return null;
                }
                const config = campaignId ? configs[campaignId] : null;
                if (!campaignId || !config) {
                    return;
                }
                this.props.modalSDK.setConfig(config);
                const elementConfig = this.getElementConfig(id, config);
                if (!elementConfig) {
                    return;
                }
                this.elements.push(new crawler_element_1.default({
                    el,
                    config: elementConfig,
                    campaignId,
                    win: this.props.win,
                    modalSDK: this.props.modalSDK,
                }));
            });
        });
        this.getElementConfig = (id, config) => {
            var _a, _b;
            const elementConfig = config.components[id];
            /**
             * For the inline-donation-grid component, we want to use
             * the non-visual props from the checkout-form component.
             */
            if ((elementConfig === null || elementConfig === void 0 ? void 0 : elementConfig.type) === 'inline-donation-grid') {
                const checkoutDonationFormSection = (0, config_utils_1.getComponentSectionByType)('checkout', 'donation-form', config);
                if (checkoutDonationFormSection) {
                    return Object.assign(Object.assign({}, elementConfig), { props: Object.assign(Object.assign({}, elementConfig.props), { minimumDonationAmount: config.minimum_donation_amount, donationAmounts: checkoutDonationFormSection.props.donationAmounts, donationFrequencies: checkoutDonationFormSection.props.donationFrequencies, hideRecurringEndDate: ((_a = config.intelligentAsksConfig) === null || _a === void 0 ? void 0 : _a.is_enabled)
                                ? true
                                : checkoutDonationFormSection.props.hideRecurringEndDate, recurringAmounts: checkoutDonationFormSection.props.recurringAmounts, currencies: config.currency, orgTags: config.orgTags, showRecurringUpsell: ((_b = config.intelligentAsksConfig) === null || _b === void 0 ? void 0 : _b.is_enabled) &&
                                config.iaa.status === 200 &&
                                config.iaa.data.showRecurringUpsell
                                ? true
                                : false }) });
                }
            }
            return elementConfig;
        };
        this.props = props;
        this._initElements();
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        this.elements.forEach((el) => {
            if (typeof el.destroy === 'function') {
                el.destroy();
            }
        });
        this.elements = [];
    }
    _initElements() {
        return __awaiter(this, void 0, void 0, function* () {
            this._initOrgElements();
            this._initClassyElements();
        });
    }
}
exports["default"] = Crawler;


/***/ }),

/***/ 311:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const colors_1 = __webpack_require__(369);
const mParticle_1 = __importDefault(__webpack_require__(659));
const daoCache = {
    config: {},
};
class DAO {
    constructor(props) {
        this.destroyed = false;
        this.fetchConfigs = (campaignIds, sessionId, userId) => __awaiter(this, void 0, void 0, function* () {
            const promises = campaignIds.map((id) => this.fetchConfig(id, sessionId, userId));
            return Promise.allSettled(promises).then((results) => {
                results
                    .filter((result) => result.status === 'rejected')
                    .forEach((result, index) => {
                    console.error(`Failed to fetch campaign ${campaignIds[index]} failed:`, result.reason);
                });
                return results
                    .filter((result) => result.status === 'fulfilled')
                    .map((result) => result.value);
            });
        });
        // PS. Mutates the config
        this._adjustConfigTheme = (config) => {
            const theme = config.theme;
            const primaryColor = theme['--theme-color__brand-primary'];
            const secondaryColor = primaryColor
                ? (0, colors_1.isHexColor)(primaryColor)
                    ? (0, colors_1.convertRgbToRGBA)((0, colors_1.convertHexToRGB)(primaryColor), 0.1)
                    : (0, colors_1.convertRgbToRGBA)(primaryColor, 0.1)
                : '';
            for (const key in config.components) {
                const component = config.components[key];
                if (component.type === 'inline-donation-grid') {
                    const props = component.props;
                    if (props && !props.primaryColor) {
                        props.primaryColor = primaryColor; // Update primaryColor if empty
                    }
                    if (props && !props.secondaryColor) {
                        props.secondaryColor = (0, colors_1.convertRgbOrRgbaToHex)(secondaryColor); // Update secondaryColor if empty
                    }
                }
            }
            return config;
        };
        this._getIAATiles = (iaaAmounts, hasOtherValue) => {
            const configAmountsWithIAA = [];
            for (let i = 0; i < iaaAmounts.length; i++) {
                configAmountsWithIAA.push({
                    name: `preset${i + 1}`,
                    amount: iaaAmounts[i],
                    isVisible: true,
                    isDefault: false,
                });
            }
            if (hasOtherValue) {
                configAmountsWithIAA.push({
                    name: 'other',
                    amount: 0,
                    isVisible: true,
                    isDefault: false,
                });
            }
            return configAmountsWithIAA;
        };
        this._adjustDefaultFrequency = (configFrequencies, isDefaultRecurring) => {
            configFrequencies.forEach((frequency) => {
                if (frequency.name === 'one-time') {
                    frequency.isDefault = !isDefaultRecurring;
                }
                if (frequency.name !== 'one-time' && frequency.isVisible) {
                    frequency.isDefault = isDefaultRecurring !== null && isDefaultRecurring !== void 0 ? isDefaultRecurring : false;
                }
            });
        };
        // PS. Mutates the config
        this._adjustConfigWithIAA = (config) => {
            var _a, _b, _c, _d, _e, _f, _g, _h;
            const iaaValues = config.iaa;
            if (iaaValues.status !== 200) {
                return config;
            }
            if (config.iaaConfig.useIntelligentAskOnetime === true ||
                ((_a = config.intelligentAsksConfig) === null || _a === void 0 ? void 0 : _a.is_enabled)) {
                for (const key in config.components) {
                    const component = config.components[key];
                    if (component.type === 'inline-donation-grid') {
                        const props = component.props;
                        props.donationAmounts = this._getIAATiles((_b = iaaValues.data.suggestedOnetimeAmounts) !== null && _b !== void 0 ? _b : [], Boolean(props.donationAmounts.find((tile) => tile.name === 'other')));
                        if ((_c = config.intelligentAsksConfig) === null || _c === void 0 ? void 0 : _c.is_enabled) {
                            this._adjustDefaultFrequency(props.donationFrequencies, iaaValues.data.isDefaultRecurring);
                        }
                    }
                    if (component.type === 'checkout' && component.sections) {
                        for (const key in component.sections) {
                            if (component.sections[key].type === 'donation-form') {
                                const props = component.sections[key].props;
                                props.donationAmounts = this._getIAATiles((_d = iaaValues.data.suggestedOnetimeAmounts) !== null && _d !== void 0 ? _d : [], Boolean(props.donationAmounts.find((tile) => tile.name === 'other')));
                                if ((_e = config.intelligentAsksConfig) === null || _e === void 0 ? void 0 : _e.is_enabled) {
                                    this._adjustDefaultFrequency(props.donationFrequencies, iaaValues.data.isDefaultRecurring);
                                }
                            }
                        }
                    }
                }
            }
            if (config.iaaConfig.useIntelligentAskRecurring === true ||
                ((_f = config.intelligentAsksConfig) === null || _f === void 0 ? void 0 : _f.is_enabled)) {
                for (const key in config.components) {
                    const component = config.components[key];
                    if (component.type === 'inline-donation-grid') {
                        const props = component.props;
                        props.recurringAmounts = this._getIAATiles((_g = iaaValues.data.suggestedRecurringAmounts) !== null && _g !== void 0 ? _g : [], Boolean(props.recurringAmounts.find((tile) => tile.name === 'other')));
                    }
                    if (component.type === 'checkout' && component.sections) {
                        for (const key in component.sections) {
                            if (component.sections[key].type === 'donation-form') {
                                const props = component.sections[key].props;
                                props.recurringAmounts = this._getIAATiles((_h = iaaValues.data.suggestedRecurringAmounts) !== null && _h !== void 0 ? _h : [], Boolean(props.recurringAmounts.find((tile) => tile.name === 'other')));
                            }
                        }
                    }
                }
            }
            return config;
        };
        this._setCampaignLocale = (locale) => {
            document.cookie = `i18next=${locale}`;
        };
        this._addMparticleConfig = (config) => {
            try {
                config.mParticleConfig = {
                    deviceId: mParticle_1.default.getDeviceId(),
                };
            }
            catch (error) {
                console.error('Error getting MParticle instance:', error);
            }
            return config;
        };
        this.props = props;
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
    }
    fetchConfig(campaignId, sessionId, userId) {
        var _a, _b, _c;
        return __awaiter(this, void 0, void 0, function* () {
            if (daoCache.config[campaignId]) {
                return daoCache.config[campaignId];
            }
            /**
             * TODO: Once https://classydev.atlassian.net/browse/CL-46263 is completed
             * we'll update this logic to set the selected currency.
             */
            const currency = 'USD';
            const screenHeight = ((_a = window === null || window === void 0 ? void 0 : window.screen) === null || _a === void 0 ? void 0 : _a.height) || 0;
            const screenWidth = ((_b = window === null || window === void 0 ? void 0 : window.screen) === null || _b === void 0 ? void 0 : _b.width) || 0;
            const locale = navigator.language;
            const queryParams = new URLSearchParams({
                published: '1',
                clickSource: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.origin,
                screenHeight: String(screenHeight),
                screenWidth: String(screenWidth),
                locale,
                currency,
            });
            if (sessionId) {
                queryParams.append('sessionId', sessionId);
            }
            if (userId) {
                queryParams.append('heapId', userId);
            }
            const response = yield this.props.win.fetch(`${"https://giving.classy.org/embedded"}/api/sdk-config/campaigns/${campaignId}?${queryParams}`);
            if (!response.ok) {
                throw new Error('Failed to fetch config');
            }
            const configData = yield response.json();
            this._setCampaignLocale(configData.data.locale || 'en');
            let config = this._adjustConfigTheme(configData.data);
            config = this._adjustConfigWithIAA(config);
            config = this._addMparticleConfig(config);
            daoCache.config[campaignId] = config;
            return config;
        });
    }
}
exports["default"] = DAO;


/***/ }),

/***/ 156:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LifecycleManager = void 0;
const abandon_cart_nudge_tray_ctrl_1 = __importDefault(__webpack_require__(60));
const AnalyticsManager_1 = __importDefault(__webpack_require__(604));
const config_service_1 = __importDefault(__webpack_require__(664));
const CookiesManager_1 = __importDefault(__webpack_require__(672));
const crawler_1 = __importDefault(__webpack_require__(560));
const messenger_1 = __importDefault(__webpack_require__(963));
const modal_ctrl_1 = __importDefault(__webpack_require__(16));
const lifecycle_1 = __webpack_require__(439);
Object.defineProperty(exports, "LifecycleManager", ({ enumerable: true, get: function () { return lifecycle_1.LifecycleManager; } }));
const script_params_1 = __webpack_require__(869);
__webpack_require__(910);
// Capture the script URL params at load time (document.currentScript is only available during initial execution)
const skipAutoInit = typeof window !== 'undefined' ? (0, script_params_1.shouldSkipAutoInit)() : false;
function legacyInit(win) {
    const msg = new messenger_1.default({ win });
    const cookiesManager = new CookiesManager_1.default({ msg });
    const configService = new config_service_1.default({ win, cookiesManager });
    const configs = configService.fetch();
    const modalCtrl = new modal_ctrl_1.default({ win, msg, configs });
    const modalSDK = modalCtrl.sdk();
    new abandon_cart_nudge_tray_ctrl_1.default({ win, msg, modalSDK, configs });
    new crawler_1.default({ win, cookiesManager, modalSDK, configs });
    const analytics = new AnalyticsManager_1.default({ win });
    analytics.initialize();
    analytics.setupEventListener();
    // Extend window.eg with modal and analytics (legacy API)
    if (win.eg) {
        win.eg.modal = modalSDK;
        win.eg.sendAnalyticsEvent = (eventName, eventData) => {
            analytics.sendEvent(eventName, eventData);
        };
    }
}
if (typeof window !== 'undefined') {
    // Initialize window.eg with lifecycle API
    // @ts-ignore - we're building up the object
    window.eg = {
        init: (config) => lifecycle_1.LifecycleManager.init(config),
        destroy: () => lifecycle_1.LifecycleManager.destroy(),
        isInitialized: () => lifecycle_1.LifecycleManager.isInitialized(),
    };
    // Only run legacyInit if manual init is not requested via ?manualInit=true
    // This allows SPA applications to control initialization via eg.init()
    if (!skipAutoInit) {
        legacyInit(window);
    }
}


/***/ }),

/***/ 439:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/**
 * Lifecycle Manager - Singleton for SDK initialization and cleanup
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LifecycleManager = void 0;
const operation_queue_1 = __webpack_require__(435);
const sdk_error_1 = __webpack_require__(48);
class LifecycleManagerImpl {
    constructor() {
        this.state = 'uninitialized';
        this.currentInstance = null;
        this.pendingInit = null;
        this.config = {};
        this.modules = {};
        this.queue = new operation_queue_1.OperationQueue();
        this.targetWindow = null;
    }
    init(config = {}) {
        return __awaiter(this, void 0, void 0, function* () {
            if (this.pendingInit) {
                return this.pendingInit;
            }
            if (this.state === 'initialized' && this.currentInstance) {
                if (config.onError) {
                    config.onError((0, sdk_error_1.createSDKError)('ALREADY_INITIALIZED', 'SDK is already initialized'));
                }
                return this.currentInstance;
            }
            this.config = config;
            this.targetWindow = config.win || window;
            this.pendingInit = this.queue.enqueue(() => __awaiter(this, void 0, void 0, function* () {
                try {
                    this.state = 'initializing';
                    const instance = yield this.initializeModules();
                    this.state = 'initialized';
                    this.currentInstance = instance;
                    if (config.onReady) {
                        config.onReady();
                    }
                    return instance;
                }
                catch (error) {
                    this.state = 'uninitialized';
                    const sdkError = error instanceof Error
                        ? (0, sdk_error_1.createSDKError)('INIT_FAILED', error.message)
                        : (0, sdk_error_1.createSDKError)('INIT_FAILED', 'Unknown initialization error');
                    if (config.onError) {
                        config.onError(sdkError);
                    }
                    throw sdkError;
                }
                finally {
                    this.pendingInit = null;
                }
            }));
            return this.pendingInit;
        });
    }
    destroy() {
        var _a;
        if (this.state === 'uninitialized' || this.state === 'destroying') {
            return;
        }
        this.state = 'destroying';
        try {
            this.cleanupModules();
            // Clean up modal and analytics from window.eg, but keep lifecycle methods
            if ((_a = this.targetWindow) === null || _a === void 0 ? void 0 : _a.eg) {
                delete this.targetWindow.eg.modal;
                delete this.targetWindow.eg.sendAnalyticsEvent;
            }
            this.currentInstance = null;
            this.modules = {};
            this.state = 'uninitialized';
        }
        catch (error) {
            this.state = 'uninitialized';
        }
    }
    isInitialized() {
        return this.state === 'initialized';
    }
    getState() {
        return this.state;
    }
    initializeModules() {
        return __awaiter(this, void 0, void 0, function* () {
            const win = this.targetWindow;
            // Dynamic imports to avoid circular dependencies
            const { default: Messenger } = yield Promise.resolve().then(() => __importStar(__webpack_require__(963)));
            const { default: CookiesManager } = yield Promise.resolve().then(() => __importStar(__webpack_require__(672)));
            const { default: ConfigService } = yield Promise.resolve().then(() => __importStar(__webpack_require__(664)));
            const { default: ModalCtrl } = yield Promise.resolve().then(() => __importStar(__webpack_require__(16)));
            const { default: AbandonCartNudgeTrayCtrl } = yield Promise.resolve().then(() => __importStar(__webpack_require__(60)));
            const { default: Crawler } = yield Promise.resolve().then(() => __importStar(__webpack_require__(560)));
            const { default: AnalyticsManager } = yield Promise.resolve().then(() => __importStar(__webpack_require__(604)));
            const msg = new Messenger({ win });
            this.modules.messenger = msg;
            const cookiesManager = new CookiesManager({ msg });
            this.modules.cookiesManager = cookiesManager;
            const configService = new ConfigService({ win, cookiesManager });
            const configs = configService.fetch();
            this.modules.configService = configService;
            const modalCtrl = new ModalCtrl({ win, msg, configs });
            this.modules.modalCtrl = modalCtrl;
            const modalSDK = modalCtrl.sdk();
            const abandonCartNudgeTray = new AbandonCartNudgeTrayCtrl({ win, msg, modalSDK, configs });
            this.modules.abandonCartNudgeTray = abandonCartNudgeTray;
            const crawler = new Crawler({ win, cookiesManager, modalSDK, configs });
            this.modules.crawler = crawler;
            const analytics = new AnalyticsManager({ win });
            analytics.initialize();
            analytics.setupEventListener();
            this.modules.analytics = analytics;
            const instance = this.createSDKInstance(modalSDK, analytics);
            // Extend window.eg with modal and analytics, preserving lifecycle methods
            const egApi = win.eg;
            if (egApi) {
                egApi.modal = this.createProxiedModal(modalSDK);
                egApi.sendAnalyticsEvent = this.createProxiedAnalytics(analytics);
            }
            return instance;
        });
    }
    createSDKInstance(modalSDK, analytics) {
        return {
            modal: modalSDK,
            sendAnalyticsEvent: (name, data) => {
                if (!this.isInitialized()) {
                    throw (0, sdk_error_1.createSDKError)('NOT_INITIALIZED', 'SDK has been destroyed');
                }
                analytics.sendEvent(name, data);
            },
            destroy: () => this.destroy(),
            reinit: (newConfig) => {
                this.destroy();
                return this.initSync(newConfig || this.config);
            },
            isInitialized: () => this.isInitialized(),
        };
    }
    initSync(config) {
        this.init(config);
        return this.currentInstance;
    }
    createProxiedModal(modalSDK) {
        const isInitialized = () => this.isInitialized();
        return new Proxy(modalSDK, {
            get(target, prop) {
                if (!isInitialized()) {
                    throw (0, sdk_error_1.createSDKError)('NOT_INITIALIZED', 'SDK has been destroyed');
                }
                return target[prop];
            },
        });
    }
    createProxiedAnalytics(analytics) {
        return (name, data) => {
            if (!this.isInitialized()) {
                throw (0, sdk_error_1.createSDKError)('NOT_INITIALIZED', 'SDK has been destroyed');
            }
            analytics.sendEvent(name, data);
        };
    }
    cleanupModules() {
        const cleanupOrder = [
            'abandonCartNudgeTray',
            'crawler',
            'analytics',
            'modalCtrl',
            'configService',
            'cookiesManager',
            'messenger',
        ];
        for (const key of cleanupOrder) {
            const module = this.modules[key];
            if (module && typeof module.destroy === 'function') {
                try {
                    module.destroy();
                }
                catch (e) {
                    console.error(`[eg] Failed to destroy ${key}:`, e);
                }
            }
        }
    }
}
exports.LifecycleManager = new LifecycleManagerImpl();


/***/ }),

/***/ 435:
/***/ (function(__unused_webpack_module, exports) {

"use strict";

/**
 * Operation Queue for handling concurrency in lifecycle operations
 */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.OperationQueue = void 0;
class OperationQueue {
    constructor() {
        this.queue = [];
        this.processing = false;
        this.lastOperationTime = 0;
        this.RAPID_CYCLE_THRESHOLD_MS = 100;
    }
    enqueue(operation) {
        return __awaiter(this, void 0, void 0, function* () {
            return new Promise((resolve, reject) => {
                const queuedOp = {
                    operation,
                    resolve,
                    reject,
                    cancelled: false,
                };
                this.queue.push(queuedOp);
                this.trackTiming();
                this.processQueue();
            });
        });
    }
    cancelPending() {
        this.queue.forEach((op) => {
            op.cancelled = true;
            op.reject(new Error('Operation cancelled'));
        });
        this.queue = [];
    }
    isRapidCycle() {
        const now = Date.now();
        return now - this.lastOperationTime < this.RAPID_CYCLE_THRESHOLD_MS;
    }
    get pendingCount() {
        return this.queue.length;
    }
    trackTiming() {
        this.lastOperationTime = Date.now();
    }
    processQueue() {
        return __awaiter(this, void 0, void 0, function* () {
            if (this.processing || this.queue.length === 0) {
                return;
            }
            this.processing = true;
            while (this.queue.length > 0) {
                const queuedOp = this.queue.shift();
                if (!queuedOp || queuedOp.cancelled) {
                    continue;
                }
                try {
                    const result = yield queuedOp.operation();
                    if (!queuedOp.cancelled) {
                        queuedOp.resolve(result);
                    }
                }
                catch (error) {
                    if (!queuedOp.cancelled) {
                        queuedOp.reject(error);
                    }
                }
            }
            this.processing = false;
        });
    }
}
exports.OperationQueue = OperationQueue;


/***/ }),

/***/ 48:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

/**
 * SDK Error Factory
 * Creates consistent error objects with logging
 */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isSDKError = exports.createSDKError = void 0;
const RECOVERABLE_CODES = [
    'IFRAME_LOAD_TIMEOUT',
    'INIT_FAILED',
    'ALREADY_INITIALIZED',
];
const LOG_PREFIX = '[eg]';
class SDKErrorImpl extends Error {
    constructor(code, message, recoverable, context) {
        super(message);
        this.name = 'SDKError';
        this.code = code;
        this.recoverable = recoverable;
        this.context = context;
        Object.setPrototypeOf(this, SDKErrorImpl.prototype);
    }
}
function createSDKError(code, message, context) {
    const recoverable = RECOVERABLE_CODES.includes(code);
    const error = new SDKErrorImpl(code, message, recoverable, context);
    console.error(`${LOG_PREFIX} ${code}: ${message}`, context || '');
    return error;
}
exports.createSDKError = createSDKError;
function isSDKError(error) {
    return error instanceof SDKErrorImpl;
}
exports.isSDKError = isSDKError;


/***/ }),

/***/ 659:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
class MParticle {
    static generateUUIDv2(uid, domain) {
        uid = uid || 1000; // Default UID
        domain = domain || 0; // Domain (0 = person, 1 = group, etc.)
        // Offset from Unix epoch (1970) to Gregorian epoch (1582)
        const gregorianOffset = 12219292800000;
        // Time since Gregorian epoch in 100ns intervals
        const timeNow = Date.now() + gregorianOffset;
        const timestamp100ns = timeNow * 10000;
        // Break timestamp into parts (simulate 60-bit timestamp)
        const timeLow = uid & 0xffffffff; // Replaced with UID
        const timeMid = (timestamp100ns / Math.pow(2, 32)) & 0xffff;
        let timeHi = (timestamp100ns / Math.pow(2, 48)) & 0x0fff;
        timeHi |= 2 << 12; // Set version to 2
        // Generate 14-bit clock sequence with variant bits
        const clockSeqHi = Math.floor(Math.random() * 0x40) | 0x80; // variant 10xx xxxx
        const clockSeqLow = Math.floor(Math.random() * 0x100);
        // Node (MAC or random 6 bytes)
        const node = [];
        for (let i = 0; i < 6; i++) {
            node.push(Math.floor(Math.random() * 256));
        }
        function hex(n, width) {
            let s = n.toString(16);
            while (s.length < width) {
                s = '0' + s;
            }
            return s;
        }
        return [
            hex(timeLow, 8),
            hex(timeMid, 4),
            hex(timeHi, 4),
            hex(clockSeqHi, 2) + hex(clockSeqLow, 2),
            node
                .map(function (b) {
                return hex(b, 2);
            })
                .join(''),
        ].join('-');
    }
}
_a = MParticle;
// Static cookie name for mParticle device id
MParticle.mParticleCookieName = 'gfmUserId';
MParticle.getDeviceId = () => {
    // Check if we have a custom mParticle cookie with a device id
    const mParticleCookie = document.cookie
        .split('; ')
        .find((cookie) => cookie.startsWith(`${_a.mParticleCookieName}=`));
    if (mParticleCookie) {
        const deviceId = mParticleCookie.split('=')[1];
        return deviceId;
    }
    // Otherwise, create the cookie with a random UUIDv2 format and return it
    const deviceId = _a.generateUUIDv2();
    document.cookie = `${_a.mParticleCookieName}=${deviceId}; Path=/; SameSite=Lax;${ true ? ' Secure;' : 0}`;
    return deviceId;
};
exports["default"] = MParticle;


/***/ }),

/***/ 205:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const messenger_messages_1 = __webpack_require__(681);
/**
 * Utility class to send messages to the app's iframe.
 *
 * It's important that we listen for a handshake event (DONATION_READY_MSG_FROM_APP) before
 * we send events across. The iframe can be loading and the application still mounting otherwise.
 */
class MessengerIframe {
    constructor() {
        this.isAppReady = false;
        this.eventQueue = [];
        /**
         * Registers the iframe and marks it as available to receive messages.
         *
         * @param iframe - The iframe element where messages will be sent
         */
        this.register = (iframe) => {
            this.iframe = iframe;
            /**
             * If the app is immediately ready, flush the queue.
             */
            if (this.isAppReady) {
                this._flushQueue();
            }
        };
        /**
         * Resets the iframe messenger by clearing the iframe reference and resetting state.
         * Should be called when the iframe is closed.
         */
        this.reset = () => {
            this.iframe = undefined;
            this.isAppReady = false;
            this.eventQueue = [];
        };
        /**
         * Sends a message to the iframe immediately if the app is ready, otherwise queues it.
         *
         * @param message - The message to send to the iframe
         */
        this.sendMessage = (message) => {
            var _a;
            if (this.isAppReady && ((_a = this.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow)) {
                this._postMessage(message);
            }
            else {
                this._queueMessage(message);
            }
        };
        /**
         * Queues a message if the iframe is not ready to receive it.
         *
         * @param message - The message to queue until the app is ready
         */
        this._queueMessage = (message) => {
            this.eventQueue.push(message);
        };
        /**
         * Flushes the queue and sends all queued messages once the app is ready.
         */
        this._flushQueue = () => {
            var _a;
            if (this.isAppReady && ((_a = this.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow)) {
                while (this.eventQueue.length > 0) {
                    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
                    const message = this.eventQueue.shift();
                    this._postMessage(message);
                }
            }
        };
        /**
         * Sends a message to the iframe's content window.
         *
         * @param message - The message to send to the iframe
         */
        this._postMessage = (message) => {
            var _a;
            if ((_a = this.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow) {
                this.iframe.contentWindow.postMessage(message, '*');
            }
        };
        this.setAppReady = () => {
            this.isAppReady = true;
        };
        this.sendSDKInitMessage = (config) => {
            const safeguardToken = "insectsdofly";
            // Send the initialization message once the app is ready
            this._postMessage({
                type: messenger_messages_1.SDK_INIT,
                payload: {
                    safeguardToken,
                    iaa: config.iaa,
                    mParticleConfig: config.mParticleConfig,
                },
            });
            // Flush any messages that were queued while waiting for the app to be ready
            this._flushQueue();
        };
    }
}
exports["default"] = MessengerIframe;


/***/ }),

/***/ 681:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.IDENTIFY_USER_MESSAGE_FROM_APP = exports.USER_ID_MSG_TO_APP = exports.SESSION_ID_MSG_TO_APP = exports.NEW_USER_ID_MSG_FROM_APP = exports.SDK_INIT = exports.EMBEDDED_APP_VISIBLE = exports.DONATION_COMPLETED_MSG_FROM_APP = exports.DONATION_CHANGED_MSG_FROM_APP = exports.DONATION_READY_MSG_FROM_APP = exports.ANALYTICS_EVENT_MSG_FROM_APP = exports.GA4_INIT_MSG_FROM_APP = void 0;
exports.GA4_INIT_MSG_FROM_APP = 'GA4_INIT_MSG_FROM_APP';
exports.ANALYTICS_EVENT_MSG_FROM_APP = 'ANALYTICS_EVENT_MSG_FROM_APP';
exports.DONATION_READY_MSG_FROM_APP = 'DONATION_READY_MSG_FROM_APP';
exports.DONATION_CHANGED_MSG_FROM_APP = 'DONATION_CHANGED_MSG_FROM_APP';
exports.DONATION_COMPLETED_MSG_FROM_APP = 'DONATION_COMPLETED_MSG_FROM_APP';
exports.EMBEDDED_APP_VISIBLE = 'EMBEDDED_APP_VISIBLE'; // Used to signify the modal is open and visible to the user
exports.SDK_INIT = 'SDK_INIT';
exports.NEW_USER_ID_MSG_FROM_APP = 'NEW_USER_ID_MSG_FROM_APP';
exports.SESSION_ID_MSG_TO_APP = 'SESSION_ID_MSG_TO_APP';
exports.USER_ID_MSG_TO_APP = 'USER_ID_MSG_TO_APP';
exports.IDENTIFY_USER_MESSAGE_FROM_APP = 'IDENTIFY_USER_MESSAGE_FROM_APP';


/***/ }),

/***/ 963:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const pubsub_1 = __importDefault(__webpack_require__(179));
const messenger_iframe_1 = __importDefault(__webpack_require__(205));
const messenger_messages_1 = __webpack_require__(681);
/**
 * Messenger class responsible for handling postMessage events between the app and the iframe,
 * and initializing the MessengerIframe class to handle queued messages.
 */
class Messenger {
    constructor(props) {
        this.messageListener = null;
        this.destroyed = false;
        this._subscribe = () => {
            this.messageListener = (event) => {
                const trustedOrigin = "https://giving.classy.org/embedded";
                if (event.origin !== location.origin && trustedOrigin.indexOf(event.origin) === -1) {
                    console.warn('Untrusted origin:', event.origin);
                    return;
                }
                if (!event.data) {
                    return;
                }
                const { type, payload } = event.data;
                if (type && payload) {
                    this.pubsub.publish({ name: type, data: { type, payload } });
                }
            };
            this.props.win.addEventListener('message', this.messageListener);
        };
        /**
         * Subscribes to GA4 initialization messages.
         *
         * @param callback - The function to handle GA4 init messages
         */
        this.onGA4Init = (callback) => {
            this.pubsub.subscribe(messenger_messages_1.GA4_INIT_MSG_FROM_APP, callback);
        };
        /**
         * Subscribes to analytics event messages.
         *
         * @param callback - The function to handle analytics event messages
         */
        this.onAnalyticsEvent = (callback) => {
            this.pubsub.subscribe(messenger_messages_1.ANALYTICS_EVENT_MSG_FROM_APP, callback);
        };
        /**
         * Subscribes to donation ready messages and passes the callback to MessengerIframe.
         *
         * @param callback - The function to handle donation ready messages
         */
        this.onDonationReady = (callback) => {
            this.pubsub.subscribe(messenger_messages_1.DONATION_READY_MSG_FROM_APP, callback);
        };
        /**
         * Subscribes to donation changed messages.
         *
         * @param callback - The function to handle donation changed messages
         */
        this.onDonationChanged = (callback) => {
            this.pubsub.subscribe(messenger_messages_1.DONATION_CHANGED_MSG_FROM_APP, callback);
        };
        /**
         * Subscribes to donation completed messages.
         *
         * @param callback - The function to handle donation completed messages
         */
        this.onDonationCompleted = (callback) => {
            this.pubsub.subscribe(messenger_messages_1.DONATION_COMPLETED_MSG_FROM_APP, callback);
        };
        /**
         * Subscribes to member ID messages (MEMBER_ID_MSG_TO_SDK).
         *
         * @param callback - The function to handle member ID messages
         */
        this.onNewUserId = (callback) => {
            this.pubsub.subscribe(messenger_messages_1.NEW_USER_ID_MSG_FROM_APP, callback);
        };
        /**
         * Subscribes to member ID messages (MEMBER_ID_MSG_TO_SDK).
         *
         * @param callback - The function to handle member ID messages
         */
        this.onIdentifyUser = (callback) => {
            this.pubsub.subscribe(messenger_messages_1.IDENTIFY_USER_MESSAGE_FROM_APP, callback);
        };
        this.props = props;
        this.pubsub = new pubsub_1.default();
        this.iframe = new messenger_iframe_1.default();
        this._subscribe();
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        if (this.messageListener) {
            this.props.win.removeEventListener('message', this.messageListener);
            this.messageListener = null;
        }
        this.pubsub.unsubscribeAll();
        this.iframe.reset();
    }
}
exports["default"] = Messenger;


/***/ }),

/***/ 16:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const modal_view_1 = __importDefault(__webpack_require__(864));
const modal_1 = __importDefault(__webpack_require__(127));
const messenger_messages_1 = __webpack_require__(681);
class ModalCtrl {
    constructor(props) {
        this.destroyed = false;
        this.sdk = () => this.modal.sdk();
        this._onLoad = (event) => {
            if (event.data.campaign) {
                this._subscribeToOpenEvent(event);
                this.modal.open(event.data.campaign, event.data.params);
            }
        };
        this._subscribeToOpenEvent = ({ data: { campaign, params } }) => __awaiter(this, void 0, void 0, function* () {
            if (!campaign) {
                return;
            }
            if (this.view) {
                this.view.style.display = 'block';
            }
            else {
                yield this._appendView(campaign, params, 'block');
            }
            this._sendEmbeddedAppVisibleEvent();
        });
        this._subscribeToHoverEvent = ({ data: { campaign, params }, }) => __awaiter(this, void 0, void 0, function* () {
            var _a, _b;
            if (!campaign) {
                return;
            }
            if (!this.view) {
                yield this._appendView(campaign, params, 'none');
            }
            (_b = (_a = window.eg) === null || _a === void 0 ? void 0 : _a.sendAnalyticsEvent) === null || _b === void 0 ? void 0 : _b.call(_a, 'studio_checkout_cta_hover', { campaign, params });
        });
        this._subscribeToCloseEvent = ({ data: { campaign } }) => {
            var _a, _b;
            this._removeView();
            // Reset the iframe messenger when the modal is closed
            this.props.msg.iframe.reset();
            (_b = (_a = window.eg) === null || _a === void 0 ? void 0 : _a.sendAnalyticsEvent) === null || _b === void 0 ? void 0 : _b.call(_a, 'studio_checkout_close', {
                campaign: campaign,
            });
        };
        this._removeView = () => {
            var _a;
            const { body } = this.props.win.document;
            body.style.overflow = 'inherit';
            (_a = this.view) === null || _a === void 0 ? void 0 : _a.remove();
            this.view = undefined;
        };
        this._appendView = (campaign, params, display) => __awaiter(this, void 0, void 0, function* () {
            const { body } = this.props.win.document;
            body.style.overflow = 'hidden';
            // Get the config for this campaign
            const configs = yield this.props.configs;
            const config = configs[campaign];
            this.view = new modal_view_1.default({
                campaign,
                params,
                subscribeToCloseEvent: this.modal.close,
                config, // Pass the config to ModalView
            });
            this.view.style.display = display;
            // Append the view (and iframe) to the body
            body.appendChild(this.view);
            // Now that the iframe is appended, register the iframe with the messenger
            this.props.msg.iframe.register(this.view.getIframe());
        });
        /**
         * Sends the `EMBEDDED_APP_VISIBLE` event to the iframe when the modal becomes visible.
         */
        this._sendEmbeddedAppVisibleEvent = () => {
            this.props.msg.iframe.sendMessage({
                type: messenger_messages_1.EMBEDDED_APP_VISIBLE,
                payload: {},
            });
        };
        this.props = props;
        this.modal = new modal_1.default({ win: props.win });
        this.modal.onLoad(this._onLoad);
        this.modal.subscribeToOpenEvent(this._subscribeToOpenEvent);
        this.modal.subscribeToCloseEvent(this._subscribeToCloseEvent);
        this.modal.subscribeToHoverEvent(this._subscribeToHoverEvent);
        this.props.msg.onDonationReady(() => __awaiter(this, void 0, void 0, function* () {
            this.props.msg.iframe.setAppReady();
            const campaignId = this.modal.getCampaign();
            if (!campaignId) {
                return;
            }
            const configs = yield this.props.configs;
            const config = configs[campaignId];
            if (!config) {
                return;
            }
            this.props.msg.iframe.sendSDKInitMessage(config);
        }));
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        if (this.modal.getIsOpen()) {
            this.modal.close();
        }
        this._removeView();
        this.modal.destroy();
    }
}
exports["default"] = ModalCtrl;


/***/ }),

/***/ 127:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MODAL_CLOSE_EVENT = exports.MODAL_HOVER_EVENT = exports.MODAL_OPEN_EVENT = exports.MODAL_LOAD_EVENT = void 0;
const nav_1 = __importDefault(__webpack_require__(979));
const pubsub_1 = __importDefault(__webpack_require__(179));
exports.MODAL_LOAD_EVENT = 'load';
exports.MODAL_OPEN_EVENT = 'open';
exports.MODAL_HOVER_EVENT = 'hover';
exports.MODAL_CLOSE_EVENT = 'close';
class Modal {
    constructor(props) {
        this.destroyed = false;
        this._onNavPopstate = (event) => {
            const { campaign } = event.data;
            if (campaign) {
                this._isOpen = true;
                this.pubsub.publish({ name: exports.MODAL_OPEN_EVENT, data: this.nav.get() });
            }
            else {
                this._isOpen = false;
                this.pubsub.publish({ name: exports.MODAL_CLOSE_EVENT, data: this.nav.get() });
            }
        };
        this.open = (campaign, params) => {
            if (this._isOpen) {
                return;
            }
            this.nav.setClassyParams(campaign, params);
            this.pubsub.publish({ name: exports.MODAL_OPEN_EVENT, data: this.nav.get() });
            this._isOpen = true;
        };
        this.subscribeToOpenEvent = (callback) => {
            return this.pubsub.subscribe(exports.MODAL_OPEN_EVENT, callback);
        };
        this.close = () => {
            if (!this._isOpen) {
                return;
            }
            this.nav.removeClassyParams();
            this.pubsub.publish({ name: exports.MODAL_CLOSE_EVENT, data: this.nav.get() });
            this._isOpen = false;
        };
        this.subscribeToCloseEvent = (callback) => {
            return this.pubsub.subscribe(exports.MODAL_CLOSE_EVENT, callback);
        };
        this.hover = (campaign, params) => {
            this.pubsub.publish({ name: exports.MODAL_HOVER_EVENT, data: { campaign, params } });
        };
        this.subscribeToHoverEvent = (callback) => {
            return this.pubsub.subscribe(exports.MODAL_HOVER_EVENT, callback);
        };
        this.unsubscribe = (subscriptionKey) => {
            this.pubsub.unsubscribe(subscriptionKey);
        };
        this.onLoad = (callback) => {
            callback({ name: exports.MODAL_LOAD_EVENT, data: this.nav.get() });
        };
        this.getParams = () => this.nav.get().params;
        this.getCampaign = () => this.nav.get().campaign;
        this.__handleKeydown = (event) => {
            if (!this._isOpen) {
                console.log('not open');
            }
            if (event.key === 'Escape' || event.keyCode === 27) {
                this.close();
            }
        };
        this.setConfig = (config) => {
            this.config = config;
        };
        this.getConfig = () => this.config;
        this.getIsOpen = () => this._isOpen;
        this.sdk = () => ({
            open: this.open,
            close: this.close,
            hover: this.hover,
            isOpen: this.getIsOpen,
            getCampaign: this.getCampaign,
            getParams: this.getParams,
            getConfig: this.getConfig,
            setConfig: this.setConfig,
            subscribeToOpenEvent: this.subscribeToOpenEvent,
            subscribeToCloseEvent: this.subscribeToCloseEvent,
            subscribeToHoverEvent: this.subscribeToHoverEvent,
            unsubscribe: this.unsubscribe,
        });
        this.props = props;
        this.nav = new nav_1.default({ win: this.props.win });
        this.nav.onPopstate(this._onNavPopstate);
        this.pubsub = new pubsub_1.default();
        this._isOpen = !!this.nav.get().campaign;
        this.props.win.addEventListener('keydown', this.__handleKeydown);
        document.addEventListener('keydown', this.__handleKeydown);
    }
    destroy() {
        if (this.destroyed) {
            return;
        }
        this.destroyed = true;
        this.props.win.removeEventListener('keydown', this.__handleKeydown);
        document.removeEventListener('keydown', this.__handleKeydown);
        this.pubsub.unsubscribeAll();
        this._isOpen = false;
    }
}
exports["default"] = Modal;


/***/ }),

/***/ 864:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const config_utils_1 = __webpack_require__(862);
class ModalView extends HTMLElement {
    constructor(props) {
        super();
        this.getIframe = () => this.iframe;
        this._isContentPanelEnabled = () => {
            if (!this.props.config) {
                return false;
            }
            const modalComponent = (0, config_utils_1.getComponentSectionByType)('checkout', 'content-pane', this.props.config);
            return (modalComponent === null || modalComponent === void 0 ? void 0 : modalComponent.props.enabled) === true;
        };
        this._unbindEvents = () => {
            this.closeBtn.removeEventListener('click', this.props.subscribeToCloseEvent);
        };
        this._makeCSS = () => {
            const css = document.createElement('style');
            css.textContent = `
      .eg-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(100vh - 45px);
        background: rgba(26, 25, 25, 0.8);
        z-index: 2147483645;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        padding-top: 45px;
      }

      .eg-modal--window {
        position: relative;
        height: 100%;
        border-radius: 20px;
        max-height: 680px;
        pointer-events: auto;
        display: flex;
        flex-direction: column;
      }

      .eg-modal--close {
        position: absolute;
        top: -36px;
        right: 0px;
        cursor: pointer;
        z-index: 2;
        border: none;
        background: transparent;
        height: 24px;
        color: var(--neutral-100, #FFF);;
        text-align: center;
        font-family: sans-serif;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.2s ease;
      }

      .eg-modal--close:hover {
        opacity: 0.8;
      }
      .eg-modal--close-x {
        font-size: 20px;
        margin-left: 3px;
        margin-bottom: 2px;
      }

      .eg-modal--iframe {
        flex: 1;
        width: 100%;
        border: none;
        border-radius: 20px;
        z-index: 1;
      }

      .eg-modal--loader {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: zoom-in 0.25s ease;
        background: white;
        border-radius: 20px;
      }

      .eg-modal--loader--inner {
        padding: 48px;
        background: white;
        border-radius: 20px;
        text-align: center;
        color: #1B1918;
      }

      .eg-modal--loader--title {
        font-size: 1.125em;
        
      }

      .eg-modal--loader--body {
        font-size: .85em;
      }

      @keyframes zoom-in {
        0% {
          transform: scale(0.5, 0.5);
        }
        100% {
          transform: scale(1, 1);
        }
      }

      @media (max-width: 783px) {
        .eg-modal--window {
          width: 440px !important;
        }
      }
    `;
            return css;
        };
        this._makeHTML = () => {
            const modal = document.createElement('div');
            modal.setAttribute('class', 'eg-modal');
            const window = document.createElement('div');
            window.setAttribute('class', 'eg-modal--window');
            // Apply dynamic width based on content panel setting
            const width = this._isContentPanelEnabled() ? '992px' : '440px';
            window.style.width = width;
            window.appendChild(this.closeBtn);
            window.appendChild(this.iframe);
            window.appendChild(this.loader);
            modal.appendChild(window);
            return modal;
        };
        this._makeIframe = () => {
            const iframe = document.createElement('iframe');
            iframe.setAttribute('frameborder', '0');
            iframe.setAttribute('allow', 'payment; clipboard-write; clipboard-read;');
            iframe.setAttribute('allowfullscreen', 'true');
            iframe.setAttribute('allowpaymentrequest', 'true');
            iframe.setAttribute('class', 'eg-modal--iframe');
            iframe.setAttribute('name', `eg-modal-iframe--${this.props.campaign}`);
            iframe.setAttribute('src', this._makeIframeSrc());
            return iframe;
        };
        this._makeLoader = () => {
            const loader = document.createElement('div');
            loader.setAttribute('class', 'eg-modal--loader');
            loader.innerHTML = `
      <div class="eg-modal--loader--inner">
      <svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em" viewBox="0 0 24 24">
        <path fill="#425CCD" d="M10.72,19.9a8,8,0,0,1-6.5-9.79A7.77,7.77,0,0,1,10.4,4.16a8,8,0,0,1,9.49,6.52A1.54,1.54,0,0,0,21.38,12h.13a1.37,1.37,0,0,0,1.38-1.54,11,11,0,1,0-12.7,12.39A1.54,1.54,0,0,0,12,21.34h0A1.47,1.47,0,0,0,10.72,19.9Z">
          <animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12" />
        </path>
      </svg>
        <div class="eg-modal--loader--title">One moment, please</div>
      </div>
    `;
            return loader;
        };
        this._makeCloseBtn = () => {
            const btn = document.createElement('button');
            btn.innerHTML =
                '<span class="eg-modal--close-text">Close</span> <span class="eg-modal--close-x">&times;</span>';
            btn.setAttribute('label', 'Close');
            btn.setAttribute('class', 'eg-modal--close');
            btn.addEventListener('click', this.props.subscribeToCloseEvent);
            return btn;
        };
        this._makeIframeSrc = () => {
            // @ts-ignore global variable defined by webpack
            const embeddedAppUri = "https://giving.classy.org/embedded";
            // @ts-ignore global variable defined by webpack
            const isProd = "production" === 'production';
            const urlParamsStr = new URLSearchParams(Object.assign({ cid: this.props.campaign }, this.props.params)).toString();
            // This url hash prevents the consent popup from showing. Needed by TE
            const hideConsentPromptURLHash = isProd ? '' : '#:~:tcm-prompt=Hidden&log=*';
            return `${embeddedAppUri}/?${urlParamsStr}${hideConsentPromptURLHash}`;
        };
        this.props = props;
        const shadowRoot = this.attachShadow({ mode: 'open' });
        this.loader = this._makeLoader();
        this.iframe = this._makeIframe();
        this.closeBtn = this._makeCloseBtn();
        shadowRoot.append(this._makeCSS());
        shadowRoot.append(this._makeHTML());
        this.iframe.addEventListener('load', () => {
            this.loader.remove();
        });
    }
    disconnectedCallback() {
        this._unbindEvents();
    }
}
exports["default"] = ModalView;
// Check if 'eg-modal' is already defined before defining it again
if (!customElements.get('eg-modal')) {
    customElements.define('eg-modal', ModalView);
}


/***/ }),

/***/ 979:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const pubsub_1 = __importDefault(__webpack_require__(179));
const params_constants_1 = __webpack_require__(118);
const NAV_POPSTATE_EVENT = 'popstate';
/**
 * Abstraction on top of url history related apis
 */
class Nav {
    constructor(props) {
        this.get = () => {
            return this.state;
        };
        this.setClassyParams = (campaign, newParams) => {
            const allParams = this._getAllParams();
            // Deleting instead of just overriding below coz we want the campaign param to come first in the url
            delete allParams.campaign;
            this._pushState(Object.assign(Object.assign({ campaign }, allParams), newParams));
            this.state = this._getState();
        };
        this.removeClassyParams = () => {
            const queryObj = this._getOrgParams();
            this._pushState(queryObj);
            this.state = this._getState();
        };
        this.onPopstate = (callback) => {
            this.pubsub.subscribe(NAV_POPSTATE_EVENT, callback);
        };
        this._onPopstate = () => {
            this.state = this._getState();
            this.pubsub.publish({ name: NAV_POPSTATE_EVENT, data: this.state });
        };
        this._getState = () => ({
            campaign: this._getCampaign(),
            params: this._getClassyParams(),
        });
        this._getCampaign = () => {
            const allParams = this._getAllParams();
            const campaignParam = allParams[params_constants_1.CAMPAIGN_PARAM];
            return campaignParam || undefined;
        };
        this._getClassyParams = () => {
            const allParams = this._getAllParams();
            const classyParams = params_constants_1.CLASSY_PARAMS.reduce((acc, cur) => {
                const value = allParams[cur];
                if (value) {
                    // @ts-ignore
                    acc[cur] = value;
                }
                return acc;
            }, {});
            const utmParams = Object.keys(allParams)
                .filter((key) => key.startsWith('utm_'))
                .reduce((acc, cur) => {
                return Object.assign(Object.assign({}, acc), { [cur]: allParams[cur] });
            }, {});
            return Object.assign(Object.assign({}, classyParams), utmParams);
        };
        this._getOrgParams = () => {
            const allParams = this._getAllParams();
            const paramsToPreserve = new Set([params_constants_1.C_SRC_PARAM, params_constants_1.C_SRC2_PARAM]);
            const orgParams = Object.keys(allParams).reduce((acc, cur) => {
                const isPreserved = paramsToPreserve.has(cur);
                const isClassyParam = params_constants_1.CLASSY_PARAMS.includes(cur);
                if (isPreserved || (!isClassyParam && cur !== params_constants_1.CAMPAIGN_PARAM)) {
                    // @ts-ignore
                    acc[cur] = allParams[cur];
                }
                return acc;
            }, {});
            return orgParams;
        };
        this._getAllParams = () => {
            const allParams = new URLSearchParams(this.props.win.location.search);
            return Object.fromEntries(allParams.entries());
        };
        this._pushState = (queryObj) => {
            const queryStr = this._toQueryStr(queryObj);
            this.props.win.history.pushState(undefined, '', queryStr);
        };
        this._toQueryStr = (obj) => {
            const objKeys = Object.keys(obj);
            const { pathname } = this.props.win.location;
            if (objKeys.length === 0) {
                return pathname;
            }
            const queryStr = objKeys
                .filter((key) => !!obj[key])
                .map((key) => `${key}=${encodeURIComponent(obj[key])}`)
                .join('&');
            return `${pathname}?${queryStr}`;
        };
        this.props = props;
        this.state = this._getState();
        this.pubsub = new pubsub_1.default();
        this.props.win.addEventListener(NAV_POPSTATE_EVENT, this._onPopstate);
    }
}
exports["default"] = Nav;


/***/ }),

/***/ 118:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CLASSY_PARAMS = exports.RECURRING_END_DATE_PARAM = exports.DESIGNATION_PARAM = exports.C_SRC2_PARAM = exports.C_SRC_PARAM = exports.UTM_PARAM = exports.DONOR_PARAMS = exports.COUNTRY = exports.ZIP = exports.STATE = exports.CITY = exports.STREET = exports.PHONE = exports.EMAIL = exports.LAST = exports.FIRST = exports.CURRENCY_PARAM = exports.PRESET4_PARAM = exports.PRESET3_PARAM = exports.PRESET2_PARAM = exports.PRESET1_PARAM = exports.AMOUNT_PARAM = exports.FREQUENCY_PARAM = exports.RECURRING_PARAM = exports.CAMPAIGN_PARAM = void 0;
/**
 * This is a special parameter that we use to identify what campaign should be opened in the modal.
 * This is NOT a pass-through parameter expected by the app
 */
exports.CAMPAIGN_PARAM = 'campaign';
// donation parameters
exports.RECURRING_PARAM = 'recurring'; // TODO @hvnt: this should be 'frequency'... we did recurring for EG2
exports.FREQUENCY_PARAM = 'frequency';
exports.AMOUNT_PARAM = 'amount';
exports.PRESET1_PARAM = 'preset1';
exports.PRESET2_PARAM = 'preset2';
exports.PRESET3_PARAM = 'preset3';
exports.PRESET4_PARAM = 'preset4';
exports.CURRENCY_PARAM = 'currency';
// donor parameters
exports.FIRST = 'first';
exports.LAST = 'last';
exports.EMAIL = 'email';
exports.PHONE = 'phone';
exports.STREET = 'street';
exports.CITY = 'city';
exports.STATE = 'state';
exports.ZIP = 'zip';
exports.COUNTRY = 'country';
exports.DONOR_PARAMS = [exports.FIRST, exports.LAST, exports.EMAIL, exports.PHONE, exports.STREET, exports.CITY, exports.STATE, exports.ZIP, exports.COUNTRY];
// tracking parameters
/**
 * PS. Not really a parameter. Only communicates that there may be multiple params with name utm_*
 */
exports.UTM_PARAM = 'utm_*';
exports.C_SRC_PARAM = 'c_src';
exports.C_SRC2_PARAM = 'c_src2';
// options parameters
exports.DESIGNATION_PARAM = 'designation';
exports.RECURRING_END_DATE_PARAM = 'recurringEndDate';
// parameters that the org. can pass via the url
exports.CLASSY_PARAMS = [
    exports.RECURRING_PARAM,
    exports.FREQUENCY_PARAM,
    exports.RECURRING_END_DATE_PARAM,
    exports.AMOUNT_PARAM,
    exports.PRESET1_PARAM,
    exports.PRESET2_PARAM,
    exports.PRESET3_PARAM,
    exports.PRESET4_PARAM,
    exports.CURRENCY_PARAM,
    exports.UTM_PARAM,
    exports.C_SRC_PARAM,
    exports.C_SRC2_PARAM,
    exports.DESIGNATION_PARAM,
    ...exports.DONOR_PARAMS,
];


/***/ }),

/***/ 386:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.extractClassyParamsFromHref = void 0;
const params_constants_1 = __webpack_require__(118);
/**
 * Given an href string, this function extracts the url parameters supported by Classy.
 */
const extractClassyParamsFromHref = (href) => {
    const urlSearchParams = new URLSearchParams(href);
    const params = {};
    for (const [key, value] of urlSearchParams.entries()) {
        if (params_constants_1.CLASSY_PARAMS.indexOf(key) !== -1) {
            params[key] = value;
        }
    }
    return params;
};
exports.extractClassyParamsFromHref = extractClassyParamsFromHref;


/***/ }),

/***/ 179:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
/**
 * Utility class for with pubsub functionality.
 * Mostly used by model classes so other modules can track state changes.
 */
class Pubsub {
    constructor() {
        this.publish = (event) => {
            const eventSubscription = this.subscriptions[event.name];
            if (eventSubscription) {
                Object.keys(eventSubscription).forEach((key) => {
                    eventSubscription[key](event);
                });
            }
        };
        this.subscribe = (eventName, subscription) => {
            if (!this.subscriptions[eventName]) {
                this.subscriptions[eventName] = {};
            }
            const nextKey = this.generateNextKey();
            this.subscriptions[eventName][nextKey] = subscription;
            return `${eventName}.${nextKey}`;
        };
        this.generateNextKey = () => {
            const nextKey = this.currentKey + 1;
            this.currentKey = nextKey;
            return nextKey;
        };
        this.currentKey = 0;
        this.subscriptions = {};
    }
    unsubscribe(subscriptionKey) {
        const [eventName, key] = subscriptionKey.split('.');
        if (!this.subscriptions[eventName] || !this.subscriptions[eventName][key]) {
            return false;
        }
        delete this.subscriptions[eventName][key];
        return true;
    }
    unsubscribeAll() {
        this.subscriptions = {};
        this.currentKey = 0;
    }
}
exports["default"] = Pubsub;


/***/ }),

/***/ 369:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.convertRgbOrRgbaToHex = exports.convertRgbToHex = exports.isHexColor = exports.convertHexToRGB = exports.convertRgbToRGBA = void 0;
const convertRgbToRGBA = (rgb, opacity = 0.1) => {
    const rgbaRegex = /rgba?\((\d+), (\d+), (\d+)(?:, (\d*\.?\d+))?\)/;
    const match = rgb.match(rgbaRegex);
    if (match) {
        const r = match[1];
        const g = match[2];
        const b = match[3];
        return `rgba(${r}, ${g}, ${b}, ${opacity})`;
    }
    return rgb;
};
exports.convertRgbToRGBA = convertRgbToRGBA;
const convertHexToRGB = (hex) => {
    let r, g, b;
    hex = hex.replace(/^#/, '');
    if (hex.length === 3) {
        r = parseInt(hex[0] + hex[0], 16);
        g = parseInt(hex[1] + hex[1], 16);
        b = parseInt(hex[2] + hex[2], 16);
    }
    else {
        r = parseInt(hex.slice(0, 2), 16);
        g = parseInt(hex.slice(2, 4), 16);
        b = parseInt(hex.slice(4, 6), 16);
    }
    return `rgb(${r}, ${g}, ${b})`;
};
exports.convertHexToRGB = convertHexToRGB;
const isHexColor = (color) => {
    const hexRegex = /^#([0-9A-F]{3}|[0-9A-F]{6})$/i;
    return hexRegex.test(color);
};
exports.isHexColor = isHexColor;
const convertRgbToHex = (rgb) => {
    const rgbaRegex = /rgba?\((\d+), (\d+), (\d+)(?:, (\d*\.?\d+))?\)/;
    const match = rgb.match(rgbaRegex);
    if (!match) {
        throw new Error('Invalid RGB or RGBA string');
    }
    const r = parseInt(match[1], 10);
    const g = parseInt(match[2], 10);
    const b = parseInt(match[3], 10);
    const toHex = (component) => {
        const hex = component.toString(16);
        return hex.length === 1 ? '0' + hex : hex;
    };
    return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
};
exports.convertRgbToHex = convertRgbToHex;
const convertRgbOrRgbaToHex = (color, bgColor = '#FFFFFF') => {
    if (!color) {
        return '';
    }
    // Regex to extract values from RGB or RGBA format
    const rgbaRegex = /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/;
    const match = color.match(rgbaRegex);
    if (!match) {
        throw new Error('Invalid RGB or RGBA format. Expected format: rgb(R, G, B) or rgba(R, G, B, A)');
    }
    // Extract RGB values
    const r = parseInt(match[1], 10);
    const g = parseInt(match[2], 10);
    const b = parseInt(match[3], 10);
    const a = match[4] !== undefined ? parseFloat(match[4]) : 1; // Default alpha to 1 if not present
    if (a < 0 || a > 1) {
        throw new Error('Alpha must be between 0 and 1');
    }
    // Helper function to convert a number to a two-digit hex string (without padStart)
    const toHex = (component) => {
        const hex = component.toString(16).toUpperCase();
        return hex.length === 1 ? `0${hex}` : hex; // Manual padding if necessary
    };
    // If alpha is 1, return the solid RGB hex color
    if (a === 1) {
        return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
    }
    // Convert background color from HEX to RGB
    const bgR = parseInt(bgColor.substring(1, 3), 16);
    const bgG = parseInt(bgColor.substring(3, 5), 16);
    const bgB = parseInt(bgColor.substring(5, 7), 16);
    // Blend the RGBA color with the background color
    const blendedR = Math.round((1 - a) * bgR + a * r);
    const blendedG = Math.round((1 - a) * bgG + a * g);
    const blendedB = Math.round((1 - a) * bgB + a * b);
    // Return the final blended HEX color
    return `#${toHex(blendedR)}${toHex(blendedG)}${toHex(blendedB)}`;
};
exports.convertRgbOrRgbaToHex = convertRgbOrRgbaToHex;


/***/ }),

/***/ 318:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getCurrencyDecimalPlaces = void 0;
const currencyDecimalMap = {
    JPY: 0,
    KRW: 0,
    IDR: 0,
    VND: 0,
    PYG: 0,
    COP: 0,
    ISK: 0,
    MGA: 0,
};
const getCurrencyDecimalPlaces = (currencyCode) => {
    var _a;
    return (_a = currencyDecimalMap[currencyCode.toUpperCase()]) !== null && _a !== void 0 ? _a : 2;
};
exports.getCurrencyDecimalPlaces = getCurrencyDecimalPlaces;


/***/ }),

/***/ 869:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

/**
 * Utility for parsing query parameters from the SDK script URL.
 * Used to configure SDK behavior via script tag attributes.
 */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.shouldSkipAutoInit = exports.parseManualInitParam = void 0;
/**
 * Parses a script URL and checks if manual initialization is requested.
 * Accepts 'true', '1', or empty string as truthy values for manual-init param.
 *
 * @param scriptSrc - The src attribute of the script element
 * @returns true if manual-init param indicates manual initialization should be used
 *
 * @example
 * ```typescript
 * parseManualInitParam('https://embed.classy.org/api/sdk/js/123?manual-init=true') // true
 * parseManualInitParam('https://embed.classy.org/api/sdk/js/123?manual-init=1') // true
 * parseManualInitParam('https://embed.classy.org/api/sdk/js/123?manual-init') // true
 * parseManualInitParam('https://embed.classy.org/api/sdk/js/123') // false
 * parseManualInitParam('https://embed.classy.org/api/sdk/js/123?manual-init=false') // false
 * ```
 */
function parseManualInitParam(scriptSrc) {
    if (!scriptSrc) {
        return false;
    }
    try {
        const url = new URL(scriptSrc);
        const manualInit = url.searchParams.get('manual-init');
        // Accept 'true', '1', or just presence of the param with no value
        return manualInit === 'true' || manualInit === '1' || manualInit === '';
    }
    catch (_a) {
        // Invalid URL, ignore
        return false;
    }
}
exports.parseManualInitParam = parseManualInitParam;
/**
 * Checks if the SDK should skip automatic initialization by looking for
 * the `manual-init` query parameter on the current script's URL.
 *
 * Uses document.currentScript which is only available during script execution.
 *
 * @returns true if auto-initialization should be skipped
 *
 * @example
 * ```html
 * <script async src="https://embed.classy.org/api/sdk/js/YOUR_ORG_ID?manual-init=true"></script>
 * ```
 */
function shouldSkipAutoInit() {
    if (typeof document !== 'undefined' && document.currentScript) {
        const scriptSrc = document.currentScript.src;
        return parseManualInitParam(scriptSrc);
    }
    return false;
}
exports.shouldSkipAutoInit = shouldSkipAutoInit;


/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/nonce */
/******/ 	(() => {
/******/ 		__webpack_require__.nc = undefined;
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module is referenced by other modules so it can't be inlined
/******/ 	var __webpack_exports__ = __webpack_require__(156);
/******/ 	
/******/ })()
;
//# sourceMappingURL=classy-embedded-sdk.js.map