@heycater/qualification-funnel 1.19.28 → 1.19.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/heycater-funnel.iife.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +6 -3
- package/package.json +1 -1
|
@@ -2616,7 +2616,7 @@
|
|
|
2616
2616
|
opacity: 0.9;
|
|
2617
2617
|
transform: translateY(-1px);
|
|
2618
2618
|
}
|
|
2619
|
-
`,$H=({ratings:e,onCancel:t,funnelContextRef:n,updateContext:r})=>{var o;const{i18n:i}=Wd(),a=null==(o=i.language)?void 0:o.startsWith("de"),s=LE(),{state:l,actions:u,answerOf:c}=tj(),[d,f]=g.useState(0),[p,h]=g.useState("questions"),[m,v]=g.useState(20),[y,b]=g.useState(!1),[w,x]=g.useState(null),[k,S]=g.useState(null),E=g.useRef(!1),{submitAsNewCustomer:_}=Vq(),L=lU[d],O=t||(()=>window.history.back());g.useEffect(()=>{if("redesign_people_count"===L){const e=c("min_order_number"),t=c("price_per_person");void 0===e&&u.answerQuestion("min_order_number",100),void 0===t&&u.answerQuestion("price_per_person",m)}},[L,u,c,m]),g.useEffect(()=>{!E.current&&n.current.session_id&&(E.current=!0,gM(n.current,L))},[n.current.session_id,L]);const j=g.useCallback((e,t)=>{let r=t;t instanceof Date&&(r=DL(t,"yyyy-MM-dd")),pM(n.current,{step_id:L,step_index:d,question_id:e,answer_value:r,is_last_question:!0})},[n,d,L]),M=g.useCallback(()=>{const e=d+1;e>=lU.length?h("loading"):f(e)},[d]),T=g.useCallback(()=>{d>0&&f(d-1)},[d]),P=g.useCallback(e=>{const t=lU.indexOf(e);t>=0&&("contact"===p&&h("questions"),f(t))},[p]),D=g.useCallback(e=>{u.answerQuestion("city",e),j("city",e),r({city:e}),M()},[u,j,r,M]),N=g.useCallback(e=>{const t=function(e){return lO[e]}(e);u.answerQuestion("event_type",e),u.answerQuestion("service_type",t.service_type),u.answerQuestion("catering_categories",[t.catering_category]),j("event_type",e),r({service_type:t.service_type,total_steps:cU()}),M()},[u,j,r,M]),R=g.useCallback(e=>{e&&(u.answerQuestion("event_date",e),j("event_date",e))},[u,j]),A=g.useCallback(e=>{u.answerQuestion("is_multi_day",e),j("is_multi_day",e)},[u,j]),F=g.useCallback(e=>{u.answerQuestion("min_order_number",e),j("min_order_number",e)},[u,j]),I=g.useCallback(e=>{v(e),u.answerQuestion("price_per_person",e),j("price_per_person",e)},[u,j]),z=g.useCallback(()=>{h("contact")},[]),$=g.useCallback(async e=>{b(!0);try{const t={first_name:e.vorname,last_name:e.nachname,company:e.firma,email:e.email,phone:e.telefon,deliveryAddressStreet:e.deliveryAddressStreet,deliveryAddressStreetNumber:e.deliveryAddressStreetNumber,deliveryAddressPostalCode:e.deliveryAddressPostalCode,deliveryAddressCity:e.deliveryAddressCity,deliveryAddressCountry:e.deliveryAddressCountry||"Germany",comment:e.kommentar},r=await _(t),{signInToken:o,opportunity:i}=r||{};if(
|
|
2619
|
+
`,$H=({ratings:e,onCancel:t,funnelContextRef:n,updateContext:r})=>{var o;const{i18n:i}=Wd(),a=null==(o=i.language)?void 0:o.startsWith("de"),s=LE(),{state:l,actions:u,answerOf:c}=tj(),[d,f]=g.useState(0),[p,h]=g.useState("questions"),[m,v]=g.useState(20),[y,b]=g.useState(!1),[w,x]=g.useState(null),[k,S]=g.useState(null),E=g.useRef(!1),{submitAsNewCustomer:_}=Vq(),L=lU[d],O=t||(()=>window.history.back());g.useEffect(()=>{if("redesign_people_count"===L){const e=c("min_order_number"),t=c("price_per_person");void 0===e&&u.answerQuestion("min_order_number",100),void 0===t&&u.answerQuestion("price_per_person",m)}},[L,u,c,m]),g.useEffect(()=>{!E.current&&n.current.session_id&&(E.current=!0,gM(n.current,L))},[n.current.session_id,L]);const j=g.useCallback((e,t)=>{let r=t;t instanceof Date&&(r=DL(t,"yyyy-MM-dd")),pM(n.current,{step_id:L,step_index:d,question_id:e,answer_value:r,is_last_question:!0})},[n,d,L]),M=g.useCallback(()=>{const e=d+1;e>=lU.length?h("loading"):f(e)},[d]),T=g.useCallback(()=>{d>0&&f(d-1)},[d]),P=g.useCallback(e=>{const t=lU.indexOf(e);t>=0&&("contact"===p&&h("questions"),f(t))},[p]),D=g.useCallback(e=>{u.answerQuestion("city",e),j("city",e),r({city:e}),M()},[u,j,r,M]),N=g.useCallback(e=>{const t=function(e){return lO[e]}(e);u.answerQuestion("event_type",e),u.answerQuestion("service_type",t.service_type),u.answerQuestion("catering_categories",[t.catering_category]),j("event_type",e),r({service_type:t.service_type,total_steps:cU()}),M()},[u,j,r,M]),R=g.useCallback(e=>{e&&(u.answerQuestion("event_date",e),j("event_date",e))},[u,j]),A=g.useCallback(e=>{u.answerQuestion("is_multi_day",e),j("is_multi_day",e)},[u,j]),F=g.useCallback(e=>{u.answerQuestion("min_order_number",e),j("min_order_number",e)},[u,j]),I=g.useCallback(e=>{v(e),u.answerQuestion("price_per_person",e),j("price_per_person",e)},[u,j]),z=g.useCallback(()=>{h("contact")},[]),$=g.useCallback(async e=>{b(!0);try{const t={first_name:e.vorname,last_name:e.nachname,company:e.firma,email:e.email,phone:e.telefon,deliveryAddressStreet:e.deliveryAddressStreet,deliveryAddressStreetNumber:e.deliveryAddressStreetNumber,deliveryAddressPostalCode:e.deliveryAddressPostalCode,deliveryAddressCity:e.deliveryAddressCity,deliveryAddressCountry:e.deliveryAddressCountry||"Germany",comment:e.kommentar},r=await _(t),{signInToken:o,opportunity:i}=r||{};if(!i||!i.id)return console.error("[HeyCater Funnel] submitAsNewCustomer returned invalid opportunity:",r),void b(!1);const a=o?`/${s.locale}/account/requests/${i.id}?one_time_sign_in_token=${o}`:`/${s.locale}/account/external/requests/${i.id}`;S(a),mM(n.current),x(e),h("done")}catch(t){console.error("Failed to submit request:",t),b(!1)}},[_,n,s.locale]),B=g.useCallback(()=>{h("questions"),f(lU.length-1)},[]),q=g.useCallback(()=>{switch(L){case"redesign_city":return!!c("city");case"redesign_event_type":return!!c("event_type");case"redesign_date":return!!c("event_date");case"redesign_people_count":const e=c("min_order_number");return"number"==typeof e&&e>0;default:return!1}},[L,c]);if("loading"===p)return C.jsx(qH,{children:C.jsx(WH,{$fullWidth:!0,children:C.jsx(FU,{onComplete:z})})});if("contact"===p){const e=a?"Fast geschafft – nur noch deine Kontaktdaten":"Almost done – just your contact details",t=a?"Danach meldet sich dein Cateringexperte und schickt dir passende Angebote.":"Your catering expert will then get in touch and send you matching offers.";return C.jsxs(qH,{children:[C.jsx(fU,{currentStepId:sU,onStepClick:P}),C.jsxs(WH,{children:[C.jsxs(VH,{children:[C.jsx(UH,{children:C.jsx(xD,{height:20})}),C.jsx(HH,{children:C.jsx(ZH,{children:a?"Schritt 5 von 5":"Step 5 of 5"})}),C.jsx(KH,{children:C.jsx(GH,{$progress:100})})]}),C.jsxs(QH,{children:[C.jsx(JH,{onClick:O,children:a?"Abbrechen":"Cancel"}),C.jsx(XH,{children:a?"Schritt 5 von 5":"Step 5 of 5"})]}),C.jsxs(fZ,{children:[C.jsx(tZ,{children:e}),C.jsx(nZ,{children:t}),C.jsx(JU,{onSubmit:$,onBack:B,isSubmitting:y})]})]})]})}if("done"===p){const e=(null==w?void 0:w.vorname)||"",t=(null==w?void 0:w.email)||"",n=a?[{n:"1",title:"Wir prüfen deine Anfrage",desc:"Unser Team schaut sich deine Anfrage an."},{n:"2",title:"Du erhältst Angebote",desc:"Innerhalb weniger Stunden bekommst du bis zu 3 passende Angebote."},{n:"3",title:"Buche deinen Favoriten",desc:"Vergleiche die Angebote und buche, wenn du bereit bist."}]:[{n:"1",title:"We review your request",desc:"Our team will look at your request."},{n:"2",title:"You receive offers",desc:"Within a few hours you'll receive up to 3 matching offers."},{n:"3",title:"Book your favorite",desc:"Compare the offers and book when you're ready."}];return C.jsx(qH,{children:C.jsx(WH,{$fullWidth:!0,children:C.jsxs(pZ,{children:[C.jsx(hZ,{children:C.jsx(xD,{height:24})}),C.jsxs(mZ,{children:[C.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M20 6L9 17l-5-5"})}),a?"Anfrage gesendet":"Request sent"]}),C.jsx(gZ,{children:a?`Danke, ${e}!`:`Thank you, ${e}!`}),C.jsx(vZ,{children:a?"Wir haben deine Anfrage erhalten und stellen jetzt passende Angebote für dich zusammen.":"We have received your request and are now putting together matching offers for you."}),C.jsxs(yZ,{children:[C.jsx(bZ,{children:a?"So geht es weiter":"What happens next"}),C.jsx(wZ,{children:n.map(e=>C.jsxs(xZ,{children:[C.jsx(CZ,{children:e.n}),C.jsxs(kZ,{children:[C.jsx(SZ,{children:e.title}),C.jsx(EZ,{children:e.desc})]})]},e.n))})]}),C.jsx(_Z,{children:a?C.jsxs(C.Fragment,{children:["Eine Bestätigung ist unterwegs an ",C.jsx("strong",{children:t}),"."]}):C.jsxs(C.Fragment,{children:["A confirmation is on its way to ",C.jsx("strong",{children:t}),"."]})}),k&&C.jsx(LZ,{onClick:()=>window.location.href=k,children:a?"Zu meiner Anfrage":"View my request"})]})})})}const W=uU[L],V=a?W.titleDe:W.titleEn,U=a?W.subtitleDe:W.subtitleEn,H=cU(),Z=(()=>{const e=[],t=c("city"),n=c("event_type"),r=c("event_date");if(t&&e.push(eV[t]||t),n&&d>=2){const t=a?tV:nV;e.push(t[n]||n)}return d>=3&&r&&e.push(DL(r,"dd.MM.yy")),e})(),Y=d>0,K=d>=1&&Z.length>0;return C.jsxs(qH,{children:[C.jsx(fU,{currentStepId:L,onStepClick:P}),C.jsxs(WH,{children:[C.jsxs(VH,{children:[C.jsx(UH,{children:C.jsx(xD,{height:20})}),C.jsxs(HH,{children:[C.jsx(ZH,{children:a?`Schritt ${d+1} von ${H}`:`Step ${d+1} of ${H}`}),C.jsx(YH,{onClick:O,children:a?"Abbrechen":"Cancel"})]}),C.jsx(KH,{children:C.jsx(GH,{$progress:(d+1)/H*100})})]}),C.jsxs(QH,{children:[C.jsx(JH,{onClick:O,children:a?"Abbrechen":"Cancel"}),C.jsx(XH,{children:a?`Schritt ${d+1} von ${H}`:`Step ${d+1} of ${H}`})]}),C.jsxs(eZ,{children:[C.jsx(tZ,{children:V}),U&&C.jsx(nZ,{children:U}),C.jsx(rZ,{children:(()=>{switch(L){case"redesign_city":return C.jsx(aV,{selected:c("city"),onSelect:D});case"redesign_event_type":return C.jsx(gV,{selected:c("event_type"),onSelect:N,variant:"primary"});case"redesign_date":return C.jsx(EV,{value:c("event_date"),onChange:R,isMultiDay:!!c("is_multi_day"),onMultiDayChange:A});case"redesign_people_count":return C.jsx(qV,{peopleCount:c("min_order_number")||100,budgetPerPerson:m,onPeopleCountChange:F,onBudgetPerPersonChange:I});default:return null}})()})]}),C.jsxs(oZ,{children:[K&&C.jsxs(iZ,{children:[C.jsx(aZ,{children:a?"Deine Auswahl:":"Your selection:"}),Z.map((e,t)=>C.jsx(lZ,{children:e},t))]}),C.jsxs(sZ,{children:[C.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M20 6L9 17l-5-5"})}),a?"Deine Anfrage ist kostenlos & unverbindlich":"Your request is free & non-binding"]}),C.jsxs(uZ,{children:[Y&&C.jsx(cZ,{type:"button",onClick:T,children:a?"Zurück":"Back"}),C.jsx(dZ,{type:"button",onClick:M,disabled:!q(),children:a?"Weiter":"Continue"})]})]})]})]})},BH=Op`
|
|
2620
2620
|
from { opacity: 0; transform: translateY(8px); }
|
|
2621
2621
|
to { opacity: 1; transform: none; }
|
|
2622
2622
|
`,qH=_p.div`
|
package/dist/index.cjs.js
CHANGED
|
@@ -2528,7 +2528,7 @@ object-assign
|
|
|
2528
2528
|
opacity: 0.9;
|
|
2529
2529
|
transform: translateY(-1px);
|
|
2530
2530
|
}
|
|
2531
|
-
`,$D=({ratings:e,onCancel:r,funnelContextRef:o,updateContext:a})=>{var s;const{i18n:l}=i.useTranslation(),u=null==(s=l.language)?void 0:s.startsWith("de"),c=du(),{state:d,actions:f,answerOf:p}=Mf(),[h,m]=n.useState(0),[g,y]=n.useState("questions"),[v,b]=n.useState(20),[x,C]=n.useState(!1),[w,L]=n.useState(null),[k,j]=n.useState(null),M=n.useRef(!1),{submitAsNewCustomer:S}=T_(),_=XO[h],E=r||(()=>window.history.back());n.useEffect(()=>{if("redesign_people_count"===_){const e=p("min_order_number"),t=p("price_per_person");void 0===e&&f.answerQuestion("min_order_number",100),void 0===t&&f.answerQuestion("price_per_person",v)}},[_,f,p,v]),n.useEffect(()=>{!M.current&&o.current.session_id&&(M.current=!0,qp(o.current,_))},[o.current.session_id,_]);const O=n.useCallback((e,t)=>{let n=t;t instanceof Date&&(n=rd(t,"yyyy-MM-dd")),Rp(o.current,{step_id:_,step_index:h,question_id:e,answer_value:n,is_last_question:!0})},[o,h,_]),$=n.useCallback(()=>{const e=h+1;e>=XO.length?y("loading"):m(e)},[h]),D=n.useCallback(()=>{h>0&&m(h-1)},[h]),z=n.useCallback(e=>{const t=XO.indexOf(e);t>=0&&("contact"===g&&y("questions"),m(t))},[g]),A=n.useCallback(e=>{f.answerQuestion("city",e),O("city",e),a({city:e}),$()},[f,O,a,$]),T=n.useCallback(e=>{const t=function(e){return Dd[e]}(e);f.answerQuestion("event_type",e),f.answerQuestion("service_type",t.service_type),f.answerQuestion("catering_categories",[t.catering_category]),O("event_type",e),a({service_type:t.service_type,total_steps:t$()}),$()},[f,O,a,$]),P=n.useCallback(e=>{e&&(f.answerQuestion("event_date",e),O("event_date",e))},[f,O]),F=n.useCallback(e=>{f.answerQuestion("is_multi_day",e),O("is_multi_day",e)},[f,O]),R=n.useCallback(e=>{f.answerQuestion("min_order_number",e),O("min_order_number",e)},[f,O]),I=n.useCallback(e=>{b(e),f.answerQuestion("price_per_person",e),O("price_per_person",e)},[f,O]),N=n.useCallback(()=>{y("contact")},[]),q=n.useCallback(async e=>{C(!0);try{const t={first_name:e.vorname,last_name:e.nachname,company:e.firma,email:e.email,phone:e.telefon,deliveryAddressStreet:e.deliveryAddressStreet,deliveryAddressStreetNumber:e.deliveryAddressStreetNumber,deliveryAddressPostalCode:e.deliveryAddressPostalCode,deliveryAddressCity:e.deliveryAddressCity,deliveryAddressCountry:e.deliveryAddressCountry||"Germany",comment:e.kommentar},n=await S(t),{signInToken:r,opportunity:i}=n||{};if(
|
|
2531
|
+
`,$D=({ratings:e,onCancel:r,funnelContextRef:o,updateContext:a})=>{var s;const{i18n:l}=i.useTranslation(),u=null==(s=l.language)?void 0:s.startsWith("de"),c=du(),{state:d,actions:f,answerOf:p}=Mf(),[h,m]=n.useState(0),[g,y]=n.useState("questions"),[v,b]=n.useState(20),[x,C]=n.useState(!1),[w,L]=n.useState(null),[k,j]=n.useState(null),M=n.useRef(!1),{submitAsNewCustomer:S}=T_(),_=XO[h],E=r||(()=>window.history.back());n.useEffect(()=>{if("redesign_people_count"===_){const e=p("min_order_number"),t=p("price_per_person");void 0===e&&f.answerQuestion("min_order_number",100),void 0===t&&f.answerQuestion("price_per_person",v)}},[_,f,p,v]),n.useEffect(()=>{!M.current&&o.current.session_id&&(M.current=!0,qp(o.current,_))},[o.current.session_id,_]);const O=n.useCallback((e,t)=>{let n=t;t instanceof Date&&(n=rd(t,"yyyy-MM-dd")),Rp(o.current,{step_id:_,step_index:h,question_id:e,answer_value:n,is_last_question:!0})},[o,h,_]),$=n.useCallback(()=>{const e=h+1;e>=XO.length?y("loading"):m(e)},[h]),D=n.useCallback(()=>{h>0&&m(h-1)},[h]),z=n.useCallback(e=>{const t=XO.indexOf(e);t>=0&&("contact"===g&&y("questions"),m(t))},[g]),A=n.useCallback(e=>{f.answerQuestion("city",e),O("city",e),a({city:e}),$()},[f,O,a,$]),T=n.useCallback(e=>{const t=function(e){return Dd[e]}(e);f.answerQuestion("event_type",e),f.answerQuestion("service_type",t.service_type),f.answerQuestion("catering_categories",[t.catering_category]),O("event_type",e),a({service_type:t.service_type,total_steps:t$()}),$()},[f,O,a,$]),P=n.useCallback(e=>{e&&(f.answerQuestion("event_date",e),O("event_date",e))},[f,O]),F=n.useCallback(e=>{f.answerQuestion("is_multi_day",e),O("is_multi_day",e)},[f,O]),R=n.useCallback(e=>{f.answerQuestion("min_order_number",e),O("min_order_number",e)},[f,O]),I=n.useCallback(e=>{b(e),f.answerQuestion("price_per_person",e),O("price_per_person",e)},[f,O]),N=n.useCallback(()=>{y("contact")},[]),q=n.useCallback(async e=>{C(!0);try{const t={first_name:e.vorname,last_name:e.nachname,company:e.firma,email:e.email,phone:e.telefon,deliveryAddressStreet:e.deliveryAddressStreet,deliveryAddressStreetNumber:e.deliveryAddressStreetNumber,deliveryAddressPostalCode:e.deliveryAddressPostalCode,deliveryAddressCity:e.deliveryAddressCity,deliveryAddressCountry:e.deliveryAddressCountry||"Germany",comment:e.kommentar},n=await S(t),{signInToken:r,opportunity:i}=n||{};if(!i||!i.id)return console.error("[HeyCater Funnel] submitAsNewCustomer returned invalid opportunity:",n),void C(!1);const a=r?`/${c.locale}/account/requests/${i.id}?one_time_sign_in_token=${r}`:`/${c.locale}/account/external/requests/${i.id}`;j(a),Np(o.current),L(e),y("done")}catch(t){console.error("Failed to submit request:",t),C(!1)}},[S,o,c.locale]),Z=n.useCallback(()=>{y("questions"),m(XO.length-1)},[]),B=n.useCallback(()=>{switch(_){case"redesign_city":return!!p("city");case"redesign_event_type":return!!p("event_type");case"redesign_date":return!!p("event_date");case"redesign_people_count":const e=p("min_order_number");return"number"==typeof e&&e>0;default:return!1}},[_,p]);if("loading"===g)return t.jsx(zD,{children:t.jsx(AD,{$fullWidth:!0,children:t.jsx(_$,{onComplete:N})})});if("contact"===g){const e=u?"Fast geschafft – nur noch deine Kontaktdaten":"Almost done – just your contact details",n=u?"Danach meldet sich dein Cateringexperte und schickt dir passende Angebote.":"Your catering expert will then get in touch and send you matching offers.";return t.jsxs(zD,{children:[t.jsx(r$,{currentStepId:JO,onStepClick:z}),t.jsxs(AD,{children:[t.jsxs(TD,{children:[t.jsx(PD,{children:t.jsx(xm,{height:20})}),t.jsx(FD,{children:t.jsx(RD,{children:u?"Schritt 5 von 5":"Step 5 of 5"})}),t.jsx(ND,{children:t.jsx(qD,{$progress:100})})]}),t.jsxs(ZD,{children:[t.jsx(BD,{onClick:E,children:u?"Abbrechen":"Cancel"}),t.jsx(WD,{children:u?"Schritt 5 von 5":"Step 5 of 5"})]}),t.jsxs(rz,{children:[t.jsx(UD,{children:e}),t.jsx(HD,{children:n}),t.jsx(B$,{onSubmit:q,onBack:Z,isSubmitting:x})]})]})]})}if("done"===g){const e=(null==w?void 0:w.vorname)||"",n=(null==w?void 0:w.email)||"",r=u?[{n:"1",title:"Wir prüfen deine Anfrage",desc:"Unser Team schaut sich deine Anfrage an."},{n:"2",title:"Du erhältst Angebote",desc:"Innerhalb weniger Stunden bekommst du bis zu 3 passende Angebote."},{n:"3",title:"Buche deinen Favoriten",desc:"Vergleiche die Angebote und buche, wenn du bereit bist."}]:[{n:"1",title:"We review your request",desc:"Our team will look at your request."},{n:"2",title:"You receive offers",desc:"Within a few hours you'll receive up to 3 matching offers."},{n:"3",title:"Book your favorite",desc:"Compare the offers and book when you're ready."}];return t.jsx(zD,{children:t.jsx(AD,{$fullWidth:!0,children:t.jsxs(iz,{children:[t.jsx(oz,{children:t.jsx(xm,{height:24})}),t.jsxs(az,{children:[t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}),u?"Anfrage gesendet":"Request sent"]}),t.jsx(sz,{children:u?`Danke, ${e}!`:`Thank you, ${e}!`}),t.jsx(lz,{children:u?"Wir haben deine Anfrage erhalten und stellen jetzt passende Angebote für dich zusammen.":"We have received your request and are now putting together matching offers for you."}),t.jsxs(uz,{children:[t.jsx(cz,{children:u?"So geht es weiter":"What happens next"}),t.jsx(dz,{children:r.map(e=>t.jsxs(fz,{children:[t.jsx(pz,{children:e.n}),t.jsxs(hz,{children:[t.jsx(mz,{children:e.title}),t.jsx(gz,{children:e.desc})]})]},e.n))})]}),t.jsx(yz,{children:u?t.jsxs(t.Fragment,{children:["Eine Bestätigung ist unterwegs an ",t.jsx("strong",{children:n}),"."]}):t.jsxs(t.Fragment,{children:["A confirmation is on its way to ",t.jsx("strong",{children:n}),"."]})}),k&&t.jsx(vz,{onClick:()=>window.location.href=k,children:u?"Zu meiner Anfrage":"View my request"})]})})})}const W=e$[_],V=u?W.titleDe:W.titleEn,U=u?W.subtitleDe:W.subtitleEn,H=t$(),G=(()=>{const e=[],t=p("city"),n=p("event_type"),r=p("event_date");if(t&&e.push(VE[t]||t),n&&h>=2){const t=u?UE:HE;e.push(t[n]||n)}return h>=3&&r&&e.push(rd(r,"dd.MM.yy")),e})(),K=h>0,Y=h>=1&&G.length>0;return t.jsxs(zD,{children:[t.jsx(r$,{currentStepId:_,onStepClick:z}),t.jsxs(AD,{children:[t.jsxs(TD,{children:[t.jsx(PD,{children:t.jsx(xm,{height:20})}),t.jsxs(FD,{children:[t.jsx(RD,{children:u?`Schritt ${h+1} von ${H}`:`Step ${h+1} of ${H}`}),t.jsx(ID,{onClick:E,children:u?"Abbrechen":"Cancel"})]}),t.jsx(ND,{children:t.jsx(qD,{$progress:(h+1)/H*100})})]}),t.jsxs(ZD,{children:[t.jsx(BD,{onClick:E,children:u?"Abbrechen":"Cancel"}),t.jsx(WD,{children:u?`Schritt ${h+1} von ${H}`:`Step ${h+1} of ${H}`})]}),t.jsxs(VD,{children:[t.jsx(UD,{children:V}),U&&t.jsx(HD,{children:U}),t.jsx(GD,{children:(()=>{switch(_){case"redesign_city":return t.jsx(QE,{selected:p("city"),onSelect:A});case"redesign_event_type":return t.jsx(sO,{selected:p("event_type"),onSelect:T,variant:"primary"});case"redesign_date":return t.jsx(gO,{value:p("event_date"),onChange:P,isMultiDay:!!p("is_multi_day"),onMultiDayChange:F});case"redesign_people_count":return t.jsx(zO,{peopleCount:p("min_order_number")||100,budgetPerPerson:v,onPeopleCountChange:R,onBudgetPerPersonChange:I});default:return null}})()})]}),t.jsxs(KD,{children:[Y&&t.jsxs(YD,{children:[t.jsx(QD,{children:u?"Deine Auswahl:":"Your selection:"}),G.map((e,n)=>t.jsx(XD,{children:e},n))]}),t.jsxs(JD,{children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}),u?"Deine Anfrage ist kostenlos & unverbindlich":"Your request is free & non-binding"]}),t.jsxs(ez,{children:[K&&t.jsx(tz,{type:"button",onClick:D,children:u?"Zurück":"Back"}),t.jsx(nz,{type:"button",onClick:$,disabled:!B(),children:u?"Weiter":"Continue"})]})]})]})]})},DD=o.keyframes`
|
|
2532
2532
|
from { opacity: 0; transform: translateY(8px); }
|
|
2533
2533
|
to { opacity: 1; transform: none; }
|
|
2534
2534
|
`,zD=o.div`
|
package/dist/index.esm.js
CHANGED
|
@@ -32395,10 +32395,13 @@ const RedesignedFunnel = ({
|
|
|
32395
32395
|
};
|
|
32396
32396
|
const response = await submitAsNewCustomer(buildValues);
|
|
32397
32397
|
const { signInToken, opportunity } = response || {};
|
|
32398
|
-
if (opportunity
|
|
32399
|
-
|
|
32400
|
-
|
|
32398
|
+
if (!opportunity || !opportunity.id) {
|
|
32399
|
+
console.error("[HeyCater Funnel] submitAsNewCustomer returned invalid opportunity:", response);
|
|
32400
|
+
setIsSubmitting(false);
|
|
32401
|
+
return;
|
|
32401
32402
|
}
|
|
32403
|
+
const accountUrl = signInToken ? `/${router.locale}/account/requests/${opportunity.id}?one_time_sign_in_token=${signInToken}` : `/${router.locale}/account/external/requests/${opportunity.id}`;
|
|
32404
|
+
setRedirectUrl(accountUrl);
|
|
32402
32405
|
trackCompleted(funnelContextRef.current);
|
|
32403
32406
|
setSubmittedData(formData);
|
|
32404
32407
|
setPhase("done");
|