Space

Sign up for our newsletter
We summarize the week’s scientific breakthroughs every Thursday.
<![CDATA[!function(){"use strict";function e(){}function t(e,t){for(const r in t)e[r]=t[r];return e}function r(e){return e()}function n(){return Object.create(null)}function o(e){e.forEach(r)}function i(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let s;function c(e,t){return e===t||(s||(s=document.createElement("a")),s.href=t,e===s.href)}function l(e,t,r,n){if(e){const o=u(e,t,r,n);return e[0](o)}}function u(e,r,n,o){return e[1]&&o?t(n.ctx.slice(),e[1](o(r))):n.ctx}function d(e,t,r,n){if(e[2]&&n){const o=e[2](n(r));if(void 0===t.dirty)return o;if("object"==typeof o){const e=[],r=Math.max(t.dirty.length,o.length);for(let n=0;n32){const t=[],r=e.ctx.length/32;for(let e=0;e{t.call(e,i)})),!i.defaultPrevented}return!0}}const B=[],U=[];let G=[];const V=[],q=Promise.resolve();let j=!1;function H(e){G.push(e)}const K=new Set;let Y=0;function W(){if(0!==Y)return;const e=x;do{try{for(;Y{const t=e.$$.on_mount.map(r).filter(i);e.$$.on_destroy?e.$$.on_destroy.push(…t):o(t),e.$$.on_mount=[]})),s.forEach(H)}function ce(e,t){const r=e.$$;null!==r.fragment&&(!function(e){const t=[],r=[];G.forEach((n=>-1===e.indexOf(n)?t.push(n):r.push(n))),r.forEach((e=>e())),G=t}(r.after_update),o(r.on_destroy),r.fragment&&r.fragment.d(t),r.on_destroy=r.fragment=null,r.ctx=[])}function le(e,t){-1===e.$$.dirty[0]&&(B.push(e),j||(j=!0,q.then(W)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1{const e=n.indexOf(r);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}”undefined”!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add(“4″);const pe=”700px”,me=”10000px”,fe=”0px”,he=500;function ye(e,t){let r=t;e.style.maxHeight=t?me:fe,e.style.overflow=t?”unset”:”hidden”;const n=window.matchMedia(“(prefers-reduced-motion: reduce)”).matches;return n&&(e.style.display=t?”unset”:”none”),{update(t){if(n)return void(e.style.display=t?”unset”:”none”);if(t===r)return;r=t;const o=t?pe:fe,i=t?fe:pe;e.animate([{maxHeight:i,overflow:”hidden”},{maxHeight:o,overflow:”hidden”}],{duration:he,fill:”both”}).addEventListener(“finish”,(()=>{t&&e.animate([{maxHeight:o,overflow:”hidden”},{maxHeight:me,overflow:”hidden”}],{duration:100,fill:”both”})}))}}}const ge=”progress_bar”,be=”payment_option_selection”,Pe=”password”,Ee=”otp_code”,Ae=”button”,Se=”payment”,Ce=”payment-pre-loader”,ve=”email_address”,Te=”success_message”,_e=”text”,Oe=”user_attribute”,Ie=”link”,we=”resend_login_link”,Re=”social_sign_in”,Me=”payment_summary”,Ne=”divider”,$e=”show_login_link”,Le=”account_code”,xe=”mobile_payment”,Fe=”invitation”,ze=”template_component”,ke=”subscription_select”,De=”event_link”,Be=”subscriptions_list”,Ue=”past_subscriptions_link”,Ge=”billing_history”,Ve=”change_payment_method_button”,qe=”read_only_email_address”,je=”read_only_password”,He=”read_only_user_attribute”,Ke=”change_payment_method”,Ye=”devices_list”,We=”sign_out_of_devices_button”,Je=”button_group”,Qe=”link_button”,Ze=”recipient_name”,Xe=”recipient_email”,et=”recipient_address”,tt=”recipient_message”,rt=”gift_code”;var nt;!function(e){e.FORM_START=”FORM_START”,e.LOGIN_REGISTRATION_COMPLETE=”LOGIN_REGISTRATION_COMPLETE”,e.SECTION_EMAIL_COMPLETE=”SECTION_EMAIL_COMPLETE”,e.SECTION_PASSWORD_RESET_COMPLETE=”SECTION_PASSWORD_RESET_COMPLETE”,e.SECTION_FORGOT_PASSWORD_COMPLETE=”SECTION_FORGOT_PASSWORD_COMPLETE”,e.PART_PLAN_SELECT_COMPLETE=”PART_PLAN_SELECT_COMPLETE”,e.PART_ACCOUNT_VERIFICATION_COMPLETE=”PART_ACCOUNT_VERIFICATION_COMPLETE”,e.PART_GIFT_RECIPIENT_COMPLETE=”PART_GIFT_RECIPIENT_COMPLETE”,e.PART_PAYMENT_COMPLETE=”PART_PAYMENT_COMPLETE”,e.PART_SUCCESS_COMPLETE=”PART_SUCCESS_COMPLETE”,e.PART_CONTACT_VERIFICATION_COMPLETE=”PART_CONTACT_VERIFICATION_COMPLETE”,e.PART_PROFILE_UPDATE_COMPLETE=”PART_PROFILE_UPDATE_COMPLETE”,e.PART_EMAIL_UPDATE_COMPLETE=”PART_EMAIL_UPDATE_COMPLETE”,e.PART_EMAIL_UPDATE_OTP_COMPLETE=”PART_EMAIL_UPDATE_OTP_COMPLETE”,e.PART_PASSWORD_UPDATE_COMPLETE=”PART_PASSWORD_UPDATE_COMPLETE”,e.PART_PASSWORD_UPDATE_OTP_COMPLETE=”PART_PASSWORD_UPDATE_OTP_COMPLETE”,e.PART_ATTRIBUTES_UPDATE_COMPLETE=”PART_ATTRIBUTES_UPDATE_COMPLETE”,e.REGISTRATION_CUSTOM_COMPLETE=”REGISTRATION_CUSTOM_COMPLETE”,e.SELECT_SUBSCRIPTION_COMPLETE=”SELECT_SUBSCRIPTION_COMPLETE”,e.UPDATE=”UPDATE”,e.GO_BACK=”GO_BACK”,e.VERIFY_EMAIL_UPDATE_OTP=”VERIFY_EMAIL_UPDATE_OTP”,e.VERIFY_PASSWORD_UPDATE_OTP=”VERIFY_PASSWORD_UPDATE_OTP”,e.PART_CHANGE_PAYMENT_COMPLETE=”PART_CHANGE_PAYMENT_COMPLETE”,e.LIST_DEVICES_SESSIONS=”LIST_DEVICES_SESSIONS”,e.SIGN_OUT_ALL_DEVICES=”SIGN_OUT_ALL_DEVICES”,e.SIGN_OUT_SINGLE_DEVICE=”SIGN_OUT_SINGLE_DEVICE”,e.GIFT_REDEMPTION_COMPLETE=”GIFT_REDEMPTION_COMPLETE”}(nt||(nt={}));const ot={PLAN_SELECT:{type:”plan-select”,order:0,completionEvent:nt.PART_PLAN_SELECT_COMPLETE},ACCOUNT_VERIFICATION:{type:”account-verification”,order:1,completionEvent:nt.PART_ACCOUNT_VERIFICATION_COMPLETE},GIFT_RECIPIENT:{type:”gift-recipient”,order:1,completionEvent:nt.PART_GIFT_RECIPIENT_COMPLETE},PAYMENT:{type:”payment”,order:2,completionEvent:nt.PART_PAYMENT_COMPLETE},SUCCESS:{type:”success”,order:3,completionEvent:nt.PART_SUCCESS_COMPLETE},CONTACT_VERIFICATION:{type:”contact-verification”,order:1,completionEvent:nt.PART_CONTACT_VERIFICATION_COMPLETE},PROFILE_UPDATE:{type:”profile-update”,order:0,completionEvent:nt.PART_PROFILE_UPDATE_COMPLETE},SELECT_SUBSCRIPTION:{type:”select-subscription”,order:0,completionEvent:nt.SELECT_SUBSCRIPTION_COMPLETE},EMAIL_UPDATE:{type:”email-update”,order:0,completionEvent:nt.PART_EMAIL_UPDATE_COMPLETE},EMAIL_UPDATE_OTP:{type:”email-update-otp”,order:0,completionEvent:nt.PART_EMAIL_UPDATE_OTP_COMPLETE},PASSWORD_UPDATE:{type:”password-update”,order:0,completionEvent:nt.PART_PASSWORD_UPDATE_COMPLETE},PASSWORD_UPDATE_OTP:{type:”password-update-otp”,order:0,completionEvent:nt.PART_PASSWORD_UPDATE_OTP_COMPLETE},ATTRIBUTES_UPDATE:{type:”attributes-update”,order:0,completionEvent:nt.PART_ATTRIBUTES_UPDATE_COMPLETE},LIST_SUBSCRIPTIONS:{type:”list-subscriptions”,order:0},BILLING_HISTORY:{type:”billing-history”,order:0},PAST_SUBSCRIPTIONS:{type:”past-subscriptions”,order:0},CHANGE_PAYMENT:{type:”change-payment”,order:2,completionEvent:nt.PART_CHANGE_PAYMENT_COMPLETE},DEVICES_SESSIONS:{type:”devices-sessions”,order:0,completionEvent:nt.LIST_DEVICES_SESSIONS},CANCEL_SUCCESS:{type:”cancel-success”,order:3},GIFT_REDEMPTION:{type:”gift_redemption”,order:4}},it=e=>Object.values(ot).find((t=>t.type==e))||(()=>{throw`No part ${e} found`})();var at;!function(e){e[e.USER_DOES_NOT_EXIST=0]=”USER_DOES_NOT_EXIST”,e[e.USER_ALREADY_EXISTS=1]=”USER_ALREADY_EXISTS”,e[e.PASSWORD_NOT_STRONG_ENOUGH=2]=”PASSWORD_NOT_STRONG_ENOUGH”,e[e.EMAIL_VERIFICATION_REQUIRED=3]=”EMAIL_VERIFICATION_REQUIRED”,e[e.VERIFICATION_CODE_OR_PASSWORD_INCORRECT=4]=”VERIFICATION_CODE_OR_PASSWORD_INCORRECT”,e[e.VERIFICATION_CODE_INCORRECT=5]=”VERIFICATION_CODE_INCORRECT”,e[e.LOGIN_FAILED=6]=”LOGIN_FAILED”,e[e.UNKNOWN_LOGIN_REGISTER_ERROR=7]=”UNKNOWN_LOGIN_REGISTER_ERROR”,e[e.NO_COOKIE_FROM_LOGIN_REGISTER_ERROR=8]=”NO_COOKIE_FROM_LOGIN_REGISTER_ERROR”,e[e.NO_ACCOUNT_ACCESS=9]=”NO_ACCOUNT_ACCESS”,e[e.ACCOUNT_NOT_FOUND=10]=”ACCOUNT_NOT_FOUND”,e[e.PAYMENT_PROCESSING_ERROR=11]=”PAYMENT_PROCESSING_ERROR”,e[e.MOBILE_PAYMENT_PROCESSING_ERROR=12]=”MOBILE_PAYMENT_PROCESSING_ERROR”,e[e.PASSWORD_RESET_LINK_SEND_ERROR=13]=”PASSWORD_RESET_LINK_SEND_ERROR”,e[e.PASSWORD_RESET_ERROR=14]=”PASSWORD_RESET_ERROR”,e[e.VERIFICATION_CODE_SEND_ERROR=15]=”VERIFICATION_CODE_SEND_ERROR”,e[e.SOCIAL_SIGNIN_REGISTRATION_LOGIN_ERROR=16]=”SOCIAL_SIGNIN_REGISTRATION_LOGIN_ERROR”,e[e.PROMO_CODE_EXPIRED_ERROR=17]=”PROMO_CODE_EXPIRED_ERROR”,e[e.PROMO_CODE_INVALID_ERROR=18]=”PROMO_CODE_INVALID_ERROR”,e[e.PROMO_CODE_NOT_VALID_FOR_PLAN_ERROR=19]=”PROMO_CODE_NOT_VALID_FOR_PLAN_ERROR”,e[e.INVITATION_FAILED_LIMIT_REACHED=20]=”INVITATION_FAILED_LIMIT_REACHED”,e[e.INVITATION_FAILED_DUPLICATE_EMAIL=21]=”INVITATION_FAILED_DUPLICATE_EMAIL”,e[e.INVITATION_FAILED_INVALID_EMAIL=22]=”INVITATION_FAILED_INVALID_EMAIL”,e[e.INVITATION_FAILED_NO_PRODUCT_ACCESS=23]=”INVITATION_FAILED_NO_PRODUCT_ACCESS”,e[e.INVITATION_FAILED_UNKNOWN=24]=”INVITATION_FAILED_UNKNOWN”,e[e.TOO_MANY_SESSIONS=25]=”TOO_MANY_SESSIONS”,e[e.INVALID_USER_ATTRIBUTES=26]=”INVALID_USER_ATTRIBUTES”,e[e.CONTACT_CREATION_NOT_ENABLED=27]=”CONTACT_CREATION_NOT_ENABLED”,e[e.NO_AUTHENTICATED_SESSION=28]=”NO_AUTHENTICATED_SESSION”,e[e.BLOCKED_EMAIL_DOMAIN=29]=”BLOCKED_EMAIL_DOMAIN”,e[e.UNKNOWN=30]=”UNKNOWN”,e[e.GIFT_CODE_INVALID=31]=”GIFT_CODE_INVALID”,e[e.GIFT_CODE_ALREADY_REDEEMED=32]=”GIFT_CODE_ALREADY_REDEEMED”,e[e.GIFT_CODE_SERVER_ERROR=33]=”GIFT_CODE_SERVER_ERROR”}(at||(at={}));const st={[at.USER_DOES_NOT_EXIST]:{languagePackKey:”forms.errors.user-not-found”,fallbackMessage:”User not found.”,jumpToPart:ot.ACCOUNT_VERIFICATION.type,displayOnElements:[ve]},[at.USER_ALREADY_EXISTS]:{languagePackKey:”forms.errors.email-taken”,fallbackMessage:”This email address is already registered. Please log in to continue.”,jumpToPart:ot.ACCOUNT_VERIFICATION.type,displayOnElements:[ve]},[at.EMAIL_VERIFICATION_REQUIRED]:{languagePackKey:”forms.errors.email-verification-required”,fallbackMessage:”Email verification is required”,jumpToPart:ot.ACCOUNT_VERIFICATION.type,displayOnElements:[ve]},[at.VERIFICATION_CODE_OR_PASSWORD_INCORRECT]:{languagePackKey:”forms.errors.otp-or-password-incorrect”,fallbackMessage:”The password or code you entered is incorrect.”,displayOnElements:[Ee,Pe]},[at.VERIFICATION_CODE_INCORRECT]:{languagePackKey:”forms.errors.otp-incorrect”,fallbackMessage:”The code you entered is incorrect.”,displayOnElements:[Ee]},[at.LOGIN_FAILED]:{languagePackKey:”forms.errors.login-failed”,fallbackMessage:”The email address or password you entered is incorrect.”,displayOnElements:[Pe,Ee]},[at.PASSWORD_NOT_STRONG_ENOUGH]:{languagePackKey:”n/a”,fallbackMessage:””,useDymamicMessage:!0,displayOnElements:[Pe]},[at.UNKNOWN_LOGIN_REGISTER_ERROR]:{languagePackKey:”forms.errors.unknown-error”,fallbackMessage:”Something went wrong. Please try again later”,displayOnElements:[Pe,Ee]},[at.NO_COOKIE_FROM_LOGIN_REGISTER_ERROR]:{languagePackKey:”forms.errors.unknown-error”,fallbackMessage:”Something went wrong. Please try again later”,displayOnElements:[Pe,Ee]},[at.NO_ACCOUNT_ACCESS]:{languagePackKey:”forms.errors.too-many-requests”,fallbackMessage:”To gain login access, please contact your administrator.”,displayOnElements:[Pe]},[at.ACCOUNT_NOT_FOUND]:{languagePackKey:”forms.errors.company-account-not-found”,fallbackMessage:”Account not found.”,jumpToPart:ot.ACCOUNT_VERIFICATION.type,displayOnElements:[Le]},[at.PAYMENT_PROCESSING_ERROR]:{languagePackKey:”forms.errors.unknown-payment-error”,fallbackMessage:”Something went wrong when processing your payment. Please try again later.”,displayOnElements:[Se]},[at.MOBILE_PAYMENT_PROCESSING_ERROR]:{languagePackKey:”forms.errors.unknown-payment-error”,fallbackMessage:”Something went wrong when processing your payment. Please try again later.”,displayOnElements:[xe]},[at.PASSWORD_RESET_LINK_SEND_ERROR]:{languagePackKey:”forms.errors.password-reset-link-send-failed”,fallbackMessage:”Unable to send a password reset link. Please try again later”,displayOnElements:[Ie]},[at.VERIFICATION_CODE_SEND_ERROR]:{languagePackKey:”forms.errors.otp-send-failed”,fallbackMessage:”Unable to send a verification code. Please try again later”,displayOnElements:[Ee]},[at.PASSWORD_RESET_ERROR]:{languagePackKey:”forms.errors.password-reset-failed”,fallbackMessage:”Unable to reset your password. Please try again later”,displayOnElements:[Pe]},[at.SOCIAL_SIGNIN_REGISTRATION_LOGIN_ERROR]:{languagePackKey:”forms.errors.unknown-error”,fallbackMessage:”Something went wrong. Please try again later”,displayOnElements:[Re]},[at.PROMO_CODE_EXPIRED_ERROR]:{languagePackKey:”forms.errors.promo-code-expired”,fallbackMessage:”Promo code expired”,displayOnElements:[Me]},[at.PROMO_CODE_INVALID_ERROR]:{languagePackKey:”forms.errors.promo-code-invalid”,fallbackMessage:”Invalid promo code”,displayOnElements:[Me]},[at.PROMO_CODE_NOT_VALID_FOR_PLAN_ERROR]:{languagePackKey:”forms.errors.promo-code-invalid-for-payment-option”,fallbackMessage:”Promo code cannot be applied to selected option”,displayOnElements:[Me]},[at.INVITATION_FAILED_LIMIT_REACHED]:{languagePackKey:”forms.errors.invitation-failed-limit-reached”,fallbackMessage:”You have reached the sharing limit for this product”,displayOnElements:[Fe]},[at.INVITATION_FAILED_DUPLICATE_EMAIL]:{languagePackKey:”forms.errors.invitation-failed-duplicate-email”,fallbackMessage:”An invite has already been created for this email”,displayOnElements:[Fe]},[at.INVITATION_FAILED_INVALID_EMAIL]:{languagePackKey:”forms.errors.invitation-failed-invalid-email”,fallbackMessage:”Invalid email address”,displayOnElements:[Fe]},[at.INVITATION_FAILED_NO_PRODUCT_ACCESS]:{languagePackKey:”forms.errors.invitation-failed-no-product-access”,fallbackMessage:”You do not currently have access to this product”,displayOnElements:[Fe]},[at.INVITATION_FAILED_UNKNOWN]:{languagePackKey:”forms.errors.unknown-error”,fallbackMessage:”Something went wrong. Please try again later”,displayOnElements:[Fe]},[at.TOO_MANY_SESSIONS]:{languagePackKey:”forms.errors.session-limit-reached”,fallbackMessage:”You have reached the session limit. Please log out from another device to access this content.”,displayOnElements:[ve]},[at.INVALID_USER_ATTRIBUTES]:{languagePackKey:”forms.errors.user-attribute-invalid”,fallbackMessage:”Invalid User Attribute”,displayOnElements:[Oe]},[at.CONTACT_CREATION_NOT_ENABLED]:{languagePackKey:”forms.errors.contact-creation-disabled”,fallbackMessage:”This operation is not possible at the moment, please try again later.”,jumpToPart:ot.ACCOUNT_VERIFICATION.type,displayOnElements:[ve]},[at.NO_AUTHENTICATED_SESSION]:{languagePackKey:”forms.errors.no-authenticated-session”,fallbackMessage:”Please login to update your profile”},[at.BLOCKED_EMAIL_DOMAIN]:{languagePackKey:”forms.errors.email-domain-blocked”,fallbackMessage:”Please use a different email address, this domain is not supported.”,jumpToPart:ot.ACCOUNT_VERIFICATION.type,displayOnElements:[ve]},[at.UNKNOWN]:{languagePackKey:”forms.errors.unknown-error”,fallbackMessage:”Something went wrong. Please try again later”},[at.GIFT_CODE_INVALID]:{languagePackKey:”forms.errors.gift-code-invalid”,fallbackMessage:”Invalid gift code”,displayOnElements:[rt]},[at.GIFT_CODE_ALREADY_REDEEMED]:{languagePackKey:”forms.errors.gift-code-already-redeemed”,fallbackMessage:”Gift code already redeemed”,displayOnElements:[rt]},[at.GIFT_CODE_SERVER_ERROR]:{languagePackKey:”forms.errors.gift-code-server-error”,fallbackMessage:”Something went wrong with the gift code. Please try again later”,displayOnElements:[rt]}},ct=(e,t)=>t.serverErrors.find((t=>st[t].displayOnElements?.includes(e)))??void 0,lt={PLAN_SELECT:{type:”plan_select”,defaultLabel:”Plan Select”,fullWidth:!0},EMAIL:{type:”email”,defaultLabel:”Account Verification”,completionEvent:nt.SECTION_EMAIL_COMPLETE},RECIPIENT_DETAILS:{type:”recipient_details”,defaultLabel:”Recipient”},PASSWORD_SETUP:{type:”password_setup”,defaultLabel:”Password Setup”},PASSWORDLESS_VIA_LOGIN_LINK:{type:”passwordless_login_via_link”,defaultLabel:”Passwordless Login via Login Link”},VERIFICATION_CODE_LOGIN:{type:”verification_code_login”,defaultLabel:””},VERIFICATION_CODE_REGISTRATION:{type:”verification_code_registration”,defaultLabel:””},LOGIN_PASSWORD:{type:”login_password”,defaultLabel:”Login”},REGISTRATION_CUSTOM:{type:”registration_custom”,defaultLabel:””},FORGOT_PASSWORD:{type:”forgot_password”,defaultLabel:””,completionEvent:nt.SECTION_FORGOT_PASSWORD_COMPLETE},PASSWORD_RESET:{type:”reset_password”,defaultLabel:””,completionEvent:nt.SECTION_PASSWORD_RESET_COMPLETE},SUCCESS:{type:”success”,defaultLabel:””},EMAIL_VERIFIED:{type:”email_verified”,defaultLabel:””},READ_ONLY_PROFILE:{type:”read_only_profile”,defaultLabel:”Read Only Profile”},UPDATE_EMAIL:{type:”update_email”,defaultLabel:”Update Email”},UPDATE_PASSWORD:{type:”update_password”,defaultLabel:”Update Password”},UPDATE_ATTRIBUTES:{type:”update_attributes”,defaultLabel:”Update Attributes”},CHANGE_PAYMENT:{type:”change-payment”,completionEvent:nt.PART_CHANGE_PAYMENT_COMPLETE,defaultLabel:””},SELECT:{type:”select”,defaultLabel:””,fullWidth:!0},LIST:{type:”list”,defaultLabel:””,fullWidth:!0},PAST_SUBSCRIPTIONS:{type:”past-subscriptions”,defaultLabel:””,fullWidth:!0},GIFT_REDEMPTION:{type:”gift_redemption”,defaultLabel:”Gift Code Redemption”,completionEvent:nt.GIFT_REDEMPTION_COMPLETE},GIFT_REDEEMED:{type:”gift_redeemed”,defaultLabel:”Gift Redeemed”}},ut=e=>Object.values(lt).find((t=>t.type==e));function dt(e,t,r){const n={event:t,formType:e.formType,formId:e.formId,ruleId:e.ruleId,outcomeId:e.outcomeId,…r};if(window.postMessage({“zephr-form-datalayer-event”:n},window.origin),!e.organisationConfiguration.trackFormDataLayerEvents)return;const o=e.organisationConfiguration.dataLayerName||”dataLayer”;window[o]=window[o]||[],window[o].push(n)}const pt=(e,t,r)=>{const n=((e,t)=>t.parts.flatMap((e=>e.sections.map((t=>({part:e,section:t}))))).find((t=>t.section.type===e)))(e,t);if(!n)throw`Cannot find section ${e}`;const o=r.getFormState();return Et({form:t,formActions:r,part:n.part,section:n.section,previousPart:o.currentPart,previousSection:o.currentSection}),Promise.resolve()},mt=(e,t,r)=>{if(t.environment.previewMode)return;const n=t.parts.find((t=>t.type==e)),o=r.getFormState();return Et({form:t,formActions:r,part:n,section:n.sections[0],previousPart:o.currentPart,previousSection:o.currentSection}),Promise.resolve()},ft=(e,t,r)=>{const n=t.sections.findIndex((t=>t.order==e.order));return t.sections.length>n+1?{section:t.sections[n+1],part:t}:((e,t)=>{const r=it(e.type);if(r){const n=t.parts.find((e=>it(e.type).order===r.order+1))??t.parts[t.parts.indexOf(e)+1];if(n)return{section:n.sections[0],part:n}}return null})(t,r)},ht=e=>e?.startsWith(“custom_”)?”registration_custom”:e,yt=(e,t,r)=>t.sectionFlow.sectionVisibilities.find((t=>t.type===ht(e.type)))?.isVisible(t,r)??!0,gt=(e,t,r)=>{const n=t.sectionFlow.sectionVisibilities.find((t=>t.type===ht(e.type)));return(n?.isDisplayedInProgressBar&&yt(e,t,r))??!0},bt=(e,t,r)=>{if(e.environment.previewMode)return;let n=0,o={part:t.currentPart,section:t.currentSection};do{if(n++,n>50)throw new Error(`Cannot move from ${t.currentPart.type}:${t.currentSection.type}. n Exceeded max loop size after ${o?.part?.type}:${o?.section?.type}n `);const r=ft(o?.section,o?.part,e);if(r?.part.type===o?.part?.type&&r?.section.type===o?.section?.type&&r?.section.order===o?.section?.order)throw new Error(`Cannot move from ${t.currentPart.type}:${t.currentSection.type}. n Infinte loop found at next section ${r?.part?.type}:${r?.section?.type}n `);o=r}while(o&&!yt(o.section,e,t));if(!o||o.part!==t.currentPart){const n=it(t.currentPart.type),o=n?.completionEvent&&e.sectionFlow.eventHandlers[n.completionEvent];if(o)return o(e,t,r)}if(!o)throw”No next section”;return Et({form:e,formActions:r,part:o.part,section:o.section,previousPart:t.currentPart,previousSection:t.currentSection}),Promise.resolve()},Pt=(e,t,r)=>{if(e.environment.previewMode)return;const n=ut(t.currentSection.type);return((n&&e.sectionFlow.eventHandlers[n.completionEvent])??bt)(e,t,r)},Et=({form:e,formActions:t,part:r,section:n,previousSection:o,previousPart:i})=>{t.updateFormState({currentPart:r,currentSection:n}),dt(e,”zephr_form_section_change”,{sectionId:n.type,previousSectionId:o.type,partId:r.type,previousPartId:i.type}),(e=>{try{const t=document.getElementById(e);if(!t)return;const{top:r}=t.getBoundingClientRect();r<0&&t.scrollIntoView({block:"start",inline:"nearest"})}catch(e){console.error(e)}})(e.formId)};function At(e,t,r){const n=e.slice();n[7]=t[r];const o=!n[0]&&!n[7].isDisabled&&n[7].order<n[2].order;return n[8]=o,n}function St(e){let t,r,n,o=ne(e[3]),i=[];for(let t=0;t<o.length;t+=1)i[t]=Tt(At(e,o,t));return{c(){t=P("div");for(let e=0;e<i.length;e+=1)i[e].c();r=S(),n=P("progress"),_(t,"class","zephr-form-flex-container"),$(t,"zephr-payment-form-flex-container",e[1]),_(n,"class","zephr-form-progress-bar svelte-d78fa2"),_(n,"id","progress-bar"),_(n,"max","100"),n.value=e[4],$(n,"zephr-payment-form-progress-bar",e[1])},m(e,o){y(e,t,o);for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,null);y(e,r,o),y(e,n,o)},p(e,r){if(15&r){let n;for(o=ne(e[3]),n=0;n<o.length;n+=1){const a=At(e,o,n);i[n]?i[n].p(a,r):(i[n]=Tt(a),i[n].c(),i[n].m(t,null))}for(;n{“disabled”in e&&r(0,a=e.disabled),”items”in e&&r(5,s=e.items),”isPaymentForm”in e&&r(1,c=e.isPaymentForm)},e.$$.update=()=>{32&e.$$.dirty&&r(2,n=s.find((e=>e.isCurrent))),32&e.$$.dirty&&r(3,o=s.filter((e=>e.isVisible))),12&e.$$.dirty&&r(4,i=Math.floor(100/(o.length-1)*(n.isVisible?n.visibleOrder:Math.max.apply(Math,o.filter((e=>e.ordere.visibleOrder))))))},[a,c,n,o,i,s,e=>{e.onSelect()}]}class It extends de{constructor(e){super(),ue(this,e,Ot,_t,a,{disabled:0,items:5,isPaymentForm:1})}}var wt;!function(e){e.EMPTY=”EMPTY”,e.PAYMENT=”PAYMENT”,e.CHANGE_SUBSCRIPTION=”CHANGE_SUBSCRIPTION”,e.REGISTRATION=”REGISTRATION”,e.CONTACT=”CONTACT”,e.DATA_CAPTURE=”DATA_CAPTURE”,e.COMPLETE_REGISTRATION=”COMPLETE_REGISTRATION”,e.UPDATE_PROFILE=”UPDATE_PROFILE”,e.CANCEL_SUBSCRIPTION=”CANCEL_SUBSCRIPTION”,e.LIST_SUBSCRIPTIONS=”LIST_SUBSCRIPTIONS”,e.DEVICES=”DEVICES”,e.GIFT_SUBSCRIPTION=”GIFT_SUBSCRIPTION”,e.GIFT_REDEMPTION=”GIFT_REDEMPTION”}(wt||(wt={}));const Rt=(e,t,r)=>{let n=0,o=0;return e.parts.flatMap((e=>e.sections.map((t=>({part:e,section:t}))))).map((({part:i,section:a})=>({type:a.type,isVisible:gt(a,e,t),label:a.label??i.label??ut(a.type)?.defaultLabel,isCurrent:t.currentSection==a,isDisabled:t.loginRegistrationComplete&&![ot.PLAN_SELECT.type].includes(i.type),order:n++,visibleOrder:gt(a,e,t)?o++:null,onSelect:()=>Et({form:e,formActions:r,part:i,section:a,previousSection:t.currentSection,previousPart:t.currentPart})})))},Mt={matches:e=>e.type===ge,create:(e,t,r)=>({component:It,props:{disabled:t.isBusy,items:Rt(e,t,r),isPaymentForm:e.formType===wt.PAYMENT}})},Nt=e=>e.typeConfiguration;function $t(t){let r,n,o,i,a,s,l,u,d,p,m,f;return{c(){r=P(“script”),r.innerHTML=””,o=P(“script”),o.innerHTML=””,a=P(“script”),a.innerHTML=””,l=P(“script”),l.innerHTML=””,d=S(),p=P(“div”),m=S(),f=P(“div”),f.innerHTML=””,c(r.src,n=”https://js.braintreegateway.com/web/3.85.3/js/google-payment.min.js”)||_(r,”src”,”https://js.braintreegateway.com/web/3.85.3/js/google-payment.min.js”),c(o.src,i=”https://pay.google.com/gp/p/js/pay.js”)||_(o,”src”,”https://pay.google.com/gp/p/js/pay.js”),_(o,”onload”,”window.googlePayLoadBraintreeCallback()”),c(a.src,s=”https://js.braintreegateway.com/web/3.85.3/js/client.min.js”)||_(a,”src”,”https://js.braintreegateway.com/web/3.85.3/js/client.min.js”),_(a,”onload”,”window.braintreeLoadCallback()”),c(l.src,u=”https://js.braintreegateway.com/web/3.85.3/js/apple-pay.min.js”)||_(l,”src”,”https://js.braintreegateway.com/web/3.85.3/js/apple-pay.min.js”),_(l,”onload”,”window.applePayLoadBraintreeCallback()”),_(p,”id”,”google-pay-button”),_(p,”class”,”svelte-1acsmhs”),$(p,”zephr-form-disabled-div”,t[0]),$(p,”zephr-payment-form-disabled-div”,t[0]),_(f,”id”,”apple_pay_button”)},m(e,t){h(document.head,r),h(document.head,o),h(document.head,a),h(document.head,l),y(e,d,t),y(e,p,t),y(e,m,t),y(e,f,t)},p(e,[t]){1&t&&$(p,”zephr-form-disabled-div”,e[0]),1&t&&$(p,”zephr-payment-form-disabled-div”,e[0])},i:e,o:e,d(e){e&&(g(d),g(p),g(m),g(f)),g(r),g(o),g(a),g(l)}}}function Lt(e,t,r){let{onMountCallback:n}=t,{isDisabled:o}=t,{disableCoreDependencyHeader:i}=t;return k(n),e.$$set=e=>{“onMountCallback”in e&&r(1,n=e.onMountCallback),”isDisabled”in e&&r(0,o=e.isDisabled),”disableCoreDependencyHeader”in e&&r(2,i=e.disableCoreDependencyHeader)},[o,n,i]}function xt(t){let r,n,o;return{c(){r=P(“div”),n=P(“div”),o=A(t[0]),_(n,”class”,”zephr-form-error-message svelte-719cfr”),_(n,”aria-live”,”assertive”),$(n,”zephr-payment-form-error-message”,!t[1]),_(r,”class”,”zephr-form-error-message-min-height svelte-719cfr”),$(r,”zephr-payment-form-error-message-min-height”,!t[1])},m(e,t){y(e,r,t),h(r,n),h(n,o)},p(e,[t]){1&t&&w(o,e[0]),2&t&&$(n,”zephr-payment-form-error-message”,!e[1]),2&t&&$(r,”zephr-payment-form-error-message-min-height”,!e[1])},i:e,o:e,d(e){e&&g(r)}}}function Ft(e,t,r){let{error:n}=t,{isPaymentForm:o=!1}=t;return e.$$set=e=>{“error”in e&&r(0,n=e.error),”isPaymentForm”in e&&r(1,o=e.isPaymentForm)},[n,o]}class zt extends de{constructor(e){super(),ue(this,e,Ft,xt,a,{error:0,isPaymentForm:1})}}function kt(e){let t,r,n,o,i,a,s;return a=new zt({props:{error:e[0]?.message??e[2]??””,isPaymentForm:!0}}),{c(){t=P(“script”),t.innerHTML=””,n=S(),o=P(“div”),i=S(),ae(a.$$.fragment),c(t.src,r=”https://js.braintreegateway.com/web/dropin/1.33.2/js/dropin.min.js”)||_(t,”src”,”https://js.braintreegateway.com/web/dropin/1.33.2/js/dropin.min.js”),_(t,”onload”,”window.braintreeLoadCallback()”),_(o,”id”,”braintree-dropin-container”),_(o,”class”,”svelte-z7jd27″),$(o,”zephr-form-disabled-div”,e[1]),$(o,”zephr-payment-form-disabled-div”,e[1])},m(e,r){h(document.head,t),y(e,n,r),y(e,o,r),y(e,i,r),se(a,e,r),s=!0},p(e,[t]){(!s||2&t)&&$(o,”zephr-form-disabled-div”,e[1]),(!s||2&t)&&$(o,”zephr-payment-form-disabled-div”,e[1]);const r={};5&t&&(r.error=e[0]?.message??e[2]??””),a.$set(r)},i(e){s||(te(a.$$.fragment,e),s=!0)},o(e){re(a.$$.fragment,e),s=!1},d(e){e&&(g(n),g(o),g(i)),g(t),ce(a,e)}}}function Dt(e,t,r){let{onMountCallback:n}=t,{providerError:o}=t,{isDisabled:i}=t,{isLoaded:a}=t,{error:s=null}=t;return k(n),e.$$set=e=>{“onMountCallback”in e&&r(3,n=e.onMountCallback),”providerError”in e&&r(0,o=e.providerError),”isDisabled”in e&&r(1,i=e.isDisabled),”isLoaded”in e&&r(4,a=e.isLoaded),”error”in e&&r(2,s=e.error)},[o,i,s,n,a]}function Bt(e){let t,r,n,o,i,a,s;return a=new zt({props:{error:e[0]?.message??(e[2]?e[3]:””)??””,isPaymentForm:!0}}),{c(){t=P(“script”),t.innerHTML=””,n=S(),o=P(“div”),i=S(),ae(a.$$.fragment),c(t.src,r=”https://js.stripe.com/v3/”)||_(t,”src”,”https://js.stripe.com/v3/”),_(t,”onload”,”window.stripeLoadCallback()”),_(o,”id”,”stripe-element”),_(o,”class”,”svelte-1lhuc6b”),$(o,”zephr-form-disabled-div”,e[1]),$(o,”zephr-payment-form-disabled-div”,e[1])},m(e,r){h(document.head,t),y(e,n,r),y(e,o,r),y(e,i,r),se(a,e,r),s=!0},p(e,[t]){(!s||2&t)&&$(o,”zephr-form-disabled-div”,e[1]),(!s||2&t)&&$(o,”zephr-payment-form-disabled-div”,e[1]);const r={};13&t&&(r.error=e[0]?.message??(e[2]?e[3]:””)??””),a.$set(r)},i(e){s||(te(a.$$.fragment,e),s=!0)},o(e){re(a.$$.fragment,e),s=!1},d(e){e&&(g(n),g(o),g(i)),g(t),ce(a,e)}}}function Ut(e,t,r){let{onMountCallback:n}=t,{providerError:o}=t,{isDisabled:i}=t,{isComplete:a}=t,{isLoaded:s}=t,{error:c=null}=t;return k(n),e.$$set=e=>{“onMountCallback”in e&&r(4,n=e.onMountCallback),”providerError”in e&&r(0,o=e.providerError),”isDisabled”in e&&r(1,i=e.isDisabled),”isComplete”in e&&r(2,a=e.isComplete),”isLoaded”in e&&r(5,s=e.isLoaded),”error”in e&&r(3,c=e.error)},[o,i,a,c,n,s]}function Gt(e){let t,r;return{c(){t=P(“script”),t.innerHTML=””,c(t.src,r=”https://js.stripe.com/v3/”)||_(t,”src”,”https://js.stripe.com/v3/”),_(t,”onload”,”window.stripeLoadCallback()”)},m(e,r){y(e,t,r)},d(e){e&&g(t)}}}function Vt(t){let r,n,o,i,a,s=!t[1]&&Gt();return{c(){r=P(“script”),r.innerHTML=””,s&&s.c(),o=C(),i=S(),a=P(“div”),c(r.src,n=”https://pay.google.com/gp/p/js/pay.js”)||_(r,”src”,”https://pay.google.com/gp/p/js/pay.js”),_(r,”onload”,”window.googlePayLoadStripeCallback()”),_(a,”id”,”stripe-mobile-pay-button”),_(a,”class”,”svelte-1t95nqv”),$(a,”zephr-form-disabled-div”,t[0]),$(a,”zephr-payment-form-disabled-div”,t[0])},m(e,t){h(document.head,r),s&&s.m(document.head,null),h(document.head,o),y(e,i,t),y(e,a,t)},p(e,[t]){e[1]?s&&(s.d(1),s=null):s||(s=Gt(),s.c(),s.m(o.parentNode,o)),1&t&&$(a,”zephr-form-disabled-div”,e[0]),1&t&&$(a,”zephr-payment-form-disabled-div”,e[0])},i:e,o:e,d(e){e&&(g(i),g(a)),g(r),s&&s.d(e),g(o)}}}function qt(e,t,r){let{onMountCallback:n}=t,{isDisabled:o}=t,{disableCoreDependencyHeader:i}=t;return k(n),e.$$set=e=>{“onMountCallback”in e&&r(2,n=e.onMountCallback),”isDisabled”in e&&r(0,o=e.isDisabled),”disableCoreDependencyHeader”in e&&r(1,i=e.disableCoreDependencyHeader)},[o,i,n]}var jt={prefix:”fas”,iconName:”circle-check”,icon:[512,512,[61533,”check-circle”],”f058″,”M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z”]},Ht={prefix:”fas”,iconName:”spinner”,icon:[512,512,[],”f110″,”M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z”]},Kt={prefix:”fas”,iconName:”check”,icon:[448,512,[10003,10004],”f00c”,”M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z”]},Yt={prefix:”fas”,iconName:”circle-xmark”,icon:[512,512,[61532,”times-circle”,”xmark-circle”],”f057″,”M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z”]};function Wt(e){let t,r,n,o,i,a,s;function c(e,t){return”string”==typeof e[16][4]?Qt:Jt}let l=c(e),u=l(e);return{c(){t=E(“svg”),r=E(“g”),n=E(“g”),u.c(),_(n,”transform”,e[15]),_(r,”transform”,o=”translate(“+e[16][0]/2+” “+e[16][1]/2+”)”),_(r,”transform-origin”,i=e[16][0]/4+” 0″),_(t,”id”,e[1]),_(t,”class”,a=”svelte-fa svelte-fa-base “+e[0]+” svelte-bvo74f”),_(t,”style”,e[2]),_(t,”viewBox”,s=”0 0 “+e[16][0]+” “+e[16][1]),_(t,”aria-hidden”,”true”),_(t,”role”,”img”),_(t,”xmlns”,”http://www.w3.org/2000/svg”),$(t,”pulse”,e[8]),$(t,”svelte-fa-size-lg”,”lg”===e[3]),$(t,”svelte-fa-size-sm”,”sm”===e[3]),$(t,”svelte-fa-size-xs”,”xs”===e[3]),$(t,”svelte-fa-fw”,e[5]),$(t,”svelte-fa-pull-left”,”left”===e[6]),$(t,”svelte-fa-pull-right”,”right”===e[6]),$(t,”spin”,e[7])},m(o,i){y(o,t,i),h(t,r),h(r,n),u.m(n,null),e[23](t)},p(e,d){l===(l=c(e))&&u?u.p(e,d):(u.d(1),u=l(e),u&&(u.c(),u.m(n,null))),32768&d&&_(n,”transform”,e[15]),65536&d&&o!==(o=”translate(“+e[16][0]/2+” “+e[16][1]/2+”)”)&&_(r,”transform”,o),65536&d&&i!==(i=e[16][0]/4+” 0″)&&_(r,”transform-origin”,i),2&d&&_(t,”id”,e[1]),1&d&&a!==(a=”svelte-fa svelte-fa-base “+e[0]+” svelte-bvo74f”)&&_(t,”class”,a),4&d&&_(t,”style”,e[2]),65536&d&&s!==(s=”0 0 “+e[16][0]+” “+e[16][1])&&_(t,”viewBox”,s),257&d&&$(t,”pulse”,e[8]),9&d&&$(t,”svelte-fa-size-lg”,”lg”===e[3]),9&d&&$(t,”svelte-fa-size-sm”,”sm”===e[3]),9&d&&$(t,”svelte-fa-size-xs”,”xs”===e[3]),33&d&&$(t,”svelte-fa-fw”,e[5]),65&d&&$(t,”svelte-fa-pull-left”,”left”===e[6]),65&d&&$(t,”svelte-fa-pull-right”,”right”===e[6]),129&d&&$(t,”spin”,e[7])},d(r){r&&g(t),u.d(),e[23](null)}}}function Jt(e){let t,r,n,o,i,a,s,c,l,u;return{c(){t=E(“path”),a=E(“path”),_(t,”d”,r=e[16][4][0]),_(t,”fill”,n=e[10]||e[4]||”currentColor”),_(t,”fill-opacity”,o=0!=e[13]?e[11]:e[12]),_(t,”transform”,i=”translate(“+e[16][0]/-2+” “+e[16][1]/-2+”)”),_(a,”d”,s=e[16][4][1]),_(a,”fill”,c=e[9]||e[4]||”currentColor”),_(a,”fill-opacity”,l=0!=e[13]?e[12]:e[11]),_(a,”transform”,u=”translate(“+e[16][0]/-2+” “+e[16][1]/-2+”)”)},m(e,r){y(e,t,r),y(e,a,r)},p(e,d){65536&d&&r!==(r=e[16][4][0])&&_(t,”d”,r),1040&d&&n!==(n=e[10]||e[4]||”currentColor”)&&_(t,”fill”,n),14336&d&&o!==(o=0!=e[13]?e[11]:e[12])&&_(t,”fill-opacity”,o),65536&d&&i!==(i=”translate(“+e[16][0]/-2+” “+e[16][1]/-2+”)”)&&_(t,”transform”,i),65536&d&&s!==(s=e[16][4][1])&&_(a,”d”,s),528&d&&c!==(c=e[9]||e[4]||”currentColor”)&&_(a,”fill”,c),14336&d&&l!==(l=0!=e[13]?e[12]:e[11])&&_(a,”fill-opacity”,l),65536&d&&u!==(u=”translate(“+e[16][0]/-2+” “+e[16][1]/-2+”)”)&&_(a,”transform”,u)},d(e){e&&(g(t),g(a))}}}function Qt(e){let t,r,n,o;return{c(){t=E(“path”),_(t,”d”,r=e[16][4]),_(t,”fill”,n=e[4]||e[9]||”currentColor”),_(t,”transform”,o=”translate(“+e[16][0]/-2+” “+e[16][1]/-2+”)”)},m(e,r){y(e,t,r)},p(e,i){65536&i&&r!==(r=e[16][4])&&_(t,”d”,r),528&i&&n!==(n=e[4]||e[9]||”currentColor”)&&_(t,”fill”,n),65536&i&&o!==(o=”translate(“+e[16][0]/-2+” “+e[16][1]/-2+”)”)&&_(t,”transform”,o)},d(e){e&&g(t)}}}function Zt(t){let r,n=t[16][4]&&Wt(t);return{c(){n&&n.c(),r=C()},m(e,t){n&&n.m(e,t),y(e,r,t)},p(e,[t]){e[16][4]?n?n.p(e,t):(n=Wt(e),n.c(),n.m(r.parentNode,r)):n&&(n.d(1),n=null)},i:e,o:e,d(e){e&&g(r),n&&n.d(e)}}}function Xt(e,t,r){let n,o,i,{class:a}=t,{id:s}=t,{style:c}=t,{icon:l}=t,{size:u}=t,{color:d}=t,{fw:p=!1}=t,{pull:m}=t,{scale:f=1}=t,{translateX:h=0}=t,{translateY:y=0}=t,{rotate:g}=t,{flip:b}=t,{spin:P=!1}=t,{pulse:E=!1}=t,{primaryColor:A=””}=t,{secondaryColor:S=””}=t,{primaryOpacity:C=1}=t,{secondaryOpacity:v=.4}=t,{swapOpacity:T=!1}=t;return e.$$set=e=>{“class”in e&&r(0,a=e.class),”id”in e&&r(1,s=e.id),”style”in e&&r(2,c=e.style),”icon”in e&&r(17,l=e.icon),”size”in e&&r(3,u=e.size),”color”in e&&r(4,d=e.color),”fw”in e&&r(5,p=e.fw),”pull”in e&&r(6,m=e.pull),”scale”in e&&r(18,f=e.scale),”translateX”in e&&r(19,h=e.translateX),”translateY”in e&&r(20,y=e.translateY),”rotate”in e&&r(21,g=e.rotate),”flip”in e&&r(22,b=e.flip),”spin”in e&&r(7,P=e.spin),”pulse”in e&&r(8,E=e.pulse),”primaryColor”in e&&r(9,A=e.primaryColor),”secondaryColor”in e&&r(10,S=e.secondaryColor),”primaryOpacity”in e&&r(11,C=e.primaryOpacity),”secondaryOpacity”in e&&r(12,v=e.secondaryOpacity),”swapOpacity”in e&&r(13,T=e.swapOpacity)},e.$$.update=()=>{16392&e.$$.dirty&&i&&u&&function(e,t){e.style.fontSize=t&&”lg”!==t&&”sm”!==t&&”xs”!==t?t.replace(“x”,”em”):””}(i,u),131072&e.$$.dirty&&r(16,n=l&&l.icon||[0,0,””,[],””]),8126464&e.$$.dirty&&r(15,o=function(e,t,r,n,o,i=1,a=””,s=””){let c=1,l=1;o&&(“horizontal”==o?c=-1:”vertical”==o?l=-1:c=l=-1),”string”==typeof e&&(e=parseFloat(e)),”string”==typeof t&&(t=parseFloat(t)),”string”==typeof r&&(r=parseFloat(r));let u=`translate(${t*i}${a},${r*i}${a}) scale(${c*e},${l*e})`;return n&&(u+=` rotate(${n}${s})`),u}(f,h,y,g,b,512))},[a,s,c,u,d,p,m,P,E,A,S,C,v,T,i,o,n,l,f,h,y,g,b,function(e){U[e?”unshift”:”push”]((()=>{i=e,r(14,i)}))}]}class er extends de{constructor(e){super(),ue(this,e,Xt,Zt,a,{class:0,id:1,style:2,icon:17,size:3,color:4,fw:5,pull:6,scale:18,translateX:19,translateY:20,rotate:21,flip:22,spin:7,pulse:8,primaryColor:9,secondaryColor:10,primaryOpacity:11,secondaryOpacity:12,swapOpacity:13})}}function tr(t){let r,n,o;return n=new er({props:{size:”2x”,icon:Ht,spin:!0}}),{c(){r=P(“div”),ae(n.$$.fragment),_(r,”class”,”spinner-container svelte-1isq5k3″)},m(e,t){y(e,r,t),se(n,r,null),o=!0},p:e,i(e){o||(te(n.$$.fragment,e),o=!0)},o(e){re(n.$$.fragment,e),o=!1},d(e){e&&g(r),ce(n)}}}class rr extends de{constructor(e){super(),ue(this,e,null,tr,a,{})}}function nr(e){let t,r;return t=new rr({}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function or(e){let t,r,n;return r=new rr({}),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”class”,”spinner-overlay svelte-1a5rslt”)},m(e,o){y(e,t,o),se(r,t,null),n=!0},i(e){n||(te(r.$$.fragment,e),n=!0)},o(e){re(r.$$.fragment,e),n=!1},d(e){e&&g(t),ce(r)}}}function ir(e){let t,r,n,o,i,a,s,c,l,u,d,p=!e[2]&&nr(),m=e[3]&&or();return u=new zt({props:{error:e[1]?.message??e[4]??””,isPaymentForm:!0}}),{c(){p&&p.c(),t=S(),r=P(“div”),m&&m.c(),n=S(),o=P(“div”),s=S(),c=P(“div”),l=S(),ae(u.$$.fragment),_(o,”id”,”zuora_payment”),_(o,”class”,i=f(e[0]?”zuora-disabled-iframe-container zuora-dynamic-form-disabled”:””)+” svelte-1a5rslt”),_(r,”class”,a=f(e[3]?”zuora-dynamic-form-disabled form-wrapper”:”form-wrapper”)+” svelte-1a5rslt”),_(c,”id”,”core-style”)},m(e,i){p&&p.m(e,i),y(e,t,i),y(e,r,i),m&&m.m(r,null),h(r,n),h(r,o),y(e,s,i),y(e,c,i),y(e,l,i),se(u,e,i),d=!0},p(e,[s]){e[2]?p&&(X(),re(p,1,1,(()=>{p=null})),ee()):p?4&s&&te(p,1):(p=nr(),p.c(),te(p,1),p.m(t.parentNode,t)),e[3]?m?8&s&&te(m,1):(m=or(),m.c(),te(m,1),m.m(r,n)):m&&(X(),re(m,1,1,(()=>{m=null})),ee()),(!d||1&s&&i!==(i=f(e[0]?”zuora-disabled-iframe-container zuora-dynamic-form-disabled”:””)+” svelte-1a5rslt”))&&_(o,”class”,i),(!d||8&s&&a!==(a=f(e[3]?”zuora-dynamic-form-disabled form-wrapper”:”form-wrapper”)+” svelte-1a5rslt”))&&_(r,”class”,a);const c={};18&s&&(c.error=e[1]?.message??e[4]??””),u.$set(c)},i(e){d||(te(p),te(m),te(u.$$.fragment,e),d=!0)},o(e){re(p),re(m),re(u.$$.fragment,e),d=!1},d(e){e&&(g(t),g(r),g(s),g(c),g(l)),p&&p.d(e),m&&m.d(),ce(u,e)}}}function ar(e,t,r){let{onMountCallback:n}=t,{isDisabled:o}=t,{providerError:i}=t,{isLoaded:a}=t,{isBusy:s}=t,{error:c=null}=t;return k(n),e.$$set=e=>{“onMountCallback”in e&&r(5,n=e.onMountCallback),”isDisabled”in e&&r(0,o=e.isDisabled),”providerError”in e&&r(1,i=e.providerError),”isLoaded”in e&&r(2,a=e.isLoaded),”isBusy”in e&&r(3,s=e.isBusy),”error”in e&&r(4,c=e.error)},[o,i,a,s,c,n]}function sr(t){let r,n;return{c(){r=P(“script”),r.innerHTML=””,_(r,”type”,”text/javascript”),c(r.src,n=”https://static.zuora.com/Resources/libs/hosted/1.3.1/zuora-min.js”)||_(r,”src”,”https://static.zuora.com/Resources/libs/hosted/1.3.1/zuora-min.js”),_(r,”onload”,”window.zuoraLoadCallback()”)},m(e,t){h(document.head,r)},p:e,i:e,o:e,d(e){g(r)}}}function cr(e,t,r){let{onMountCallback:n}=t;return k(n),e.$$set=e=>{“onMountCallback”in e&&r(0,n=e.onMountCallback)},[n]}class lr extends de{constructor(e){super(),ue(this,e,cr,sr,a,{onMountCallback:0})}}const ur=”braintree”,dr=”stripe”,pr=”zuora-billing”,mr=new Headers;mr.append(“Content-Type”,”application/json”),mr.append(“Accept”,”application/json”);const fr=async(e,t,r,n=null,o=!1)=>{o||r.updateFormState({serverErrors:[]}),r.incrementRequestCount(n);try{return await fetch(`${r.apiUrlBase}/${e}`,{method:t.method,body:null==t.bodyObject?void 0:JSON.stringify(t.bodyObject),headers:mr,credentials:”include”})}finally{r.decrementRequestCount(n)}},hr=e=>”ONE_OFF”===e.type,yr=(e,t,r,n)=>{if(t.paymentOption.pricePointId)return{url:`blaize/payment/${r}/buy`,body:{product_id:t.paymentOption.productId,price_point_id:t.paymentOption.slug,discount_code:t.promoCodeValid?t.promoCode:void 0,…n}};let o,i,a={};if(Nt(e).changeSubscriptionMode){o=`subscriptions/${t.validChangeFromPlans.find((e=>t.paymentOption.slug===e.planSlug&&t.paymentOption.productId===e.productId)).changesFromSubscription.externalId}`,i=”PATCH”,a={navigated_from:`ChangeForm ${window.location.href}`}}else hr(t.paymentOption)?(o=”payment/buy”,i=”POST”):(o=”subscribe”,i=”POST”);return{url:`zephr/${o}`,method:i,body:{product_id:t.paymentOption.productId,plan_id:t.paymentOption.slug,discount_code:t.promoCodeValid?t.promoCode:void 0,…a,vendor_fields:n??{}}}};let gr;const br=new Promise((function(e){window.braintreeLoadCallback=e})),Pr=e=>({flow:”ONE_OFF”===e.paymentOption.type?”checkout”:”vault”,singleUse:!0,buttonStyle:{shape:”rect”,size:”medium”},commit:!1,currency:e.paymentOption.currencyCode.toLowerCase(),amount:e.paymentOptionPrices.totalPrice}),Er=(e,t)=>fr(“blaize/payment/braintree/token”,{method:”GET”},t,null,!0).then((e=>e.json())).then((e=>e.token));var Ar;!function(e){e.GOOGLE_PAY=”GOOGLE_PAY”,e.APPLE_PAY=”APPLE_PAY”}(Ar||(Ar={}));const Sr=new Promise((function(e){window.googlePayLoadBraintreeCallback=e})),Cr=new Promise((function(e){window.applePayLoadBraintreeCallback=e})),vr=(e,t,r)=>{const n=JSON.parse(e.organisationConfiguration?.braintreeMobilePaymentConfig??”{}”);let o;return Sr.then((()=>{const i=document.getElementById(“google-pay-button”);for(;i.firstChild;)i.removeChild(i.lastChild);if(!n?.google)return i.style.display=”none”,void console.error(“Braintree Mobile payments are not configured in the console”);t=r.getFormState(),o=new window.google.payments.api.PaymentsClient({environment:e.organisationConfiguration.braintreeSandboxEnv?”TEST”:”PRODUCTION”}),br.then((()=>Er(0,r))).then((a=>{window.braintree.client.create({authorization:a},((a,s)=>{for(;i.firstChild;)i.removeChild(i.lastChild);if(a)return console.error(“Error creating braintree client”,a),void(i.style.display=”none”);window.braintree.googlePayment.create({client:s,googlePayVersion:2,googleMerchantId:n.google.googleMerchantId},((n,a)=>{if(n)return console.error(“Error creating braintree client”,n),void(i.style.display=”none”);o.isReadyToPay({apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:a.createPaymentDataRequest().allowedPaymentMethods,existingPaymentMethodRequired:!0}).then((n=>{n.result&&n.paymentMethodPresent||(i.style.display=”none”,console.error(n.paymentMethodPresent?”Google Pay support not found”:”No payment method”),r.updateFormState({serverErrors:[at.MOBILE_PAYMENT_PROCESSING_ERROR]}),dt(e,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]})),i.appendChild(o.createButton({buttonColor:”default”,buttonType:”plain”,buttonSizeMode:”fill”,onClick:()=>{Tr(e,t,r,a,o)}}))}))}))}))}))}))},Tr=(e,t,r,n,o)=>{r.updateFormState({mobilePaymentService:Ar.GOOGLE_PAY,serverErrors:[]});const i=n.createPaymentDataRequest({transactionInfo:{currencyCode:t.paymentOption.currencyCode,totalPriceStatus:”FINAL”,totalPrice:t.paymentOptionPrices.totalPrice.toFixed(2)},emailRequired:!1,shippingAddressRequired:!1});o.loadPaymentData(i).then((function(t){n.parseResponse(t,((t,n)=>{if(t||!n.nonce)return r.updateFormState({serverErrors:[at.MOBILE_PAYMENT_PROCESSING_ERROR],mobilePaymentService:null}),console.error(“Error requesting payment data”,t,n),void dt(e,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]});r.updateFormState({mobilePaymentMethodId:n.nonce}),r.completeSection()}))})).catch((function(t){console.warn(“Error requesting payment data”,t),r.updateFormState({mobilePaymentService:null,serverErrors:[at.MOBILE_PAYMENT_PROCESSING_ERROR]}),dt(e,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]})}))},_r=(e,t,r)=>{const n=document.getElementById(“apple_pay_button”);for(;n.firstChild;)n.removeChild(n.lastChild);return Cr.then((()=>window.ApplePaySession&&window.ApplePaySession.supportsVersion(3)&&window.ApplePaySession.canMakePayments()?br.then((()=>Er(0,r))).then((o=>{window.braintree.client.create({authorization:o},((o,i)=>{if(o)return n.style.display=”none”,void console.error(“Error creating braintree client:”,o);window.braintree.applePay.create({client:i},(function(o,i){for(;n.firstChild;)n.removeChild(n.lastChild);if(o)return n.style.display=”none”,void console.error(“Error creating applePayInstance:”,o);const a=i.createPaymentRequest({total:{label:t.paymentOption.label,amount:t.paymentOptionPrices.totalPrice.toFixed(2)}}),s=document.createElement(“div”);s.classList.add(“apple-pay-button”),s.classList.add(“apple-pay-button-black”),n.appendChild(s),s.addEventListener(“click”,(function(){Or(e,t,r,a,i)}))}))}))})):(n.style.display=”none”,void console.log(“Cannot make payments with Apple Pay”))))},Or=(e,t,r,n,o)=>{r.updateFormState({mobilePaymentService:Ar.APPLE_PAY,serverErrors:[]});const i=new ApplePaySession(3,n);i.onvalidatemerchant=function(n){o.performValidation({validationURL:n.validationURL,displayName:t.paymentOption.label},(function(t,n){if(t)return r.updateFormState({serverErrors:[at.MOBILE_PAYMENT_PROCESSING_ERROR],mobilePaymentService:null}),console.log(“err in onvalidatemerchant in apple pay configuration: “,t),void dt(e,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]});i.completeMerchantValidation(n)}))},i.onpaymentauthorized=function(t){o.tokenize({token:t.payment.token},(function(t,n){if(t)return r.updateFormState({serverErrors:[at.MOBILE_PAYMENT_PROCESSING_ERROR],mobilePaymentService:null}),console.error(“Error tokenizing Apple Pay:”,t),dt(e,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]}),void i.completePayment(ApplePaySession.STATUS_FAILURE);r.updateFormState({mobilePaymentMethodId:n.nonce}),r.completeSection(),i.completePayment(ApplePaySession.STATUS_SUCCESS)}))},i.begin()},Ir=[“BIF”,”CLP”,”DJF”,”GNF”,”JPY”,”KMF”,”KRW”,”MGA”,”PYG”,”RWF”,”UGX”,”VND”,”VUV”,”XAF”,”XOF”,”XPF”],wr=e=>Ir.includes(e),Rr=e=>{const t=JSON.parse(e??”{}”);return{variables:{color:t?.color?.text?.main??”#32325d”,fontFamily:`${t?.typography?.body?.font}, ${t?.typography?.body?.fallbackFont}, “Helvetica Neue”, Helvetica, sans-serif`,fontSmooth:”always”,fontSizeBase:”16px”,colorWarningText:t?.color?.warning?.main??”#fa755a”,colorIconCardError:t?.color?.warning?.main??”#fa755a”,borderRadius:`${t?.input?.borderRadius??”4″}px`},rules:{“.Input::placeholder”:{color:”#aab7c4″}}}},Mr={base:{color:”#32325d”,fontFamily:'”Helvetica Neue”, Helvetica, sans-serif’,fontSmoothing:”antialiased”,fontSize:”16px”,”::placeholder”:{color:”#aab7c4″}},invalid:{color:”#fa755a”,iconColor:”#fa755a”}},Nr=(e,t,r)=>t.organisationConfiguration.stripeAutomaticTaxEnabled&&t.formType!==wt.LIST_SUBSCRIPTIONS||Nt(t).paymentProviderFormConfig?.usePaymentElement?((e,t,r)=>{const n=r.getFormState(),o=wr(n.paymentOption.currencyCode.toUpperCase())?1:100;return e.elements({mode:”payment”,currency:n.paymentOption.currencyCode.toLowerCase(),amount:parseFloat((n.paymentOptionPrices.totalPrice*o).toFixed(2)),setup_future_usage:”off_session”,appearance:Rr(t.organisationConfiguration.siteStyles),paymentMethodTypes:[“card”]}).create(“payment”,{terms:{card:”never”},wallets:{applePay:”never”,googlePay:”never”}})})(e,t,r):(e=>e.elements().create(“card”,{style:Mr}))(e); /*! * mustache.js – Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ var $r=Object.prototype.toString,Lr=Array.isArray||function(e){return”[object Array]”===$r.call(e)};function xr(e){return”function”==typeof e}function Fr(e){return e.replace(/[-[]{}()*+?.,\^$|#s]/g,”\$&”)}function zr(e,t){return null!=e&&”object”==typeof e&&t in e}var kr=RegExp.prototype.test;var Dr=/S/;function Br(e){return!function(e,t){return kr.call(e,t)}(Dr,e)}var Ur={“&”:”&”,””:”>”,'”‘:”””,”‘”:”‘”,”/”:”/”,”`”:”`”,”=”:”=”};var Gr=/s*/,Vr=/s+/,qr=/s*=/,jr=/s*}/,Hr=/#|^|/|>|{|&|=|!/;function Kr(e){this.string=e,this.tail=e,this.pos=0}function Yr(e,t){this.view=e,this.cache={“.”:this.view},this.parent=t}function Wr(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Kr.prototype.eos=function(){return””===this.tail},Kr.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return””;var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},Kr.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail=””;break;case 0:t=””;break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},Yr.prototype.push=function(e){return new Yr(e,this)},Yr.prototype.lookup=function(e){var t,r,n,o=this.cache;if(o.hasOwnProperty(e))t=o[e];else{for(var i,a,s,c=this,l=!1;c;){if(e.indexOf(“.”)>0)for(i=c.view,a=e.split(“.”),s=0;null!=i&&s<a.length;)s===a.length-1&&(l=zr(i,a[s])||(r=i,n=a[s],null!=r&&"object"!=typeof r&&r.hasOwnProperty&&r.hasOwnProperty(n))),i=i[a[s++]];else i=c.view[e],l=zr(c.view,e);if(l){t=i;break}c=c.parent}o[e]=t}return xr(t)&&(t=t.call(this.view)),t},Wr.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},Wr.prototype.parse=function(e,t){var r=this.templateCache,n=e+":"+(t||Jr.tags).join(":"),o=void 0!==r,i=o?r.get(n):void 0;return null==i&&(i=function(e,t){if(!e)return[];var r,n,o,i=!1,a=[],s=[],c=[],l=!1,u=!1,d="",p=0;function m(){if(l&&!u)for(;c.length;)delete s[c.pop()];else c=[];l=!1,u=!1}function f(e){if("string"==typeof e&&(e=e.split(Vr,2)),!Lr(e)||2!==e.length)throw new Error("Invalid tags: "+e);r=new RegExp(Fr(e[0])+"\s*"),n=new RegExp("\s*"+Fr(e[1])),o=new RegExp("\s*"+Fr("}"+e[1]))}f(t||Jr.tags);for(var h,y,g,b,P,E,A=new Kr(e);!A.eos();){if(h=A.pos,g=A.scanUntil(r))for(var S=0,C=g.length;S"==y?[y,g,h,A.pos,d,p,i]:[y,g,h,A.pos],p++,s.push(P),"#"===y||"^"===y)a.push(P);else if("/"===y){if(!(E=a.pop()))throw new Error('Unopened section "'+g+'" at '+h);if(E[1]!==g)throw new Error('Unclosed section "'+E[1]+'" at '+h)}else"name"===y||"{"===y||"&"===y?u=!0:"="===y&&f(g)}if(m(),E=a.pop())throw new Error('Unclosed section "'+E[1]+'" at '+A.pos);return function(e){for(var t,r=[],n=r,o=[],i=0,a=e.length;i0?o[o.length-1][4]:r;break;default:n.push(t)}return r}(function(e){for(var t,r,n=[],o=0,i=e.length;o<i;++o)(t=e[o])&&("text"===t[0]&&r&&"text"===r[0]?(r[1]+=t[1],r[3]=t[3]):(n.push(t),r=t));return n}(s))}(e,t),o&&r.set(n,i)),i},Wr.prototype.render=function(e,t,r,n){var o=this.getConfigTags(n),i=this.parse(e,o),a=t instanceof Yr?t:new Yr(t,void 0);return this.renderTokens(i,a,r,e,n)},Wr.prototype.renderTokens=function(e,t,r,n,o){for(var i,a,s,c="",l=0,u=e.length;l“===a?s=this.renderPartial(i,t,r,o):”&”===a?s=this.unescapedValue(i,t):”name”===a?s=this.escapedValue(i,t,o):”text”===a&&(s=this.rawValue(i)),void 0!==s&&(c+=s);return c},Wr.prototype.renderSection=function(e,t,r,n,o){var i=this,a=””,s=t.lookup(e[1]);if(s){if(Lr(s))for(var c=0,l=s.length;cJr.render(e,t),Xr=async e=>{try{return await fr(“blaize/profile”,{method:”GET”},e).then((e=>e.json()))}catch(e){return console.error(“Failed to fetch user attributes:”,e),{}}},en=async e=>{try{const t=await fr(“zephr/public/sessions/v1/sessions”,{method:”GET”},e,null,!0);return await t.json()}catch(e){return console.error(“Failed to fetch sessions:”,e),[]}},tn=()=>{const e=new URLSearchParams(window.location.search);return{source:e.get(“utm_source”),medium:e.get(“utm_medium”),campaign:e.get(“utm_campaign”),term:e.get(“utm_term”),content:e.get(“utm_content”)}},rn=async(e,t)=>{try{const[r,n]=await Promise.all([en(t),Xr(t)]),o=r.find((e=>e.requestingSession))||null;return{page:{url:window.location.href,path:window.location.pathname,searchParameters:Object.fromEntries(new URLSearchParams(window.location.search)),utmParameters:tn(),referrer:document.referrer||null},user:{attributes:n,session:o?{id:o.id,tenantId:o.tenantId,userId:o.userId,deviceName:o.deviceName,browser:o.browser,startDate:o.startDate,ipAddress:o.ipAddress??null,requestingSession:o.requestingSession}:null,geoLocation:{city:o?.city??”unknown”,country:o?.country??”unknown”,state:o?.geoState??”unknown”,ipAddress:o?.ipAddress??null}},form:{id:e.id,outcomeId:e.outcomeId,ruleId:e.ruleId}}}catch(e){throw console.error(“Failed to initialize subscription scope:”,e),e}};let nn,on,an;const sn=e=>nn||(nn=new Promise((function(e){window.stripeLoadCallback=e})).then((()=>(e=>fr(“blaize/payment/stripe/publicKey”,{method:”GET”},e,null,!0).then((e=>e.text())))(e))).then((e=>(on=window.Stripe(e),on)))),cn=(e,t,r)=>{const n=t.paymentMethodId;return r.incrementRequestCount(),n?un(e,t,r,n):on.createPaymentMethod(“card”,an,{}).then((async({error:n,paymentMethod:o})=>{if(n||!o)throw r.decrementRequestCount(),`Error requesting payment method ${JSON.stringify(n)}`;await un(e,t,r,o.id)}))},ln=(e,t,r,n)=>fr(“zephr/payment/stripe/updateSubscription”,{method:”POST”,bodyObject:{payment_method_id:n,subscription_id:t.selectedSubscription.externalId}},r),un=async(e,t,r,n)=>{const o=Nt(e).paymentProviderFormConfig?.subscriptionMetadata||{},i={};if(o){const t=await rn(e,r);for(const[e,r]of Object.entries(o))i[e]=Zr(r,t)||””}const a=!!Object.keys(i).length,{url:s,body:c,method:l}=yr(e,t,dr,{payment_method:n,billing_address_provided:!!t.billingAddress.country,…a?{subscription_metadata:JSON.stringify(i)}:{}});return fr(s,{method:l,bodyObject:c},r).then((async e=>{if(!e?.ok)throw JSON.stringify(e);return e.json()})).then((o=>{if(!o.grant_id){if(“requires_action”===o.paymentIntentStatus)return on.confirmCardPayment(o.clientSecret??o.client_secret).then((s=>{if(s.error||!s.paymentIntent)throw`Error requesting payment method ${JSON.stringify(s)}`;if(hr(t.paymentOption)&&o.payment_intent_id){const{url:s,body:c,method:l}=yr(e,t,dr,{payment_method:n,billing_address_provided:!!t.billingAddress.country,payment_intent_id:o.payment_intent_id,…a?{subscription_metadata:JSON.stringify(i)}:{}});return fr(s,{method:l,bodyObject:c},r).then((e=>{if(!e?.ok)throw e}))}return fr(“blaize/payment/stripe/subscription/confirmation”,{method:”POST”,bodyObject:{subscriptionId:o.subscriptionId}},r).then((e=>{if(!e?.ok)throw e}))}));throw JSON.stringify(o)}})).catch((e=>{throw console.error(e),e})).finally((()=>{r.decrementRequestCount()}))},dn=new Promise((function(e){window.googlePayLoadStripeCallback=e})),pn=async(e,t,r,n,o,i)=>{if(o.googlePay?t.updateFormState({mobilePaymentService:Ar.GOOGLE_PAY,serverErrors:[]}):o.applePay&&t.updateFormState({mobilePaymentService:Ar.APPLE_PAY,serverErrors:[]}),!n)return n.complete(“fail”),t.updateFormState({serverErrors:[at.MOBILE_PAYMENT_PROCESSING_ERROR]}),void dt(i,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]});const a=n.paymentMethod.billing_details.address;if(i.organisationConfiguration.stripeAutomaticTaxEnabled&&(e=await lo(i,t.updateFormState({billingAddress:{country:a.country,postalCode:a.postal_code}}),t)),e=t.updateFormState({paymentMethodId:n.paymentMethod.id}),n.complete(“success”),e.paymentOptionPrices.taxPrice||!e.canAttemptSectionCompletion){const t=e.elementValidity.find((e=>!e.isValid&&”payment”!=e.elementType))?.elementId,r=t?document.getElementById(`zephr-form-${t}`):document.getElementsByClassName(“zephr-form-button”)[0];r?.scrollIntoView({block:”center”})}else t.completeSection()},mn=1e-5,fn=(e,t)=>{try{if(3===t?.length){const r=((e,t)=>new Intl.NumberFormat(void 0,{style:”currency”,currency:t,minimumFractionDigits:Math.abs(e)%1{const o=so(e.organisationConfiguration.paymentProvider);return o.hasProductAddons&&(t.loginRegistrationComplete||t.userSession)?fr(o.productAddonPath,{method:”POST”,bodyObject:{promoCode:t.promoCodeValid?t.promoCode:null,paymentOptions:Nt(e).paymentOptions}},r,null,!0).then((async n=>{if(!n.ok)return console.log(“error loading product addons”,n),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]}),r.updateFormState({addons:[],serverErrors:[at.UNKNOWN]});const o=await n.json();try{const e=o.map((e=>({id:e.id,label:e.label,planPrices:e.paymentOptions.map((e=>({planSlug:e.slug,productId:e.productId,addonPrice:e.addonPrice})))})));return r.updateFormState({addons:e})}catch(e){return console.error(“Error parsing product addons response”,e,o),t}})).then((async t=>(n||await yn(e,t,r),t))):Promise.resolve(t)},yn=async(e,t,r)=>{if(t.currentSection.elements.some((e=>e.type===xe&&!1!==e.config?.enabled))){r.incrementRequestCount();try{await co(e.organisationConfiguration.paymentProvider).loader(e,t,r)}finally{r.decrementRequestCount()}}},gn=e=>e.addons.map((t=>{const r=t.planPrices.find((t=>t.planSlug===e.paymentOption.slug&&t.productId===e.paymentOption.productId));return r&&{label:t.label,addonPrice:r.addonPrice,addonPriceFormattedString:fn(r.addonPrice,e.paymentOption.currencyCode)}})).filter((e=>e)),bn=(e,t,r)=>{const n=gn(t),o=Nt(e).paymentOptions.find((e=>e.productId==t.paymentOption.productId&&e.slug==t.paymentOption.slug)),i=o.price,a=t.discountedPlanPrices.find((e=>e.planSlug===t.paymentOption.slug&&e.productId===t.paymentOption.productId))?.discountPrice;let s=a??i,c=i-s;if(“braintree”===e.organisationConfiguration.paymentProvider&&o.discounts&&o.discounts.length>0){const e=o.discounts.reduce(((e,t)=>e+(t.amount||0)),0);s=Math.max(0,s-e),c=i-s}const l=n.reduce(((e,t)=>e+t.addonPrice),s);return Promise.resolve({slug:t.paymentOption.slug,productId:t.paymentOption.productId,promoCode:t.promoCode,addonPrices:n,billingAddress:t.billingAddress,totalPrice:l,totalPriceFormattedString:fn(l,t.paymentOption.currencyCode),netPrice:i,netPriceFormattedString:fn(i,t.paymentOption.currencyCode),discountPrice:c,discountPriceFormattedPrice:fn(c,t.paymentOption.currencyCode),chargeItems:[]})},Pn=(e,t)=>Nt(e).formCurrency??t.paymentOption?.currencyCode,En=async(e,t,r,n)=>{const o=t.paymentOption&&await lo(e,t,r),[i,a]=(navigator.language??””).split(“-“),s={locale:i||”en”,region:Nt(e).requestCountry||a||”US”,currency:Pn(e,t),amount:`${o?.paymentOptionPrices?.totalPrice??”0.00″}`,profile:Nt(e).paymentProviderFormConfig?.paymentFormNumber??void 0,createPaymentSession:()=>(async(e,t)=>{if(t.getFormState().isBusy)console.warn(“Form is busy – ignoring payment request”);else{t.updateFormState({serverErrors:[],paymentProviderFormBusy:!0}),t.incrementRequestCount();try{const r=await fr(“zephr/public/payment/v1/billing/payment-sessions”,{method:”POST”,bodyObject:{currency:Pn(e,t.getFormState()),amount:t.getFormState().paymentOptionPrices?.totalPrice??.01}},t);if(r.ok)return(await r.json())?.token;console.error(“Error occurred while creating payment session.”,r),t.updateFormState({serverErrors:[at.PAYMENT_PROCESSING_ERROR],paymentProviderFormBusy:!1}),dt(e,”zephr_form_error”,{error:at[at.PAYMENT_PROCESSING_ERROR]})}catch(r){console.error(“Error occurred while creating payment session.”,r),t.updateFormState({serverErrors:[at.PAYMENT_PROCESSING_ERROR],paymentProviderFormBusy:!1}),dt(e,”zephr_form_error”,{error:at[at.PAYMENT_PROCESSING_ERROR]})}}})(e,r),onComplete:t=>((e,t,r)=>{if(!r?.success||!r.paymentMethodId)return t.decrementRequestCount(),console.warn(“Non-success payment result”,r),t.updateFormState({serverErrors:[at.PAYMENT_PROCESSING_ERROR],paymentProviderFormBusy:!1}),void dt(e,”zephr_form_error”,{error:at[at.PAYMENT_PROCESSING_ERROR]});const n=t.getFormState();t.updateFormState({paymentFormComplete:!0,paymentProviderVendorFields:{currency:Pn(e,n),detail:JSON.stringify({refId:r.paymentMethodId,email:n.emailAddress}),…n.dynamicOfferResult?{dynamicOfferResult:JSON.stringify(n.dynamicOfferResult)}:{}}}),t.decrementRequestCount(),t.completeSection()})(e,r,t)},c=window.Zuora(n);(await c.createPaymentForm(s)).mount(“#zuora_payment”),r.updateFormState({paymentProviderFormLoaded:!0})};let An;const Sn=()=>null!=An?An:An=new Promise((function(e){window.zuoraLoadCallback=e})),Cn=e=>Nt(e).paymentProviderFormConfig?.useDynamicForm,vn=(e,t)=>Cn(e)?(async(e,t)=>{const r=await fr(“zephr/public/payment/v1/billing/publishable-key”,{method:”GET”},t);return(await r.json())?.message})(0,t):fr(“plugins/public/zuora-billing/payment-form-token”,{method:”POST”,bodyObject:{hostedPageId:Nt(e).paymentProviderFormConfig.hostedPageId,hostedPageUrl:Nt(e).paymentProviderFormConfig.hostedPageUrl}},t).then((e=>e.json())),Tn=(e,t)=>{const r=e.trim();try{switch(t.toUpperCase()){case”INTEGER”:{const e=parseInt(r,10);if(isNaN(e))throw new Error;return e}case”NUMBER”:{const e=parseFloat(r);if(isNaN(e))throw new Error;return e}case”BOOLEAN”:return”true”===r.toLowerCase();default:return r.toString()}}catch(e){return console.warn(`Error casting custom field value “${r}” to type ${t}`),null}},_n=(e,t,r)=>!Nt(t).changeSubscriptionMode||t.environment.previewMode?e:{…e,products:e.products.map((e=>({…e,paymentPlans:e.paymentPlans.filter((t=>r.validChangeFromPlans.some((r=>r.planSlug===t.planId&&r.productId===e.id))))})))};function On(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function In(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?On(Object(r),!0).forEach((function(t){wn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):On(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rn(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Mn,Nn={countries:{AD:”Andorra”,AE:”United Arab Emirates”,AF:”Afghanistan”,AG:”Antigua and Barbuda”,AI:”Anguilla”,AL:”Albania”,AM:”Armenia”,AO:”Angola”,AQ:”Antarctica”,AR:”Argentina”,AS:”American Samoa”,AT:”Austria”,AU:”Australia”,AW:”Aruba”,AX:”Åland Islands”,AZ:”Azerbaijan”,BA:”Bosnia and Herzegovina”,BB:”Barbados”,BD:”Bangladesh”,BE:”Belgium”,BF:”Burkina Faso”,BG:”Bulgaria”,BH:”Bahrain”,BI:”Burundi”,BJ:”Benin”,BL:”Saint Barthélemy”,BM:”Bermuda”,BN:”Brunei”,BO:”Bolivia”,BQ:”Caribbean Netherlands”,BR:”Brazil”,BS:”Bahamas”,BT:”Bhutan”,BW:”Botswana”,BY:”Belarus”,BZ:”Belize”,CA:”Canada”,CC:”Cocos Islands”,CD:”Democratic Republic of the Congo”,CF:”Central African Republic”,CG:”Republic of the Congo”,CH:”Switzerland”,CI:”Ivory Coast”,CK:”Cook Islands”,CL:”Chile”,CM:”Cameroon”,CN:”China”,CO:”Colombia”,CR:”Costa Rica”,CU:”Cuba”,CV:”Cabo Verde”,CW:”Curaçao”,CX:”Christmas Island”,CY:”Cyprus”,CZ:”Czechia”,DE:”Germany”,DJ:”Djibouti”,DK:”Denmark”,DM:”Dominica”,DO:”Dominican Republic”,DZ:”Algeria”,EC:”Ecuador”,EE:”Estonia”,EG:”Egypt”,EH:”Western Sahara”,ER:”Eritrea”,ES:”Spain”,ET:”Ethiopia”,FI:”Finland”,FJ:”Fiji”,FK:”Falkland Islands”,FM:”Micronesia”,FO:”Faroe Islands”,FR:”France”,GA:”Gabon”,GB:”United Kingdom”,GD:”Grenada”,GE:”Georgia”,GF:”French Guiana”,GG:”Guernsey”,GH:”Ghana”,GI:”Gibraltar”,GL:”Greenland”,GM:”Gambia”,GN:”Guinea”,GP:”Guadeloupe”,GQ:”Equatorial Guinea”,GR:”Greece”,GS:”South Georgia and the South Sandwich Islands”,GT:”Guatemala”,GU:”Guam”,GW:”Guinea-Bissau”,GY:”Guyana”,HK:”Hong Kong”,HN:”Honduras”,HR:”Croatia”,HT:”Haiti”,HU:”Hungary”,ID:”Indonesia”,IE:”Ireland”,IL:”Israel”,IM:”Isle of Man”,IN:”India”,IO:”British Indian Ocean Territory”,IQ:”Iraq”,IR:”Iran”,IS:”Iceland”,IT:”Italy”,JE:”Jersey”,JM:”Jamaica”,JO:”Jordan”,JP:”Japan”,KE:”Kenya”,KG:”Kyrgyzstan”,KH:”Cambodia”,KI:”Kiribati”,KM:”Comoros”,KN:”Saint Kitts and Nevis”,KP:”North Korea”,KR:”South Korea”,KW:”Kuwait”,KY:”Cayman Islands”,KZ:”Kazakhstan”,LA:”Laos”,LB:”Lebanon”,LC:”Saint Lucia”,LI:”Liechtenstein”,LK:”Sri Lanka”,LR:”Liberia”,LS:”Lesotho”,LT:”Lithuania”,LU:”Luxembourg”,LV:”Latvia”,LY:”Libya”,MA:”Morocco”,MC:”Monaco”,MD:”Moldova”,ME:”Montenegro”,MF:”Saint Martin”,MG:”Madagascar”,MH:”Marshall Islands”,MK:”North Macedonia”,ML:”Mali”,MM:”Myanmar”,MN:”Mongolia”,MO:”Macao”,MP:”Northern Mariana Islands”,MQ:”Martinique”,MR:”Mauritania”,MS:”Montserrat”,MT:”Malta”,MU:”Mauritius”,MV:”Maldives”,MW:”Malawi”,MX:”Mexico”,MY:”Malaysia”,MZ:”Mozambique”,NA:”Namibia”,NC:”New Caledonia”,NE:”Niger”,NF:”Norfolk Island”,NG:”Nigeria”,NI:”Nicaragua”,NL:”Netherlands”,NO:”Norway”,NP:”Nepal”,NR:”Nauru”,NU:”Niue”,NZ:”New Zealand”,OM:”Oman”,PA:”Panama”,PE:”Peru”,PF:”French Polynesia”,PG:”Papua New Guinea”,PH:”Philippines”,PK:”Pakistan”,PL:”Poland”,PM:”Saint Pierre and Miquelon”,PN:”Pitcairn”,PR:”Puerto Rico”,PS:”Palestine”,PT:”Portugal”,PW:”Palau”,PY:”Paraguay”,QA:”Qatar”,RE:”Réunion”,RO:”Romania”,RS:”Serbia”,RU:”Russia”,RW:”Rwanda”,SA:”Saudi Arabia”,SB:”Solomon Islands”,SC:”Seychelles”,SD:”Sudan”,SE:”Sweden”,SG:”Singapore”,SH:”Saint Helena, Ascension and Tristan da Cunha”,SI:”Slovenia”,SJ:”Svalbard and Jan Mayen”,SK:”Slovakia”,SL:”Sierra Leone”,SM:”San Marino”,SN:”Senegal”,SO:”Somalia”,SR:”Suriname”,SS:”South Sudan”,ST:”Sao Tome and Principe”,SV:”El Salvador”,SX:”Sint Maarten”,SY:”Syria”,SZ:”Eswatini”,TC:”Turks and Caicos Islands”,TD:”Chad”,TF:”French Southern Territories”,TG:”Togo”,TH:”Thailand”,TJ:”Tajikistan”,TK:”Tokelau”,TL:”Timor-Leste”,TM:”Turkmenistan”,TN:”Tunisia”,TO:”Tonga”,TR:”Türkiye”,TT:”Trinidad and Tobago”,TV:”Tuvalu”,TW:”Taiwan”,TZ:”Tanzania”,UA:”Ukraine”,UG:”Uganda”,UM:”United States Minor Outlying Islands”,US:”United States of America”,UY:”Uruguay”,UZ:”Uzbekistan”,VA:”Holy See”,VC:”Saint Vincent and the Grenadines”,VE:”Venezuela”,VG:”Virgin Islands (UK)”,VI:”Virgin Islands (US)”,VN:”Vietnam”,VU:”Vanuatu”,WF:”Wallis and Futuna”,WS:”Samoa”,YE:”Yemen”,YT:”Mayotte”,ZA:”South Africa”,ZM:”Zambia”,ZW:”Zimbabwe”},timezones:{“Africa/Abidjan”:{u:0,c:[“CI”,”BF”,”GH”,”GM”,”GN”,”IS”,”ML”,”MR”,”SH”,”SL”,”SN”,”TG”]},”Africa/Accra”:{a:”Africa/Abidjan”,c:[“GH”],r:1},”Africa/Addis_Ababa”:{a:”Africa/Nairobi”,c:[“ET”],r:1},”Africa/Algiers”:{u:60,c:[“DZ”]},”Africa/Asmara”:{a:”Africa/Nairobi”,c:[“ER”],r:1},”Africa/Asmera”:{a:”Africa/Nairobi”,c:[“ER”],r:1},”Africa/Bamako”:{a:”Africa/Abidjan”,c:[“ML”],r:1},”Africa/Bangui”:{a:”Africa/Lagos”,c:[“CF”],r:1},”Africa/Banjul”:{a:”Africa/Abidjan”,c:[“GM”],r:1},”Africa/Bissau”:{u:0,c:[“GW”]},”Africa/Blantyre”:{a:”Africa/Maputo”,c:[“MW”],r:1},”Africa/Brazzaville”:{a:”Africa/Lagos”,c:[“CG”],r:1},”Africa/Bujumbura”:{a:”Africa/Maputo”,c:[“BI”],r:1},”Africa/Cairo”:{u:120,d:180,c:[“EG”]},”Africa/Casablanca”:{u:60,d:0,c:[“MA”]},”Africa/Ceuta”:{u:60,d:120,c:[“ES”]},”Africa/Conakry”:{a:”Africa/Abidjan”,c:[“GN”],r:1},”Africa/Dakar”:{a:”Africa/Abidjan”,c:[“SN”],r:1},”Africa/Dar_es_Salaam”:{a:”Africa/Nairobi”,c:[“TZ”],r:1},”Africa/Djibouti”:{a:”Africa/Nairobi”,c:[“DJ”],r:1},”Africa/Douala”:{a:”Africa/Lagos”,c:[“CM”],r:1},”Africa/El_Aaiun”:{u:60,d:0,c:[“EH”]},”Africa/Freetown”:{a:”Africa/Abidjan”,c:[“SL”],r:1},”Africa/Gaborone”:{a:”Africa/Maputo”,c:[“BW”],r:1},”Africa/Harare”:{a:”Africa/Maputo”,c:[“ZW”],r:1},”Africa/Johannesburg”:{u:120,c:[“ZA”,”LS”,”SZ”]},”Africa/Juba”:{u:120,c:[“SS”]},”Africa/Kampala”:{a:”Africa/Nairobi”,c:[“UG”],r:1},”Africa/Khartoum”:{u:120,c:[“SD”]},”Africa/Kigali”:{a:”Africa/Maputo”,c:[“RW”],r:1},”Africa/Kinshasa”:{a:”Africa/Lagos”,c:[“CD”],r:1},”Africa/Lagos”:{u:60,c:[“NG”,”AO”,”BJ”,”CD”,”CF”,”CG”,”CM”,”GA”,”GQ”,”NE”]},”Africa/Libreville”:{a:”Africa/Lagos”,c:[“GA”],r:1},”Africa/Lome”:{a:”Africa/Abidjan”,c:[“TG”],r:1},”Africa/Luanda”:{a:”Africa/Lagos”,c:[“AO”],r:1},”Africa/Lubumbashi”:{a:”Africa/Maputo”,c:[“CD”],r:1},”Africa/Lusaka”:{a:”Africa/Maputo”,c:[“ZM”],r:1},”Africa/Malabo”:{a:”Africa/Lagos”,c:[“GQ”],r:1},”Africa/Maputo”:{u:120,c:[“MZ”,”BI”,”BW”,”CD”,”MW”,”RW”,”ZM”,”ZW”]},”Africa/Maseru”:{a:”Africa/Johannesburg”,c:[“LS”],r:1},”Africa/Mbabane”:{a:”Africa/Johannesburg”,c:[“SZ”],r:1},”Africa/Mogadishu”:{a:”Africa/Nairobi”,c:[“SO”],r:1},”Africa/Monrovia”:{u:0,c:[“LR”]},”Africa/Nairobi”:{u:180,c:[“KE”,”DJ”,”ER”,”ET”,”KM”,”MG”,”SO”,”TZ”,”UG”,”YT”]},”Africa/Ndjamena”:{u:60,c:[“TD”]},”Africa/Niamey”:{a:”Africa/Lagos”,c:[“NE”],r:1},”Africa/Nouakchott”:{a:”Africa/Abidjan”,c:[“MR”],r:1},”Africa/Ouagadougou”:{a:”Africa/Abidjan”,c:[“BF”],r:1},”Africa/Porto-Novo”:{a:”Africa/Lagos”,c:[“BJ”],r:1},”Africa/Sao_Tome”:{u:0,c:[“ST”]},”Africa/Timbuktu”:{a:”Africa/Abidjan”,c:[“ML”],r:1},”Africa/Tripoli”:{u:120,c:[“LY”]},”Africa/Tunis”:{u:60,c:[“TN”]},”Africa/Windhoek”:{u:120,c:[“NA”]},”America/Adak”:{u:-600,d:-540,c:[“US”]},”America/Anchorage”:{u:-540,d:-480,c:[“US”]},”America/Anguilla”:{a:”America/Puerto_Rico”,c:[“AI”],r:1},”America/Antigua”:{a:”America/Puerto_Rico”,c:[“AG”],r:1},”America/Araguaina”:{u:-180,c:[“BR”]},”America/Argentina/Buenos_Aires”:{u:-180,c:[“AR”]},”America/Argentina/Catamarca”:{u:-180,c:[“AR”]},”America/Argentina/ComodRivadavia”:{a:”America/Argentina/Catamarca”,r:1},”America/Argentina/Cordoba”:{u:-180,c:[“AR”]},”America/Argentina/Jujuy”:{u:-180,c:[“AR”]},”America/Argentina/La_Rioja”:{u:-180,c:[“AR”]},”America/Argentina/Mendoza”:{u:-180,c:[“AR”]},”America/Argentina/Rio_Gallegos”:{u:-180,c:[“AR”]},”America/Argentina/Salta”:{u:-180,c:[“AR”]},”America/Argentina/San_Juan”:{u:-180,c:[“AR”]},”America/Argentina/San_Luis”:{u:-180,c:[“AR”]},”America/Argentina/Tucuman”:{u:-180,c:[“AR”]},”America/Argentina/Ushuaia”:{u:-180,c:[“AR”]},”America/Aruba”:{a:”America/Puerto_Rico”,c:[“AW”],r:1},”America/Asuncion”:{u:-240,d:-180,c:[“PY”]},”America/Atikokan”:{a:”America/Panama”,c:[“CA”],r:1},”America/Atka”:{a:”America/Adak”,r:1},”America/Bahia”:{u:-180,c:[“BR”]},”America/Bahia_Banderas”:{u:-360,c:[“MX”]},”America/Barbados”:{u:-240,c:[“BB”]},”America/Belem”:{u:-180,c:[“BR”]},”America/Belize”:{u:-360,c:[“BZ”]},”America/Blanc-Sablon”:{a:”America/Puerto_Rico”,c:[“CA”],r:1},”America/Boa_Vista”:{u:-240,c:[“BR”]},”America/Bogota”:{u:-300,c:[“CO”]},”America/Boise”:{u:-420,d:-360,c:[“US”]},”America/Buenos_Aires”:{a:”America/Argentina/Buenos_Aires”,r:1},”America/Cambridge_Bay”:{u:-420,d:-360,c:[“CA”]},”America/Campo_Grande”:{u:-240,c:[“BR”]},”America/Cancun”:{u:-300,c:[“MX”]},”America/Caracas”:{u:-240,c:[“VE”]},”America/Catamarca”:{a:”America/Argentina/Catamarca”,r:1},”America/Cayenne”:{u:-180,c:[“GF”]},”America/Cayman”:{a:”America/Panama”,c:[“KY”],r:1},”America/Chicago”:{u:-360,d:-300,c:[“US”]},”America/Chihuahua”:{u:-360,c:[“MX”]},”America/Ciudad_Juarez”:{u:-420,d:-360,c:[“MX”]},”America/Coral_Harbour”:{a:”America/Panama”,c:[“CA”],r:1},”America/Cordoba”:{a:”America/Argentina/Cordoba”,r:1},”America/Costa_Rica”:{u:-360,c:[“CR”]},”America/Creston”:{a:”America/Phoenix”,c:[“CA”],r:1},”America/Cuiaba”:{u:-240,c:[“BR”]},”America/Curacao”:{a:”America/Puerto_Rico”,c:[“CW”],r:1},”America/Danmarkshavn”:{u:0,c:[“GL”]},”America/Dawson”:{u:-420,c:[“CA”]},”America/Dawson_Creek”:{u:-420,c:[“CA”]},”America/Denver”:{u:-420,d:-360,c:[“US”]},”America/Detroit”:{u:-300,d:-240,c:[“US”]},”America/Dominica”:{a:”America/Puerto_Rico”,c:[“DM”],r:1},”America/Edmonton”:{u:-420,d:-360,c:[“CA”]},”America/Eirunepe”:{u:-300,c:[“BR”]},”America/El_Salvador”:{u:-360,c:[“SV”]},”America/Ensenada”:{a:”America/Tijuana”,r:1},”America/Fort_Nelson”:{u:-420,c:[“CA”]},”America/Fort_Wayne”:{a:”America/Indiana/Indianapolis”,r:1},”America/Fortaleza”:{u:-180,c:[“BR”]},”America/Glace_Bay”:{u:-240,d:-180,c:[“CA”]},”America/Godthab”:{a:”America/Nuuk”,r:1},”America/Goose_Bay”:{u:-240,d:-180,c:[“CA”]},”America/Grand_Turk”:{u:-300,d:-240,c:[“TC”]},”America/Grenada”:{a:”America/Puerto_Rico”,c:[“GD”],r:1},”America/Guadeloupe”:{a:”America/Puerto_Rico”,c:[“GP”],r:1},”America/Guatemala”:{u:-360,c:[“GT”]},”America/Guayaquil”:{u:-300,c:[“EC”]},”America/Guyana”:{u:-240,c:[“GY”]},”America/Halifax”:{u:-240,d:-180,c:[“CA”]},”America/Havana”:{u:-300,d:-240,c:[“CU”]},”America/Hermosillo”:{u:-420,c:[“MX”]},”America/Indiana/Indianapolis”:{u:-300,d:-240,c:[“US”]},”America/Indiana/Knox”:{u:-360,d:-300,c:[“US”]},”America/Indiana/Marengo”:{u:-300,d:-240,c:[“US”]},”America/Indiana/Petersburg”:{u:-300,d:-240,c:[“US”]},”America/Indiana/Tell_City”:{u:-360,d:-300,c:[“US”]},”America/Indiana/Vevay”:{u:-300,d:-240,c:[“US”]},”America/Indiana/Vincennes”:{u:-300,d:-240,c:[“US”]},”America/Indiana/Winamac”:{u:-300,d:-240,c:[“US”]},”America/Indianapolis”:{a:”America/Indiana/Indianapolis”,r:1},”America/Inuvik”:{u:-420,d:-360,c:[“CA”]},”America/Iqaluit”:{u:-300,d:-240,c:[“CA”]},”America/Jamaica”:{u:-300,c:[“JM”]},”America/Jujuy”:{a:”America/Argentina/Jujuy”,r:1},”America/Juneau”:{u:-540,d:-480,c:[“US”]},”America/Kentucky/Louisville”:{u:-300,d:-240,c:[“US”]},”America/Kentucky/Monticello”:{u:-300,d:-240,c:[“US”]},”America/Knox_IN”:{a:”America/Indiana/Knox”,r:1},”America/Kralendijk”:{a:”America/Puerto_Rico”,c:[“BQ”],r:1},”America/La_Paz”:{u:-240,c:[“BO”]},”America/Lima”:{u:-300,c:[“PE”]},”America/Los_Angeles”:{u:-480,d:-420,c:[“US”]},”America/Louisville”:{a:”America/Kentucky/Louisville”,r:1},”America/Lower_Princes”:{a:”America/Puerto_Rico”,c:[“SX”],r:1},”America/Maceio”:{u:-180,c:[“BR”]},”America/Managua”:{u:-360,c:[“NI”]},”America/Manaus”:{u:-240,c:[“BR”]},”America/Marigot”:{a:”America/Puerto_Rico”,c:[“MF”],r:1},”America/Martinique”:{u:-240,c:[“MQ”]},”America/Matamoros”:{u:-360,d:-300,c:[“MX”]},”America/Mazatlan”:{u:-420,c:[“MX”]},”America/Mendoza”:{a:”America/Argentina/Mendoza”,r:1},”America/Menominee”:{u:-360,d:-300,c:[“US”]},”America/Merida”:{u:-360,c:[“MX”]},”America/Metlakatla”:{u:-540,d:-480,c:[“US”]},”America/Mexico_City”:{u:-360,c:[“MX”]},”America/Miquelon”:{u:-180,d:-120,c:[“PM”]},”America/Moncton”:{u:-240,d:-180,c:[“CA”]},”America/Monterrey”:{u:-360,c:[“MX”]},”America/Montevideo”:{u:-180,c:[“UY”]},”America/Montreal”:{a:”America/Toronto”,c:[“CA”],r:1},”America/Montserrat”:{a:”America/Puerto_Rico”,c:[“MS”],r:1},”America/Nassau”:{a:”America/Toronto”,c:[“BS”],r:1},”America/New_York”:{u:-300,d:-240,c:[“US”]},”America/Nipigon”:{a:”America/Toronto”,c:[“CA”],r:1},”America/Nome”:{u:-540,d:-480,c:[“US”]},”America/Noronha”:{u:-120,c:[“BR”]},”America/North_Dakota/Beulah”:{u:-360,d:-300,c:[“US”]},”America/North_Dakota/Center”:{u:-360,d:-300,c:[“US”]},”America/North_Dakota/New_Salem”:{u:-360,d:-300,c:[“US”]},”America/Nuuk”:{u:-120,d:-60,c:[“GL”]},”America/Ojinaga”:{u:-360,d:-300,c:[“MX”]},”America/Panama”:{u:-300,c:[“PA”,”CA”,”KY”]},”America/Pangnirtung”:{a:”America/Iqaluit”,r:1},”America/Paramaribo”:{u:-180,c:[“SR”]},”America/Phoenix”:{u:-420,c:[“US”,”CA”]},”America/Port-au-Prince”:{u:-300,d:-240,c:[“HT”]},”America/Port_of_Spain”:{a:”America/Puerto_Rico”,c:[“TT”],r:1},”America/Porto_Acre”:{a:”America/Rio_Branco”,r:1},”America/Porto_Velho”:{u:-240,c:[“BR”]},”America/Puerto_Rico”:{u:-240,c:[“PR”,”AG”,”CA”,”AI”,”AW”,”BL”,”BQ”,”CW”,”DM”,”GD”,”GP”,”KN”,”LC”,”MF”,”MS”,”SX”,”TT”,”VC”,”VG”,”VI”]},”America/Punta_Arenas”:{u:-180,c:[“CL”]},”America/Rainy_River”:{a:”America/Winnipeg”,r:1},”America/Rankin_Inlet”:{u:-360,d:-300,c:[“CA”]},”America/Recife”:{u:-180,c:[“BR”]},”America/Regina”:{u:-360,c:[“CA”]},”America/Resolute”:{u:-360,d:-300,c:[“CA”]},”America/Rio_Branco”:{u:-300,c:[“BR”]},”America/Rosario”:{a:”America/Argentina/Cordoba”,r:1},”America/Santa_Isabel”:{a:”America/Tijuana”,r:1},”America/Santarem”:{u:-180,c:[“BR”]},”America/Santiago”:{u:-240,d:-180,c:[“CL”]},”America/Santo_Domingo”:{u:-240,c:[“DO”]},”America/Sao_Paulo”:{u:-180,c:[“BR”]},”America/Scoresbysund”:{u:-60,d:0,c:[“GL”]},”America/Shiprock”:{a:”America/Denver”,r:1},”America/Sitka”:{u:-540,d:-480,c:[“US”]},”America/St_Barthelemy”:{a:”America/Puerto_Rico”,c:[“BL”],r:1},”America/St_Johns”:{u:-210,d:-150,c:[“CA”]},”America/St_Kitts”:{a:”America/Puerto_Rico”,c:[“KN”],r:1},”America/St_Lucia”:{a:”America/Puerto_Rico”,c:[“LC”],r:1},”America/St_Thomas”:{a:”America/Puerto_Rico”,c:[“VI”],r:1},”America/St_Vincent”:{a:”America/Puerto_Rico”,c:[“VC”],r:1},”America/Swift_Current”:{u:-360,c:[“CA”]},”America/Tegucigalpa”:{u:-360,c:[“HN”]},”America/Thule”:{u:-240,d:-180,c:[“GL”]},”America/Thunder_Bay”:{a:”America/Toronto”,c:[“CA”],r:1},”America/Tijuana”:{u:-480,d:-420,c:[“MX”]},”America/Toronto”:{u:-300,d:-240,c:[“CA”,”BS”]},”America/Tortola”:{a:”America/Puerto_Rico”,c:[“VG”],r:1},”America/Vancouver”:{u:-480,d:-420,c:[“CA”]},”America/Virgin”:{a:”America/Puerto_Rico”,c:[“VI”],r:1},”America/Whitehorse”:{u:-420,c:[“CA”]},”America/Winnipeg”:{u:-360,d:-300,c:[“CA”]},”America/Yakutat”:{u:-540,d:-480,c:[“US”]},”America/Yellowknife”:{a:”America/Edmonton”,r:1},”Antarctica/Casey”:{u:660,c:[“AQ”]},”Antarctica/Davis”:{u:420,c:[“AQ”]},”Antarctica/DumontDUrville”:{a:”Pacific/Port_Moresby”,c:[“AQ”],r:1},”Antarctica/Macquarie”:{u:600,d:660,c:[“AU”]},”Antarctica/Mawson”:{u:300,c:[“AQ”]},”Antarctica/McMurdo”:{a:”Pacific/Auckland”,c:[“AQ”],r:1},”Antarctica/Palmer”:{u:-180,c:[“AQ”]},”Antarctica/Rothera”:{u:-180,c:[“AQ”]},”Antarctica/South_Pole”:{a:”Pacific/Auckland”,c:[“AQ”],r:1},”Antarctica/Syowa”:{a:”Asia/Riyadh”,c:[“AQ”],r:1},”Antarctica/Troll”:{u:0,d:120,c:[“AQ”]},”Antarctica/Vostok”:{a:”Asia/Urumqi”,c:[“AQ”],r:1},”Arctic/Longyearbyen”:{a:”Europe/Berlin”,c:[“SJ”],r:1},”Asia/Aden”:{a:”Asia/Riyadh”,c:[“YE”],r:1},”Asia/Almaty”:{u:360,c:[“KZ”]},”Asia/Amman”:{u:180,c:[“JO”]},”Asia/Anadyr”:{u:720,c:[“RU”]},”Asia/Aqtau”:{u:300,c:[“KZ”]},”Asia/Aqtobe”:{u:300,c:[“KZ”]},”Asia/Ashgabat”:{u:300,c:[“TM”]},”Asia/Ashkhabad”:{a:”Asia/Ashgabat”,r:1},”Asia/Atyrau”:{u:300,c:[“KZ”]},”Asia/Baghdad”:{u:180,c:[“IQ”]},”Asia/Bahrain”:{a:”Asia/Qatar”,c:[“BH”],r:1},”Asia/Baku”:{u:240,c:[“AZ”]},”Asia/Bangkok”:{u:420,c:[“TH”,”CX”,”KH”,”LA”,”VN”]},”Asia/Barnaul”:{u:420,c:[“RU”]},”Asia/Beirut”:{u:120,d:180,c:[“LB”]},”Asia/Bishkek”:{u:360,c:[“KG”]},”Asia/Brunei”:{a:”Asia/Kuching”,c:[“BN”],r:1},”Asia/Calcutta”:{a:”Asia/Kolkata”,r:1},”Asia/Chita”:{u:540,c:[“RU”]},”Asia/Choibalsan”:{u:480,c:[“MN”]},”Asia/Chongqing”:{a:”Asia/Shanghai”,r:1},”Asia/Chungking”:{a:”Asia/Shanghai”,r:1},”Asia/Colombo”:{u:330,c:[“LK”]},”Asia/Dacca”:{a:”Asia/Dhaka”,r:1},”Asia/Damascus”:{u:180,c:[“SY”]},”Asia/Dhaka”:{u:360,c:[“BD”]},”Asia/Dili”:{u:540,c:[“TL”]},”Asia/Dubai”:{u:240,c:[“AE”,”OM”,”RE”,”SC”,”TF”]},”Asia/Dushanbe”:{u:300,c:[“TJ”]},”Asia/Famagusta”:{u:120,d:180,c:[“CY”]},”Asia/Gaza”:{u:120,d:180,c:[“PS”]},”Asia/Harbin”:{a:”Asia/Shanghai”,r:1},”Asia/Hebron”:{u:120,d:180,c:[“PS”]},”Asia/Ho_Chi_Minh”:{u:420,c:[“VN”]},”Asia/Hong_Kong”:{u:480,c:[“HK”]},”Asia/Hovd”:{u:420,c:[“MN”]},”Asia/Irkutsk”:{u:480,c:[“RU”]},”Asia/Istanbul”:{a:”Europe/Istanbul”,r:1},”Asia/Jakarta”:{u:420,c:[“ID”]},”Asia/Jayapura”:{u:540,c:[“ID”]},”Asia/Jerusalem”:{u:120,d:180,c:[“IL”]},”Asia/Kabul”:{u:270,c:[“AF”]},”Asia/Kamchatka”:{u:720,c:[“RU”]},”Asia/Karachi”:{u:300,c:[“PK”]},”Asia/Kashgar”:{a:”Asia/Urumqi”,c:[“CN”],r:1},”Asia/Kathmandu”:{u:345,c:[“NP”]},”Asia/Katmandu”:{a:”Asia/Kathmandu”,r:1},”Asia/Khandyga”:{u:540,c:[“RU”]},”Asia/Kolkata”:{u:330,c:[“IN”]},”Asia/Krasnoyarsk”:{u:420,c:[“RU”]},”Asia/Kuala_Lumpur”:{a:”Asia/Singapore”,c:[“MY”],r:1},”Asia/Kuching”:{u:480,c:[“MY”,”BN”]},”Asia/Kuwait”:{a:”Asia/Riyadh”,c:[“KW”],r:1},”Asia/Macao”:{a:”Asia/Macau”,r:1},”Asia/Macau”:{u:480,c:[“MO”]},”Asia/Magadan”:{u:660,c:[“RU”]},”Asia/Makassar”:{u:480,c:[“ID”]},”Asia/Manila”:{u:480,c:[“PH”]},”Asia/Muscat”:{a:”Asia/Dubai”,c:[“OM”],r:1},”Asia/Nicosia”:{u:120,d:180,c:[“CY”]},”Asia/Novokuznetsk”:{u:420,c:[“RU”]},”Asia/Novosibirsk”:{u:420,c:[“RU”]},”Asia/Omsk”:{u:360,c:[“RU”]},”Asia/Oral”:{u:300,c:[“KZ”]},”Asia/Phnom_Penh”:{a:”Asia/Bangkok”,c:[“KH”],r:1},”Asia/Pontianak”:{u:420,c:[“ID”]},”Asia/Pyongyang”:{u:540,c:[“KP”]},”Asia/Qatar”:{u:180,c:[“QA”,”BH”]},”Asia/Qostanay”:{u:360,c:[“KZ”]},”Asia/Qyzylorda”:{u:300,c:[“KZ”]},”Asia/Rangoon”:{a:”Asia/Yangon”,c:[“MM”],r:1},”Asia/Riyadh”:{u:180,c:[“SA”,”AQ”,”KW”,”YE”]},”Asia/Saigon”:{a:”Asia/Ho_Chi_Minh”,r:1},”Asia/Sakhalin”:{u:660,c:[“RU”]},”Asia/Samarkand”:{u:300,c:[“UZ”]},”Asia/Seoul”:{u:540,c:[“KR”]},”Asia/Shanghai”:{u:480,c:[“CN”]},”Asia/Singapore”:{u:480,c:[“SG”,”MY”]},”Asia/Srednekolymsk”:{u:660,c:[“RU”]},”Asia/Taipei”:{u:480,c:[“TW”]},”Asia/Tashkent”:{u:300,c:[“UZ”]},”Asia/Tbilisi”:{u:240,c:[“GE”]},”Asia/Tehran”:{u:210,c:[“IR”]},”Asia/Tel_Aviv”:{a:”Asia/Jerusalem”,r:1},”Asia/Thimbu”:{a:”Asia/Thimphu”,r:1},”Asia/Thimphu”:{u:360,c:[“BT”]},”Asia/Tokyo”:{u:540,c:[“JP”]},”Asia/Tomsk”:{u:420,c:[“RU”]},”Asia/Ujung_Pandang”:{a:”Asia/Makassar”,r:1},”Asia/Ulaanbaatar”:{u:480,c:[“MN”]},”Asia/Ulan_Bator”:{a:”Asia/Ulaanbaatar”,r:1},”Asia/Urumqi”:{u:360,c:[“CN”,”AQ”]},”Asia/Ust-Nera”:{u:600,c:[“RU”]},”Asia/Vientiane”:{a:”Asia/Bangkok”,c:[“LA”],r:1},”Asia/Vladivostok”:{u:600,c:[“RU”]},”Asia/Yakutsk”:{u:540,c:[“RU”]},”Asia/Yangon”:{u:390,c:[“MM”,”CC”]},”Asia/Yekaterinburg”:{u:300,c:[“RU”]},”Asia/Yerevan”:{u:240,c:[“AM”]},”Atlantic/Azores”:{u:-60,d:0,c:[“PT”]},”Atlantic/Bermuda”:{u:-240,d:-180,c:[“BM”]},”Atlantic/Canary”:{u:0,d:60,c:[“ES”]},”Atlantic/Cape_Verde”:{u:-60,c:[“CV”]},”Atlantic/Faeroe”:{a:”Atlantic/Faroe”,r:1},”Atlantic/Faroe”:{u:0,d:60,c:[“FO”]},”Atlantic/Jan_Mayen”:{a:”Europe/Berlin”,c:[“SJ”],r:1},”Atlantic/Madeira”:{u:0,d:60,c:[“PT”]},”Atlantic/Reykjavik”:{a:”Africa/Abidjan”,c:[“IS”],r:1},”Atlantic/South_Georgia”:{u:-120,c:[“GS”]},”Atlantic/St_Helena”:{a:”Africa/Abidjan”,c:[“SH”],r:1},”Atlantic/Stanley”:{u:-180,c:[“FK”]},”Australia/ACT”:{a:”Australia/Sydney”,r:1},”Australia/Adelaide”:{u:570,d:630,c:[“AU”]},”Australia/Brisbane”:{u:600,c:[“AU”]},”Australia/Broken_Hill”:{u:570,d:630,c:[“AU”]},”Australia/Canberra”:{a:”Australia/Sydney”,r:1},”Australia/Currie”:{a:”Australia/Hobart”,r:1},”Australia/Darwin”:{u:570,c:[“AU”]},”Australia/Eucla”:{u:525,c:[“AU”]},”Australia/Hobart”:{u:600,d:660,c:[“AU”]},”Australia/LHI”:{a:”Australia/Lord_Howe”,r:1},”Australia/Lindeman”:{u:600,c:[“AU”]},”Australia/Lord_Howe”:{u:630,d:660,c:[“AU”]},”Australia/Melbourne”:{u:600,d:660,c:[“AU”]},”Australia/NSW”:{a:”Australia/Sydney”,r:1},”Australia/North”:{a:”Australia/Darwin”,r:1},”Australia/Perth”:{u:480,c:[“AU”]},”Australia/Queensland”:{a:”Australia/Brisbane”,r:1},”Australia/South”:{a:”Australia/Adelaide”,r:1},”Australia/Sydney”:{u:600,d:660,c:[“AU”]},”Australia/Tasmania”:{a:”Australia/Hobart”,r:1},”Australia/Victoria”:{a:”Australia/Melbourne”,r:1},”Australia/West”:{a:”Australia/Perth”,r:1},”Australia/Yancowinna”:{a:”Australia/Broken_Hill”,r:1},”Brazil/Acre”:{a:”America/Rio_Branco”,r:1},”Brazil/DeNoronha”:{a:”America/Noronha”,r:1},”Brazil/East”:{a:”America/Sao_Paulo”,r:1},”Brazil/West”:{a:”America/Manaus”,r:1},CET:{u:60,d:120},CST6CDT:{u:-360,d:-300},”Canada/Atlantic”:{a:”America/Halifax”,r:1},”Canada/Central”:{a:”America/Winnipeg”,r:1},”Canada/Eastern”:{a:”America/Toronto”,c:[“CA”],r:1},”Canada/Mountain”:{a:”America/Edmonton”,r:1},”Canada/Newfoundland”:{a:”America/St_Johns”,r:1},”Canada/Pacific”:{a:”America/Vancouver”,r:1},”Canada/Saskatchewan”:{a:”America/Regina”,r:1},”Canada/Yukon”:{a:”America/Whitehorse”,r:1},”Chile/Continental”:{a:”America/Santiago”,r:1},”Chile/EasterIsland”:{a:”Pacific/Easter”,r:1},Cuba:{a:”America/Havana”,r:1},EET:{u:120,d:180},EST:{u:-300},EST5EDT:{u:-300,d:-240},Egypt:{a:”Africa/Cairo”,r:1},Eire:{a:”Europe/Dublin”,r:1},”Etc/GMT”:{u:0},”Etc/GMT+0″:{a:”Etc/GMT”,r:1},”Etc/GMT+1″:{u:-60},”Etc/GMT+10″:{u:-600},”Etc/GMT+11″:{u:-660},”Etc/GMT+12″:{u:-720},”Etc/GMT+2″:{u:-120},”Etc/GMT+3″:{u:-180},”Etc/GMT+4″:{u:-240},”Etc/GMT+5″:{u:-300},”Etc/GMT+6″:{u:-360},”Etc/GMT+7″:{u:-420},”Etc/GMT+8″:{u:-480},”Etc/GMT+9″:{u:-540},”Etc/GMT-0″:{a:”Etc/GMT”,r:1},”Etc/GMT-1″:{u:60},”Etc/GMT-10″:{u:600},”Etc/GMT-11″:{u:660},”Etc/GMT-12″:{u:720},”Etc/GMT-13″:{u:780},”Etc/GMT-14″:{u:840},”Etc/GMT-2″:{u:120},”Etc/GMT-3″:{u:180},”Etc/GMT-4″:{u:240},”Etc/GMT-5″:{u:300},”Etc/GMT-6″:{u:360},”Etc/GMT-7″:{u:420},”Etc/GMT-8″:{u:480},”Etc/GMT-9″:{u:540},”Etc/GMT0″:{a:”Etc/GMT”,r:1},”Etc/Greenwich”:{a:”Etc/GMT”,r:1},”Etc/UCT”:{a:”Etc/UTC”,r:1},”Etc/UTC”:{u:0},”Etc/Universal”:{a:”Etc/UTC”,r:1},”Etc/Zulu”:{a:”Etc/UTC”,r:1},”Europe/Amsterdam”:{a:”Europe/Brussels”,c:[“NL”],r:1},”Europe/Andorra”:{u:60,d:120,c:[“AD”]},”Europe/Astrakhan”:{u:240,c:[“RU”]},”Europe/Athens”:{u:120,d:180,c:[“GR”]},”Europe/Belfast”:{a:”Europe/London”,c:[“GB”],r:1},”Europe/Belgrade”:{u:60,d:120,c:[“RS”,”BA”,”HR”,”ME”,”MK”,”SI”]},”Europe/Berlin”:{u:60,d:120,c:[“DE”,”DK”,”NO”,”SE”,”SJ”]},”Europe/Bratislava”:{a:”Europe/Prague”,c:[“SK”],r:1},”Europe/Brussels”:{u:60,d:120,c:[“BE”,”LU”,”NL”]},”Europe/Bucharest”:{u:120,d:180,c:[“RO”]},”Europe/Budapest”:{u:60,d:120,c:[“HU”]},”Europe/Busingen”:{a:”Europe/Zurich”,c:[“DE”],r:1},”Europe/Chisinau”:{u:120,d:180,c:[“MD”]},”Europe/Copenhagen”:{a:”Europe/Berlin”,c:[“DK”],r:1},”Europe/Dublin”:{u:60,d:0,c:[“IE”]},”Europe/Gibraltar”:{u:60,d:120,c:[“GI”]},”Europe/Guernsey”:{a:”Europe/London”,c:[“GG”],r:1},”Europe/Helsinki”:{u:120,d:180,c:[“FI”,”AX”]},”Europe/Isle_of_Man”:{a:”Europe/London”,c:[“IM”],r:1},”Europe/Istanbul”:{u:180,c:[“TR”]},”Europe/Jersey”:{a:”Europe/London”,c:[“JE”],r:1},”Europe/Kaliningrad”:{u:120,c:[“RU”]},”Europe/Kiev”:{a:”Europe/Kyiv”,r:1},”Europe/Kirov”:{u:180,c:[“RU”]},”Europe/Kyiv”:{u:120,d:180,c:[“UA”]},”Europe/Lisbon”:{u:0,d:60,c:[“PT”]},”Europe/Ljubljana”:{a:”Europe/Belgrade”,c:[“SI”],r:1},”Europe/London”:{u:0,d:60,c:[“GB”,”GG”,”IM”,”JE”]},”Europe/Luxembourg”:{a:”Europe/Brussels”,c:[“LU”],r:1},”Europe/Madrid”:{u:60,d:120,c:[“ES”]},”Europe/Malta”:{u:60,d:120,c:[“MT”]},”Europe/Mariehamn”:{a:”Europe/Helsinki”,c:[“AX”],r:1},”Europe/Minsk”:{u:180,c:[“BY”]},”Europe/Monaco”:{a:”Europe/Paris”,c:[“MC”],r:1},”Europe/Moscow”:{u:180,c:[“RU”]},”Europe/Nicosia”:{a:”Asia/Nicosia”,r:1},”Europe/Oslo”:{a:”Europe/Berlin”,c:[“NO”],r:1},”Europe/Paris”:{u:60,d:120,c:[“FR”,”MC”]},”Europe/Podgorica”:{a:”Europe/Belgrade”,c:[“ME”],r:1},”Europe/Prague”:{u:60,d:120,c:[“CZ”,”SK”]},”Europe/Riga”:{u:120,d:180,c:[“LV”]},”Europe/Rome”:{u:60,d:120,c:[“IT”,”SM”,”VA”]},”Europe/Samara”:{u:240,c:[“RU”]},”Europe/San_Marino”:{a:”Europe/Rome”,c:[“SM”],r:1},”Europe/Sarajevo”:{a:”Europe/Belgrade”,c:[“BA”],r:1},”Europe/Saratov”:{u:240,c:[“RU”]},”Europe/Simferopol”:{u:180,c:[“RU”,”UA”]},”Europe/Skopje”:{a:”Europe/Belgrade”,c:[“MK”],r:1},”Europe/Sofia”:{u:120,d:180,c:[“BG”]},”Europe/Stockholm”:{a:”Europe/Berlin”,c:[“SE”],r:1},”Europe/Tallinn”:{u:120,d:180,c:[“EE”]},”Europe/Tirane”:{u:60,d:120,c:[“AL”]},”Europe/Tiraspol”:{a:”Europe/Chisinau”,r:1},”Europe/Ulyanovsk”:{u:240,c:[“RU”]},”Europe/Uzhgorod”:{a:”Europe/Kyiv”,r:1},”Europe/Vaduz”:{a:”Europe/Zurich”,c:[“LI”],r:1},”Europe/Vatican”:{a:”Europe/Rome”,c:[“VA”],r:1},”Europe/Vienna”:{u:60,d:120,c:[“AT”]},”Europe/Vilnius”:{u:120,d:180,c:[“LT”]},”Europe/Volgograd”:{u:180,c:[“RU”]},”Europe/Warsaw”:{u:60,d:120,c:[“PL”]},”Europe/Zagreb”:{a:”Europe/Belgrade”,c:[“HR”],r:1},”Europe/Zaporozhye”:{a:”Europe/Kyiv”,r:1},”Europe/Zurich”:{u:60,d:120,c:[“CH”,”DE”,”LI”]},Factory:{u:0},GB:{a:”Europe/London”,c:[“GB”],r:1},”GB-Eire”:{a:”Europe/London”,c:[“GB”],r:1},GMT:{a:”Etc/GMT”,r:1},”GMT+0″:{a:”Etc/GMT”,r:1},”GMT-0″:{a:”Etc/GMT”,r:1},GMT0:{a:”Etc/GMT”,r:1},Greenwich:{a:”Etc/GMT”,r:1},HST:{u:-600},Hongkong:{a:”Asia/Hong_Kong”,r:1},Iceland:{a:”Africa/Abidjan”,c:[“IS”],r:1},”Indian/Antananarivo”:{a:”Africa/Nairobi”,c:[“MG”],r:1},”Indian/Chagos”:{u:360,c:[“IO”]},”Indian/Christmas”:{a:”Asia/Bangkok”,c:[“CX”],r:1},”Indian/Cocos”:{a:”Asia/Yangon”,c:[“CC”],r:1},”Indian/Comoro”:{a:”Africa/Nairobi”,c:[“KM”],r:1},”Indian/Kerguelen”:{a:”Indian/Maldives”,c:[“TF”],r:1},”Indian/Mahe”:{a:”Asia/Dubai”,c:[“SC”],r:1},”Indian/Maldives”:{u:300,c:[“MV”,”TF”]},”Indian/Mauritius”:{u:240,c:[“MU”]},”Indian/Mayotte”:{a:”Africa/Nairobi”,c:[“YT”],r:1},”Indian/Reunion”:{a:”Asia/Dubai”,c:[“RE”],r:1},Iran:{a:”Asia/Tehran”,r:1},Israel:{a:”Asia/Jerusalem”,r:1},Jamaica:{a:”America/Jamaica”,r:1},Japan:{a:”Asia/Tokyo”,r:1},Kwajalein:{a:”Pacific/Kwajalein”,r:1},Libya:{a:”Africa/Tripoli”,r:1},MET:{u:60,d:120},MST:{u:-420},MST7MDT:{u:-420,d:-360},”Mexico/BajaNorte”:{a:”America/Tijuana”,r:1},”Mexico/BajaSur”:{a:”America/Mazatlan”,r:1},”Mexico/General”:{a:”America/Mexico_City”,r:1},NZ:{a:”Pacific/Auckland”,c:[“NZ”],r:1},”NZ-CHAT”:{a:”Pacific/Chatham”,r:1},Navajo:{a:”America/Denver”,r:1},PRC:{a:”Asia/Shanghai”,r:1},PST8PDT:{u:-480,d:-420},”Pacific/Apia”:{u:780,c:[“WS”]},”Pacific/Auckland”:{u:720,d:780,c:[“NZ”,”AQ”]},”Pacific/Bougainville”:{u:660,c:[“PG”]},”Pacific/Chatham”:{u:765,d:825,c:[“NZ”]},”Pacific/Chuuk”:{a:”Pacific/Port_Moresby”,c:[“FM”],r:1},”Pacific/Easter”:{u:-360,d:-300,c:[“CL”]},”Pacific/Efate”:{u:660,c:[“VU”]},”Pacific/Enderbury”:{a:”Pacific/Kanton”,r:1},”Pacific/Fakaofo”:{u:780,c:[“TK”]},”Pacific/Fiji”:{u:720,c:[“FJ”]},”Pacific/Funafuti”:{a:”Pacific/Tarawa”,c:[“TV”],r:1},”Pacific/Galapagos”:{u:-360,c:[“EC”]},”Pacific/Gambier”:{u:-540,c:[“PF”]},”Pacific/Guadalcanal”:{u:660,c:[“SB”,”FM”]},”Pacific/Guam”:{u:600,c:[“GU”,”MP”]},”Pacific/Honolulu”:{u:-600,c:[“US”]},”Pacific/Johnston”:{a:”Pacific/Honolulu”,r:1},”Pacific/Kanton”:{u:780,c:[“KI”]},”Pacific/Kiritimati”:{u:840,c:[“KI”]},”Pacific/Kosrae”:{u:660,c:[“FM”]},”Pacific/Kwajalein”:{u:720,c:[“MH”]},”Pacific/Majuro”:{a:”Pacific/Tarawa”,c:[“MH”],r:1},”Pacific/Marquesas”:{u:-570,c:[“PF”]},”Pacific/Midway”:{a:”Pacific/Pago_Pago”,c:[“UM”],r:1},”Pacific/Nauru”:{u:720,c:[“NR”]},”Pacific/Niue”:{u:-660,c:[“NU”]},”Pacific/Norfolk”:{u:660,d:720,c:[“NF”]},”Pacific/Noumea”:{u:660,c:[“NC”]},”Pacific/Pago_Pago”:{u:-660,c:[“AS”,”UM”]},”Pacific/Palau”:{u:540,c:[“PW”]},”Pacific/Pitcairn”:{u:-480,c:[“PN”]},”Pacific/Pohnpei”:{a:”Pacific/Guadalcanal”,c:[“FM”],r:1},”Pacific/Ponape”:{a:”Pacific/Guadalcanal”,c:[“FM”],r:1},”Pacific/Port_Moresby”:{u:600,c:[“PG”,”AQ”,”FM”]},”Pacific/Rarotonga”:{u:-600,c:[“CK”]},”Pacific/Saipan”:{a:”Pacific/Guam”,c:[“MP”],r:1},”Pacific/Samoa”:{a:”Pacific/Pago_Pago”,c:[“AS”],r:1},”Pacific/Tahiti”:{u:-600,c:[“PF”]},”Pacific/Tarawa”:{u:720,c:[“KI”,”MH”,”TV”,”UM”,”WF”]},”Pacific/Tongatapu”:{u:780,c:[“TO”]},”Pacific/Truk”:{a:”Pacific/Port_Moresby”,c:[“FM”],r:1},”Pacific/Wake”:{a:”Pacific/Tarawa”,c:[“UM”],r:1},”Pacific/Wallis”:{a:”Pacific/Tarawa”,c:[“WF”],r:1},”Pacific/Yap”:{a:”Pacific/Port_Moresby”,c:[“FM”],r:1},Poland:{a:”Europe/Warsaw”,r:1},Portugal:{a:”Europe/Lisbon”,r:1},ROC:{a:”Asia/Taipei”,r:1},ROK:{a:”Asia/Seoul”,r:1},Singapore:{a:”Asia/Singapore”,c:[“SG”],r:1},Turkey:{a:”Europe/Istanbul”,r:1},UCT:{a:”Etc/UTC”,r:1},”US/Alaska”:{a:”America/Anchorage”,r:1},”US/Aleutian”:{a:”America/Adak”,r:1},”US/Arizona”:{a:”America/Phoenix”,c:[“US”],r:1},”US/Central”:{a:”America/Chicago”,r:1},”US/East-Indiana”:{a:”America/Indiana/Indianapolis”,r:1},”US/Eastern”:{a:”America/New_York”,r:1},”US/Hawaii”:{a:”Pacific/Honolulu”,r:1},”US/Indiana-Starke”:{a:”America/Indiana/Knox”,r:1},”US/Michigan”:{a:”America/Detroit”,r:1},”US/Mountain”:{a:”America/Denver”,r:1},”US/Pacific”:{a:”America/Los_Angeles”,r:1},”US/Samoa”:{a:”Pacific/Pago_Pago”,c:[“AS”],r:1},UTC:{a:”Etc/UTC”,r:1},Universal:{a:”Etc/UTC”,r:1},”W-SU”:{a:”Europe/Moscow”,r:1},WET:{u:0,d:60},Zulu:{a:”Etc/UTC”,r:1}}};function $n(e,t){var r=e.countries[t];if(!r)return null;var n=function(e){Mn||(Mn=function(e){return Object.keys(e.timezones).reduce((function(t,r){var n=e.timezones[r],o=n.c,i=n.a,a=e.timezones[i]||{},s=o||a.c;return s?(s.forEach((function(e){t[e]||Object.assign(t,wn({},e,{current:[],all:[]})),void 0===n.r&&t[e].current.push(r),t[e].all.push(r)})),t):t}),{})}(e));return Mn}(e)[t]||{};return{id:t,name:r,timezones:n.current||[],allTimezones:n.all||[]}}function Ln(e){var t=Math.floor(Math.abs(e)/60),r=e%60;return””.concat(e<0?"-":"+").concat(xn(t),":").concat(xn(r))}function xn(e){var t=Math.abs(e);return"".concat(t1&&void 0!==arguments[1]?arguments[1]:{};return zn[e]||function(e){if(!e)return;zn[e.id]=e}($n(Nn,e)),function(e,t){if(!e)return null;var r=t||{},n=r.deprecated;e.allTimezones;var o=Rn(e,Fn),i=n?e.allTimezones:e.timezones;return In(In({},o),{},{timezones:i})}(zn[e],t)}function Bn(e){return kn[e]||function(e){if(!e)return;kn[e.name]=e,Object.keys(e).length}(function(e,t){var r=e.timezones[t];if(!r)return null;var n=r.a,o=void 0===n?null:n,i=In(In({},o?e.timezones[o]:{}),e.timezones[t]),a=i.c||[],s=i.u,c=Number.isInteger(i.d)?i.d:s,l={name:t,countries:a,utcOffset:s,utcOffsetStr:Ln(s),dstOffset:c,dstOffsetStr:Ln(c),aliasOf:o};return r.r&&(l.deprecated=!0),l}(Nn,e)),kn[e]?In({},kn[e]):null}const Un=()=>{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return((Bn(e)||{}).countries||[]).map((function(e){return Dn(e,t)}))}(e)[0]?.id??””},Gn=e=>”unknown”===e?.toLowerCase()?””:e,Vn=(e,t,r)=>{if(e.environment.previewMode)return(e=>{const t=e?.products?e.products[0].paymentPlans[0].charges[0]:{prices:[{price:25}],chargeData:{name:”Monthly Fee”}},r=t.prices[0]?.price,n=t.chargeData?.name;return{success:!0,contractedMrr:r,totalContractedValue:null,amount:r+3,amountWithoutTax:r,taxAmount:3,invoiceTargetDate:”2024-05-20″,documentDate:”2024-05-20″,invoiceItems:{0:{serviceStartDate:”2024-05-20″,serviceEndDate:”2024-06-19″,chargeAmount:r,taxAmount:3,chargeDescription:””,chargeName:n,productName:”Product”,productRatePlanChargeId:”8ad097b48f533234018f57a8982a5a45″,quantity:1,unitOfMeasure:””}}}})(Nt(e).dynamicOfferPreview??{});const n=t.paymentOption.terms,o={account:{city:Gn(Nt(e).requestCity),country:Gn(Nt(e).requestCountry)||Un(),county:””,state:Gn(Nt(e).requestState),zipCode:Gn(Nt(e).requestZipCode)},currency:Pn(e,t),ratePlanIds:[t.paymentOption.slug],…n?{termType:n.initialTerm.termType,…”TERMED”===n.initialTerm.termType?{initialTerm:n.initialTerm.period,initialTermPeriodType:n.initialTerm.periodType}:{}}:{termType:”EVERGREEN”},…t.dynamicOfferResult?{dynamicOfferResult:JSON.stringify(t.dynamicOfferResult),productId:t.paymentOption.productId}:{}};return fr(“plugins/public/zuora-billing/preview-subscription”,{method:”POST”,bodyObject:o},r).then((e=>e.json()))},qn=(e,t=”en-UK”)=>{if(!e)return””;const r=new Date(e);return Number.isNaN(r.getDate())?”Unknown”:r.toLocaleDateString(t,{day:”numeric”,month:”short”,year:”numeric”})},jn=/^<>$/,Hn=(e,t)=>{if(null==t)return””;const r=e.languagePack?.entries??{},n=st[t];return r[n.languagePackKey]??n.fallbackMessage},Kn=(e,t,r)=>{try{return(e.languagePack?.entries??{})[t]??r}catch(e){return console.warn(`error resolving language pack key in string ${t}`,e),r}},Yn=e=>Kn(e,”pages.common.date-time-format-locale”,”en-US”),Wn=(e,t)=>{try{return null==t?t:”object”==typeof t||Array.isArray(t)?Array.isArray(t)?t.map((t=>Wn(e,t))):Object.entries(t).reduce(((t,[r,n])=>({…t,[r]:Wn(e,n)})),{}):”string”==typeof t||t instanceof String?((e,t)=>{if(!t)return t;try{const r=jn.exec(t);return r&&r[1]?(e?.entries??{})[r[1]]??r[2]:t}catch(e){return console.warn(`error resolving language pack key in string ${t}`,e),t}})(e,t):t}catch(e){return console.warn(“error resolving language pack entries”,e),t}},Jn=(e,t)=>{try{if(t.isOneOff)return””;const r=Kn(e,”forms.billing.history.every”,”every”),n=t[“transaction-history”]?.[0]??t[“next-billing-time”],o=n?.[“human-readable-amount”];if(!o)return””;const i=t.currency_code?.toUpperCase()??o.replace(/[0-9,.]/g,””),{discounts_applied:a,pre_discount_price:s,billing_frequency:c,billing_frequency_unit:l}=t??{};if(!a&&s&&c&&l)return 1===c?`${i} ${s}/${l.toLowerCase()}`:`${i} ${s} ${r} ${c} ${l.toLowerCase()}s`;const u=Number(o.replace(/[^d.-]/g,””)),d=Number.isInteger(u)?u.toFixed(0):u;return 1===n.cycleCount?`${i}${d}/${n.cycle}`:`${i} ${d} ${r} ${n.cycleCount} ${n.cycle}s`}catch{return console.error(“Failed to get subscription amount”),””}},Qn=(e,t,r)=>(e?””:”+”)+`${(t/100).toFixed(2)} ${r}`+(e?” incl.”:””),Zn=(e,t)=>{try{const r=t[“default-tax-rates”],n=t[“managed-by”].toLowerCase(),o=”canceled”===t[“subscription-state”].toLowerCase(),i=qn(“stripe”===n?t.ended:t.ends),a=Yn(e);let s=t[“transaction-history”].reduce(((e,t)=>{const o=qn(t.time,a),i=((e,t,r,n)=>{try{const o=new Date(e),i=(()=>{switch(t){case”day”:return o.setDate(o.getDate()+r);case”week”:return o.setDate(o.getDate()+7*r);case”month”:return o.setMonth(o.getMonth()+r);case”year”:return o.setFullYear(o.getFullYear()+r);default:return null}})();return`${qn(e,n)} – ${qn(i,n)}`}catch{return console.error(“Failed to get subscription period”),””}})(t.time,t.cycle,t.cycleCount,a),{cents:s,currency:c,taxRate:l}=t;let u,d;if(l){const{displayName:e,taxInclusive:t,taxPercent:r}=l;({taxes:d,total:u}=((e,t,r,n)=>{try{const o=n*(e/100),i=((e+(r?0:o))/100).toFixed(2);return{taxes:`(${Qn(r,o,t)})`,total:i}}catch{return console.error(“Failed to get subscription tax”),{taxes:””,total:0}}})(s,e,t,r))}else r?.length?({taxes:d,total:u}=((e,t)=>{try{const r=[];let n=e;t.forEach((t=>{const o=t.taxPercent*(e/100),i=Qn(t.taxInclusive,o,t.displayName);r.push(i),n+=t.taxInclusive?0:o}));const o=(n/100).toFixed(2);return{taxes:`(${r.join(“, “)})`,total:o}}catch{return console.error(“Failed to get subscription default tax”),{taxes:””,total:0}}})(s,r)):(u=(s/100).toFixed(2),d=null);return[…e,{date:o,period:i,subtotal:”stripe”===n?(t.cents/100).toFixed(2):null,currency:c,taxes:d,total:u}]}),[]);return o&&(s=[{date:i,period:”canceled”},…s]),s}catch{return console.error(“Failed to get subscription billing history”),null}},Xn=(e,t,r,n)=>fr(`blaize/payment/${e.organisationConfiguration.paymentProvider}/subscriptions`,{method:”GET”},r,null,!0).then((e=>e.ok?e.json():[])).then((t=>t.filter((e=>!n||”active”===e[“subscription-state”]?.toLowerCase())).map((t=>({externalId:t[“external-id”],productId:t[“blaize-product”].id,productLabel:t[“blaize-product”].label??t[“blaize-product”].id,planId:t.plan_id,planLabel:t.plan_name,currency:t.currency_code,status:”active”===t[“subscription-state”]?.toLowerCase()?”active”:”inactive”,nextBillingTime:qn(t[“next-billing-time”]),amount:Jn(e,t),transactionHistory:Zn(e,t)}))))),eo={draft:”pending”,”pending activation”:”pending”,”pending acceptance”:”pending”,active:”active”,cancelled:”inactive”,expired:”inactive”,suspended:”inactive”},to=(e,t)=>fr(“zephr/payment/stripe/create-subscription-previews”,{method:”POST”,bodyObject:{product_id:e.paymentOption.productId,plan_id:e.paymentOption.slug,billing_country:e.billingAddress.country,billing_post_code:e.billingAddress.postalCode,promo_code:e.promoCodeValid?e.promoCode:void 0}},t,null,!0).then((e=>e.json()));function ro(t){let r,n;return{c(){r=P(“script”),r.innerHTML=””,_(r,”type”,”text/javascript”),c(r.src,n=”https://js.zuora.com/payment/v3/zuora.js”)||_(r,”src”,”https://js.zuora.com/payment/v3/zuora.js”),_(r,”onload”,”window.zuoraLoadCallback()”)},m(e,t){h(document.head,r)},p:e,i:e,o:e,d(e){g(r)}}}function no(e,t,r){let{onMountCallback:n}=t;return k(n),e.$$set=e=>{“onMountCallback”in e&&r(0,n=e.onMountCallback)},[n]}class oo extends de{constructor(e){super(),ue(this,e,no,ro,a,{onMountCallback:0})}}const io={[ur]:{loader:(e,t,r)=>{const n=Nt(e).paymentProviderFormConfig?.enablePaypal;r.incrementRequestCount(),br.then((()=>Er(0,r))).then((e=>{window.braintree.dropin.create({authorization:e,container:”#braintree-dropin-container”,…n?{paypal:Pr(t)}:{}},((e,t)=>{if(r.decrementRequestCount(),gr=t,r.updateFormState({paymentProviderFormLoaded:!0}),e)throw e;gr.isPaymentMethodRequestable()&&r.updateFormState({paymentFormComplete:!0}),gr.on(“paymentMethodRequestable”,(()=>{r.updateFormState({paymentFormComplete:!0})})),gr.on(“noPaymentMethodRequestable”,(()=>{r.updateFormState({paymentFormComplete:!1})}))}))})).catch((e=>{console.error(e),r.decrementRequestCount()}))},preLoader:null,completer:async(e,t,r)=>{let n,o;r.incrementRequestCount();const i=new Promise(((e,t)=>{n=e,o=t})),a=e=>{console.error(e),r.decrementRequestCount(),o()};return gr.requestPaymentMethod(((o,i)=>{!o&&i||a(`Error requesting payment method ${JSON.stringify(o)}`);const{url:s,body:c,method:l}=yr(e,t,ur,{payment_nonce:i.nonce,…”PayPalAccount”===i.type?{paypal:!0}:{}});return fr(s,{method:l,bodyObject:c},r).then((e=>{if(e?.ok)return r.decrementRequestCount(),void n();a(e)})).catch((e=>{a(e)}))})),i},changePaymentCompleter:async(e,t,r)=>{let n,o;const i=new Promise(((e,t)=>{n=e,o=t}));return gr.requestPaymentMethod(((e,i)=>(!e&&i||console.error(`Error requesting payment method ${JSON.stringify(e)}`),fr(`blaize/payment/braintree/subscriptions/${t.selectedSubscription?.externalId}`,{method:”PATCH”,bodyObject:{payment_method_nonce:i?.nonce}},r).then((e=>{console.log(e),e?.ok?n():o(e)})).catch((e=>{o(e)}))))),i},component:class extends de{constructor(e){super(),ue(this,e,Dt,kt,a,{onMountCallback:3,providerError:0,isDisabled:1,isLoaded:4,error:2})}},preLoaderComponent:null,promoCodeCheckPath:”blaize/payment/braintree/promo-code-check”,productAddonPath:”blaize/payment/braintree/addons-check”,existingSubscriptionLoader:Xn,priceCalculator:bn,hasProductAddons:!0,hasPromoCodes:()=>!0,internalSubmit:()=>!1,noPaymentForm:()=>!1,canAttemptIncompletePaymentFormSubmission:!1},[dr]:{loader:(e,t,r)=>{r.incrementRequestCount(),sn(r).then((()=>{an=Nr(on,e,r),an.mount(“#stripe-element”),an.addEventListener(“change”,(t=>{r.updateFormState({paymentProviderError:t.error,paymentFormComplete:t.complete,serverErrors:[]}),e.organisationConfiguration.stripeAutomaticTaxEnabled&&e.formType!==wt.LIST_SUBSCRIPTIONS&&((e,t,r)=>{e.complete&&(r.incrementRequestCount(),on.createPaymentMethod(“card”,an,{}).then((({error:e,paymentMethod:t})=>e||!t?(console.error(`Error requesting payment method ${JSON.stringify(e)}`),null):(r.updateFormState({paymentMethodId:t.id}),t?.billing_details?.address))).catch((e=>(console.error(`Error requesting payment method ${JSON.stringify(e)}`),null))).then((e=>lo(t,r.updateFormState({billingAddress:{country:e?.country,postalCode:e?.postal_code}}),r))).catch((e=>{console.error(`Error requesting payment method ${JSON.stringify(e)}`)})).finally((()=>{r.decrementRequestCount()})))})(t,e,r)})),an.addEventListener(“ready”,(()=>{r.updateFormState({paymentProviderFormLoaded:!0})})),r.decrementRequestCount()})).catch((e=>{console.error(e),r.decrementRequestCount()}))},preLoader:null,completer:cn,changePaymentCompleter:(e,t,r)=>{const n=t.paymentMethodId;return r.incrementRequestCount(),n?ln(e,t,r,n):on.createPaymentMethod(“card”,an,{}).then((async({error:n,paymentMethod:o})=>{if(n||!o)throw r.decrementRequestCount(),`Error requesting payment method ${JSON.stringify(n)}`;await fr(“zephr/payment/stripe/setupIntentSecret”,{method:”POST”},r).then((async e=>{const t=(await e.json()).clientSecret;return on.confirmCardSetup(t,{payment_method:{card:an}})})).then((async n=>ln(e,t,r,n.setupIntent.payment_method)))}))},component:class extends de{constructor(e){super(),ue(this,e,Ut,Bt,a,{onMountCallback:4,providerError:0,isDisabled:1,isComplete:2,isLoaded:5,error:3})}},preLoaderComponent:null,promoCodeCheckPath:”zephr/payment/stripe/promo-code-check”,existingSubscriptionLoader:Xn,priceCalculator:(e,t,r)=>e.organisationConfiguration.stripeAutomaticTaxEnabled&&null!=t.billingAddress.country?to(t,r).then((r=>{if(!r.total)return bn(e,t);const n=wr(t.paymentOption.currencyCode.toUpperCase())?1:.01,o=e=>fn(e*n,t.paymentOption.currencyCode);return{slug:t.paymentOption.slug,productId:t.paymentOption.productId,promoCode:t.promoCode,billingAddress:t.billingAddress,addonPrices:[],totalPrice:r.total*n,totalPriceFormattedString:o(r.total),netPrice:r.sub_total*n,netPriceFormattedString:o(r.sub_total),taxPrice:r.tax?r.tax*n:null,taxPriceFormattedString:r.tax?o(r.tax):null,discountPrice:r.discount?r.discount*n:null,discountPriceFormattedPrice:r.discount?o(r.discount):null,chargeItems:[]}})).catch((r=>(console.error(`Error calculating stripe tax preview ${JSON.stringify(r)}`),bn(e,t)))):bn(e,t),changeSubscriptionProrateCalculator:(e,t,r)=>{const n=t.validChangeFromPlans.find((e=>t.paymentOption.slug===e.planSlug&&t.paymentOption.productId===e.productId))?.changesFromSubscription;if(n)return fr(`zephr/payment/stripe/subscriptions/${n.externalId}/change-previews`,{method:”POST”,bodyObject:{plan_id:t.paymentOption.slug}},r).then((e=>e.json())).then((e=>{const r=wr(t.paymentOption.currencyCode.toUpperCase())?1:.01;return{totalPrice:e.total*r,totalPriceFormattedString:fn(e.total*r,t.paymentOption.currencyCode),subTotalPrice:e.sub_total*r,subTotalPriceFormattedString:fn(e.sub_total*r,t.paymentOption.currencyCode)}}));console.error(“No valid change from subscription”)},hasProductAddons:!1,hasPromoCodes:()=>!0,internalSubmit:()=>!1,noPaymentForm:()=>!1,canAttemptIncompletePaymentFormSubmission:!0},[pr]:{loader:(e,t,r)=>{Nt(e).changeSubscriptionMode?r.updateFormState({paymentFormComplete:!0}):Sn().then((()=>vn(e,r))).then((n=>{if(!Pn(e,t))return r.updateFormState({serverErrors:[at.PAYMENT_PROCESSING_ERROR]}),console.error(“Form currency not set”),void dt(e,”zephr_form_error”,{error:at[at.PAYMENT_PROCESSING_ERROR]});if(Cn(e))return En(e,t,r,n);const o={tenantId:n.tenantId,token:n.token,signature:n.signature,key:n.key,id:n.id,url:n.url,style:”inline”,submitEnabled:!0},i={email:t.emailAddress};window.Z.setEventHandler(“onloadCallback”,(()=>{r.updateFormState({paymentProviderFormLoaded:!0})})),window.Z.render(o,i,(n=>{if(“true”!==n.success)return console.error(“Payment failed”,n),r.updateFormState({serverErrors:[at.PAYMENT_PROCESSING_ERROR]}),void dt(e,”zephr_form_error”,{error:at[at.PAYMENT_PROCESSING_ERROR]});r.updateFormState({paymentFormComplete:!0,paymentProviderVendorFields:{currency:Pn(e,t),detail:JSON.stringify({creditCardCountry:n.creditCardCountry,creditCardState:n.creditCardState,refId:n.refId,email:n.email}),…t.dynamicOfferResult?{dynamicOfferResult:JSON.stringify(t.dynamicOfferResult)}:{},…t.paymentOption?.terms?{terms:t.paymentOption.terms}:{},…t.paymentOption?.termsAndConditions?{termsAndConditions:t.paymentOption.termsAndConditions}:{}}}),r.completeSection()}))}))},preLoader:Sn,completer:async(e,t,r)=>{r.incrementRequestCount();try{if(!Nt(e).changeSubscriptionMode&&!t.paymentProviderVendorFields)return console.error(“Flow error – no Zuora vendor fields found”),r.updateFormState({serverErrors:[at.PAYMENT_PROCESSING_ERROR]}),dt(e,”zephr_form_error”,{error:at[at.PAYMENT_PROCESSING_ERROR]}),Promise.resolve();const n=Nt(e).paymentProviderFormConfig?.subscriptionCustomFields||[],o={};if(n?.length){const t=await rn(e,r);for(const e of n){const r=Zr(e.value,t)||””;o[e.name]=Tn(r,e.type)}}const i=!!Object.keys(o).length,a={…t.paymentProviderVendorFields,…i?{subscriptionCustomFields:JSON.stringify(o)}:{}},{url:s,body:c,method:l}=yr(e,t,pr,a);if(e.formType===wt.GIFT_SUBSCRIPTION){const n=Nt(e).requires_address||!1,o={…c,discount_code:t.promoCodeValid?t.promoCode:void 0,vendor_fields:{…c.vendor_fields||{},giftDetails:{recipient_email:t.giftRecipient.email,recipient_name:t.giftRecipient.name,message:t.giftRecipient.customMessage,requires_address:n,recipient_address:{addressLine1:t.giftRecipient.recipientAddress?.addressLine1||””,addressLine2:t.giftRecipient.recipientAddress?.addressLine2||””,city:t.giftRecipient.recipientAddress?.city||””,state:t.giftRecipient.recipientAddress?.state||””,country:t.giftRecipient.recipientAddress?.country||””,postalCode:t.giftRecipient.recipientAddress?.postalCode||””}}}},i=await fr(“zephr/public/gifts/v1/purchase”,{method:”POST”,bodyObject:o},r);return i?.ok?Promise.resolve():(console.error(“Error creating gift subscription”,i),r.updateFormState({serverErrors:[at.PAYMENT_PROCESSING_ERROR]}),Promise.reject())}{const t=Nt(e).changeSubscriptionMode?c:{…c,plan_id:`zuora-billing_product_rate_plan-${c.plan_id}-unused`};return await fr(s,{method:l,bodyObject:t},r).then((e=>{if(!e?.ok)return console.error(“Error when subscribing”,e),Promise.reject()}))}}finally{r.decrementRequestCount(),r.updateFormState({paymentProviderFormBusy:!1})}},changePaymentCompleter:(e,t,r)=>{console.log(t.paymentProviderVendorFields);const n=JSON.parse(t.paymentProviderVendorFields?.detail).refId;return fr(“plugins/public/zuora-billing/update-account”,{method:”POST”,bodyObject:{paymentMethodId:n}},r).then((e=>{if(!e?.ok)return console.error(“Error when changing default payment method”,e),Promise.reject()}))},component:class extends de{constructor(e){super(),ue(this,e,ar,ir,a,{onMountCallback:5,isDisabled:0,providerError:1,isLoaded:2,isBusy:3,error:4})}},preLoaderComponent:e=>e?.useDynamicForm?oo:lr,promoCodeCheckPath:””,promoCodeServiceOverride:async(e,t,r)=>(async(e,t,r)=>{if(e.environment.previewMode)return;const n=Nt(e).dynamicOffer?.id;if(!n)throw Error(“Missing Dynamic Offer id”);let o;try{o=document.cookie.match(/blaize_session=[0-9a-z-]+/)[0].substring(15)}catch{o=null}const i=(t?.dynamicOfferResult?.products??[]).flatMap((e=>e.paymentPlans.map((t=>({id:e.id,payment_plan:{provider:”zuora-billing”,plan_id:t.planId,charges:t.charges.map((e=>({charge_definition_id:e.chargeDefinitionData.productChargeDefinitionId,currency:e.prices[0]?.currency,price:e.prices[0].price})))}}))))),a=await fr(“zephr/public/decisions/v1/promo-codes”,{method:”POST”,bodyObject:{promo_code:t.promoCode,session:o,selected_products:i}},r,”promo-code”);if(!a.ok)return dt(e,”zephr_form_error”,{error:at[at.PROMO_CODE_INVALID_ERROR]}),Promise.resolve(r.updateFormState({promoCodeValid:!1,serverErrors:[at.PROMO_CODE_INVALID_ERROR],discountedPlanPrices:[]}));const s=await a.json(),c=s?.products?.find((e=>e.id===t.paymentOption.productId&&e.paymentPlans.some((e=>e.planId===t.paymentOption.slug))));if(!c)return dt(e,”zephr_form_error”,{error:at[at.PROMO_CODE_INVALID_ERROR]}),Promise.resolve(r.updateFormState({promoCodeValid:!1,serverErrors:[at.PROMO_CODE_INVALID_ERROR],discountedPlanPrices:[]}));const l=r.updateFormState({promoCodeValid:!0,serverErrors:[],discountedPlanPrices:[],originalDynamicOfferResult:t.dynamicOfferResult,dynamicOfferResult:{…t.dynamicOfferResult,…s}});await lo(e,l,r)})(e,t,r),priceCalculator:(e,t,r)=>Sn().then((()=>Vn(e,t,r))).then((r=>({slug:t.paymentOption.slug,productId:t.paymentOption.productId,promoCode:t.promoCode,addonPrices:[],totalPrice:r.amount,totalPriceFormattedString:fn(r.amount,Pn(e,t)),netPrice:r.amountWithoutTax,netPriceFormattedString:fn(r.amountWithoutTax,Pn(e,t)),taxPrice:r.taxAmount||null,taxPriceFormattedString:r.taxAmount?fn(r.taxAmount,Pn(e,t)):null,discountPrice:0,discountPriceFormattedPrice:fn(0,Pn(e,t)),chargeItems:[…Object.values(r.invoiceItems)].filter((e=>e.chargeAmount)).map((r=>({label:r.chargeName,priceFormattedString:fn(r.chargeAmount,Pn(e,t))}))),billingAddress:t.billingAddress}))),existingSubscriptionLoader:(e,t,r,n)=>fr(“plugins/public/zuora-billing/subscriptions”,{method:”GET”},r,null,!0).then((e=>e.json())).then((e=>[…Object.values(e.subscriptions)])).then((r=>r.filter((e=>!n||”active”===e.status?.toLowerCase())).map((r=>{const n=[…Object.values(r.ratePlans)],o=1===n.length?n:n.filter((e=>”Add”===e.lastChangeType));if(1!==o.length&&console.warn(`Subscription ${r.id} has ${o.length} active rate plans`,n),o[0]&&!Nt(e).dynamicOffer?.id&&Pn(e,t)&&![…Object.values(o[0].ratePlanCharges??{})].every((r=>r?.currency===Pn(e,t))))return console.log(`Subscription ${r.id} is not in the form currency`),null;const i=r.contractedMrr&&r.currency&&r.currentTermPeriodType?`${r.currency} ${r.contractedMrr}`:””;return{externalId:r.id,productId:r.SubscriptionExperienceProductID__c,productLabel:o[0]?.productName,planId:o[0]?.productRatePlanId,planLabel:null,currency:o[0]?.ratePlanCharges[0]?.currency,status:eo[r.status?.toLowerCase()]??”inactive”,amount:i}})).filter((e=>e&&null!=e.planId&&null!=e.productId)))),changeSubscriptionProrateCalculator:(e,t,r)=>{const n=t.validChangeFromPlans.find((e=>t.paymentOption.slug===e.planSlug&&t.paymentOption.productId===e.productId))?.changesFromSubscription;if(n)return fr(“plugins/public/zuora-billing/subscription-change-preview”,{method:”POST”,bodyObject:{subscriptionId:n.externalId,newProductRatePlanId:t.paymentOption.slug,currency:Pn(e,t),…t.dynamicOfferResult?{dynamicOfferResult:JSON.stringify(t.dynamicOfferResult),productId:t.paymentOption.productId}:{}}},r).then((e=>e.json())).then((r=>({totalPrice:r.amount,totalPriceFormattedString:fn(r.amount,Pn(e,t)),subTotalPrice:r.amountWithoutTax,subTotalPriceFormattedString:fn(r.amountWithoutTax,Pn(e,t))})));console.error(“No valid change from subscription”)},hasProductAddons:!1,hasPromoCodes:e=>Nt(e).dynamicOffer&&!Nt(e).changeSubscriptionMode,internalSubmit:e=>!Nt(e).changeSubscriptionMode,noPaymentForm:e=>Nt(e).changeSubscriptionMode,canAttemptIncompletePaymentFormSubmission:!1}},ao={[ur]:{loader:async(e,t,r)=>{await vr(e,t,r),await _r(e,t,r)},completer:(e,t,r)=>{const{url:n,body:o,method:i}=yr(e,t,ur,{payment_nonce:t.mobilePaymentMethodId,vault_payment_method:!0});return fr(n,{method:i,bodyObject:o},r).then((e=>{if(!e?.ok)throw JSON.stringify(e)}))},component:class extends de{constructor(e){super(),ue(this,e,Lt,$t,a,{onMountCallback:1,isDisabled:0,disableCoreDependencyHeader:2})}},previewMode:e=>e.environment.previewMode},[dr]:{loader:async(e,t,r)=>{const n=JSON.parse(e.organisationConfiguration?.stripeMobilePaymentConfig??”{}”),o=document.getElementById(“stripe-mobile-pay-button”);return n?.google||n?.apple?dn.then((async()=>await sn(r))).then((i=>{t=r.getFormState();const a=wr(t.paymentOption.currencyCode.toUpperCase())?1:100,s={country:n.google?.countryCode??n.apple?.countryCode,currency:t.paymentOption.currencyCode.toLowerCase(),total:{label:t.paymentOption.label,amount:parseFloat((t.paymentOptionPrices.totalPrice*a).toFixed(2))},requestPayerName:!0},c=i.paymentRequest(s),l=i.elements().create(“paymentRequestButton”,{paymentRequest:c});c.canMakePayment().then((n=>{if(!n||!n.googlePay&&!n.applePay)return console.warn(“Cannot make mobile payments on this browser”,n),void(o.style.display=”none”);l.mount(“#stripe-mobile-pay-button”),c.on(“paymentmethod”,(o=>{pn(t,r,i,o,n,e)}))}))})).catch((t=>{console.error(t),r.updateFormState({serverErrors:[at.UNKNOWN]}),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]})})):(o.style.display=”none”,void console.error(“Stripe Mobile payments are not configured in the console”))},completer:cn,component:class extends de{constructor(e){super(),ue(this,e,qt,Vt,a,{onMountCallback:2,isDisabled:0,disableCoreDependencyHeader:1})}},previewMode:e=>e.environment.previewMode}},so=e=>{const t=io[e];if(!t)throw`Payment provider ${e} not configured.`;return t},co=e=>{const t=ao[e];if(!t)throw`Mobile payment provider ${e} not configured.`;return t},lo=async(e,t,r)=>{if(null!=t.paymentOptionPrices&&t.paymentOptionPrices.productId===t.paymentOption.productId&&t.paymentOptionPrices.slug===t.paymentOption.slug&&t.paymentOptionPrices.promoCode===t.promoCode&&t.paymentOptionPrices.addonPrices==gn(t)&&t.paymentOptionPrices.billingAddress.country===t.billingAddress.country&&t.paymentOptionPrices.billingAddress.postalCode===t.billingAddress.postalCode&&0==t.paymentOptionPrices.addonPrices.length&&0==gn(t).length)return t;r.updateFormState({paymentOptionPrices:null});const n=await so(e.organisationConfiguration.paymentProvider).priceCalculator(e,t,r);return r.updateFormState({paymentOptionPrices:n})};function uo(t){let r,n,o,a;return{c(){r=P(“button”),n=A(t[1]),_(r,”class”,”zephr-form-button svelte-1eqnyqe”),_(r,”type”,”submit”),r.disabled=t[0],$(r,”zephr-payment-form-button”,t[5]),$(r,”zephr-form-button-top-margin”,!t[2]),$(r,”zephr-payment-form-button-top-margin”,t[5]&&!t[2]),$(r,”inputHeight”,t[3]),$(r,”aside”,t[4])},m(e,s){y(e,r,s),h(r,n),o||(a=v(r,”click”,T((function(){i(t[6])&&t[6].apply(this,arguments)}))),o=!0)},p(e,[o]){t=e,2&o&&w(n,t[1]),1&o&&(r.disabled=t[0]),32&o&&$(r,”zephr-payment-form-button”,t[5]),4&o&&$(r,”zephr-form-button-top-margin”,!t[2]),36&o&&$(r,”zephr-payment-form-button-top-margin”,t[5]&&!t[2]),8&o&&$(r,”inputHeight”,t[3]),16&o&&$(r,”aside”,t[4])},i:e,o:e,d(e){e&&g(r),o=!1,a()}}}function po(e,t,r){let{disabled:n}=t,{text:o}=t,{noMargin:i=!1}=t,{inputHeight:a=!1}=t,{aside:s=!1}=t,{isPaymentForm:c=!1}=t,{onClick:l}=t;return e.$$set=e=>{“disabled”in e&&r(0,n=e.disabled),”text”in e&&r(1,o=e.text),”noMargin”in e&&r(2,i=e.noMargin),”inputHeight”in e&&r(3,a=e.inputHeight),”aside”in e&&r(4,s=e.aside),”isPaymentForm”in e&&r(5,c=e.isPaymentForm),”onClick”in e&&r(6,l=e.onClick)},[n,o,i,a,s,c,l]}class mo extends de{constructor(e){super(),ue(this,e,po,uo,a,{disabled:0,text:1,noMargin:2,inputHeight:3,aside:4,isPaymentForm:5,onClick:6})}}function fo(e){let t,r,n=e[1].highlightedText+””;return{c(){t=P(“div”),r=A(n),_(t,”class”,”box-top-text svelte-wecxzz”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){2&t&&n!==(n=e[1].highlightedText+””)&&w(r,n)},d(e){e&&g(t)}}}function ho(e){let t,r,n=e[1].disclaimerMessage+””;return{c(){t=P(“span”),r=A(n),_(t,”class”,”button-sub-text svelte-wecxzz”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){2&t&&n!==(n=e[1].disclaimerMessage+””)&&w(r,n)},d(e){e&&g(t)}}}function yo(e){let t,r,n,o,a,s,c,l,u,d,p,m,f,b,E,A,C,O,I,w=(e[1].description??””)+””,R=e[1].highlightedText&&fo(e);f=new mo({props:{disabled:!1,text:e[1].selectButtonText??”Select Plan”,onClick:e[0],isPaymentForm:!0}});let N=e[1].disclaimerMessage&&ho(e);return{c(){t=P(“div”),r=P(“input”),a=S(),s=P(“div”),c=P(“div”),R&&R.c(),l=S(),u=P(“div”),d=P(“div”),p=S(),m=P(“div”),ae(f.$$.fragment),b=S(),N&&N.c(),_(r,”type”,”radio”),_(r,”name”,”boxSelect”),_(r,”id”,n=”boxSelect-“+e[1].slug+”-“+e[1].productId+”}”),r.value=o=e[1].price,_(r,”class”,”svelte-wecxzz”),_(c,”class”,”box-top svelte-wecxzz”),_(d,”class”,”box-content svelte-wecxzz”),$(d,”styled-box-content”,e[2]),_(m,”class”,”box-bottom svelte-wecxzz”),_(u,”class”,E=”inner-box “+(e[1].highlightedText||””)+” svelte-wecxzz”),_(s,”class”,A=”box-container “+(e[1].highlightedText?”highlighted”:””)+” svelte-wecxzz”),_(s,”aria-hidden”,”true”),M(s,”cursor”,”pointer”),_(t,”class”,”payment-option-wrapper svelte-wecxzz”)},m(n,o){y(n,t,o),h(t,r),h(t,a),h(t,s),h(s,c),R&&R.m(c,null),h(s,l),h(s,u),h(u,d),d.innerHTML=w,h(u,p),h(u,m),se(f,m,null),h(m,b),N&&N.m(m,null),C=!0,O||(I=v(s,”click”,T((function(){i(e[0])&&e[0].apply(this,arguments)}))),O=!0)},p(t,[i]){e=t,(!C||2&i&&n!==(n=”boxSelect-“+e[1].slug+”-“+e[1].productId+”}”))&&_(r,”id”,n),(!C||2&i&&o!==(o=e[1].price))&&(r.value=o),e[1].highlightedText?R?R.p(e,i):(R=fo(e),R.c(),R.m(c,null)):R&&(R.d(1),R=null),(!C||2&i)&&w!==(w=(e[1].description??””)+””)&&(d.innerHTML=w),(!C||4&i)&&$(d,”styled-box-content”,e[2]);const a={};2&i&&(a.text=e[1].selectButtonText??”Select Plan”),1&i&&(a.onClick=e[0]),f.$set(a),e[1].disclaimerMessage?N?N.p(e,i):(N=ho(e),N.c(),N.m(m,null)):N&&(N.d(1),N=null),(!C||2&i&&E!==(E=”inner-box “+(e[1].highlightedText||””)+” svelte-wecxzz”))&&_(u,”class”,E),(!C||2&i&&A!==(A=”box-container “+(e[1].highlightedText?”highlighted”:””)+” svelte-wecxzz”))&&_(s,”class”,A)},i(e){C||(te(f.$$.fragment,e),C=!0)},o(e){re(f.$$.fragment,e),C=!1},d(e){e&&g(t),R&&R.d(),ce(f),N&&N.d(),O=!1,I()}}}function go(e,t,r){let{onSelect:n}=t,{paymentOption:o}=t,{styleDescription:i}=t;return e.$$set=e=>{“onSelect”in e&&r(0,n=e.onSelect),”paymentOption”in e&&r(1,o=e.paymentOption),”styleDescription”in e&&r(2,i=e.styleDescription)},[n,o,i]}class bo extends de{constructor(e){super(),ue(this,e,go,yo,a,{onSelect:0,paymentOption:1,styleDescription:2})}}function Po(e,t,r){const n=e.slice();return n[6]=t[r],n}function Eo(e){let t,r;function n(){return e[5](e[6])}return t=new bo({props:{paymentOption:e[6],styleDescription:e[0].styleDescription,onSelect:n}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(r,o){e=r;const i={};4&o&&(i.paymentOption=e[6]),1&o&&(i.styleDescription=e[0].styleDescription),6&o&&(i.onSelect=n),t.$set(i)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Ao(e){let t,r,n=ne(e[2]),o=[];for(let t=0;tre(o[e],1,1,(()=>{o[e]=null}));return{c(){t=P(“div”);for(let e=0;e<o.length;e+=1)o[e].c();_(t,"class","payment-options-container svelte-15oxdku")},m(e,n){y(e,t,n);for(let e=0;e<o.length;e+=1)o[e]&&o[e].m(t,null);r=!0},p(e,[r]){if(7&r){let a;for(n=ne(e[2]),a=0;a<n.length;a+=1){const i=Po(e,n,a);o[a]?(o[a].p(i,r),te(o[a],1)):(o[a]=Eo(i),o[a].c(),te(o[a],1),o[a].m(t,null))}for(X(),a=n.length;a<o.length;a+=1)i(a);ee()}},i(e){if(!r){for(let e=0;e{8&e.$$.dirty&&r(2,n=o.sort(((e,t)=>e.fieldOrder-t.fieldOrder)))},[i,a,n,o,s,e=>a(e)]}class Co extends de{constructor(e){super(),ue(this,e,So,Ao,a,{paymentOptions:3,config:0,onSelect:1,logView:4})}}const vo=(e,t)=>Nt(e).changeSubscriptionMode?Nt(e).paymentOptions.filter((e=>t.validChangeFromPlans.some((t=>t.productId===e.productId&&t.planSlug===e.slug)))):Nt(e).paymentOptions,To={matches:e=>e.type===be,create:(e,t,r,n)=>({component:Co,props:{paymentOptions:vo(e,t),config:n||{},onSelect:async n=>{r.updateFormState({paymentOption:n,serverErrors:[],billingAddress:{country:null,postalCode:null}}),e.organisationConfiguration.trackFormDataLayerEvents&&await lo(e,t,r);const o=r.getFormState().paymentOptionPrices?.totalPrice;dt(e,”zephr_form_payment_option_selected”,{productId:n.productId,planId:n.slug,price:o}),dt(e,”select_item”,{ecommerce:{items:[{item_id:n.slug,item_name:n.productId,price:o,quantity:1}]}}),dt(e,”add_to_cart”,{ecommerce:{currency:Nt(e).formCurrency??n?.currencyCode,value:o,items:[{item_id:n.slug,item_name:n.productId,price:o,quantity:1}]}}),dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),r.completeSection()},logView:()=>{vo(e,t).forEach((t=>dt(e,”view_item”,{ecommerce:{currency:Nt(e).formCurrency??t?.currencyCode,value:t.price,items:[{item_id:t.slug,item_name:t.productId,price:t.price,quantity:1}]}})))}}})};function _o(e){let t,r,n,o,a;return{c(){t=P(“button”),r=P(“span”),n=A(e[16]),_(r,”class”,”zephr-form-input-inner-text”),$(r,”zephr-payment-form-input-inner-text”,e[7]),_(t,”type”,”button”),_(t,”class”,”zephr-form-input-inner-button”)},m(s,c){y(s,t,c),h(t,r),h(r,n),e[28](t),o||(a=v(t,”click”,T((function(){i(e[17])&&e[17].apply(this,arguments)}))),o=!0)},p(t,o){e=t,65536&o&&w(n,e[16]),128&o&&$(r,”zephr-payment-form-input-inner-text”,e[7])},d(r){r&&g(t),e[28](null),o=!1,a()}}}function Oo(e){let t,r;return t=new zt({props:{error:e[6],isPaymentForm:e[7]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};64&r&&(n.error=e[6]),128&r&&(n.isPaymentForm=e[7]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Io(e){let t,r,n,a,s,c,u,b,E,A,T,O,I,w,R,M,N,L,x=e[16]&&_o(e);const F=e[26].default,z=l(F,e,e[25],null);let k=e[6]&&Oo(e);return{c(){t=P(“div”),r=P(“input”),O=S(),x&&x.c(),I=S(),z&&z.c(),w=S(),k&&k.c(),R=C(),_(r,”id”,e[0]),_(r,”name”,e[1]),r.required=e[3],r.disabled=e[4],_(r,”type”,e[2]),r.value=n=e[8]||null,_(r,”autocomplete”,a=e[19]||null),r.checked=s=e[10]||null,_(r,”placeholder”,c=e[9]||null),_(r,”pattern”,u=e[11]||null),_(r,”min”,b=e[12]||null),_(r,”max”,E=e[13]||null),_(r,”maxlength”,e[15]),_(r,”step”,A=e[14]||null),_(r,”class”,T=f(`zephr-form-input ${e[2]&&`zephr-form-input-${e[2]}`} ${e[7]&&e[2]&&`zephr-payment-form-input-${e[2]}`}`)+” svelte-127vcsp”),$(r,”disabled”,e[4]),$(r,”error”,e[5]||e[6]),$(r,”zephr-form-input-full-width”,e[18]),$(r,”zephr-payment-form-input”,e[7]),$(r,”zephr-payment-form-input-full-width”,e[7]&&e[18]),_(t,”class”,”zephr-form-input-inner-container svelte-127vcsp”),$(t,”zephr-payment-form-input-inner-container”,e[7])},m(n,o){y(n,t,o),h(t,r),e[27](r),h(t,O),x&&x.m(t,null),y(n,I,o),z&&z.m(n,o),y(n,w,o),k&&k.m(n,o),y(n,R,o),M=!0,N||(L=[v(r,”focus”,(function(){i(e[20])&&e[20].apply(this,arguments)})),v(r,”blur”,(function(){i(e[21])&&e[21].apply(this,arguments)})),v(r,”input”,e[24]),v(r,”paste”,e[24])],N=!0)},p(o,[i]){e=o,(!M||1&i)&&_(r,”id”,e[0]),(!M||2&i)&&_(r,”name”,e[1]),(!M||8&i)&&(r.required=e[3]),(!M||16&i)&&(r.disabled=e[4]),(!M||4&i)&&_(r,”type”,e[2]),(!M||256&i&&n!==(n=e[8]||null)&&r.value!==n)&&(r.value=n),(!M||524288&i&&a!==(a=e[19]||null))&&_(r,”autocomplete”,a),(!M||1024&i&&s!==(s=e[10]||null))&&(r.checked=s),(!M||512&i&&c!==(c=e[9]||null))&&_(r,”placeholder”,c),(!M||2048&i&&u!==(u=e[11]||null))&&_(r,”pattern”,u),(!M||4096&i&&b!==(b=e[12]||null))&&_(r,”min”,b),(!M||8192&i&&E!==(E=e[13]||null))&&_(r,”max”,E),(!M||32768&i)&&_(r,”maxlength”,e[15]),(!M||16384&i&&A!==(A=e[14]||null))&&_(r,”step”,A),(!M||132&i&&T!==(T=f(`zephr-form-input ${e[2]&&`zephr-form-input-${e[2]}`} ${e[7]&&e[2]&&`zephr-payment-form-input-${e[2]}`}`)+” svelte-127vcsp”))&&_(r,”class”,T),(!M||148&i)&&$(r,”disabled”,e[4]),(!M||228&i)&&$(r,”error”,e[5]||e[6]),(!M||262276&i)&&$(r,”zephr-form-input-full-width”,e[18]),(!M||132&i)&&$(r,”zephr-payment-form-input”,e[7]),(!M||262276&i)&&$(r,”zephr-payment-form-input-full-width”,e[7]&&e[18]),e[16]?x?x.p(e,i):(x=_o(e),x.c(),x.m(t,null)):x&&(x.d(1),x=null),(!M||128&i)&&$(t,”zephr-payment-form-input-inner-container”,e[7]),z&&z.p&&(!M||33554432&i)&&p(z,F,e,e[25],M?d(F,e[25],i,null):m(e[25]),null),e[6]?k?(k.p(e,i),64&i&&te(k,1)):(k=Oo(e),k.c(),te(k,1),k.m(R.parentNode,R)):k&&(X(),re(k,1,1,(()=>{k=null})),ee())},i(e){M||(te(z,e),te(k),M=!0)},o(e){re(z,e),re(k),M=!1},d(r){r&&(g(t),g(I),g(w),g(R)),e[27](null),x&&x.d(),z&&z.d(r),k&&k.d(r),N=!1,o(L)}}}function wo(e,t,r){let{$$slots:n={},$$scope:o}=t;const i=D();let a,s,{id:c}=t,{name:l=c}=t,{type:u=”text”}=t,{required:d=!0}=t,{disabled:p=!1}=t,{hasError:m=!1}=t,{errorMessage:f=null}=t,{isPaymentForm:h=!1}=t,{value:y=””}=t,{placeholder:g=””}=t,{checked:b=!1}=t,{pattern:P=””}=t,{min:E=0}=t,{max:A=0}=t,{step:S=0}=t,{maxlength:C=null}=t,{innerText:v=null}=t,{innerTextOnClick:T=null}=t,{fill:_=!1}=t,{autocomplete:O=””}=t,{onFocus:I}=t,{onBlur:w}=t;var R;return R=()=>{v&&s&&a&&r(22,a.style.paddingRight=`${s.offsetWidth+8}px`,a)},z().$$.after_update.push(R),e.$$set=e=>{“id”in e&&r(0,c=e.id),”name”in e&&r(1,l=e.name),”type”in e&&r(2,u=e.type),”required”in e&&r(3,d=e.required),”disabled”in e&&r(4,p=e.disabled),”hasError”in e&&r(5,m=e.hasError),”errorMessage”in e&&r(6,f=e.errorMessage),”isPaymentForm”in e&&r(7,h=e.isPaymentForm),”value”in e&&r(8,y=e.value),”placeholder”in e&&r(9,g=e.placeholder),”checked”in e&&r(10,b=e.checked),”pattern”in e&&r(11,P=e.pattern),”min”in e&&r(12,E=e.min),”max”in e&&r(13,A=e.max),”step”in e&&r(14,S=e.step),”maxlength”in e&&r(15,C=e.maxlength),”innerText”in e&&r(16,v=e.innerText),”innerTextOnClick”in e&&r(17,T=e.innerTextOnClick),”fill”in e&&r(18,_=e.fill),”autocomplete”in e&&r(19,O=e.autocomplete),”onFocus”in e&&r(20,I=e.onFocus),”onBlur”in e&&r(21,w=e.onBlur),”$$scope”in e&&r(25,o=e.$$scope)},[c,l,u,d,p,m,f,h,y,g,b,P,E,A,S,C,v,T,_,O,I,w,a,s,e=>{i(“change”,”checkbox”!==u?e.target.value:e.target.checked)},o,n,function(e){U[e?”unshift”:”push”]((()=>{a=e,r(22,a)}))},function(e){U[e?”unshift”:”push”]((()=>{s=e,r(23,s)}))}]}class Ro extends de{constructor(e){super(),ue(this,e,wo,Io,a,{id:0,name:1,type:2,required:3,disabled:4,hasError:5,errorMessage:6,isPaymentForm:7,value:8,placeholder:9,checked:10,pattern:11,min:12,max:13,step:14,maxlength:15,innerText:16,innerTextOnClick:17,fill:18,autocomplete:19,onFocus:20,onBlur:21})}}function Mo(e){let t,r;return{c(){t=P(“span”),r=A(e[1]),_(t,”class”,”svelte-vnzoa4″)},m(e,n){y(e,t,n),h(t,r)},p(e,t){2&t&&w(r,e[1])},d(e){e&&g(t)}}}function No(e){let t,r,n,o,i,a,s=e[1]&&Mo(e);const c=e[6].default,u=l(c,e,e[5],null);return{c(){t=P(“label”),r=P(“span”),n=A(e[2]),o=S(),s&&s.c(),i=S(),u&&u.c(),_(r,”class”,”svelte-vnzoa4″),_(t,”class”,”zephr-form-input-label svelte-vnzoa4″),_(t,”for”,e[0]),_(t,”style”,e[3]),$(t,”zephr-payment-form-input-label”,e[4])},m(e,c){y(e,t,c),h(t,r),h(r,n),h(t,o),s&&s.m(t,null),h(t,i),u&&u.m(t,null),a=!0},p(e,[r]){(!a||4&r)&&w(n,e[2]),e[1]?s?s.p(e,r):(s=Mo(e),s.c(),s.m(t,i)):s&&(s.d(1),s=null),u&&u.p&&(!a||32&r)&&p(u,c,e,e[5],a?d(c,e[5],r,null):m(e[5]),null),(!a||1&r)&&_(t,”for”,e[0]),(!a||8&r)&&_(t,”style”,e[3]),(!a||16&r)&&$(t,”zephr-payment-form-input-label”,e[4])},i(e){a||(te(u,e),a=!0)},o(e){re(u,e),a=!1},d(e){e&&g(t),s&&s.d(),u&&u.d(e)}}}function $o(e,t,r){let{$$slots:n={},$$scope:o}=t,{forInput:i}=t,{sublabel:a=””}=t,{label:s=””}=t,{style:c=””}=t,{isPaymentForm:l=!1}=t;return e.$$set=e=>{“forInput”in e&&r(0,i=e.forInput),”sublabel”in e&&r(1,a=e.sublabel),”label”in e&&r(2,s=e.label),”style”in e&&r(3,c=e.style),”isPaymentForm”in e&&r(4,l=e.isPaymentForm),”$$scope”in e&&r(5,o=e.$$scope)},[i,a,s,c,l,o,n]}class Lo extends de{constructor(e){super(),ue(this,e,$o,No,a,{forInput:0,sublabel:1,label:2,style:3,isPaymentForm:4})}}function xo(e){let t,r,n,o,i;return t=new Lo({props:{forInput:e[13],label:e[1],isPaymentForm:e[8]}}),o=new Ro({props:{disabled:e[0],required:!0,id:e[13],type:e[14],value:e[11],placeholder:e[2],errorMessage:e[5],autocomplete:e[7],isPaymentForm:e[8],innerTextOnClick:e[16],innerText:e[12]?e[4]:e[3],onFocus:e[9],onBlur:e[10]}}),o.$on(“change”,e[17]),{c(){ae(t.$$.fragment),r=S(),n=P(“div”),ae(o.$$.fragment),_(n,”class”,”zephr-form-relative-container”),$(n,”zephr-payment-form-relative-container”,e[8])},m(e,a){se(t,e,a),y(e,r,a),y(e,n,a),se(o,n,null),i=!0},p(e,[r]){const a={};8192&r&&(a.forInput=e[13]),2&r&&(a.label=e[1]),256&r&&(a.isPaymentForm=e[8]),t.$set(a);const s={};1&r&&(s.disabled=e[0]),8192&r&&(s.id=e[13]),16384&r&&(s.type=e[14]),2048&r&&(s.value=e[11]),4&r&&(s.placeholder=e[2]),32&r&&(s.errorMessage=e[5]),128&r&&(s.autocomplete=e[7]),256&r&&(s.isPaymentForm=e[8]),4096&r&&(s.innerTextOnClick=e[16]),4120&r&&(s.innerText=e[12]?e[4]:e[3]),512&r&&(s.onFocus=e[9]),1024&r&&(s.onBlur=e[10]),o.$set(s),(!i||256&r)&&$(n,”zephr-payment-form-relative-container”,e[8])},i(e){i||(te(t.$$.fragment,e),te(o.$$.fragment,e),i=!0)},o(e){re(t.$$.fragment,e),re(o.$$.fragment,e),i=!1},d(e){e&&(g(r),g(n)),ce(t,e),ce(o)}}}function Fo(e,t,r){let n,o,{disabled:i}=t,{label:a}=t,{placeholder:s}=t,{isMainPassword:c}=t,{showLabel:l}=t,{hideLabel:u}=t,{error:d=null}=t,{onChange:p}=t,{autocomplete:m}=t,{isPaymentForm:f=!1}=t,{onFocus:h}=t,{onBlur:y}=t,{password:g}=t,b=!1;return e.$$set=e=>{“disabled”in e&&r(0,i=e.disabled),”label”in e&&r(1,a=e.label),”placeholder”in e&&r(2,s=e.placeholder),”isMainPassword”in e&&r(15,c=e.isMainPassword),”showLabel”in e&&r(3,l=e.showLabel),”hideLabel”in e&&r(4,u=e.hideLabel),”error”in e&&r(5,d=e.error),”onChange”in e&&r(6,p=e.onChange),”autocomplete”in e&&r(7,m=e.autocomplete),”isPaymentForm”in e&&r(8,f=e.isPaymentForm),”onFocus”in e&&r(9,h=e.onFocus),”onBlur”in e&&r(10,y=e.onBlur),”password”in e&&r(11,g=e.password)},e.$$.update=()=>{4096&e.$$.dirty&&r(14,n=b?”text”:”password”),32768&e.$$.dirty&&r(13,o=”zephr-form-“+(c?”password”:”confirm-password”))},[i,a,s,l,u,d,p,m,f,h,y,g,b,o,n,c,()=>r(12,b=!b),({detail:e})=>p(e)]}class zo extends de{constructor(e){super(),ue(this,e,Fo,xo,a,{disabled:0,label:1,placeholder:2,isMainPassword:15,showLabel:3,hideLabel:4,error:5,onChange:6,autocomplete:7,isPaymentForm:8,onFocus:9,onBlur:10,password:11})}}function ko(e){let t,r,n,o,i,a,s,c;return i=new er({props:{icon:jt,color:e[0]&&e[0]===e[1]?Do:Bo}}),{c(){t=P(“div”),r=P(“ul”),n=P(“li”),o=P(“div”),ae(i.$$.fragment),a=S(),s=A(e[2]),_(o,”class”,”zephr-form-password-requirement-icon svelte-11tz5c7″),$(o,”zephr-payment-form-password-requirement-icon”,e[3]),_(n,”class”,”zephr-form-password-requirement svelte-11tz5c7″),$(n,”zephr-payment-form-password-requirement”,e[3]),_(r,”class”,”svelte-11tz5c7″),_(t,”class”,”zephr-form-flex-container zephr-form-password-match svelte-11tz5c7″),$(t,”zephr-payment-form-flex-container”,e[3]),$(t,”zephr-payment-form-password-match”,e[3])},m(e,l){y(e,t,l),h(t,r),h(r,n),h(n,o),se(i,o,null),h(n,a),h(n,s),c=!0},p(e,[r]){const a={};3&r&&(a.color=e[0]&&e[0]===e[1]?Do:Bo),i.$set(a),(!c||8&r)&&$(o,”zephr-payment-form-password-requirement-icon”,e[3]),(!c||4&r)&&w(s,e[2]),(!c||8&r)&&$(n,”zephr-payment-form-password-requirement”,e[3]),(!c||8&r)&&$(t,”zephr-payment-form-flex-container”,e[3]),(!c||8&r)&&$(t,”zephr-payment-form-password-match”,e[3])},i(e){c||(te(i.$$.fragment,e),c=!0)},o(e){re(i.$$.fragment,e),c=!1},d(e){e&&g(t),ce(i)}}}const Do=”var(–zf-password-valid-color)”,Bo=”var(–zf-password-invalid-color)”;function Uo(e,t,r){let{password:n}=t,{confirmPassword:o}=t,{passwordsMatchText:i}=t,{isPaymentForm:a=!1}=t;return e.$$set=e=>{“password”in e&&r(0,n=e.password),”confirmPassword”in e&&r(1,o=e.confirmPassword),”passwordsMatchText”in e&&r(2,i=e.passwordsMatchText),”isPaymentForm”in e&&r(3,a=e.isPaymentForm)},[n,o,i,a]}class Go extends de{constructor(e){super(),ue(this,e,Uo,ko,a,{password:0,confirmPassword:1,passwordsMatchText:2,isPaymentForm:3})}}function Vo(e,t,r){const n=e.slice();return n[12]=t[r],n[14]=r,n}function qo(e){let t;return{c(){t=P(“div”),_(t,”class”,”zephr-form-password-bar svelte-1b6w0g8″),M(t,”background-color”,e[3]>e[14]?Jo:Qo),$(t,”zephr-payment-form-password-bar”,e[2])},m(e,r){y(e,t,r)},p(e,r){8&r&&M(t,”background-color”,e[3]>e[14]?Jo:Qo),4&r&&$(t,”zephr-payment-form-password-bar”,e[2])},d(e){e&&g(t)}}}function jo(e){let t,r,n,o,i,a,s=e[1].minLengthValidationText+””;return n=new er({props:{icon:jt,color:e[4]?Jo:Qo}}),{c(){t=P(“li”),r=P(“div”),ae(n.$$.fragment),o=S(),i=A(s),_(r,”class”,”zephr-form-password-requirement-icon svelte-1b6w0g8″),$(r,”zephr-payment-form-password-requirement-icon”,e[2]),_(t,”class”,”zephr-form-password-requirement svelte-1b6w0g8″),$(t,”zephr-payment-form-password-requirement”,e[2])},m(e,s){y(e,t,s),h(t,r),se(n,r,null),h(t,o),h(t,i),a=!0},p(e,o){const c={};16&o&&(c.color=e[4]?Jo:Qo),n.$set(c),(!a||4&o)&&$(r,”zephr-payment-form-password-requirement-icon”,e[2]),(!a||2&o)&&s!==(s=e[1].minLengthValidationText+””)&&w(i,s),(!a||4&o)&&$(t,”zephr-payment-form-password-requirement”,e[2])},i(e){a||(te(n.$$.fragment,e),a=!0)},o(e){re(n.$$.fragment,e),a=!1},d(e){e&&g(t),ce(n)}}}function Ho(e){let t,r,n,o,i,a,s=e[1].uppercaseValidationText+””;return n=new er({props:{icon:jt,color:e[7]?Jo:Qo}}),{c(){t=P(“li”),r=P(“div”),ae(n.$$.fragment),o=S(),i=A(s),_(r,”class”,”zephr-form-password-requirement-icon svelte-1b6w0g8″),$(r,”zephr-payment-form-password-requirement-icon”,e[2]),_(t,”class”,”zephr-form-password-requirement svelte-1b6w0g8″),$(t,”zephr-payment-form-password-requirement”,e[2])},m(e,s){y(e,t,s),h(t,r),se(n,r,null),h(t,o),h(t,i),a=!0},p(e,o){const c={};128&o&&(c.color=e[7]?Jo:Qo),n.$set(c),(!a||4&o)&&$(r,”zephr-payment-form-password-requirement-icon”,e[2]),(!a||2&o)&&s!==(s=e[1].uppercaseValidationText+””)&&w(i,s),(!a||4&o)&&$(t,”zephr-payment-form-password-requirement”,e[2])},i(e){a||(te(n.$$.fragment,e),a=!0)},o(e){re(n.$$.fragment,e),a=!1},d(e){e&&g(t),ce(n)}}}function Ko(e){let t,r,n,o,i,a,s=e[1].numberValidationText+””;return n=new er({props:{icon:jt,color:e[6]?Jo:Qo}}),{c(){t=P(“li”),r=P(“div”),ae(n.$$.fragment),o=S(),i=A(s),_(r,”class”,”zephr-form-password-requirement-icon svelte-1b6w0g8″),$(r,”zephr-payment-form-password-requirement-icon”,e[2]),_(t,”class”,”zephr-form-password-requirement svelte-1b6w0g8″),$(t,”zephr-payment-form-password-requirement”,e[2])},m(e,s){y(e,t,s),h(t,r),se(n,r,null),h(t,o),h(t,i),a=!0},p(e,o){const c={};64&o&&(c.color=e[6]?Jo:Qo),n.$set(c),(!a||4&o)&&$(r,”zephr-payment-form-password-requirement-icon”,e[2]),(!a||2&o)&&s!==(s=e[1].numberValidationText+””)&&w(i,s),(!a||4&o)&&$(t,”zephr-payment-form-password-requirement”,e[2])},i(e){a||(te(n.$$.fragment,e),a=!0)},o(e){re(n.$$.fragment,e),a=!1},d(e){e&&g(t),ce(n)}}}function Yo(e){let t,r,n,o,i,a,s=e[1].symbolValidationText+””;return n=new er({props:{icon:jt,color:e[5]?Jo:Qo}}),{c(){t=P(“li”),r=P(“div”),ae(n.$$.fragment),o=S(),i=A(s),_(r,”class”,”zephr-form-password-requirement-icon svelte-1b6w0g8″),$(r,”zephr-payment-form-password-requirement-icon”,e[2]),_(t,”class”,”zephr-form-password-requirement svelte-1b6w0g8″),$(t,”zephr-payment-form-password-requirement”,e[2])},m(e,s){y(e,t,s),h(t,r),se(n,r,null),h(t,o),h(t,i),a=!0},p(e,o){const c={};32&o&&(c.color=e[5]?Jo:Qo),n.$set(c),(!a||4&o)&&$(r,”zephr-payment-form-password-requirement-icon”,e[2]),(!a||2&o)&&s!==(s=e[1].symbolValidationText+””)&&w(i,s),(!a||4&o)&&$(t,”zephr-payment-form-password-requirement”,e[2])},i(e){a||(te(n.$$.fragment,e),a=!0)},o(e){re(n.$$.fragment,e),a=!1},d(e){e&&g(t),ce(n)}}}function Wo(e){let t,r,n,o,i,a,s,c,l=ne(Array(e[8])),u=[];for(let t=0;t<l.length;t+=1)u[t]=qo(Vo(e,l,t));let d=e[0].minLength&&jo(e),p=e[0].requireUppercase&&Ho(e),m=e[0].requireNumbers&&Ko(e),f=e[0].requireSpecialCharacters&&Yo(e);return{c(){t=P("div");for(let e=0;e<u.length;e+=1)u[e].c();r=S(),n=P("div"),o=P("ul"),d&&d.c(),i=S(),p&&p.c(),a=S(),m&&m.c(),s=S(),f&&f.c(),_(t,"class","zephr-form-password-progress svelte-1b6w0g8"),$(t,"zephr-payment-form-password-progress",e[2]),_(o,"class","svelte-1b6w0g8"),_(n,"class","zephr-form-flex-container zephr-form-password-requirements svelte-1b6w0g8"),$(n,"zephr-payment-form-flex-container",e[2]),$(n,"zephr-payment-form-password-requirements",e[2])},m(e,l){y(e,t,l);for(let e=0;e<u.length;e+=1)u[e]&&u[e].m(t,null);y(e,r,l),y(e,n,l),h(n,o),d&&d.m(o,null),h(o,i),p&&p.m(o,null),h(o,a),m&&m.m(o,null),h(o,s),f&&f.m(o,null),c=!0},p(e,[r]){if(12&r){let n;for(l=ne(Array(e[8])),n=0;n<l.length;n+=1){const o=Vo(e,l,n);u[n]?u[n].p(o,r):(u[n]=qo(o),u[n].c(),u[n].m(t,null))}for(;n{d=null})),ee()),e[0].requireUppercase?p?(p.p(e,r),1&r&&te(p,1)):(p=Ho(e),p.c(),te(p,1),p.m(o,a)):p&&(X(),re(p,1,1,(()=>{p=null})),ee()),e[0].requireNumbers?m?(m.p(e,r),1&r&&te(m,1)):(m=Ko(e),m.c(),te(m,1),m.m(o,s)):m&&(X(),re(m,1,1,(()=>{m=null})),ee()),e[0].requireSpecialCharacters?f?(f.p(e,r),1&r&&te(f,1)):(f=Yo(e),f.c(),te(f,1),f.m(o,null)):f&&(X(),re(f,1,1,(()=>{f=null})),ee()),(!c||4&r)&&$(n,”zephr-payment-form-flex-container”,e[2]),(!c||4&r)&&$(n,”zephr-payment-form-password-requirements”,e[2])},i(e){c||(te(d),te(p),te(m),te(f),c=!0)},o(e){re(d),re(p),re(m),re(f),c=!1},d(e){e&&(g(t),g(r),g(n)),b(u,e),d&&d.d(),p&&p.d(),m&&m.d(),f&&f.d()}}}const Jo=”var(–zf-password-valid-color)”,Qo=”var(–zf-password-invalid-color)”;function Zo(e,t,r){let n,o,i,a,{passwordRequirements:s}=t,{passwordValidationTexts:c}=t,{isPaymentForm:l=!1}=t,{onChange:u}=t,{password:d}=t,{passwordIsValid:p}=t,m=0,f=Object.values(s).reduce(((e,t)=>e+(t?1:0)),0);return e.$$set=e=>{“passwordRequirements”in e&&r(0,s=e.passwordRequirements),”passwordValidationTexts”in e&&r(1,c=e.passwordValidationTexts),”isPaymentForm”in e&&r(2,l=e.isPaymentForm),”onChange”in e&&r(9,u=e.onChange),”password”in e&&r(10,d=e.password),”passwordIsValid”in e&&r(11,p=e.passwordIsValid)},e.$$.update=()=>{1024&e.$$.dirty&&r(7,n=/[A-Z]+/.test(d)),1024&e.$$.dirty&&r(6,o=/[0-9]+/.test(d)),1024&e.$$.dirty&&r(5,i=/[^a-z0-9A-Z]+/.test(d)),1025&e.$$.dirty&&r(4,a=d?.length>=s.minLength),3593&e.$$.dirty&&(r(3,m=0),/[A-Z]+/.test(d)&&s.requireUppercase&&r(3,m+=1),/[0-9]+/.test(d)&&s.requireNumbers&&r(3,m+=1),/[^a-z0-9A-Z]+/.test(d)&&s.requireSpecialCharacters&&r(3,m+=1),d?.length>=s.minLength&&s.minLength&&r(3,m+=1),m>=f!==p&&u(m>=f))},[s,c,l,m,a,i,o,n,f,u,d,p]}class Xo extends de{constructor(e){super(),ue(this,e,Zo,Wo,a,{passwordRequirements:0,passwordValidationTexts:1,isPaymentForm:2,onChange:9,password:10,passwordIsValid:11})}}function ei(e){let t,r;return t=new Xo({props:{password:e[12],passwordIsValid:e[14],passwordRequirements:e[1],passwordValidationTexts:e[16],isPaymentForm:e[3],onChange:e[10]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};4096&r&&(n.password=e[12]),16384&r&&(n.passwordIsValid=e[14]),2&r&&(n.passwordRequirements=e[1]),8&r&&(n.isPaymentForm=e[3]),1024&r&&(n.onChange=e[10]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function ti(e){let t,r;return t=new zo({props:{disabled:e[11],password:e[13],isMainPassword:!1,label:e[0].confirm,hideLabel:e[0].hide,showLabel:e[0].show,placeholder:e[0].confirmPlaceholder,isPaymentForm:e[3],autocomplete:”new-password”,onChange:e[7],onFocus:e[8],onBlur:e[9]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};2048&r&&(n.disabled=e[11]),8192&r&&(n.password=e[13]),1&r&&(n.label=e[0].confirm),1&r&&(n.hideLabel=e[0].hide),1&r&&(n.showLabel=e[0].show),1&r&&(n.placeholder=e[0].confirmPlaceholder),8&r&&(n.isPaymentForm=e[3]),128&r&&(n.onChange=e[7]),256&r&&(n.onFocus=e[8]),512&r&&(n.onBlur=e[9]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function ri(e){let t,r;return t=new Go({props:{password:e[12],confirmPassword:e[13],passwordsMatchText:e[16].passwordsMatchText,isPaymentForm:e[3]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};4096&r&&(n.password=e[12]),8192&r&&(n.confirmPassword=e[13]),8&r&&(n.isPaymentForm=e[3]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function ni(e){let t,r;return t=new zt({props:{error:e[15]??””,isPaymentForm:e[3]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};32768&r&&(n.error=e[15]??””),8&r&&(n.isPaymentForm=e[3]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function oi(e){let t,r,n,o,i,a,s;t=new zo({props:{disabled:e[11],password:e[12],isMainPassword:!0,label:e[0].password,hideLabel:e[0].hide,showLabel:e[0].show,placeholder:e[0].placeholder,isPaymentForm:e[3],autocomplete:e[2]?”current-password”:”new-password”,onChange:e[4],onFocus:e[5],onBlur:e[6]}});let c=e[0].passValidatorEnabled&&ei(e),l=!e[2]&&ti(e),u=e[0].passwordsMatchIndicatorEnabled&&ri(e),d=e[15]&&ni(e);return{c(){ae(t.$$.fragment),r=S(),c&&c.c(),n=S(),l&&l.c(),o=S(),u&&u.c(),i=S(),d&&d.c(),a=C()},m(e,p){se(t,e,p),y(e,r,p),c&&c.m(e,p),y(e,n,p),l&&l.m(e,p),y(e,o,p),u&&u.m(e,p),y(e,i,p),d&&d.m(e,p),y(e,a,p),s=!0},p(e,[r]){const s={};2048&r&&(s.disabled=e[11]),4096&r&&(s.password=e[12]),1&r&&(s.label=e[0].password),1&r&&(s.hideLabel=e[0].hide),1&r&&(s.showLabel=e[0].show),1&r&&(s.placeholder=e[0].placeholder),8&r&&(s.isPaymentForm=e[3]),4&r&&(s.autocomplete=e[2]?”current-password”:”new-password”),16&r&&(s.onChange=e[4]),32&r&&(s.onFocus=e[5]),64&r&&(s.onBlur=e[6]),t.$set(s),e[0].passValidatorEnabled?c?(c.p(e,r),1&r&&te(c,1)):(c=ei(e),c.c(),te(c,1),c.m(n.parentNode,n)):c&&(X(),re(c,1,1,(()=>{c=null})),ee()),e[2]?l&&(X(),re(l,1,1,(()=>{l=null})),ee()):l?(l.p(e,r),4&r&&te(l,1)):(l=ti(e),l.c(),te(l,1),l.m(o.parentNode,o)),e[0].passwordsMatchIndicatorEnabled?u?(u.p(e,r),1&r&&te(u,1)):(u=ri(e),u.c(),te(u,1),u.m(i.parentNode,i)):u&&(X(),re(u,1,1,(()=>{u=null})),ee()),e[15]?d?(d.p(e,r),32768&r&&te(d,1)):(d=ni(e),d.c(),te(d,1),d.m(a.parentNode,a)):d&&(X(),re(d,1,1,(()=>{d=null})),ee())},i(e){s||(te(t.$$.fragment,e),te(c),te(l),te(u),te(d),s=!0)},o(e){re(t.$$.fragment,e),re(c),re(l),re(u),re(d),s=!1},d(e){e&&(g(r),g(n),g(o),g(i),g(a)),ce(t,e),c&&c.d(e),l&&l.d(e),u&&u.d(e),d&&d.d(e)}}}function ii(e,t,r){let{config:n}=t,{passwordRequirements:o}=t,{hideConfirmPassword:i}=t,{isPaymentForm:a=!1}=t,{onPasswordChange:s}=t,{onPasswordFocus:c}=t,{onPasswordBlur:l}=t,{onConfirmPasswordChange:u}=t,{onConfirmPasswordFocus:d}=t,{onConfirmPasswordBlur:p}=t,{onPasswordIsValidChange:m}=t,{disabled:f}=t,{password:h}=t,{confirmPassword:y}=t,{passwordIsValid:g}=t,{error:b=null}=t,P={minLengthValidationText:n.minLengthValidation||`Must include at least ${o.minLength} characters`,uppercaseValidationText:n.uppercaseValidation||”Must include an uppercase letter”,numberValidationText:n.numberValidation||”Must include a number character”,symbolValidationText:n.symbolValidation||”Must include a supported symbol”,passwordsMatchText:n.passwordsMatchText||”Passwords match”};return e.$$set=e=>{“config”in e&&r(0,n=e.config),”passwordRequirements”in e&&r(1,o=e.passwordRequirements),”hideConfirmPassword”in e&&r(2,i=e.hideConfirmPassword),”isPaymentForm”in e&&r(3,a=e.isPaymentForm),”onPasswordChange”in e&&r(4,s=e.onPasswordChange),”onPasswordFocus”in e&&r(5,c=e.onPasswordFocus),”onPasswordBlur”in e&&r(6,l=e.onPasswordBlur),”onConfirmPasswordChange”in e&&r(7,u=e.onConfirmPasswordChange),”onConfirmPasswordFocus”in e&&r(8,d=e.onConfirmPasswordFocus),”onConfirmPasswordBlur”in e&&r(9,p=e.onConfirmPasswordBlur),”onPasswordIsValidChange”in e&&r(10,m=e.onPasswordIsValidChange),”disabled”in e&&r(11,f=e.disabled),”password”in e&&r(12,h=e.password),”confirmPassword”in e&&r(13,y=e.confirmPassword),”passwordIsValid”in e&&r(14,g=e.passwordIsValid),”error”in e&&r(15,b=e.error)},[n,o,i,a,s,c,l,u,d,p,m,f,h,y,g,b,P]}class ai extends de{constructor(e){super(),ue(this,e,ii,oi,a,{config:0,passwordRequirements:1,hideConfirmPassword:2,isPaymentForm:3,onPasswordChange:4,onPasswordFocus:5,onPasswordBlur:6,onConfirmPasswordChange:7,onConfirmPasswordFocus:8,onConfirmPasswordBlur:9,onPasswordIsValidChange:10,disabled:11,password:12,confirmPassword:13,passwordIsValid:14,error:15})}}const si={matches:e=>e.type===Pe&&null!=e.config?.confirm,create:(e,t,r,n)=>({component:ai,props:{disabled:t.isBusy,config:n,passwordRequirements:e.organisationConfiguration.passwordStrengthRequirements,hideConfirmPassword:e.organisationConfiguration.hideConfirmPasswordOnRegForm,isPaymentForm:e.formType===wt.PAYMENT,onPasswordChange:n=>{r.updateFormState({createPassword:n}),dt(e,”zephr_form_input_change”,{inputName:”zephr-form-password”,sectionId:t.currentSection.type,field:”create-password”})},onPasswordFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:”zephr-form-password”,sectionId:t.currentSection.type,field:”create-password”}),onPasswordBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:”zephr-form-password”,sectionId:t.currentSection.type,field:”create-password”}),onConfirmPasswordChange:n=>{r.updateFormState({confirmCreatePassword:n}),dt(e,”zephr_form_input_change”,{inputName:”zephr-form-confirm-password”,sectionId:t.currentSection.type,field:”confirm-password”})},onConfirmPasswordFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:”zephr-form-confirm-password”,sectionId:t.currentSection.type,field:”confirm-password”}),onConfirmPasswordBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:”zephr-form-confirm-password”,sectionId:t.currentSection.type,field:”confirm-password”}),onPasswordIsValidChange:e=>r.updateFormState({passwordIsValid:e}),password:t.createPassword,confirmPassword:t.confirmCreatePassword,passwordIsValid:t.passwordIsValid},isValid:null!=t.password&&(!n.passValidatorEnabled||t.passwordIsValid)&&(e.organisationConfiguration.hideConfirmPasswordOnRegForm||t.createPassword===t.confirmCreatePassword)})},ci={matches:e=>e.type===Pe&&null==e.config?.confirm,create:(e,t,r,n)=>{const o=n.isUpdatePasswordCurrentPassword?”currentPassword”:”password”;return{component:zo,props:{disabled:t.isBusy,label:n.password,placeholder:n.placeholder,isMainPassword:!0,showLabel:n.showLabel,hideLabel:n.hideLabel,password:t[o],autocomplete:”password”,onChange:n=>{r.updateFormState({[o]:n}),dt(e,”zephr_form_input_change”,{inputName:”zephr-form-password”,sectionId:t.currentSection.type,field:”password”})},onFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:”zephr-form-password”,sectionId:t.currentSection.type,field:”password”}),onBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:”zephr-form-password”,sectionId:t.currentSection.type,field:”password”})},isValid:(i=t[o],null!=i&&i.length>2)};var i}},li={matches:e=>e.type===Ae&&!e.config.isLogin&&!e.config.isCancel,create:(e,t,r,n)=>({component:mo,props:{disabled:t.isBusy||!t.canAttemptSectionCompletion,text:n.text,onClick:()=>{dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),r.attemptCompleteSection()},isPaymentForm:e.formType===wt.PAYMENT}})};function ui(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,”default”)?e.default:e}var di={exports:{}};!function(e){var t=”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},r=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(); /** * @author Leandro Silva * @copyright 2012, 2017 Leandro Silva (http://grafluxe.com) * @license MIT * * @classdesc * Validate email address patterns that others don't. This project aims to support all common addresses along * with many rare ones that are considered valid under RFC standards. It can be used in both client and server * side environments. * *
* Valid email addresses that are supported: *
- *
- niceandsimple@example.com *
- very.common@example.com *
- a.little.lengthy.but.fine@dept.example.com *
- disposable.style.email.with+symbol@example.com *
- other.email-with-dash@example.com *
- “much.more unusual”@example.com *
- “very.unusual.@.unusual.com”@example.com *
- #!$%&’*+-/=?^_`{}|~@example.org *
- ” “@example.org *
- üñîçøðé@üñîçøðé.com *
- admin@mailserver1 *
- user@tt *
- “hi”@example.com *
- jsmith@[192.168.2.1] *
- jsmith@[IPv6:2001:db8::1] *
- email@123.123.123.123 *
- “()[]:,;@\”!#$%&’*+-/=?^_`{}| ~.a”@example.org *
- abc.”defghi”.xyz@example.com *
- _______@example.com *
- very.unusual.”@”.unusual.com@example.com *
- john.smith(comment)@example.com *
- (comment)john.smith@example.com *
- “()[]:,;@\”!#$%&’*+-/=?^_`{}| ~.a”(comment)@example.org * * * Valid (but rare) email addresses that are not supported: *
- *
- “very.(),:;[]”.VERY.”very@\ “very”.unusual”@strange.example.com *
- “()[]:,;@”!#$%&’*+-/=?^_`{}| ~.a”@example.org *
- abc.”d”efghi”.xyz@example.com *
- much.”more unusual”@example.com * * */ var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}(this,e)}return r(e,[{key:”isValidAddress”,value:function(e){return this._whitelist(e)&&!this._blacklist(e)&&!this._tooLong(e)}},{key:”getParts”,value:function(e){var t=e.match(/[^@]*$/);return{local:e.substr(0,t.index-1)||””,domain:t[0]||””}}},{key:”_whitelist”,value:function(e){return/^(?=s)|^(?:(?!.+.{2,})(?!.)(?:[w.!#$%&’*+-/=?^`{|} ~]|[^x00-x7F])+[^.”]@|^”(?:[w.!#$%&’*+-/=?^`{|} ~(),:;@[]]|[^x00-x7F])+”@|(?:[w.!#$%&’*+-/=?^`{|} ~]|[^x00-x7F])+.”(?:[w.!#$%&’*+-/=?^`{|} ~”(),:;\@[]]|[^x00-x7F])+”.(?:[w.!#$%&’*+-/=?^`{|} ~]|[^x00-x7F])+@)(?!-)(?!.*-.)(?:[a-zA-Z0-9-.]|[^x00-x7F])+$|^”.+”@.+|.+@[(?:w+.|w+:){3}.+]|^(.+)|(.+)@/.test(e)}},{key:”_blacklist”,value:function(e){return/^@|^s|@[?(?=d).*d{4,}|”(?!.+\”).+”.+”|.(.+)@(?=.+@)/.test(e)}},{key:”_tooLong”,value:function(e){var t=this.getParts(e);return t.domain.length>=253||t.local.length>=64||e.length>=254}}]),e}();”object”===t(e)&&e.exports&&(e.exports=n)}(di);const pi=new(ui(di.exports)),mi=e=>!!e&&(!!e.match(/^[^@]@[a-zA-Z0-9].+$/)||pi.isValidAddress(e));function fi(e){let t,r,n,o,i;return t=new Lo({props:{forInput:e[11],label:e[2],isPaymentForm:e[6]}}),o=new Ro({props:{id:e[11],autocomplete:”email”,type:”email”,name:”email”,disabled:e[1],value:e[0],placeholder:e[3],errorMessage:e[5],innerTextOnClick:e[7],innerText:e[7]&&(e[4]||”Edit”),isPaymentForm:e[6],onFocus:e[9],onBlur:e[10]}}),o.$on(“change”,e[13]),{c(){ae(t.$$.fragment),r=S(),n=P(“div”),ae(o.$$.fragment),_(n,”class”,”zephr-form-relative-container”),$(n,”zephr-payment-form-relative-container”,e[6])},m(e,a){se(t,e,a),y(e,r,a),y(e,n,a),se(o,n,null),i=!0},p(e,[r]){const a={};4&r&&(a.label=e[2]),64&r&&(a.isPaymentForm=e[6]),t.$set(a);const s={};2&r&&(s.disabled=e[1]),1&r&&(s.value=e[0]),8&r&&(s.placeholder=e[3]),32&r&&(s.errorMessage=e[5]),128&r&&(s.innerTextOnClick=e[7]),144&r&&(s.innerText=e[7]&&(e[4]||”Edit”)),64&r&&(s.isPaymentForm=e[6]),512&r&&(s.onFocus=e[9]),1024&r&&(s.onBlur=e[10]),o.$set(s),(!i||64&r)&&$(n,”zephr-payment-form-relative-container”,e[6])},i(e){i||(te(t.$$.fragment,e),te(o.$$.fragment,e),i=!0)},o(e){re(t.$$.fragment,e),re(o.$$.fragment,e),i=!1},d(e){e&&(g(r),g(n)),ce(t,e),ce(o)}}}function hi(e,t,r){let{formKey:n}=t,{emailAddress:o}=t,{disabled:i}=t,{label:a}=t,{placeholder:s}=t,{editText:c}=t,{error:l=null}=t,{isPaymentForm:u=!1}=t,{onEdit:d}=t,{onChange:p}=t,{onFocus:m}=t,{onBlur:f}=t;const h=`zephr-form-identifier-${n}`;return e.$$set=e=>{“formKey”in e&&r(12,n=e.formKey),”emailAddress”in e&&r(0,o=e.emailAddress),”disabled”in e&&r(1,i=e.disabled),”label”in e&&r(2,a=e.label),”placeholder”in e&&r(3,s=e.placeholder),”editText”in e&&r(4,c=e.editText),”error”in e&&r(5,l=e.error),”isPaymentForm”in e&&r(6,u=e.isPaymentForm),”onEdit”in e&&r(7,d=e.onEdit),”onChange”in e&&r(8,p=e.onChange),”onFocus”in e&&r(9,m=e.onFocus),”onBlur”in e&&r(10,f=e.onBlur)},[o,i,a,s,c,l,u,d,p,m,f,h,n,({detail:e})=>p(e)]}class yi extends de{constructor(e){super(),ue(this,e,hi,fi,a,{formKey:12,emailAddress:0,disabled:1,label:2,placeholder:3,editText:4,error:5,isPaymentForm:6,onEdit:7,onChange:8,onFocus:9,onBlur:10})}}const gi={matches:e=>e.type===ve,create:(e,t,r,n)=>{const o=n.disabled||t.isBusy;return{component:yi,props:{formKey:e.uniqueKey,disabled:o,emailAddress:t.emailAddress,label:n.label,placeholder:n.placeholder,editText:n.editText,onChange:n=>{!o&&r.updateFormState({userExists:void 0,emailIsContact:void 0,emailAddress:n,verificationCode:””,verificationCodeValid:void 0,serverErrors:[]}),dt(e,”zephr_form_input_change”,{inputName:`zephr-form-identifier-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”email”})},onFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:`zephr-form-identifier-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”email”}),onBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:`zephr-form-identifier-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”email”}),onEdit:n.disabled&&(()=>{r.jumpToPartStart(ot.ACCOUNT_VERIFICATION.type)}),isPaymentForm:e.formType===wt.PAYMENT},isValid:mi(t.emailAddress)}}};function bi(e){let t,r;return t=new zt({props:{error:e[0]?.message??e[1]??””,isPaymentForm:!0}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,[r]){const n={};3&r&&(n.error=e[0]?.message??e[1]??””),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Pi(e,t,r){let{providerError:n}=t,{error:o=null}=t;return e.$$set=e=>{“providerError”in e&&r(0,n=e.providerError),”error”in e&&r(1,o=e.error)},[n,o]}class Ei extends de{constructor(e){super(),ue(this,e,Pi,bi,a,{providerError:0,error:1})}}const Ai={matches:e=>e.type===Se||e.type===Ke,create:(e,t,r)=>{const n=so(e.organisationConfiguration.paymentProvider);return n.noPaymentForm(e)?{component:Ei,props:{providerError:t.paymentProviderError},isValid:!0}:{component:n.component,props:{isLoaded:t.paymentProviderFormLoaded,isBusy:t.paymentProviderFormBusy,providerError:t.paymentProviderError,isComplete:t.paymentFormComplete,isDisabled:n.internalSubmit(e)?!t.canAttemptSectionCompletion:t.isBusy||null!=t.mobilePaymentService,onMountCallback:()=>{r.updateFormState({paymentProviderFormLoaded:!1}),n.loader(e,t,r)}},isValid:n.internalSubmit(e)?void 0:t.paymentFormComplete&&!t.paymentProviderError}}},Si=e=>e.parts.flatMap((e=>e.sections)).flatMap((e=>e.elements)).some((e=>e.type===Se&&!1!==e.config?.enabled)),Ci={matches:e=>e.type===xe,create:(e,t,r)=>{const n=co(e.organisationConfiguration.paymentProvider);return e.environment.previewMode?null:{component:n.component,props:{isDisabled:t.isBusy||null!=t.mobilePaymentService,onMountCallback:()=>n.loader(e,t,r),disableCoreDependencyHeader:Si(e)}}}};function vi(t){let r,n,o,i,a,s;return{c(){r=P(“div”),n=P(“img”),i=S(),a=P(“div”),s=A(t[0]),_(n,”class”,”check-image svelte-12ljnq4″),c(n.src,o=”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGEAAABiCAYAAABAkr0NAAAJa0lEQVR4Xu2dT28TRxTA39oGUsHBiC/giKT/LiRHpBYIUPWQEmfVD9BwrQoJpZW4JbkhtRUO9E74AO3GQTkVCLSVOGIurVRCky/QkgNIodjezoxjsrZ3Zt7Mzu7OOraEkOLZ9Zv3m3lv/rx540BWPtc2S1Cvl6DplJjITb/1f/CTc7bAgW1w/G0oFLbg+vBWFqrnWCfkwmYRXtbH4HVuDPJwwp24MBNFRu9BtUbAERjOIzjUrMH3ow+jvC+OZ+2AQFv5q+Y0gF92z0+diaOiwXd691YJCKcKh3MrNvSW9CDQFv9Pk7TyZBTPA8t6iuMswVD+YVpAkofwzbMzUPdn3InpL+Ju8arv99bvLsNQbjFpGMlBoMp/7cwnYW5Uld9dnpmrQ/5iUv4jfgjfbo7BTuOGKeUzBeWpow35NPwi+WsRcn7RPVseiwwjoZ4RHwRq87fr8+5EeU5HGS1lw1PIE1t9AGpaJoI2gCaUoEFGWw3ntG5D8NarFRgqLGnJgKh8PBCI6XE/Lq8jfr+jiLe+ugQFfwWOFGqwMLyt+jyqfASfROS7CJWRZdTvKBQyC0Gj9Sdtfzt0c3VzGhpvplUGCaxXFAuLJhuJOQhkrO+enNzENgBSmUVSmYrJymB/u6fctT9LsJNfUILxeG3YlHkyA+HqxrR7asrDKMEq5XcLrAjD+3XVhR9GVjD1FpWJDuHy83n33IUFmSDM7Bx+cxGufxA+spG9IMnvFWB49+8uwM3ji1HEiwYBC8BQi4lSUa1nv96YcU9P3ZY9GxWEPgQEANb6j+VdK+y+TJO875G9IgoIPQgoAHevwK3jFd26W/fc3DPiuMvzIrl0QahDwAD4rTqR1JQ/UViI+Y8OCDUIlzdn3XOTwtbtPf6JDN0y4Hx16RHz5J78XDgU9+79TKzA+2grgIdAlgDcjyafCLtjvwNoVx4D4ve1cfhuuIZhjYOAmIj1fQ8ImVNIewRyQoeDcGljXbT4te8AIHsEGx3eGpmQ9QY5BIkj9hS6nUyYTH4vMdMY/yCGIDFD3r0+G4bqtgLJpM6TmCUxhNlnT3ibI2wNqDIqXa7QrVfmnpt7XiGRIbNhcsvMEh+CjG75D7kpy5wmIwhMl/Ff1Nf5jZa/F8FVpFv90OeJtG8dsYyRzD88WTsatoQTDkHgjAdmSEJCsLzB010vBJkzHpghMQViltzxyRdcKxLSG3ohCHxBXHussl6eue/Jtql7ajJ0kyusN/RAEPqCQS/AtwfBBNfr0mMnhEEvwCtZVlKw4ur9QrZFf9zbFu2EoEBPJsPge6IBjj675w17EAQOeeALNJvUpedz7vkLN0IncAEHvQdB9MB+8AU0PH+IHDAxGXQmGCkFHfQehNm/yRLFZz3xmyxSuXL8omZbsP+xrgmWzs6YsJKc5YygSWpBEJmift2qpPXmzHCNml+Rg941SS0IolFRv5oiwRKDd9+rws33yMkhMx/esL8NuwVh7q/lsBDAvjVFsjUewxBk+m1B4PqDeKKQzbQvzbdg9spNb1RJLI0DIg/ebxv3GADrayT8fXhZE3H4Y4LAAI/4BQdEjqOf/EFaAHaxcP0CGfg4wJkfyHaDjLaUuF+WMgBWvcsbK+65qXJ3VekWsQO8cSw9NVMZ0TrqFLdOld5vAwA2+Anf/qSnkxwRoczHktoCgELgWRwyEiPmKDymyMv6JM0mABTCV2SP4ZPePQbvwUrNETmMzAb12gaAQviShJF+Gh5GyocQ1/A0EFTMUhq8U3BNnf1ivsJGAFQuwTA1WQicSYssOArtiG0FYBUEzjCNyhgZhM0AsgIhEgjbAVgFAXPSBRlO/tZEZQGAVRDYpAVx9gsLIisAtCGYXkkMelcTILIEgNZdYAUc7jJ2V1gGeoSCLRgFRNYACCDQNbp0ly10QGQRgHTZIu0FPBUQWQUgXcATLCyZ3GcVWikMCJKaQZbExItjQwZrXmXluIFgdCnblk0dBAhRPa0GQAQXb+rYtL2pCcJ2AMKQIra9KaIUU7qxqKYp+Lz1AKiwvDUzsowNS++O2xnyguwRmQDAnLI4pMje4C8JiMwAQFiaFgSRX0hzh40DIksAhAOf3T2bQFQ2Z5sz7Q3/LhCZAiAyRbv+gBbZgyA6dcg5+ikbGhv7np4R3iGZf02HrhsTkP8i7tA0kA1hD4LIJA3SJ+jhEoU/BraPUcel+ioQTE+dWk/xe0Fn9pdOCJywDCpB5kNgtNQY4SGFQ5joI7SD3qAGROUocu9hcpGDzmp+UzX9RS+t0As6R0ftn9ZICxBd6v56g2pylvAEIxpJMvpLjRFqo5GcJRyCrDfEuf8cof6pP6qZnEUr6RQLXzxamDB65jd1DUYXQGiGBCvS4uxdojQL9DKHyuiV6KL3yRtEZog22qXRcV5NxRAkSVi9+6szcHPkTp+oUb8akszJskxpYghULEG6BTaJ2+/+QXYcF5GwUQ6BgZAlpzV3tYl+c0zhSZkjNpacltYNkxsaG7qYgq5i+UmDqatxPYHWAhPzs19AYAAomGk8BIR/YD6i30FgACgu/atBoFpGbML37YorJrQf4Yi7zaM6BCwIA7cuxWLLdV+KucBDAwAVRw8CFkRCF4jq6hX1HLs3uuHJ7u2MkrRXHwISBPMTaQSRoTQsKYS8xC8KgGg9oS0/wke0QKRz4bQWC3ZdfeO2rPW36hU9e360ntCuoSAjbrcSrIZBTc+/TXJ5k/wGRQbA0CaXGQhUIsSELgjEKhiKym8Nxc3domUOApWMXQXcJJfChV/mEGYaGIy8XzVxkaiy6dG4sp7dGV3ML5hcxjcLoa0F5J2Voaaq0LwTW04N2kheklvK6w65g3kq9NYPEci45j/xQNg1T7BzcE6lV3SYK3Y9vP8I8k4Ncvkt7J1lHUqkDvZNg1wND2fIvxMYRxveW823/uDvxAeh/SvIC0QxpoTt6DUdem38NoETfn18wy/pKrunZ9KGMJS/otUAMBXaLRM/hLYwGvZXoR5GiyZ9ZX1yEGLoGUY1T0c8dJAQp0/iCJw8hCCM/w4QW+3P8m5kMq3kUHtPTQ44VTiWWzY54lGRPT0IQSmp33h1kKRF9sum7LlwlNNW/OHcitGEVyqaD5S1A0K38Mx/5EgGe/805IijPVvuyWavUl9mZhrwFA41a3CkUEurxfNkthNCmLR0uFmvl8AvFMFvFKHpl3qK5Zwt9recvwWFwpYNrRzTWP4HK7laSxb9gaIAAAAASUVORK5CYII=”)||_(n,”src”,”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGEAAABiCAYAAABAkr0NAAAJa0lEQVR4Xu2dT28TRxTA39oGUsHBiC/giKT/LiRHpBYIUPWQEmfVD9BwrQoJpZW4JbkhtRUO9E74AO3GQTkVCLSVOGIurVRCky/QkgNIodjezoxjsrZ3Zt7Mzu7OOraEkOLZ9Zv3m3lv/rx540BWPtc2S1Cvl6DplJjITb/1f/CTc7bAgW1w/G0oFLbg+vBWFqrnWCfkwmYRXtbH4HVuDPJwwp24MBNFRu9BtUbAERjOIzjUrMH3ow+jvC+OZ+2AQFv5q+Y0gF92z0+diaOiwXd691YJCKcKh3MrNvSW9CDQFv9Pk7TyZBTPA8t6iuMswVD+YVpAkofwzbMzUPdn3InpL+Ju8arv99bvLsNQbjFpGMlBoMp/7cwnYW5Uld9dnpmrQ/5iUv4jfgjfbo7BTuOGKeUzBeWpow35NPwi+WsRcn7RPVseiwwjoZ4RHwRq87fr8+5EeU5HGS1lw1PIE1t9AGpaJoI2gCaUoEFGWw3ntG5D8NarFRgqLGnJgKh8PBCI6XE/Lq8jfr+jiLe+ugQFfwWOFGqwMLyt+jyqfASfROS7CJWRZdTvKBQyC0Gj9Sdtfzt0c3VzGhpvplUGCaxXFAuLJhuJOQhkrO+enNzENgBSmUVSmYrJymB/u6fctT9LsJNfUILxeG3YlHkyA+HqxrR7asrDKMEq5XcLrAjD+3XVhR9GVjD1FpWJDuHy83n33IUFmSDM7Bx+cxGufxA+spG9IMnvFWB49+8uwM3ji1HEiwYBC8BQi4lSUa1nv96YcU9P3ZY9GxWEPgQEANb6j+VdK+y+TJO875G9IgoIPQgoAHevwK3jFd26W/fc3DPiuMvzIrl0QahDwAD4rTqR1JQ/UViI+Y8OCDUIlzdn3XOTwtbtPf6JDN0y4Hx16RHz5J78XDgU9+79TKzA+2grgIdAlgDcjyafCLtjvwNoVx4D4ve1cfhuuIZhjYOAmIj1fQ8ImVNIewRyQoeDcGljXbT4te8AIHsEGx3eGpmQ9QY5BIkj9hS6nUyYTH4vMdMY/yCGIDFD3r0+G4bqtgLJpM6TmCUxhNlnT3ibI2wNqDIqXa7QrVfmnpt7XiGRIbNhcsvMEh+CjG75D7kpy5wmIwhMl/Ff1Nf5jZa/F8FVpFv90OeJtG8dsYyRzD88WTsatoQTDkHgjAdmSEJCsLzB010vBJkzHpghMQViltzxyRdcKxLSG3ohCHxBXHussl6eue/Jtql7ajJ0kyusN/RAEPqCQS/AtwfBBNfr0mMnhEEvwCtZVlKw4ur9QrZFf9zbFu2EoEBPJsPge6IBjj675w17EAQOeeALNJvUpedz7vkLN0IncAEHvQdB9MB+8AU0PH+IHDAxGXQmGCkFHfQehNm/yRLFZz3xmyxSuXL8omZbsP+xrgmWzs6YsJKc5YygSWpBEJmift2qpPXmzHCNml+Rg941SS0IolFRv5oiwRKDd9+rws33yMkhMx/esL8NuwVh7q/lsBDAvjVFsjUewxBk+m1B4PqDeKKQzbQvzbdg9spNb1RJLI0DIg/ebxv3GADrayT8fXhZE3H4Y4LAAI/4BQdEjqOf/EFaAHaxcP0CGfg4wJkfyHaDjLaUuF+WMgBWvcsbK+65qXJ3VekWsQO8cSw9NVMZ0TrqFLdOld5vAwA2+Anf/qSnkxwRoczHktoCgELgWRwyEiPmKDymyMv6JM0mABTCV2SP4ZPePQbvwUrNETmMzAb12gaAQviShJF+Gh5GyocQ1/A0EFTMUhq8U3BNnf1ivsJGAFQuwTA1WQicSYssOArtiG0FYBUEzjCNyhgZhM0AsgIhEgjbAVgFAXPSBRlO/tZEZQGAVRDYpAVx9gsLIisAtCGYXkkMelcTILIEgNZdYAUc7jJ2V1gGeoSCLRgFRNYACCDQNbp0ly10QGQRgHTZIu0FPBUQWQUgXcATLCyZ3GcVWikMCJKaQZbExItjQwZrXmXluIFgdCnblk0dBAhRPa0GQAQXb+rYtL2pCcJ2AMKQIra9KaIUU7qxqKYp+Lz1AKiwvDUzsowNS++O2xnyguwRmQDAnLI4pMje4C8JiMwAQFiaFgSRX0hzh40DIksAhAOf3T2bQFQ2Z5sz7Q3/LhCZAiAyRbv+gBbZgyA6dcg5+ikbGhv7np4R3iGZf02HrhsTkP8i7tA0kA1hD4LIJA3SJ+jhEoU/BraPUcel+ioQTE+dWk/xe0Fn9pdOCJywDCpB5kNgtNQY4SGFQ5joI7SD3qAGROUocu9hcpGDzmp+UzX9RS+t0As6R0ftn9ZICxBd6v56g2pylvAEIxpJMvpLjRFqo5GcJRyCrDfEuf8cof6pP6qZnEUr6RQLXzxamDB65jd1DUYXQGiGBCvS4uxdojQL9DKHyuiV6KL3yRtEZog22qXRcV5NxRAkSVi9+6szcHPkTp+oUb8akszJskxpYghULEG6BTaJ2+/+QXYcF5GwUQ6BgZAlpzV3tYl+c0zhSZkjNpacltYNkxsaG7qYgq5i+UmDqatxPYHWAhPzs19AYAAomGk8BIR/YD6i30FgACgu/atBoFpGbML37YorJrQf4Yi7zaM6BCwIA7cuxWLLdV+KucBDAwAVRw8CFkRCF4jq6hX1HLs3uuHJ7u2MkrRXHwISBPMTaQSRoTQsKYS8xC8KgGg9oS0/wke0QKRz4bQWC3ZdfeO2rPW36hU9e360ntCuoSAjbrcSrIZBTc+/TXJ5k/wGRQbA0CaXGQhUIsSELgjEKhiKym8Nxc3domUOApWMXQXcJJfChV/mEGYaGIy8XzVxkaiy6dG4sp7dGV3ML5hcxjcLoa0F5J2Voaaq0LwTW04N2kheklvK6w65g3kq9NYPEci45j/xQNg1T7BzcE6lV3SYK3Y9vP8I8k4Ncvkt7J1lHUqkDvZNg1wND2fIvxMYRxveW823/uDvxAeh/SvIC0QxpoTt6DUdem38NoETfn18wy/pKrunZ9KGMJS/otUAMBXaLRM/hLYwGvZXoR5GiyZ9ZX1yEGLoGUY1T0c8dJAQp0/iCJw8hCCM/w4QW+3P8m5kMq3kUHtPTQ44VTiWWzY54lGRPT0IQSmp33h1kKRF9sum7LlwlNNW/OHcitGEVyqaD5S1A0K38Mx/5EgGe/805IijPVvuyWavUl9mZhrwFA41a3CkUEurxfNkthNCmLR0uFmvl8AvFMFvFKHpl3qK5Zwt9recvwWFwpYNrRzTWP4HK7laSxb9gaIAAAAASUVORK5CYII=”),_(n,”alt”,”Success indicator”),_(a,”class”,”zephr-form-success-message svelte-12ljnq4″),$(a,”zephr-payment-form-success-message”,t[1])},m(e,t){y(e,r,t),h(r,n),h(r,i),h(r,a),h(a,s)},p(e,[t]){1&t&&w(s,e[0]),2&t&&$(a,”zephr-payment-form-success-message”,e[1])},i:e,o:e,d(e){e&&g(r)}}}function Ti(e,t,r){let{text:n}=t,{isPaymentForm:o=!1}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”isPaymentForm”in e&&r(1,o=e.isPaymentForm)},[n,o]}class _i extends de{constructor(e){super(),ue(this,e,Ti,vi,a,{text:0,isPaymentForm:1})}}const Oi={matches:e=>e.type===Te,create:(e,t,r,n)=>({component:_i,props:{text:n?.text,isPaymentForm:e.formType===wt.PAYMENT}})},Ii=(e,t)=>({identifiers:{email_address:t},delivery:{method:”email”,destination:t,action:e,redirect:window.location.href.replace(window.location.origin,””)}}),wi=async(e,t,r,n)=>{try{(await fr(“blaize/token-exchange”,{method:”POST”,bodyObject:Ii(t,r)},n)).ok||(n.updateFormState({serverErrors:[at.UNKNOWN]}),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]}))}catch(t){n.updateFormState({serverErrors:[at.UNKNOWN]}),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]})}},Ri=e=>e.formType===wt.REGISTRATION&&!1===Nt(e).usePassword&&!0===e.organisationConfiguration.requireEmailVerfication&&!1===Nt(e).useVerificationCodes,Mi=async(e,t,r)=>Li(t,r).then((async n=>{if(!n.redirected){const o=200===n.status,i=e.parts.flatMap((e=>e.sections)).some((e=>e.type===lt.VERIFICATION_CODE_REGISTRATION.type)),a=!!o&&((await n.json()).contact&&i),s=o&&!a;r.updateFormState({userExists:s,emailIsContact:a});return Ri(e)?s?(wi(e,”login”,t.emailAddress,r),pt(lt.PASSWORDLESS_VIA_LOGIN_LINK.type,e,r)):bt(e,t,r):a||Nt(e).useVerificationCodes||e.organisationConfiguration.twoFactorEmailAuthenticationEnabled?($i(e,t,r),pt(s?lt.VERIFICATION_CODE_LOGIN.type:lt.VERIFICATION_CODE_REGISTRATION.type,e,r)):pt(s?lt.LOGIN_PASSWORD.type:lt.PASSWORD_SETUP.type,e,r)}window.location.replace(n.url)})),Ni=e=>({identifiers:{email_address:e.emailAddress},delivery:{method:”email”,destination:e.emailAddress,action:e.userExists?”login”:”register”,redirect:window.location.href.replace(window.location.origin,””)}}),$i=async(e,t,r)=>{r.updateFormState({verificationCode:””,verificationCodeValid:void 0});const n=await fr(“blaize/two-factor-authentication”,{method:”POST”,bodyObject:Ni(t)},r);return n.ok||(r.updateFormState({serverErrors:[at.VERIFICATION_CODE_SEND_ERROR]}),dt(e,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]})),n.ok},Li=async(e,t)=>(t.updateFormState({password:””,verificationCode:void 0,verificationCodeValid:void 0,forgotPassword:!1}),await fr(“zephr/media/user/info”,{method:”POST”,bodyObject:{identifiers:{email_address:e.emailAddress}}},t)),xi=async e=>await new Promise((t=>setTimeout(t,e.environment.reduceDelays?1:1500))),Fi=async(e,t,r)=>{r.incrementRequestCount(),r.updateFormState({verificationCodeValid:void 0});const n=await fr(`zephr/users/reset/${t.verificationCode}`,{method:”POST”,bodyObject:{identifiers:{email_address:t.emailAddress}}},r);return dt(e,”zephr_form_password_reset_code_validate”,{success:n?.ok}),n.ok?xi(e).then((()=>{r.decrementRequestCount(),r.jumpToSection(lt.PASSWORD_RESET.type)})):(r.updateFormState({serverErrors:[at.VERIFICATION_CODE_INCORRECT]}),dt(e,”zephr_form_error”,{error:at[at.VERIFICATION_CODE_INCORRECT]}),r.decrementRequestCount(),Promise.resolve())},zi=async(e,t,r)=>{r.updateFormState({createPassword:””,confirmCreatePassword:””,forgotPassword:!0,verificationCode:””}),r.incrementRequestCount();const n=await fr(“zephr/users/reset”,{method:”POST”,bodyObject:{identifiers:{email_address:t.emailAddress}}},r);return dt(e,”zephr_form_password_reset_code_sent”,{success:n?.ok}),n.ok?xi(e).then((()=>{r.decrementRequestCount(),r.jumpToSection(lt.FORGOT_PASSWORD.type)})):(r.updateFormState({serverErrors:[at.PASSWORD_RESET_LINK_SEND_ERROR]}),r.decrementRequestCount(),dt(e,”zephr_form_error”,{error:at[at.PASSWORD_RESET_LINK_SEND_ERROR]}),Promise.resolve())},ki=async(e,t,r)=>{const n=await fr(`zephr/users/reset/${t.verificationCode}`,{method:”POST”,bodyObject:{identifiers:{email_address:t.emailAddress},validators:{password:t.createPassword}}},r);return dt(e,”zephr_form_password_reset”,{success:n?.ok}),n.ok?(r.updateFormState({verificationCode:””,forgotPassword:!1}),r.jumpToPartStart(ot.ACCOUNT_VERIFICATION.type)):(r.updateFormState({serverErrors:[at.PASSWORD_RESET_ERROR]}),dt(e,”zephr_form_error”,{error:at[at.MOBILE_PAYMENT_PROCESSING_ERROR]}),Promise.resolve())};function Di(e){let t;function r(e,t){return e[14]&&!e[5]?Ui:Bi}let n=r(e),o=n(e);return{c(){o.c(),t=C()},m(e,r){o.m(e,r),y(e,t,r)},p(e,i){n===(n=r(e))&&o?o.p(e,i):(o.d(1),o=n(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){e&&g(t),o.d(e)}}}function Bi(e){let t,r,n,o;return{c(){t=P(“button”),r=A(e[3]),_(t,”class”,”zephr-form-verification-resend-link svelte-b6r3ph”),$(t,”zephr-payment-form-verification-resend-link”,e[9])},m(i,a){y(i,t,a),h(t,r),n||(o=v(t,”click”,e[15]),n=!0)},p(e,n){8&n&&w(r,e[3]),512&n&&$(t,”zephr-payment-form-verification-resend-link”,e[9])},d(e){e&&g(t),n=!1,o()}}}function Ui(e){let t,r;return{c(){t=P(“div”),r=A(e[2]),_(t,”class”,”zephr-form-verification-resend-text svelte-b6r3ph”),$(t,”zephr-payment-form-verification-resend-text”,e[9])},m(e,n){y(e,t,n),h(t,r)},p(e,n){4&n&&w(r,e[2]),512&n&&$(t,”zephr-payment-form-verification-resend-text”,e[9])},d(e){e&&g(t)}}}function Gi(e){let t,r=e[3]&&Di(e);return{c(){r&&r.c(),t=C()},m(e,n){r&&r.m(e,n),y(e,t,n)},p(e,n){e[3]?r?r.p(e,n):(r=Di(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){e&&g(t),r&&r.d(e)}}}function Vi(e){let t,r;return t=new er({props:{icon:Kt}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function qi(e){let t,r;return t=new er({props:{icon:Ht,spin:!0}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function ji(e){let t,r,n,o,i,a,s,c;t=new Lo({props:{forInput:”zephr-form-verification-code”,label:e[0],isPaymentForm:e[9]}}),o=new Ro({props:{id:”zephr-form-verification-code”,value:e[8],placeholder:e[1],maxlength:6,hasError:null!=e[5],errorMessage:e[5],isPaymentForm:e[9],onFocus:e[12],onBlur:e[13],$$slots:{default:[Gi]},$$scope:{ctx:e}}}),o.$on(“change”,e[16]);let l=e[6]&&Vi(),u=e[8]&&!e[6]&&e[7]&&qi();return{c(){ae(t.$$.fragment),r=S(),n=P(“div”),ae(o.$$.fragment),i=S(),a=P(“div”),l&&l.c(),s=S(),u&&u.c(),_(a,”class”,”zephr-form-input-inner-text”),$(a,”zephr-payment-form-input-inner-text”,e[9]),_(n,”class”,”zephr-form-relative-container zephr-form-verification-resend-link-container svelte-b6r3ph”),$(n,”zephr-payment-form-relative-container”,e[9]),$(n,”zephr-payment-form-verification-resend-link-container”,e[9])},m(e,d){se(t,e,d),y(e,r,d),y(e,n,d),se(o,n,null),h(n,i),h(n,a),l&&l.m(a,null),h(a,s),u&&u.m(a,null),c=!0},p(e,[r]){const i={};1&r&&(i.label=e[0]),512&r&&(i.isPaymentForm=e[9]),t.$set(i);const d={};256&r&&(d.value=e[8]),2&r&&(d.placeholder=e[1]),32&r&&(d.hasError=null!=e[5]),32&r&&(d.errorMessage=e[5]),512&r&&(d.isPaymentForm=e[9]),4096&r&&(d.onFocus=e[12]),8192&r&&(d.onBlur=e[13]),150060&r&&(d.$$scope={dirty:r,ctx:e}),o.$set(d),e[6]?l?64&r&&te(l,1):(l=Vi(),l.c(),te(l,1),l.m(a,s)):l&&(X(),re(l,1,1,(()=>{l=null})),ee()),e[8]&&!e[6]&&e[7]?u?448&r&&te(u,1):(u=qi(),u.c(),te(u,1),u.m(a,null)):u&&(X(),re(u,1,1,(()=>{u=null})),ee()),(!c||512&r)&&$(a,”zephr-payment-form-input-inner-text”,e[9]),(!c||512&r)&&$(n,”zephr-payment-form-relative-container”,e[9]),(!c||512&r)&&$(n,”zephr-payment-form-verification-resend-link-container”,e[9])},i(e){c||(te(t.$$.fragment,e),te(o.$$.fragment,e),te(l),te(u),c=!0)},o(e){re(t.$$.fragment,e),re(o.$$.fragment,e),re(l),re(u),c=!1},d(e){e&&(g(r),g(n)),ce(t,e),ce(o),l&&l.d(),u&&u.d()}}}function Hi(e,t,r){let{label:n}=t,{placeholder:o}=t,{resendMessage:i=null}=t,{resendText:a=null}=t,{disabled:s}=t,{error:c=null}=t,{codeValid:l}=t,{formBusy:u}=t,{code:d}=t,{isPaymentForm:p=!1}=t,{onChange:m}=t,{onResendVerificationCode:f}=t,{onFocus:h}=t,{onBlur:y}=t,g=!1;return e.$$set=e=>{“label”in e&&r(0,n=e.label),”placeholder”in e&&r(1,o=e.placeholder),”resendMessage”in e&&r(2,i=e.resendMessage),”resendText”in e&&r(3,a=e.resendText),”disabled”in e&&r(4,s=e.disabled),”error”in e&&r(5,c=e.error),”codeValid”in e&&r(6,l=e.codeValid),”formBusy”in e&&r(7,u=e.formBusy),”code”in e&&r(8,d=e.code),”isPaymentForm”in e&&r(9,p=e.isPaymentForm),”onChange”in e&&r(10,m=e.onChange),”onResendVerificationCode”in e&&r(11,f=e.onResendVerificationCode),”onFocus”in e&&r(12,h=e.onFocus),”onBlur”in e&&r(13,y=e.onBlur)},[n,o,i,a,s,c,l,u,d,p,m,f,h,y,g,()=>{i&&(r(14,g=!0),setTimeout((()=>r(14,g=!1)),2e3)),f()},({detail:e})=>!s&&m(e)]}class Ki extends de{constructor(e){super(),ue(this,e,Hi,ji,a,{label:0,placeholder:1,resendMessage:2,resendText:3,disabled:4,error:5,codeValid:6,formBusy:7,code:8,isPaymentForm:9,onChange:10,onResendVerificationCode:11,onFocus:12,onBlur:13})}}const Yi=e=>6===e?.length,Wi={matches:e=>e.type===Ee,create:(e,t,r,n)=>({component:Ki,props:{code:t.verificationCode,label:n.label,placeholder:n.placeholder,resendMessage:n.message,resendText:n.resendText,disabled:t.isBusy||t.verificationCodeValid,codeValid:t.verificationCodeValid,formBusy:t.isBusy,isPaymentForm:e.formType===wt.PAYMENT,onResendVerificationCode:()=>{(t.currentSection.type===lt.FORGOT_PASSWORD.type?zi:$i)(e,t,r)},onChange:o=>{const i=r.updateFormState({verificationCodeValid:void 0,verificationCode:o,serverErrors:[]}),a=(e=>!e.elementValidity.filter((t=>t.partType===e.currentPart.type&&t.sectionType===e.currentSection.type&&t.sectionOrder===e.currentSection.order&&”user_attribute”===t.elementType)).some((e=>!e.isValid)))(t);if(r.updateFormState({showFieldErrors:!a}),Yi(o)){if(n.verificationEvent)return void r.onEvent(n.verificationEvent);t.currentSection.type===lt.FORGOT_PASSWORD.type?r.completeSection():a&&(async(e,t,r)=>{if(!(await fr(“zephr/media/user/otp-check”,{method:”POST”,bodyObject:{code:t.verificationCode,email:t.emailAddress}},r)).ok)return r.updateFormState({verificationCodeValid:!1,serverErrors:[at.VERIFICATION_CODE_INCORRECT]}),void dt(e,”zephr_form_error”,{error:at[at.VERIFICATION_CODE_INCORRECT]});r.updateFormState({verificationCodeValid:!1,serverErrors:[]}),r.completeSection()})(e,i,r)}dt(e,”zephr_form_input_change”,{inputName:”zephr-form-verification-code”,sectionId:t.currentSection.type,field:”verification-code”})},onFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:”zephr-form-verification-code”,sectionId:t.currentSection.type,field:”verification-code”}),onBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:”zephr-form-verification-code”,sectionId:t.currentSection.type,field:”verification-code”})},isValid:Yi(t.verificationCode)})};function Ji(t){let r;return{c(){r=P(“div”),_(r,”class”,”zephr-form-custom-text svelte-12fdogm”),M(r,”text-align”,t[1]?”center”:”initial”),$(r,”zephr-payment-form-custom-text”,t[2])},m(e,n){y(e,r,n),r.innerHTML=t[0]},p(e,[t]){1&t&&(r.innerHTML=e[0]),2&t&&M(r,”text-align”,e[1]?”center”:”initial”),4&t&&$(r,”zephr-payment-form-custom-text”,e[2])},i:e,o:e,d(e){e&&g(r)}}}function Qi(e,t,r){let{text:n}=t,{centerText:o=!1}=t,{isPaymentForm:i=!1}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”centerText”in e&&r(1,o=e.centerText),”isPaymentForm”in e&&r(2,i=e.isPaymentForm)},[n,o,i]}class Zi extends de{constructor(e){super(),ue(this,e,Qi,Ji,a,{text:0,centerText:1,isPaymentForm:2})}}const Xi={matches:e=>e.type===_e,create:(e,t,r,n)=>({component:Zi,props:{text:n.text,centerText:n.centerText,isPaymentForm:e.formType===wt.PAYMENT}})};function ea(r){let n,o,i,a,s,c,l,u,d=[{id:r[0]},{name:r[1]},{required:r[2]},{disabled:r[3]},r[8],{type:”checkbox”},{class:”zephr-form-checkbox”}],p={};for(let e=0;e{“id”in e&&r(0,o=e.id),”name”in e&&r(1,i=e.name),”required”in e&&r(2,a=e.required),”disabled”in e&&r(3,s=e.disabled),”hasError”in e&&r(4,c=e.hasError),”isPaymentForm”in e&&r(5,l=e.isPaymentForm),”label”in e&&r(6,u=e.label),”value”in e&&r(10,d=e.value),”placeholder”in e&&r(11,p=e.placeholder),”checked”in e&&r(7,m=e.checked),”pattern”in e&&r(12,f=e.pattern)},[o,i,a,s,c,l,u,m,h,e=>{n(“change”,e.target.checked)},d,p,f]}class ra extends de{constructor(e){super(),ue(this,e,ta,ea,a,{id:0,name:1,required:2,disabled:3,hasError:4,isPaymentForm:5,label:6,value:10,placeholder:11,checked:7,pattern:12})}}function na(r){let n,o,i,a,s,c,l,u,d=[{id:r[0]},{name:r[1]},{required:r[2]},{disabled:r[3]},r[8],{type:”radio”},{class:”zephr-form-input-radio”}],p={};for(let e=0;e{“id”in e&&r(0,o=e.id),”name”in e&&r(1,i=e.name),”required”in e&&r(2,a=e.required),”disabled”in e&&r(3,s=e.disabled),”hasError”in e&&r(4,c=e.hasError),”isPaymentForm”in e&&r(5,l=e.isPaymentForm),”label”in e&&r(6,u=e.label),”value”in e&&r(10,d=e.value),”placeholder”in e&&r(11,p=e.placeholder),”checked”in e&&r(7,m=e.checked),”pattern”in e&&r(12,f=e.pattern)},[o,i,a,s,c,l,u,m,h,e=>{n(“change”,e.target.value)},d,p,f]}class ia extends de{constructor(e){super(),ue(this,e,oa,na,a,{id:0,name:1,required:2,disabled:3,hasError:4,isPaymentForm:5,label:6,value:10,placeholder:11,checked:7,pattern:12})}}function aa(e,t,r){const n=e.slice();return n[19]=t[r],n}function sa(e,t,r){const n=e.slice();return n[19]=t[r],n}function ca(e){let t,r;return t=new Ro({props:{id:e[10],name:e[0].slug,required:e[0].required||e[1]?.required,type:e[1]?.[“input-type”],value:e[2],checked:”checkbox”===e[1]?.[“input-type”]&&e[2],pattern:e[1]?.[“validation-expression”],placeholder:e[0].placeholder,hasError:e[8],isPaymentForm:e[3],onFocus:e[5],onBlur:e[6]}}),t.$on(“change”,e[18]),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};1&r&&(n.name=e[0].slug),3&r&&(n.required=e[0].required||e[1]?.required),2&r&&(n.type=e[1]?.[“input-type”]),4&r&&(n.value=e[2]),6&r&&(n.checked=”checkbox”===e[1]?.[“input-type”]&&e[2]),2&r&&(n.pattern=e[1]?.[“validation-expression”]),1&r&&(n.placeholder=e[0].placeholder),256&r&&(n.hasError=e[8]),8&r&&(n.isPaymentForm=e[3]),32&r&&(n.onFocus=e[5]),64&r&&(n.onBlur=e[6]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function la(e){let t,r,n,o;r=new Ro({props:{id:e[10],required:e[0].required||e[1]?.required,type:e[1][“input-type”],value:e[2],min:e[1][“range-start”],max:e[1][“range-end”],step:e[1][“range-start”],isPaymentForm:e[3],onFocus:e[5],onBlur:e[6]}}),r.$on(“change”,e[17]);let i=”range”===e[1][“input-type”]&&null!=e[2]&&fa(e);return{c(){t=P(“div”),ae(r.$$.fragment),n=S(),i&&i.c(),_(t,”class”,”zephr-form-flex-container”),$(t,”zephr-payment-form-flex-container”,e[3])},m(e,a){y(e,t,a),se(r,t,null),h(t,n),i&&i.m(t,null),o=!0},p(e,n){const a={};3&n&&(a.required=e[0].required||e[1]?.required),2&n&&(a.type=e[1][“input-type”]),4&n&&(a.value=e[2]),2&n&&(a.min=e[1][“range-start”]),2&n&&(a.max=e[1][“range-end”]),2&n&&(a.step=e[1][“range-start”]),8&n&&(a.isPaymentForm=e[3]),32&n&&(a.onFocus=e[5]),64&n&&(a.onBlur=e[6]),r.$set(a),”range”===e[1][“input-type”]&&null!=e[2]?i?i.p(e,n):(i=fa(e),i.c(),i.m(t,null)):i&&(i.d(1),i=null),(!o||8&n)&&$(t,”zephr-payment-form-flex-container”,e[3])},i(e){o||(te(r.$$.fragment,e),o=!0)},o(e){re(r.$$.fragment,e),o=!1},d(e){e&&g(t),ce(r),i&&i.d()}}}function ua(t){let r,n,o,i,a;return{c(){r=P(“textarea”),_(r,”id”,t[10]),_(r,”class”,”zephr-form-input zephr-form-input-textarea svelte-1f2hwm0″),r.required=n=t[0].required||t[1]?.required,_(r,”placeholder”,o=t[0].placeholder),$(r,”zephr-payment-form-input”,t[3]),$(r,”zephr-payment-form-input-textarea”,t[3])},m(e,n){y(e,r,n),R(r,t[7]),i||(a=v(r,”input”,t[16]),i=!0)},p(e,t){3&t&&n!==(n=e[0].required||e[1]?.required)&&(r.required=n),1&t&&o!==(o=e[0].placeholder)&&_(r,”placeholder”,o),128&t&&R(r,e[7]),8&t&&$(r,”zephr-payment-form-input”,e[3]),8&t&&$(r,”zephr-payment-form-input-textarea”,e[3])},i:e,o:e,d(e){e&&g(r),i=!1,a()}}}function da(t){let r,n,o,i,a,s,c,l,u=(t[0].placeholder??””)+””,d=ne(t[1]?.[“select-options”]),p=[];for(let e=0;e<d.length;e+=1)p[e]=ha(aa(t,d,e));return{c(){r=P("select"),n=P("option"),o=A(u);for(let e=0;e<p.length;e+=1)p[e].c();n.disabled=!0,n.__value="",R(n,n.__value),_(r,"id",t[10]),_(r,"name",i=t[0].slug),_(r,"class","zephr-form-input zephr-form-input-select svelte-1f2hwm0"),r.required=a=t[0].required||t[1]?.required,$(r,"zephr-payment-form-input",t[3]),$(r,"zephr-payment-form-input-select",t[3]),$(r,"unselected",!t[2]),$(r,"error",t[8])},m(e,i){y(e,r,i),h(r,n),h(n,o);for(let e=0;e<p.length;e+=1)p[e]&&p[e].m(r,null);N(r,t[2]??""),c||(l=v(r,"change",t[15]),c=!0)},p(e,t){if(1&t&&u!==(u=(e[0].placeholder??"")+"")&&w(o,u),6&t){let n;for(d=ne(e[1]?.["select-options"]),n=0;n<d.length;n+=1){const o=aa(e,d,n);p[n]?p[n].p(o,t):(p[n]=ha(o),p[n].c(),p[n].m(r,null))}for(;n
{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=C()},m(e,n){for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,n);y(e,t,n),r=!0},p(e,r){if(1311&r){let a;for(n=ne(e[1]?.["select-options"]),a=0;a<n.length;a+=1){const i=sa(e,n,a);o[a]?(o[a].p(i,r),te(o[a],1)):(o[a]=ya(i),o[a].c(),te(o[a],1),o[a].m(t.parentNode,t))}for(X(),a=n.length;a<o.length;a+=1)i(a);ee()}},i(e){if(!r){for(let e=0;ee,h=`zephr-form-${i.slug}-${o}`;return e.$$set=e=>{“formKey”in e&&r(11,o=e.formKey),”config”in e&&r(0,i=e.config),”attributeSchema”in e&&r(1,a=e.attributeSchema),”value”in e&&r(2,s=e.value),”error”in e&&r(12,c=e.error),”isPaymentForm”in e&&r(3,l=e.isPaymentForm),”onChange”in e&&r(4,u=e.onChange),”onFocus”in e&&r(5,d=e.onFocus),”onBlur”in e&&r(6,p=e.onBlur)},e.$$.update=()=>{4096&e.$$.dirty&&r(8,n=!!c),150&e.$$.dirty&&”textarea”===a?.[“input-type”]&&m!==s&&u(m)},[i,a,s,l,u,d,p,m,n,f,h,o,c,({detail:e})=>u(e),({detail:e})=>u(e),e=>u(e.target.value),function(){m=this.value,r(7,m)},({detail:e})=>u(e),({detail:e})=>u(e)]}class Aa extends de{constructor(e){super(),ue(this,e,Ea,Pa,a,{formKey:11,config:0,attributeSchema:1,value:2,error:12,isPaymentForm:3,onChange:4,onFocus:5,onBlur:6})}}const Sa=e=>null==e||””===e,Ca={matches:e=>e.type===Oe,create:(e,t,r,n)=>{const o=e.organisationConfiguration.schemaFields.find((e=>e.slug===n.slug)),i=t.hideIfSetAttributes?.includes(n.slug);if(null==o||i)return;const a=o.required||n.required,s=t.userAttributes[n.slug]??(t.readOnlyAttributeValues??{})[n.slug];return{component:Aa,props:{formKey:e.uniqueKey,config:n,value:s,attributeSchema:o,isPaymentForm:e.formType===wt.PAYMENT,onChange:o=>{r.updateFormState({userAttributes:{…t.userAttributes,[n.slug]:o}}),dt(e,”zephr_form_input_change”,{inputName:`zephr-form-${n.slug}-${e.uniqueKey}`,sectionId:t.currentSection.type,field:n.slug})},onFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:`zephr-form-${n.slug}-${e.uniqueKey}`,sectionId:t.currentSection.type,field:n.slug}),onBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:`zephr-form-${n.slug}-${e.uniqueKey}`,sectionId:t.currentSection.type,field:n.slug})},isValid:!(a&&Sa(s)||a&&”checkbox”===o[“input-type”]&&!s||”email”===o[“input-type”]&&!Sa(s)&&!mi(s))}}};function va(t){let r,n,o,i;return{c(){r=P(“button”),n=A(t[0]),_(r,”type”,”button”),_(r,”class”,”zephr-form-link svelte-1mdtotm”),$(r,”zephr-form-link-disabled”,t[1]),$(r,”zephr-form-link-no-underline”,t[3])},m(e,a){y(e,r,a),h(r,n),o||(i=v(r,”click”,t[5]),o=!0)},p(e,[t]){1&t&&w(n,e[0]),2&t&&$(r,”zephr-form-link-disabled”,e[1]),8&t&&$(r,”zephr-form-link-no-underline”,e[3])},i:e,o:e,d(e){e&&g(r),o=!1,i()}}}function Ta(e,t,r){let{text:n}=t,{disabled:o=!1}=t,{onClick:i=(()=>{})}=t,{noUnderline:a=!1}=t;const s=D();return e.$$set=e=>{“text”in e&&r(0,n=e.text),”disabled”in e&&r(1,o=e.disabled),”onClick”in e&&r(2,i=e.onClick),”noUnderline”in e&&r(3,a=e.noUnderline)},[n,o,i,a,s,()=>{i(),s(“linkClick”,null)}]}class _a extends de{constructor(e){super(),ue(this,e,Ta,va,a,{text:0,disabled:1,onClick:2,noUnderline:3})}}function Oa(e){let t,r;return t=new _a({props:{text:e[0],onClick:e[2]}}),t.$on(“linkClick”,e[7]),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};1&r&&(n.text=e[0]),4&r&&(n.onClick=e[2]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Ia(t){let r,n;return{c(){r=P(“div”),n=A(t[1]),_(r,”class”,”zephr-form-link-message svelte-11qigta”)},m(e,t){y(e,r,t),h(r,n)},p(e,t){2&t&&w(n,e[1])},i:e,o:e,d(e){e&&g(r)}}}function wa(e){let t,r;return t=new zt({props:{error:e[3],isPaymentForm:e[5]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};8&r&&(n.error=e[3]),32&r&&(n.isPaymentForm=e[5]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Ra(e){let t,r,n,o,i;const a=[Ia,Oa],s=[];function c(e,t){return e[6]&&!e[3]?0:1}r=c(e),n=s[r]=a[r](e);let l=e[3]&&wa(e);return{c(){t=P(“div”),n.c(),o=S(),l&&l.c(),_(t,”class”,”zephr-form-flex-container zephr-form-reset-link-container svelte-11qigta”),$(t,”zephr-payment-form-flex-container”,e[5])},m(e,n){y(e,t,n),s[r].m(t,null),h(t,o),l&&l.m(t,null),i=!0},p(e,[u]){let d=r;r=c(e),r===d?s[r].p(e,u):(X(),re(s[d],1,1,(()=>{s[d]=null})),ee(),n=s[r],n?n.p(e,u):(n=s[r]=a[r](e),n.c()),te(n,1),n.m(t,o)),e[3]?l?(l.p(e,u),8&u&&te(l,1)):(l=wa(e),l.c(),te(l,1),l.m(t,null)):l&&(X(),re(l,1,1,(()=>{l=null})),ee()),(!i||32&u)&&$(t,”zephr-payment-form-flex-container”,e[5])},i(e){i||(te(n),te(l),i=!0)},o(e){re(n),re(l),i=!1},d(e){e&&g(t),s[r].d(),l&&l.d()}}}function Ma(e,t,r){let{text:n}=t,{message:o}=t,{onClick:i}=t,{error:a=null}=t,{delayMs:s}=t,{isPaymentForm:c=!1}=t,l=!1;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”message”in e&&r(1,o=e.message),”onClick”in e&&r(2,i=e.onClick),”error”in e&&r(3,a=e.error),”delayMs”in e&&r(4,s=e.delayMs),”isPaymentForm”in e&&r(5,c=e.isPaymentForm)},[n,o,i,a,s,c,l,()=>{o&&(r(6,l=!0),setTimeout((()=>r(6,l=!1)),s))}]}class Na extends de{constructor(e){super(),ue(this,e,Ma,Ra,a,{text:0,message:1,onClick:2,error:3,delayMs:4,isPaymentForm:5})}}const $a={matches:e=>e.type===Ie,create:(e,t,r,n)=>({component:Na,props:{text:n.text,message:n.message,delayMs:e.environment.reduceDelays?1:3e3,isPaymentForm:e.formType===wt.PAYMENT,onClick:()=>zi(e,t,r)}})};function La(e){let t,r;return t=new _a({props:{text:e[0],onClick:e[2]}}),t.$on(“linkClick”,e[7]),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};1&r&&(n.text=e[0]),4&r&&(n.onClick=e[2]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function xa(t){let r,n;return{c(){r=P(“div”),n=A(t[1]),_(r,”class”,”zephr-form-link-message svelte-11qigta”)},m(e,t){y(e,r,t),h(r,n)},p(e,t){2&t&&w(n,e[1])},i:e,o:e,d(e){e&&g(r)}}}function Fa(e){let t,r;return t=new zt({props:{error:e[3],isPaymentForm:e[5]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};8&r&&(n.error=e[3]),32&r&&(n.isPaymentForm=e[5]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function za(e){let t,r,n,o,i;const a=[xa,La],s=[];function c(e,t){return e[6]&&!e[3]?0:1}r=c(e),n=s[r]=a[r](e);let l=e[3]&&Fa(e);return{c(){t=P(“div”),n.c(),o=S(),l&&l.c(),_(t,”class”,”zephr-form-flex-container zephr-form-reset-link-container svelte-11qigta”),$(t,”zephr-payment-form-flex-container”,e[5])},m(e,n){y(e,t,n),s[r].m(t,null),h(t,o),l&&l.m(t,null),i=!0},p(e,[u]){let d=r;r=c(e),r===d?s[r].p(e,u):(X(),re(s[d],1,1,(()=>{s[d]=null})),ee(),n=s[r],n?n.p(e,u):(n=s[r]=a[r](e),n.c()),te(n,1),n.m(t,o)),e[3]?l?(l.p(e,u),8&u&&te(l,1)):(l=Fa(e),l.c(),te(l,1),l.m(t,null)):l&&(X(),re(l,1,1,(()=>{l=null})),ee()),(!i||32&u)&&$(t,”zephr-payment-form-flex-container”,e[5])},i(e){i||(te(n),te(l),i=!0)},o(e){re(n),re(l),i=!1},d(e){e&&g(t),s[r].d(),l&&l.d()}}}function ka(e,t,r){let{text:n}=t,{message:o}=t,{onClick:i}=t,{error:a=null}=t,{delayMs:s}=t,{isPaymentForm:c=!1}=t,l=!1;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”message”in e&&r(1,o=e.message),”onClick”in e&&r(2,i=e.onClick),”error”in e&&r(3,a=e.error),”delayMs”in e&&r(4,s=e.delayMs),”isPaymentForm”in e&&r(5,c=e.isPaymentForm)},[n,o,i,a,s,c,l,()=>{o&&(r(6,l=!0),setTimeout((()=>r(6,l=!1)),s))}]}class Da extends de{constructor(e){super(),ue(this,e,ka,za,a,{text:0,message:1,onClick:2,error:3,delayMs:4,isPaymentForm:5})}}const Ba={matches:e=>e.type===we,create:(e,t,r,n)=>({component:Da,props:{text:n.text,message:n.message,delayMs:e.environment.reduceDelays?1:3e3,isPaymentForm:e.formType===wt.PAYMENT,onClick:async()=>{await wi(e,”login”,t.emailAddress,r)}}})},Ua=(e,t)=>r=>{if(r?.data?.fromZephr)if(window.removeEventListener(“message”,window.zephrOAuthListener),e.environment.debugLogging&&console.log(“Social signin message:”,r),”register”===r.data.action){const n=t.updateFormState({emailAddress:r.data.identifier,socialSigninToken:r.data.stateKey,userAttributes:r.data.userAttributes??{},socialSignin:!0,userExists:!1,emailIsContact:void 0});Nt(e).useVerificationCodes&&$i(e,n,t),bt(e,n,t)}else”otp”==r.data.action?(t.updateFormState({emailAddress:r.data.identifier,socialSigninToken:r.data.stateKey,userAttributes:r.data.userAttributes??{},socialSignin:!0,userExists:!0,emailIsContact:!1}),t.jumpToSection(lt.VERIFICATION_CODE_LOGIN.type)):”login”===r.data.action?(document.cookie=r.data.cookie,t.updateFormState({socialSignin:!0,userExists:!0,loginRegistrationComplete:!0,emailIsContact:!1}),t.onEvent(nt.LOGIN_REGISTRATION_COMPLETE)):t.updateFormState({socialSigninError:r.data.message??”Something went wrong. Please try again later!”})};var Ga={prefix:”fab”,iconName:”microsoft”,icon:[448,512,[],”f3ca”,”M0 32h214.6v214.6H0V32zm233.4 0H448v214.6H233.4V32zM0 265.4h214.6V480H0V265.4zm233.4 0H448V480H233.4V265.4z”]},Va={prefix:”fab”,iconName:”apple”,icon:[384,512,[],”f179″,”M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z”]},qa={prefix:”fab”,iconName:”linkedin”,icon:[448,512,[],”f08c”,”M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z”]},ja={prefix:”fab”,iconName:”facebook”,icon:[512,512,[62e3],”f09a”,”M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z”]},Ha={prefix:”fab”,iconName:”twitter”,icon:[512,512,[],”f099″,”M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z”]};function Ka(t){let r,n,o,i,a;return{c(){r=E(“svg”),n=E(“path”),o=E(“path”),i=E(“path”),a=E(“path”),_(n,”d”,”M533.5 278.4c0-18.5-1.5-37.1-4.7-55.3H272.1v104.8h147c-6.1 33.8-25.7 63.7-54.4 82.7v68h87.7c51.5-47.4 81.1-117.4 81.1-200.2z”),_(n,”fill”,”#4285f4″),_(o,”d”,”M272.1 544.3c73.4 0 135.3-24.1 180.4-65.7l-87.7-68c-24.4 16.6-55.9 26-92.6 26-71 0-131.2-47.9-152.8-112.3H28.9v70.1c46.2 91.9 140.3 149.9 243.2 149.9z”),_(o,”fill”,”#34a853″),_(i,”d”,”M119.3 324.3c-11.4-33.8-11.4-70.4 0-104.2V150H28.9c-38.6 76.9-38.6 167.5 0 244.4l90.4-70.1z”),_(i,”fill”,”#fbbc04″),_(a,”d”,”M272.1 107.7c38.8-.6 76.3 14 104.4 40.8l77.7-77.7C405 24.6 339.7-.8 272.1 0 169.2 0 75.1 58 28.9 150l90.4 70.1c21.5-64.5 81.8-112.4 152.8-112.4z”),_(a,”fill”,”#ea4335″),_(r,”class”,”zephr-form-social-sign-in-icon zephr-form-google-icon svelte-155mfls”),_(r,”viewBox”,”0 0 533.5 544.3″),_(r,”xmlns”,”http://www.w3.org/2000/svg”)},m(e,t){y(e,r,t),h(r,n),h(r,o),h(r,i),h(r,a)},p:e,i:e,o:e,d(e){e&&g(r)}}}class Ya extends de{constructor(e){super(),ue(this,e,null,Ka,a,{})}}function Wa(e,t,r){const n=e.slice();return n[8]=t[r],n}function Ja(e){let t,r,n,o,i,a,s,c,l,u,d,p,m=e[8]+””;const f=[Za,Qa],b=[];function E(e,t){return”Google”===e[8]?0:1}function C(){return e[6](e[8])}return o=E(e),i=b[o]=f[o](e),{c(){t=P(“button”),r=P(“span”),n=P(“span”),i.c(),a=S(),s=A(e[4]),c=S(),l=A(m),_(n,”class”,”zephr-form-social-sign-in-icon svelte-18a7qws”),$(n,”zephr-payment-form-social-sign-in-icon”,e[3]),_(r,”class”,”zephr-form-flex-container zephr-form-social-sign-in svelte-18a7qws”),$(r,”zephr-payment-form-flex-container”,e[3]),$(r,”zephr-payment-form-social-sign-in”,e[3]),_(t,”type”,”button”),_(t,”class”,”zephr-form-button zephr-form-social-sign-in-button svelte-18a7qws”),$(t,”zephr-payment-form-button”,e[3]),$(t,”zephr-payment-form-social-sign-in-button”,e[3])},m(e,i){y(e,t,i),h(t,r),h(r,n),b[o].m(n,null),h(r,a),h(r,s),h(r,c),h(r,l),u=!0,d||(p=v(t,”click”,T(C)),d=!0)},p(a,s){let c=o;o=E(e=a),o===c?b[o].p(e,s):(X(),re(b[c],1,1,(()=>{b[c]=null})),ee(),i=b[o],i?i.p(e,s):(i=b[o]=f[o](e),i.c()),te(i,1),i.m(n,null)),(!u||8&s)&&$(n,”zephr-payment-form-social-sign-in-icon”,e[3]),(!u||1&s)&&m!==(m=e[8]+””)&&w(l,m),(!u||8&s)&&$(r,”zephr-payment-form-flex-container”,e[3]),(!u||8&s)&&$(r,”zephr-payment-form-social-sign-in”,e[3]),(!u||8&s)&&$(t,”zephr-payment-form-button”,e[3]),(!u||8&s)&&$(t,”zephr-payment-form-social-sign-in-button”,e[3])},i(e){u||(te(i),u=!0)},o(e){re(i),u=!1},d(e){e&&g(t),b[o].d(),d=!1,p()}}}function Qa(e){let r,n;const o=[e[5](e[8])];let i={};for(let e=0;e{n=null})),ee())},i(e){r||(te(n),r=!0)},o(e){re(n),r=!1},d(e){e&&g(t),n&&n.d(e)}}}function es(e){let t,r;return t=new zt({props:{error:e[2],isPaymentForm:e[3]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};4&r&&(n.error=e[2]),8&r&&(n.isPaymentForm=e[3]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function ts(e){let t,r,n,o=ne(Object.keys(e[0])),i=[];for(let t=0;tre(i[e],1,1,(()=>{i[e]=null}));let s=e[2]&&es(e);return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=S(),s&&s.c(),r=C()},m(e,o){for(let t=0;t<i.length;t+=1)i[t]&&i[t].m(e,o);y(e,t,o),s&&s.m(e,o),y(e,r,o),n=!0},p(e,[n]){if(59&n){let r;for(o=ne(Object.keys(e[0])),r=0;r<o.length;r+=1){const a=Wa(e,o,r);i[r]?(i[r].p(a,n),te(i[r],1)):(i[r]=Xa(a),i[r].c(),te(i[r],1),i[r].m(t.parentNode,t))}for(X(),r=o.length;r{s=null})),ee())},i(e){if(!n){for(let e=0;e<o.length;e+=1)te(i[e]);te(s),n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e{“config”in e&&r(0,n=e.config),”onSelectProvider”in e&&r(1,o=e.onSelectProvider),”error”in e&&r(2,i=e.error),”isPaymentForm”in e&&r(3,a=e.isPaymentForm)},[n,o,i,a,c,e=>{switch(e){case”Facebook”:default:return{icon:ja,color:”#1877f2″,size:”lg”};case”LinkedIn”:return{icon:qa,color:”#0a66c2″,size:”lg”};case”Apple”:return{icon:Va,color:”#000″,size:”lg”};case”Microsoft”:return{icon:Ga,color:”#00a4ef”,size:”lg”};case”Twitter”:return{icon:Ha,color:”#08a0e9″,size:”lg”}}},e=>o(e.toLowerCase())]}class ns extends de{constructor(e){super(),ue(this,e,rs,ts,a,{config:0,onSelectProvider:1,error:2,isPaymentForm:3})}}const os={matches:e=>e.type===Re,create:(e,t,r,n)=>{const{enabled:o,hide:i,show:a,…s}=n??{};return{component:ns,props:{config:s,isPaymentForm:e.formType===wt.PAYMENT,onSelectProvider:t=>((e,t,r)=>{r.updateFormState({socialSigninError:void 0}),window.open(`${t.environment.apiUrlBase??””}/blaize/oauth/${e}`,e+” sign-in”,”menubar=no,location=yes,resizable=no,scrollbars=no,status=no,width=500,height=600″);const n=Ua(t,r);window.zephrOAuthListener=n,window.addEventListener(“message”,n)})(t,e,r)}}}},is=”promo-code”,as=async(e,t,r)=>{const n=await hn(e,t,r,!0),o=await lo(e,n,r);if(t.currentSection.elements.some((e=>e.type===xe&&!1!==e.config?.enabled))){r.incrementRequestCount();try{await co(e.organisationConfiguration.paymentProvider).loader(e,o,r)}finally{r.decrementRequestCount()}}},ss=async(e,t,r)=>{const n=so(e.organisationConfiguration.paymentProvider);return n.hasPromoCodes(e)?n?.promoCodeServiceOverride?n.promoCodeServiceOverride(e,t,r):(async(e,t,r)=>{r.updateFormState({promoCodeValid:void 0,serverErrors:[],discountedPlanPrices:[]});const n=so(e.organisationConfiguration.paymentProvider),o=await fr(n.promoCodeCheckPath,{method:”POST”,bodyObject:{promoCode:t.promoCode,paymentOptions:Nt(e).paymentOptions}},r,is);if(!o.ok){let t;if(403===o.status){const e=await o.json();t=2===e?.code||3===e?.code?at.PROMO_CODE_EXPIRED_ERROR:at.PROMO_CODE_INVALID_ERROR}else t=at.PROMO_CODE_INVALID_ERROR,console.error(“Unknown error evaluating promo code”,o);return dt(e,”zephr_form_error”,{error:at[t]}),Promise.resolve(r.updateFormState({promoCodeValid:!1,serverErrors:[t],discountedPlanPrices:[]}))}const i=(await o.json()).paymentOptions.map((e=>({planSlug:e.slug,productId:e.productId,discountPrice:e.discountPrice})));return i.find((e=>e.planSlug===t.paymentOption.slug&&e.productId===t.paymentOption.productId))?Promise.resolve(r.updateFormState({promoCodeValid:!0,serverErrors:[],discountedPlanPrices:i})):(dt(e,”zephr_form_error”,{error:at[at.PROMO_CODE_NOT_VALID_FOR_PLAN_ERROR]}),Promise.resolve(r.updateFormState({promoCodeValid:!1,serverErrors:[at.PROMO_CODE_NOT_VALID_FOR_PLAN_ERROR],discountedPlanPrices:i})))})(e,t,r).then((t=>as(e,t,r))):t};function cs(e,t,r){const n=e.slice();return n[36]=t[r],n}function ls(e,t,r){const n=e.slice();return n[39]=t[r],n}function us(e,t,r){const n=e.slice();return n[42]=t[r],n}function ds(e){let t,r,n,o,i,a,s,c=e[42].label+””,l=e[42].priceFormattedString+””;return{c(){t=P(“div”),r=P(“span”),n=A(c),o=S(),i=P(“div”),a=P(“span”),s=A(l),_(r,”class”,”zephr-form-summary-charge-description zephr-payment-form-summary-charge-description svelte-3s0tux”),_(i,”class”,”zephr-form-summary-line-right zephr-payment-form-summary-line-right svelte-3s0tux”),_(t,”class”,”zephr-form-charge-line zephr-payment-form-charge-line svelte-3s0tux”)},m(e,c){y(e,t,c),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a),h(a,s)},p(e,t){524288&t[0]&&c!==(c=e[42].label+””)&&w(n,c),524288&t[0]&&l!==(l=e[42].priceFormattedString+””)&&w(s,l)},d(e){e&&g(t)}}}function ps(e){let t,r=ne(e[23]),n=[];for(let t=0;t<r.length;t+=1)n[t]=ms(ls(e,r,t));return{c(){for(let e=0;e<n.length;e+=1)n[e].c();t=C()},m(e,r){for(let t=0;t<n.length;t+=1)n[t]&&n[t].m(e,r);y(e,t,r)},p(e,o){if(8388608&o[0]){let i;for(r=ne(e[23]),i=0;i{b[i]=null})),ee()),~n?(o=b[n],o?o.p(e,t):(o=b[n]=m[n](e),o.c()),te(o,1),o.m(r,null)):o=null);let u=s;s=T(e),s===u?~s&&v[s].p(e,t):(c&&(X(),re(v[u],1,1,(()=>{v[u]=null})),ee()),~s?(c=v[s],c?c.p(e,t):(c=v[s]=A[s](e),c.c()),te(c,1),c.m(a,null)):c=null),(!p||4096&t[0]&&l!==(l=f(e[12]?”zephr-form-summary-line-right zephr-payment-form-summary-line-right”:”zephr-form-summary-line-left zephr-payment-form-summary-line-left”)+” svelte-3s0tux”))&&_(a,”class”,l),e[14]?O?(O.p(e,t),16384&t[0]&&te(O,1)):(O=Os(e),O.c(),te(O,1),O.m(d.parentNode,d)):O&&(X(),re(O,1,1,(()=>{O=null})),ee())},i(e){p||(te(o),te(c),te(O),p=!0)},o(e){re(o),re(c),re(O),p=!1},d(e){e&&(g(t),g(u),g(d)),~n&&b[n].d(),~s&&v[s].d(),O&&O.d(e)}}}function Ps(e){let t,r,n;return r=new Ro({props:{id:”zephr-form-promo-code”,value:e[11],placeholder:e[5],maxlength:50,hasError:null!=e[14],fill:!0,isPaymentForm:!0,onFocus:e[27],onBlur:e[28],$$slots:{default:[Cs]},$$scope:{ctx:e}}}),r.$on(“change”,e[35]),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”class”,”zephr-form-relative-container zephr-form-promo-input zephr-form-relative-container zephr-payment-form-promo-input”)},m(e,o){y(e,t,o),se(r,t,null),n=!0},p(e,t){const n={};2048&t[0]&&(n.value=e[11]),32&t[0]&&(n.placeholder=e[5]),16384&t[0]&&(n.hasError=null!=e[14]),134217728&t[0]&&(n.onFocus=e[27]),268435456&t[0]&&(n.onBlur=e[28]),53248&t[0]|16384&t[1]&&(n.$$scope={dirty:t,ctx:e}),r.$set(n)},i(e){n||(te(r.$$.fragment,e),n=!0)},o(e){re(r.$$.fragment,e),n=!1},d(e){e&&g(t),ce(r)}}}function Es(t){let r,n;return{c(){r=P(“span”),n=A(t[11]),_(r,”class”,”zephr-form-summary-promo-middle zephr-payment-form-summary-promo-middle svelte-3s0tux”)},m(e,t){y(e,r,t),h(r,n)},p(e,t){2048&t[0]&&w(n,e[11])},i:e,o:e,d(e){e&&g(r)}}}function As(e){let t,r;return t=new er({props:{icon:Ht,spin:!0}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Ss(e){let t,r;return t=new er({props:{icon:Kt}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Cs(e){let t,r,n,o;const i=[Ss,As],a=[];function s(e,t){return e[12]?0:e[15]&&!e[14]?1:-1}return~(r=s(e))&&(n=a[r]=i[r](e)),{c(){t=P(“div”),n&&n.c(),_(t,”class”,”zephr-form-input-inner-text zephr-payment-form-input-inner-text zephr-form-input-inner-button”)},m(e,n){y(e,t,n),~r&&a[r].m(t,null),o=!0},p(e,o){let c=r;r=s(e),r!==c&&(n&&(X(),re(a[c],1,1,(()=>{a[c]=null})),ee()),~r?(n=a[r],n||(n=a[r]=i[r](e),n.c()),te(n,1),n.m(t,null)):n=null)},i(e){o||(te(n),o=!0)},o(e){re(n),o=!1},d(e){e&&g(t),~r&&a[r].d()}}}function vs(e){let t,r;return t=new mo({props:{disabled:e[16],text:e[6],onClick:e[26],noMargin:!0,inputHeight:!0,isPaymentForm:!0}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};65536&r[0]&&(n.disabled=e[16]),64&r[0]&&(n.text=e[6]),67108864&r[0]&&(n.onClick=e[26]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Ts(t){let r,n=t[0]&&_s(t);return{c(){r=P(“span”),n&&n.c(),_(r,”class”,”zephr-form-summary-promo-middle zephr-payment-form-summary-promo-middle svelte-3s0tux”)},m(e,t){y(e,r,t),n&&n.m(r,null)},p(e,t){e[0]?n?n.p(e,t):(n=_s(e),n.c(),n.m(r,null)):n&&(n.d(1),n=null)},i:e,o:e,d(e){e&&g(r),n&&n.d()}}}function _s(e){let t,r;return{c(){t=A(“- “),r=A(e[13])},m(e,n){y(e,t,n),y(e,r,n)},p(e,t){8192&t[0]&&w(r,e[13])},d(e){e&&(g(t),g(r))}}}function Os(e){let t,r;return t=new zt({props:{error:e[14],isPaymentForm:!0}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};16384&r[0]&&(n.error=e[14]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Is(e){let t,r;return{c(){t=P(“div”),r=A(e[10]),_(t,”class”,”zephr-form-summary-prorate-disclaimer zephr-payment-form-summary-prorate-disclaimer svelte-3s0tux”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){1024&t[0]&&w(r,e[10])},d(e){e&&g(t)}}}function ws(e){let t,r,n,o,i,a,s=(e[9]??”DUE TODAY”)+””,c=e[20].totalPriceFormattedString+””;return{c(){t=P(“div”),r=P(“div”),n=A(s),o=S(),i=P(“div”),a=A(c),_(r,”class”,”zephr-form-summary-line-total-title zephr-payment-form-summary-line-total-title”),_(i,”class”,”zephr-form-summary-line-price zephr-payment-form-summary-line-price svelte-3s0tux”),_(t,”class”,”zephr-form-summary-line zephr-form-summary-price-line zephr-payment-form-summary-line zephr-payment-form-summary-price-line svelte-3s0tux”)},m(e,s){y(e,t,s),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a)},p(e,t){512&t[0]&&s!==(s=(e[9]??”DUE TODAY”)+””)&&w(n,s),1048576&t[0]&&c!==(c=e[20].totalPriceFormattedString+””)&&w(a,c)},d(e){e&&g(t)}}}function Rs(e){let t,r,n,o,i,a,s,c,l,u,d,p,m,f,E,C,v,T,O,I,R,M,N,$,L,x=ne(e[19]),F=[];for(let t=0;t0&&ps(e),k=e[21]&&fs(e),D=ne(e[18]),B=[];for(let t=0;t<D.length;t+=1)B[t]=hs(cs(e,D,t));let U=e[3]&&ys(e),G=e[10]&&Is(e),V=e[20]&&ws(e);return{c(){t=P("div"),r=P("div"),n=A(e[7]),o=S(),i=P("div"),a=P("div"),s=A(e[1]),c=S(),l=P("div"),u=A(e[30]),d=S();for(let e=0;e<F.length;e+=1)F[e].c();p=S(),z&&z.c(),m=S(),k&&k.c(),f=S();for(let e=0;e<B.length;e+=1)B[e].c();E=S(),U&&U.c(),C=S(),v=P("div"),T=P("div"),O=A(e[8]),I=S(),R=P("div"),M=A(e[2]),N=S(),G&&G.c(),$=S(),V&&V.c(),_(r,"class","zephr-form-summary-title zephr-payment-form-summary-title svelte-3s0tux"),_(a,"class","zephr-form-summary-line-title zephr-payment-form-summary-line-title svelte-3s0tux"),_(l,"class","zephr-form-summary-line-price zephr-payment-form-summary-line-price svelte-3s0tux"),_(i,"class","zephr-form-summary-line zephr-payment-form-summary-line svelte-3s0tux"),_(T,"class","zephr-form-summary-line-total-title zephr-payment-form-summary-line-total-title"),_(R,"class","zephr-form-summary-line-price zephr-payment-form-summary-line-price svelte-3s0tux"),_(v,"class","zephr-form-summary-line zephr-form-summary-price-line zephr-form-summary-price-line-upper zephr-payment-form-summary-line zephr-payment-form-summary-price-line zephr-payment-form-summary-price-line-upper svelte-3s0tux"),_(t,"class","zephr-form-summary zephr-payment-form-summary svelte-3s0tux")},m(e,g){y(e,t,g),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a),h(a,s),h(i,c),h(i,l),h(l,u),h(t,d);for(let e=0;e<F.length;e+=1)F[e]&&F[e].m(t,null);h(t,p),z&&z.m(t,null),h(t,m),k&&k.m(t,null),h(t,f);for(let e=0;e<B.length;e+=1)B[e]&&B[e].m(t,null);h(t,E),U&&U.m(t,null),h(t,C),h(t,v),h(v,T),h(T,O),h(v,I),h(v,R),h(R,M),h(t,N),G&&G.m(t,null),h(t,$),V&&V.m(t,null),L=!0},p(e,r){if((!L||128&r[0])&&w(n,e[7]),(!L||2&r[0])&&w(s,e[1]),(!L||1073741824&r[0])&&w(u,e[30]),524288&r[0]){let n;for(x=ne(e[19]),n=0;n<x.length;n+=1){const o=us(e,x,n);F[n]?F[n].p(o,r):(F[n]=ds(o),F[n].c(),F[n].m(t,p))}for(;n0?z?z.p(e,r):(z=ps(e),z.c(),z.m(t,m)):z&&(z.d(1),z=null),e[21]?k?k.p(e,r):(k=fs(e),k.c(),k.m(t,f)):k&&(k.d(1),k=null),262144&r[0]){let n;for(D=ne(e[18]),n=0;n<D.length;n+=1){const o=cs(e,D,n);B[n]?B[n].p(o,r):(B[n]=hs(o),B[n].c(),B[n].m(t,E))}for(;n{U=null})),ee()),(!L||256&r[0])&&w(O,e[8]),(!L||4&r[0])&&w(M,e[2]),e[10]?G?G.p(e,r):(G=Is(e),G.c(),G.m(t,$)):G&&(G.d(1),G=null),e[20]?V?V.p(e,r):(V=ws(e),V.c(),V.m(t,null)):V&&(V.d(1),V=null)},i(e){L||(te(U),L=!0)},o(e){re(U),L=!1},d(e){e&&g(t),b(F,e),z&&z.d(),k&&k.d(),b(B,e),U&&U.d(),G&&G.d(),V&&V.d()}}}function Ms(e,t,r){let n,{showPromoCodeDiscountAmount:o=!0}=t,{planTitle:i}=t,{price:a}=t,{totalPrice:s}=t,{allowPromoCodes:c}=t,{promoCodeLinkText:l}=t,{promoCodePlaceholder:u}=t,{promoCodeButtonText:d}=t,{title:p}=t,{totalLabel:m}=t,{prorateLabel:f}=t,{prorateDisclaimer:h}=t,{promoCode:y}=t,{promoCodeValid:g}=t,{discountAmount:b}=t,{error:P=null}=t,{busy:E}=t,{promoCodeDisabled:A}=t,{paymentProcessed:S}=t,{addons:C}=t,{chargeItems:v}=t,{changeSubscriptionProrate:T}=t,{tax:_}=t,{taxLabel:O}=t,{subTotal:I}=t,{discounts:w=[]}=t,{paymentProvider:R=””}=t,{onChangePromoCode:M}=t,{verifyPromoCode:N}=t,{onFocus:$}=t,{onBlur:L}=t,{logBeginCheckout:x}=t,F=!1;x();return e.$$set=e=>{“showPromoCodeDiscountAmount”in e&&r(0,o=e.showPromoCodeDiscountAmount),”planTitle”in e&&r(1,i=e.planTitle),”price”in e&&r(31,a=e.price),”totalPrice”in e&&r(2,s=e.totalPrice),”allowPromoCodes”in e&&r(3,c=e.allowPromoCodes),”promoCodeLinkText”in e&&r(4,l=e.promoCodeLinkText),”promoCodePlaceholder”in e&&r(5,u=e.promoCodePlaceholder),”promoCodeButtonText”in e&&r(6,d=e.promoCodeButtonText),”title”in e&&r(7,p=e.title),”totalLabel”in e&&r(8,m=e.totalLabel),”prorateLabel”in e&&r(9,f=e.prorateLabel),”prorateDisclaimer”in e&&r(10,h=e.prorateDisclaimer),”promoCode”in e&&r(11,y=e.promoCode),”promoCodeValid”in e&&r(12,g=e.promoCodeValid),”discountAmount”in e&&r(13,b=e.discountAmount),”error”in e&&r(14,P=e.error),”busy”in e&&r(15,E=e.busy),”promoCodeDisabled”in e&&r(16,A=e.promoCodeDisabled),”paymentProcessed”in e&&r(17,S=e.paymentProcessed),”addons”in e&&r(18,C=e.addons),”chargeItems”in e&&r(19,v=e.chargeItems),”changeSubscriptionProrate”in e&&r(20,T=e.changeSubscriptionProrate),”tax”in e&&r(21,_=e.tax),”taxLabel”in e&&r(22,O=e.taxLabel),”subTotal”in e&&r(32,I=e.subTotal),”discounts”in e&&r(23,w=e.discounts),”paymentProvider”in e&&r(24,R=e.paymentProvider),”onChangePromoCode”in e&&r(25,M=e.onChangePromoCode),”verifyPromoCode”in e&&r(26,N=e.verifyPromoCode),”onFocus”in e&&r(27,$=e.onFocus),”onBlur”in e&&r(28,L=e.onBlur),”logBeginCheckout”in e&&r(33,x=e.logBeginCheckout)},e.$$.update=()=>{524288&e.$$.dirty[0]|3&e.$$.dirty[1]&&r(30,n=v.length?””:I||a)},[o,i,s,c,l,u,d,p,m,f,h,y,g,b,P,E,A,S,C,v,T,_,O,w,R,M,N,$,L,F,n,a,I,x,()=>r(29,F=!0),({detail:e})=>M(e)]}class Ns extends de{constructor(e){super(),ue(this,e,Ms,Rs,a,{showPromoCodeDiscountAmount:0,planTitle:1,price:31,totalPrice:2,allowPromoCodes:3,promoCodeLinkText:4,promoCodePlaceholder:5,promoCodeButtonText:6,title:7,totalLabel:8,prorateLabel:9,prorateDisclaimer:10,promoCode:11,promoCodeValid:12,discountAmount:13,error:14,busy:15,promoCodeDisabled:16,paymentProcessed:17,addons:18,chargeItems:19,changeSubscriptionProrate:20,tax:21,taxLabel:22,subTotal:32,discounts:23,paymentProvider:24,onChangePromoCode:25,verifyPromoCode:26,onFocus:27,onBlur:28,logBeginCheckout:33},null,[-1,-1])}}const $s={matches:e=>e.type===Me,create:(e,t,r,n)=>{const o=so(e.organisationConfiguration.paymentProvider);return{component:Ns,props:{showPromoCodeDiscountAmount:!Nt(e).dynamicOffer,price:t.paymentOptionPrices?.netPriceFormattedString??”-“,totalPrice:t.paymentOptionPrices?.totalPriceFormattedString??”-“,tax:t.paymentOptionPrices?.taxPriceFormattedString,taxLabel:n.taxLabel??”Tax”,subTotal:t.paymentOptionPrices?.netPriceFormattedString,planTitle:t.paymentOption.label,paymentProvider:e.organisationConfiguration.paymentProvider,discounts:”braintree”===e.organisationConfiguration.paymentProvider?(Nt(e).paymentOptions.find((e=>e.productId===t.paymentOption.productId&&e.slug===t.paymentOption.slug))?.discounts||[]).map((e=>({description:e.description||e.name,formattedAmount:`- ${fn(e.amount||0,t.paymentOption.currencyCode)}`}))):[],allowPromoCodes:(Nt(e).promoCodeConfig?.promoCodeAllowed||Nt(e).dynamicOffer)&&o.hasPromoCodes(e),promoCodeLinkText:Nt(e).promoCodeConfig?.promoCodeText,promoCodePlaceholder:Nt(e).promoCodeConfig?.promoCodePlaceholder,promoCodeButtonText:Nt(e).promoCodeConfig?.promoCodeButtonText,totalLabel:n.total,prorateLabel:n.prorateLabel,prorateDisclaimer:!Nt(e).changeSubscriptionMode||o.changeSubscriptionProrateCalculator?null:n.prorateDisclaimer,title:n.title,promoCode:t.promoCode,busy:t.isBusyByKey[is],promoCodeDisabled:t.isBusy||0===t.promoCode?.length,paymentProcessed:t.paymentProcessed,discountAmount:t.paymentOptionPrices?.discountPriceFormattedPrice??”-“,addons:gn(t).map((e=>({label:e.label,addonPrice:fn(e.addonPrice,t.paymentOption.currencyCode)}))),chargeItems:t.paymentOptionPrices?.chargeItems??[],promoCodeValid:t.promoCodeValid,changeSubscriptionProrate:t.changeSubscriptionProrate,onChangePromoCode:n=>{let o=r.updateFormState({promoCode:n,promoCodeValid:void 0,discountedPlanPrices:[]});t.promoCodeValid&&(t.originalDynamicOfferResult&&(o=r.updateFormState({dynamicOfferResult:t.originalDynamicOfferResult})),as(e,o,r)),dt(e,”zephr_form_input_change”,{inputName:”zephr-form-promo-code”,sectionId:t.currentSection.type,field:”promo-code”})},onFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:”zephr-form-promo-code”,sectionId:t.currentSection.type,field:”promo-code”}),onBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:”zephr-form-promo-code”,sectionId:t.currentSection.type,field:”promo-code”}),verifyPromoCode:()=>{ss(e,t,r)},logBeginCheckout:async()=>{t.currentPart.type===ot.PAYMENT.type&&(e.organisationConfiguration.trackFormDataLayerEvents&&await lo(e,t,r),dt(e,”begin_checkout”,{ecommerce:{currency:Pn(e,t),value:r.getFormState().paymentOptionPrices?.totalPrice,items:[{item_id:t.paymentOption.slug,item_name:t.paymentOption.productId,price:r.getFormState().paymentOptionPrices?.totalPrice,quantity:1}]}}))}}}}};function Ls(e){let t,r,n,o=e[1]&&xs(e),i=e[0]&&ks(e),a=e[1]&&e[0]&&Ds(e);return{c(){t=P(“div”),o&&o.c(),r=S(),i&&i.c(),n=S(),a&&a.c(),_(t,”class”,”zephr-form-divider-container svelte-svq2r5″),$(t,”zephr-payment-form-divider-container”,e[3])},m(e,s){y(e,t,s),o&&o.m(t,null),h(t,r),i&&i.m(t,null),h(t,n),a&&a.m(t,null)},p(e,s){e[1]?o?o.p(e,s):(o=xs(e),o.c(),o.m(t,r)):o&&(o.d(1),o=null),e[0]?i?i.p(e,s):(i=ks(e),i.c(),i.m(t,n)):i&&(i.d(1),i=null),e[1]&&e[0]?a?a.p(e,s):(a=Ds(e),a.c(),a.m(t,null)):a&&(a.d(1),a=null),8&s&&$(t,”zephr-payment-form-divider-container”,e[3])},d(e){e&&g(t),o&&o.d(),i&&i.d(),a&&a.d()}}}function xs(e){let t;function r(e,t){return e[0]?zs:Fs}let n=r(e),o=n(e);return{c(){o.c(),t=C()},m(e,r){o.m(e,r),y(e,t,r)},p(e,i){n===(n=r(e))&&o?o.p(e,i):(o.d(1),o=n(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){e&&g(t),o.d(e)}}}function Fs(t){let r;return{c(){r=P(“div”),_(r,”class”,”zephr-form-divider-line-complete svelte-svq2r5″)},m(e,t){y(e,r,t)},p:e,d(e){e&&g(r)}}}function zs(e){let t;return{c(){t=P(“div”),_(t,”class”,”zephr-form-divider-line svelte-svq2r5″),$(t,”zephr-payment-form-divider-line”,e[3])},m(e,r){y(e,t,r)},p(e,r){8&r&&$(t,”zephr-payment-form-divider-line”,e[3])},d(e){e&&g(t)}}}function ks(e){let t,r;return{c(){t=P(“span”),r=A(e[0]),_(t,”class”,”zephr-form-divider-text svelte-svq2r5″),$(t,”zephr-payment-form-divider-text”,e[3])},m(e,n){y(e,t,n),h(t,r)},p(e,n){1&n&&w(r,e[0]),8&n&&$(t,”zephr-payment-form-divider-text”,e[3])},d(e){e&&g(t)}}}function Ds(e){let t;return{c(){t=P(“div”),_(t,”class”,”zephr-form-divider-line svelte-svq2r5″),$(t,”zephr-payment-form-divider-line”,e[3])},m(e,r){y(e,t,r)},p(e,r){8&r&&$(t,”zephr-payment-form-divider-line”,e[3])},d(e){e&&g(t)}}}function Bs(t){let r,n=t[2]&&Ls(t);return{c(){n&&n.c(),r=C()},m(e,t){n&&n.m(e,t),y(e,r,t)},p(e,[t]){e[2]?n?n.p(e,t):(n=Ls(e),n.c(),n.m(r.parentNode,r)):n&&(n.d(1),n=null)},i:e,o:e,d(e){e&&g(r),n&&n.d(e)}}}function Us(e,t,r){let{text:n}=t,{showLine:o}=t,{show:i}=t,{isPaymentForm:a=!1}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”showLine”in e&&r(1,o=e.showLine),”show”in e&&r(2,i=e.show),”isPaymentForm”in e&&r(3,a=e.isPaymentForm)},[n,o,i,a]}class Gs extends de{constructor(e){super(),ue(this,e,Us,Bs,a,{text:0,showLine:1,show:2,isPaymentForm:3})}}const Vs={matches:e=>e.type===Ne,create:(e,t,r,n)=>({component:Gs,props:{text:n.text,showLine:n.showLine,show:n.show,isPaymentForm:e.formType===wt.PAYMENT}})};function qs(t){let r,n,o,i,a;return{c(){r=P(“div”),n=A(t[0]),o=S(),i=P(“a”),a=A(t[1]),_(i,”href”,t[2]),_(i,”class”,”svelte-1bpa3mq”),_(r,”class”,”zephr-form-login-link svelte-1bpa3mq”),$(r,”zephr-payment-login-link”,t[3])},m(e,t){y(e,r,t),h(r,n),h(r,o),h(r,i),h(i,a)},p(e,[t]){1&t&&w(n,e[0]),2&t&&w(a,e[1]),4&t&&_(i,”href”,e[2]),8&t&&$(r,”zephr-payment-login-link”,e[3])},i:e,o:e,d(e){e&&g(r)}}}function js(e,t,r){let{text:n}=t,{linkText:o}=t,{url:i}=t,{isPaymentForm:a=!1}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”linkText”in e&&r(1,o=e.linkText),”url”in e&&r(2,i=e.url),”isPaymentForm”in e&&r(3,a=e.isPaymentForm)},[n,o,i,a]}class Hs extends de{constructor(e){super(),ue(this,e,js,qs,a,{text:0,linkText:1,url:2,isPaymentForm:3})}}const Ks={matches:e=>e.type===$e,create:(e,t,r,n)=>({component:Hs,props:{text:n.alreadyRegText,linkText:n.loginText,url:n.url,isPaymentForm:e.formType===wt.PAYMENT}})},Ys={matches:e=>e.type===Ae&&e.config.isLogin,create:(e,t,r,n)=>({component:mo,props:{disabled:t.isBusy,text:n.text,onClick:()=>{dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),r.updateFormState({forgotPassword:!1}),r.jumpToPartStart(ot.ACCOUNT_VERIFICATION.type)},isPaymentForm:e.formType===wt.PAYMENT}})},Ws={matches:e=>e.type===Ae&&e.config.isCancel,create:(e,t,r,n)=>({component:mo,props:{text:n.text,onClick:()=>{dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),r.updateFormState({confirmCancel:!0}),r.completeSection()}}})};function Js(e){let t,r;return t=new _a({props:{text:e[0]}}),t.$on(“linkClick”,e[10]),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};1&r&&(n.text=e[0]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Qs(e){let t,r,n,o;return t=new Lo({props:{forInput:e[8],label:e[0]}}),n=new Ro({props:{id:e[8],value:e[2],errorMessage:e[3],placeholder:e[1],onFocus:e[5],onBlur:e[6]}}),n.$on(“change”,e[11]),{c(){ae(t.$$.fragment),r=S(),ae(n.$$.fragment)},m(e,i){se(t,e,i),y(e,r,i),se(n,e,i),o=!0},p(e,r){const o={};1&r&&(o.label=e[0]),t.$set(o);const i={};4&r&&(i.value=e[2]),8&r&&(i.errorMessage=e[3]),2&r&&(i.placeholder=e[1]),32&r&&(i.onFocus=e[5]),64&r&&(i.onBlur=e[6]),n.$set(i)},i(e){o||(te(t.$$.fragment,e),te(n.$$.fragment,e),o=!0)},o(e){re(t.$$.fragment,e),re(n.$$.fragment,e),o=!1},d(e){e&&g(r),ce(t,e),ce(n,e)}}}function Zs(e){let t,r,n,o=!e[7]&&Js(e),i=(e[2]||e[7])&&Qs(e);return{c(){t=P(“div”),o&&o.c(),r=S(),i&&i.c(),_(t,”class”,”zephr-form-account-code-container svelte-ctt9he”)},m(e,a){y(e,t,a),o&&o.m(t,null),h(t,r),i&&i.m(t,null),n=!0},p(e,[n]){e[7]?o&&(X(),re(o,1,1,(()=>{o=null})),ee()):o?(o.p(e,n),128&n&&te(o,1)):(o=Js(e),o.c(),te(o,1),o.m(t,r)),e[2]||e[7]?i?(i.p(e,n),132&n&&te(i,1)):(i=Qs(e),i.c(),te(i,1),i.m(t,null)):i&&(X(),re(i,1,1,(()=>{i=null})),ee())},i(e){n||(te(o),te(i),n=!0)},o(e){re(o),re(i),n=!1},d(e){e&&g(t),o&&o.d(),i&&i.d()}}}function Xs(e,t,r){let{formKey:n}=t,{label:o}=t,{placeholder:i}=t,{accountMembershipCode:a}=t,{error:s=null}=t,{onChange:c}=t,{onFocus:l}=t,{onBlur:u}=t,d=!1;const p=`zephr-form-account-code-${n}`;return e.$$set=e=>{“formKey”in e&&r(9,n=e.formKey),”label”in e&&r(0,o=e.label),”placeholder”in e&&r(1,i=e.placeholder),”accountMembershipCode”in e&&r(2,a=e.accountMembershipCode),”error”in e&&r(3,s=e.error),”onChange”in e&&r(4,c=e.onChange),”onFocus”in e&&r(5,l=e.onFocus),”onBlur”in e&&r(6,u=e.onBlur)},[o,i,a,s,c,l,u,d,p,n,()=>r(7,d=!0),e=>c(e.detail)]}class ec extends de{constructor(e){super(),ue(this,e,Xs,Zs,a,{formKey:9,label:0,placeholder:1,accountMembershipCode:2,error:3,onChange:4,onFocus:5,onBlur:6})}}const tc={matches:e=>e.type===Le,create:(e,t,r,n)=>({component:ec,props:{formKey:e.uniqueKey,label:n.label,placeholder:n.placeholder,accountMembershipCode:t.accountMembershipCode,onChange:n=>{r.updateFormState({accountMembershipCode:n,serverErrors:[]}),dt(e,”zephr_form_input_change”,{inputName:`zephr-form-account-code-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”account-code”})},onFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:`zephr-form-account-code-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”account-code”}),onBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:`zephr-form-account-code-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”account-code”})}})};function rc(e){let t,r,n;return r=new _i({props:{text:e[4]}}),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”class”,”zephr-form-invitation-success-message svelte-yy7ok3″)},m(e,o){y(e,t,o),se(r,t,null),n=!0},p(e,t){const n={};16&t&&(n.text=e[4]),r.$set(n)},i(e){n||(te(r.$$.fragment,e),n=!0)},o(e){re(r.$$.fragment,e),n=!1},d(e){e&&g(t),ce(r)}}}function nc(e){let t,r,n,o,i,a,s,c,l,u,d,p,m,f,b,E;c=new Lo({props:{forInput:e[14],label:e[2],isPaymentForm:e[11]}}),p=new Ro({props:{disabled:e[10],required:!0,id:e[14],value:e[7]??””,errorMessage:e[9],isPaymentForm:e[11],onFocus:e[12],onBlur:e[13]}}),p.$on(“change”,e[16]),f=new mo({props:{disabled:!mi(e[7])||e[10],text:e[3],onClick:e[5],noMargin:!0,inputHeight:!0,aside:!0,isPaymentForm:e[11]}});let C=e[8]&&rc(e);return{c(){t=P(“div”),r=P(“div”),n=A(e[0]),o=S(),i=P(“div”),a=A(e[1]),s=S(),ae(c.$$.fragment),l=S(),u=P(“div”),d=P(“div”),ae(p.$$.fragment),m=S(),ae(f.$$.fragment),b=S(),C&&C.c(),_(r,”class”,”zephr-form-invitation-title svelte-yy7ok3″),_(i,”class”,”zephr-form-invitation-description”),_(d,”class”,”zephr-form-invitation-input-container svelte-yy7ok3″),_(u,”class”,”zephr-form-relative-container zephr-form-invitation-email svelte-yy7ok3″),$(u,”zephr-payment-form-relative-container”,e[11]),_(t,”class”,”zephr-form-invitation-container svelte-yy7ok3″)},m(e,g){y(e,t,g),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a),h(t,s),se(c,t,null),h(t,l),h(t,u),h(u,d),se(p,d,null),h(u,m),se(f,u,null),h(t,b),C&&C.m(t,null),E=!0},p(e,[r]){(!E||1&r)&&w(n,e[0]),(!E||2&r)&&w(a,e[1]);const o={};4&r&&(o.label=e[2]),2048&r&&(o.isPaymentForm=e[11]),c.$set(o);const i={};1024&r&&(i.disabled=e[10]),128&r&&(i.value=e[7]??””),512&r&&(i.errorMessage=e[9]),2048&r&&(i.isPaymentForm=e[11]),4096&r&&(i.onFocus=e[12]),8192&r&&(i.onBlur=e[13]),p.$set(i);const s={};1152&r&&(s.disabled=!mi(e[7])||e[10]),8&r&&(s.text=e[3]),32&r&&(s.onClick=e[5]),2048&r&&(s.isPaymentForm=e[11]),f.$set(s),(!E||2048&r)&&$(u,”zephr-payment-form-relative-container”,e[11]),e[8]?C?(C.p(e,r),256&r&&te(C,1)):(C=rc(e),C.c(),te(C,1),C.m(t,null)):C&&(X(),re(C,1,1,(()=>{C=null})),ee())},i(e){E||(te(c.$$.fragment,e),te(p.$$.fragment,e),te(f.$$.fragment,e),te(C),E=!0)},o(e){re(c.$$.fragment,e),re(p.$$.fragment,e),re(f.$$.fragment,e),re(C),E=!1},d(e){e&&g(t),ce(c),ce(p),ce(f),C&&C.d()}}}function oc(e,t,r){let{formKey:n}=t,{title:o}=t,{description:i}=t,{label:a}=t,{btnText:s}=t,{linkSentText:c}=t,{onSendInviteClick:l}=t,{onChange:u}=t,{invitationEmail:d}=t,{invitationSent:p}=t,{error:m=null}=t,{isBusy:f}=t,{isPaymentForm:h=!1}=t,{onFocus:y}=t,{onBlur:g}=t;const b=`zephr-form-invitation-email-${n}`;return e.$$set=e=>{“formKey”in e&&r(15,n=e.formKey),”title”in e&&r(0,o=e.title),”description”in e&&r(1,i=e.description),”label”in e&&r(2,a=e.label),”btnText”in e&&r(3,s=e.btnText),”linkSentText”in e&&r(4,c=e.linkSentText),”onSendInviteClick”in e&&r(5,l=e.onSendInviteClick),”onChange”in e&&r(6,u=e.onChange),”invitationEmail”in e&&r(7,d=e.invitationEmail),”invitationSent”in e&&r(8,p=e.invitationSent),”error”in e&&r(9,m=e.error),”isBusy”in e&&r(10,f=e.isBusy),”isPaymentForm”in e&&r(11,h=e.isPaymentForm),”onFocus”in e&&r(12,y=e.onFocus),”onBlur”in e&&r(13,g=e.onBlur)},[o,i,a,s,c,l,u,d,p,m,f,h,y,g,b,n,({detail:e})=>u(e)]}class ic extends de{constructor(e){super(),ue(this,e,oc,nc,a,{formKey:15,title:0,description:1,label:2,btnText:3,linkSentText:4,onSendInviteClick:5,onChange:6,invitationEmail:7,invitationSent:8,error:9,isBusy:10,isPaymentForm:11,onFocus:12,onBlur:13})}}const ac=async(e,t,r)=>{let n;n=t.userExists?await(e=>fr(“blaize/profile”,{method:”GET”},e).then((e=>e.json())))(r):t.userAttributes;const o=((e,t)=>(e??[]).reduce(((e,r)=>{const n=t[r.attrSlug];return{…e,[r.fieldName]:n}}),{}))(Nt(e).invitationMetadata.mapping,n),i=await fr(“zephr/public/products/v1/shares/invitations/emails”,{method:”POST”,bodyObject:{product_id:t.paymentOption.productId,email_address:t.invitationEmail,base_url:Nt(e).invitationMetadata.url,meta_data:o}},r),a=await i.json();if(i.ok)r.updateFormState({invitationSent:!0,invitationEmail:””}),setTimeout((()=>{r.updateFormState({invitationSent:!1})}),3e3);else{const t=(s=a,403===s?.status&&s?.message?.includes(“you do not have access to”)?at.INVITATION_FAILED_NO_PRODUCT_ACCESS:400===s?.status&&s?.message?.includes(“Invalid recipient email”)?at.INVITATION_FAILED_INVALID_EMAIL:400===s?.status&&s?.message?.includes(“reached the configured limit”)?at.INVITATION_FAILED_LIMIT_REACHED:409===s?.status?at.INVITATION_FAILED_DUPLICATE_EMAIL:at.INVITATION_FAILED_UNKNOWN);dt(e,”zephr_form_error”,{error:at[t]}),r.updateFormState({invitationSent:!1,serverErrors:[t]})}var s},sc={matches:e=>e.type===Fe,create:(e,t,r,n)=>t.paymentOption?.product_sharing_limit>0?{component:ic,props:{formKey:e.uniqueKey,title:n.title,description:n.description,label:n.label,btnText:n.btnText,linkSentText:n.linkSentText,onSendInviteClick:()=>{dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),ac(e,t,r)},onChange:n=>{r.updateFormState({invitationEmail:n,serverErrors:[]}),dt(e,”zephr_form_input_change”,{inputName:`zephr-form-invitation-email-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”invitation-email”})},onFocus:()=>dt(e,”zephr_form_input_focus”,{inputName:`zephr-form-invitation-email-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”invitation-email”}),onBlur:()=>dt(e,”zephr_form_input_blur”,{inputName:`zephr-form-invitation-email-${e.uniqueKey}`,sectionId:t.currentSection.type,field:”invitation-email”}),invitationEmail:t.invitationEmail,invitationSent:t.invitationSent,isBusy:t.isBusy,isPaymentForm:e.formType===wt.PAYMENT}}:{component:null,props:{}}};class cc extends de{constructor(e){super(),ue(this,e,null,null,a,{})}}const lc={matches:e=>e.type===Ce,create:(e,t,r)=>{const n=so(e.organisationConfiguration.paymentProvider);if(null==n.preLoaderComponent)return{component:cc,props:{}};return{component:n.preLoaderComponent(Nt(e).paymentProviderFormConfig),props:{onMountCallback:()=>n.preLoader()}}}};function uc(t){let r;return{c(){r=P(“div”)},m(e,n){y(e,r,n),r.innerHTML=t[0]},p(e,[t]){1&t&&(r.innerHTML=e[0])},i:e,o:e,d(e){e&&g(r)}}}function dc(e,t,r){let{html:n}=t;return e.$$set=e=>{“html”in e&&r(0,n=e.html)},[n]}class pc extends de{constructor(e){super(),ue(this,e,dc,uc,a,{html:0})}}const mc=()=>(Math.random()+1).toString(36).substring(7),fc=mc(),hc=e=>e.dynamicOfferResult?Object.entries({tagline:e.dynamicOfferResult.tagline,…e.dynamicOfferResult.custom??{}}).reduce(((e,[t,r])=>(t&&null!=r&&(e[t]=r),e)),{}):{},yc=(e,t)=>(e.templateVariables??[]).reduce(((e,r)=>null==r.defaultValue||r.paymentOptionLevel!=t?e:{…e,[r.key]:r.defaultValue}),{}),gc=e=>{window.Zephr||(window.Zephr={}),window.Zephr.forms||(window.Zephr.forms={}),window.Zephr.forms[e.formInstanceId]=e},bc=(e,t,r,n,o,i)=>{if(!o)return{scope:{},actions:{}};try{const a=new Function(“state”,”form”,”scope”,o),s=(t.customComponentState??{})[r.id??”_”];return a(t.dynamicOfferResult?{…s??{},dynamicOfferResult:_n(t.dynamicOfferResult,e,t)}:s,n,i)}catch(e){return console.error(“Error evaluating pre-render script”,e),{scope:{error:e},actions:{}}}},Pc=(e,t,r)=>n=>{t.updateFormState({customComponentState:{…e.customComponentState??{},[r]:{…(e.customComponentState??{})[r]??{},…n??{}}}})},Ec=(e,t,r,n)=>async(o,i)=>{let a;if(n){const e=r.dynamicOfferResult.products.find((e=>e.id===o)),t=e?.paymentPlans.find((e=>e.planId===i));a={slug:t.planId,productId:e.id,label:e.label,currencyCode:t.charges[0].prices[0].currency}}else a=Nt(e).paymentOptions?.find((e=>e.productId===o&&e.slug===i));if(a){if(t.updateFormState({paymentOption:a,serverErrors:[],billingAddress:{country:null,postalCode:null}}),e.organisationConfiguration.trackFormDataLayerEvents){await lo(e,t.getFormState(),t);const n=t.getFormState().paymentOptionPrices?.totalPrice;dt(e,”zephr_form_payment_option_selected”,{productId:a.productId,planId:a.slug,price:n}),dt(e,”select_item”,{ecommerce:{items:[{item_id:a.slug,item_name:a.productId,price:n,quantity:1}]}}),dt(e,”add_to_cart”,{ecommerce:{currency:Nt(e).formCurrency??a?.currencyCode,value:n,items:[{item_id:a.slug,item_name:a.productId,price:n,quantity:1}]}}),dt(e,”zephr_form_button_press”,{sectionId:r.currentSection.type,buttonType:”SUBMIT”})}t.completeSection()}else console.warn(`No payment option exists for ${o} ${i}.`)},Ac=(e,t,r,n,o)=>{const i=!!Nt(e).dynamicOffer?.id,a=(Nt(e).paymentOptions??[]).map(((e,t)=>({slug:e.slug,productId:e.productId,label:e.label,price:e.price,currencyCode:e.currencyCode,formattedPrice:fn(e.price,e.currencyCode),index:t,…yc(o,!0),…e.templateValues??{}})));return{formId:e.id,formInstanceId:fc,paymentOptions:a,ref:`window.Zephr.forms[‘${fc}’]`,setState:Pc(t,r,n.id??”_”),getState:()=>r.getFormState(),selectPaymentOption:Ec(e,r,t,i)}},Sc={matches:e=>e.type===ze,create:(e,t,r,n)=>{const o=((e,t,r,n)=>{const o=(e.resolvedComponentTemplates??[]).find((e=>e.id===n.templateId));if(!o)return console.warn(`No component template found for id ‘${n.templateId}’`),””;const i=Ac(e,t,r,n,o),a={…yc(o,!1),…n.templateValues??{},…hc(t),zephrForm:i,zephrOutcomeId:e.outcomeId,zephrRuleId:e.ruleId},s=bc(e,t,n,i,o.preRenderScript,a),c={…a,…s.scope??{}};i.actions=s.actions??{},gc(i);try{return Jr.render(`n ${o.css?`${o.css}`:””}n ${o.html??””}n `,c)}catch(e){return console.error(“Error rendering mustache template”,e),””}})(e,t,r,n);return{component:pc,props:{html:o}}}};function Cc(e){let t,r,n,o=e[0].planLabel+””;return{c(){t=P(“div”),r=P(“h3″),n=A(o),_(t,”class”,”plan-label”)},m(e,o){y(e,t,o),h(t,r),h(r,n)},p(e,t){1&t&&o!==(o=e[0].planLabel+””)&&w(n,o)},d(e){e&&g(t)}}}function vc(e){let t,r,n,o,i,a,s,c,l=e[0].amount+””;return{c(){t=P(“hr”),r=S(),n=P(“div”),o=P(“div”),i=A(e[2]),a=S(),s=P(“div”),c=A(l),_(t,”class”,”svelte-1ecrab7″),_(o,”class”,”info-label svelte-1ecrab7″),_(s,”class”,”info svelte-1ecrab7″),_(n,”class”,”info-row svelte-1ecrab7″)},m(e,l){y(e,t,l),y(e,r,l),y(e,n,l),h(n,o),h(o,i),h(n,a),h(n,s),h(s,c)},p(e,t){4&t&&w(i,e[2]),1&t&&l!==(l=e[0].amount+””)&&w(c,l)},d(e){e&&(g(t),g(r),g(n))}}}function Tc(e){let t,r,n,o,i,a,s,c,l=e[0].nextBillingTime+””;return{c(){t=P(“hr”),r=S(),n=P(“div”),o=P(“div”),i=A(e[3]),a=S(),s=P(“div”),c=A(l),_(t,”class”,”svelte-1ecrab7″),_(o,”class”,”info-label svelte-1ecrab7″),_(s,”class”,”info svelte-1ecrab7″),_(n,”class”,”info-row svelte-1ecrab7″)},m(e,l){y(e,t,l),y(e,r,l),y(e,n,l),h(n,o),h(o,i),h(n,a),h(n,s),h(s,c)},p(e,t){8&t&&w(i,e[3]),1&t&&l!==(l=e[0].nextBillingTime+””)&&w(c,l)},d(e){e&&(g(t),g(r),g(n))}}}function _c(e){let t;return{c(){t=P(“div”),_(t,”class”,”change-disabled-label svelte-1ecrab7″)},m(r,n){y(r,t,n),t.innerHTML=e[4]},p(e,r){16&r&&(t.innerHTML=e[4])},d(e){e&&g(t)}}}function Oc(e){let t,r,n,o,a,s,c,l,u,d,p,m,f,b,E,C,O=e[0].productLabel+””,I=e[0].planLabel&&Cc(e),R=e[0].amount&&e[2]&&vc(e),M=e[0].nextBillingTime&&e[3]&&Tc(e);p=new mo({props:{disabled:e[0].cannotBeChanged,text:e[1]??”Select”,onClick:e[5]}});let N=e[0].cannotBeChanged&&_c(e);return{c(){t=P(“div”),r=P(“div”),n=P(“div”),o=P(“div”),a=P(“h2″),s=A(O),c=S(),I&&I.c(),l=S(),R&&R.c(),u=S(),M&&M.c(),d=S(),ae(p.$$.fragment),m=S(),N&&N.c(),_(o,”class”,”subscription-option-product-label”),_(n,”class”,”inner-box svelte-1ecrab7″),_(r,”class”,”subscription-option-box”),_(r,”aria-hidden”,”true”),_(r,”style”,f=e[0].cannotBeChanged?””:”cursor: pointer;”),_(t,”class”,”subscription-option-wrapper svelte-1ecrab7″)},m(f,g){var P;y(f,t,g),h(t,r),h(r,n),h(n,o),h(o,a),h(a,s),h(n,c),I&&I.m(n,null),h(n,l),R&&R.m(n,null),h(n,u),M&&M.m(n,null),h(n,d),se(p,n,null),h(n,m),N&&N.m(n,null),b=!0,E||(C=v(r,”click”,(P=T((function(){i(e[5])&&e[5].apply(this,arguments)})),function(e){e.target===this&&P.call(this,e)})),E=!0)},p(t,[o]){e=t,(!b||1&o)&&O!==(O=e[0].productLabel+””)&&w(s,O),e[0].planLabel?I?I.p(e,o):(I=Cc(e),I.c(),I.m(n,l)):I&&(I.d(1),I=null),e[0].amount&&e[2]?R?R.p(e,o):(R=vc(e),R.c(),R.m(n,u)):R&&(R.d(1),R=null),e[0].nextBillingTime&&e[3]?M?M.p(e,o):(M=Tc(e),M.c(),M.m(n,d)):M&&(M.d(1),M=null);const i={};1&o&&(i.disabled=e[0].cannotBeChanged),2&o&&(i.text=e[1]??”Select”),32&o&&(i.onClick=e[5]),p.$set(i),e[0].cannotBeChanged?N?N.p(e,o):(N=_c(e),N.c(),N.m(n,null)):N&&(N.d(1),N=null),(!b||1&o&&f!==(f=e[0].cannotBeChanged?””:”cursor: pointer;”))&&_(r,”style”,f)},i(e){b||(te(p.$$.fragment,e),b=!0)},o(e){re(p.$$.fragment,e),b=!1},d(e){e&&g(t),I&&I.d(),R&&R.d(),M&&M.d(),ce(p),N&&N.d(),E=!1,C()}}}function Ic(e,t,r){let{subscription:n}=t,{selectButtonText:o}=t,{amountLabel:i}=t,{nextBillingDateLabel:a}=t,{noChangePlanMappingMessage:s}=t,{onSelect:c}=t;return e.$$set=e=>{“subscription”in e&&r(0,n=e.subscription),”selectButtonText”in e&&r(1,o=e.selectButtonText),”amountLabel”in e&&r(2,i=e.amountLabel),”nextBillingDateLabel”in e&&r(3,a=e.nextBillingDateLabel),”noChangePlanMappingMessage”in e&&r(4,s=e.noChangePlanMappingMessage),”onSelect”in e&&r(5,c=e.onSelect)},[n,o,i,a,s,c]}class wc extends de{constructor(e){super(),ue(this,e,Ic,Oc,a,{subscription:0,selectButtonText:1,amountLabel:2,nextBillingDateLabel:3,noChangePlanMappingMessage:4,onSelect:5})}}function Rc(e,t,r){const n=e.slice();return n[8]=t[r],n}function Mc(e){let t,r;return t=new rr({}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Nc(e){let t;return{c(){t=P(“div”)},m(r,n){y(r,t,n),t.innerHTML=e[0]},p(e,r){1&r&&(t.innerHTML=e[0])},d(e){e&&g(t)}}}function $c(e){let t,r;function n(){return e[7](e[8])}return t=new wc({props:{subscription:e[8],selectButtonText:e[5],noChangePlanMappingMessage:e[1],amountLabel:e[3],nextBillingDateLabel:e[4],onSelect:n}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(r,o){e=r;const i={};4&o&&(i.subscription=e[8]),32&o&&(i.selectButtonText=e[5]),2&o&&(i.noChangePlanMappingMessage=e[1]),8&o&&(i.amountLabel=e[3]),16&o&&(i.nextBillingDateLabel=e[4]),68&o&&(i.onSelect=n),t.$set(i)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Lc(e){let t,r,n,o,i=null==e[2]&&Mc(),a=null!=e[2]&&!e[2].length&&Nc(e),s=ne(e[2]??[]),c=[];for(let t=0;tre(c[e],1,1,(()=>{c[e]=null}));return{c(){t=P(“div”),i&&i.c(),r=S(),a&&a.c(),n=S();for(let e=0;e<c.length;e+=1)c[e].c();_(t,"class","subscription-options-container svelte-1nzbr4y")},m(e,s){y(e,t,s),i&&i.m(t,null),h(t,r),a&&a.m(t,null),h(t,n);for(let e=0;e{i=null})),ee()),null==e[2]||e[2].length?a&&(a.d(1),a=null):a?a.p(e,o):(a=Nc(e),a.c(),a.m(t,n)),126&o){let r;for(s=ne(e[2]??[]),r=0;r<s.length;r+=1){const n=Rc(e,s,r);c[r]?(c[r].p(n,o),te(c[r],1)):(c[r]=$c(n),c[r].c(),te(c[r],1),c[r].m(t,null))}for(X(),r=s.length;r<c.length;r+=1)l(r);ee()}},i(e){if(!o){te(i);for(let e=0;e
l(e)]}class Fc extends de{constructor(e){super(),ue(this,e,xc,Lc,a,{noSubscriptionsMessage:0,noChangePlanMappingMessage:1,subscriptions:2,amountLabel:3,nextBillingDateLabel:4,selectButtonText:5,onSelect:6})}}const zc={matches:e=>e.type===ke,create:(e,t,r,n)=>({component:Fc,props:{noSubscriptionsMessage:n.noSubscriptionsMessage,selectButtonText:n.selectButtonText,noChangePlanMappingMessage:n.noChangePlanMappingMessage,amountLabel:n.amountLabel,nextBillingDateLabel:n.nextBillingDateLabel,subscriptions:t.existingSubscriptions?t.existingSubscriptions.filter((e=>”inactive”!==e.status)):null,onSelect:n=>{r.updateFormState({selectedSubscription:n}),dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),r.completeSection()}}})};function kc(e){let t,r,n,o,i,a,s,c=e[4]&&Dc(e);return{c(){t=P(“div”),r=P(“div”),n=A(e[3]),o=S(),c&&c.c(),i=S(),a=P(“hr”),_(r,”class”,”information”),_(t,”class”,”section”),_(a,”class”,”svelte-1wg9q7″)},m(e,l){y(e,t,l),h(t,r),h(r,n),h(r,o),c&&c.m(r,null),y(e,i,l),y(e,a,l),s=!0},p(e,t){(!s||8&t)&&w(n,e[3]),e[4]?c?(c.p(e,t),16&t&&te(c,1)):(c=Dc(e),c.c(),te(c,1),c.m(r,null)):c&&(X(),re(c,1,1,(()=>{c=null})),ee())},i(e){s||(te(c),s=!0)},o(e){re(c),s=!1},d(e){e&&(g(t),g(i),g(a)),c&&c.d()}}}function Dc(e){let t,r;return t=new _a({props:{text:e[4]}}),t.$on(“linkClick”,e[7]),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};16&r&&(n.text=e[4]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Bc(e){let t,r,n,o,i,a,s,c,l=e[0].nextBillingTime+””;return{c(){t=P(“div”),r=P(“h3”),n=A(e[1]),o=S(),i=P(“div”),a=A(l),s=S(),c=P(“hr”),_(r,”class”,”svelte-1wg9q7″),_(i,”class”,”information”),_(t,”class”,”section”),_(c,”class”,”svelte-1wg9q7″)},m(e,l){y(e,t,l),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a),y(e,s,l),y(e,c,l)},p(e,t){2&t&&w(n,e[1]),1&t&&l!==(l=e[0].nextBillingTime+””)&&w(a,l)},d(e){e&&(g(t),g(s),g(c))}}}function Uc(e){let t,r,n,o,i,a,s,c,l=e[0].amount+””;return{c(){t=P(“div”),r=P(“h3”),n=A(e[2]),o=S(),i=P(“div”),a=A(l),s=S(),c=P(“hr”),_(r,”class”,”svelte-1wg9q7″),_(i,”class”,”information”),_(t,”class”,”section”),_(c,”class”,”svelte-1wg9q7″)},m(e,l){y(e,t,l),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a),y(e,s,l),y(e,c,l)},p(e,t){4&t&&w(n,e[2]),1&t&&l!==(l=e[0].amount+””)&&w(a,l)},d(e){e&&(g(t),g(s),g(c))}}}function Gc(e){let t,r,n,o,i,a,s,c,l,u,d,p,m=e[0].productLabel+””,b=e[6]&&kc(e),E=”active”===e[0].status&&e[0].nextBillingTime&&Bc(e),C=e[0].amount&&Uc(e);return{c(){t=P(“div”),r=P(“div”),n=P(“div”),o=P(“h2”),i=A(m),s=S(),c=P(“hr”),l=S(),b&&b.c(),u=S(),E&&E.c(),d=S(),C&&C.c(),_(o,”class”,a=f(“inactive”===e[0].status?”inactive”:””)+” svelte-1wg9q7″),_(n,”class”,”section”),_(c,”class”,”svelte-1wg9q7″),_(r,”class”,”inner-box svelte-1wg9q7″),_(t,”class”,”subscription-list-item svelte-1wg9q7″)},m(e,a){y(e,t,a),h(t,r),h(r,n),h(n,o),h(o,i),h(r,s),h(r,c),h(r,l),b&&b.m(r,null),h(r,u),E&&E.m(r,null),h(r,d),C&&C.m(r,null),p=!0},p(e,[t]){(!p||1&t)&&m!==(m=e[0].productLabel+””)&&w(i,m),(!p||1&t&&a!==(a=f(“inactive”===e[0].status?”inactive”:””)+” svelte-1wg9q7″))&&_(o,”class”,a),e[6]?b?(b.p(e,t),64&t&&te(b,1)):(b=kc(e),b.c(),te(b,1),b.m(r,u)):b&&(X(),re(b,1,1,(()=>{b=null})),ee()),”active”===e[0].status&&e[0].nextBillingTime?E?E.p(e,t):(E=Bc(e),E.c(),E.m(r,d)):E&&(E.d(1),E=null),e[0].amount?C?C.p(e,t):(C=Uc(e),C.c(),C.m(r,null)):C&&(C.d(1),C=null)},i(e){p||(te(b),p=!0)},o(e){re(b),p=!1},d(e){e&&g(t),b&&b.d(),E&&E.d(),C&&C.d()}}}function Vc(e,t,r){let{subscription:n}=t,{nextPaymentDateText:o}=t,{subscriptionRateText:i}=t,{billingHistoryText:a}=t,{billingHistoryLink:s}=t,{onViewHistory:c}=t,{showBillingHistory:l}=t;return e.$$set=e=>{“subscription”in e&&r(0,n=e.subscription),”nextPaymentDateText”in e&&r(1,o=e.nextPaymentDateText),”subscriptionRateText”in e&&r(2,i=e.subscriptionRateText),”billingHistoryText”in e&&r(3,a=e.billingHistoryText),”billingHistoryLink”in e&&r(4,s=e.billingHistoryLink),”onViewHistory”in e&&r(5,c=e.onViewHistory),”showBillingHistory”in e&&r(6,l=e.showBillingHistory)},[n,o,i,a,s,c,l,()=>c(n)]}class qc extends de{constructor(e){super(),ue(this,e,Vc,Gc,a,{subscription:0,nextPaymentDateText:1,subscriptionRateText:2,billingHistoryText:3,billingHistoryLink:4,onViewHistory:5,showBillingHistory:6})}}function jc(t){let r,n,o,i,a,s,c,l,u;return{c(){r=P(“a”),n=P(“span”),o=A(t[0]),i=S(),a=E(“svg”),s=E(“path”),_(s,”fill”,”currentColor”),_(s,”d”,”M305 239c9.4 9.4 9.4 24.6 0 33.9L113 465c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l175-175L79 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L305 239z”),_(a,”aria-hidden”,”true”),_(a,”focusable”,”false”),_(a,”data-prefix”,”far”),_(a,”data-icon”,”chevron-right”),_(a,”class”,”svg-inline–fa fa-chevron-right sc-egTsrv kzAurc”),_(a,”role”,”img”),_(a,”xmlns”,”http://www.w3.org/2000/svg”),_(a,”viewBox”,”0 0 320 512″),_(a,”width”,”16″),_(a,”height”,”16″),_(r,”class”,”zephr-form-tablink svelte-ky9lgg”),_(r,”href”,c=!t[1]||window.Zephr&&window.Zephr.isCustomPage&&t[1].startsWith(window.Zephr.customPagePath)?”javascript: void(0)”:t[1])},m(e,c){y(e,r,c),h(r,n),h(n,o),h(r,i),h(r,a),h(a,s),l||(u=v(r,”click”,t[4]),l=!0)},p(e,[t]){1&t&&w(o,e[0]),2&t&&c!==(c=!e[1]||window.Zephr&&window.Zephr.isCustomPage&&e[1].startsWith(window.Zephr.customPagePath)?”javascript: void(0)”:e[1])&&_(r,”href”,c)},i:e,o:e,d(e){e&&g(r),l=!1,u()}}}function Hc(e,t,r){let{text:n}=t,{path:o=””}=t,{onClick:i=(()=>{})}=t,{logDlEvent:a=(()=>{})}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”path”in e&&r(1,o=e.path),”onClick”in e&&r(2,i=e.onClick),”logDlEvent”in e&&r(3,a=e.logDlEvent)},[n,o,i,a,()=>{a?.(),window.Zephr&&window.Zephr.isCustomPage&&o.startsWith(window.Zephr.customPagePath)?window.history.pushState({},””,o):i()}]}class Kc extends de{constructor(e){super(),ue(this,e,Hc,jc,a,{text:0,path:1,onClick:2,logDlEvent:3})}}function Yc(e,t,r){const n=e.slice();return n[20]=t[r],n[22]=r,n}function Wc(e){let t,r,n=ne(e[13]),o=[];for(let t=0;tre(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=C()},m(e,n){for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,n);y(e,t,n),r=!0},p(e,r){if(32767&r){let a;for(n=ne(e[13]),a=0;a<n.length;a+=1){const i=Yc(e,n,a);o[a]?(o[a].p(i,r),te(o[a],1)):(o[a]=cl(i),o[a].c(),te(o[a],1),o[a].m(t.parentNode,t))}for(X(),a=n.length;a<o.length;a+=1)i(a);ee()}},i(e){if(!r){for(let e=0;e{n=null})),ee())},i(e){r||(te(n),r=!0)},o(e){re(n),r=!1},d(e){e&&g(t),n&&n.d(e)}}}function nl(e){let t,r;return t=new Kc({props:{text:e[8],onClick:e[17]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};256&r&&(n.text=e[8]),33&r&&(n.onClick=e[17]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function ol(e){let t,r,n=e[9]&&il(e);return{c(){n&&n.c(),t=C()},m(e,o){n&&n.m(e,o),y(e,t,o),r=!0},p(e,r){e[9]?n?(n.p(e,r),512&r&&te(n,1)):(n=il(e),n.c(),te(n,1),n.m(t.parentNode,t)):n&&(X(),re(n,1,1,(()=>{n=null})),ee())},i(e){r||(te(n),r=!0)},o(e){re(n),r=!1},d(e){e&&g(t),n&&n.d(e)}}}function il(e){let t,r;return t=new Kc({props:{text:e[9],path:`${e[11]}?subscription=${e[0].externalId}`,logDlEvent:e[18]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};512&r&&(n.text=e[9]),2049&r&&(n.path=`${e[11]}?subscription=${e[0].externalId}`),65&r&&(n.logDlEvent=e[18]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function al(e){let t,r,n=e[10]&&sl(e);return{c(){n&&n.c(),t=C()},m(e,o){n&&n.m(e,o),y(e,t,o),r=!0},p(e,r){e[10]?n?(n.p(e,r),1024&r&&te(n,1)):(n=sl(e),n.c(),te(n,1),n.m(t.parentNode,t)):n&&(X(),re(n,1,1,(()=>{n=null})),ee())},i(e){r||(te(n),r=!0)},o(e){re(n),r=!1},d(e){e&&g(t),n&&n.d(e)}}}function sl(e){let t,r;return t=new Kc({props:{text:e[10],path:`${e[12]}?subscription=${e[0].externalId}`,logDlEvent:e[19]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};1024&r&&(n.text=e[10]),4097&r&&(n.path=`${e[12]}?subscription=${e[0].externalId}`),129&r&&(n.logDlEvent=e[19]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function cl(e){let t,r,n,o,i,a,s=”subscription_information”===e[20]&&!e[14].subscriptionInformation&&Qc(e),c=”billing_history”===e[20]&&!e[14].billingHistory&&el(e),l=”change_payment”===e[20]&&!e[14].changePayment&&rl(e),u=”change_subscription”===e[20]&&!e[14].changeSubscription&&ol(e),d=”cancel_subscription”===e[20]&&!e[14].cancelSubscription&&al(e);return{c(){s&&s.c(),t=S(),c&&c.c(),r=S(),l&&l.c(),n=S(),u&&u.c(),o=S(),d&&d.c(),i=C()},m(e,p){s&&s.m(e,p),y(e,t,p),c&&c.m(e,p),y(e,r,p),l&&l.m(e,p),y(e,n,p),u&&u.m(e,p),y(e,o,p),d&&d.m(e,p),y(e,i,p),a=!0},p(e,a){“subscription_information”!==e[20]||e[14].subscriptionInformation?s&&(s.d(1),s=null):s?s.p(e,a):(s=Qc(e),s.c(),s.m(t.parentNode,t)),”billing_history”!==e[20]||e[14].billingHistory?c&&(X(),re(c,1,1,(()=>{c=null})),ee()):c?(c.p(e,a),24576&a&&te(c,1)):(c=el(e),c.c(),te(c,1),c.m(r.parentNode,r)),”change_payment”!==e[20]||e[14].changePayment?l&&(X(),re(l,1,1,(()=>{l=null})),ee()):l?(l.p(e,a),24576&a&&te(l,1)):(l=rl(e),l.c(),te(l,1),l.m(n.parentNode,n)),”change_subscription”!==e[20]||e[14].changeSubscription?u&&(X(),re(u,1,1,(()=>{u=null})),ee()):u?(u.p(e,a),24576&a&&te(u,1)):(u=ol(e),u.c(),te(u,1),u.m(o.parentNode,o)),”cancel_subscription”!==e[20]||e[14].cancelSubscription?d&&(X(),re(d,1,1,(()=>{d=null})),ee()):d?(d.p(e,a),24576&a&&te(d,1)):(d=al(e),d.c(),te(d,1),d.m(i.parentNode,i))},i(e){a||(te(c),te(l),te(u),te(d),a=!0)},o(e){re(c),re(l),re(u),re(d),a=!1},d(e){e&&(g(t),g(r),g(n),g(o),g(i)),s&&s.d(e),c&&c.d(e),l&&l.d(e),u&&u.d(e),d&&d.d(e)}}}function ll(e){let t,r,n,o,i,a,s=e[0].amount+””;return{c(){t=P(“div”),r=P(“span”),n=A(e[2]),o=S(),i=P(“div”),a=A(s),_(r,”class”,”svelte-h57nmp”),_(i,”class”,”zephr-box-item-information svelte-h57nmp”),_(t,”class”,”zephr-section svelte-h57nmp”)},m(e,s){y(e,t,s),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a)},p(e,t){4&t&&w(n,e[2]),1&t&&s!==(s=e[0].amount+””)&&w(a,s)},d(e){e&&g(t)}}}function ul(e){let t,r,n,o,i,a,s,c,l,u=e[0].productLabel+””;const d=[Jc,Wc],p=[];function m(e,t){return e[15]?0:1}return s=m(e),c=p[s]=d[s](e),{c(){t=P(“div”),r=P(“div”),n=P(“div”),o=P(“h2″),i=A(u),a=S(),c.c(),_(o,”class”,”svelte-h57nmp”),_(n,”class”,”zephr-section svelte-h57nmp”),_(r,”class”,”zephr-inner-box svelte-h57nmp”),_(t,”class”,”zephr-subscription-list-box-item svelte-h57nmp”)},m(e,c){y(e,t,c),h(t,r),h(r,n),h(n,o),h(o,i),h(r,a),p[s].m(r,null),l=!0},p(e,[t]){(!l||1&t)&&u!==(u=e[0].productLabel+””)&&w(i,u);let n=s;s=m(e),s===n?p[s].p(e,t):(X(),re(p[n],1,1,(()=>{p[n]=null})),ee(),c=p[s],c?c.p(e,t):(c=p[s]=d[s](e),c.c()),te(c,1),c.m(r,null))},i(e){l||(te(c),l=!0)},o(e){re(c),l=!1},d(e){e&&g(t),p[s].d()}}}function dl(e,t,r){let{subscription:n}=t,{nextPaymentDateText:o}=t,{subscriptionRateText:i}=t,{billingHistoryLink:a}=t,{onViewHistory:s}=t,{onChangePayment:c}=t,{logChangeSubscription:l}=t,{logCancelSubscription:u}=t,{changePaymentMethodText:d}=t,{changeSubscriptionText:p}=t,{cancelSubscriptionText:m}=t,{changeSubscriptionPath:f}=t,{cancelSubscriptionPath:h}=t,{elementsOrder:y}=t,{elementsHide:g}=t,{isInactive:b=!1}=t;return e.$$set=e=>{“subscription”in e&&r(0,n=e.subscription),”nextPaymentDateText”in e&&r(1,o=e.nextPaymentDateText),”subscriptionRateText”in e&&r(2,i=e.subscriptionRateText),”billingHistoryLink”in e&&r(3,a=e.billingHistoryLink),”onViewHistory”in e&&r(4,s=e.onViewHistory),”onChangePayment”in e&&r(5,c=e.onChangePayment),”logChangeSubscription”in e&&r(6,l=e.logChangeSubscription),”logCancelSubscription”in e&&r(7,u=e.logCancelSubscription),”changePaymentMethodText”in e&&r(8,d=e.changePaymentMethodText),”changeSubscriptionText”in e&&r(9,p=e.changeSubscriptionText),”cancelSubscriptionText”in e&&r(10,m=e.cancelSubscriptionText),”changeSubscriptionPath”in e&&r(11,f=e.changeSubscriptionPath),”cancelSubscriptionPath”in e&&r(12,h=e.cancelSubscriptionPath),”elementsOrder”in e&&r(13,y=e.elementsOrder),”elementsHide”in e&&r(14,g=e.elementsHide),”isInactive”in e&&r(15,b=e.isInactive)},[n,o,i,a,s,c,l,u,d,p,m,f,h,y,g,b,()=>s(n),()=>c(n),()=>l(n),()=>u(n)]}class pl extends de{constructor(e){super(),ue(this,e,dl,ul,a,{subscription:0,nextPaymentDateText:1,subscriptionRateText:2,billingHistoryLink:3,onViewHistory:4,onChangePayment:5,logChangeSubscription:6,logCancelSubscription:7,changePaymentMethodText:8,changeSubscriptionText:9,cancelSubscriptionText:10,changeSubscriptionPath:11,cancelSubscriptionPath:12,elementsOrder:13,elementsHide:14,isInactive:15})}}function ml(e,t,r){const n=e.slice();return n[22]=t[r],n}function fl(e,t,r){const n=e.slice();return n[22]=t[r],n}function hl(e){let t,r;return t=new rr({}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function yl(e){let t,r,n,o=!e[10]&&!e[6].length&&gl(e),i=ne(e[6]),a=[];for(let t=0;tre(a[e],1,1,(()=>{a[e]=null}));return{c(){o&&o.c(),t=S();for(let e=0;e<a.length;e+=1)a[e].c();r=C()},m(e,i){o&&o.m(e,i),y(e,t,i);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(e,i);y(e,r,i),n=!0},p(e,n){if(e[10]||e[6].length?o&&(o.d(1),o=null):o?o.p(e,n):(o=gl(e),o.c(),o.m(t.parentNode,t)),2095996&n){let t;for(i=ne(e[6]),t=0;t<i.length;t+=1){const o=fl(e,i,t);a[t]?(a[t].p(o,n),te(a[t],1)):(a[t]=Al(o),a[t].c(),te(a[t],1),a[t].m(r.parentNode,r))}for(X(),t=i.length;t<a.length;t+=1)s(t);ee()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)te(a[e]);n=!0}},o(e){a=a.filter(Boolean);for(let e=0;e{i=null})),ee())},i(e){o||(te(t.$$.fragment,e),te(i),o=!0)},o(e){re(t.$$.fragment,e),re(i),o=!1},d(e){e&&(g(r),g(n)),ce(t,e),i&&i.d(e)}}}function Pl(e){let t,r;return t=new pl({props:{subscription:e[22],nextPaymentDateText:e[4],subscriptionRateText:e[5],billingHistoryLink:e[3],onViewHistory:e[14],onChangePayment:e[11],logChangeSubscription:e[12],logCancelSubscription:e[13],changePaymentMethodText:e[9],changeSubscriptionText:e[15],cancelSubscriptionText:e[16],changeSubscriptionPath:e[17],cancelSubscriptionPath:e[18],elementsOrder:e[19],elementsHide:e[20]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};64&r&&(n.subscription=e[22]),16&r&&(n.nextPaymentDateText=e[4]),32&r&&(n.subscriptionRateText=e[5]),8&r&&(n.billingHistoryLink=e[3]),16384&r&&(n.onViewHistory=e[14]),2048&r&&(n.onChangePayment=e[11]),4096&r&&(n.logChangeSubscription=e[12]),8192&r&&(n.logCancelSubscription=e[13]),512&r&&(n.changePaymentMethodText=e[9]),32768&r&&(n.changeSubscriptionText=e[15]),65536&r&&(n.cancelSubscriptionText=e[16]),131072&r&&(n.changeSubscriptionPath=e[17]),262144&r&&(n.cancelSubscriptionPath=e[18]),524288&r&&(n.elementsOrder=e[19]),1048576&r&&(n.elementsHide=e[20]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function El(e){let t,r;function n(){return e[21](e[22])}return t=new mo({props:{disabled:!1,text:e[9],onClick:n,noMargin:!0}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(r,o){e=r;const i={};512&o&&(i.text=e[9]),2112&o&&(i.onClick=n),t.$set(i)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Al(e){let t,r,n,o;const i=[Pl,bl],a=[];function s(e,t){return e[19]?0:1}return t=s(e),r=a[t]=i[t](e),{c(){r.c(),n=C()},m(e,r){a[t].m(e,r),y(e,n,r),o=!0},p(e,o){let c=t;t=s(e),t===c?a[t].p(e,o):(X(),re(a[c],1,1,(()=>{a[c]=null})),ee(),r=a[t],r?r.p(e,o):(r=a[t]=i[t](e),r.c()),te(r,1),r.m(n.parentNode,n))},i(e){o||(te(r),o=!0)},o(e){re(r),o=!1},d(e){e&&g(n),a[t].d(e)}}}function Sl(e){let t,r,n,o=!e[10]&&!e[7].length&&Cl(e),i=ne(e[7]),a=[];for(let t=0;tre(a[e],1,1,(()=>{a[e]=null}));return{c(){o&&o.c(),t=S();for(let e=0;e<a.length;e+=1)a[e].c();r=C()},m(e,i){o&&o.m(e,i),y(e,t,i);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(e,i);y(e,r,i),n=!0},p(e,n){if(e[10]||e[7].length?o&&(o.d(1),o=null):o?o.p(e,n):(o=Cl(e),o.c(),o.m(t.parentNode,t)),160&n){let t;for(i=ne(e[7]),t=0;t<i.length;t+=1){const o=ml(e,i,t);a[t]?(a[t].p(o,n),te(a[t],1)):(a[t]=vl(o),a[t].c(),te(a[t],1),a[t].m(r.parentNode,r))}for(X(),t=i.length;t<a.length;t+=1)s(t);ee()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)te(a[e]);n=!0}},o(e){a=a.filter(Boolean);for(let e=0;e{i=null})),ee()),e[0]?a&&(X(),re(a,1,1,(()=>{a=null})),ee()):a?(a.p(e,o),1&o&&te(a,1)):(a=yl(e),a.c(),te(a,1),a.m(t,n)),e[0]?s?(s.p(e,o),1&o&&te(s,1)):(s=Sl(e),s.c(),te(s,1),s.m(t,null)):s&&(X(),re(s,1,1,(()=>{s=null})),ee())},i(e){o||(te(i),te(a),te(s),o=!0)},o(e){re(i),re(a),re(s),o=!1},d(e){e&&g(t),i&&i.d(),a&&a.d(),s&&s.d()}}}function _l(e,t,r){let{isPastSubscriptions:n}=t,{noSubscriptionsMessage:o}=t,{billingHistoryText:i}=t,{billingHistoryLink:a}=t,{nextPaymentDateText:s}=t,{subscriptionRateText:c}=t,{subscriptions:l}=t,{inactiveSubscriptions:u}=t,{paymentProvider:d}=t,{changePaymentMethodText:p}=t,{loading:m}=t,{onChangePayment:f}=t,{logChangeSubscription:h}=t,{logCancelSubscription:y}=t,{onViewHistory:g}=t,{changeSubscriptionText:b}=t,{cancelSubscriptionText:P}=t,{changeSubscriptionPath:E}=t,{cancelSubscriptionPath:A}=t,{elementsOrder:S}=t,{elementsHide:C}=t;return e.$$set=e=>{“isPastSubscriptions”in e&&r(0,n=e.isPastSubscriptions),”noSubscriptionsMessage”in e&&r(1,o=e.noSubscriptionsMessage),”billingHistoryText”in e&&r(2,i=e.billingHistoryText),”billingHistoryLink”in e&&r(3,a=e.billingHistoryLink),”nextPaymentDateText”in e&&r(4,s=e.nextPaymentDateText),”subscriptionRateText”in e&&r(5,c=e.subscriptionRateText),”subscriptions”in e&&r(6,l=e.subscriptions),”inactiveSubscriptions”in e&&r(7,u=e.inactiveSubscriptions),”paymentProvider”in e&&r(8,d=e.paymentProvider),”changePaymentMethodText”in e&&r(9,p=e.changePaymentMethodText),”loading”in e&&r(10,m=e.loading),”onChangePayment”in e&&r(11,f=e.onChangePayment),”logChangeSubscription”in e&&r(12,h=e.logChangeSubscription),”logCancelSubscription”in e&&r(13,y=e.logCancelSubscription),”onViewHistory”in e&&r(14,g=e.onViewHistory),”changeSubscriptionText”in e&&r(15,b=e.changeSubscriptionText),”cancelSubscriptionText”in e&&r(16,P=e.cancelSubscriptionText),”changeSubscriptionPath”in e&&r(17,E=e.changeSubscriptionPath),”cancelSubscriptionPath”in e&&r(18,A=e.cancelSubscriptionPath),”elementsOrder”in e&&r(19,S=e.elementsOrder),”elementsHide”in e&&r(20,C=e.elementsHide)},[n,o,i,a,s,c,l,u,d,p,m,f,h,y,g,b,P,E,A,S,C,e=>f(e)]}class Ol extends de{constructor(e){super(),ue(this,e,_l,Tl,a,{isPastSubscriptions:0,noSubscriptionsMessage:1,billingHistoryText:2,billingHistoryLink:3,nextPaymentDateText:4,subscriptionRateText:5,subscriptions:6,inactiveSubscriptions:7,paymentProvider:8,changePaymentMethodText:9,loading:10,onChangePayment:11,logChangeSubscription:12,logCancelSubscription:13,onViewHistory:14,changeSubscriptionText:15,cancelSubscriptionText:16,changeSubscriptionPath:17,cancelSubscriptionPath:18,elementsOrder:19,elementsHide:20})}}const Il={matches:e=>e.type===Be,create:(e,t,r,n)=>({component:Ol,props:{isPastSubscriptions:n.isPastSubscriptions,subscriptionTitle:n.subscriptionTitle,billingHistoryText:n.billingHistoryText,billingHistoryLink:n.billingHistoryLink,noSubscriptionsMessage:n.noSubscriptionsMessage,nextPaymentDateText:n.nextPaymentDateText,subscriptionRateText:n.subscriptionRateText,loading:!t.existingSubscriptions,subscriptions:t.existingSubscriptions?t.existingSubscriptions.filter((e=>”active”===e.status)):[],inactiveSubscriptions:t.existingSubscriptions?t.existingSubscriptions.filter((e=>”active”!==e.status)):[],paymentProvider:e.organisationConfiguration.paymentProvider,changePaymentMethodText:n.changePaymentMethodText,onChangePayment:n=>{r.updateFormState({selectedSubscription:n}),dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),r.completeSection()},onViewHistory:t=>{r.updateFormState({selectedSubscription:t}),r.jumpToPartStart(“billing-history”),dt(e,”zephr_form_billing_history_view”,null)},logChangeSubscription:t=>{dt(e,”zephr_form_subscription_change_clicked”,{productId:t.productId,planId:t.externalId})},logCancelSubscription:t=>{dt(e,”zephr_form_cancel_subscription_clicked”,{productId:t.productId,planId:t.externalId})},changeSubscriptionText:n.changeSubscriptionText,cancelSubscriptionText:n.cancelSubscriptionText,changeSubscriptionPath:n.changeSubscriptionPath,cancelSubscriptionPath:n.cancelSubscriptionPath,elementsOrder:n.elementsOrder,elementsHide:{subscriptionInformation:n?.hideSubscriptionInformation,changePayment:n?.hideChangePayment,changeSubscription:n?.hideChangeSubscription,cancelSubscription:n?.hideCancelSubscription,billingHistory:n?.hideBillingHistory}}})};function wl(e){let t,r,n;return r=new _a({props:{text:e[2]}}),r.$on(“linkClick”,(function(){i(e[3])&&e[3].apply(this,arguments)})),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”class”,”past-subscriptions-link-wrapper svelte-1gacumx”)},m(e,o){y(e,t,o),se(r,t,null),n=!0},p(t,n){e=t;const o={};4&n&&(o.text=e[2]),r.$set(o)},i(e){n||(te(r.$$.fragment,e),n=!0)},o(e){re(r.$$.fragment,e),n=!1},d(e){e&&g(t),ce(r)}}}function Rl(e){let t,r,n=e[1]&&!e[0]&&wl(e);return{c(){n&&n.c(),t=C()},m(e,o){n&&n.m(e,o),y(e,t,o),r=!0},p(e,[r]){e[1]&&!e[0]?n?(n.p(e,r),3&r&&te(n,1)):(n=wl(e),n.c(),te(n,1),n.m(t.parentNode,t)):n&&(X(),re(n,1,1,(()=>{n=null})),ee())},i(e){r||(te(n),r=!0)},o(e){re(n),r=!1},d(e){e&&g(t),n&&n.d(e)}}}function Ml(e,t,r){let{loading:n}=t,{show:o}=t,{linkText:i}=t,{onClick:a}=t;return e.$$set=e=>{“loading”in e&&r(0,n=e.loading),”show”in e&&r(1,o=e.show),”linkText”in e&&r(2,i=e.linkText),”onClick”in e&&r(3,a=e.onClick)},[n,o,i,a]}class Nl extends de{constructor(e){super(),ue(this,e,Ml,Rl,a,{loading:0,show:1,linkText:2,onClick:3})}}const $l={matches:e=>e.type===Ue,create:(e,t,r,n)=>({component:Nl,props:{loading:!t.existingSubscriptions,show:n.show,linkText:n.linkText,onClick:()=>{r.jumpToPartStart(“past-subscriptions”)}}})};function Ll(e){let t,r,n;return r=new mo({props:{disabled:!1,text:e[0],onClick:e[2]}}),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”class”,”change-payment-method-button-container”)},m(e,o){y(e,t,o),se(r,t,null),n=!0},p(e,[t]){const n={};1&t&&(n.text=e[0]),2&t&&(n.onClick=e[2]),r.$set(n)},i(e){n||(te(r.$$.fragment,e),n=!0)},o(e){re(r.$$.fragment,e),n=!1},d(e){e&&g(t),ce(r)}}}function xl(e,t,r){let{text:n}=t,{onChangePayment:o}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”onChangePayment”in e&&r(1,o=e.onChangePayment)},[n,o,()=>o()]}class Fl extends de{constructor(e){super(),ue(this,e,xl,Ll,a,{text:0,onChangePayment:1})}}const zl={matches:e=>e.type===Ve,create:(e,t,r,n)=>({component:Fl,props:{text:n.text,onChangePayment:()=>{dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),r.completeSection()}}})};function kl(e){let t,r,n,o;return r=new _a({props:{text:e[0],onClick:e[2]}}),r.$on(“linkClick”,(function(){i(e[2])&&e[2].apply(this,arguments)})),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”class”,n=f(“event-link-wrapper “+(e[1]?”float-right”:””))+” svelte-12vtv9v”)},m(e,n){y(e,t,n),se(r,t,null),o=!0},p(i,[a]){e=i;const s={};1&a&&(s.text=e[0]),4&a&&(s.onClick=e[2]),r.$set(s),(!o||2&a&&n!==(n=f(“event-link-wrapper “+(e[1]?”float-right”:””))+” svelte-12vtv9v”))&&_(t,”class”,n)},i(e){o||(te(r.$$.fragment,e),o=!0)},o(e){re(r.$$.fragment,e),o=!1},d(e){e&&g(t),ce(r)}}}function Dl(e,t,r){let{text:n}=t,{floatRight:o}=t,{onClick:i}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”floatRight”in e&&r(1,o=e.floatRight),”onClick”in e&&r(2,i=e.onClick)},[n,o,i]}class Bl extends de{constructor(e){super(),ue(this,e,Dl,kl,a,{text:0,floatRight:1,onClick:2})}}const Ul={matches:e=>e.type===De,create:(e,t,r,n)=>({component:Bl,props:{text:n.text,floatRight:n.floatRight,onClick:()=>{r.onEvent(n.event)}}})};function Gl(e){let t,r;return t=new _a({props:{text:e[2]}}),t.$on(“linkClick”,(function(){i(e[4])&&e[4].apply(this,arguments)})),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(r,n){e=r;const o={};4&n&&(o.text=e[2]),t.$set(o)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Vl(e){let t,r,n,o,i,a,s;r=new Lo({props:{forInput:e[5],label:e[0]}});let c=e[3]&&Gl(e);return{c(){t=P(“div”),ae(r.$$.fragment),n=S(),o=P(“div”),i=P(“input”),a=S(),c&&c.c(),_(t,”class”,”bold-label svelte-121zkre”),_(i,”id”,e[5]),_(i,”type”,”email”),_(i,”name”,”email”),i.value=e[1],i.readOnly=!0,_(i,”class”,”read-only-input svelte-121zkre”),_(o,”class”,”zephr-form-relative-container svelte-121zkre”)},m(e,l){y(e,t,l),se(r,t,null),y(e,n,l),y(e,o,l),h(o,i),h(o,a),c&&c.m(o,null),s=!0},p(e,[t]){const n={};1&t&&(n.label=e[0]),r.$set(n),(!s||2&t&&i.value!==e[1])&&(i.value=e[1]),e[3]?c?(c.p(e,t),8&t&&te(c,1)):(c=Gl(e),c.c(),te(c,1),c.m(o,null)):c&&(X(),re(c,1,1,(()=>{c=null})),ee())},i(e){s||(te(r.$$.fragment,e),te(c),s=!0)},o(e){re(r.$$.fragment,e),re(c),s=!1},d(e){e&&(g(t),g(n),g(o)),ce(r),c&&c.d()}}}function ql(e,t,r){let{formKey:n}=t,{label:o}=t,{emailAddress:i}=t,{updateLabel:a}=t,{updateEnabled:s}=t,{onUpdate:c}=t;const l=`zephr-form-read-only-email-address-${n}`;return e.$$set=e=>{“formKey”in e&&r(6,n=e.formKey),”label”in e&&r(0,o=e.label),”emailAddress”in e&&r(1,i=e.emailAddress),”updateLabel”in e&&r(2,a=e.updateLabel),”updateEnabled”in e&&r(3,s=e.updateEnabled),”onUpdate”in e&&r(4,c=e.onUpdate)},[o,i,a,s,c,l,n]}class jl extends de{constructor(e){super(),ue(this,e,ql,Vl,a,{formKey:6,label:0,emailAddress:1,updateLabel:2,updateEnabled:3,onUpdate:4})}}const Hl={matches:e=>e.type===qe,create:(e,t,r,n)=>({component:jl,props:{formKey:e.uniqueKey,emailAddress:t.readOnlyEmail??””,label:n.label,updateLabel:n.updateLinkLabel,updateEnabled:n.updateLinkEnabled,onUpdate:()=>r.jumpToPartStart(“email-update”)}})};function Kl(e){let t,r;return t=new _a({props:{text:e[1]}}),t.$on(“linkClick”,(function(){i(e[3])&&e[3].apply(this,arguments)})),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(r,n){e=r;const o={};2&n&&(o.text=e[1]),t.$set(o)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function Yl(e){let t,r,n,o,i,a,s;r=new Lo({props:{forInput:e[4],label:e[0]}});let c=e[2]&&Kl(e);return{c(){t=P(“div”),ae(r.$$.fragment),n=S(),o=P(“div”),i=P(“input”),a=S(),c&&c.c(),_(t,”class”,”bold-label svelte-121zkre”),_(i,”id”,e[4]),_(i,”type”,”password”),i.value=”••••••••••••••••”,i.readOnly=!0,_(i,”class”,”read-only-input svelte-121zkre”),_(o,”class”,”zephr-form-relative-container svelte-121zkre”)},m(e,l){y(e,t,l),se(r,t,null),y(e,n,l),y(e,o,l),h(o,i),h(o,a),c&&c.m(o,null),s=!0},p(e,[t]){const n={};1&t&&(n.label=e[0]),r.$set(n),e[2]?c?(c.p(e,t),4&t&&te(c,1)):(c=Kl(e),c.c(),te(c,1),c.m(o,null)):c&&(X(),re(c,1,1,(()=>{c=null})),ee())},i(e){s||(te(r.$$.fragment,e),te(c),s=!0)},o(e){re(r.$$.fragment,e),re(c),s=!1},d(e){e&&(g(t),g(n),g(o)),ce(r),c&&c.d()}}}function Wl(e,t,r){let{formKey:n}=t,{label:o}=t,{updateLabel:i}=t,{updateEnabled:a}=t,{onUpdate:s}=t;const c=`zephr-form-read-only-password-${n}`;return e.$$set=e=>{“formKey”in e&&r(5,n=e.formKey),”label”in e&&r(0,o=e.label),”updateLabel”in e&&r(1,i=e.updateLabel),”updateEnabled”in e&&r(2,a=e.updateEnabled),”onUpdate”in e&&r(3,s=e.onUpdate)},[o,i,a,s,c,n]}class Jl extends de{constructor(e){super(),ue(this,e,Wl,Yl,a,{formKey:5,label:0,updateLabel:1,updateEnabled:2,onUpdate:3})}}const Ql={matches:e=>e.type===je,create:(e,t,r,n)=>({component:Jl,props:{formKey:e.uniqueKey,label:n.label,updateLabel:n.updateLinkLabel,updateEnabled:n.updateLinkEnabled,onUpdate:()=>r.jumpToPartStart(“password-update”)}})};function Zl(t){let r,n,o,i,a,s;return{c(){r=P(“div”),n=P(“div”),o=A(t[3]),i=S(),a=P(“div”),s=A(t[2]),_(n,”class”,”zephr-form-ro-attribute-label”),_(a,”class”,”zephr-form-ro-attribute-value”),_(r,”class”,”zephr-form-ro-attribute”)},m(e,t){y(e,r,t),h(r,n),h(n,o),h(r,i),h(r,a),h(a,s)},p(e,t){8&t&&w(o,e[3]),4&t&&w(s,e[2])},i:e,o:e,d(e){e&&g(r)}}}function Xl(e){let t,r,n;return r=new ra({props:{id:`zephr-form-ro-checkbox-${e[1]}`,name:e[1],label:e[3],required:!1,value:e[2],checked:e[2],disabled:!0}}),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”class”,”zephr-form-ro-attribute”)},m(e,o){y(e,t,o),se(r,t,null),n=!0},p(e,t){const n={};2&t&&(n.id=`zephr-form-ro-checkbox-${e[1]}`),2&t&&(n.name=e[1]),8&t&&(n.label=e[3]),4&t&&(n.value=e[2]),4&t&&(n.checked=e[2]),r.$set(n)},i(e){n||(te(r.$$.fragment,e),n=!0)},o(e){re(r.$$.fragment,e),n=!1},d(e){e&&g(t),ce(r)}}}function eu(e){let t,r,n,o;const i=[Xl,Zl],a=[];function s(e,t){return e[0]?0:1}return t=s(e),r=a[t]=i[t](e),{c(){r.c(),n=C()},m(e,r){a[t].m(e,r),y(e,n,r),o=!0},p(e,[o]){let c=t;t=s(e),t===c?a[t].p(e,o):(X(),re(a[c],1,1,(()=>{a[c]=null})),ee(),r=a[t],r?r.p(e,o):(r=a[t]=i[t](e),r.c()),te(r,1),r.m(n.parentNode,n))},i(e){o||(te(r),o=!0)},o(e){re(r),o=!1},d(e){e&&g(n),a[t].d(e)}}}function tu(e,t,r){let{isCheckbox:n}=t,{slug:o}=t,{value:i}=t,{label:a}=t;return e.$$set=e=>{“isCheckbox”in e&&r(0,n=e.isCheckbox),”slug”in e&&r(1,o=e.slug),”value”in e&&r(2,i=e.value),”label”in e&&r(3,a=e.label)},[n,o,i,a]}class ru extends de{constructor(e){super(),ue(this,e,tu,eu,a,{isCheckbox:0,slug:1,value:2,label:3})}}const nu=[“radio”,”select”],ou={matches:e=>e.type===He,create:(e,t,r,n)=>{const o=e.organisationConfiguration.schemaFields.find((e=>e.slug===n.slug));let i=(t.readOnlyAttributeValues??{})[n.slug]??””;i&&nu.includes(o?.[“input-type”])&&(i=(o?.[“select-options”]??[]).find((e=>e.value===i))?.label??i);const a=”checkbox”===o?.[“input-type”];return{component:ru,props:{value:i,slug:n.slug,label:n.label,isCheckbox:a}}}};function iu(e){let t,r;return{c(){t=P(“span”),r=A(e[2]),_(t,”class”,”current-device svelte-4jb3ht”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){4&t&&w(r,e[2])},d(e){e&&g(t)}}}function au(e){let t,r;return t=new mo({props:{disabled:!1,text:e[4],onClick:e[5]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};16&r&&(n.text=e[4]),3&r&&(n.onClick=e[5]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function su(e){let t,r,n,o,i,a,s,c,l,u,d,p,m,f,b,E,C,v,T,O=e[0].deviceName+””,I=e[0].startDate+””,R=e[0].browser+””,M=e[0].country+””,N=e[0].requestingSession&&iu(e),$=!e[0].requestingSession&&au(e);return{c(){t=P(“div”),r=P(“div”),n=A(O),o=S(),N&&N.c(),i=S(),a=P(“div”),s=A(e[3]),c=A(“: “),l=A(I),u=S(),d=P(“div”),p=A(R),m=S(),f=P(“div”),b=A(M),E=S(),$&&$.c(),C=S(),v=P(“hr”),_(r,”class”,”device-title svelte-4jb3ht”),_(a,”class”,”login-time svelte-4jb3ht”),_(d,”class”,”browser svelte-4jb3ht”),_(f,”class”,”country svelte-4jb3ht”),_(v,”class”,”svelte-4jb3ht”),_(t,”class”,”session-container svelte-4jb3ht”)},m(e,g){y(e,t,g),h(t,r),h(r,n),h(r,o),N&&N.m(r,null),h(t,i),h(t,a),h(a,s),h(a,c),h(a,l),h(t,u),h(t,d),h(d,p),h(t,m),h(t,f),h(f,b),h(t,E),$&&$.m(t,null),h(t,C),h(t,v),T=!0},p(e,[o]){(!T||1&o)&&O!==(O=e[0].deviceName+””)&&w(n,O),e[0].requestingSession?N?N.p(e,o):(N=iu(e),N.c(),N.m(r,null)):N&&(N.d(1),N=null),(!T||8&o)&&w(s,e[3]),(!T||1&o)&&I!==(I=e[0].startDate+””)&&w(l,I),(!T||1&o)&&R!==(R=e[0].browser+””)&&w(p,R),(!T||1&o)&&M!==(M=e[0].country+””)&&w(b,M),e[0].requestingSession?$&&(X(),re($,1,1,(()=>{$=null})),ee()):$?($.p(e,o),1&o&&te($,1)):($=au(e),$.c(),te($,1),$.m(t,C))},i(e){T||(te($),T=!0)},o(e){re($),T=!1},d(e){e&&g(t),N&&N.d(),$&&$.d()}}}function cu(e,t,r){let{deviceSession:n}=t,{onDeviceSignOut:o}=t,{currentDeviceLabel:i}=t,{loginTimeLabel:a}=t,{signOutLabel:s}=t;return e.$$set=e=>{“deviceSession”in e&&r(0,n=e.deviceSession),”onDeviceSignOut”in e&&r(1,o=e.onDeviceSignOut),”currentDeviceLabel”in e&&r(2,i=e.currentDeviceLabel),”loginTimeLabel”in e&&r(3,a=e.loginTimeLabel),”signOutLabel”in e&&r(4,s=e.signOutLabel)},[n,o,i,a,s,()=>o(n.id)]}class lu extends de{constructor(e){super(),ue(this,e,cu,su,a,{deviceSession:0,onDeviceSignOut:1,currentDeviceLabel:2,loginTimeLabel:3,signOutLabel:4})}}function uu(e,t,r){const n=e.slice();return n[7]=t[r],n}function du(e){let t,r;return t=new er({props:{icon:Ht,spin:!0,size:”lg”}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function pu(e){let t;return{c(){t=P(“div”)},m(r,n){y(r,t,n),t.innerHTML=e[1]},p(e,r){2&r&&(t.innerHTML=e[1])},d(e){e&&g(t)}}}function mu(e){let t,r;return t=new lu({props:{deviceSession:e[7],currentDeviceLabel:e[3],loginTimeLabel:e[4],signOutLabel:e[5],onDeviceSignOut:e[6]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};1&r&&(n.deviceSession=e[7]),8&r&&(n.currentDeviceLabel=e[3]),16&r&&(n.loginTimeLabel=e[4]),32&r&&(n.signOutLabel=e[5]),64&r&&(n.onDeviceSignOut=e[6]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function fu(e){let t,r,n,o,i,a,s,c,l=null==e[0]&&du(),u=null!=e[0]&&!e[0].length&&pu(e),d=ne(e[0]??[]),p=[];for(let t=0;tre(p[e],1,1,(()=>{p[e]=null}));return{c(){t=P(“div”),r=P(“div”),n=P(“h1”),o=A(e[2]),i=S(),l&&l.c(),a=S(),u&&u.c(),s=S();for(let e=0;e<p.length;e+=1)p[e].c();_(n,"class","current-device"),_(r,"class","your-devices"),_(t,"class","devices-sessions-container")},m(e,d){y(e,t,d),h(t,r),h(r,n),h(n,o),h(t,i),l&&l.m(t,null),h(t,a),u&&u.m(t,null),h(t,s);for(let e=0;e{l=null})),ee()),null==e[0]||e[0].length?u&&(u.d(1),u=null):u?u.p(e,r):(u=pu(e),u.c(),u.m(t,s)),121&r){let n;for(d=ne(e[0]??[]),n=0;n<d.length;n+=1){const o=uu(e,d,n);p[n]?(p[n].p(o,r),te(p[n],1)):(p[n]=mu(o),p[n].c(),te(p[n],1),p[n].m(t,null))}for(X(),n=d.length;n<p.length;n+=1)m(n);ee()}},i(e){if(!c){te(l);for(let e=0;e<d.length;e+=1)te(p[e]);c=!0}},o(e){re(l),p=p.filter(Boolean);for(let e=0;e
{“devicesSessions”in e&&r(0,n=e.devicesSessions),”noDeviceSessionsMessage”in e&&r(1,o=e.noDeviceSessionsMessage),”yourDevicesLabel”in e&&r(2,i=e.yourDevicesLabel),”currentDeviceLabel”in e&&r(3,a=e.currentDeviceLabel),”loginTimeLabel”in e&&r(4,s=e.loginTimeLabel),”signOutLabel”in e&&r(5,c=e.signOutLabel),”onDeviceSignOut”in e&&r(6,l=e.onDeviceSignOut)},[n,o,i,a,s,c,l]}class yu extends de{constructor(e){super(),ue(this,e,hu,fu,a,{devicesSessions:0,noDeviceSessionsMessage:1,yourDevicesLabel:2,currentDeviceLabel:3,loginTimeLabel:4,signOutLabel:5,onDeviceSignOut:6})}}const gu=async(e,t,r)=>{const n=await bu(e,t,r);return r.updateFormState({availableDeviceSessions:n}),n},bu=(e,t,r)=>fr(“zephr/public/sessions/v1/sessions”,{method:”GET”},r,null,!0).then((e=>e.ok?e.json():[])).then((t=>t.map((t=>({tenantId:t.tenantId,userId:t.userId,id:t.id,startDate:new Date(t.startDate).toLocaleString(Yn(e),{year:”numeric”,month:”long”,day:”numeric”,hour:”2-digit”,minute:”2-digit”,second:”2-digit”,hour12:!0}),deviceName:t.deviceName,browser:t.browser,requestingSession:t.requestingSession,city:t.city??null,country:t.country??null,geoState:t.geoState??null,ipAddress:t.ipAddress??null}))))),Pu=async(e,t,r,n)=>{try{return 200===(await fr(`zephr/public/sessions/v1/sessions/${n}`,{method:”DELETE”},r,null,!0)).status}catch(e){return console.error(“Error occurred while signing out device:”,e),!1}},Eu={matches:e=>e.type===Ye,create:(e,t,r,n)=>({component:yu,props:{yourDevicesLabel:n.yourDevicesLabel,noDeviceSessionsMessage:n.noDeviceSessionsMessage,devicesSessions:t.availableDeviceSessions,currentDeviceLabel:n.currentDeviceLabel,loginTimeLabel:n.loginTimeLabel,signOutLabel:n.signOutLabel,onDeviceSignOut:n=>{dt(e,”zephr_form_button_press”,{sectionId:t.currentSection.type,buttonType:”SUBMIT”}),dt(e,”zephr_form_device_logout”,{deviceId:n}),(async(e,t,r,n)=>{if(await Pu(e,t,r,n))return console.log(“Successfully signed out device.”),gu(e,t,r);console.error(“Failed to sign out device.”)})(e,t,r,n)}}})};function Au(e){let t,r,n,o;return{c(){t=P(“div”),r=A(e[2]),_(t,”class”,”sign-out-all svelte-1gdzu2p”)},m(a,s){y(a,t,s),h(t,r),n||(o=v(t,”click”,(function(){i(e[0])&&e[0].apply(this,arguments)})),n=!0)},p(t,n){e=t,4&n&&w(r,e[2])},d(e){e&&g(t),n=!1,o()}}}function Su(t){let r,n=!t[1]&&Au(t);return{c(){n&&n.c(),r=C()},m(e,t){n&&n.m(e,t),y(e,r,t)},p(e,[t]){e[1]?n&&(n.d(1),n=null):n?n.p(e,t):(n=Au(e),n.c(),n.m(r.parentNode,r))},i:e,o:e,d(e){e&&g(r),n&&n.d(e)}}}function Cu(e,t,r){let{onSignOutAllDevices:n}=t,{hidden:o}=t,{text:i}=t;return e.$$set=e=>{“onSignOutAllDevices”in e&&r(0,n=e.onSignOutAllDevices),”hidden”in e&&r(1,o=e.hidden),”text”in e&&r(2,i=e.text)},[n,o,i]}class vu extends de{constructor(e){super(),ue(this,e,Cu,Su,a,{onSignOutAllDevices:0,hidden:1,text:2})}}const Tu=async(e,t,r)=>{try{return 200===(await fr(“zephr/public/sessions/v1/sessions?except-current”,{method:”DELETE”},r,null,!0)).status}catch(e){return console.error(“Error occurred while signing out devices:”,e),!1}},_u={matches:e=>e.type===We,create:(e,t,r,n)=>({component:vu,props:{hidden:t.availableDeviceSessions?.length{dt(e,”zephr_form_sign_out_all_devices”,null),(async(e,t,r)=>{if(await Tu(e,t,r))return console.log(“Successfully signed out of all devices.”),gu(e,t,r);console.error(“Failed to sign out of all devices.”)})(e,t,r)}}})};function Ou(e,t,r){const n=e.slice();return n[5]=t[r],n}function Iu(e){let t,r,n,o,i,a=e[5].currency+””,s=e[5].subtotal+””,c=e[5].taxes&&wu(e);return{c(){t=A(a),r=S(),n=A(s),o=S(),c&&c.c(),i=C()},m(e,a){y(e,t,a),y(e,r,a),y(e,n,a),y(e,o,a),c&&c.m(e,a),y(e,i,a)},p(e,r){1&r&&a!==(a=e[5].currency+””)&&w(t,a),1&r&&s!==(s=e[5].subtotal+””)&&w(n,s),e[5].taxes?c?c.p(e,r):(c=wu(e),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},d(e){e&&(g(t),g(r),g(n),g(o),g(i)),c&&c.d(e)}}}function wu(e){let t,r,n=` ${e[5].taxes}`;return{c(){t=P(“span”),r=A(n),_(t,”class”,”taxes svelte-15e6uru”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){1&t&&n!==(n=` ${e[5].taxes}`)&&w(r,n)},d(e){e&&g(t)}}}function Ru(e){let t,r,n,o=e[5].currency+””,i=e[5].total+””;return{c(){t=A(o),r=S(),n=A(i)},m(e,o){y(e,t,o),y(e,r,o),y(e,n,o)},p(e,r){1&r&&o!==(o=e[5].currency+””)&&w(t,o),1&r&&i!==(i=e[5].total+””)&&w(n,i)},d(e){e&&(g(t),g(r),g(n))}}}function Mu(e){let t,r,n,o,i,a,s,c,l,u,d,p=e[5].date+””,m=e[5].period+””,f=e[5].subtotal&&Iu(e),b=e[5].total&&Ru(e);return{c(){t=P(“div”),r=P(“div”),n=A(p),o=S(),i=P(“div”),a=A(m),s=S(),c=P(“div”),f&&f.c(),l=S(),u=P(“div”),b&&b.c(),d=S(),_(r,”class”,”svelte-15e6uru”),_(i,”class”,”svelte-15e6uru”),_(c,”class”,”svelte-15e6uru”),_(u,”class”,”svelte-15e6uru”),_(t,”class”,”table-row svelte-15e6uru”)},m(e,p){y(e,t,p),h(t,r),h(r,n),h(t,o),h(t,i),h(i,a),h(t,s),h(t,c),f&&f.m(c,null),h(t,l),h(t,u),b&&b.m(u,null),h(t,d)},p(e,t){1&t&&p!==(p=e[5].date+””)&&w(n,p),1&t&&m!==(m=e[5].period+””)&&w(a,m),e[5].subtotal?f?f.p(e,t):(f=Iu(e),f.c(),f.m(c,null)):f&&(f.d(1),f=null),e[5].total?b?b.p(e,t):(b=Ru(e),b.c(),b.m(u,null)):b&&(b.d(1),b=null)},d(e){e&&g(t),f&&f.d(),b&&b.d()}}}function Nu(t){let r,n,o,i,a,s,c,l,u,d,p,m,f,E,C,v=ne(t[0]??[]),T=[];for(let e=0;e<v.length;e+=1)T[e]=Mu(Ou(t,v,e));return{c(){r=P("div"),n=P("div"),o=P("div"),i=P("div"),a=A(t[1]),s=S(),c=P("div"),l=A(t[2]),u=S(),d=P("div"),p=A(t[3]),m=S(),f=P("div"),E=A(t[4]),C=S();for(let e=0;e<T.length;e+=1)T[e].c();_(i,"class","svelte-15e6uru"),_(c,"class","svelte-15e6uru"),_(d,"class","svelte-15e6uru"),_(f,"class","svelte-15e6uru"),_(o,"class","table-head svelte-15e6uru"),_(n,"class","table svelte-15e6uru"),_(r,"class","billing-history-container")},m(e,t){y(e,r,t),h(r,n),h(n,o),h(o,i),h(i,a),h(o,s),h(o,c),h(c,l),h(o,u),h(o,d),h(d,p),h(o,m),h(o,f),h(f,E),h(n,C);for(let e=0;e<T.length;e+=1)T[e]&&T[e].m(n,null)},p(e,[t]){if(2&t&&w(a,e[1]),4&t&&w(l,e[2]),8&t&&w(p,e[3]),16&t&&w(E,e[4]),1&t){let r;for(v=ne(e[0]??[]),r=0;re.type===Ge,create:(e,t,r)=>({component:Lu,props:{historyItems:t.selectedSubscription?.transactionHistory,dateLabel:Kn(e,”forms.billing.history.date”,”Date”),periodLabel:Kn(e,”forms.billing.history.period”,”Period”),subtotalLabel:Kn(e,”forms.billing.history.subtotal”,”Subtotal”),totalLabel:Kn(e,”forms.billing.history.total”,”Total”)}})};function Fu(e){let t,r,n,o;return{c(){t=P(“button”),r=A(e[1]),_(t,”class”,”zephr-form-back-button svelte-s116f2″),_(t,”type”,”submit”)},m(a,s){y(a,t,s),h(t,r),n||(o=v(t,”click”,T((function(){i(e[3])&&e[3].apply(this,arguments)}))),n=!0)},p(t,n){e=t,2&n&&w(r,e[1])},d(e){e&&g(t),n=!1,o()}}}function zu(t){let r,n,o,a,s,c,l=t[2]&&Fu(t);return{c(){r=P(“div”),l&&l.c(),n=S(),o=P(“button”),a=A(t[0]),_(o,”class”,”zephr-form-continue-button svelte-s116f2″),_(o,”type”,”submit”),_(r,”class”,”zephr-form-button-group zephr-form-max-width svelte-s116f2″)},m(e,u){y(e,r,u),l&&l.m(r,null),h(r,n),h(r,o),h(o,a),s||(c=v(o,”click”,T((function(){i(t[4])&&t[4].apply(this,arguments)}))),s=!0)},p(e,[o]){(t=e)[2]?l?l.p(t,o):(l=Fu(t),l.c(),l.m(r,n)):l&&(l.d(1),l=null),1&o&&w(a,t[0])},i:e,o:e,d(e){e&&g(r),l&&l.d(),s=!1,c()}}}function ku(e,t,r){let{continueText:n}=t,{backText:o}=t,{backEnabled:i}=t,{onBack:a}=t,{onClick:s}=t;return e.$$set=e=>{“continueText”in e&&r(0,n=e.continueText),”backText”in e&&r(1,o=e.backText),”backEnabled”in e&&r(2,i=e.backEnabled),”onBack”in e&&r(3,a=e.onBack),”onClick”in e&&r(4,s=e.onClick)},[n,o,i,a,s]}class Du extends de{constructor(e){super(),ue(this,e,ku,zu,a,{continueText:0,backText:1,backEnabled:2,onBack:3,onClick:4})}}const Bu={matches:e=>e.type===Je,create:(e,t,r,n)=>({component:Du,props:{continueText:n.continueText,backText:n.backText,backEnabled:n.backEnabled,onClick:()=>{n.isCancel&&r.updateFormState({confirmCancel:!0}),r.updateFormState({isExternalReferrer:!1}),r.attemptCompleteSection()},onBack:()=>{n.backToURL?window.location.pathname=n.backURL:t.isExternalReferrer?window.history.back():r.onEvent(n.event)}}})};function Uu(t){let r,n;return{c(){r=P(“a”),n=A(t[0]),_(r,”class”,”zephr-form-button zephr-form-button-top-margin svelte-16hrghb”),_(r,”href”,t[1])},m(e,t){y(e,r,t),h(r,n)},p(e,[t]){1&t&&w(n,e[0]),2&t&&_(r,”href”,e[1])},i:e,o:e,d(e){e&&g(r)}}}function Gu(e,t,r){let{text:n}=t,{href:o}=t;return e.$$set=e=>{“text”in e&&r(0,n=e.text),”href”in e&&r(1,o=e.href)},[n,o]}class Vu extends de{constructor(e){super(),ue(this,e,Gu,Uu,a,{text:0,href:1})}}const qu={matches:e=>e.type===Qe,create:(e,t,r,n)=>({component:Vu,props:{text:n.text,href:n.href}})};function ju(e){let t,r;return{c(){t=P(“div”),r=A(e[2]),_(t,”class”,”error-text svelte-wt5yoy”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){4&t&&w(r,e[2])},d(e){e&&g(t)}}}function Hu(t){let r,n,i,a,s,c,l,u,d,p,m=t[0].nameLabel+””,f=t[2]&&ju(t);return{c(){r=P(“div”),n=P(“div”),i=P(“label”),a=A(m),s=S(),c=P(“input”),u=S(),f&&f.c(),_(i,”for”,”recipientName”),_(i,”class”,”svelte-wt5yoy”),_(c,”id”,”recipientName”),_(c,”type”,”text”),c.required=!0,_(c,”placeholder”,l=t[0].namePlaceholder),_(c,”class”,”svelte-wt5yoy”),$(c,”error”,!!t[2]),_(n,”class”,”field svelte-wt5yoy”),_(r,”class”,”recipient-name-section svelte-wt5yoy”)},m(e,o){y(e,r,o),h(r,n),h(n,i),h(i,a),h(n,s),h(n,c),R(c,t[1]),h(n,u),f&&f.m(n,null),d||(p=[v(c,”input”,t[6]),v(c,”input”,t[3])],d=!0)},p(e,[t]){1&t&&m!==(m=e[0].nameLabel+””)&&w(a,m),1&t&&l!==(l=e[0].namePlaceholder)&&_(c,”placeholder”,l),2&t&&c.value!==e[1]&&R(c,e[1]),4&t&&$(c,”error”,!!e[2]),e[2]?f?f.p(e,t):(f=ju(e),f.c(),f.m(n,null)):f&&(f.d(1),f=null)},i:e,o:e,d(e){e&&g(r),f&&f.d(),d=!1,o(p)}}}function Ku(e,t,r){let{formState:n}=t,{formActions:o}=t,{config:i}=t;const a=D();let s=n.giftRecipient?.name||””,c=””;const l=()=>{const e=!!s.trim();r(2,c=e?””:”Recipient name is required”),a(“validity”,{isValid:e})};return e.$$set=e=>{“formState”in e&&r(4,n=e.formState),”formActions”in e&&r(5,o=e.formActions),”config”in e&&r(0,i=e.config)},[i,s,c,()=>{const e={…n.giftRecipient||{},name:s};o.updateFormState({giftRecipient:e}),l()},n,o,function(){s=this.value,r(1,s)}]}class Yu extends de{constructor(e){super(),ue(this,e,Ku,Hu,a,{formState:4,formActions:5,config:0})}}const Wu={matches:e=>e.type===Ze,create:(e,t,r,n)=>{const o={nameLabel:Kn(e,”forms.gift.recipient-name”,n.nameLabel),namePlaceholder:Kn(e,”forms.gift.name-placeholder”,n.namePlaceholder)},i=!!(t.giftRecipient||{}).name.trim();return{component:Yu,props:{config:o,form:e,formState:t,formActions:r},isValid:i}}};function Ju(e){let t,r;return{c(){t=P(“div”),r=A(e[2]),_(t,”class”,”error-text svelte-17rjebp”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){4&t&&w(r,e[2])},d(e){e&&g(t)}}}function Qu(t){let r,n,i,a,s,c,l,u,d,p,m=t[0].emailLabel+””,f=t[2]&&Ju(t);return{c(){r=P(“div”),n=P(“div”),i=P(“label”),a=A(m),s=S(),c=P(“input”),u=S(),f&&f.c(),_(i,”for”,”recipientEmail”),_(i,”class”,”svelte-17rjebp”),_(c,”id”,”recipientEmail”),_(c,”type”,”email”),c.required=!0,_(c,”placeholder”,l=t[0].emailPlaceholder),_(c,”class”,”svelte-17rjebp”),$(c,”error”,!!t[2]),_(n,”class”,”field svelte-17rjebp”),_(r,”class”,”recipient-email-section svelte-17rjebp”)},m(e,o){y(e,r,o),h(r,n),h(n,i),h(i,a),h(n,s),h(n,c),R(c,t[1]),h(n,u),f&&f.m(n,null),d||(p=[v(c,”input”,t[7]),v(c,”input”,t[3])],d=!0)},p(e,[t]){1&t&&m!==(m=e[0].emailLabel+””)&&w(a,m),1&t&&l!==(l=e[0].emailPlaceholder)&&_(c,”placeholder”,l),2&t&&c.value!==e[1]&&R(c,e[1]),4&t&&$(c,”error”,!!e[2]),e[2]?f?f.p(e,t):(f=Ju(e),f.c(),f.m(n,null)):f&&(f.d(1),f=null)},i:e,o:e,d(e){e&&g(r),f&&f.d(),d=!1,o(p)}}}function Zu(e,t,r){let{formState:n}=t,{formActions:o}=t,{config:i}=t,{form:a}=t;const s=D();let c=n.giftRecipient?.email||””,l=””;const u=()=>{const e=mi(c);r(2,l=c&&!e?Kn(a,”forms.errors.email-invalid”,”Please enter a valid email address”):c?””:”Recipient email is required”),s(“validity”,{isValid:e})};return e.$$set=e=>{“formState”in e&&r(4,n=e.formState),”formActions”in e&&r(5,o=e.formActions),”config”in e&&r(0,i=e.config),”form”in e&&r(6,a=e.form)},[i,c,l,()=>{const e={…n.giftRecipient||{},email:c};o.updateFormState({giftRecipient:e}),u()},n,o,a,function(){c=this.value,r(1,c)}]}class Xu extends de{constructor(e){super(),ue(this,e,Zu,Qu,a,{formState:4,formActions:5,config:0,form:6})}}const ed={matches:e=>e.type===Xe,create:(e,t,r,n)=>{const o={emailLabel:Kn(e,”forms.gift.recipient-email”,n.emailLabel),emailPlaceholder:Kn(e,”forms.gift.email-placeholder”,n.emailPlaceholder)},i=t.giftRecipient||{},a=mi(i.email);return{component:Xu,props:{config:o,form:e,formState:t,formActions:r},isValid:a}}};function td(e){let t,r,n,i,a,s,c,l,u,d,p,m,f,b,E,C,T,O,I,M,N,$,L,x,F,z,k,D,B,U,G,V,q,j,H,K,Y,W,J,Q,Z,X,ee,te,re,ne,oe,ie,ae,se=e[0].label+””,ce=e[0].addressLine1Label+””,le=e[0].addressLine2Label+””,ue=e[0].cityLabel+””,de=e[0].stateLabel+””,pe=e[0].countryLabel+””,me=e[0].postalCodeLabel+””,fe=e[1]&&rd(e);return{c(){t=P(“div”),r=P(“label”),n=A(se),i=S(),a=P(“div”),s=P(“div”),c=P(“label”),l=A(ce),u=S(),d=P(“input”),m=S(),f=P(“div”),b=P(“label”),E=A(le),C=S(),T=P(“input”),I=S(),M=P(“div”),N=P(“label”),$=A(ue),L=S(),x=P(“input”),z=S(),k=P(“div”),D=P(“label”),B=A(de),U=S(),G=P(“input”),q=S(),j=P(“div”),H=P(“label”),K=A(pe),Y=S(),W=P(“input”),Q=S(),Z=P(“div”),X=P(“label”),ee=A(me),te=S(),re=P(“input”),oe=S(),fe&&fe.c(),_(r,”class”,”address-main-label svelte-hqngij”),_(c,”for”,”addressLine1″),_(c,”class”,”svelte-hqngij”),_(d,”id”,”addressLine1″),_(d,”type”,”text”),d.required=e[3],_(d,”placeholder”,p=e[0].addressLine1Placeholder),_(d,”class”,”svelte-hqngij”),_(s,”class”,”field full-width svelte-hqngij”),_(b,”for”,”addressLine2″),_(b,”class”,”svelte-hqngij”),_(T,”id”,”addressLine2″),_(T,”type”,”text”),_(T,”placeholder”,O=e[0].addressLine2Placeholder),_(T,”class”,”svelte-hqngij”),_(f,”class”,”field full-width svelte-hqngij”),_(N,”for”,”city”),_(N,”class”,”svelte-hqngij”),_(x,”id”,”city”),_(x,”type”,”text”),x.required=e[3],_(x,”placeholder”,F=e[0].cityPlaceholder),_(x,”class”,”svelte-hqngij”),_(M,”class”,”field svelte-hqngij”),_(D,”for”,”state”),_(D,”class”,”svelte-hqngij”),_(G,”id”,”state”),_(G,”type”,”text”),_(G,”placeholder”,V=e[0].statePlaceholder),_(G,”class”,”svelte-hqngij”),_(k,”class”,”field svelte-hqngij”),_(H,”for”,”country”),_(H,”class”,”svelte-hqngij”),_(W,”id”,”country”),_(W,”type”,”text”),W.required=e[3],_(W,”placeholder”,J=e[0].countryPlaceholder),_(W,”class”,”svelte-hqngij”),_(j,”class”,”field svelte-hqngij”),_(X,”for”,”postalCode”),_(X,”class”,”svelte-hqngij”),_(re,”id”,”postalCode”),_(re,”type”,”text”),re.required=e[3],_(re,”placeholder”,ne=e[0].postalCodePlaceholder),_(re,”class”,”svelte-hqngij”),_(Z,”class”,”field svelte-hqngij”),_(a,”class”,”address-fields svelte-hqngij”),_(t,”class”,”recipient-address-section svelte-hqngij”)},m(o,p){y(o,t,p),h(t,r),h(r,n),h(t,i),h(t,a),h(a,s),h(s,c),h(c,l),h(s,u),h(s,d),R(d,e[2].addressLine1),h(a,m),h(a,f),h(f,b),h(b,E),h(f,C),h(f,T),R(T,e[2].addressLine2),h(a,I),h(a,M),h(M,N),h(N,$),h(M,L),h(M,x),R(x,e[2].city),h(a,z),h(a,k),h(k,D),h(D,B),h(k,U),h(k,G),R(G,e[2].state),h(a,q),h(a,j),h(j,H),h(H,K),h(j,Y),h(j,W),R(W,e[2].country),h(a,Q),h(a,Z),h(Z,X),h(X,ee),h(Z,te),h(Z,re),R(re,e[2].postalCode),h(t,oe),fe&&fe.m(t,null),ie||(ae=[v(d,”input”,e[8]),v(d,”input”,e[4]),v(T,”input”,e[9]),v(T,”input”,e[4]),v(x,”input”,e[10]),v(x,”input”,e[4]),v(G,”input”,e[11]),v(G,”input”,e[4]),v(W,”input”,e[12]),v(W,”input”,e[4]),v(re,”input”,e[13]),v(re,”input”,e[4])],ie=!0)},p(e,r){1&r&&se!==(se=e[0].label+””)&&w(n,se),1&r&&ce!==(ce=e[0].addressLine1Label+””)&&w(l,ce),8&r&&(d.required=e[3]),1&r&&p!==(p=e[0].addressLine1Placeholder)&&_(d,”placeholder”,p),4&r&&d.value!==e[2].addressLine1&&R(d,e[2].addressLine1),1&r&&le!==(le=e[0].addressLine2Label+””)&&w(E,le),1&r&&O!==(O=e[0].addressLine2Placeholder)&&_(T,”placeholder”,O),4&r&&T.value!==e[2].addressLine2&&R(T,e[2].addressLine2),1&r&&ue!==(ue=e[0].cityLabel+””)&&w($,ue),8&r&&(x.required=e[3]),1&r&&F!==(F=e[0].cityPlaceholder)&&_(x,”placeholder”,F),4&r&&x.value!==e[2].city&&R(x,e[2].city),1&r&&de!==(de=e[0].stateLabel+””)&&w(B,de),1&r&&V!==(V=e[0].statePlaceholder)&&_(G,”placeholder”,V),4&r&&G.value!==e[2].state&&R(G,e[2].state),1&r&&pe!==(pe=e[0].countryLabel+””)&&w(K,pe),8&r&&(W.required=e[3]),1&r&&J!==(J=e[0].countryPlaceholder)&&_(W,”placeholder”,J),4&r&&W.value!==e[2].country&&R(W,e[2].country),1&r&&me!==(me=e[0].postalCodeLabel+””)&&w(ee,me),8&r&&(re.required=e[3]),1&r&&ne!==(ne=e[0].postalCodePlaceholder)&&_(re,”placeholder”,ne),4&r&&re.value!==e[2].postalCode&&R(re,e[2].postalCode),e[1]?fe?fe.p(e,r):(fe=rd(e),fe.c(),fe.m(t,null)):fe&&(fe.d(1),fe=null)},d(e){e&&g(t),fe&&fe.d(),ie=!1,o(ae)}}}function rd(e){let t,r;return{c(){t=P(“div”),r=A(e[1]),_(t,”class”,”error-text svelte-hqngij”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){2&t&&w(r,e[1])},d(e){e&&g(t)}}}function nd(t){let r,n=t[3]&&td(t);return{c(){n&&n.c(),r=C()},m(e,t){n&&n.m(e,t),y(e,r,t)},p(e,[t]){e[3]?n?n.p(e,t):(n=td(e),n.c(),n.m(r.parentNode,r)):n&&(n.d(1),n=null)},i:e,o:e,d(e){e&&g(r),n&&n.d(e)}}}function od(e,t,r){let{formState:n}=t,{formActions:o}=t,{config:i}=t,{form:a}=t;const s=D();let c=””,l={addressLine1:n.giftRecipient?.recipientAddress?.addressLine1||””,addressLine2:n.giftRecipient?.recipientAddress?.addressLine2||””,city:n.giftRecipient?.recipientAddress?.city||””,state:n.giftRecipient?.recipientAddress?.state||””,country:n.giftRecipient?.recipientAddress?.country||””,postalCode:n.giftRecipient?.recipientAddress?.postalCode||””},u=!1;a?.typeConfiguration?.requires_address&&(u=!0);const d=()=>{if(!u)return s(“validity”,{isValid:!0}),void r(1,c=””);const e=!!(l.addressLine1.trim()&&l.city.trim()&&l.country.trim()&&l.postalCode.trim());r(1,c=e?””:i.addressRequiredError),s(“validity”,{isValid:e})};return e.$$set=e=>{“formState”in e&&r(5,n=e.formState),”formActions”in e&&r(6,o=e.formActions),”config”in e&&r(0,i=e.config),”form”in e&&r(7,a=e.form)},[i,c,l,u,()=>{const e={…n.giftRecipient||{},recipientAddress:l};o.updateFormState({giftRecipient:e}),d()},n,o,a,function(){l.addressLine1=this.value,r(2,l)},function(){l.addressLine2=this.value,r(2,l)},function(){l.city=this.value,r(2,l)},function(){l.state=this.value,r(2,l)},function(){l.country=this.value,r(2,l)},function(){l.postalCode=this.value,r(2,l)}]}class id extends de{constructor(e){super(),ue(this,e,od,nd,a,{formState:5,formActions:6,config:0,form:7})}}const ad={matches:e=>e.type===et,create:(e,t,r,n)=>{const o=Nt(e).requires_address;if(!1===o)return{component:null,props:{},isValid:!0};const i={label:Kn(e,”forms.gift.recipient-address”,n.label),addressLine1Label:Kn(e,”forms.gift.address-line1″,n.addressLine1Label),addressLine2Label:Kn(e,”forms.gift.address-line2″,n.addressLine2Label),cityLabel:Kn(e,”forms.gift.city”,n.cityLabel),stateLabel:Kn(e,”forms.gift.state”,n.stateLabel),countryLabel:Kn(e,”forms.gift.country”,n.countryLabel),postalCodeLabel:Kn(e,”forms.gift.postal-code”,n.postalCodeLabel),addressRequiredError:Kn(e,”forms.gift.address-required”,n.addressRequiredError),addressLine1Placeholder:Kn(e,”forms.gift.address-line1-placeholder”,n.addressLine1Placeholder),addressLine2Placeholder:Kn(e,”forms.gift.address-line2-placeholder”,n.addressLine2Placeholder),cityPlaceholder:Kn(e,”forms.gift.city-placeholder”,n.cityPlaceholder),statePlaceholder:Kn(e,”forms.gift.state-placeholder”,n.statePlaceholder),countryPlaceholder:Kn(e,”forms.gift.country-placeholder”,n.countryPlaceholder),postalCodePlaceholder:Kn(e,”forms.gift.postal-code-placeholder”,n.postalCodePlaceholder)},a=(t.giftRecipient||{}).recipientAddress||{},s=!o||!!a.addressLine1.trim()&&!!a.city.trim()&&!!a.country.trim()&&!!a.postalCode.trim();return{component:id,props:{config:i,form:e,formState:t,formActions:r},isValid:s}}};function sd(t){let r,n,i,a,s,c,l,u,d,p=t[0].messageLabel+””;return{c(){r=P(“div”),n=P(“div”),i=P(“label”),a=A(p),s=S(),c=P(“textarea”),_(i,”for”,”customMessage”),_(i,”class”,”svelte-90amkz”),_(c,”id”,”customMessage”),_(c,”placeholder”,l=t[0].messagePlaceholder),_(c,”class”,”svelte-90amkz”),_(n,”class”,”field svelte-90amkz”),_(r,”class”,”recipient-message-section svelte-90amkz”)},m(e,o){y(e,r,o),h(r,n),h(n,i),h(i,a),h(n,s),h(n,c),R(c,t[1]),u||(d=[v(c,”input”,t[5]),v(c,”input”,t[2])],u=!0)},p(e,[t]){1&t&&p!==(p=e[0].messageLabel+””)&&w(a,p),1&t&&l!==(l=e[0].messagePlaceholder)&&_(c,”placeholder”,l),2&t&&R(c,e[1])},i:e,o:e,d(e){e&&g(r),u=!1,o(d)}}}function cd(e,t,r){let{formState:n}=t,{formActions:o}=t,{config:i}=t;const a=D();let s=n.giftRecipient?.customMessage||””;return k((()=>{a(“validity”,{isValid:!0})})),e.$$set=e=>{“formState”in e&&r(3,n=e.formState),”formActions”in e&&r(4,o=e.formActions),”config”in e&&r(0,i=e.config)},[i,s,()=>{const e={…n.giftRecipient||{},customMessage:s};o.updateFormState({giftRecipient:e})},n,o,function(){s=this.value,r(1,s)}]}class ld extends de{constructor(e){super(),ue(this,e,cd,sd,a,{formState:3,formActions:4,config:0})}}const ud={matches:e=>e.type===tt,create:(e,t,r,n)=>{const o={messageLabel:Kn(e,”forms.gift.custom-message”,n.messageLabel),messagePlaceholder:Kn(e,”forms.gift.message-placeholder”,n.messagePlaceholder)};return{component:ld,props:{config:o,form:e,formState:t,formActions:r},isValid:!0}}};function dd(e){let t,r,n,o=e[3]&&pd();return{c(){t=P(“label”),r=A(e[1]),n=S(),o&&o.c(),_(t,”for”,”zephr-form-gift-code”),_(t,”class”,”svelte-1wfl3xs”)},m(e,i){y(e,t,i),h(t,r),h(t,n),o&&o.m(t,null)},p(e,n){2&n&&w(r,e[1]),e[3]?o||(o=pd(),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(e){e&&g(t),o&&o.d()}}}function pd(e){let t;return{c(){t=P(“span”),t.textContent=”*”,_(t,”class”,”required svelte-1wfl3xs”)},m(e,r){y(e,t,r)},d(e){e&&g(t)}}}function md(e){let t,r;return{c(){t=P(“div”),r=A(e[7]),_(t,”class”,”error-message svelte-1wfl3xs”)},m(e,n){y(e,t,n),h(t,r)},p(e,t){128&t&&w(r,e[7])},d(e){e&&g(t)}}}function fd(t){let r,n,a,s,c,l,u=t[1]&&dd(t),d=t[7]&&md(t);return{c(){r=P(“div”),u&&u.c(),n=S(),a=P(“input”),s=S(),d&&d.c(),_(a,”id”,”zephr-form-gift-code”),_(a,”type”,”text”),_(a,”placeholder”,t[2]),a.disabled=t[4],a.required=t[3],a.value=t[0],_(a,”maxlength”,”16″),_(a,”class”,”svelte-1wfl3xs”),$(a,”error”,!!t[7]),_(r,”class”,”zephr-form-input-wrapper svelte-1wfl3xs”)},m(e,o){y(e,r,o),u&&u.m(r,null),h(r,n),h(r,a),h(r,s),d&&d.m(r,null),c||(l=[v(a,”input”,t[8]),v(a,”focus”,(function(){i(t[5])&&t[5].apply(this,arguments)})),v(a,”blur”,(function(){i(t[6])&&t[6].apply(this,arguments)}))],c=!0)},p(e,[o]){(t=e)[1]?u?u.p(t,o):(u=dd(t),u.c(),u.m(r,n)):u&&(u.d(1),u=null),4&o&&_(a,”placeholder”,t[2]),16&o&&(a.disabled=t[4]),8&o&&(a.required=t[3]),1&o&&a.value!==t[0]&&(a.value=t[0]),128&o&&$(a,”error”,!!t[7]),t[7]?d?d.p(t,o):(d=md(t),d.c(),d.m(r,null)):d&&(d.d(1),d=null)},i:e,o:e,d(e){e&&g(r),u&&u.d(),d&&d.d(),c=!1,o(l)}}}function hd(e,t,r){let n,{value:o=””}=t,{label:i=””}=t,{placeholder:a=””}=t,{required:s=!1}=t,{disabled:c=!1}=t,{hasError:l=!1}=t,{error:u=!1}=t,{onChange:d=(e=>{})}=t,{onFocus:p=(()=>{})}=t,{onBlur:m=(()=>{})}=t;return e.$$set=e=>{“value”in e&&r(0,o=e.value),”label”in e&&r(1,i=e.label),”placeholder”in e&&r(2,a=e.placeholder),”required”in e&&r(3,s=e.required),”disabled”in e&&r(4,c=e.disabled),”hasError”in e&&r(9,l=e.hasError),”error”in e&&r(10,u=e.error),”onChange”in e&&r(11,d=e.onChange),”onFocus”in e&&r(5,p=e.onFocus),”onBlur”in e&&r(6,m=e.onBlur)},e.$$.update=()=>{1536&e.$$.dirty&&r(7,n=l||u)},[o,i,a,s,c,p,m,n,e=>{const t=e.target.value;d(t)},l,u,d]}class yd extends de{constructor(e){super(),ue(this,e,hd,fd,a,{value:0,label:1,placeholder:2,required:3,disabled:4,hasError:9,error:10,onChange:11,onFocus:5,onBlur:6})}}const gd={matches:e=>e.type===rt,create:(e,t,r,n)=>{const{disabled:o,label:i,placeholder:a,required:s}=n,c=ct(rt,t),l=t.giftCode||””,u=!(s&&!l||16!==l.length),d=c?Hn(e,c):t.giftCodeError;return{component:yd,props:{hasError:d,label:i,placeholder:a,required:s,disabled:o,onChange:n=>{r.updateFormState({giftCode:n,giftCodeError:void 0}),dt(e,”zephr_form_input_change”,{field:”gift-code”,inputName:`zephr-form-gift-code-${e.uniqueKey}`,sectionId:t.currentSection.type})},onFocus:()=>dt(e,”zephr_form_input_focus”,{field:”gift-code”,inputName:`zephr-form-gift-code-${e.uniqueKey}`,sectionId:t.currentSection.type}),onBlur:()=>dt(e,”zephr_form_input_blur”,{field:”gift-code”,inputName:`zephr-form-gift-code-${e.uniqueKey}`,sectionId:t.currentSection.type}),value:t.giftCode||””},isValid:u}}},bd=[Mt,To,si,ci,li,gi,Ai,Ci,Oi,Wi,Xi,Ca,$a,Ba,os,$s,Vs,Ks,Ys,Ws,tc,sc,lc,Sc,zc,Il,$l,zl,Ul,Hl,Ql,ou,Eu,_u,xu,Bu,qu,Wu,ed,ad,ud,gd];function Pd(e){let r,n,o,i;const a=[e[4](e[2].props,e[0],e[1])];var s=e[2].component;function c(e,r){let n={};for(let e=0;e{ce(e,1)})),ee()}s?(r=L(s,c(e,t)),ae(r.$$.fragment),te(r.$$.fragment,1),se(r,n.parentNode,n)):r=null}else if(s){const n=23&t?oe(a,[ie(e[4](e[2].props,e[0],e[1]))]):{};r.$set(n)}!1===e[2].isValid&&e[0].showFieldErrors?l?(l.p(e,t),5&t&&te(l,1)):(l=Ed(e),l.c(),te(l,1),l.m(o.parentNode,o)):l&&(X(),re(l,1,1,(()=>{l=null})),ee())},i(e){i||(r&&te(r.$$.fragment,e),te(l),i=!0)},o(e){r&&re(r.$$.fragment,e),re(l),i=!1},d(e){e&&(g(n),g(o)),r&&ce(r,e),l&&l.d(e)}}}function Ed(t){let r,n;return r=new zt({props:{error:”Field is invalid”,isPaymentForm:t[3]}}),{c(){ae(r.$$.fragment)},m(e,t){se(r,e,t),n=!0},p:e,i(e){n||(te(r.$$.fragment,e),n=!0)},o(e){re(r.$$.fragment,e),n=!1},d(e){ce(r,e)}}}function Ad(e){let t,r,n=e[2]&&Pd(e);return{c(){n&&n.c(),t=C()},m(e,o){n&&n.m(e,o),y(e,t,o),r=!0},p(e,[r]){e[2]?n?(n.p(e,r),4&r&&te(n,1)):(n=Pd(e),n.c(),te(n,1),n.m(t.parentNode,t)):n&&(X(),re(n,1,1,(()=>{n=null})),ee())},i(e){r||(te(n),r=!0)},o(e){re(n),r=!1},d(e){e&&g(t),n&&n.d(e)}}}function Sd(e,t,r){let n,{form:o}=t,{formActions:i}=t,a=”PAYMENT”===o.formType,{formState:s}=t,{sectionElement:c}=t;return e.$$set=e=>{“form”in e&&r(5,o=e.form),”formActions”in e&&r(6,i=e.formActions),”formState”in e&&r(0,s=e.formState),”sectionElement”in e&&r(1,c=e.sectionElement)},e.$$.update=()=>{3&e.$$.dirty&&r(2,n=((e,t)=>{if(!1===t.config?.enabled||!0===t.hidden)return null;const r=bd.find((r=>r.matches(t,o,e.currentPart,e.currentSection)));if(!r)throw`Unknown element ${JSON.stringify(t)}`;const n=r.create(o,e,i,t.config);return((e,t,r,n)=>{if(void 0!==e?.isValid){const o={partType:t.currentPart.type,sectionType:t.currentSection.type,sectionOrder:t.currentSection.order,elementType:r.type,elementOrder:r.order,isValid:e.isValid,elementId:r.config?.slug},i=t.elementValidity.find((e=>e.partType===o.partType&&e.sectionType===o.sectionType&&e.sectionOrder===o.sectionOrder&&e.elementType===o.elementType&&e.elementOrder===o.elementOrder));i?.isValid!==o.isValid&&n.updateFormState({elementValidity:[…t.elementValidity.filter((e=>e!=i)),o]})}})(n,e,t,i),n})(s,c))},[s,c,n,a,(e,t,r)=>{const i=ct(r.type,t),a=st[i];if(a){const e={error:at[i],errorMessage:Hn(o,i),success:!1,formSlug:o.id},t=JSON.stringify(e);window?.webkit?.messageHandlers?.messageHandler?.postMessage(t),window?.AndroidFormEventListener?.processFormEvent(t)}return a?{…n.props,error:n.props.error??(a.useDymamicMessage?t.dynamicServerErrorMessage:Hn(o,i))}:e},o,i]}class Cd extends de{constructor(e){super(),ue(this,e,Sd,Ad,a,{form:5,formActions:6,formState:0,sectionElement:1})}}const vd=e=>e.parts.flatMap((e=>e.sections)).flatMap((e=>e.elements)).filter((e=>e.type===Oe)).map((e=>e.config)).reduce(((t,r)=>{const n=e.organisationConfiguration.schemaFields.find((e=>e.slug===r.slug));return n?{…t,[r.slug]:(r.defaultValue||n[“select-options”]?.find((e=>e.default))?.value)??void 0}:{…t}}),{}),Td=()=>{window.Blaize||(window.Blaize={formPreProcessors:{},formPostProcessors:{},registerFormPreProcessor:function(e,t){window.Blaize.formPreProcessors[e]||(window.Blaize.formPreProcessors[e]=[]),”function”==typeof t&&window.Blaize.formPreProcessors[e].push(t)},registerFormPostProcessor:function(e,t){window.Blaize.formPostProcessors[e]||(window.Blaize.formPostProcessors[e]=[]),”function”==typeof t&&window.Blaize.formPostProcessors[e].push(t)},preProcessFormData:function(e,t){if(window.Blaize.formPreProcessors[e]||window.Blaize.formPreProcessors[“*”]){const r=[];window.Blaize.formPreProcessors[“*”]&&window.Blaize.formPreProcessors[“*”].forEach((function(e){r.push(e)})),window.Blaize.formPreProcessors[e]&&window.Blaize.formPreProcessors[e].forEach((function(e){r.push(e)})),r.forEach((function(e){const r=e(t);null!=r&&(t=r)}))}return t},postProcessFormData:function(e,t,r){if(window.Blaize.formPostProcessors[e]||window.Blaize.formPostProcessors[“*”]){const n=[];window.Blaize.formPostProcessors[“*”]&&window.Blaize.formPostProcessors[“*”].forEach((function(e){n.push(e)})),window.Blaize.formPostProcessors[e]&&window.Blaize.formPostProcessors[e].forEach((function(e){n.push(e)})),n.forEach((function(e){e(t,r)}))}}})};function _d(e){let t,r;const n=e[3].default,o=l(n,e,e[2],null);return{c(){t=P(“div”),o&&o.c()},m(n,i){y(n,t,i),o&&o.m(t,null),e[4](t),r=!0},p(e,[t]){o&&o.p&&(!r||4&t)&&p(o,n,e,e[2],r?d(n,e[2],t,null):m(e[2]),null)},i(e){r||(te(o,e),r=!0)},o(e){re(o,e),r=!1},d(r){r&&g(t),o&&o.d(r),e[4](null)}}}function Od(e,t,r){let n,o,{$$slots:i={},$$scope:a}=t,{form:s}=t,c=!1;const l=D();return k((()=>(“undefined”!=typeof IntersectionObserver&&(o=new IntersectionObserver((e=>{const t=e[0];c=t?.isIntersecting,l(“observe”,t),c&&s&&(dt(s,”zephr_form_view”,null),o.unobserve(n))}),{threshold:.75}),n&&o.observe(n)),()=>{o&&o.disconnect()}))),e.$$set=e=>{“form”in e&&r(1,s=e.form),”$$scope”in e&&r(2,a=e.$$scope)},[n,s,a,i,function(e){U[e?”unshift”:”push”]((()=>{n=e,r(0,n)}))}]}class Id extends de{constructor(e){super(),ue(this,e,Od,_d,a,{form:1})}}const wd=async e=>{if(!document.cookie?.includes(“blaize_session”))return e.updateFormState({userSession:!1}),!1;let t;try{t=await fr(“blaize/account”,{method:”GET”},e)}catch(e){console.error(e)}if(t?.ok){const r=await t.json();e.updateFormState({userExists:!0,emailIsContact:!1,emailAddress:r.identifiers?.email_address,userSession:!0,loginRegistrationComplete:!0})}else e.updateFormState({userSession:!1});return t?.ok};function Rd(e,t,r){const n=e.slice();return n[21]=t[r],n}function Md(e){let t,r,n,o;t=new Id({props:{form:e[5],$$slots:{default:[xd]},$$scope:{ctx:e}}});let i=e[3]&&Fd(e);return{c(){ae(t.$$.fragment),r=S(),i&&i.c(),n=C()},m(e,a){se(t,e,a),y(e,r,a),i&&i.m(e,a),y(e,n,a),o=!0},p(e,r){const o={};16777221&r&&(o.$$scope={dirty:r,ctx:e}),t.$set(o),e[3]?i?(i.p(e,r),8&r&&te(i,1)):(i=Fd(e),i.c(),te(i,1),i.m(n.parentNode,n)):i&&(X(),re(i,1,1,(()=>{i=null})),ee())},i(e){o||(te(t.$$.fragment,e),te(i),o=!0)},o(e){re(t.$$.fragment,e),re(i),o=!1},d(e){e&&(g(r),g(n)),ce(t,e),i&&i.d(e)}}}function Nd(t){let r,n,o;return n=new rr({}),{c(){r=P(“div”),ae(n.$$.fragment),_(r,”class”,”loading-placeholder svelte-cde0t0″)},m(e,t){y(e,r,t),se(n,r,null),o=!0},p:e,i(e){o||(te(n.$$.fragment,e),o=!0)},o(e){re(n.$$.fragment,e),o=!1},d(e){e&&g(r),ce(n)}}}function $d(t){let r;return{c(){r=P(“div”),r.textContent=`${Hn(t[5],at.UNKNOWN)}`},m(e,t){y(e,r,t)},p:e,i:e,o:e,d(e){e&&g(r)}}}function Ld(e){let t,r;return t=new Cd({props:{form:e[5],formState:e[0],formActions:e[7],sectionElement:e[21]}}),{c(){ae(t.$$.fragment)},m(e,n){se(t,e,n),r=!0},p(e,r){const n={};1&r&&(n.formState=e[0]),1&r&&(n.sectionElement=e[21]),t.$set(n)},i(e){r||(te(t.$$.fragment,e),r=!0)},o(e){re(t.$$.fragment,e),r=!1},d(e){ce(t,e)}}}function xd(e){let t,r,n,o,i=ne(e[5].sectionFlow.extraElements.concat(e[0].currentSection.elements||[])),a=[];for(let t=0;tre(a[e],1,1,(()=>{a[e]=null}));return{c(){t=P(“form”);for(let e=0;e<a.length;e+=1)a[e].c();_(t,"class","zephr-form-content svelte-cde0t0"),$(t,"zephr-payment-options-content",e[2])},m(e,i){y(e,t,i);for(let e=0;e<a.length;e+=1)a[e]&&a[e].m(t,null);r=!0,n||(o=v(t,"submit",kd),n=!0)},p(e,n){if(161&n){let r;for(i=ne(e[5].sectionFlow.extraElements.concat(e[0].currentSection.elements||[])),r=0;r<i.length;r+=1){const o=Rd(e,i,r);a[r]?(a[r].p(o,n),te(a[r],1)):(a[r]=Ld(o),a[r].c(),te(a[r],1),a[r].m(t,null))}for(X(),r=i.length;r<a.length;r+=1)s(r);ee()}(!r||4&n)&&$(t,"zephr-payment-options-content",e[2])},i(e){if(!r){for(let e=0;e<i.length;e+=1)te(a[e]);r=!0}},o(e){a=a.filter(Boolean);for(let e=0;e{m[n]=null})),ee(),a=m[o],a?a.p(e,t):(a=m[o]=p[o](e),a.c()),te(a,1),a.m(r,null)),s&&i(s.update)&&16&t&&s.update.call(null,e[4]),(!c||4&t)&&$(r,”zephr-form-max-width”,!e[2]),(!c||4&t)&&$(r,”zephr-payment-form-max-width”,!e[2])},i(e){c||(te(d),te(a),c=!0)},o(e){re(d),re(a),c=!1},d(e){e&&g(r),d&&d.d(),m[o].d(),l=!1,u()}}}const kd=e=>e?.preventDefault();function Dd(e,t,r){let n,o,i;k(Td);let{formConfiguration:a}=t,s=(e=>({…e,parts:e.parts.sort(((e,t)=>it(e.type).order-it(t.type).order)).map((e=>({…e,sections:e.sections.sort(((e,t)=>e.order-t.order)).map((e=>({…e,elements:e.elements.sort(((e,t)=>e.order-t.order))})))})))}))(a);s.environment.debugLogging&&console.log(s);let c=”PAYMENT”===s.formType,l={},u=!1;const d=s.environment.previewMode&&s.environment.previewInitialState?((e,t)=>{const[r,n]=e.includes(“:”)?e.split(“:”):[null,e];return t.parts.flatMap((e=>e.sections.map((t=>({part:e,section:t}))))).find((e=>e.section.type===n&&(!r||e.part.type===r)))})(s.environment.previewInitialState,s):null;let p=Object.freeze({currentPart:d?.part??s.parts[0],currentSection:d?.section??s.parts[0].sections[0],paymentOption:null,paymentOptionPrices:null,emailAddress:””,createPassword:””,password:””,confirmCreatePassword:””,accountMembershipCode:””,passwordIsValid:!1,elementValidity:[],canAttemptSectionCompletion:!0,showFieldErrors:!1,loginRegistrationComplete:!1,serverErrors:[],isBusy:!1,isBusyByKey:[],formCannotBeActioned:!1,forgotPassword:!1,promoCode:””,addons:[],discountedPlanPrices:[],paymentProviderFormLoaded:!1,paymentProviderError:null,paymentFormComplete:!1,paymentProviderVendorFields:null,verificationCode:””,userAttributes:vd(s),socialSignin:!1,paymentProcessed:!1,invitationEmail:””,invitationSent:!1,validChangeFromPlans:[],taxCalculations:{},billingAddress:{country:null,postalCode:null},formPrerequisiteLoaded:!s.sectionFlow.formRequiresPrerequisiteLoading(s),dynamicOfferResult:null,originalDynamicOfferResult:null,giftCode:new URLSearchParams(window.location.search).get(“giftCode”)||””});const m=e=>(r(0,p=Object.freeze({…p,…e})),s.environment.debugLogging&&console.log(p),s.environment.onStateChanged(e,p),p),f=(e,t)=>{const r=t??”default”;if(void 0===l[r]&&(l[r]=0),l[r]+=e,l[r]e>0));n!==p.isBusy&&m({isBusy:n});const o=l[r]>0;o!==p.isBusyByKey[r]&&m({isBusyByKey:{…p.isBusyByKey,[r]:o}})},h={updateFormState:m,attemptCompleteSection:()=>{((e,t,r)=>{if(r.getFormState().canAttemptSectionCompletion){const t=r.updateFormState({showFieldErrors:!1});return Pt(e,t,r)}r.updateFormState({showFieldErrors:!0}),Promise.resolve()})(s,0,h)},completeSection:()=>{Pt(s,p,h)},jumpToPartStart:e=>{mt(e,s,h)},jumpToSection:e=>{pt(e,s,h)},onEvent:e=>{s.environment.previewMode||s.sectionFlow.eventHandlers[e]?.(s,p,h)},incrementRequestCount:(e=null)=>f(1,e),decrementRequestCount:(e=null)=>f(-1,e),getFormState:()=>p,apiUrlBase:s.environment.apiUrlBase};s.environment.previewMode&&s.environment.previewBundle?.setupPreviewMode(s,h),k((async()=>{“GIFT_REDEMPTION”===s.formType&&(await wd(h),r(1,u=!0)),h.onEvent(nt.FORM_START),dt(s,”zephr_form_render”,null)}));let y=!1;const g=s.sectionFlow.canDismissFormManually(s);return e.$$set=e=>{“formConfiguration”in e&&r(10,a=e.formConfiguration)},e.$$.update=()=>{if(1&e.$$.dirty){const e=s.sectionFlow.canAttemptSectionCompletion(s,p);e!=p.canAttemptSectionCompletion&&m({canAttemptSectionCompletion:e})}2049&e.$$.dirty&&r(4,n=!y&&p.formPrerequisiteLoaded&&!p.formCannotBeActioned),1&e.$$.dirty&&r(3,o=p.serverErrors[0]&&0===(p.currentSection.elements||[]).filter((e=>ct(e.type,p))).length?p.serverErrors[0]:null),1&e.$$.dirty&&r(2,i=[…Object.values(lt)].find((e=>e.type===p.currentSection.type))?.fullWidth)},[p,u,i,o,n,s,c,h,()=>r(11,y=!0),g,a,y]}class Bd extends de{constructor(e){super(),ue(this,e,Dd,zd,a,{formConfiguration:10})}}const Ud={“–zephr-button-borderRadius”:”9″,”–zephr-button-borderWidth”:”0″,”–zephr-button-fontSize”:”16″,”–zephr-button-fontWeight”:”normal”,”–zephr-button-height”:”50″,”–zephr-color-accent-main”:”#dcf1fb”,”–zephr-color-accent-tinted”:”#81cdf1″,”–zephr-color-action-main”:”#006edb”,”–zephr-color-action-tinted”:”#0f87ff”,”–zephr-color-background-main”:”#fff”,”–zephr-color-background-tinted”:”#ccc”,”–zephr-color-text-main”:”#000″,”–zephr-color-text-tinted”:”#333″,”–zephr-color-warning-main”:”#d90b00″,”–zephr-color-warning-tinted”:”#ff190d”,”–zephr-input-borderColor”:”#333″,”–zephr-input-borderRadius”:”5″,”–zephr-input-borderWidth”:”1″,”–zephr-input-height”:”50″,”–zephr-typography-title-fallbackFont”:”sans-serif”,”–zephr-typography-title-font”:”Roboto”,”–zephr-typography-body-fallbackFont”:”sans-serif”,”–zephr-typography-body-font”:”Roboto”};function Gd(e){switch(e){case wt.CHANGE_SUBSCRIPTION:case wt.PAYMENT:case wt.GIFT_SUBSCRIPTION:return”zephr-payment-form”;case wt.REGISTRATION:case wt.COMPLETE_REGISTRATION:case wt.GIFT_REDEMPTION:return”zephr-registration-form”;case wt.CONTACT:return”zephr-contact-form”;case wt.DATA_CAPTURE:return”zephr-data-capture-form”;default:return””}}const Vd=(e,t,r)=>t.parts.find((t=>t.type===e)).sections.flatMap((e=>e.elements)).filter((e=>e.type===Oe)).map((e=>e.config)).reduce(((e,t)=>r.userAttributes?{…e,[t.slug]:r.userAttributes[t.slug]}:{…e}),{}),qd=(e,t,r)=>401===e?t.indexOf(“verification is required”)>-1?at.EMAIL_VERIFICATION_REQUIRED:t.indexOf(“session must be authenticated”)>-1?at.NO_AUTHENTICATED_SESSION:r.verificationCode?at.VERIFICATION_CODE_OR_PASSWORD_INCORRECT:at.LOGIN_FAILED:402===e&&t?.includes(“this domain is not supported.”)?at.BLOCKED_EMAIL_DOMAIN:409===e?at.USER_ALREADY_EXISTS:400===e&&t?.includes(“The provided password is not strong enough”)?at.PASSWORD_NOT_STRONG_ENOUGH:404===e&&t?.includes(“account”)?at.ACCOUNT_NOT_FOUND:404===e?at.USER_DOES_NOT_EXIST:429===e&&t?.includes(“sessions limit reached”)?at.TOO_MANY_SESSIONS:429===e?at.NO_ACCOUNT_ACCESS:r.socialSignin?at.SOCIAL_SIGNIN_REGISTRATION_LOGIN_ERROR:403===e&&t?.includes(“Contact creation not enabled”)?at.CONTACT_CREATION_NOT_ENABLED:at.UNKNOWN_LOGIN_REGISTER_ERROR,jd=(e,t,r)=>{t.organisationConfiguration.ruleAnalyticsEnabled&&fr(“zephr/public/rule-outcomes/v1/conversions”,{method:”POST”,bodyObject:{conversion:e,ruleId:t.ruleId,outcomeId:t.outcomeId}},r)},Hd=”sharing_id”,Kd=e=>{try{const t=new URL(e);return t.searchParams.has(Hd)?(t.searchParams.delete(Hd),t.href):e}catch{return e}},Yd=(e,t)=>t,Wd=(e,t)=>{const r=Nt(e).autoApplyAttributes??{},n=window.Blaize?.preProcessFormData??Yd,o={…Vd(ot.ACCOUNT_VERIFICATION.type,e,t),…r},i=(()=>{try{const e=new URLSearchParams(window.location.search).get(Hd);return e?{product_sharing_id:e}:null}catch{return null}})();return n(e.id,{identifiers:{email_address:t.emailAddress},validators:{password:t.createPassword||void 0,email_otp:t.verificationCode||void 0,token_exchange:t.socialSigninToken||void 0},attributes:Object.keys(o).length?o:void 0,account_membership_code:t.accountMembershipCode||void 0,…i??{}})},Jd=async(e,t,r)=>{const n=Wd(e,t),o=await fr(“blaize/register”,{method:”POST”,bodyObject:n},r);return Zd(n,o,e,t,r)},Qd=async(e,t,r)=>{const n=(e=>({identifiers:{email_address:e.emailAddress},validators:{password:e.password||void 0,email_otp:e.verificationCode||void 0,token_exchange:e.socialSigninToken||void 0}}))(t),o=await fr(“blaize/login”,{method:”POST”,bodyObject:n},r);return Zd(null,o,e,t,r)},Zd=async(e,t,r,n,o)=>{if(dt(r,e?”zephr_form_register”:”zephr_form_login”,{success:t?.ok}),!t?.ok){n.verificationCode&&o.updateFormState({verificationCodeValid:!1});const e=(await t.json())?.message,i=qd(t.status,e,n);return dt(r,”zephr_form_error”,{error:at[i]}),i===at.PASSWORD_NOT_STRONG_ENOUGH&&o.updateFormState({dynamicServerErrorMessage:e}),o.updateFormState({serverErrors:[i]}),st[i].jumpToPart&&o.jumpToPartStart(st[i].jumpToPart),Promise.resolve()}return n.userExists||((e,t)=>{jd(“REGISTERED”,e,t)})(r,o),t.json().then((async t=>{const i=t.cookie?.includes(“blaize_session”);if(i)document.cookie=t.cookie;else if(!r.sectionFlow.canPartiallyRegister)return console.warn(“No cookie returned from login/register endpoint – most likely incorrect form configuration.”),o.updateFormState({serverErrors:[at.NO_COOKIE_FROM_LOGIN_REGISTER_ERROR]}),Promise.resolve();return e&&window.Blaize?.postProcessFormData&&window.Blaize.postProcessFormData(r.id,e,t),n.verificationCode&&n.currentSection.elements.some((e=>e.type===Ee))&&(o.updateFormState({verificationCodeValid:!0}),await xi(r)),o.updateFormState({loginRegistrationComplete:!0}),o.onEvent(nt.LOGIN_REGISTRATION_COMPLETE)}))},Xd=async(e,t,r,n)=>{const o=Vd(e,t,r);if(0===Object.keys(o).length)return Promise.resolve();const i=await fr(“blaize/profile”,{method:”PATCH”,bodyObject:o},n);if(!i.ok)throw n.updateFormState({serverErrors:[at.INVALID_USER_ATTRIBUTES]}),dt(t,”zephr_form_error”,{error:at[at.INVALID_USER_ATTRIBUTES]}),`Error submitting user attributes ${JSON.stringify(i)}`;return Promise.resolve()};let ep;const tp=new Uint8Array(16);function rp(){if(!ep&&(ep=”undefined”!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ep))throw new Error(“crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported”);return ep(tp)}const np=[];for(let e=0;e<256;++e)np.push((e+256).toString(16).slice(1));var op={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ip(e,t,r){if(op.randomUUID&&!t&&!e)return op.randomUUID();const n=(e=e||{}).random||(e.rng||rp)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;eXd(ot.PAYMENT.type,e,t,r).then((()=>(null==t.mobilePaymentService?so(e.organisationConfiguration.paymentProvider).completer:co(e.organisationConfiguration.paymentProvider).completer)(e,t,r).then((()=>{const n={error:null,errorMessage:””,success:!0,formSlug:e.id},o=JSON.stringify(n);if(window?.webkit?.messageHandlers?.messageHandler?.postMessage(o),window?.AndroidFormEventListener?.processFormEvent(o),((e,t)=>{jd(Nt(e).changeSubscriptionMode?Nt(e).changeSubscriptionConversionName??”CHANGE_SUBSCRIPTION”:”CUSTOMER”,e,t)})(e,r),r.updateFormState({paymentProcessed:!0}),dt(e,”zephr_form_purchase”,{productId:t.paymentOption.productId,planId:t.paymentOption.slug,price:t.paymentOptionPrices?.totalPrice}),dt(e,”purchase”,{ecommerce:{transaction_id:ip(),value:t.paymentOptionPrices?.totalPrice,tax:t.paymentOptionPrices?.taxPrice,currency:Pn(e,t),coupon:t.promoCode,items:[{item_id:t.paymentOption.slug,item_name:t.paymentOption.productId,price:t.paymentOptionPrices?.totalPrice,quantity:1}]}}),t.convertCancelSubscriptionToAcceptOffer&&dt(e,”zephr_form_subscription_cancel_accept_offer”,{canceledProductId:t.selectedSubscription.productId,acceptedProductId:t.paymentOption.productId,productLabel:t.paymentOption.label,currency:t.paymentOption.currencyCode,amount:t.paymentOptionPrices?.totalPrice}),r.jumpToPartStart(ot.SUCCESS.type),Nt(e).changeSubscriptionMode){const r=t.validChangeFromPlans.find((e=>t.paymentOption.slug===e.planSlug&&t.paymentOption.productId===e.productId)).changesFromSubscription;dt(e,”zephr_form_subscription_change”,{fromProductId:r.productId,fromProductAmount:r.amount,toProductId:t.paymentOption.productId,toProductAmount:t.paymentOptionPrices.netPriceFormattedString})}})).catch((n=>{const o=null==t.mobilePaymentService?at.PAYMENT_PROCESSING_ERROR:at.MOBILE_PAYMENT_PROCESSING_ERROR;console.error(“Error completing payment”,n),dt(e,”zephr_form_payment_failure”,{reason:n}),r.updateFormState({mobilePaymentService:null,serverErrors:[o]}),dt(e,”zephr_form_error”,{error:at[o]})})))),sp=async(e,t,r)=>{if(!Nt(e).changeSubscriptionMode)return;r.updateFormState({changeSubscriptionProrate:null});const n=so(e.organisationConfiguration.paymentProvider).changeSubscriptionProrateCalculator;if(!n)return;const o=await n(e,t,r);r.updateFormState({changeSubscriptionProrate:o})},cp=e=>new URL(e).searchParams.get(“subscription”),lp=(e,t)=>0===e.length?[]:Nt(t).paymentOptions.map((r=>{const n=(Nt(t).changeSubscriptionPlanMappings??[]).find((e=>e.toPlan.planSlug===r.slug&&e.toPlan.productId===r.productId));if(!n)return;const o=e.filter((e=>!(e.planId===r.slug&&e.productId===r.productId)&&(n.fromAnyPlan||n.fromPlans.some((t=>t.planSlug===e.planId&&t.productId===e.productId)))));return 0!==o.length?(o.length>1&&console.log(“Found multiple valid subscriptions to move to payment option, selecting the first”,r),{planSlug:r.slug,productId:r.productId,changesFromSubscription:e[0]}):void 0})).filter(Boolean),up=async(e,t,r,n,o)=>{const i=so(e.organisationConfiguration.paymentProvider).existingSubscriptionLoader;if(!i)return console.error(`Existing subscription loader not configured for ${e.organisationConfiguration.paymentProvider}`),void r.updateFormState({formCannotBeActioned:!0});let a;try{a=await i(e,t,r,!0)}catch(e){return console.error(“Unable to load subscriptions”,e),void r.updateFormState({formCannotBeActioned:!0})}const s=cp(window.location.href);if(s){const t=a.filter((e=>e.externalId===s));t.length&&lp(t,e).length&&(a=t)}if(n)return void dp(a,t,r);const c=lp(a,e),l=Nt(e).subscriptionSelectionMode;return 0===a.length?console.warn(“Not showing form as user has no active subscriptions”):0===c.length&&!l&&o&&console.warn(“Not showing form as no payment options can be actioned with the user’s current subscriptions”),l&&(a=a.map((t=>(Nt(e).changeSubscriptionPlanMappings.some((e=>e.fromAnyPlan||e.fromPlans.some((e=>e.planSlug===t.planId&&e.productId===t.productId))))?t.cannotBeChanged=!1:t.cannotBeChanged=!0,t)))),r.updateFormState({existingSubscriptions:a,formCannotBeActioned:0===c.length&&!l&&o,validChangeFromPlans:c,formPrerequisiteLoaded:!0}),a},dp=(e,t,r)=>{if(0===e.length)return console.log(“No subscriptions available.”),void r.updateFormState({existingSubscriptions:[],formCannotBeActioned:!0,validChangeFromPlans:[],formPrerequisiteLoaded:!0});const n=t.dynamicOfferResult;n||console.log(“No dynamic offer result available.”);const o=n?.products?.flatMap((t=>t.paymentPlans.filter((r=>{const n=e.some((e=>e.planId===r.planId&&e.productId===t.id)),o=e.every((e=>r.charges.every((t=>t.prices?.some((t=>t.currency===e.currency))))));return!n&&o})).map((r=>({planSlug:r.planId,productId:t.id,changesFromSubscription:e.find((e=>r.charges.every((t=>t.prices?.some((t=>t.currency===e.currency))))))}))).filter((e=>!!e.changesFromSubscription))))??[];r.updateFormState({existingSubscriptions:e,formCannotBeActioned:0===o.length,validChangeFromPlans:o,formPrerequisiteLoaded:!0})};let pp;const mp=new Promise((function(e){pp=e})),fp={[nt.FORM_START]:async(e,t,r)=>{const n=!!Nt(e).dynamicOffer?.id||!!Nt(e).dynamicOfferPreview;return n&&await(async(e,t)=>{const r=Nt(e).dynamicOffer?.id,n=Nt(e).dynamicOfferPreview;if(e.environment.previewMode)return void t.updateFormState({dynamicOfferResult:n});let o;try{o=document.cookie.match(/blaize_session=[0-9a-z-]+/)[0].substring(15)}catch{o=null}if(!r)throw Error(“Missing Dynamic Offer id”);const i=await fr(“zephr/public/decisions/v2/dynamic-offers”,{method:”POST”,bodyObject:{dynamic_offer:{slug:r},session:o}},t),a=await i.json();t.updateFormState({dynamicOfferResult:a})})(e,r).catch((e=>{console.error(“Error loading Dynamic Offer”,e)})),wd(r).then((async t=>{if(pp(pp),Nt(e).changeSubscriptionMode){r.updateFormState({formCannotBeActioned:!t}),await up(e,r.getFormState(),r,n,!0);cp(window.location.href)&&1===r.getFormState().existingSubscriptions.length&&r.jumpToPartStart(ot.PLAN_SELECT.type)}}))},[nt.LOGIN_REGISTRATION_COMPLETE]:(e,t,r)=>hn(e,r.getFormState(),r).then((()=>lo(e,r.getFormState(),r))).then((()=>r.jumpToPartStart(ot.PAYMENT.type))),[nt.SECTION_EMAIL_COMPLETE]:Mi,[nt.SECTION_PASSWORD_RESET_COMPLETE]:ki,[nt.SECTION_FORGOT_PASSWORD_COMPLETE]:Fi,[nt.PART_PLAN_SELECT_COMPLETE]:(e,t,r)=>mp.then((async()=>{const n=r.getFormState();if(n.userSession||n.loginRegistrationComplete){const t=await hn(e,n,r);lo(e,t,r),sp(e,t,r),r.jumpToPartStart(ot.PAYMENT.type)}else lo(e,t,r),sp(e,t,r),r.jumpToPartStart(ot.ACCOUNT_VERIFICATION.type)})),[nt.PART_ACCOUNT_VERIFICATION_COMPLETE]:(e,t,r)=>(t.userExists?Qd:Jd)(e,t,r),[nt.PART_PAYMENT_COMPLETE]:ap,[nt.PART_SUCCESS_COMPLETE]:(e,t,r)=>Xd(ot.SUCCESS.type,e,t,r).then((()=>{window.location.reload()})),[nt.SELECT_SUBSCRIPTION_COMPLETE]:(e,t,r)=>{const n=lp([t.selectedSubscription],e);r.updateFormState({existingSubscriptions:[t.selectedSubscription],formCannotBeActioned:0===n.length,validChangeFromPlans:n,formPrerequisiteLoaded:!0}),r.jumpToPartStart(ot.PLAN_SELECT.type)}},hp=[{type:lt.EMAIL.type,isDisplayedInProgressBar:!0,isVisible:e=>!Nt(e).changeSubscriptionMode},{type:lt.LOGIN_PASSWORD.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>Nt(e).usePassword&&t.userExists&&!t.socialSignin},{type:lt.PASSWORD_SETUP.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>Nt(e).usePassword&&!t.userExists&&!t.socialSignin},{type:lt.SUCCESS.type,isDisplayedInProgressBar:!1,isVisible:()=>!0},{type:lt.PASSWORD_RESET.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>Nt(e).usePassword&&t.forgotPassword},{type:lt.FORGOT_PASSWORD.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>Nt(e).usePassword&&t.forgotPassword},{type:lt.VERIFICATION_CODE_LOGIN.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>(t.userExists&&(Nt(e).useVerificationCodes||t.socialSignin))??!1},{type:lt.VERIFICATION_CODE_REGISTRATION.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>(!t.userExists&&(Nt(e).useVerificationCodes||t.emailIsContact))??!1},{type:lt.REGISTRATION_CUSTOM.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>!t.userExists}],yp={extraElements:[{type:Ce,order:-1}],sectionVisibilities:hp,eventHandlers:fp,canAttemptSectionCompletion:(e,t)=>{const r=so(e.organisationConfiguration.paymentProvider);return!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).filter((e=>!(e.elementType===Se&&r.canAttemptIncompletePaymentFormSubmission&&t.paymentProviderFormLoaded))).some((e=>!e.isValid))},canDismissFormManually:e=>Nt(e).changeSubscriptionMode,formRequiresPrerequisiteLoading:e=>Nt(e).changeSubscriptionMode},gp={extraElements:[],eventHandlers:{[nt.LOGIN_REGISTRATION_COMPLETE]:async(e,t,r)=>{const n=Nt(e),o=Ri(e);return t.userExists||!o&&(!e.organisationConfiguration.requireEmailVerfication||n.useVerificationCodes||t.socialSignin)?(n.showSuccessOnFormCompletion&&!t.userExists?await pt(lt.SUCCESS.type,e,r):(window.location.href=Kd(window.location.href),window.flowpoint&&window.flowpoint.track(“Registration/Login Form Submitted”)),Promise.resolve()):(await wi(e,”register”,t.emailAddress,r),await pt(lt.EMAIL_VERIFIED.type,e,r),Promise.resolve())},[nt.SECTION_EMAIL_COMPLETE]:Mi,[nt.SECTION_PASSWORD_RESET_COMPLETE]:ki,[nt.SECTION_FORGOT_PASSWORD_COMPLETE]:Fi,[nt.PART_ACCOUNT_VERIFICATION_COMPLETE]:(e,t,r)=>(t.userExists?Qd:Jd)(e,t,r),[nt.PART_SUCCESS_COMPLETE]:()=>(window.location.href=Kd(window.location.href),window.flowpoint&&window.flowpoint.track(“Registration/Login Form Submitted”),Promise.resolve())},sectionVisibilities:[{type:lt.EMAIL.type,isDisplayedInProgressBar:!0,isVisible:()=>!0},{type:lt.LOGIN_PASSWORD.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>Nt(e).usePassword&&t.userExists&&!t.socialSignin},{type:lt.PASSWORD_SETUP.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>Nt(e).usePassword&&!t.userExists&&!t.socialSignin},{type:lt.PASSWORD_RESET.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>Nt(e).usePassword&&t.forgotPassword},{type:lt.FORGOT_PASSWORD.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>Nt(e).usePassword&&t.forgotPassword},{type:lt.VERIFICATION_CODE_LOGIN.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>(t.userExists&&(Nt(e).useVerificationCodes||t.socialSignin))??!1},{type:lt.VERIFICATION_CODE_REGISTRATION.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>(!t.userExists&&(Nt(e).useVerificationCodes||t.emailIsContact))??!1},{type:lt.REGISTRATION_CUSTOM.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>!t.userExists},{type:lt.SUCCESS.type,isDisplayedInProgressBar:!1,isVisible:()=>!0},{type:lt.EMAIL_VERIFIED.type,isDisplayedInProgressBar:!1,isVisible:e=>e.organisationConfiguration.requireEmailVerfication&&!Nt(e).useVerificationCodes},{type:lt.PASSWORDLESS_VIA_LOGIN_LINK.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>t.userExists&&Ri(e)}],canAttemptSectionCompletion:(e,t)=>!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).some((e=>!e.isValid)),canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1,canPartiallyRegister:!0},bp=(e,t)=>t,Pp=async(e,t,r)=>{const n=((e,t)=>{const r=Nt(e).autoApplyAttributes??{},n=window.Blaize?.preProcessFormData??bp,o={…Vd(ot.CONTACT_VERIFICATION.type,e,t),…r};return n(e.id,{identifiers:{email_address:t.emailAddress},attributes:Object.keys(o).length?o:void 0})})(e,t);return(async(e,t,r,n,o)=>{const i=await t.json();if(t?.ok)return jd(“CONTACT”,r,o),window.Blaize?.postProcessFormData&&window.Blaize.postProcessFormData(r.id,e,i),Promise.resolve(!0);const a=qd(t.status,i?.message,n);return o.updateFormState({serverErrors:[a]}),dt(r,”zephr_form_error”,{error:at[a]}),st[a].jumpToPart&&o.jumpToPartStart(st[a].jumpToPart),Promise.resolve(!1)})(n,await fr(“zephr/createContact”,{method:”POST”,bodyObject:n},r),e,t,r)},Ep={extraElements:[],eventHandlers:{[nt.FORM_START]:async(e,t,r)=>{await wd(r)},[nt.PART_CONTACT_VERIFICATION_COMPLETE]:async(e,t,r)=>{const n=Nt(e);try{await Pp(e,t,r),n.showSuccessOnFormCompletion?await mt(ot.SUCCESS.type,e,r):window.location.reload()}catch(t){console.error(t),await pt(lt.EMAIL.type,e,r)}}},sectionVisibilities:[{type:lt.EMAIL.type,isDisplayedInProgressBar:!1,isVisible:()=>!0},{type:lt.REGISTRATION_CUSTOM.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>!t.userExists}],canAttemptSectionCompletion:(e,t)=>!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).some((e=>!e.isValid)),canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1},Ap=(e,t)=>t,Sp=async(e,t,r,n)=>{const o=((e,t,r)=>{const n=window.Blaize?.preProcessFormData??Ap,o=Vd(r,e,t),i=Nt(e).autoApplyAttributes??{};return n(e.id,{…o,…i,…t.createPassword&&{“blaize-validator”:t.createPassword}})})(e,t,n);t.fireCancelationReasonEvent&&r.updateFormState({cancelationReasonAttributes:o});return(async(e,t,r,n,o,i)=>{if(t?.ok){n.formType==wt.UPDATE_PROFILE&&dt(n,”zephr_form_profile_update”,{success:t?.ok,…Object.entries(r).reduce(((e,[t,r])=>({…e,[`attr_${t}`]:r})),{})}),n.formType==wt.DATA_CAPTURE&&(jd(“Data Captured”,n,i),dt(n,”zephr_form_data_capture”,{success:t?.ok,…Object.entries(r).reduce(((e,[t,r])=>({…e,[`attr_${t}`]:r})),{})})),n.formType==wt.COMPLETE_REGISTRATION&&(jd(“Completed Registration”,n,i),dt(n,”zephr_form_complete_registration”,{success:t?.ok,…Object.entries(r).reduce(((e,[t,r])=>({…e,[`attr_${t}`]:r})),{})}));const o=await t.json();return e&&window.Blaize?.postProcessFormData&&window.Blaize.postProcessFormData(n.id,e,o),Promise.resolve(!0)}const a=(await t.json())?.message,s=qd(t.status,a,o);return i.updateFormState({serverErrors:[s]}),dt(n,”zephr_form_error”,{error:at[s]}),Promise.resolve(!1)})(o,await fr(“blaize/profile”,{method:”PATCH”,bodyObject:o},r),Vd(n,e,t),e,t,r)},Cp={extraElements:[],eventHandlers:{[nt.FORM_START]:async(e,t,r)=>{const n=e.parts.map((e=>e.sections)).reduce(((e,t)=>{const r=t.map((e=>e.elements.filter((e=>”user_attribute”==e.type&&e.config.hideIfSet)).map((e=>e.config.slug))));return e.concat(r)}),[]).flat(),o=[];try{const i=await fr(“blaize/profile”,{method:”GET”},r);if(i?.ok){const a=await i.json();Nt(e).autoApplyAttributes&&Object.keys(Nt(e).autoApplyAttributes).forEach((e=>{Object.prototype.hasOwnProperty.call(a,e)&&delete a[e]})),n.forEach((e=>{Object.prototype.hasOwnProperty.call(a,e)&&o.push(e)})),o.length==Object.keys(t.userAttributes).length&&e.formType!=wt.COMPLETE_REGISTRATION?console.warn(“Not showing form as user has no attributes to update”):r.updateFormState({formPrerequisiteLoaded:!0,hideIfSetAttributes:o,userAttributes:{…a}})}}catch(e){console.error(e)}},[nt.PART_PROFILE_UPDATE_COMPLETE]:async(e,t,r)=>{const n=Nt(e);try{await Sp(e,t,r,ot.PROFILE_UPDATE.type).then((async t=>{t&&n.showSuccessOnFormCompletion?await mt(ot.SUCCESS.type,e,r):t&&window.location.reload()}))}catch(e){console.error(e)}}},sectionVisibilities:[],canAttemptSectionCompletion:(e,t)=>!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).some((e=>!e.isValid)),canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!0},vp=async(e,t,r)=>{r.incrementRequestCount();try{await Promise.all([_p(r),Op(r)])}finally{r.decrementRequestCount()}},Tp=async(e,t,r,n)=>{r.updateFormState({emailAddress:null,password:null,createPassword:null,passwordIsValid:null,verificationCode:null,currentPassword:null,serverErrors:[]}),n?await vp(0,0,r):vp(0,0,r),await mt(ot.PROFILE_UPDATE.type,e,r)},_p=async e=>{try{const t=await fr(“blaize/profile”,{method:”GET”},e),r=await t.json();e.updateFormState({readOnlyAttributeValues:r})}catch(e){console.error(“Unable to load user profile”,e)}},Op=async e=>{try{const t=await fr(“blaize/account”,{method:”GET”},e),r=(await t.json())?.identifiers.email_address;e.updateFormState({readOnlyEmail:r})}catch(e){console.error(“Unable to load user email”,e)}},Ip={extraElements:[],eventHandlers:{[nt.FORM_START]:vp,[nt.GO_BACK]:async(e,t,r)=>Tp(e,t,r,!1),[nt.UPDATE]:async(e,t,r)=>{await mt(ot.ATTRIBUTES_UPDATE.type,e,r)},[nt.PART_EMAIL_UPDATE_COMPLETE]:async(e,t,r)=>{const n=await(async(e,t,r)=>{try{const n=!t.password,o={current_identifiers:{email_address:t.readOnlyEmail},new_identifiers:{email_address:t.emailAddress},…n?{}:{validators:{password:t.password}}},i=await fr(n?”blaize/users/update-email”:”zephr/users/update-email”,{method:”POST”,bodyObject:o},r);return dt(e,”zephr_form_email_update_code_sent”,{success:i?.ok}),!!i.ok||(r.updateFormState({serverErrors:[at.UNKNOWN]}),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]}),!1)}catch(t){return r.updateFormState({serverErrors:[at.UNKNOWN]}),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]}),!1}})(e,t,r);n&&await mt(ot.EMAIL_UPDATE_OTP.type,e,r)},[nt.VERIFY_EMAIL_UPDATE_OTP]:async(e,t,r)=>{const n=await(async(e,t,r)=>{r.incrementRequestCount(),r.updateFormState({verificationCodeValid:void 0});const n=await fr(`zephr/users/update-email/${t.verificationCode}`,{method:”POST”,bodyObject:{current_identifiers:{email_address:t.readOnlyEmail}}},r);return dt(e,”zephr_form_password_reset_code_validate”,{success:n?.ok}),n.ok?(await xi(e),r.decrementRequestCount(),!0):(r.updateFormState({serverErrors:[at.VERIFICATION_CODE_INCORRECT]}),dt(e,”zephr_form_error”,{error:at[at.VERIFICATION_CODE_INCORRECT]}),r.decrementRequestCount(),!1)})(e,t,r);n&&await Tp(e,t,r,!0)},[nt.PART_PASSWORD_UPDATE_COMPLETE]:async(e,t,r)=>{const n=await(async(e,t,r)=>{try{const n={current_validators:{password:t.currentPassword},new_validators:{password:t.createPassword}},o=await fr(“zephr/users/change-password”,{method:”POST”,bodyObject:n},r);return dt(e,”zephr_form_password_update_code_sent”,{success:o?.ok}),!!o.ok||(r.updateFormState({serverErrors:[at.UNKNOWN]}),!1)}catch(e){return r.updateFormState({serverErrors:[at.UNKNOWN]}),!1}})(e,t,r);n&&await mt(ot.PASSWORD_UPDATE_OTP.type,e,r)},[nt.VERIFY_PASSWORD_UPDATE_OTP]:async(e,t,r)=>{const n=await(async(e,t,r)=>{r.incrementRequestCount(),r.updateFormState({verificationCodeValid:void 0});const n=await fr(`zephr/users/change-password/${t.verificationCode}`,{method:”GET”},r);return dt(e,”zephr_form_password_update_code_validate”,{success:n?.ok}),n.ok?(await xi(e),r.decrementRequestCount(),!0):(r.updateFormState({serverErrors:[at.VERIFICATION_CODE_INCORRECT]}),dt(e,”zephr_form_error”,{error:at[at.VERIFICATION_CODE_INCORRECT]}),r.decrementRequestCount(),!1)})(e,t,r);n&&await Tp(e,t,r,!0)},[nt.PART_ATTRIBUTES_UPDATE_COMPLETE]:async(e,t,r)=>{await Sp(e,t,r,ot.ATTRIBUTES_UPDATE.type)&&await Tp(e,t,r,!0)}},sectionVisibilities:[],canAttemptSectionCompletion:(e,t)=>!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).some((e=>!e.isValid)),canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1},wp=async(e,t,r,n)=>{const o=so(e.organisationConfiguration.paymentProvider)?.existingSubscriptionLoader;o||console.error(`Existing subscription loader not configured for ${e.organisationConfiguration.paymentProvider}`);const i=o?await o(e,t,r,n):[];return r.updateFormState({existingSubscriptions:i}),i},Rp=async(e,t)=>{const r=t.getFormState();try{(await fr(`zephr/subscriptions/${r.selectedSubscription.externalId}`,{method:”DELETE”},t)).ok?(r.fireCancelationReasonEvent&&dt(e,”zephr_form_subscription_cancel_reason”,{productId:r.selectedSubscription.productId,…Object.entries(r.cancelationReasonAttributes).reduce(((e,[t,r])=>({…e,[`attr_${t}`]:r})),{})}),dt(e,”zephr_form_subscription_cancel”,{productId:r.selectedSubscription.productId,productLabel:r.selectedSubscription.productLabel,currency:r.selectedSubscription.currency,amount:r.selectedSubscription.amount}),e.parts.some((e=>e.type==ot.CANCEL_SUCCESS.type))?t.jumpToPartStart(ot.CANCEL_SUCCESS.type):t.jumpToPartStart(ot.SUCCESS.type)):(t.updateFormState({serverErrors:[at.UNKNOWN]}),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]}))}catch(r){console.error(“Error occurred while cancelling subscription.”,r),t.updateFormState({serverErrors:[at.UNKNOWN]}),dt(e,”zephr_form_error”,{error:at[at.UNKNOWN]})}},Mp={extraElements:[],eventHandlers:{[nt.FORM_START]:async(e,t,r)=>{const n=Nt(e).hasSaveOffer?await up(e,t,r,!1,!1):await wp(e,t,r,!0),o=cp(window.location.href);if(!o)return;const i=n.find((e=>e.externalId===o));i&&(r.updateFormState({selectedSubscription:i,isExternalReferrer:!0}),r.completeSection())},[nt.SELECT_SUBSCRIPTION_COMPLETE]:async(e,t,r)=>{Nt(e).hasCancelReason?(r.updateFormState({fireCancelationReasonEvent:!0,cancelFlowSubscriptionSelectedId:t.selectedSubscription.externalId}),r.jumpToPartStart(ot.ATTRIBUTES_UPDATE.type)):0===t.validChangeFromPlans.length?await Rp(e,r):Nt(e).hasSaveOffer?(r.updateFormState({cancelFlowSubscriptionSelectedId:t.selectedSubscription.externalId}),r.jumpToPartStart(ot.PLAN_SELECT.type)):await Rp(e,r)},[nt.GO_BACK]:async(e,t,r)=>(r.jumpToPartStart(ot.SELECT_SUBSCRIPTION.type),Promise.resolve()),[nt.PART_PLAN_SELECT_COMPLETE]:async(e,t,r)=>{if(t.confirmCancel)await Rp(e,r);else{const t=r.getFormState(),n=await hn(e,t,r);lo(e,n,r),sp(e,n,r),r.updateFormState({convertCancelSubscriptionToAcceptOffer:!0}),r.jumpToPartStart(ot.PAYMENT.type)}},[nt.PART_PAYMENT_COMPLETE]:ap,[nt.PART_ATTRIBUTES_UPDATE_COMPLETE]:async(e,t,r)=>{await Sp(e,t,r,ot.ATTRIBUTES_UPDATE.type)&&(0===t.validChangeFromPlans.length?await Rp(e,r):Nt(e).hasSaveOffer?r.jumpToPartStart(ot.PLAN_SELECT.type):await Rp(e,r))}},sectionVisibilities:[],canAttemptSectionCompletion:()=>!0,canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1},Np={[nt.FORM_START]:async(e,t,r)=>{await wp(e,t,r,!1)},[nt.GO_BACK]:async(e,t,r)=>(r.jumpToPartStart(ot.LIST_SUBSCRIPTIONS.type),Promise.resolve()),[nt.PART_CHANGE_PAYMENT_COMPLETE]:async(e,t,r)=>{const n=so(e.organisationConfiguration.paymentProvider).changePaymentCompleter;await n(e,t,r).then((()=>{r.updateFormState({paymentProviderFormBusy:!1}),r.jumpToPartStart(ot.SUCCESS.type),dt(e,”zephr_form_payment_method_changed”,null)})).catch((n=>{const o=null==t.mobilePaymentService?at.PAYMENT_PROCESSING_ERROR:at.MOBILE_PAYMENT_PROCESSING_ERROR;console.error(“Error completing payment change”,n),r.updateFormState({mobilePaymentService:null,paymentProviderFormBusy:!1,serverErrors:[o]}),dt(e,”zephr_form_error”,{error:at[o]})}))}},$p={extraElements:[{type:Ce,order:-1}],eventHandlers:Np,sectionVisibilities:[],canAttemptSectionCompletion:(e,t)=>!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).some((e=>!e.isValid)),canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1},Lp={extraElements:[],eventHandlers:{[nt.FORM_START]:async(e,t,r)=>{await gu(e,t,r)}},sectionVisibilities:[],canAttemptSectionCompletion:(e,t)=>!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).some((e=>!e.isValid)),canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1},xp={…yp.eventHandlers,[nt.FORM_START]:async(e,t,r)=>{await yp.eventHandlers[nt.FORM_START](e,t,r),r.updateFormState({giftRecipient:{name:””,email:””,recipientAddress:{addressLine1:””,addressLine2:””,city:””,state:””,country:””,postalCode:””},customMessage:””}})},[nt.PART_PLAN_SELECT_COMPLETE]:async(e,t,r)=>(await yp.eventHandlers[nt.PART_PLAN_SELECT_COMPLETE](e,t,r),await pt(“recipient_details”,e,r),null),[nt.PART_GIFT_RECIPIENT_COMPLETE]:async(e,t,r)=>{await pt(“email”,e,r)},[nt.PART_PAYMENT_COMPLETE]:async(e,t,r)=>{try{if(!t.giftRecipient)throw new Error(“Gift recipient information is missing”);return await ap(e,t,r)}catch(t){console.error(“Error in gift subscription payment:”,t);const n=Kn(e,”forms.errors.unknown-payment-error”,”Payment failed”);throw r.updateFormState({dynamicServerErrorMessage:n}),t}}},Fp=[…yp.sectionVisibilities,{type:lt.RECIPIENT_DETAILS.type,isDisplayedInProgressBar:!0,isVisible:()=>!0}],zp={extraElements:yp.extraElements,sectionVisibilities:Fp,eventHandlers:xp,canAttemptSectionCompletion:(e,t)=>!t.elementValidity.filter((e=>e.partType===t.currentPart.type&&e.sectionType===t.currentSection.type&&e.sectionOrder===t.currentSection.order)).some((e=>!e.isValid)),canDismissFormManually:yp.canDismissFormManually,formRequiresPrerequisiteLoading:yp.formRequiresPrerequisiteLoading,canPartiallyRegister:!0},kp={…gp.eventHandlers,[nt.FORM_START]:async(e,t,r)=>{if(t.userSession){const t=e.parts.find((e=>”gift_redemption”===e.type));return void(t&&r.updateFormState({currentPart:t,currentSection:t.sections[0],userSession:!0,loginRegistrationComplete:!0}))}if(await wd(r)){const t=e.parts.find((e=>”gift_redemption”===e.type));t&&r.updateFormState({currentPart:t,currentSection:t.sections[0],userSession:!0,loginRegistrationComplete:!0})}},[nt.GIFT_REDEMPTION_COMPLETE]:async(e,t,r)=>{await(async(e,t,r)=>{const n=t.giftCode;try{if(!n||16!==n.length)return r.updateFormState({giftCodeError:Kn(e,”forms.errors.gift-code-invalid-length”,”Gift code must be 16 characters long”)}),!1;r.incrementRequestCount();const t=await fr(“zephr/public/gifts/v1/redeem”,{method:”POST”,bodyObject:{code:n}},r);return dt(e,”zephr_form_gift_redeem”,{success:t.ok}),t.ok?(r.decrementRequestCount(),await pt(lt.GIFT_REDEEMED.type,e,r),!0):(r.updateFormState({serverErrors:[at.GIFT_CODE_INVALID],giftCodeError:Kn(e,”forms.errors.gift-code-invalid”,”The gift code you entered is invalid”)}),r.decrementRequestCount(),!1)}catch(t){return r.updateFormState({serverErrors:[at.GIFT_CODE_SERVER_ERROR],giftCodeError:Kn(e,”forms.errors.gift-code-server-error”,”An error occurred processing your gift code”)}),r.decrementRequestCount(),!1}})(e,t,r)},[nt.LOGIN_REGISTRATION_COMPLETE]:async(e,t,r)=>(await mt(“gift_redemption”,e,r),Promise.resolve())},Dp=[{type:lt.EMAIL.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>!t.userSession},{type:lt.LOGIN_PASSWORD.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>!t.userSession&&Nt(e).usePassword&&t.userExists&&!t.socialSignin},{type:lt.PASSWORD_SETUP.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>!t.userSession&&Nt(e).usePassword&&!t.userExists&&!t.socialSignin},{type:lt.PASSWORD_RESET.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>!t.userSession&&Nt(e).usePassword&&t.forgotPassword},{type:lt.FORGOT_PASSWORD.type,isDisplayedInProgressBar:!1,isVisible:(e,t)=>!t.userSession&&Nt(e).usePassword&&t.forgotPassword},{type:lt.GIFT_REDEMPTION.type,isDisplayedInProgressBar:!0,isVisible:(e,t)=>t.loginRegistrationComplete||t.userSession},{type:lt.GIFT_REDEEMED.type,isDisplayedInProgressBar:!1,isVisible:()=>!0}],Bp={…gp,eventHandlers:kp,sectionVisibilities:Dp,canAttemptSectionCompletion:(e,t)=>{if(t.currentSection.type===lt.GIFT_REDEMPTION.type){const e=t.elementValidity.find((e=>e.elementType===rt&&e.sectionType===t.currentSection.type));if(e&&!e.isValid)return!1;if(16!==t.giftCode?.length)return!1}return gp.canAttemptSectionCompletion(e,t)},canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1,canPartiallyRegister:!0},Up={[wt.PAYMENT]:yp,[wt.CHANGE_SUBSCRIPTION]:yp,[wt.REGISTRATION]:gp,[wt.CONTACT]:Ep,[wt.DATA_CAPTURE]:Cp,[wt.COMPLETE_REGISTRATION]:Cp,[wt.UPDATE_PROFILE]:Ip,[wt.CANCEL_SUBSCRIPTION]:Mp,[wt.LIST_SUBSCRIPTIONS]:$p,[wt.DEVICES]:Lp,[wt.GIFT_SUBSCRIPTION]:zp,[wt.GIFT_REDEMPTION]:Bp,[wt.EMPTY]:{extraElements:[],sectionVisibilities:[],eventHandlers:{},canAttemptSectionCompletion:()=>!0,canDismissFormManually:()=>!1,formRequiresPrerequisiteLoading:()=>!1}},Gp=Date.parse(“2024-04-19T00:00:00Z”),Vp={“–zf-container-color”:”unset”,”–zf-container-bgColor”:”#fff”,”–zf-container-borderRadius”:”0″,”–zf-input-bgColor”:”#fff”,”–zf-payment-options-border”:”1px solid #000″,”–zf-payment-options-color”:”#000″,”–zf-payment-options-bgColor”:”#fff”,”–zf-payment-summary-border”:”1px solid #000″,”–zf-payment-summary-borderRadius”:”0″,”–zf-payment-summary-color”:”unset”,”–zf-payment-summary-bgColor”:”transparent”},qp=(e,t)=>(t||0)`${e};n${Object.entries(t).map((([e,t])=>`${e}: ${t}`)).join(“;n”)}`)(e,Vp):e;function jp(e){let t,r,n,o;return r=new Bd({props:{formConfiguration:e[2]}}),{c(){t=P(“div”),ae(r.$$.fragment),_(t,”id”,e[2].formId),_(t,”class”,n=f(`zephr-form ${Gd(e[0])}`)+” svelte-jjl1p8″),_(t,”style”,e[1])},m(e,n){y(e,t,n),se(r,t,null),o=!0},p(e,[r]){(!o||1&r&&n!==(n=f(`zephr-form ${Gd(e[0])}`)+” svelte-jjl1p8″))&&_(t,”class”,n)},i(e){o||(te(r.$$.fragment,e),o=!0)},o(e){re(r.$$.fragment,e),o=!1},d(e){e&&g(t),ce(r)}}}function Hp(e,t,r){let{formType:n}=t,{formConfig:o}=t,{formTypeConfig:i}=t,{organisationConfig:a}=t,{environment:s={}}=t;const c={apiUrlBase:””,onStateChanged:()=>{},debugLogging:!1,reduceDelays:!1,previewMode:!1,…s,…o?._spikeApiUrl?{apiUrlBase:o._spikeApiUrl}:{}},l=JSON.parse(a.siteStyles??”{}”),u=qp((e=>{const t={},r=(e,n)=>{null!==e&&”object”==typeof e?Object.entries(e).forEach((([e,t])=>{r(t,n.concat(`${n?”-“:””}${e}`))})):t[`–zephr-${n}`]=e};return r(e,””),Object.entries({…Ud,…t}).map((([e,t])=>`${e}: ${t}`)).join(“;n”)})(l),o.timestamp),d=(e=>{const t=Up[e];if(!t)throw`No flow for form type ${e}`;return t})(n),p=Wn(o.languagePack,o),m=Wn(o.languagePack,i),f=Wn(o.languagePack,a),h=mc(),y=n===wt.PAYMENT,g={environment:c,formType:n,…p,organisationConfiguration:f,typeConfiguration:m,sectionFlow:d,uniqueKey:h,formId:y?”zephr-payment-form-root”:`zephr-form-root-${h}`};return e.$$set=e=>{“formType”in e&&r(0,n=e.formType),”formConfig”in e&&r(3,o=e.formConfig),”formTypeConfig”in e&&r(4,i=e.formTypeConfig),”organisationConfig”in e&&r(5,a=e.organisationConfig),”environment”in e&&r(6,s=e.environment)},[n,u,g,o,i,a,s]}class Kp extends de{constructor(e){super(),ue(this,e,Hp,jp,a,{formType:0,formConfig:3,formTypeConfig:4,organisationConfig:5,environment:6})}}null==window.Zephr&&(window.Zephr={}),window.Zephr.renderForm=(e,t)=>{const r=”string”==typeof e||e instanceof String?document.getElementById(e):e;return new Kp({target:r,props:t})},window.Zephr.translateFormProps=(e,t)=>{if(“main:1″===e)return t;throw`Unknown props version ${e}`}}(); ]]>
<![CDATA[ var element = document.currentScript; while(!(element.classList && element.classList.contains('zephr-form-container'))){ element = element.previousSibling; } window.Zephr.renderForm(element, window.Zephr.translateFormProps("main:1", {"formType":"CONTACT","formConfig":{"parts":[{"type":"contact-verification","sections":[{"type":"email","order":0,"elements":[{"type":"email_address","id":"efcb5ae0-9e76-4191-9b86-b0fb19c234a0","config":{"label":"<>”,”placeholder”:”E-mail”},”order”:0,”hidden”:false},{“type”:”button”,”id”:”017708c9-861a-4d88-b116-afb66e822257″,”config”:{“text”:”Sign up”,”isSubmit”:true},”order”:1,”hidden”:false},{“type”:”text”,”order”:2,”id”:”1ae31156-ce69-4aa4-a73b-d7eaa152cdd0″,”config”:{“text”:”
By subscribing, you agree to our Terms & Privacy Policy. You must be 13 or older to sign up.”,”centerText”:true}}]}]},{“type”:”success”,”sections”:[{“type”:”success”,”order”:0,”elements”:[{“type”:”text”,”order”:0,”id”:”e3987e72-3e86-4b69-8f5b-f3eff3fefb66″,”config”:{“text”:”
