PageSourceSearch

https://static-app.fygaro.com/static/50.cb27ea16.js

js fygaro.com collected 2026-10-03 23:25:13 UTC 76,314 bytes, 1 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[50],{74300(e,t,s){s.d(t,{A:()=>Me});var i=s(73620),a=s(64467),r=s(96540),n=s(56347),o=s(63710),c=s(96007),l=s(15192),d=s(28097),_=s(68519),u=s(75404),m=s(55882),v=s(81292),h=s(10661),A=s(44913),p=s(16289),g=s(47650),y=s(76704),f=s(51930),b=s(67210),S=s(55023),N=s(40424),w=s(53412),q=s(29921),k=s(84759),C=s(64167),x=s(41609),E=s(40021),T=s(21083),P=s(78174),R=s(47468),F=s(39200),G=s(64298),M=s(70291),O=s(42994),$=s(83816),I=s(38723),D=s(85512),B=s(902),U=s(55291),L=s(52427),W=s(41801),Q=s(12901),V=s(85636),j=s(2598),J=s(97173);const K=(0,c.Ay)({resolved:{},chunkName:()=>"modals-Modal",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!s.m[t]},importAsync:()=>Promise.resolve().then(s.bind(s,79167)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){const t=this.resolve(e);return s(t)},resolve:()=>79167},{ssr:!1}),z="https://www.fygaro.com",H=e=>e instanceof l.A?e:null==e||""===e||isNaN(e)?new l.A(0):new l.A(e),Z=e=>H(e).times(100).round(0,Q.i1).div(100),Y=e=>null==e?null:String(e),X=(e,t)=>e?new Set((t||[]).map(Y)):null,ee=(e,t)=>{if(!e)return!0;const s=Y(t);return!!s&&e.has(s)},te=e=>{const t=new Map;return Array.isArray(e)&&e.forEach(e=>{if(e?.external_id){const s=null==e.service_fee?0:e.service_fee;t.set(e.external_id,s)}}),t},se=(e,t)=>{if(!Array.isArray(e)||!t?.size)return e;let s=!1;const i=e.map(e=>{if(!e?.external_id||!t.has(e.external_id))return e;const i=t.get(e.external_id);return e.service_fee===i?e:(s=!0,{...e,service_fee:i})});return s?i:e},ie=e=>{const t=(0,v.GM)(e?.firstname),s=(0,v.GM)(e?.lastname),i=""!==t,a=""!==s;return{first_name:t,last_name:s,is_locked:i&&a,is_invalid:i!==a}},ae=(e,t)=>{if(!t?.is_locked||!e)return!1;const s=(0,v.GM)(e.first_name),i=(0,v.GM)(e.last_name);return!s||!i||((0,v.vO)(s)!==(0,v.vO)(t.first_name)||(0,v.vO)(i)!==(0,v.vO)(t.last_name))};var re=(0,i.A)("br",{}),ne=(0,i.A)("i",{className:"fa fa-minus"}),oe=(0,i.A)("i",{className:"fa fa-plus"}),ce=(0,i.A)("i",{className:"fa fa-minus"}),le=(0,i.A)("i",{className:"fa fa-plus"}),de=(0,i.A)("i",{className:"fa fa-check","aria-hidden":"true"}),_e=(0,i.A)("i",{className:"fa fa-plus-circle"}),ue=(0,i.A)("hr",{}),me=(0,i.A)(M.A,{name:"user_billing_address"}),ve=(0,i.A)("hr",{}),he=(0,i.A)(M.A,{name:"user_shipping_address"}),Ae=(0,i.A)("hr",{}),pe=(0,i.A)("hr",{}),ge=(0,i.A)(C.A,{}),ye=(0,i.A)("br",{}),fe=(0,i.A)("br",{}),be=(0,i.A)("i",{className:"fa fa-check"}),Se=(0,i.A)("br",{}),Ne=(0,i.A)("br",{}),we=(0,i.A)("br",{}),qe=(0,i.A)("br",{}),ke=(0,i.A)(f.A,{}),Ce=(0,i.A)("i",{className:"fa fa-check"}),xe=(0,i.A)("hr",{}),Ee=(0,i.A)("br",{}),Te=(0,i.A)("br",{}),Pe=(0,i.A)(f.A,{}),Re=(0,i.A)("a",{href:z,target:"_blank"},void 0,(0,i.A)("b",{},void 0,"Fygaro"));class Fe extends d.A{constructor(e,t){super(e),(0,a.A)(this,"onResize",e=>{if("undefined"!=typeof window){let t={};const s=window.innerWidth;t.isMobile=s<680,t.isSingleColLayout=s<980,e?this.state={...this.state,...t}:this.setState(t)}}),(0,a.A)(this,"payPalCreateOrder",async()=>{const{bot_shield:e,contextRequest:t}=this.props;if(!(t?.state===_.My.SUCCESS_STATE))return;const{instance:s}=this.state;s.isEvent&&await new Promise((e,t)=>{this.setField("orderTotal",this.getTotal(),()=>{e()})});const i=t.body.payment_button?.external_id,a=this;return new Promise((t,s)=>{e?grecaptcha.ready(function(){grecaptcha.execute("6Leqaz0bAAAAADaOFr3O-JFpyWHc90cTN6cXMZbg",{action:"submit"}).then(function(e){a.setField("bot_shield_token",e,()=>{t((0,L.YM)(i,a.state.instance))})})}):t((0,L.YM)(i,a.state.instance))})}),this.state={...this.state,step:0,missing_required_field:!1,addOnVisibility:{},jwt_name_invalid:!1,wallet_error:null},this.required_fields={step_0:new Set,step_1:new Set,step_2:new Set,step_3:new Set,step_4:new Set,step_billing:new Set,step_shipping:new Set},this.walletPaymentSubmitInFlight=!1,"undefined"!=typeof window&&this.onResize(!0)}componentDidMount(){"undefined"!=typeof window&&window.addEventListener("resize",()=>this.onResize(!1))}static getDerivedStateFromProps(e,t){const s=d.A.getDerivedStateFromProps(e,t);let i=null===s?{}:s;const{validateCouponRequest:a,contextRequest:r}=e;let n,o,c;if(a?.body&&(a.body.subscriber_coupon?(n=a.body.subscriber_coupon,o="subscriber_coupon"):(n=a.body,o="event_coupon")),n&&(c=n.code),t.instance&&t.instance[o]!==c){let e=i.instance?i.instance:{...t.instance};e[o]=c,i.instance=e}const l=r?.state===_.My.SUCCESS_STATE,u=r?.body?.payment_button,m=u?.payment_button_type==B.wJ,v=u?.event;if(l&&m&&v?.pass_through_service_fee&&t.instance){const e=a?.state,s=e===_.My.SUCCESS_STATE,r=null==a;let n=null;if(s&&a.body?.service_fee_context?n=a.body.service_fee_context:(r||e===_.My.ERROR_STATE||s&&!a.body?.service_fee_context)&&(n={event_ticket_categories:v.event_ticket_categories,event_ticket_category_combos:v.event_ticket_category_combos,event_add_ons:v.event_add_ons}),n){const e=i.instance?i.instance:t.instance,s=te(n.event_ticket_categories),a=te(n.event_ticket_category_combos),r=te(n.event_add_ons),o=se(e.event_ticket_categories,s),c=se(e.event_ticket_category_combos,a),l=se(e.event_add_ons,r),d=se(e.event_ticket_add_ons,r);o===e.event_ticket_categories&&c===e.event_ticket_category_combos&&l===e.event_add_ons&&d===e.event_ticket_add_ons||(i.instance={...e,event_ticket_categories:o,event_ticket_category_combos:c,event_add_ons:l,event_ticket_add_ons:d})}}let h=!1;for(const e in i)if(i.hasOwnProperty(e)){h=!0;break}return h?i:null}handleChange(e,t){const{gratuityOption:s}=this.state;if("user_card"===t)e={...e,...(0,E.g)(t,!1)},this.state.errors?.credit_card&&this.setState(e=>{let t={errors:{...e.errors}};return delete t.errors.credit_card,t});else if(this.isPaymentFeatureField(t)){const{selectedGateway:s,selectedSubscriberGateway:i}=this.getPaymentFeatureContext(e),a=(0,O.MK)({fieldName:t,currentValues:e,selectedGateway:s,selectedSubscriberGateway:i,paymentButton:this.getCheckoutPaymentButton(),ecommerceContext:this.getCheckoutEcommerceContext(),total:this.getTotal()});e={...e,...a}}else if("amount"===t)"number"==typeof s&&s>0&&(""===e.amount||null===e.amount||void 0===e.amount||isNaN(e.amount)?e.gratuity_amount=void 0:e.gratuity_amount=new l.A(s).div(100).times(e.amount).toFixed(2));else if("gratuity_amount"==t&&e.gratuity_amount.includes(".")){const[t,s]=e.gratuity_amount.split(".");s.length>2&&(e.gratuity_amount=t+"."+s.slice(0,2))}"wallet_payment"!==t&&e?.wallet_payment&&(e={...e,wallet_payment:void 0});const i="wallet_payment"!==t&&this.state.wallet_error;if(!this.isPaymentFeatureField(t)||!this.hasPaymentFeatureErrors())return i&&this.setState({wallet_error:null}),super.handleChange(e,t);this.setState(t=>({instance:e,errors:this.removePaymentFeatureErrors(t.errors),wallet_error:i?null:t.wallet_error}))}isPaymentFeatureField(e){return O.cp.includes(e)}hasPaymentFeatureErrors(){const{errors:e}=this.state;return O.ck.some(t=>e?.[t])}removePaymentFeatureErrors(e={}){return(0,O.g)(e)}getCheckoutContext(){const{contextRequest:e}=this.props;return e?.state===_.My.SUCCESS_STATE&&e.body||{}}getCheckoutPaymentButton(){return this.getCheckoutContext().payment_button||{}}getCheckoutEcommerceContext(){return this.getCheckoutContext().ecommerce_context||{}}getSubscriberGatewayById(e,t){if(e?.subscriber_gateways)return e.subscriber_gateways.find(e=>e.id==t)}getPaymentFeatureContext(e){const t=this.getGateway(e.gateway);return{selectedGateway:t,selectedSubscriberGateway:this.getSubscriberGatewayById(t,e.subscriber_gateway)}}componentDidUpdate(e,t){const s=e.instance,i=this.props.instance,a=this.props.contextRequest?.state===_.My.SUCCESS_STATE;if(!this.initialInstanceSet&&a){const{jwt:e,decodedJwt:t}=this.props,s=this.props.contextRequest.body,i=s.ecommerce_context,a=s.payment_button;let r={jwt:e},n=!1;const o=new URLSearchParams(location.search);if(a.payment_button_type==B.eO)r.amount=a.amount;else if(a.payment_button_type==B.tV)r.products=a.products.map(e=>{let t={...e,quantity:1};if(e.product_versions){let s,i;for(let t=0;t<e.product_versions.length;t++){const a=e.product_versions[t];if(a.is_default){s=a,i=t;break}}void 0===s&&(s=e.product_versions[0],i=0),t.product_version=i;for(const e of s.product_options){t[this.getProductOptionKey(e.product_option_type.external_id)]=e.id}}return t});else if(a.payment_button_type==B.wJ){const e=a.event;if(r.isEvent=!0,e?.event_ticket_categories){const s=e.event_occurrences;r.event_ticket_categories=e.event_ticket_categories.map(e=>{let i={...e,quantity:0,event_occurrence:s[e.event_occurrence_i]};return e.is_public||(i.hide=!0),void 0!==t?.ticket_categories&&(t.ticket_categories.includes(e.external_id)||(i.hide=!0)),i})}else r.event_ticket_categories=[];r.event_ticket_category_combos=e?.event_ticket_category_combos?e.event_ticket_category_combos.map(e=>{let s={...e,quantity:0};return void 0!==t?.ticket_combos&&(t.ticket_combos.includes(e.external_id)||(s.hide=!0)),s}):[],e?.event_add_ons&&(r.event_add_ons=e.event_add_ons.map(e=>({...e,totalQuantity:0})))}else{if(t&&t.amount)r.amount=t.amount,n=!0;else if(a.payment_button_type==B.Ss){const e=o.get("amount");e&&!isNaN(e)&&(r.amount=e)}r.amount&&(r.amount=parseFloat(r.amount).toFixed(2))}if(t&&t.custom_reference)r.custom_reference=t.custom_reference;else{const e=o.get("custom_reference");null!==e&&""!==e&&(r.custom_reference=e)}const c=o.get("client_note");null!==c&&""!==c&&a.allow_client_note&&(r.client_note=c);const l=ie(t),d=(e=>{const t=(0,v.GM)(e.get("firstname")),s=(0,v.GM)(e.get("lastname"));if(t&&s)return{first_name:t,last_name:s}})(o);let _,u;l.is_locked?(r.first_name=l.first_name,r.last_name=l.last_name):!l.is_invali
1d&&d&&(r.first_name=d.first_name,r.last_name=d.last_name),i.gateways&&(_=this.getDefaultGateway(i),u=this.getDefaultSubscriberGateway(_)),_&&(r.gateway=_.id),u&&(r.subscriber_gateway=u.id),this.setState({instance:r,jwt_lock_amount:n,jwt_name_invalid:l.is_invalid},()=>{const e=(0,O.ZM)({selectedGateway:_,selectedSubscriberGateway:u,paymentButton:a,ecommerceContext:i,total:this.getTotal(),currentValues:this.state.instance});Object.keys(e).some(t=>this.state.instance[t]!==e[t])&&this.setState(t=>({instance:{...t.instance,...e}}))}),this.initialInstanceSet=!0}!t.instance.external_reference&&i?.external_reference&&this.setState({instance:{...t.instance,external_reference:i.external_reference}});const r=e.saveState===_.My.PENDING_STATE,n=this.props.saveState===_.My.SUCCESS_STATE,o=this.props.saveState===_.My.ERROR_STATE;if(i&&!s.preflight_required&&i.preflight_required&&this.setState({instance:{...t.instance,...i}}),r&&o){t.instance?.wallet_payment||this.state.instance?.wallet_payment?this.failDigitalWalletPayment():this.resolveWalletPaymentCompletion(!1);const{errors:e}=this.props;e.client?this.goToStep(1):e.billing_address&&this.goToStep(2)}r&&n&&(this.resolveWalletPaymentCompletion(!0),(this.state.instance?.wallet_payment||this.state.wallet_error)&&this.setState(e=>({instance:e.instance?.wallet_payment?(0,F.yM)(e.instance):e.instance,wallet_error:null})))}registerRequired(e,t,s){if(void 0!==t&&""!==t){const i="step_"+e;s?this.required_fields[i].delete(t):this.required_fields[i].add(t)}}registerRequiredStep0(e,t){this.registerRequired("0",e,t)}registerRequiredStep1(e,t){this.registerRequired("1",e,t)}registerRequiredStep2(e,t){this.registerRequired("2",e,t)}registerRequiredStep3(e,t){this.registerRequired("3",e,t)}registerRequiredStep4(e,t){this.registerRequired("4",e,t)}registerRequiredBillingAddress(e,t){this.registerRequired("billing",e,t)}registerRequiredShippingAddress(e,t){this.registerRequired("shipping",e,t)}validateStep0(){const{t:e}=this.props,{instance:t}=this.state,{contextRequest:s}=this.props,i=s?.body?.payment_button;let a=!1,r={};if(i?.payment_button_type===B.tV)for(const s of t.products){if(!!!s.product_versions)continue;let t;if(void 0!==s.product_version&&(t=s.product_versions[s.product_version]),!t){a=!0,r.error=e("Please review the selected products and quantities.");break}}else{if(i?.payment_button_type!==B.wJ)return!1;{const t=i.event,s=this.getEventItemQty();s?t.limit_items_per_order!=B.RA&&s>t.limit_items_per_order&&(a=!0,r.error=e("Maximum of {{n}} tickets per order exceeded.",{n:t.limit_items_per_order})):(a=!0,r.error=e("Please select at least one ticket."))}}return!!a&&r}validateStep1(){const{t:e}=this.props,{instance:t,jwt_name_invalid:s}=this.state;let i=!1,a={client:{}};return s&&(i=!0,a.error=e("The checkout link is missing required name fields. Please contact the merchant.")),t.use_wallet||((0,v.GM)(t.first_name)||(i=!0,a.client.first_name=e("Please enter your first name.")),(0,v.GM)(t.last_name)||(i=!0,a.client.last_name=e("Please enter your last name.")),(0,b.D)(t.email)||(i=!0,a.client.email=e("Please enter a valid email."))),!!i&&a}getUserCardRequireValidation(){const{instance:e}=this.state;if(e.user_card){const t=e.user_card.split("::");if(2===t.length&&"true"===t[1])return!0}return!1}validateAndSubmit(){const{t:e,bot_shield:t}=this.props,{instance:s,jwt_name_invalid:i}=this.state,a=ie(this.props.decodedJwt),r=!!s.wallet_payment;let n=!0;if(i)return this.setState({errors:{error:e("The checkout link is missing required name fields. Please contact the merchant.")}}),!1;const o=this.getRequireBillingAddress();if(o&&!s.user_billing_address&&!s.billing_address)return this.setState({step:2,missing_required_field:!0,errors:{error:e("At least one of the fields from the billing address are missing.")}}),!1;if(this.getRequireShippingAddress()&&(s.is_distinct_shipping||!o)&&!s.user_shipping_address&&!s.shipping_address)return this.setState({step:2,missing_required_field:!0,errors:{error:e("At least one of the fields from the shipping address are missing.")}}),!1;if(s.use_wallet&&ae(s.user,a))return this.setState({errors:{error:e("Your wallet name must match the checkout name. Please update your wallet profile or continue as guest.")}}),!1;const c=this.getSelectedGateway();let l=!1,d=this.getRequireCard(),_=this.getRequirePaymentUsername();if(c&&(l=!0),l&&_&&!r&&(s.payment_username&&s.payment_username.trim()||(n=!1)),l&&d&&!r){let e=this.getUserCardRequireValidation();if(!s.user_card){const e=u.A.expirationDate(s.expiration_date);s.expiration_date&&e.isValid||(n=!1)}if(!s.user_card||e){const e=u.A.number(s.card_number);s.card_number&&e.isValid||(n=!1),s.cvv&&s.cvv.trim().length>=3||(n=!1)}}if(!n)return!1;const m=this.getSelectedSubscriberGateway(c),v=(0,O.UM)({selectedGateway:c,selectedSubscriberGateway:m,paymentButton:this.getCheckoutPaymentButton(),ecommerceContext:this.getCheckoutEcommerceContext(),total:this.getTotal(),currentValues:s}),h={...s,...v},A=(0,O.HU)({t:e,values:h,selectedGateway:c,selectedSubscriberGateway:m,paymentButton:this.getCheckoutPaymentButton(),ecommerceContext:this.getCheckoutEcommerceContext(),total:this.getTotal()});if(A)return this.setState(e=>({errors:{...e.errors,...A}})),!1;const p=()=>
1{if(t){this.setState({show_loader:!0});const t=this,s="undefined"!=typeof grecaptcha?grecaptcha:"undefined"!=typeof window?window.grecaptcha:void 0,i=()=>{r?t.setState({show_loader:!1},()=>{t.failDigitalWalletPayment()}):(t.setState(t=>({show_loader:!1,errors:{...t.errors||{},error:e("Payment could not be submitted. Please try again.")}})),t.resolveWalletPaymentCompletion(!1))};if(!s)return void i();try{s.ready(function(){s.execute("6Leqaz0bAAAAADaOFr3O-JFpyWHc90cTN6cXMZbg",{action:"submit"}).then(function(e){t.setState({show_loader:!1}),t.setField("bot_shield_token",e,()=>{t.submitForm()})}).catch(i)})}catch(e){i()}}else this.submitForm()};return Object.keys(v).some(e=>s[e]!==v[e])?this.setState(e=>({instance:{...e.instance,...v}}),p):p(),!0}submitForm(){const{instance:e}=this.state;e.isEvent?this.setField("orderTotal",this.getTotal(),()=>{this.handleSubmit(!0)}):this.handleSubmit(!0)}handleDigitalWalletPayment(e,t){this.walletPaymentSubmitInFlight?t?.(!1):(this.walletPaymentSubmitInFlight=!0,this.walletPaymentCompletion=t,this.setState(t=>(0,F.tS)(t,e),()=>{this.validateAndSubmit()||this.failDigitalWalletPayment()}))}failDigitalWalletPayment(e){const t=(0,F.$R)(this.props.t,e);this.setState(e=>(0,F.bu)(e,t)),this.resolveWalletPaymentCompletion(!1)}resolveWalletPaymentCompletion(e){if(this.walletPaymentSubmitInFlight=!1,"function"!=typeof this.walletPaymentCompletion)return;const t=this.walletPaymentCompletion;this.walletPaymentCompletion=void 0,t(!!e)}validateRequiredFields(e,t){let s=!1;return this.required_fields[e].forEach(e=>{if(void 0===t)s=!0;else{const i=t[e];void 0!==i&&""!==i&&null!==i||(s=!0)}}),s}goToStep(e){this.setState({step:e}),window.scrollTo(0,0)}nextStep(e){const{contextRequest:t}=this.props,{instance:s,step:i}=this.state;let a=!1,r=i+1;if(t?.state===_.My.SUCCESS_STATE)if(0===i)if(e){const e=this.validateStep0();e?this.setState({missing_required_field:!0,errors:e}):a=!0}else this.setState({missing_required_field:!0});else if(1===i)if(e){const e=this.validateStep1();if(e)this.setState({missing_required_field:!0,errors:e});else{const e=this.getRequireBillingAddress(),t=this.getRequireShippingAddress();e||t||(r+=2),a=!0}}else this.setState({missing_required_field:!0});else if(2===i)if(e){const e=this.getRequireBillingAddress(),t=this.getRequireShippingAddress();if(this.validateRequiredFields("step_billing",s.billing_address))return void this.setState({missing_required_field:!0});if(t&&(s.is_distinct_shipping||!e)){if(this.validateRequiredFields("step_shipping",s.shipping_address))return void this.setState({missing_required_field:!0})}this.getRequireShippingAddress()||(r+=1),a=!0}else this.setState({missing_required_field:!0});else 3===i&&e&&e.courier_service&&(this.setFields(e),a=!0);a&&this.setState({step:r,missing_required_field:!1,errors:{}}),window.scrollTo(0,0)}previousStep(){const{step:e,instance:t}=this.state;let s=e-1;3==s&&(this.getRequireShippingAddress()||(s-=1)),2==s&&(this.getRequireBillingAddress()||this.getRequireShippingAddress()||(s-=1)),1==s&&t.use_wallet&&this.setFields({use_wallet:!1,user:void 0,user_card:void 0,user_card__setDefault:!1,phone:void 0,legal_id:void 0,user_billing_address:void 0,user_billing_address__setDefault:!1,user_shipping_address:void 0,user_shipping_address__setDefault:!1}),this.setState({step:s,missing_required_field:!1}),window.scrollTo(0,0)}setEventOrderItems(){const{t:e,contextRequest:t}=this.props;if(!(t?.state===_.My.SUCCESS_STATE))return;const s=(t.body.payment_button||{}).event,{instance:i}=this.state,a=i.event_add_ons,r=!!a?.length;let n=!1;this.setState(e=>{let t={...e.instance,event_order_items:[],addOnVisibility:{}};const i={};if(r&&a.forEach((e,t)=>{i[t]=new Set}),t.event_ticket_categories)for(const e in t.event_ticket_categories){const s=t.event_ticket_categories[e];let a=0;s.quantity&&(a=parseInt(s.quantity));for(let n=0;n<a;n++){let a={event_ticket_category_i:e};if(0===n&&(a.use_client_data=!0),r&&s.event_add_ons_i)for(const e of s.event_add_ons_i)i[e].add(s.event_occurrence_i);t.event_order_items.push(a)}}if(t.event_ticket_category_combos)for(const e in t.event_ticket_category_combos){const s=t.event_ticket_category_combos[e];let a=0;s.quantity&&(a=parseInt(s.quantity));for(let n=0;n<a;n++){let a={event_ticket_category_combo_i:e};0===n&&(a.use_client_data=!0);for(let e of s.event_ticket_categories_i){const s=t.event_ticket_categories[e];if(r&&s.event_add_ons_i)for(const e of s.event_add_ons_i)i[e].add(s.event_occurrence_i)}t.event_order_items.push(a)}}if(r){let e=[];t.event_add_ons.forEach((t,a)=>{const r=i[a];for(const i of r){const r=s.event_occurrences[i];e.push({...t,quantity:0,event_add_on_i:a,event_occurrence:r,event_occurrence_i:i})}}),e.length>0&&(n=!0,t.event_ticket_add_ons=e)}return{instance:t}},()=>{s.attendee_per_ticket?(this.setState({showEventAttendees:!0}),window.scrollTo(0,0)):n?(this.setState({showEventAddOns:!0}),window.scrollTo(0,0)):this.nextStep(!0)})}setEventAttendees(){const{t:e}=this.props,{instance:t}=this.state;let s={},i=!1;for(const a of t.event_order_items){if(!a.use_client_data){const t=a.event_attendee_name;(null==t||t.trim().split(" ").length<2||!/^[a-zA-Z\s]+$/.test(t))&&(s.error=e("Make sure all tickets have a valid attendee name (name and lastname)"),i=!0)}if(i)break}i?this.setState({errors:s}):t.event_ticket_add_ons?.length?(this.setState({showEventAttendees:!1,showEventAddOns:!0,errors:{}}),window.scrollTo(0,0)):this.nextStep(!0)}getRequireBillingAddress(){const{contextRequest:e}=this.props;let t;if(e?.state===_.My.SUCCESS_STATE){const s=e.body;s.payment_button&&(t=s.payment_button)}let s=!1;return t&&t.require_billing_address&&(s=t.require_billing_address),s}getRequireShippingAddress(){const{contextRequest:e}=this.props,{instance:t}=this.state;if(e?.state===_.My.SUCCESS_STATE){const t=e.body.subscriber;if(!t?.has_shipment_courier)return!1}if(t.products)for(const e of t.products)if(e.is_physical_good&&e.weight)return!0;return!1}getRequirePhone(){const{contextRequest:e}=this.props;let t;if(e?.state===_.My.SUCCESS_STATE){const s=e.body;s.payment_button&&(t=s.payment_button)}let s=!1;return t&&t.require_phone&&(s=t.require_phone),s}getRequireLegalId(){const{contextRequest:e}=this.props;let t;if(e?.state===_.My.SUCCESS_STATE){const s=e.body;s.payment_button&&(t=s.payment_button)}let s=!1;return t&&t.require_legal_id&&(s=t.require_legal_id),s}getStepProgress(e){const{t}=this.props,s=this.getRequireBillingAddress(),a=this.getRequireShippingAddress();return(0,i.A)("div",{className:p.A.step_progress},void 0,(0,i.A)("span",{className:0==e?p.A.active:void 0},void 0,t("Start")),(0,i.A)("span",{className:1==e?p.A.active:void 0},void 0,t("Contact")),(s||a)&&(0,i.A)("span",{className:2==e?p.A.active:void 0},void 0,t("Address")),a&&(0,i.A)("span",{className:3==e?p.A.active:void 0},void 0,t("Shipping")),(0,i.A)("span",{className:4==e?p.A.active:void 0},void 0,t("Payment")))}getGlobalErrors(){const{contextRequest:e}=this.props,{errors:t}=this.state;let s=[],a=0;if(void 0!==t&&(void 0!==t.error&&(s.push((0,i.A)("div",{className:p.A.error},a,t.error)),a++),void 0!==t.errors))for(let e=0;e<=t.errors.length;e++)s.push((0,i.A)("div",{className:p.A.error},a,t.errors[e])),a++;if(e?.errorBody){const t=e.errorBody;if(void 0!==t.error&&(s.push((0,i.A)("div",{className:p.A.error},a,t.error)),a++),void 0!==t.errors)for(let e=0;e<=t.errors.length;e++)s.push((0,i.A)("div",{className:p.A.error},e,t.errors[e])),a++}return s}getAmount(){const{instance:e}=this.state;return!e.amount||isNaN(e.amount)?new l.A(0):new l.A(e.amount)}getProductPrice(e){return e.product_versions?void 0!==e.product_version?e.product_versions[e.product_version].price:0:e.price}getProductSubtotal(e){let t=1;e.quantity&&(t=parseInt(e.quantity));const s=this.getProductPrice(e);return new l.A(s).times(t)}getProductAmount(){const{instance:e}=this.state;let t=new l.A(0);if(!e.products)return t;for(const s of e.products)t=t.plus(this.getProductSubtotal(s));return t}getEventAmount(){const{instance:e}=this.state;let t=new l.A(0);if(e.event_order_items)for(const s of e.event_order_items){let i;if(void 0!==s.event_ticket_category_i){const t=e.event_ticket_categories[s.event_ticket_category_i];i=new l.A(t.price)}else{if(void 0===s.event_ticket_category_combo_i){console.error("Invalid Order Item");continue}{const t=e.event_ticket_category_combos[s.event_ticket_category_combo_i];i=new l.A(t.price)}}t=t.plus(i)}if(e.event_ticket_add_ons)for(const s of e.event_ticket_add_ons){if(0===s.quantity)continue;const e=new l.A(s.quantity),i=new l.A(s.price);t=t.plus(i.times(e))}return t}getSubtotal(){const{contextRequest:e}=this.props,t=e?.body?.payment_button,s=t?.payment_button_type;return s===B.tV?this.getProductAmount():s===B.wJ?this.getEventAmount():this.getAmount()}getEventUnitDiscount(e,t,s){const i=H(e),a=(0,W.WM)(t,s,i);return a?t==Q.oU&&a.gt(i)?i:a:new l.A(0)}getEventDiscountTotal(){const{validateCouponRequest:e}=this.props,{instance:t}=this.state,s=e.body;let i=new l.A(0);if(!s)return i;const{discount_type:a,discount_rate:r,valid_for_categories:n,valid_for_combos:o,valid_for_add_ons:c,limit_categories:d,limit_combos:_,limit_add_ons:u,event_ticket_categories:m,event_ticket_category_combos:v,event_add_ons:h}=s,A=X(d,m),p=X(_,v),g=X(u,h),y=e=>{i=i.plus(this.getEventUnitDiscount(e,a,r))};if(t.event_order_items&&(n||o))for(const e of t.event_order_items){if(n&&void 0!==e.event_ticket_category_i){const s=t.event_ticket_categories[e.event_ticket_category_i];ee(A,s?.external_id)&&y(s.price)}if(o&&void 0!==e.event_ticket_category_combo_i){const s=t.event_ticket_category_combos[e.event_ticket_category_combo_i];ee(p,s?.external_id)&&y(s.price)}}if(c&&t.event_ticket_add_ons)for(const e of t.event_ticket_add_ons)if(0!==e.quantity&&ee(g,e?.external_id)){const t=new l.A(e.quantity),s=this.getEventUnitDiscount(e.price,a,r);i=i.plus(s.times(t))}return i}getDiscountTotal(e){const{contextRequest:t,validateCouponRequest:s}=this.props;let i=new l.A(0);const a=s?.state===_.My.SUCCESS_STATE,r=t?.state===_.My.SUCCESS_STATE;if(!a||!r)return i;const n=t?.body?.payment_button,o=n?.payment_button_type;if(o===B.wJ)i=this.getEventDiscountTotal();else{const t=s.body?.subscriber_coupon;t&&(i=(0,W.WM)(t.discount_type,t.discount_rate,e))}return i}getEventFeeSettings(){const{contextRequest:e}=this.props;if(!(e?.state===_.My.SUCCESS_STATE))return{pass_through_service_fee:!1,pass_through_processing_fee:!1,processing_fee_fixed:0,processing_fee_percent:0};const t=e.body?.payment_button?.event;return{pass_through_service_fee:!!t?.pass_through_service_fee,pass_through_processing_fee:!!t?.pass_through_processing_fee,processing_fee_fixed:t?.processing_fee_fixed,processing_fee_percent:t?.processing_fee_percent}}getEventServiceFeeTotal(){const{instance:e}=this.state,{pass_through_service_fee:t}=this.getEventFeeSettings();if(!t)return new l.A(0);let s=new l.A(0);if(e.event_order_items)for(const t of e.event_order_items){let i;if(void 0!==t.event_ticket_category_i){const s=e.event_ticket_categories[t.event_ticket_category_i];i=s?.service_fee}else{if(void 0===t.event_ticket_category_combo_i){console.error("Invalid Order Item");continue}{const s=e.event_ticket_category_combos[t.event_ticket_category_combo_i];i=s?.service_fee}}s=s.plus(H(i))}if(e.event_ticket_add_ons)for(const t of e.event_ticket_add_ons){if(!t.quantity)continue;const e=new l.A(t.quantity);s=s.plus(H(t.service_fee).times(e))}return s}
1getEventTotals(e,t){const s=e||this.getSubtotal(),i=t||this.getDiscountTotal(s);let a=s.minus(i);a.lt(0)&&(a=new l.A(0));const r=this.getEventServiceFeeTotal(),n=a.plus(r),o=this.getEventFeeSettings();let c=new l.A(0),d=n;if(o.pass_through_processing_fee)try{const{grossTotal:e,processingFee:t}=((e,t,s)=>{const i=H(e);if(i.lte(0))return{grossTotal:i,processingFee:new l.A(0)};const a=H(t),r=H(s).div(100);if(r.lte(0)&&a.lte(0))return{grossTotal:i,processingFee:new l.A(0)};if(r.gte(1))throw new Error("processing fee percent must be below 100");const n=Z(i.plus(a).div(new l.A(1).minus(r))),o=Z(n.minus(i));return{grossTotal:n,processingFee:o}})(n,o.processing_fee_fixed,o.processing_fee_percent);c=t||new l.A(0),d=e||n}catch(e){c=new l.A(0),d=n}return{subtotal:s,discountTotal:i,baseTotal:a,serviceFeeTotal:r,totalBeforeProcessing:n,processingFeeTotal:c,totalWithFees:d}}getShippingTotal(){const{instance:e}=this.state;if(e.courier_service)return new l.A(e.courier_service.billing_total_rate)}getTaxTotal(){const{instance:e}=this.state;let t=new l.A(0);if(!e.products)return t;for(const s of e.products){let e=this.getProductSubtotal(s);e=e.minus(this.getDiscountTotal(e));let i=new l.A(0);const a=s.taxes;if(a){let s=!1;if(i=a.reduce((t,i,a)=>(i.subtotal_plus_tax?s=!0:t=t.plus((0,h._)(i.type,i.amount,e)),t),i),s){const t=e.plus(i);i=a.reduce((e,s,i)=>(s.subtotal_plus_tax&&(e=e.plus((0,h._)(s.type,s.amount,t))),e),i)}t=t.plus(i)}}return t}getGratuityAmount(){const{instance:e}=this.state;return!e.gratuity_amount||isNaN(e.gratuity_amount)?new l.A(0):new l.A(e.gratuity_amount)}getTotal(){const{contextRequest:e}=this.props,t=e?.body?.payment_button,s=this.getGratuityAmount();if(t?.payment_button_type===B.wJ)return this.getEventTotals().totalWithFees.plus(s);const i=this.getSubtotal(),a=this.getDiscountTotal(i);let r=i.minus(a);const n=this.getTaxTotal();r=r.plus(n);const o=this.getShippingTotal();return void 0!==o&&(r=r.plus(o)),r=r.plus(s),r}getPaymentTotal(e,t){if(!e)return;const{payment_exchange_rate:s,payment_currency:i}=e;let a;if(void 0!==i&&void 0!==s){const{selling_rate:e,multiply:r}=s;let n;n=r?t.times(new l.A(e)):t.div(new l.A(e)),a=(0,m.N8)(n)+" "+i.alphabetic_code}return a}getGateway(e,t){if(!t){const{contextRequest:e}=this.props;e?.state===_.My.SUCCESS_STATE&&(t=e.body.ecommerce_context)}if(t?.gateways)return t.gateways[e]}getSelectedGateway(){const{instance:e}=this.state;if(e.gateway)return this.getGateway(e.gateway)}getDefaultSubscriberGateway(e){if(!e)return;let t;if(e){const s=e.subscriber_gateways;if(s&&s.length){for(const e of s)e.is_primary&&(t=e);t||(t=s[0])}}return t}getDefaultGateway(e){const t=e?.gateways||{},s=Object.keys(t);if(1===s.length)return this.getGateway(s[0],e);const i=s.find(e=>t[e]?.require_credit_card&&!t[e]?.require_installments&&!t[e]?.frontend_redirect);if(i)return this.getGateway(i,e);const a=s.find(e=>t[e]?.require_credit_card&&!t[e]?.frontend_redirect);return a?this.getGateway(a,e):void 0}setGateway(e){if(!e)return;const t=String(this.state.instance?.gateway)!==String(e);let s=this.getGateway(e);const i=this.getDefaultSubscriberGateway(s);let a={gateway:e,subscriber_gateway:i?.id,wallet_payment:void 0,...t?(0,E.g)():{},...(0,O.ZM)({selectedGateway:s,selectedSubscriberGateway:i,paymentButton:this.getCheckoutPaymentButton(),ecommerceContext:this.getCheckoutEcommerceContext(),total:this.getTotal()})};this.setFields(a)}getSelectedSubscriberGateway(e){const{instance:t}=this.state;if(t.subscriber_gateway&&e)return this.getSubscriberGatewayById(e,t.subscriber_gateway)}getRequireGateway(){const{contextRequest:e}=this.props;if(!(e?.state===_.My.SUCCESS_STATE))return!0;let t;const s=e.body;if(s.payment_button&&(t=s.payment_button),!t)return!0;if(t.payment_button_type==B.wJ){if(!this.getTotal().gt(0))return!1}return!0}getRequireCard(){const{contextRequest:e}=this.props;if(!(e?.state===_.My.SUCCESS_STATE))return!1;let t;const s=e.body;if(s.payment_button&&(t=s.payment_button),!t)return!1;if(t.payment_button_type==B.wJ){if(!this.getTotal().gt(0))return!1}const i=this.getSelectedGateway();if(!i)return!1;let a=!1;return i&&(a=!!i.require_credit_card),a}getRequirePaymentUsername(){const{contextRequest:e}=this.props;if(!(e?.state===_.My.SUCCESS_STATE))return!1;const t=this.getSelectedGateway();return!!t&&!!t.require_payment_username}setPaymentFeatureFields(e){this.setState(t=>({instance:{...t.instance,...e,wallet_payment:void 0},errors:this.removePaymentFeatureErrors(t.errors),wallet_error:null}))}payPalOnCapture(e){e.is_saving?this.setState({paypal_is_saving:!0}):e.success?this.setState((t,s)=>
1({paypal_saved:!0,instance:{...t.instance,external_reference:e.external_reference}})):this.setState({paypal_error:!0})}handlePreflightResponse(e){if(e.is_saving)this.setState({preflight_is_saving:!0});else if(e.success){let t=!1,s=!1;e.challenge_required?t=!0:s=!0,this.setState({preflight_saved:!0,preflight_is_saving:!1,challenge_required:t,iframe_success:s,preflight_response:e})}else this.setState({iframe_error:!0,preflight_is_saving:!1,preflight_response:e})}handleChallengeResponse(e){e.is_saving?this.setState({challenge_is_saving:!0}):e.success?this.setState({challenge_saved:!0,challenge_is_saving:!1,iframe_success:!0,challenge_response:e}):this.setState({iframe_error:!0,challenge_is_saving:!1,challenge_response:e})}openModal(e){void 0!==e&&this.setState({[e]:!0})}closeModal(e){void 0!==e&&this.setState({[e]:!1})}validateCoupon(){const{validateCoupon:e}=this.props,{instance:t}=this.state;e(t.tmp_subscriber_coupon)}getGratuityOptionBtn(e){const{t,contextRequest:s}=this.props,{gratuityOption:a}=this.state,r=s?.body?.payment_button,n=r?.currency?.symbol,o=this.getSubtotal(),c=new l.A(e);let d,_;e>0&&(d=c.div(100).times(o).toFixed(2)),_=0===e?(0,i.A)("span",{className:p.A.gratuity_btn_label},void 0,t("No Tip")):-1===e?(0,i.A)("span",{className:p.A.gratuity_btn_label},void 0,t("Custom")):(0,i.A)("span",{className:p.A.gratuity_btn_percentage},void 0,e,"%");let u=p.A.gratuity_btn;a===e&&(u+=" "+p.A.selected);return(0,i.A)("button",{type:"button",className:u,onClick:()=>{this.setField("gratuity_amount",d),this.setState({gratuityOption:e})}},void 0,_,e>0&&(0,i.A)("span",{className:p.A.gratuity_btn_amount},void 0,n,(0,m.N8)(d)))}getProductOptionKey(e){return"product_option_"+e}updateProductVersion(e,t){if(e.product_option_types&&e.product_versions){let s,i={};for(const t of e.product_option_types){const s=this.getProductOptionKey(t.external_id);i[s]=e[s]}for(let t=0;t<e.product_versions.length;t++){const a=e.product_versions[t];let r=!0;for(const e of a.product_options){if(i[this.getProductOptionKey(e.product_option_type.external_id)]!=e.id){r=!1;break}}if(r){s=t;break}}this.updateScalableField("products",t,{...e,product_version:s})}}getCartItemProductVersions(e,t){const{t:s,contextRequest:a}=this.props,r=a?.body?.payment_button,n=r?.currency?.symbol;if(!!!e.product_versions)return null;const o=e.product_option_types,c=o?.length;if(!c)return null;let l,d;return void 0!==e.product_version&&(l=e.product_versions[e.product_version]),d=1===c&&o[0].product_options?.length<=3?e.product_versions.map((s,a)=>{let r=p.A.cart_item_version_option;return e.product_version==a&&(r+=" "+p.A.selected),(0,i.A)("button",{className:r,onClick:s=>{this.updateScalableField("products",t,{...e,product_version:a})}},a,(0,i.A)("b",{},void 0,s.product_options.map((e,t)=>0==t?e.name:" - "+e.name)),re,(0,i.A)("small",{},void 0,n,(0,m.N8)(s.price)))}):o.map((a,r)=>{let n;a.product_options&&(n=a.product_options.map((e,t)=>(0,i.A)("option",{value:e.id},e.id,e.name)));const o=this.getProductOptionKey(a.external_id);return(0,i.A)("select",{name:o,label:a.name,className:p.A.cart_item_version_select,required:!0,value:e[o],onChange:s=>{const i={...e,[o]:s.target.value};this.updateScalableField("products",t,i),this.updateProductVersion(i,t)}},a.external_id,(0,i.A)("option",{value:"",disabled:!0},-1,s("Select")),n)}),(0,i.A)("div",{className:p.A.cart_item_versions},void 0,(0,i.A)("label",{className:p.A.cart_item_label},void 0,s("Select an Option"),":"),(0,i.A)("div",{className:p.A.cart_item_version_options},void 0,d))}getProductQuantityOptions(e){const t=!!e.product_versions;let s;t&&void 0!==e.product_version&&(s=e.product_versions[e.product_version]);let a=0,r=0;return(!t||!!s)&&(s?r=s.stock:t||(r=e.stock),a=void 0!==r&&r!=B.RA?r:20),Array.from({length:20},(e,t)=>{const s=t+1,r=20===s?`${s}+`:s;return(0,i.A)("option",{value:s,disabled:s>a},s,r)})}getMaxEventItemQty(e){let t=0;if(e){const s=e.available_qty;t=void 0!==s&&s!=B.RA?s:10}return t}getEventItemQty(){const{instance:e}=this.state;let t=0;if(e.event_ticket_categories)for(const s of e.event_ticket_categories){if(!s.quantity)continue;const e=parseInt(s.quantity);e<0&&console.warn("eventTicketCategory quantity is less than 0"),t+=e}if(e.event_ticket_category_combos)for(const s of e.event_ticket_category_combos){
1if(!s.quantity)continue;const e=parseInt(s.quantity);e<0&&console.warn("eventTicketCategoryCombo quantity is less than 0"),t+=e}return t}getEventItemQtyOptions(e,t,s,a){let r=[];for(let n=0;n<t+1;n++)a!==B.RA&&n>e.quantity&&s+(n-e.quantity)>a||r.push((0,i.A)("option",{value:n},n,n));return r}getProductAvailabilityMessage(e){const{t}=this.props,s=!!e.product_versions;let a;s&&void 0!==e.product_version&&(a=e.product_versions[e.product_version]);if(!(!s||!!a)){let s=(0,i.A)("p",{className:p.A.cart_item_error},void 0,t("The selected version is not available at this time."));const a=e.product_option_types,r=a?.length;if(!r)return s;let n=!0;for(let t=0;t<r;t++){const s=a[t],i=e[this.getProductOptionKey(s.external_id)];if(void 0===i||""===i){n=!1;break}}return n?s:null}let r=0;if(a?r=a.stock:s||(r=e.stock),r!=B.RA&&parseInt(e.quantity)>r)return(0,i.A)("p",{className:p.A.cart_item_error},void 0,t("The selected version is currently out of stock."))}getEventCartItem(e,t,s){const{t:a,contextRequest:r}=this.props;if(!(r?.state===_.My.SUCCESS_STATE))return;const n=r.body.payment_button||{},o=n.event,c=n.currency.symbol,l=this.getMaxEventItemQty(e),d=this.getEventItemQty(),u=o.limit_items_per_order;let v=!1;u!=B.RA&&d>=u&&(v=!0);const h=(0,i.A)("span",{className:p.A.select_qty},void 0,(0,i.A)("button",{className:p.A.select_qty_btn,disabled:!e.quantity,onClick:()=>{e.quantity>0&&this.updateScalableField(t,s,{...e,quantity:e.quantity-1})}},void 0,ne),(0,i.A)("select",{name:"quantity",value:e.quantity,onChange:i=>{const a=parseInt(i.target.value);this.updateScalableField(t,s,{...e,quantity:a})}},void 0,this.getEventItemQtyOptions(e,l,d,u)),(0,i.A)("button",{className:p.A.select_qty_btn,disabled:e.quantity>=l||v,onClick:()=>{e.quantity<l&&!v&&this.updateScalableField(t,s,{...e,quantity:e.quantity+1})}},void 0,oe));let A=p.A.event_cart_item;return e.quantity>0&&(A+=" "+p.A.selected),(0,i.A)("li",{className:A},e.external_id,(0,i.A)("div",{className:p.A.event_cart_item_flex_row},void 0,(0,i.A)("div",{className:p.A.col},void 0,(0,i.A)("h3",{className:p.A.event_cart_item_header},void 0,e.name),!!e.description?.length&&(0,i.A)("p",{className:p.A.event_cart_item_text},void 0,e.description),0==e.price?(0,i.A)("h4",{className:p.A.event_cart_item_price},void 0,a("Free")):(0,i.A)("h4",{className:p.A.event_cart_item_price},void 0,c,(0,m.N8)(e.price)),"event_ticket_category_combos"===t&&e.event_occurrences_i?.length&&(0,i.A)("div",{className:p.A.event_cart_item_tag_container},void 0,(0,i.A)("small",{},void 0,a("Included"),":"),(0,i.A)("div",{className:p.A.event_cart_item_tags},void 0,e.event_occurrences_i.map((e,t)=>{const s=o.event_occurrences[e];return(0,i.A)("span",{className:p.A.event_cart_item_tag},e,s.name)})))),(0,i.A)("div",{className:p.A.right_col},void 0,h)))}getEventOrderSummaryItems(){const{t:e,contextRequest:t}=this.props,{instance:s}=this.state;if(!(t?.state===_.My.SUCCESS_STATE))return;const a=t.body.payment_button||{},r=a.event,n=a.currency.symbol;let o=s.event_order_items?.map((t,a)=>{let o,c;if(void 0!==t.event_ticket_category_i)o=s.event_ticket_categories[t.event_ticket_category_i];else{if(void 0===t.event_ticket_category_combo_i)return void console.error("Invalid Order Item");o=s.event_ticket_category_combos[t.event_ticket_category_combo_i]}if(o.event_occurrence)c=o.event_occurrence.name;else if(o.event_occurrences_i)for(const e of o.event_occurrences_i){const t=r.event_occurrences[e];void 0===c?c=t.name:c+=", "+t.name}return(0,i.A)("li",{className:p.A.order_summary_item},a,(0,i.A)("div",{className:p.A.order_summary_item_center},void 0,(0,i.A)("h3",{className:p.A.order_summary_item_header},void 0,o.name),(0,i.A)("h4",{className:p.A.order_summary_item_header2},void 0,c)),(0,i.A)("div",{className:p.A.order_summary_item_right},void 0,(0,i.A)("p",{className:p.A.order_summary_item_value},void 0,0==o.price?(0,i.A)("b",{},void 0,e("Free")):(0,i.A)("b",{},void 0,n,(0,m.N8)(o.price)))))}),c=s.event_order_items?.length||0;if(s.event_ticket_add_ons)for(const t of s.event_ticket_add_ons)t.quantity&&(o.push((0,i.A)("li",{className:p.A.order_summary_item},c,(0,i.A)("div",{className:p.A.order_summary_item_center},void 0,(0,i.A)("h3",{className:p.A.order_summary_item_header},void 0,t.name),(0,i.A)("h4",{className:p.A.order_summary_item_header2},void 0,t.event_occurrence.name)),(0,i.A)("div",{className:p.A.order_summary_item_right},void 0,(0,i.A)("p",{className:p.A.order_summary_item_value},void 0,t.quantity," x  ",0==t.price?(0,i.A)("b",{},void 0,e("Free")):(0,i.A)("b",{},void 0,n,(0,m.N8)(t.price)))))),c+=1);return o}setEventTicketAddOnQty(e,t){const{instance:s}=this.state,i=s.event_ticket_add_ons[e],a=i.event_add_on_i,r=s.event_add_ons[a],n=t-i.quantity;this.updateScalableField("event_ticket_add_ons",e,{...i,quantity:t}),this.updateScalableField("event_add_ons",a,{...r,totalQuantity:r.totalQuantity+n})}getEventAddOnFields(){const{t:e,contextRequest:t}=this.props,{instance:s}=this.state;if(!(t?.state===_.My.SUCCESS_STATE))return;const a=t.body.payment_button||{},r=a.event,n=a.currency.symbol;return r.event_occurrences.reduce((t,a,r)=>{let o=s.event_ticket_add_ons?.reduce((t,a,o)=>
1{if(a.event_occurrence_i!==r)return t;const c=this.getMaxEventItemQty(a),l=a.limit_per_order,d=s.event_add_ons[a.event_add_on_i].totalQuantity;let _=!1;l!=B.RA&&d>=l&&(_=!0);const u=(0,i.A)("span",{className:p.A.select_qty},void 0,(0,i.A)("button",{className:p.A.select_qty_btn,disabled:!a.quantity,onClick:()=>{a.quantity>0&&this.setEventTicketAddOnQty(o,a.quantity-1)}},void 0,ce),(0,i.A)("select",{name:"quantity",value:a.quantity,onChange:e=>{const t=parseInt(e.target.value);this.updateScalableField("event_ticket_add_ons",o,{...a,quantity:t}),this.setEventTicketAddOnQty(o,t)}},void 0,this.getEventItemQtyOptions(a,c,d,l)),(0,i.A)("button",{className:p.A.select_qty_btn,disabled:a.quantity>=c||_,onClick:()=>{a.quantity<c&&!_&&this.setEventTicketAddOnQty(o,a.quantity+1)}},void 0,le));let v=p.A.event_cart_item;return a.quantity>0&&(v+=" "+p.A.selected),t.push((0,i.A)("li",{className:v},o,(0,i.A)("div",{className:p.A.event_cart_item_flex_row},void 0,(0,i.A)("div",{className:p.A.col},void 0,(0,i.A)("h4",{className:p.A.event_cart_item_header},void 0,a.name),!!a.description?.length&&(0,i.A)("p",{className:p.A.event_cart_item_text},void 0,a.description),0==a.price?(0,i.A)("h5",{className:p.A.event_cart_item_price},void 0,e("Free")):(0,i.A)("h5",{className:p.A.event_cart_item_price},void 0,n,(0,m.N8)(a.price))),(0,i.A)("div",{className:p.A.right_col},void 0,u)))),t},[]);return 0===o.length||t.push((0,i.A)("div",{className:p.A.step_content_ticket},r,(0,i.A)("fieldset",{className:p.A.form_group},void 0,(0,i.A)("div",{className:p.A.event_occurrence},void 0,(0,i.A)("h4",{className:p.A.event_occurrence_name},void 0,a.name),o.length>0?(0,i.A)("div",{className:p.A.event_cart},void 0,(0,i.A)("ul",{className:p.A.event_cart_items},void 0,o)):(0,i.A)("p",{style:{marginTop:"16px"}},void 0,e("No add-ons available")))))),t},[])}getPerTicketFields(){const{t:e,contextRequest:t}=this.props,{instance:s}=this.state;if(!(t?.state===_.My.SUCCESS_STATE))return;const a=t.body.payment_button||{};a.event,a.currency.symbol;let n=s.event_ticket_categories?.reduce((t,a,n)=>{if(0==a.quantity)return t;let o=0,c=!0;const l=a.event_occurrence,d=s.event_order_items.reduce((t,s,a)=>(s.event_ticket_category_i!=n||(o+=1,t.push((0,i.A)("div",{className:p.A.event_occurrence_section},a,(0,i.A)(b.A,{values:s,handleChange:e=>{this.updateScalableField("event_order_items",a,{...e})},handleSubmit:this.nextStep.bind(this)},void 0,(0,i.A)("h5",{className:p.A.event_occurrence_section_title},void 0,e("Attendee #{{n}}",{n:o})),c&&r.createElement(r.Fragment,null,(0,i.A)(j.A,{name:"use_client_data",value:!0,label:e("This ticket is for me")}),(0,i.A)(j.A,{name:"use_client_data",value:!1,label:e("This ticket is for someone else")})),(!c||!1===s.use_client_data)&&(0,i.A)(S.A,{name:"event_attendee_name",label:e("Enter their name")})))),c=!1),t),[]);return t.push((0,i.A)("div",{className:p.A.step_content_ticket},`ca:${n}`,(0,i.A)("fieldset",{className:p.A.form_group},void 0,(0,i.A)("div",{className:p.A.event_occurrence},void 0,(0,i.A)("h4",{className:p.A.event_occurrence_name},void 0,a.name," - ",l.name),d)))),t},[])??[];return n=s.event_ticket_category_combos?.reduce((t,a,n)=>{if(0==a.quantity)return t;let o=0,c=!0;const l=s.event_order_items.reduce((t,s,a)=>(s.event_ticket_category_combo_i!=n||(o+=1,t.push((0,i.A)("div",{className:p.A.event_occurrence_section},a,(0,i.A)(b.A,{values:s,handleChange:e=>{this.updateScalableField("event_order_items",a,{...e})},handleSubmit:this.nextStep.bind(this)},void 0,(0,i.A)("h5",{className:p.A.event_occurrence_section_title},void 0,e("Attendee #{{n}}",{n:o})),c&&r.createElement(r.Fragment,null,(0,i.A)(j.A,{name:"use_client_data",value:!0,label:e("This ticket is for me")}),(0,i.A)(j.A,{name:"use_client_data",value:!1,label:e("This ticket is for someone else")})),(!c||!1===s.use_client_data)&&(0,i.A)(S.A,{name:"event_attendee_name",label:e("Enter their name")})))),c=!1),t),[]);return t.push((0,i.A)("div",{className:p.A.step_content_ticket},`co:${n}`,(0,i.A)("fieldset",{className:p.A.form_group},void 0,(0,i.A)("div",{className:p.A.event_occurrence},void 0,(0,i.A)("h4",{className:p.A.event_occurrence_name},void 0,a.name),(0,i.A)("div",{className:p.A.event_occurrence_section},void 0,l))))),t},n)??n,n}render(){const{t:e,company_name:t,jwt:s,contextRequest:a,validateCouponRequest:n,decodedJwt:c}=this.props,d=this.props.instance||{},{instance:u,is_saving:v,saved:h,step:f,missing_required_field:C,show_client_note:M,paypal_saved:Q,paypal_error:H,preflight_is_saving:Z,preflight_saved:Y,preflight_response:X,iframe_error:ee,iframe_success:te,challenge_required:se,challenge_is_saving:re,challenge_response:ne,show_loader:
1oe,errors:ce,jwt_lock_amount:le,gratuityOption:Fe,isMobile:Ge,isSingleColLayout:Me,showSummary:Oe,showEventAddOns:$e,showEventAttendees:Ie,wallet_error:De}=this.state,{match:{params:Be},location:Ue}=this.props,Le=new URLSearchParams(Ue.search),We=Le.get("external_reference"),Qe=Le.get("custom_reference"),Ve=Le.get("success"),je="0"===Ve,Je="1"===Ve,Ke=ie(c),ze=a?.state===_.My.PENDING_STATE,He=a?.state===_.My.SUCCESS_STATE,Ze=a?.state===_.My.ERROR_STATE;let Ye={},Xe={},et={},tt={};if(He){const e=a.body;Ye=e.subscriber||{},Xe=e.payment_button||{},et=Xe.event||{},tt=e.ecommerce_context||{}}const st=t||Ye.company_name||Ye.legal_name||Ye.name,it=n?.state===_.My.PENDING_STATE,at=n?.state===_.My.SUCCESS_STATE;let rt;n?.body&&(rt=n.body.subscriber_coupon?n.body.subscriber_coupon:n.body);const nt=0===f,ot=Xe.payment_button_type==B.Ss,ct=(Xe.payment_button_type,B.eO,Xe.payment_button_type==B.tV),lt=Xe.payment_button_type==B.wJ,dt=!ct&&!lt,_t=this.getSubtotal(),ut=this.getDiscountTotal(_t),mt=this.getTaxTotal(),vt=this.getShippingTotal(),ht=this.getTotal(),At=this.getGratuityAmount(),pt=this.getEventFeeSettings(),gt=lt?this.getEventTotals(_t,ut):null,yt=gt?.serviceFeeTotal||new l.A(0),ft=gt?.processingFeeTotal||new l.A(0),bt=this.getSelectedGateway(),St=this.getSelectedSubscriberGateway(bt),Nt=void 0===Z&&u.success&&u.preflight_required,wt=void 0===re&&se,qt=h&&!u.preflight_required&&!se||Je||Q||te,kt=je||H||ee,Ct=ze||v||re||Z||oe,xt=!!Ze,Et=!(Nt||wt||qt||kt||Ct||xt),Tt=!!Xe.max_successful_payments_reached,Pt=tt&&tt.gateways?tt.gateways:{},Rt=Object.keys(Pt),Ft=this.getRequireBillingAddress(),Gt=this.getRequireShippingAddress(),Mt=this.getRequirePhone(),Ot=this.getRequireLegalId(),$t=this.getRequireCard(),It=this.getRequirePaymentUsername(),Dt=this.getRequireGateway();let Bt,Ut,Lt=!1,Wt=!0;const Qt=Ye.emails&&Ye.emails.length,Vt=Ye.phones&&Ye.phones.length,jt=Qt||Vt;let Jt,Kt=[];const zt=Dt&&Rt.length>1,Ht=bt?.id==B.tL,Zt=bt?.id==B.G9;let Yt,Xt,es,ts="",ss="",is=qt?{...u,...d}:u;if(qt&&X?.success&&(is={...is,...X}),qt&&ne?.success&&(is={...is,...ne}),qt&&(is=(0,F.yM)(is)),qt&&(is.external_reference?Xt=is.external_reference:null!=We&&""!==We&&(Xt=We)),null!=u.custom_reference?es=u.custom_reference:null!=Qe&&""!==Qe&&(es=Qe),Et){let t;if(He&&(void 0!==Xe.currency&&(ts=Xe.currency.alphabetic_code,ss=Xe.currency.symbol,t=this.getPaymentTotal(St,ht)),ot&&!le&&(Wt=!1)),bt&&(Lt=bt.frontend_redirect,bt.subscriber_gateways&&(Jt=bt.subscriber_gateways.map((e,t)=>(0,i.A)("div",{className:p.A.radio_option},e.id,(0,i.A)(j.A,{name:"subscriber_gateway",value:e.id,label:e.name}))))),St&&(Bt=St.gateway_user,Ut=St.payment_currency),zt)for(const e of Rt){const t=Pt[e];let s=p.A.payment_method_choice;String(u.gateway)===String(e)&&(s+=" "+p.A.selected),Kt.push((0,i.A)("button",{type:"button",className:s,onClick:()=>this.setGateway(e),onKeyDown:w.W,role:"radio","aria-checked":String(u.gateway)===String(e)},t.id,(0,i.A)("span",{className:p.A.payment_method_indicator},void 0,de),(0,i.A)("span",{className:p.A.payment_method_title},void 0,t.name)))}let s=!Lt;!bt&&Dt&&(s=!1);let a,n=p.A.actions;if(0===f)if(lt)if(Ie)a=r.createElement(r.Fragment,null,this.getPerTicketFields(),(0,i.A)("div",{className:p.A.step_content},void 0,(0,i.A)("fieldset",{className:`${p.A.form_group} ${p.A.summary}`},void 0,(0,i.A)("div",{className:p.A.summary_errors},void 0,this.getGlobalErrors()),(0,i.A)("div",{className:p.A.actions},void 0,(0,i.A)(q.A,{theme:"success",className:p.A.full_width,iconClassName:"fa fa-chevron-right",iconPosition:"right",iconAlign:"middle",onClick:()=>{this.setEventAttendees()}},void 0,e("Continue")),(0,i.A)(k.A,{theme:"primary_full",onClick:()=>this.setState({showEventAttendees:!1})},void 0,e("Back"))),(0,i.A)("div",{className:p.A.secure_line},void 0,(0,i.A)("i",{className:`fa fa-lock ${p.A.lock_icon}`}),e("Secure checkout")))));else if($e)a=r.createElement(r.Fragment,null,(0,i.A)("div",{className:p.A.event_branding_container},void 0,(0,i.A)("div",{className:p.A.event_branding_content},void 0,(0,i.A)("h1",{},void 0,e("Enhance Your Experience")),(0,i.A)("p",{className:p.A.event_branding_text},void 0,e("Select add-ons to make it unforgettable! (Optional)")))),this.getEventAddOnFields(),(0,i.A)("div",{className:p.A.step_content},void 0,(0,i.A)("fieldset",{className:`${p.A.form_group} ${p.A.summary}`},void 0,(0,i.A)("div",{className:p.A.summary_errors},void 0,this.getGlobalErrors()),(0,i.A)("div",{className:p.A.actions},void 0,(0,i.A)(q.A,{theme:"success",className:p.A.full_width,iconClassName:"fa fa-chevron-right",iconPosition:"right",iconAlign:"middle",onClick:()=>{this.nextStep(!0)}},void 0,e("Continue")),(0,i.A)(k.A,{theme:"primary_full",onClick:()=>{this.setState({showEventAddOns:!1,showEventAttendees:!!et.attendee_per_ticket})}},void 0,e("Back"))),(0,i.A)("div",{className:p.A.secure_line},void 0,(0,i.A)("i",{className:`fa fa-lock ${p.A.lock_icon}`}),e("Secure checkout")))));else{let t=et.event_occurrences.reduce((t,s,a)=>{const r=u.event_ticket_categories?.reduce((e,t,s)=>(t.hide||a!==t.event_occurrence_i||e.push(this.getEventCartItem(t,"event_ticket_categories",s)),e),[]);return r?.length>0&&t.push((0,i.A)("div",{className:p.A.event_occurrence},a,(0,i.A)("h4",{className:p.A.event_occurrence_name},void 0,s.name,(0,i.A)("span",{className:p.A.event_occurrence_date},void 0,(0,i.A)("i",{className:`fa fa-calendar-check-o ${p.A.event_occurrence_icon}`}),s.start_date?s.start_date:e("TBD"),!!s.start_time&&` - ${s.start_time}`)),!!s.description?.length&&(0,i.A)("p",{className:p.A.event_occurrence_description},void 0,s.description),(0,i.A)("div",{className:p.A.event_cart},void 0,(0,i.A)("ul",{className:p.A.event_cart_items},void 0,r)))),t},[]);if(u.event_ticket_category_combos?.length){const s=u.event_ticket_category_combos.reduce((e,t,s)=>(t.hide||e.push(this.getEventCartItem(t,"event_ticket_category_combos",s)),e),[]);s.length>0&&t.push((0,i.A)("div",{className:p.A.event_occurrence},-1,(0,i.A)("h4",{className:p.A.event_occurrence_name},void 0,e("Packages")),(0,i.A)("div",{className:p.A.event_cart},void 0,(0,i.A)("ul",{className:p.A.event_cart_items},void 0,s))))}a=(0,i.A)("div",{className:`${p.A.step_content} ${p.A.step_intro_animation}`},void 0,(0,i.A)("fieldset",{className:`${p.A.form_group} ${p.A.summary}`},void 0,t,(0,i.A)("div",{className:p.A.summary_errors},void 0,this.getGlobalErrors()),(0,i.A)("div",{className:p.A.actions},void 0,(0,i.A)(q.A,{theme:"success",className:p.A.full_width,iconClassName:"fa fa-chevron-right",iconPosition:"right",iconAlign:"middle",onClick:()=>{this.setEventOrderItems()}},void 0,e("Continue"))),(0,i.A)("div",{className:p.A.secure_line},void 0,(0,i.A)("i",{className:`fa fa-lock ${p.A.lock_icon}`}),e("Secure checkout"))))}else a=(0,i.A)("div",{className:`${p.A.step_content} ${p.A.step_intro_animation}`},void 0,(0,i.A)("fieldset",{className:`${p.A.form_group} ${p.A.summary}`},void 0,ct&&(0,i.A)("div",{className:p.A.cart},void 0,(0,i.A)("ul",{className:p.A.cart_items},void 0,u.products?.map((e,t)=>{const s=e.qtyManualEntry?(0,i.A)("span",{className:p.A.select_qty},void 0,"x ",(0,i.A)("input",{type:"number",name:"quantity",value:e.quantity,onChange:s=>{this.updateScalableField("products",t,{...e,quantity:parseInt(s.target.value)})}})):(0,i.A)("span",{className:p.A.select_qty},void 0,"x ",(0,i.A)("select",{name:"quantity",value:e.quantity,onChange:s=>{const i=parseInt(s.target.value);this.updateScalableField("products",t,{...e,quantity:i,qtyManualEntry:i>=20})}},void 0,this.getProductQuantityOptions(e)));let a;return a=e.product_versions?.length&&void 0===e.product_version?" - - - -":(0,m.N8)(this.getProductPrice(e)),(0,i.A)("li",{className:p.A.cart_item},t,(0,i.A)("div",{className:p.A.cart_item_content},void 0,(0,i.A)("div",{className:p.A.cart_item_img},void 0,!!e.photo&&(0,i.A)("img",{src:e.photo.thumbnail})),(0,i.A)("div",{className:p.A.cart_item_content_right_col},void 0,(0,i.A)("div",{className:p.A.cart_item_flex_row},void 0,(0,i.A)("div",{className:p.A.col},void 0,(0,i.A)("h3",{className:p.A.cart_item_header},void 0,e.name),(0,i.A)("h4",{className:p.A.cart_item_price},void 0,ss,a,Ge&&s)),!Ge&&(0,i.A)("div",{className:p.A.col},void 0,s)),!Ge&&!!e.ecommerce_description&&(0,i.A)("div",{className:p.A.cart_item_versions},void 0,(0,i.A)("p",{className:p.A.cart_item_text},void 0,e.ecommerce_description)),this.getCartItemProductVersions(e,t),this.getProductAvailabilityMessage(e))),Ge&&!!e.ecommerce_description&&(0,i.A)("div",{className:p.A.cart_item_description},void 0,(0,i.A)("p",{className:p.A.cart_item_text},void 0,e.ecommerce_description)))}))),(0,i.A)(b.A,{values:u,errors:ce,missing_required_field:C,handleChange:this.handleChange.bind(this),handleSubmit:this.nextStep.bind(this),registerRequired:this.registerRequiredStep0.bind(this),required_fields:this.required_fields.step_0},void 0,dt&&r.createElement(r.Fragment,null,(0,i.A)("div",{className:p.A.amount_row},void 0,(0,i.A)("span",{className:p.A.currency_symbol_span},void 0,ss),(0,i.A)(S.A,{name:"amount",label:e(Wt?"Amount due":"Amount to pay"),type:"number",min:"1",step:".01",disabled:Wt,required:!0,autoComplete:"off"}),(0,i.A)("span",{className:p.A.currency_code_span},void 0,ts))),Xe.allow_gratuity&&(0,i.A)("div",{className:p.A.gratuity},void 0,(0,i.A)("label",{},void 0,e("Add a Tip")),(0,i.A)("div",{className:p.A.gratuity_row},void 0,this.getGratuityOptionBtn(10),this.getGratuityOptionBtn(1
15),this.getGratuityOptionBtn(20)),(0,i.A)("div",{className:p.A.gratuity_row},void 0,this.getGratuityOptionBtn(0),this.getGratuityOptionBtn(-1)),-1===Fe&&(0,i.A)(S.A,{name:"gratuity_amount",className:p.A.animation_slide_up_quick,label:e("Custom Tip Amount"),type:"number",min:"1",step:".01",required:!0})),Xe.allow_client_note&&r.createElement(r.Fragment,null,M||void 0!==u.client_note?(0,i.A)(N.A,{name:"client_note",label:e("Note")}):(0,i.A)("button",{className:p.A.show_hidden_input,onClick:()=>this.setState({show_client_note:!0})},void 0,_e," ",e("Add a Note"))),(0,i.A)("div",{className:p.A.summary_errors},void 0,this.getGlobalErrors()),(!Xe.allow_gratuity||void 0!==Fe)&&r.createElement(r.Fragment,null,(0,i.A)("div",{className:p.A.actions},void 0,(0,i.A)(q.A,{type:"submit",theme:"success",className:p.A.full_width,iconClassName:"fa fa-chevron-right",iconPosition:"right",iconAlign:"middle"},void 0,e("Continue"))),(0,i.A)("div",{className:p.A.secure_line},void 0,(0,i.A)("i",{className:`fa fa-lock ${p.A.lock_icon}`}),e("Secure checkout"))))));const o=(0,i.A)("fieldset",{className:`${p.A.form_group} ${p.A.padded_top}`},void 0,this.getGlobalErrors(),(0,i.A)("h2",{className:p.A.client_step_title},void 0,e("Contact Information")),(0,i.A)(x.A,{requirePhone:Mt,requireLegalId:Ot,handleSubmit:t=>{if(t?.useWallet&&t.user){if(ae(t.user,Ke))return void this.setState({errors:{error:e("Your wallet name must match the checkout name. Please update your wallet profile or continue as guest.")}});let s={use_wallet:!0,user:t.user};if(Mt){if(void 0===t.phone||t.phone.length<6)return void this.setState({errors:{error:e("A valid phone is required. Try to login again or continue as guest.")}});s.phone=t.phone}if(Ot){if(void 0===t.legal_id||t.legal_id.length<5)return void this.setState({errors:{error:e("A valid Legal ID is required. Try to login again or continue as guest.")}});s.legal_id=t.legal_id}this.setFields(s,()=>{this.nextStep(!0)})}}}),(0,i.A)("div",{className:p.A.divider},void 0,ue,(0,i.A)("p",{className:p.A.divider_text},void 0,e("Or continue as guest"))),(0,i.A)(b.A,{values:u,errors:ce.client,missing_required_field:C,handleChange:this.handleChange.bind(this),handleSubmit:this.nextStep.bind(this),registerRequired:this.registerRequiredStep1.bind(this),required_fields:this.required_fields.step_1},void 0,(0,i.A)("div",{className:p.A.two_col},void 0,(0,i.A)(S.A,{name:"first_name",label:e("First Name"),required:!0,autoComplete:"given-name",disabled:Ke.is_locked}),(0,i.A)(S.A,{name:"last_name",label:e("Last Name"),required:!0,autoComplete:"family-name",disabled:Ke.is_locked})),(0,i.A)(S.A,{name:"email",label:e("Email"),required:!0,helpText:e("We'll send your receipt to this email.")}),Mt&&(0,i.A)(S.A,{name:"phone",label:e("Phone"),required:!0}),Ot&&(0,i.A)(S.A,{name:"legal_id",label:e("Legal ID"),required:!0})));let c,l;Ft&&(c=(0,i.A)("fieldset",{className:p.A.form_group},void 0,(0,i.A)("legend",{},void 0,e("Billing Address")),u.use_wallet&&(0,i.A)(b.A,{values:u,errors:ce,missing_required_field:C,handleChange:this.handleChange.bind(this),handleSubmit:this.nextStep.bind(this),registerRequired:this.registerRequiredBillingAddress.bind(this),required_fields:this.required_fields.step_billing},void 0,me),!u.user_billing_address&&r.createElement(r.Fragment,null,u.use_wallet&&(0,i.A)("div",{className:p.A.divider},void 0,ve,(0,i.A)("p",{className:p.A.divider_text},void 0,e("New Address"))),(0,i.A)(g.A,{values:u.billing_address,errors:ce?.billing_address,localCountryID:Ye.country_id,missing_required_field:C,handleChange:e=>this.setFields({billing_address:e}),registerRequired:this.registerRequiredBillingAddress.bind(this),required_fields:this.required_fields.step_billing})))),Gt&&(l=!Ft||u.is_distinct_shipping?(0,i.A)("fieldset",{className:Ft?`${p.A.form_group} ${p.A.margin_top}`:p.A.form_group},void 0,(0,i.A)("legend",{},void 0,e("Shipping Address")),u.use_wallet&&(0,i.A)(b.A,{values:u,errors:ce,missing_required_field:C,handleChange:this.handleChange.bind(this),handleSubmit:this.nextStep.bind(this),registerRequired:this.registerRequiredShippingAddress.bind(this),required_fields:this.required_fields.step_shipping},void 0,he),!u.user_shipping_address&&r.createElement(r.Fragment,null,u.use_wallet&&(0,i.A)("div",{className:p.A.divider},void 0,Ae,(0,i.A)("p",{className:p.A.divider_text},void 0,e("New Address"))),(0,i.A)(g.A,{values:u.shipping_address,errors:ce?.shipping_address,localCountryID:Ye.country_id,missing_required_field:C,handleChange:e=>this.setFields({shipping_address:e}),registerRequired:this.registerRequiredShippingAddress.bind(this),required_fields:this.required_fields.step_shipping}))):(0,i.A)("fieldset",{className:Ft?`${p.A.form_group} ${p.A.margin_top}`:p.A.form_group},void 0,(0,i.A)("legend",{},void 0,e("Shipping Address")),(0,i.A)(b.A,{values:u,errors:ce,handleChange:this.handleChange.bind(this),handleSubmit:this.nextStep.bind(this)},void 0,(0,i.A)(J.A,{name:"is_distinct_shipping",label:e("Use a different shipping address"),value:!0,toggle:!0}))));const d=(0,i.A)("fieldset",{className:p.A.form_group},void 0,(0,i.A)(b.A,{values:u,errors:ce.client,missing_required_field:C,handleChange:this.handleChange.bind(this),handleSubmit:this.nextStep.bind(this),registerRequired:this.registerRequiredStep1.bind(this),required_fields:this.required_fields.step_1},void 0,(0,i.A)("div",{className:p.A.actions},void 0,(0,i.A)(q.A,{type:"submit",theme:"success",iconClassName:"fa fa-chevron-right",iconPosition:"right",iconAlign:"middle"},void 0,e("Continue")),(0,i.A)(k.A,{theme:"primary_full",onClick:this.previousStep.bind(this)},void 0,e("Back"))))),_=(0,i.A)("fieldset",{className:p.A.form_group},void 0,(0,i.A)(b.A,{values:u,errors:ce.client,missing_required_field:C,handleChange:this.handleChange.bind(this),handleSubmit:this.nextStep.bind(this),registerRequired:this.registerRequiredStep2.bind(this),required_fields:this.required_fields.step_2},void 0,(0,i.A)("div",{className:p.A.actions},void 0,(0,i.A)(q.A,{type:"submit",theme:"success",iconClassName:"fa fa-chevron-right",iconPosition:"right",iconAlign:"middle"},void 0,e("Continue")),(0,i.A)(k.A,{theme:"primary_full",onClick:this.previousStep.bind(this)},void 0,e("Back"))))),h=this.previousStep.bind(this),A=(0,i.A)("fieldset",{className:p.A.form_group},void 0,s&&!Ht&&(0,i.A)(b.A,{values:u,errors:ce.credit_card,handleChange:this.handleChange.bind(this),handleSubmit:this.validateAndSubmit.bind(this),registerRequired:this.registerRequiredStep4.bind(this),required_fields:this.required_fields.step_4},void 0,(0,i.A)("div",{className:`${n} ${p.A.cta_spacing}`},void 0,(0,i.A)(q.A,{type:"submit",theme:"success_full",className:p.A.full_width},void 0,ht.gt(0)?e("Pay Now"):e("Place Order")))),s&&!Ht&&(0,i.A)("div",{className:p.A.secure_stack},void 0,(0,i.A)("span",{className:p.A.secure_badge},void 0,(0,i.A)("i",{className:`fa fa-lock ${p.A.lock_icon}`}),e("Secure checkout")),tt.card_type_logos&&(0,i.A)("div",{className:p.A.secure_logos},void 0,tt.card_type_logos.map((e,t)=>(0,i.A)("img",{src:e},t)))),(bt||!Dt)&&(0,i.A)("p",{className:p.A.terms},void 0,e("By submitting this form you hereby confirm that you have read, understand and accepted the Terms and Conditions and Privacy Policy.")),(0,i.A)(k.A,{theme:"primary_full",className:p.A.back_action,onClick:h},void 0,e("Back")));let R;zt&&(R=(0,i.A)("fieldset",{className:`${p.A.form_group} ${p.A.payment_method_fieldset}`},void 0,(0,i.A)("legend",{},void 0,e("Payment Method")),this.getGlobalErrors(),(0,i.A)("div",{className:p.A.payment_method_options,role:"radiogroup","aria-label":e("Payment Method")},void 0,Kt)));const F=bt?e("Pay with {{s}}",{s:bt.name}):e("Payment");let $,I,D;if($t||It){const s=Jt&&Jt.length>1,a=void 0!==Ut,n=!!(0,O.Om)({selectedGateway:bt,selectedSubscriberGateway:St,paymentButton:Xe,ecommerceContext:tt,total:this.getTotal()}).length,o=(0,i.A)(O.Ay,{values:u,errors:ce,selectedGateway:bt,selectedSubscriberGateway:St,paymentButton:Xe,ecommerceContext:tt,total:this.getTotal(),onChange:this.setPaymentFeatureFields.bind(this)}),c=(0,O.UM)({selectedGateway:bt,selectedSubscriberGateway:St,paymentButton:Xe,ecommerceContext:tt,total:this.getTotal(),currentValues:u}).payment_feature_type,l=St?.wallets&&$t&&!u.use_wallet?(0,i.A)(P.A,{wallets:St.wallets,disableWallets:bt?.require_installments||c===O.Wd||c===O.ZU,total:(0,G.R)(St,this.getTotal()),currencyCode:(0,G.$)(St,ts),merchantName:st||"Fygaro",isSaving:v||oe,t:e,onWalletPayment:this.handleDigitalWalletPayment.bind(this)}):null;$=(0,i.A)("fieldset",{className:`${p.A.form_group} ${zt?p.A.selected_payment_method:""}`},void 0,!zt&&this.getGlobalErrors(),s&&r.createElement(r.Fragment,null,(0,i.A)("label",{},void 0,e("Payment Method")),(0,i.A)("div",{className:p.A.radio_options},void 0,Jt)),o,a&&(0,i.A)("p",{className:p.A.currency_disclaimer},void 0,e("Due to the selected payment options, the payment will be processed in {{new}} ({{total}}).",{new:Ut.alphabetic_code,total:t})),(s||n||a)&&(0,i.A)("div",{className:`${p.A.divider} ${p.A.payment_credentials_divider}`},void 0,pe),l,De&&l&&(0,i.A)("span",{className:p.A.error},void 0,De),$t&&(0,i.A)(E.A,{name:"user_card",gateway:bt,useWallet:u.use_wallet}),It&&!$t&&(0,i.A)(T.A,{label:Zt?"Lynk ID":void 0,placeholder:Zt?"Lynk ID":void 0,showAtSymbol
1:Zt}))}else Ht&&($=(0,i.A)("fieldset",{className:`${p.A.form_group} ${zt?p.A.selected_payment_method:""}`},void 0,(0,i.A)("legend",{},void 0,F),!zt&&this.getGlobalErrors(),ge));if(Lt&&Bt&&(I=(0,i.A)("fieldset",{className:`${p.A.form_group} ${zt?p.A.selected_payment_method:""}`},void 0,(0,i.A)("legend",{},void 0,e("Pay with PayPal")),!zt&&this.getGlobalErrors(),(0,i.A)(U.A,{clientId:Bt,createOrderAction:this.payPalCreateOrder.bind(this),captureOrderAction:L.iw,onCapture:this.payPalOnCapture.bind(this)}))),0===f&&(Yt=a),1===f&&(Yt=(0,i.A)("div",{className:p.A.step_content},void 0,o,d)),2===f&&(Yt=(0,i.A)("div",{className:p.A.step_content},void 0,this.getGlobalErrors(),c,l,_)),3===f&&(Yt=(0,i.A)("div",{className:p.A.step_content},void 0,(0,i.A)(y.A,{handleSubmit:this.nextStep.bind(this),handleCancel:this.previousStep.bind(this),apiEndpoint:this.props.apiEndpoint,instance:u}))),4===f){let e;$&&(e=(0,i.A)(b.A,{values:u,errors:ce.credit_card,handleChange:this.handleChange.bind(this),handleSubmit:this.validateAndSubmit.bind(this),registerRequired:this.registerRequiredStep4.bind(this),required_fields:this.required_fields.step_4},void 0,$)),zt?(D=r.createElement(r.Fragment,null,R,e,!e&&Lt&&Bt&&I),n+=" "+p.A.align_center):e?D=e:Lt&&Bt?(D=I,n+=" "+p.A.align_center):n+=" "+p.A.align_left,Yt=(0,i.A)("div",{className:p.A.step_content},void 0,D,A)}}if(xt){let t;const s=a.errorBody;return s&&(s.message?t=s.message:s.error&&(t=s.error)),t||(t=e("Please try again soon or contact us for assistance.")),(0,i.A)("div",{className:p.A.error_container},void 0,(0,i.A)("div",{className:p.A.icon},void 0,(0,i.A)("i",{className:"fa fa-cloud "+p.A.yellow})),(0,i.A)("h2",{},void 0,e("Sorry, this content isn't available")),(0,i.A)("p",{},void 0,t,ye,fe))}if(Nt&&(Yt=(0,i.A)("div",{className:p.A.step_content},void 0,(0,i.A)(I.A,{extra_context:u.extra_context,access_token:u.extra_context.access_token,collector_url:u.extra_context.collector_url,handlePreflightResponse:this.handlePreflightResponse.bind(this),redirect_url:u.redirect_url}))),wt&&(Yt=(0,i.A)("div",{className:p.A.step_content},void 0,(0,i.A)(D.A,{preflight_response:X,handleChallengeResponse:this.handleChallengeResponse.bind(this)}))),qt){let s;if(Xe.return_url){const e=new URL(Xe.return_url);null!=Xt&&e.searchParams.set("reference",Xt),null!=es&&e.searchParams.set("customReference",es),s=e.toString()}return(0,i.A)("div",{className:p.A.success_container},void 0,(0,i.A)("div",{className:p.A.icon},void 0,be),(0,i.A)("h2",{},void 0,e("Successful!")),(0,i.A)("p",{},void 0,e("We have successfully processed your request. Confirmation should be arriving to your email shortly.")),(0,i.A)(R.A,{payment:is,reference:Xt,referenceLabel:e("Payment reference"),t:e}),(0,i.A)("div",{className:p.A.actions},void 0,s&&(0,i.A)(q.A,{type:"external_link",theme:"success",to:s},void 0,t?e("Return to {{s}}",{s:t}):e("Return to Merchant"))))}if(kt){const t=e("Please review your information and try again."),a=!0;let r;if(Xe.external_id){r=A.A.reverse("payments:payment_button",{payment_button_id:Xe.external_id});let e=new URL(z+r);es&&e.searchParams.append("custom_reference",es),s&&e.searchParams.append("jwt",s),r=e.toString()}return(0,i.A)("div",{className:p.A.error_container},void 0,(0,i.A)("div",{className:p.A.icon},void 0,(0,i.A)("i",{className:"fa fa-times "+p.A.red})),(0,i.A)("h2",{},void 0,e("Error!")),(0,i.A)("p",{},void 0,t||e("An error occurred while handling your request."),Se,Ne),Xe?.external_id&&a&&(0,i.A)(q.A,{type:"external_link",theme:"success",to:r},void 0,e("Try Again")))}Tt&&(Yt=(0,i.A)("div",{className:p.A.step_content},void 0,(0,i.A)("h2",{className:p.A.step_title},void 0,e("Done!")),(0,i.A)("p",{className:p.A.step_subtitle},void 0,e("This link is no longer accepting new payments."),we,qe,(0,i.A)("b",{},void 0,e("If you have any questions please contact us.")))));let as=p.A.step;return nt&&(as+=" "+p.A.step_0),ct&&(as+=" "+p.A.step_product,1===u.products?.length&&(as+=" "+p.A.single_product)),lt&&(as+=" "+p.A.step_event),(0,i.A)("div",{className:nt?`${p.A.container} ${p.A.initial}`:p.A.container},void 0,(0,i.A)("div",{className:nt?`${p.A.row} ${p.A.initial}`:p.A.row},void 0,!nt&&(0,i.A)("div",{className:`${p.A.header} ${p.A.animation_slide_up_quick}`},void 0,(0,i.A)("button",{className:p.A.header_toggle,onClick:()=>this.setState(e=>({showSummary:!e.showSummary}))},void 0,(0,i.A)("div",{className:p.A.header_toggle_content},void 0,(0,i.A)("span",{},void 0,e(Oe?"Hide Summary":"Show Summary")," ",(0,i.A)("i",{className:"fa "+(Oe?"fa-chevron-up":"fa-chevron-down")}),Xe.external_reference&&(0,i.A)("span",{className:p.A.order_reference},void 0,e("Order")," #",(0,i.A)("b",{},void 0,Xe.external_reference))),(0,i.A)("span",{className:p.A.total},void 0,ss,(0,m.N8)(ht)))),(Me||ct||lt)&&!Ct&&(0,i.A)("div",{className:Oe?`${p.A.order_summary} ${p.A.show}`:p.A.order_summary},void 0,Xe.external_reference&&(0,i.A)("h2",{className:p.A.step_title},void 0,e("Order")," #",(0,i.A)("b",{},void 0,Xe.external_reference)),ct&&(0,i.A)("ul",{className:p.A.order_summary_items},void 0,u.products?.map((e,t)=>{const s=!!e.product_versions,a=void 0!==typeof e.product_version,r=s&&a?e.product_versions[e.product_version]:void 0;return(0,i.A)("li",{className:p.A.order_summary_item},t,(0,i.A)("div",{className:p.A.order_summary_item_left},void 0,e.photo?(0,i.A)("img",{className:p.A.order_summary_item_img,src:e.photo.thumbnail}):(0,i.A)("div",{className:p.A.order_summary_item_img})),(0,i.A)("div",{className:p.A.order_summary_item_center},void 0,(0,i.A)("h3",{className:p.A.order_summary_item_header},void 0,e.name),s&&r&&(0,i.A)("h4",{className:p.A.order_summary_item_header2},void 0,r.product_options.map((e,t)=>0==t?e.name:" - "+e.name)),(0,i.A)("h4",{className:p.A.order_summary_item_header2},void 0,"x ",e.quantity)),(0,i.A)("div",{className:p.A.order_summary_item_right},void 0,(0,i.A)("p",{className:p.A.order_summary_item_value},void 0,ss,(0,m.N8)(this.getProductPrice(e)))))})),lt&&(0,i.A)("ul",{className:p.A.event_order_summary_items},void 0,this.getEventOrderSummaryItems()),(ct||lt)&&(0,i.A)(b.A,{values:u,errors:n?.errorBody?n.errorBody:ce,handleChange:this.handleChange.bind(this),handleSubmit:()=>{this.validateCoupon()}},void 0,it?ke:r.createElement(r.Fragment,null,(0,i.A)("div",{className:p.A.coupon_form},void 0,(0,i.A)(S.A,{name:"tmp_subscriber_coupon",placeholder:e("Discount Code"),className:u.tmp_subscriber_coupon?.length?p.A.uppercase_field:void 0}),(0,i.A)(k.A,{theme:"primary",onClick:()=>{this.validateCoupon()}},void 0,e("Apply"))),n?.errorBody?.error&&(0,i.A)("p",{className:p.A.error,style:{marginTop:"2px"}},void 0,n.errorBody.error)),!it&&at&&(0,i.A)("p",{className:p.A.coupon_success},void 0,(0,i.A)("small",{},void 0,Ce," ",rt.code," (",(0,W.L5)(rt.discount_type,rt.discount_rate,ss)," Off)"))),(0,i.A)("ul",{className:p.A.order_summary_rows},void 0,(!lt||_t.gt(0))&&(0,i.A)("li",{className:p.A.order_summary_row},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Subtotal")),_t.gt(0)?(0,i.A)("p",{className:p.A.order_summary_value},void 0,ss,(0,m.N8)(_t)):(0,i.A)("p",{className:p.A.order_summary_value},void 0,e("Pending"))),ut.gt(0)&&(0,i.A)("li",{className:p.A.order_summary_row},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Discount")),(0,i.A)("p",{className:p.A.order_summary_value},void 0,ss,(0,m.N8)(ut))),lt&&pt.pass_through_service_fee&&(0,i.A)("li",{className:p.A.order_summary_row},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Service Fee")),(0,i.A)("p",{className:p.A.order_summary_value},void 0,ss,(0,m.N8)(yt))),lt&&pt.pass_through_processing_fee&&(0,i.A)("li",{className:p.A.order_summary_row},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Processing Fee")),(0,i.A)("p",{className:p.A.order_summary_value},void 0,ss,(0,m.N8)(ft))),ct&&(0,i.A)("li",{className:p.A.order_summary_row},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Tax")),mt.gt(0)?(0,i.A)("p",{className:p.A.order_summary_value},void 0,ss,(0,m.N8)(mt)):(0,i.A)("p",{className:p.A.order_summary_value},void 0,"----")),Gt&&(0,i.A)("li",{className:p.A.order_summary_row},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Shipping")),void 0!==vt?(0,i.A)("p",{className:p.A.order_summary_value},void 0,vt.gt(0)?`${ss}${(0,m.N8)(vt)}`:e("Free")):(0,i.A)("p",{className:p.A.order_summary_value},void 0,"----")),At.gt(0)&&(0,i.A)("li",{className:p.A.order_summary_row},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Gratuity")),(0,i.A)("p",{className:p.A.order_summary_value},void 0,ss,(0,m.N8)(At))),(0,i.A)("li",{className:p.A.order_summary_row_total},void 0,(0,i.A)("h3",{className:p.A.order_summary_label},void 0,e("Total")),ht.gt(0)?(0,i.A)("p",{className:p.A.order_summary_value},void 0,(0,i.A)("span",{className:p.A.currency_code},void 0,ts)," ",(0,m.N8)(ht)):(0,i.A)("p",{className:p.A.order_summary_value},void 0,lt?e("Free"):"----")))),!Me&&!ct&&!lt&&!Ct&&(0,i.A)("div",{className:Oe?`${p.A.payment_summary} ${p.A.show}`:p.A.payment_summary},void 0,Xe.external_reference?(0,i.A)("h2",{className:p.A.step_title},void 0,e("Order")," #",(0,i.A)("b",{},void 0,Xe.external_reference)):(0,i.A)("h2",{className:p.A.step_title},void 0,e("Summary")),xe,Ee,(0,i.A)("div",{className:p.A.label},void 0,e("Total")),(0,i.A)("div",{className:p.A.value},void 0,(0,m.N8)(ht)," ",(0,i.A)("span",{className:p.A.currency_code},void 0,ts)),At.gt(0)&&(0,i.A)("div",{className:`${p.A.label} ${p.A.breakdown}`},void 0,ss,(0,m.N8)(u.amount)," + ",ss,(0,m.N8)(At)," ",e("Tip")))),(0,i.A)("div",{className:as},void 0,(!lt||!nt||$e)&&(0,i.A)("header",{className:p.A.branding_container},void 0,(0,i.A)("div",{className:p.A.branding},void 0,et.event_logo?(0,i.A)("img",{src:et.event_logo.file,alt:et.name}):Ye.logo&&(0,i.A)("img",{src:Ye.logo,alt:st}),lt?(0,i.A)("h1",{},void 0,et.name):(0,i.A)("h1",{},void 0,st)),nt&&Xe.external_reference&&(0,i.A)("h3",{className:p.A.step_subtitle},void 0,e("Order")," #",(0,i.A)("b",{},void 0,Xe.external_reference))),nt&&lt&&!$e&&!Ct&&(0,i.A)("header",{className:p.A.event_branding_container},void 0,et.checkout_cover&&(0,i.A)("div",{className:p.A.event_branding_cover},void 0,(0,i.A)("img",{src:et.checkout_cover.file,alt:et.checkout_cover.title})),(0,i.A)("div",{className:p.A.event_branding_content},void 0,(0,i.A)("h1",{},void 0,et.name),!!et.description?.length&&(0,i.A)("p",{className:p.A.event_branding_text},void 0,et.description),et.event_location&&(0,i.A)("p",{className:p.A.event_branding_detail},void 0,(0,i.A)("i",{className:`fa fa-map-marker ${p.A.event_branding_icon}`}),(0,i.A)("b",{},void 0,et.event_location.name),Te,(0,i.A)("small",{},void 0,!!et.event_location.description&&et.event_location.description)))),Ct?(0,i.A)("div",{className:p.A.step}
1,-1,Pe):Yt,(0,i.A)("footer",{className:nt?p.A.footer:`${p.A.footer} ${p.A.blink}`},void 0,(0,i.A)("div",{className:p.A.footer_info},void 0,(0,i.A)("div",{className:`${p.A.item} ${p.A.brand}`},void 0,(0,i.A)(o.x6,{t:e},void 0,"Built with ",Re)),(0,i.A)("div",{className:p.A.footer_divider}),Ye.has_payment_policies&&Ye.external_id&&(0,i.A)("div",{className:`${p.A.item} ${p.A.pointer}`,onClick:this.openModal.bind(this,"show_modal_policy")},void 0,e("Privacy")),Ye.has_payment_terms&&Ye.external_id&&(0,i.A)("div",{className:`${p.A.item} ${p.A.pointer}`,onClick:this.openModal.bind(this,"show_modal_terms")},void 0,e("Terms")),jt&&(0,i.A)("div",{className:`${p.A.item} ${p.A.pointer}`,onClick:this.openModal.bind(this,"show_modal_contact")},void 0,e("Contact")))))),Ye.has_payment_policies&&Ye.external_id&&(0,i.A)($.A,{title:e("Privacy Policy"),show_modal:this.state.show_modal_policy,handleClose:this.closeModal.bind(this,"show_modal_policy"),subscriberId:Ye.external_id,itemType:V.EH}),Ye.has_payment_terms&&Ye.external_id&&(0,i.A)($.A,{title:e("Terms & Conditions"),show_modal:this.state.show_modal_terms,handleClose:this.closeModal.bind(this,"show_modal_terms"),subscriberId:Ye.external_id,itemType:V.xe}),jt&&(0,i.A)(K,{title:e("Contact Information"),show_modal:this.state.show_modal_contact,handleClose:this.closeModal.bind(this,"show_modal_contact")},void 0,(0,i.A)("div",{className:p.A.contact},void 0,Qt&&(0,i.A)("h5",{},void 0,e("Emails")),Qt&&(0,i.A)("ul",{},void 0,Ye.emails.map((e,t)=>(0,i.A)("li",{},t,(0,i.A)("a",{href:"mailto:"+e},void 0,e)))),Vt&&(0,i.A)("h5",{},void 0,e("Phones")),Vt&&(0,i.A)("ul",{},void 0,Ye.phones.map((e,t)=>(0,i.A)("li",{},t,(0,i.A)("a",{href:"tel:"+e},void 0,e)))))))}}const Ge=(0,o.CI)()(Fe),Me=(0,n.y)(Ge)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.