HOME


Mini Shell 1.0
DIR: /home/dhnidqcz/pragmaticsng.org/wp-content/plugins/event-tickets/build/wizard/
Upload File :
Current File : /home/dhnidqcz/pragmaticsng.org/wp-content/plugins/event-tickets/build/wizard/wizard.js
(()=>{var e={KS35:()=>{},rReD:(e,t,n)=>{"undefined"!=typeof window&&void 0!==window.tecTicketsWebpackPublicPath&&(n.p=window.tecTicketsWebpackPublicPath)}},t={};function n(s){var a=t[s];if(void 0!==a)return a.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="",(()=>{"use strict";var e={};n.r(e),n.d(e,{getCompletedTabs:()=>k,getCountryCurrency:()=>x,getIsSaving:()=>b,getSetting:()=>m,getSettings:()=>g,getSkippedTabs:()=>v,isConnected:()=>S});var t={};n.r(t),n.d(t,{TYPES:()=>y,completeTab:()=>N,createSetting:()=>C,initializeSettings:()=>T,setSaving:()=>f,skipTab:()=>w,updateSettings:()=>j});var s={};n.r(s),n.d(s,{getInitialState:()=>U,getIsOpen:()=>H});var a={};n.r(a),n.d(a,{closeModal:()=>Y,openModal:()=>K}),n("rReD");const i=window.React;var c=n.n(i);const o=window.wp.domReady;var r=n.n(o);const l=window.ReactDOM;var d=n.n(l);const p=window.wp.components,u=window.wp.element,_=window.wp.data,h=window.wp.i18n,g=e=>e.settings||{},m=(e,t)=>e.settings[t]||!1,b=e=>e.isSaving||!1,k=e=>e.completedTabs||[],v=e=>e.skippedTabs||[],x=e=>{const t=e.settings.country,n=e.settings.countries,s=n&&n[t];return s&&s.currency||!1},S=e=>{const t=e.settings.paymentOption;return"stripe"===t?e.settings.stripeConnected:"square"===t&&e.settings.squareConnected},y={CREATE:"CREATE",INITIALIZE:"INITIALIZE",IS_SAVING:"IS_SAVING",SAVE_SETTINGS_ERROR:"SAVE_SETTINGS_ERROR",SAVE_SETTINGS_REQUEST:"SAVE_SETTINGS_REQUEST",SAVE_SETTINGS_SUCCESS:"SAVE_SETTINGS_SUCCESS",UPDATE:"UPDATE",SKIP_TAB:"SKIP_TAB",COMPLETE_TAB:"COMPLETE_TAB"};function T(e){return{type:y.INITIALIZE,settings:e}}function C(e){return{type:y.CREATE,setting:e}}const j=e=>({type:y.UPDATE,settings:e}),f=e=>({type:y.IS_SAVING,isSaving:e}),w=e=>({type:y.SKIP_TAB,payload:e}),N=e=>({type:y.COMPLETE_TAB,payload:e}),{CREATE:E,INITIALIZE:L,IS_SAVING:A,SAVE_SETTINGS_ERROR:M,SAVE_SETTINGS_REQUEST:O,SAVE_SETTINGS_SUCCESS:P,UPDATE:I,SKIP_TAB:R,COMPLETE_TAB:Z}={CREATE:"CREATE",INITIALIZE:"INITIALIZE",IS_SAVING:"IS_SAVING",SAVE_SETTINGS_ERROR:"SAVE_SETTINGS_ERROR",SAVE_SETTINGS_REQUEST:"SAVE_SETTINGS_REQUEST",SAVE_SETTINGS_SUCCESS:"SAVE_SETTINGS_SUCCESS",UPDATE:"UPDATE",SET_VISITED_FIELDS:"SET_VISITED_FIELDS",SKIP_TAB:"SKIP_TAB",COMPLETE_TAB:"COMPLETE_TAB"},D={settings:{},isSaving:!1,error:null,completedTabs:[],skippedTabs:[]};var B=n("KS35");const V=window.wp.dataControls,q="data/TTOWSettingsStore",G="/tec/tickets/onboarding/wizard",F={selectors:e,actions:t,reducer:(e=D,{settings:t,setting:n,type:s,payload:a,error:i})=>{switch(s){case L:if(e.settings&&Object.keys(e.settings).length>0)return e;const{completedTabs:s=[],skippedTabs:c=[],...o}=t||{};return{...e,settings:o,completedTabs:s,skippedTabs:c};case E:return{...e,settings:{...e.settings,...n&&n.key?{[n.key]:n.value}:{}}};case I:return t?{...e,settings:{...e.settings,...t}}:e;case O:return{...e,isSaving:!0,error:null};case P:return{...e,settings:{...e.settings,...a},isSaving:!1};case M:return{...e,isSaving:!1,error:i};case A:return{...e,isSaving:a||!1};case Z:return{...e,completedTabs:Array.from(new Set([...e.completedTabs||[],a])),skippedTabs:e.skippedTabs.filter((e=>e!==a))};case R:return e.completedTabs.includes(a)?e:{...e,skippedTabs:Array.from(new Set([...e.skippedTabs||[],a]))};default:return e}},resolvers:B,controls:V.controls},H=e=>e.isOpen,U=()=>!0,W={OPEN_MODAL:"OPEN_MODAL",CLOSE_MODAL:"CLOSE_MODAL"},{OPEN_MODAL:z,CLOSE_MODAL:$}=W,K=()=>({type:z}),Y=()=>({type:$}),{OPEN_MODAL:Q,CLOSE_MODAL:J}=W,X={isOpen:!1},ee="data/TTOWModalStore",te={actions:a,reducer:(e=X,t)=>{switch(t.type){case Q:return{...e,isOpen:!0};case J:return{...e,isOpen:!1};default:return e}},selectors:s};(0,_.registerStore)(q,F),(0,_.registerStore)(ee,te);const ne=window.ReactJSXRuntime,se=e=>(0,ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:39,height:39,className:"tec-tickets-onboarding__header-icon",role:"presentation",...e,children:[(0,ne.jsx)("path",{d:"M8.76397 6.57814L8.80191 6.60875L12.2129 9.70218C12.3821 9.85562 12.393 10.1147 12.2373 10.2814C11.8303 10.717 11.6004 11.2865 11.6004 11.8925C11.6004 13.2047 12.6746 14.2675 13.9985 14.2675C14.6823 14.2675 15.319 13.9832 15.7706 13.4926C15.9263 13.3234 16.2227 13.6861 16.3933 13.8408C17.9076 15.3294 19.1762 16.5765 19.1762 16.5765C19.1762 16.5765 23.1554 13.1733 23.8145 12.1994C23.9481 12.0018 24.0471 11.7213 24.236 11.8587L24.2726 11.8886L27.4218 14.7681C27.5989 14.93 27.5994 15.2054 27.423 15.368L27.3387 15.448C26.779 16.007 26.4589 16.7623 26.4589 17.5695C26.4589 19.2256 27.8017 20.5659 29.4548 20.5659C30.3915 20.5659 31.2559 20.1332 31.8207 19.4059C31.9604 19.2261 32.2188 19.1933 32.3994 19.324L32.4368 19.3545L35.5792 22.2279C35.7276 22.3636 35.7554 22.5843 35.6453 22.7514C33.1185 26.5882 26.5242 30.4331 22.9219 30.782C19.7626 31.0879 17.5898 30.6676 15.1515 29.0973L14.9955 28.9955C13.3355 27.8983 10.2918 25.4277 5.84995 21.5741L5.28232 21.0808C3.94772 20.4009 3.19104 19.0157 3.2536 16.8252C3.34447 13.6301 5.10981 10.0007 8.20939 6.63496C8.35402 6.47791 8.59387 6.45654 8.76397 6.57814Z",fill:"white"}),(0,ne.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.0635 29.3657C29.4621 28.3924 33.9704 25.1882 35.7502 22.566C35.7502 22.566 34.5524 21.518 32.1569 19.422C31.5335 20.2008 30.5586 20.7024 29.4621 20.7024C27.5797 20.7024 26.0533 19.2242 26.0533 17.4012C26.0533 16.4895 27.0518 15.0665 27.0518 15.0665L24.0026 12.1875C23.1847 13.3597 21.4973 15.2836 19.3424 16.8344C18.3502 17.5484 17.259 18.1833 16.1079 18.6293",fill:"#334AFF"}),(0,ne.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.80191 6.60875L8.76397 6.57814C8.59387 6.45654 8.35402 6.47791 8.20939 6.63496C5.10981 10.0007 3.34447 13.6301 3.2536 16.8252C3.19104 19.0157 3.94772 20.4009 5.28232 21.0808L5.84995 21.5741C10.2918 25.4277 13.3355 27.8983 14.9955 28.9955L15.1515 29.0973C17.5898 30.6676 19.7626 31.0879 22.9219 30.782C26.5242 30.4331 33.1185 26.5882 35.6453 22.7514C35.7554 22.5843 35.7276 22.3636 35.5792 22.2279L32.4368 19.3545L32.3994 19.324C32.2188 19.1933 31.9604 19.2261 31.8207 19.4059C31.2559 20.1332 30.3915 20.5659 29.4548 20.5659C27.8017 20.5659 26.4589 19.2256 26.4589 17.5695C26.4589 16.7623 26.779 16.007 27.3387 15.448L27.423 15.368C27.5994 15.2054 27.5989 14.93 27.4218 14.7681L24.2726 11.8886L24.236 11.8587C24.0471 11.7213 23.7744 11.7642 23.6408 11.9618C22.6426 13.4366 21.1618 14.8281 18.9754 16.5138L18.7827 16.6551C14.5326 19.7544 10.6459 21.2631 6.8309 20.7046C5.03798 20.4418 4.01801 19.3044 4.08815 16.8482L4.09435 16.6853C4.22917 13.8536 5.78461 10.6089 8.50882 7.53915L8.54791 7.49507L11.3605 10.0458L11.3232 10.0983C10.9637 10.6206 10.7655 11.2417 10.7655 11.8925C10.7655 13.6568 12.2124 15.0882 13.9985 15.0882L14.1135 15.0862C14.8394 15.061 15.5216 14.7978 16.0655 14.35L16.0863 14.3321L17.547 15.6565C17.7165 15.8101 17.9806 15.7997 18.1369 15.6331C18.2932 15.4665 18.2826 15.2069 18.1131 15.0532L16.3632 13.4663C16.1926 13.3116 15.9263 13.3234 15.7706 13.4926C15.319 13.9832 14.6823 14.2675 13.9985 14.2675C12.6746 14.2675 11.6004 13.2047 11.6004 11.8925C11.6004 11.2865 11.8303 10.717 12.2373 10.2814C12.393 10.1147 12.3821 9.85562 12.2129 9.70218L8.80191 6.60875ZM24.0147 12.8678L24.056 12.8111L26.545 15.0872L26.4912 15.1503C25.9361 15.8249 25.6241 16.6732 25.6241 17.5695C25.6241 19.6761 27.3378 21.3866 29.4548 21.3866L29.5787 21.3846C30.5667 21.3531 31.4846 20.946 32.1648 20.2661L32.1851 20.2449L34.7491 22.5896L34.6739 22.6939C32.1071 26.1901 26.0732 29.6521 22.8401 29.9652C19.7956 30.26 17.7908 29.8541 15.4614 28.3144L15.2228 28.1537C13.7859 27.1687 11.4054 25.2535 8.08892 22.4129L7.1063 21.5678C10.994 22.0025 14.8868 20.4765 19.0774 17.4611L19.4838 17.1647L19.7062 16.9925C21.6269 15.497 23.0098 14.2141 24.0147 12.8678Z",fill:"#0F1031"}),(0,ne.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.5517 24.7017C27.1421 25.1379 27.1706 25.817 27.6153 26.2189C28.0603 26.6208 28.7535 26.5924 29.1631 26.1562C29.5731 25.72 29.5446 25.0409 29.0996 24.6394C28.6545 24.2379 27.9617 24.2655 27.5517 24.7017Z",fill:"white"}),(0,ne.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.2657 21.8386C23.8557 22.2747 23.8846 22.9538 24.3293 23.3553C24.7743 23.7575 25.4675 23.7292 25.8772 23.293C26.2872 22.8568 26.2582 22.1777 25.8132 21.7759C25.3682 21.3744 24.6753 21.4024 24.2657 21.8386Z",fill:"white"}),(0,ne.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.9799 18.9792C20.5703 19.4155 20.5989 20.0947 21.0435 20.4962C21.4885 20.8981 22.1817 20.8697 22.5913 20.4335C23.0013 19.9976 22.9728 19.3181 22.5278 18.9166C22.0828 18.515 21.3899 18.543 20.9799 18.9792Z",fill:"white"})]}),ae=c().memo((({children:e,id:t,tabId:n,tabIndex:s,activeTab:a})=>(0,ne.jsx)("section",{role:"tabpanel",id:t,"aria-labelledby":n,"aria-hidden":a!==s,hidden:a!==s,tabIndex:a===s?0:-1,className:`tec-tickets-onboarding__tabpanel tec-tickets-onboarding__tabpanel-${n} ${a===s?"active":""}`,children:e}))),ie=({index:e,tab:t,activeTab:n,handleChange:s})=>{const{id:a,title:c,disabled:o,completed:r,panelId:l,ref:d}=t,p=n===e,u=(0,i.useMemo)((()=>["tec-tickets-onboarding__tab",`tec-tickets-onboarding__tab--${a}`,o&&"tec-tickets-onboarding__tab--disabled",p&&"tec-tickets-onboarding__tab--active",r&&"tec-tickets-onboarding__tab--completed"].filter(Boolean).join(" ")),[o,p,r]);return(0,ne.jsx)("li",{role:"presentation",className:u,children:(0,ne.jsx)("button",{"aria-controls":l,"aria-selected":p,className:"tec-tickets-onboarding__tab-button",disabled:o,id:a,onClick:()=>s(e),ref:d,role:"tab",tabIndex:p?0:-1,children:(0,ne.jsx)("span",{className:"tec-tickets-onboarding__tab-title",children:c})})})},ce=window.wp.apiFetch;var oe=n.n(ce);const re=({moveToNextTab:e,tabSettings:t})=>{const n=(0,_.useDispatch)(q).completeTab,s=(0,_.useSelect)((e=>e(q).getSetting("action_nonce")),[]),a=(0,_.useSelect)((e=>e(q).getSetting("_wpnonce")),[]),i=(0,_.useDispatch)(q).updateSettings,c=(0,_.useSelect)((e=>e(q).getSettings)),o=(0,_.useSelect)((e=>e(q).getCompletedTabs)),r=(0,_.useSelect)((e=>e(q).getSkippedTabs)),[l,d]=(0,u.useState)(!1),[g,m]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{t&&!l&&(d(!1),m(!1))}),[t]),(0,u.useEffect)((()=>{g&&(async()=>{d(!0),t.action_nonce=s,n(t.currentTab),i(t),oe().use(oe().createNonceMiddleware(a)),(await oe()({method:"POST",data:{...c(),completedTabs:o(),skippedTabs:r()},path:G})).success&&(Array.from(document.getElementsByClassName(`tec-tickets-onboarding-step-${t.currentTab}`)).map((e=>{e.classList.add("tec-admin-page__onboarding-step--completed")})),d(!1),e()),d(!1)})()}),[g]),(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)(p.Button,{variant:"primary",onClick:()=>m(!0),className:"tec-tickets-onboarding__button tec-tickets-onboarding__button--setup",children:[l&&(0,h.__)("Setting up...","event-tickets"),l&&(0,ne.jsx)(p.Spinner,{}),!l&&(0,h.__)("Setup your tickets","event-tickets")]})})},le=()=>{const e=(0,_.useDispatch)(ee).closeModal,t=(0,_.useSelect)((e=>e(q).getSetting("action_nonce")),[]),n=(0,_.useSelect)((e=>e(q).getSetting("_wpnonce")),[]),[s,a]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{s&&(async()=>{oe().use(oe().createNonceMiddleware(n)),await oe()({method:"POST",data:{finished:!0,begun:!1,action_nonce:t},path:G}),setTimeout((()=>{e()}),1e3)})()}),[s]),(0,ne.jsx)(p.Button,{variant:"link",onClick:()=>a(!0),className:"tec-tickets-onboarding__button tec-tickets-onboarding__button--skip tec-tickets-onboarding__button--exit",children:(0,h.__)("Skip guided setup","event-tickets")})},de=({initialOptin:e,onChange:t})=>{const[n,s]=(0,u.useState)(e);return(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__checkbox tec-tickets-onboarding__checkbox--optin",children:[(0,ne.jsx)(p.CheckboxControl,{__nextHasNoMarginBottom:!0,"aria-describedby":"tec-tickets-onboarding__checkbox-permissions",checked:n,onChange:e=>{s(e),t(e)},id:"tec-tickets-onboarding__optin-checkbox-input"}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__checkbox-description",children:[(0,ne.jsx)("label",{htmlFor:"tec-tickets-onboarding__optin-checkbox-input",children:(0,h.__)("Yes, I’d like to share basic information about my usage for future improvements.","event-tickets")}),(0,ne.jsx)("div",{id:"tec-tickets-onboarding__checkbox-permissions",children:(0,ne.jsx)("a",{href:"https://evnt.is/1bcl",target:"_blank",children:(0,h.__)("What permissions are being granted?","event-tickets")})})]})]})},pe=n.p+"images/wizard-welcome-img.243c31cffd4c3d640658.png",ue=({moveToNextTab:e})=>{const t=(0,_.useSelect)((e=>e(q).getSetting("optin")||!1),[]),n=(0,_.useSelect)((e=>e(q).getSetting("country")||"US"),[]),s=(0,_.useSelect)((e=>e(q).getSetting("countries")||{}),[]),a=(0,_.useDispatch)(q).updateSettings,[c,o]=(0,i.useState)(t),[r,l]=(0,i.useState)(t),[d,u]=(0,i.useState)(n);(0,i.useEffect)((()=>{l(t)}),[t]),(0,i.useEffect)((()=>{const e=d||n,t=s[e]?.has_stripe||!1;a({country:e,paymentOption:t?"stripe":""})}),[d,n,s,a]);const g={optin:r,country:d,paymentOption:s[d]?.has_stripe?"stripe":"",currentTab:0,begun:!0};return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("div",{className:"tec-tickets-onboarding__tab-hero",children:(0,ne.jsx)("img",{src:pe,className:"tec-tickets-onboarding__welcome-header",alt:"Welcome",role:"presentation"})}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-header",children:[(0,ne.jsx)("h1",{className:"tec-tickets-onboarding__tab-heading",children:(0,h.__)("Welcome to Event Tickets","event-tickets")}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__tab-subheader",children:(0,h.__)("Congratulations on installing the top ticket management solution for WordPress - now let's make it yours.","event-tickets")})]}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-content",children:[(0,ne.jsx)("div",{className:"tec-tickets-onboarding__form-wrapper",children:(0,ne.jsxs)(p.BaseControl,{__nextHasNoMarginBottom:!0,id:"country",label:(0,h.__)("Where in the world will you host your events?","event-tickets"),className:"tec-tickets-onboarding__form-field",children:[(0,ne.jsx)("select",{id:"country",onChange:e=>u(e.target.value),defaultValue:d,required:!0,children:Object.entries(s).map((([e,t])=>({code:e,name:t.name,continent:t.group}))).sort(((e,t)=>e.name.localeCompare(t.name))).map((({code:e,name:t})=>(0,ne.jsx)("option",{value:e,children:t},e)))}),(0,ne.jsx)("span",{className:"tec-tickets-onboarding__required-label",children:(0,h.__)("Country is required.","event-tickets")}),(0,ne.jsx)("span",{className:"tec-tickets-onboarding__invalid-label",children:(0,h.__)("Country is invalid.","event-tickets")})]})}),(0,ne.jsx)(re,{tabSettings:g,moveToNextTab:e}),(0,ne.jsx)(le,{}),(0,ne.jsx)("div",{className:"tec-tickets-onboarding__tab-footer",children:!c&&(0,ne.jsx)(de,{initialOptin:t,onChange:l})})]})]})},_e=({disabled:e,moveToNextTab:t,tabSettings:n,onSuccess:s})=>{const a=(0,_.useDispatch)(q).completeTab,{closeModal:i}=(0,_.useDispatch)(ee),c=(0,_.useSelect)((e=>e(q).getSetting("action_nonce")),[]),o=(0,_.useSelect)((e=>e(q).getSetting("_wpnonce")),[]),r=(0,_.useDispatch)(q).updateSettings,l=(0,_.useSelect)((e=>e(q).getSettings)),d=(0,_.useSelect)((e=>e(q).getCompletedTabs)),g=(0,_.useSelect)((e=>e(q).getSkippedTabs)),m=4===n.currentTab,[b,k]=(0,u.useState)(!1),[v,x]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&!b&&(k(!1),x(!1))}),[n]),(0,u.useEffect)((()=>{v&&(async()=>{k(!0),m&&(n.finished=!0),n.action_nonce=c,a(n.currentTab),r(n),oe().use(oe().createNonceMiddleware(o)),(await oe()({method:"POST",data:{...l(),completedTabs:d(),skippedTabs:g()},path:G})).success?(Array.from(document.getElementsByClassName(`tec-tickets-onboarding-step-${n.currentTab}`)).map((e=>{e.classList.add("tec-admin-page__onboarding-step--completed")})),k(!1),m?setTimeout((()=>{s()}),1e3):t()):m&&(k(!1),setTimeout((()=>{i()}),1e3)),k(!1)})()}),[v]),(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)(p.Button,{variant:"primary",disabled:e||b,onClick:()=>x(!0),className:"tec-tickets-onboarding__button tec-tickets-onboarding__button--next",children:[b&&(0,h.__)("Saving...","event-tickets"),b&&(0,ne.jsx)(p.Spinner,{}),!b&&(0,h.__)("Continue","event-tickets")]})})},he=({skipToNextTab:e,currentTab:t,buttonText:n=(0,h.__)("Skip step","event-tickets")})=>{const s=(0,_.useDispatch)(q).skipTab,a=(0,_.useDispatch)(ee).closeModal,i=(0,_.useSelect)((e=>e(q).getSettings)),c=(0,_.useSelect)((e=>e(q).getCompletedTabs)),o=(0,_.useSelect)((e=>e(q).getSkippedTabs)),[r,l]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{r&&(async()=>{s(t);const n=i();4===t&&(n.finished=!0),(await oe()({method:"POST",data:{...n,completedTabs:c(),skippedTabs:o()},path:G})).success&&t<4?e():setTimeout((()=>{a()}),1e3)})()}),[r]),(0,ne.jsx)(p.Button,{variant:"link",onClick:()=>l(!0),className:"tec-tickets-onboarding__button tec-tickets-onboarding__button--skip",children:n})},ge=()=>(0,ne.jsx)("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"presentation",children:(0,ne.jsx)("path",{d:"M13.4626 2L15.1668 3.20502L7.69816 14H5.9939L1.8335 8.17573L3.53776 6.56904L6.84603 9.6318L13.4626 2Z",fill:"#00A32A"})}),me=()=>(0,ne.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"presentation",children:(0,ne.jsx)("path",{d:"M8 2.5C9.09268 2.5 10.0976 2.77317 11.0146 3.31951C11.9317 3.84634 12.6537 4.56829 13.1805 5.48537C13.7268 6.40244 14 7.40732 14 8.5C14 9.59268 13.7268 10.5976 13.1805 11.5146C12.6537 12.4317 11.9317 13.1634 11.0146 13.7098C10.0976 14.2366 9.09268 14.5 8 14.5C6.90732 14.5 5.90244 14.2366 4.98537 13.7098C4.06829 13.1634 3.33659 12.4317 2.79024 11.5146C2.26341 10.5976 2 9.59268 2 8.5C2 7.40732 2.26341 6.40244 2.79024 5.48537C3.33659 4.56829 4.06829 3.84634 4.98537 3.31951C5.90244 2.77317 6.90732 2.5 8 2.5ZM11.7463 10.7537L9.49268 8.5L11.7463 6.24634L10.2537 4.75366L8 7.00732L5.74634 4.75366L4.25366 6.24634L6.50732 8.5L4.25366 10.7537L5.74634 12.2463L8 9.99268L10.2537 12.2463L11.7463 10.7537Z",fill:"#D63638"})}),be=({connectionStatus:e,gatewayType:t,connectText:n,onConnect:s,onContinue:a,hideStatus:i=!1})=>"connected"===e?(0,ne.jsxs)(ne.Fragment,{children:[!i&&(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__connection-status tec-tickets-onboarding__connection-status--connected",children:[(0,ne.jsx)(ge,{})," ",(0,h.__)("Connected","event-tickets")]}),(0,ne.jsx)(p.Button,{isPrimary:!0,className:"tec-tickets-onboarding__next-button",onClick:a,children:(0,h.__)("Continue","event-tickets")})]}):"failed"===e?(0,ne.jsxs)(ne.Fragment,{children:[!i&&(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__connection-error",children:[(0,ne.jsx)(me,{}),(0,ne.jsxs)("span",{className:"tec-tickets-onboarding__error-text",children:[(0,h.__)("Connection failed. ","event-tickets"),(0,ne.jsx)("a",{href:"/wp-admin/admin.php?page=tec-tickets-help",className:"tec-tickets-onboarding__support-link",children:(0,h.__)("Contact Support ↗","event-tickets")})]})]}),(0,ne.jsx)(p.Button,{isPrimary:!0,className:"tec-tickets-onboarding__try-again",onClick:s,children:(0,h.__)("Try again","event-tickets")})]}):(0,ne.jsx)(p.Button,{isPrimary:!0,className:"tec-tickets-onboarding__connect-gateway tec-tickets-onboarding__next-button",onClick:s,disabled:"connecting"===e,children:"connecting"===e?(0,h.__)("Connecting...","event-tickets"):n}),ke=()=>(0,ne.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:31,height:30,fill:"none",className:"tec-tickets-onboarding__content-header-icon",role:"presentation",children:(0,ne.jsx)("path",{fill:"#C3C4C7",fillRule:"evenodd",d:"m5.546 7.629.821-3.004c.051-.18.122-.345.224-.489a1.49 1.49 0 0 1 .455-.428 1.387 1.387 0 0 1 1.105-.158l14.483 4.08h-7.262l-.154-.044-.012.044h-2.458l.182-.656-4.856-1.367-.55 2.023H5.546Zm20.994 18.87-22.09-.005a1.41 1.41 0 0 1-1.02-.435A1.506 1.506 0 0 1 3.007 25l.004-4.54.33.002c1.411-.024 2.552-1.237 2.561-2.725-.006-1.48-1.15-2.701-2.556-2.73l-.047-.124.008.123-.307.007.004-4.54a1.51 1.51 0 0 1 .413-1.068 1.396 1.396 0 0 1 1.024-.452l22.101.01c.805.006 1.449.676 1.451 1.51v4.529l-.24.004c-1.41.024-2.555 1.249-2.561 2.725.006 1.48 1.151 2.702 2.557 2.73H28l-.012.25v4.274c0 .403-.149.777-.425 1.064a1.396 1.396 0 0 1-1.023.45ZM11.126 12.85c-.66-.004-1.183-.495-1.184-1.114l.004-.778-5.04-.002.002 2.406c1.735.689 2.9 2.44 2.895 4.388-.004 1.947-1.165 3.69-2.898 4.386l.001 2.406 5.04.002.005-.818c0-.295.12-.586.354-.795.23-.196.52-.302.826-.309.334-.01.645.12.865.35.202.21.304.477.307.76l-.005.818 13.799-.002.004-2.458c-1.683-.723-2.801-2.458-2.802-4.353-.002-1.896 1.127-3.624 2.802-4.341l.004-2.458-13.794-.01v.806c-.011.614-.537 1.117-1.185 1.116Zm-.838 1.327a1.069 1.069 0 0 0-.288.43 1.256 1.256 0 0 0-.066.365l-.003 1.14c.003.284.105.55.307.76.22.23.53.36.865.35.33.003.64-.123.87-.359a1.04 1.04 0 0 0 .314-.756l.015-1.137a1.097 1.097 0 0 0-.306-.76 1.148 1.148 0 0 0-.866-.35 1.255 1.255 0 0 0-.842.317Zm-.282 5.014a1.175 1.175 0 0 0-.062.354l-.003 1.14c0 .62.524 1.11 1.184 1.115.648 0 1.174-.502 1.18-1.104l.004-1.141c-.001-.619-.525-1.11-1.184-1.114-.53.003-.96.313-1.119.75Z",clipRule:"evenodd"})}),ve=()=>(0,ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:81,height:40,fill:"none",role:"presentation",children:[(0,ne.jsx)("g",{clipPath:"url(#a)",children:(0,ne.jsxs)("g",{fill:"#6772E5",clipPath:"url(#b)",children:[(0,ne.jsx)("path",{fillRule:"evenodd",d:"M80.374 20.997c0-5.623-2.732-10.068-7.934-10.068-5.201 0-8.397 4.439-8.397 10.026 0 6.618 3.756 9.955 9.09 9.955 2.623 0 4.594-.598 6.083-1.426V25.09a11.59 11.59 0 0 1-5.389 1.216c-2.15 0-4.022-.757-4.27-3.329h10.744c.038-.658.062-1.317.071-1.977l.002-.002ZM69.507 18.92c0-2.473 1.527-3.507 2.896-3.507s2.776 1.025 2.776 3.507h-5.672Zm-13.939-7.98a6.144 6.144 0 0 0-4.3 1.706l-.287-1.366h-4.83v25.61l5.486-1.167v-6.208a6.147 6.147 0 0 0 3.896 1.43c3.928 0 7.511-3.157 7.511-10.131.004-6.403-3.626-9.876-7.482-9.876l.006.001Zm-1.323 15.144a3.278 3.278 0 0 1-2.589-1.025l-.034-8.145a3.312 3.312 0 0 1 2.62-1.086c2.007 0 3.39 2.263 3.39 5.122.004 2.934-1.355 5.143-3.387 5.143v-.01ZM44.086 3.992l-5.509 1.171v4.468l5.51-1.167V3.992Z",clipRule:"evenodd"}),(0,ne.jsx)("path",{d:"M38.577 11.305h5.51V30.54h-5.51V11.305Z"}),(0,ne.jsx)("path",{fillRule:"evenodd",d:"m32.678 12.926-.342-1.623h-4.747V30.54h5.484V17.484c1.298-1.696 3.487-1.366 4.184-1.15v-5.028c-.731-.263-3.296-.745-4.58 1.617v.003ZM21.67 6.539l-5.358 1.138-.022 17.604c0 3.247 2.44 5.648 5.699 5.648 1.793 0 3.117-.341 3.852-.727v-4.469c-.704.28-4.167 1.288-4.167-1.945v-7.806h4.166v-4.68h-4.166l-.004-4.763ZM6.813 16.885c0-.858.713-1.188 1.864-1.188 1.907.042 3.777.526 5.464 1.414v-5.17a14.498 14.498 0 0 0-5.464-1.004c-4.438 0-7.417 2.326-7.417 6.208 0 6.075 8.343 5.088 8.343 7.707 0 1.025-.883 1.342-2.108 1.342-1.816 0-4.163-.751-6.003-1.754v5.238a15.227 15.227 0 0 0 6.003 1.264c4.563 0 7.707-2.254 7.707-6.205 0-6.557-8.39-5.385-8.39-7.854l.001.002Zm-36.674-2.777c0-1.55 1.29-2.15 3.373-2.15a22.24 22.24 0 0 1 9.885 2.558V5.161a26.226 26.226 0 0 0-9.885-1.816c-8.031 0-13.418 4.207-13.418 11.232 0 10.991 15.092 9.206 15.092 13.944 0 1.853-1.583 2.427-3.812 2.427-3.286 0-7.53-1.36-10.86-3.17v9.478a27.548 27.548 0 0 0 10.861 2.287c8.255 0 13.945-4.078 13.945-11.225 0-11.862-15.181-9.743-15.181-14.208v-.002Z",clipRule:"evenodd"})]})}),(0,ne.jsxs)("defs",{children:[(0,ne.jsx)("clipPath",{id:"a",children:(0,ne.jsx)("path",{fill:"#fff",d:"M.5 0h80v40H.5z"})}),(0,ne.jsx)("clipPath",{id:"b",children:(0,ne.jsx)("path",{fill:"#fff",d:"M.5 0h88.235v40H.5z"})})]})]}),xe=e=>(0,ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:131,height:40,fill:"none",role:"presentation",...e,children:[(0,ne.jsx)("g",{clipPath:"url(#a)",children:(0,ne.jsx)("path",{fill:"#1A1A1A",d:"M27.351 3.5H5.487C2.457 3.5 0 5.966 0 9.008v21.947c0 3.043 2.456 5.509 5.487 5.509h21.864c3.03 0 5.487-2.466 5.487-5.509V9.008c0-3.042-2.456-5.508-5.487-5.508Zm-.482 25.231c0 .961-.776 1.74-1.733 1.74H7.703a1.737 1.737 0 0 1-1.734-1.74V11.232c0-.961.776-1.74 1.734-1.74h17.432c.958 0 1.734.779 1.734 1.74v17.5Zm-13.933-4.275a.995.995 0 0 1-.994-1v-6.987a.998.998 0 0 1 .994-1.005h6.97c.548 0 .994.448.994 1.005v6.983c0 .553-.446 1-.994 1h-6.97v.004Zm28.609-.477h3.585c.179 2.038 1.555 3.629 4.332 3.629 2.48 0 4.005-1.23 4.005-3.089 0-1.74-1.195-2.519-3.348-3.03l-2.78-.6c-3.017-.659-5.289-2.607-5.289-5.79 0-3.509 3.107-5.908 7.141-5.908 4.273 0 7.023 2.25 7.26 5.577h-3.466c-.413-1.557-1.7-2.485-3.79-2.485-2.212 0-3.734 1.2-3.734 2.73 0 1.532 1.314 2.46 3.585 2.97l2.75.6c3.018.66 5.078 2.49 5.078 5.697 0 4.08-3.047 6.51-7.409 6.51-4.903-.004-7.62-2.672-7.92-6.811ZM69.7 36.464v-5.97l.235-2.618H69.7c-.822 1.883-2.548 2.913-4.893 2.913-3.78 0-6.593-3.088-6.593-7.824s2.813-7.825 6.593-7.825c2.315 0 3.956 1.087 4.893 2.794h.235V15.43h3.107v21.033H69.7Zm.116-13.503c0-3.029-1.846-4.795-4.104-4.795s-4.104 1.766-4.104 4.795c0 3.03 1.846 4.796 4.104 4.796s4.104-1.763 4.104-4.796Zm5.705 1.561v-9.09h3.341v8.795c0 2.383 1.143 3.53 3.048 3.53 2.344 0 3.87-1.677 3.87-4.295v-8.03h3.34v15.06h-3.106v-3.12h-.234c-.734 2.002-2.345 3.414-4.834 3.414-3.58 0-5.425-2.293-5.425-6.264Zm15.634 1.764c0-2.824 1.964-4.471 5.45-4.677l4.131-.265v-1.177c0-1.412-1.027-2.263-2.843-2.263-1.67 0-2.668.852-2.932 2.058h-3.34c.352-3.06 2.871-4.826 6.269-4.826 3.84 0 6.184 1.648 6.184 4.826v10.53h-3.107v-2.795h-.234c-.704 1.853-2.17 3.09-4.983 3.09-2.69 0-4.595-1.824-4.595-4.502Zm9.584-1.853v-.796l-3.37.236c-1.817.116-2.639.795-2.639 2.147 0 1.147.938 1.972 2.255 1.972 2.377 0 3.754-1.528 3.754-3.56Zm5.828 6.062V15.43h3.107v2.884h.234c.439-1.972 1.935-2.884 4.16-2.884h1.525v3.03h-1.905c-2.169 0-3.78 1.411-3.78 4.09v7.94h-3.341v.004Zm24.313-6.914h-11.4c.175 2.764 2.109 4.325 4.249 4.325 1.816 0 2.958-.736 3.605-1.972h3.312c-.908 3.06-3.576 4.852-6.947 4.852-4.424 0-7.531-3.324-7.531-7.825 0-4.5 3.193-7.825 7.561-7.825 4.394 0 7.267 3.03 7.267 6.795.003.739-.056 1.12-.116 1.65Zm-3.193-2.323c-.115-2.088-1.845-3.5-3.955-3.5-1.994 0-3.661 1.266-4.074 3.5h8.029Z"})}),(0,ne.jsx)("defs",{children:(0,ne.jsx)("clipPath",{id:"a",children:(0,ne.jsx)("path",{fill:"#fff",d:"M0 3.5h131v33H0z"})})})]}),Se=e=>(0,ne.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:135,height:44,viewBox:"-11.153 -13.144 326.05 105.914",fill:"none",role:"presentation",...e,children:(0,ne.jsxs)("g",{transform:"matrix(2.07675 0 0 -2.07675 -11.153 92.77)",children:[(0,ne.jsx)("defs",{children:(0,ne.jsx)("path",{id:"a",d:"M-84.525-27.457h326.05V78.457h-326.05z"})}),(0,ne.jsx)("clipPath",{id:"b",children:(0,ne.jsx)("use",{xlinkHref:"#a",overflow:"visible"})}),(0,ne.jsxs)("g",{"clip-path":"url(#b)",children:[(0,ne.jsx)("path",{fill:"#003087",d:"M32.419 40.982c-1.674 1.908-4.7 2.726-8.571 2.726H12.613a1.609 1.609 0 0 1-1.59-1.357L6.347 12.68a.964.964 0 0 1 .953-1.114h6.936l1.742 11.049-.054-.346a1.604 1.604 0 0 0 1.583 1.357h3.296c6.475 0 11.545 2.63 13.026 10.238.044.225.082.444.115.658.44 2.812-.003 4.726-1.524 6.459"}),(0,ne.jsx)("path",{fill:"#009cde",d:"M117.331 26.863c-.424-2.784-2.55-2.784-4.606-2.784h-1.17l.821 5.198c.05.314.32.545.638.545h.537c1.4 0 2.722 0 3.404-.797.407-.477.53-1.185.376-2.162m-.895 7.264h-7.756a1.08 1.08 0 0 1-1.066-.91L104.48 13.33a.647.647 0 0 1 .638-.747h3.98c.371 0 .687.27.745.636l.89 5.64c.082.523.534.91 1.064.91h2.454c5.11 0 8.058 2.471 8.828 7.372.347 2.142.014 3.826-.989 5.005-1.103 1.296-3.058 1.982-5.653 1.982"}),(0,ne.jsx)("path",{fill:"#003087",d:"M62.011 26.863c-.424-2.784-2.55-2.784-4.607-2.784h-1.17l.821 5.198c.05.314.32.545.638.545h.537c1.4 0 2.722 0 3.404-.797.408-.477.531-1.185.377-2.162m-.895 7.264H53.36c-.53 0-.982-.386-1.065-.91L49.16 13.33a.646.646 0 0 1 .638-.747h3.704c.53 0 .981.386 1.064.91l.847 5.365c.082.524.534.91 1.064.91h2.454c5.11 0 8.058 2.472 8.828 7.373.347 2.142.014 3.826-.989 5.005-1.103 1.296-3.058 1.982-5.653 1.982M79.123 19.723c-.36-2.122-2.043-3.547-4.192-3.547-1.077 0-1.94.347-2.494 1.003-.55.65-.756 1.577-.582 2.608.334 2.104 2.046 3.574 4.162 3.574 1.055 0 1.91-.35 2.476-1.012.569-.667.793-1.599.63-2.626m5.176 7.23h-3.714a.647.647 0 0 1-.64-.547l-.162-1.038-.26.376c-.804 1.167-2.597 1.558-4.387 1.558-4.103 0-7.608-3.11-8.29-7.47-.355-2.177.149-4.256 1.383-5.707 1.133-1.333 2.75-1.888 4.677-1.888 3.308 0 5.142 2.124 5.142 2.124l-.166-1.032a.646.646 0 0 1 .639-.747h3.344c.53 0 .982.385 1.065.91l2.008 12.713a.647.647 0 0 1-.64.747"}),(0,ne.jsx)("path",{fill:"#009cde",d:"M134.443 19.723c-.36-2.122-2.043-3.547-4.192-3.547-1.077 0-1.94.347-2.494 1.003-.55.65-.756 1.577-.582 2.608.334 2.104 2.045 3.574 4.162 3.574 1.055 0 1.91-.35 2.476-1.012.569-.667.793-1.599.63-2.626m5.176 7.23h-3.714a.647.647 0 0 1-.64-.547l-.162-1.038-.26.376c-.804 1.167-2.597 1.558-4.387 1.558-4.102 0-7.607-3.11-8.29-7.47-.355-2.177.15-4.256 1.384-5.707 1.133-1.333 2.75-1.888 4.677-1.888 3.309 0 5.143 2.124 5.143 2.124l-.166-1.032a.644.644 0 0 1 .637-.747h3.343c.53 0 .982.385 1.066.91l2.008 12.713a.647.647 0 0 1-.64.747"}),(0,ne.jsx)("path",{fill:"#003087",d:"M104.08 26.952h-3.734c-.357 0-.69-.177-.89-.473l-5.15-7.584-2.183 7.288a1.08 1.08 0 0 1-1.033.77h-3.669a.647.647 0 0 1-.612-.856l4.11-12.066-3.866-5.455a.647.647 0 0 1 .528-1.02h3.73c.352 0 .683.173.885.463l12.414 17.918a.646.646 0 0 1-.53 1.015"}),(0,ne.jsx)("path",{fill:"#009cde",d:"M143.996 33.58l-3.184-20.251a.647.647 0 0 1 .639-.747h3.201c.53 0 .982.386 1.065.91l3.139 19.888a.646.646 0 0 1-.639.747h-3.582a.645.645 0 0 1-.639-.546"}),(0,ne.jsx)("path",{fill:"#003087",d:"M32.419 40.982c-1.674 1.908-4.7 2.726-8.571 2.726H12.613a1.609 1.609 0 0 1-1.59-1.357L6.347 12.68a.964.964 0 0 1 .953-1.114h6.936l1.742 11.049-.054-.346a1.604 1.604 0 0 0 1.583 1.357h3.296c6.475 0 11.545 2.63 13.026 10.238.044.225.082.444.115.658.44 2.812-.003 4.726-1.524 6.459"}),(0,ne.jsx)("path",{fill:"#003087",d:"M17.849 34.485a1.408 1.408 0 0 0 1.389 1.187h8.808c1.043 0 2.016-.068 2.905-.21a12.206 12.206 0 0 0 1.44-.322 7.957 7.957 0 0 0 1.551-.618c.442 2.813-.002 4.726-1.523 6.46-1.675 1.907-4.7 2.725-8.571 2.725H12.612a1.609 1.609 0 0 1-1.588-1.357L6.346 12.682a.964.964 0 0 1 .952-1.115h6.937l1.742 11.05 1.872 11.868z"}),(0,ne.jsx)("path",{fill:"#009cde",d:"M33.943 34.523a18.294 18.294 0 0 0-.115-.658c-1.481-7.607-6.551-10.238-13.026-10.238h-3.297a1.602 1.602 0 0 1-1.582-1.357l-1.688-10.702-.48-3.036a.844.844 0 0 1 .834-.976h5.847c.692 0 1.28.504 1.389 1.187l.057.298 1.102 6.984.07.386a1.407 1.407 0 0 0 1.39 1.187h.875c5.664 0 10.099 2.3 11.395 8.956.54 2.78.26 5.103-1.17 6.734a5.584 5.584 0 0 1-1.601 1.235"}),(0,ne.jsx)("path",{fill:"#012169",d:"M32.392 35.14c-.226.067-.459.127-.699.18-.24.053-.488.1-.742.14-.89.145-1.862.213-2.906.213h-8.807a1.404 1.404 0 0 1-1.389-1.188l-1.872-11.87-.054-.345a1.602 1.602 0 0 0 1.582 1.357h3.297c6.475 0 11.545 2.63 13.026 10.238.044.225.081.443.115.658a7.998 7.998 0 0 1-1.218.514c-.109.036-.22.07-.333.104"})]})]})}),ye=({singleGateway:e,connectionStatus:t})=>{if(!e)return null;const n={stripe:{title:(0,h.__)("Stripe Payment Setup","event-tickets"),description:(0,h.__)("Based on your country selection, Stripe is the recommended payment processor for online payments.","event-tickets"),logo:(0,ne.jsx)(ve,{}),connectText:(0,h.__)("Connect to Stripe","event-tickets")},square:{title:(0,h.__)("Square Payment Setup","event-tickets"),description:(0,h.__)("Based on your country selection, Square is the recommended payment processor for your region.","event-tickets"),logo:(0,ne.jsx)(xe,{}),connectText:(0,h.__)("Connect to Square","event-tickets")},paypal:{title:(0,h.__)("PayPal Payment Setup","event-tickets"),description:(0,h.__)("Based on your country selection, PayPal is the recommended payment processor for your region.","event-tickets"),logo:(0,ne.jsx)(Se,{}),connectText:(0,h.__)("Connect to PayPal","event-tickets")}}[e];return(0,ne.jsx)("div",{className:"tec-tickets-onboarding__single-gateway",children:(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__payment-gateway",children:[(0,ne.jsx)("div",{className:"tec-tickets-onboarding__gateway-header",children:n.logo&&(0,ne.jsx)("div",{className:"tec-tickets-onboarding__gateway-logo",children:n.logo})}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__gateway-description",children:n.description})]})})},Te=({currencies:e,currencyCode:t,onCurrencyChange:n,hasCountryWithSingleGateway:s})=>(0,ne.jsxs)(p.BaseControl,{__nextHasNoMarginBottom:!0,id:"currency-code",label:(0,h.__)("Currency","event-tickets"),className:"tec-tickets-onboarding__form-field",children:[(0,ne.jsx)("select",{onChange:n,value:t,required:!0,children:Object.entries(e).map((([e,t])=>(0,ne.jsxs)("option",{value:t.code,children:[t.name," (",t.code,")"]},e)))}),s&&(0,ne.jsx)("p",{className:"tec-tickets-onboarding__currency-notice",children:(0,h.__)("Currency selected based on your country.","event-tickets")}),(0,ne.jsx)("span",{className:"tec-tickets-onboarding__required-label",children:(0,h.__)("Currency is required.","event-tickets")}),(0,ne.jsx)("span",{className:"tec-tickets-onboarding__invalid-label",children:(0,h.__)("Currency is invalid.","event-tickets")})]}),Ce=({paymentGateways:e,paymentOption:t,onPaymentOptionChange:n})=>{const s=e=>{n(e)};return(0,ne.jsxs)("fieldset",{className:"components-radio-control tec-tickets-onboarding__payment-radios",children:[(0,ne.jsx)("legend",{className:"screen-reader-text",children:(0,h.__)("Ticket Payments","event-tickets")}),(0,ne.jsx)("div",{className:"components-radio-control__option tec-tickets-onboarding__payment-option "+(e.stripe?"":"disabled"),children:(0,ne.jsxs)("label",{htmlFor:"tec-tickets-payment-stripe",children:[(0,ne.jsx)("input",{id:"tec-tickets-payment-stripe",className:"components-radio-control__input",type:"radio",name:"payment-option",value:"stripe",checked:"stripe"===t,onChange:()=>s("stripe"),disabled:!e.stripe}),(0,ne.jsxs)("span",{className:"tec-tickets-onboarding__payment-option-content",children:[(0,ne.jsx)("span",{className:"tec-tickets-onboarding__payment-option-label",children:(0,h.__)("Online","event-tickets")}),(0,ne.jsx)("span",{className:"tec-tickets-onboarding__payment-option-provider",children:(0,h.__)("(Powered by Stripe)","event-tickets")})]})]})}),(0,ne.jsx)("div",{className:"components-radio-control__option tec-tickets-onboarding__payment-option "+(e.square?"":"disabled"),children:(0,ne.jsxs)("label",{htmlFor:"tec-tickets-payment-square",children:[(0,ne.jsx)("input",{id:"tec-tickets-payment-square",className:"components-radio-control__input",type:"radio",name:"payment-option",value:"square",checked:"square"===t,onChange:()=>s("square"),disabled:!e.square}),(0,ne.jsxs)("span",{className:"tec-tickets-onboarding__payment-option-content",children:[(0,ne.jsx)("span",{className:"tec-tickets-onboarding__payment-option-label",children:(0,h.__)("Online and in-person","event-tickets")}),(0,ne.jsx)("span",{className:"tec-tickets-onboarding__payment-option-provider",children:(0,h.__)("(Powered by Square)","event-tickets")})]})]})})]})},je=({paymentGateways:e,paymentOption:t,onPaymentOptionChange:n})=>(0,ne.jsxs)(p.BaseControl,{__nextHasNoMarginBottom:!0,id:"payment-options",label:(0,h.__)("Ticket Payments","event-tickets"),className:"tec-tickets-onboarding__form-field tec-tickets-onboarding__payment-options",children:[(0,ne.jsx)("p",{className:"tec-tickets-onboarding__subtitle",children:(0,h.__)("Choose how you'd like to accept payments:","event-tickets")}),(0,ne.jsx)(Ce,{paymentGateways:e,paymentOption:t,onPaymentOptionChange:n}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__free-options-note",children:(0,h.__)("Free tickets and RSVP options are always available.","event-tickets")}),!e.square&&(0,ne.jsx)("div",{className:"tec-tickets-onboarding__warning-notice",children:(0,ne.jsx)("p",{children:(0,h.__)("Your selected currency does not support in-person payments with Square.","event-tickets")})})]}),fe=(e,t)=>{if(!e||!t[e])return null;const n=t[e],s={stripe:!1!==n.has_stripe,square:!1!==n.has_square,paypal:!1!==n.has_paypal},a=Object.entries(s).filter((([e,t])=>t)).map((([e])=>e));return 1===a.length?a[0]:null},we=(e,t)=>{const n=((e,t)=>e?Object.entries(t).filter((([t,n])=>n.currency&&n.currency===e)).map((([e,t])=>t)):[])(e,t);return 0===n.length?{stripe:!0,square:!0,paypal:!0}:{stripe:n.some((e=>!1!==e.has_stripe)),square:n.some((e=>!1!==e.has_square)),paypal:n.some((e=>!1!==e.has_paypal))}},Ne=({moveToNextTab:e,skipToNextTab:t,addTab:n,updateTab:s,reorderTabs:a})=>{const[i,c]=(0,u.useState)("disconnected"),o=(0,_.useSelect)((e=>e(q).getSettings)),r=(0,_.useSelect)((e=>e(q).getCountryCurrency())),l=(0,_.useSelect)((e=>e(q).getSetting("country"))),d=(0,_.useSelect)((e=>e(q).getSetting("_wpnonce")),[]),p=(0,_.useSelect)((e=>e(q).getSetting("action_nonce")),[]),g=(0,_.useDispatch)(q).updateSettings,m=(0,_.useSelect)((e=>{const t=e(q);return t.getVisibleTabs?t.getVisibleTabs():[]}),[]),b=Array.isArray(m)&&m.some((e=>e&&"payments"===e.id)),{currency:k,currencies:v,countries:x,paymentOption:S}=(0,_.useSelect)((e=>{const t=e(q);return{currency:t.getSetting("currency"),currencies:t.getSetting("currencies"),countries:t.getSetting("countries"),paymentOption:t.getSetting("paymentOption")}}),[]),y=l?fe(l,x):null,T=k||l&&x[l]?.currency||r||"USD",C=we(T,x),j=S||y||(C.stripe?"stripe":C.square?"square":"paypal"),[f,w]=(0,u.useState)(T),[N,E]=(0,u.useState)(j),[L,A]=(0,u.useState)(C),[M,O]=(0,u.useState)(!1),[P,I]=(0,u.useState)(!!y),R=e=>{E(e),g({paymentOption:e})};(0,u.useEffect)((()=>{if(l){const e=fe(l,x);I(!!e),e&&R(e),x[l]?.currency&&w(x[l].currency)}}),[l,x]),(0,u.useEffect)((()=>{if(!N){const e=["stripe","square","paypal"].find((e=>L[e]));e&&R(e)}}),[N,L]),(0,u.useEffect)((()=>{g({paymentOption:N})}),[N,g]),(0,u.useEffect)((()=>{w(k||r)}),[k,r]);const Z=()=>{(({currencyCode:e,updateSettings:t,skipPaymentsTab:n,moveToNextTab:s,paymentOption:a,paymentsTabExists:i,paymentsTabAdded:c,setPaymentsTabAdded:o,addTab:r,reorderTabs:l,skipToNextTab:d})=>{t({currency:e}),s()})({currencyCode:f,updateSettings:g,skipPaymentsTab:P,moveToNextTab:e,paymentOption:N,paymentsTabExists:b,paymentsTabAdded:M,setPaymentsTabAdded:O,addTab:n,reorderTabs:a,skipToNextTab:t})};(0,u.useEffect)((()=>{const t=o();if(t.stripeConnected&&c("connected"),t.squareConnected&&c("connected"),t.connecting&&y){c("connected"),g({connecting:!1});const t=setTimeout((()=>{e()}),1500);return()=>clearTimeout(t)}}),[]);const D={currency:f,paymentOption:N,currentTab:1,connectionStatus:i},B=!!y;return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(ke,{}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-header",children:[(0,ne.jsx)("h1",{className:"tec-tickets-onboarding__tab-heading",children:(0,h.__)("Selling Tickets","event-tickets")}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__tab-subheader",children:(0,h.__)("Nail down the basics of your ticket setup.","event-tickets")})]}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-content",children:[(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__form-wrapper",children:[B&&(0,ne.jsx)(ye,{singleGateway:y,connectionStatus:i}),(0,ne.jsx)(Te,{currencies:v,currencyCode:f,onCurrencyChange:e=>{(({e,setCurrency:t,setPaymentGateways:n,paymentOption:s,setPaymentOption:a,countries:i})=>{const c=e.target.value;t(c);const o=we(c,i);n(o);const r=["stripe","square","paypal"];(!s||s&&!o[s])&&a(r.find((e=>o[e]))||"")})({e,setCurrency:w,setPaymentGateways:A,paymentOption:N,setPaymentOption:E,countries:x})},hasCountryWithSingleGateway:B}),!B&&(0,ne.jsx)(je,{paymentGateways:L,paymentOption:N,onPaymentOptionChange:R})]}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-actions",children:[B?(0,ne.jsx)(ne.Fragment,{children:y&&(0,ne.jsx)(be,{connectionStatus:i,gatewayType:y,connectText:x[l]&&y?(0,h.__)(`Connect to ${y.charAt(0).toUpperCase()+y.slice(1)}`,"event-tickets"):(0,h.__)("Connect","event-tickets"),onConnect:()=>(async e=>{await(async({gateway:e,currencyCode:t,actionNonce:n,wpNonce:s,getSettings:a,updateSettings:i,setConnectionStatus:c,apiEndpoint:o})=>{c("connecting"),i({gateway:e,currency:t,action_nonce:n}),oe().use(oe().createNonceMiddleware(s));try{const t=await oe()({method:"POST",data:{...a(),gateway:e,action:"connect"},path:o});t&&t.signup_url?(i({connecting:!0,currentTab:2}),window.location.href=t.signup_url):c("failed")}catch(e){console.error("Connection error:",e),c("failed")}})({gateway:e,currencyCode:f,actionNonce:p,wpNonce:d,getSettings:o,updateSettings:g,setConnectionStatus:c,apiEndpoint:G})})(y),onContinue:Z})}):(0,ne.jsx)(_e,{moveToNextTab:Z,tabSettings:D,disabled:!N,onSuccess:()=>{}}),(0,ne.jsx)(he,{skipToNextTab:t,currentTab:1})]})]})]})},Ee=()=>(0,ne.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:31,height:30,fill:"none",className:"tec-tickets-onboarding__content-header-icon",role:"presentation",children:(0,ne.jsx)("path",{fill:"#C3C4C7",d:"M29.835 19.108 26.769 4.51a1.864 1.864 0 0 0-.783-1.148A1.842 1.842 0 0 0 24.63 3.1L2.57 7.758a1.87 1.87 0 0 0-1.149.783c-.26.405-.352.887-.26 1.357l3.065 14.599a1.823 1.823 0 0 0 2.153 1.395l22.048-4.644a1.802 1.802 0 0 0 1.409-2.14Zm-4.958-14.05v.013l-9.197 9.771L3.116 9.624l21.761-4.566ZM6.13 23.948 3.612 11.96l11.95 4.958a.98.98 0 0 0 1.096-.235l8.728-9.276 2.518 11.95L6.13 23.95Z"})}),Le=({moveToNextTab:e,skipToNextTab:t})=>{const n=(0,_.useSelect)((e=>e(q).getSetting("userEmail")||""),[]),[s,a]=(0,u.useState)(n||""),c=(0,_.useSelect)((e=>e(q).getSetting("userName")||""),[]),[o,r]=(0,u.useState)(c||""),[l,d]=(0,u.useState)(!0),[g,m]=(0,u.useState)(!0),[b,k]=(0,u.useState)({email:!1,name:!1}),v=(0,_.useDispatch)(q).updateSettings;(0,i.useEffect)((()=>{v({userEmail:s,userName:o})}),[s,o,v]);const x={userEmail:s,userName:o,currentTab:3},S=l&&g&&s&&o;return(()=>{const e=[];b.email&&!s?e.push((0,h.__)("Email is required.","event-tickets")):b.email&&s&&!l&&e.push((0,h.__)("Please enter a valid email address.","event-tickets")),b.name&&!o?e.push((0,h.__)("Sender name is required.","event-tickets")):b.name&&o&&!g&&e.push((0,h.__)("Please enter a valid name (at least 2 characters).","event-tickets"))})(),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Ee,{}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-header",children:[(0,ne.jsx)("h1",{className:"tec-tickets-onboarding__tab-heading",children:(0,h.__)("Communication","event-tickets")}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__tab-subheader",children:(0,h.__)("Put your best face forward—let us know how you'd like your name and email to appear to customers.","event-tickets")})]}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-content",children:[(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__form-wrapper",children:[(0,ne.jsxs)(p.BaseControl,{__nextHasNoMarginBottom:!0,id:"sender-email",label:(0,h.__)("Email Address","event-tickets"),help:(0,h.__)("When your customers receive an email about a purchase what address should it be from?","event-tickets"),className:"tec-tickets-onboarding__form-field",children:[(0,ne.jsx)("input",{type:"email",id:"sender-email",value:s,onChange:e=>{const t=e.target.value;a(t)},onBlur:()=>{k((e=>({...e,email:!0}))),d((e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))(s))},placeholder:(0,h.__)("Email","event-tickets"),className:"tec-tickets-onboarding__input"+(!b.email||s&&l?"":" tec-tickets-onboarding__input--invalid"),required:!0}),b.email&&!s&&(0,ne.jsx)("span",{className:"tec-tickets-onboarding__invalid-label",style:{display:"block"},children:(0,h.__)("Email is required.","event-tickets")}),b.email&&s&&!l&&(0,ne.jsx)("span",{className:"tec-tickets-onboarding__invalid-label",style:{display:"block"},children:(0,h.__)("Please enter a valid email address.","event-tickets")})]}),(0,ne.jsxs)(p.BaseControl,{__nextHasNoMarginBottom:!0,id:"sender-name",label:(0,h.__)("Sender Name","event-tickets"),help:(0,h.__)("Who should we say the email is from?","event-tickets"),className:"tec-tickets-onboarding__form-field",children:[(0,ne.jsx)("input",{type:"text",id:"sender-name",value:o,onChange:e=>{const t=e.target.value;r(t)},onBlur:()=>{k((e=>({...e,name:!0}))),m(o.trim().length>1)},placeholder:(0,h.__)("Name","event-tickets"),className:"tec-tickets-onboarding__input"+(!b.name||o&&g?"":" tec-tickets-onboarding__input--invalid"),required:!0}),b.name&&!o&&(0,ne.jsx)("span",{className:"tec-tickets-onboarding__invalid-label",style:{display:"block"},children:(0,h.__)("Sender name is required.","event-tickets")}),b.name&&o&&!g&&(0,ne.jsx)("span",{className:"tec-tickets-onboarding__invalid-label",style:{display:"block"},children:(0,h.__)("Please enter a valid name (at least 2 characters).","event-tickets")})]})]}),(0,ne.jsx)(_e,{tabSettings:x,moveToNextTab:e,disabled:!S,onSuccess:()=>{}}),(0,ne.jsx)(he,{skipToNextTab:t,currentTab:2})]})]})},Ae=()=>(0,ne.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:55,height:55,fill:"none",className:"tec-tickets-onboarding__content-install-icon",role:"presentation",children:[(0,ne.jsx)("path",{fill:"#fff",d:"M7.713 21.637c-.82-2.175.324-4.589 2.55-5.376l26.243-9.285c2.268-.802 4.762.398 5.5 2.648l5.259 16.01c.089.271.145.55.156.835.197 5.237-2.37 12.901-10.316 16.627l-7.099 2.784-11.061 3.616a.714.714 0 0 1-.89-.42L7.713 21.638Z"}),(0,ne.jsx)("path",{fill:"#334AFF",fillRule:"evenodd",d:"m43.552 13.513-1.196-3.424c-.83-2.357-3.47-3.588-5.857-2.732L11.152 16.45c-2.34.839-3.554 3.37-2.72 5.674l1.2 3.22 33.92-11.83Z",clipRule:"evenodd"}),(0,ne.jsx)("path",{fill:"#0F1031",fillRule:"evenodd",d:"M31.964 5.019a.805.805 0 0 0-.99-.39.779.779 0 0 0-.477 1.004l.932 2.512-16.646 5.972-.91-2.455-.035-.078a.805.805 0 0 0-.99-.39.78.78 0 0 0-.477 1.004l.912 2.457-2.771.994-.164.062c-2.644 1.043-3.996 3.955-3.035 6.609l9.815 27.11.04.099a1.52 1.52 0 0 0 1.887.8l10.807-3.876a.814.814 0 0 0 .13-.06.808.808 0 0 0 .218-.083c2.555-1.427 4.47-3.97 6.076-7.467.341-.744.659-1.509.99-2.367l.075-.195.781-2.092a14 14 0 0 1 .33-.809l.074-.153.022-.043.196.006c3.142.084 5.733-.611 7.384-1.864-1.147 4.998-4.78 9.336-10.047 11.225a.779.779 0 0 0-.476 1.005.803.803 0 0 0 1.024.466c9.072-3.253 13.735-13.102 10.417-21.997L42.744 9.768l-.058-.159c-1.035-2.667-4.074-4.04-6.827-3.053l-2.93 1.051-.931-2.51-.034-.078Zm.012 4.598.917 2.47.034.08a.805.805 0 0 0 .99.389.779.779 0 0 0 .477-1.004l-.918-2.473 2.932-1.052.144-.049c1.929-.607 4.016.405 4.682 2.3l4.317 12.27.089.244a15.33 15.33 0 0 1 .875 4.559.767.767 0 0 0-.009.143c.085 2.54-3.113 4.385-8.205 4.11-.746-.04-.954.187-1.527 1.673l-.26.689-.428 1.153-.304.803c-.32.83-.626 1.567-.953 2.278-1.479 3.222-3.21 5.52-5.41 6.749l-.01.005a.824.824 0 0 0-.096.029l-10.71 3.84-9.785-27.027-.05-.146c-.585-1.858.413-3.857 2.292-4.53l2.77-.994.937 2.526.034.08a.805.805 0 0 0 .99.389.779.779 0 0 0 .477-1.004l-.938-2.529 16.646-5.971Z",clipRule:"evenodd"}),(0,ne.jsx)("path",{fill:"#334AFF",fillRule:"evenodd",d:"M35.821 23.45c.372.997 1.497 1.51 2.514 1.145 1.017-.365 1.54-1.468 1.167-2.465-.371-.997-1.497-1.51-2.514-1.145-1.016.365-1.539 1.469-1.167 2.466Zm-8.779 3.148c.371.997 1.497 1.51 2.514 1.145 1.017-.364 1.54-1.468 1.167-2.465-.371-.997-1.497-1.51-2.514-1.145-1.016.365-1.54 1.469-1.167 2.465ZM18.26 29.75c.371.997 1.497 1.51 2.514 1.145a1.912 1.912 0 0 0 1.167-2.466c-.372-.996-1.497-1.508-2.515-1.144a1.911 1.911 0 0 0-1.167 2.465Zm11.9 4.306c.37.997 1.497 1.509 2.513 1.144a1.911 1.911 0 0 0 1.167-2.465c-.372-.997-1.497-1.51-2.514-1.145-1.017.365-1.54 1.47-1.167 2.466Zm-8.958 3.21c.372.997 1.497 1.51 2.514 1.145 1.017-.365 1.54-1.468 1.167-2.465-.372-.997-1.497-1.51-2.514-1.145a1.911 1.911 0 0 0-1.167 2.465Z",clipRule:"evenodd"})]}),Me=()=>(0,ne.jsx)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"presentation",children:(0,ne.jsx)("path",{d:"M19.9436 3L22.5 4.80753L11.297 21H8.7406L2.5 12.2636L5.05639 9.85356L10.0188 14.4477L19.9436 3Z",fill:"#00A32A"})}),Oe=()=>{const e=(0,_.useDispatch)(ee).closeModal,t=(0,_.useDispatch)(q).completeTab,n=(0,_.useSelect)((e=>e(q).getSetting("action_nonce")),[]),s=(0,_.useSelect)((e=>e(q).getSetting("_wpnonce")),[]),a=(0,_.useSelect)((e=>e(q).getCompletedTabs)),i=(0,_.useSelect)((e=>e(q).getSkippedTabs)),[c,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{c&&(async()=>{t(3),oe().use(oe().createNonceMiddleware(s)),await oe()({method:"POST",data:{finished:!0,begun:!0,action_nonce:n,completedTabs:a(),skippedTabs:i()},path:G}),setTimeout((()=>{e()}),1e3)})()}),[c]),(0,ne.jsx)(p.Button,{variant:"link",onClick:()=>o(!0),className:"tec-tickets-onboarding__button tec-tickets-onboarding__button--skip tec-tickets-onboarding__success-finish",children:(0,h.__)("Finish the Event Tickets Setup","event-tickets")})},Pe=({onlyActivated:e=!1,alreadyActivated:t=!1})=>{const n=(0,_.useSelect)((e=>e(q).getSetting("tec-wizard-completed")||!1),[]),s=(0,_.useDispatch)(q).completeTab,a=(0,_.useDispatch)(q).updateSettings,[i,c]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{i&&(s(3),a({finished:!0,begun:!0}))}),[i]),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Ae,{}),(0,ne.jsx)("div",{className:"tec-tickets-onboarding__tab-header",children:(0,ne.jsx)("h1",{className:"tec-tickets-onboarding__tab-heading",children:(0,h.__)("The Events Calendar","event-tickets")})}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-content install-success",children:[(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__form-wrapper",children:[(0,ne.jsx)("div",{className:"tec-tickets-onboarding__success-icon",children:(0,ne.jsx)(Me,{})}),(0,ne.jsx)("h3",{className:"tec-tickets-onboarding__success-heading",children:(0,h.__)("Congratulations!","event-tickets")}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__success-message",children:e?(0,h.__)("The Events Calendar is now activated.","event-tickets"):(0,h.__)("The Events Calendar is installed and activated.","event-tickets")})]}),(0,ne.jsx)(p.Button,{variant:"primary",className:"tec-tickets-onboarding__button tec-tickets-onboarding__button--next",href:"/wp-admin/edit.php?post_type=tribe_events&page="+(n?"tec-events-settings":"first-time-setup"),onClick:()=>c(!0),children:n?(0,h.__)("Go to The Events Calendar Settings","event-tickets"):(0,h.__)("Continue to The Events Calendar Setup","event-tickets")}),(0,ne.jsx)(Oe,{})]})]})},Ie=({moveToNextTab:e,skipToNextTab:t})=>{const n=(0,_.useSelect)((e=>e(q).getSetting("tecInstalled")||!1),[]),s=(0,_.useSelect)((e=>e(q).getSetting("tecActive")||!1),[]),[a,c]=(0,i.useState)(!1),[o,r]=(0,i.useState)(!0);(0,i.useEffect)((()=>{s&&c(!0)}),[s]);const l={eventsCalendar:o,currentTab:4},d=n?(0,h.__)("Yes, activate The Events Calendar plugin for me.","event-tickets"):(0,h.__)("Yes, install The Events Calendar for free on my website.","event-tickets");return a?(0,ne.jsx)(Pe,{onlyActivated:n&&!s,alreadyActivated:s}):(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Ae,{}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-header",children:[(0,ne.jsx)("h1",{className:"tec-tickets-onboarding__tab-heading",children:(0,h.__)("The Events Calendar","event-tickets")}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__tab-subheader",children:(0,h.__)("Want powerful, seamless event management? Get everything you need—from a sleek calendar user interface to event subscriptions, virtual experiences, and custom automations—all in one place.","event-tickets")})]}),(0,ne.jsx)("div",{className:"tec-tickets-onboarding__tab-content",children:(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__form-wrapper events-install",children:[!s&&(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__checkbox tec-tickets-onboarding__checkbox--events",children:[(0,ne.jsx)(p.CheckboxControl,{__nextHasNoMarginBottom:!0,"aria-describedby":"tec-tickets-onboarding__checkbox-description",checked:o,onChange:r,id:"tec-tickets-onboarding__events-checkbox-input"}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__checkbox-description",children:[(0,ne.jsx)("label",{htmlFor:"tec-tickets-onboarding__events-checkbox-input",children:d}),(0,ne.jsx)("div",{id:"tec-tickets-onboarding__checkbox-description"})]})]}),(0,ne.jsx)(_e,{tabSettings:l,moveToNextTab:e,disabled:!o,onSuccess:()=>{c(!0)}}),(0,ne.jsx)(he,{skipToNextTab:t,currentTab:3,buttonText:(0,h.__)("Skip and finish setup","event-tickets")})]})})]})},Re=()=>(0,ne.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:33,height:32,fill:"none",className:"tec-tickets-onboarding__content-header-icon",role:"presentation",children:(0,ne.jsx)("path",{stroke:"#C3C4C7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M3.5 4h1.848a1.5 1.5 0 0 1 1.449 1.114l.51 1.915M10.5 19a4 4 0 0 0-4 4h21m-17-4h14.958a79.489 79.489 0 0 0 3.898-9.517A80.152 80.152 0 0 0 7.308 7.03M10.5 19 7.308 7.03M8.5 27a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm17 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"})}),Ze=({moveToNextTab:e,skipToNextTab:t})=>{const{paymentOption:n,isConnected:s}=(0,_.useSelect)((e=>({paymentOption:e(q).getSetting("paymentOption"),isConnected:e(q).isConnected()})),[]),[a,i]=(0,u.useState)(s?"connected":"disconnected"),c=(0,_.useSelect)((e=>e(q).getSettings)),o=(0,_.useSelect)((e=>e(q).getSetting("_wpnonce")),[]),r=(0,_.useSelect)((e=>e(q).getSetting("action_nonce")),[]),l=(0,_.useDispatch)(q).updateSettings,d={currentTab:2,action_nonce:r,gateway:n},p=["stripe","square"].includes(n)&&!s,g={stripe:{logo:(0,ne.jsx)(ve,{}),description:(0,h.__)("Enable credit card payments, Afterpay, Klarna and more on your website.","event-tickets"),connectText:(0,h.__)("Connect to Stripe","event-tickets")},square:{logo:(0,ne.jsx)(xe,{}),description:(0,h.__)("Charge online and on location. Compatible with any Square powered hardware for in-person transactions.","event-tickets"),connectText:(0,h.__)("Connect to Square","event-tickets")}};return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Re,{}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-header",children:[(0,ne.jsx)("h1",{className:"tec-tickets-onboarding__tab-heading",children:(0,h.__)("Sell your tickets online","event-tickets")}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__tab-subheader",children:(0,h.__)("Easily accept payments with your trusted gateway","event-tickets")})]}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-content",children:[["stripe","square"].includes(n)?(()=>{const e=g[n];return e?(0,ne.jsx)("div",{className:"tec-tickets-onboarding__form-wrapper",children:(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__payment-gateway",children:[(0,ne.jsx)("div",{className:"tec-tickets-onboarding__gateway-logo",children:e.logo}),(0,ne.jsx)("p",{className:"tec-tickets-onboarding__gateway-description",children:e.description}),"connected"===a?(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__connection-status tec-tickets-onboarding__connection-status--connected",children:[(0,ne.jsx)(ge,{})," ",(0,h.__)("Connected","event-tickets")]}):"failed"===a?(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__connection-error",children:[(0,ne.jsx)(me,{}),(0,ne.jsxs)("span",{className:"tec-tickets-onboarding__error-text",children:[(0,h.__)("Connection failed. ","event-tickets"),(0,ne.jsx)("a",{href:"/wp-admin/admin.php?page=tec-tickets-help",className:"tec-tickets-onboarding__support-link",children:(0,h.__)("Contact Support ↗","event-tickets")})]})]}):null]})}):null})():(0,ne.jsx)("div",{className:"tec-tickets-onboarding__form-wrapper",children:(0,ne.jsx)("div",{className:"tec-tickets-onboarding__payment-option",children:(0,h.__)("You have not selected a payment option yet.","event-tickets")})}),(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tab-actions",children:[p?(0,ne.jsx)(be,{connectionStatus:a,gatewayType:n,connectText:"failed"===a?(0,h.__)("Try again","event-tickets"):g[n]?.connectText||(0,h.__)("Connect","event-tickets"),onConnect:()=>(async e=>{i("connecting"),l(d),oe().use(oe().createNonceMiddleware(o));const t=await oe()({method:"POST",data:{...c(),gateway:e,action:"connect"},path:G});t.signup_url?window.location.href=t.signup_url:i("failed")})(n),onContinue:e,hideStatus:!0}):(0,ne.jsx)(_e,{tabSettings:d,moveToNextTab:e,onSuccess:()=>{}}),(0,ne.jsx)(he,{skipToNextTab:t,currentTab:2})]})]})]})},De=()=>{const e=[{id:"welcome",title:(0,h.__)("Welcome","event-tickets"),content:ue,ref:(0,i.useRef)(null),priority:10,isVisible:!0},{id:"settings",title:(0,h.__)("Selling Tickets","event-tickets"),content:Ne,ref:(0,i.useRef)(null),priority:20,isVisible:!0},{id:"payments",title:(0,h.__)("Payments","event-tickets"),content:Ze,ref:(0,i.useRef)(null),priority:25,isVisible:!0},{id:"communication",title:(0,h.__)("Communication","event-tickets"),content:Le,ref:(0,i.useRef)(null),priority:30,isVisible:!0},{id:"events",title:(0,h.__)("Events","event-tickets"),content:Ie,ref:(0,i.useRef)(null),priority:40,isVisible:!0}],{closeModal:t}=(0,_.useDispatch)(ee),n=(0,_.useSelect)((e=>e(q).getSetting("currentTab")))||0,s=(0,_.useSelect)((e=>e(q).getSkippedTabs()))||[],a=(0,_.useSelect)((e=>e(q).getCompletedTabs()))||[],c=(0,_.useDispatch)(q).completeTab,[o,r]=(0,u.useState)(e),l=()=>o.filter((e=>"function"==typeof e.isVisible?e.isVisible():!1!==e.isVisible)).sort(((e,t)=>(e.priority||0)-(t.priority||0))),[d,p]=(0,u.useState)((()=>l().map(((e,t)=>({...e,disabled:t>n}))))),[g,m]=(0,u.useState)(0),b=e=>{r((t=>[...t,e]))},k=(e,t)=>{r((n=>n.map((n=>n.id===e?{...n,...t}:n))))},v=()=>{r((e=>[...e].sort(((e,t)=>(e.priority||0)-(t.priority||0)))))};(0,u.useEffect)((()=>{const e=l();p(e.map(((e,t)=>({...e,disabled:t>n}))))}),[o,n]);const x=(e,t)=>{p((n=>n.map(((n,s)=>s===e?{...n,...t}:n))))};(0,u.useEffect)((()=>{var e;n>0&&((e=n)>=0&&e<d.length&&(((e,t)=>{p((n=>n.map(((n,s)=>s<e?{...n,...t}:n))))})(e,{completed:a.includes(e),skipped:s.includes(e),disabled:!1}),x(e,{disabled:!1}),m(e)))}),[n]);const S=()=>{g<d.length-1?(x(g,{completed:!0}),c(g),x(g+1,{disabled:!1}),m((e=>{const t=e+1;return d[t].ref.current&&d[t].ref.current.focus(),t}))):t()},y=()=>{g<d.length-1?(x(g+1,{disabled:!1}),m((e=>{const t=e+1;return d[t].ref.current&&d[t].ref.current.focus(),t}))):t()},T=e=>{d[e].disabled||m(e)},C=e=>{const t=g+e;t>=0&&t<d.length&&!d[t].disabled&&(m(t),d[t].ref.current&&d[t].ref.current.focus())},j=d[g]||d[0];return(0,ne.jsxs)("section",{className:`tec-tickets-onboarding__tabs tec-tickets-onboarding__tab-${j.id}`,children:[(0,ne.jsxs)("div",{className:"tec-tickets-onboarding__tabs-header",children:[(0,ne.jsx)(se,{}),(0,ne.jsx)("ul",{role:"tablist",className:"tec-tickets-onboarding__tabs-list","aria-label":(0,h.__)("Onboarding Tabs","event-tickets"),onKeyDown:e=>{"ArrowRight"===e.key&&C(1),"ArrowLeft"===e.key&&C(-1)},style:{gridTemplateColumns:`repeat(${d.length-1}, 1fr)`},children:d.map(((e,t)=>(0,ne.jsx)(ie,{index:t,tab:e,activeTab:g,handleChange:T},e.id)))})]}),d.map(((e,t)=>{const n=e.content;return(0,ne.jsx)(ae,{tabIndex:t,id:`${e.id}Panel`,tabId:e.id,activeTab:g,children:(0,ne.jsx)(n,{moveToNextTab:S,skipToNextTab:y,addTab:b,updateTab:k,reorderTabs:v})},e.id)}))]})},Be=({bootData:e})=>{const[t,n]=(0,i.useState)(!1),{initializeSettings:s}=(0,_.useDispatch)(q),{openModal:a}=(0,_.useDispatch)(ee),{closeModal:c}=(0,_.useDispatch)(ee);(0,u.useEffect)((()=>{s(e),n(!0)}),[]);const o=(0,_.useSelect)((e=>e(q).getSetting("finished"))),r=(0,_.useSelect)((e=>e(q).getSetting("forceDisplay"))),l=(0,_.useSelect)((e=>e(q).getSetting("begun"))),d=(0,_.useSelect)((e=>e(ee).getIsOpen()));return(0,u.useEffect)((()=>{!t||o&&!r||a()}),[l,o,r,t]),(0,ne.jsx)(ne.Fragment,{children:d&&(0,ne.jsx)(p.Modal,{overlayClassName:"tec-onboarding__modal-overlay",className:"tec-onboarding__modal",contentLabel:"Tickets Onboarding Wizard",isDismissible:!1,isFullScreen:!0,initialTabName:"intro",onRequestClose:c,selectOnMove:!1,shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!1,children:(0,ne.jsx)(De,{})})})};let Ve=!1;r()((()=>{const e=document.getElementById("tec-tickets-onboarding-wizard");if(!e)return void console.warn("Trigger element missing.");if(Ve)return void console.warn("Modal already rendered.");const t=e.dataset.containerElement,n=e.dataset.wizardBootData;if(!t||!n)return void console.warn("Container element or boot data is missing.");const s=document.getElementById(t);if(!s)return void console.warn(`Container with ID '${t}' not found.`);let a;try{a=JSON.parse(n)}catch(e){return void console.error("Failed to parse bootData:",e)}d().createRoot(s).render((0,ne.jsx)(Be,{bootData:a})),Ve=!0}))})(),window.tec=window.tec||{},window.tec.tickets=window.tec.tickets||{},window.tec.tickets.wizard={}})();