PageSourceSearch

https://stoody.ch/build/assets/Full-c5bd6f36.js

js stoody.ch collected 2026-10-08 10:21:28 UTC 9,101 bytes, 1 lines download raw bytes

1import{r as c,X as w,G as te,d as v,j as e,A as re}from"./app-3e6c8001.js";import{G as se}from"./GuestLayout-8663872b.js";import{T as oe,t as B}from"./theme-86ca6941.js";import{G as s,M as h,F as ae,T as ie,L as ne,A as I,a as L}from"./MuiTextField-97838bd6.js";import{L as le,A as ce,M as de}from"./MuiPhoneInput-3510aac5.js";import{S as me}from"./SaferpayCard-f6aff621.js";import{E as ue}from"./Error-553b32d5.js";import{P as m}from"./PricingBox-1233a821.js";import{u as pe}from"./routeHelper-263580b1.js";import{B as A}from"./Box-22381fa4.js";import{A as he,D as xe}from"./DateField-9caa25b3.js";import{T as fe,a as O}from"./ToggleButtonGroup-63379820.js";import"./transition-b5fd6a29.js";import"./keyboard-99ed6cb8.js";import"./objectWithoutPropertiesLoose-cf9a35a2.js";import"./defaultTheme-e3b9de71.js";import"./emotion-element-f0de968e.browser.esm-066ad97e.js";import"./index-326d5d05.js";import"./generateUtilityClasses-6ea31d3d.js";import"./emotion-react.browser.esm-3868c908.js";import"./Grow-21958414.js";import"./Transition-71ef3092.js";import"./setPrototypeOf-0bb37fbe.js";import"./Select-da495917.js";import"./assertThisInitialized-081f9914.js";import"./useThemeProps-cd6bba04.js";import"./index-229ecdbc.js";import"./TextInput-792d8ef8.js";import"./Spinner-9c07b518.js";import"./autoprefixer-e2b6411b.js";import"./CSSTransition-da348d9a.js";const u={basic:"1",month:"2"};function rt({countries:V=[],script:W,url:F,token:$,query:b={},formattedUserPrice:je,address:l,productPrices:G}){const[be,R]=c.useState(""),[ge,H]=c.useState(!1),{formattedPrice:ye,price:_e,auth:d}=w().props,{t:o}=pe(),[Ne,M]=c.useState(l?l.country:""),[g,z]=c.useState("credit_card"),[C,E]=c.useState(""),[y,P]=c.useState(!1),[x,U]=c.useState(!0),[f,j]=c.useState(!1),{data:S}=w().props,D={first_name:"input-first-name",last_name:"input-last-name",address:"input-address",postal_code:"input-postal-code",city:"input-city",country:"input-country",birth_date:"input-birth-date",phone:"input-phone"},{data:a,setData:n,processing:ve,errors:i,reset:Me,setError:X,clearErrors:q}=te({last_name:d.user.lastName,first_name:d.user.firstName,birth_date:d.user.birthDate?v(d.user.birthDate).format("YYYY-MM-DD"):null,phone:d.user.phone,address:l?l.address:"",postal_code:l?l.postal_code:"",city:l?l.city:"",country:l?l.country:"",token:"",payment_method:"credit_card",product_id:u.month}),T=V.map(t=>({label:t.native_name,id:t.iso_3166_1_alpha2}));c.useEffect(()=>{n("phone",C)},[C]);const k=t=>{t.data&&t.data.paymentRedirect&&(document.location.href=t.data.paymentRedirect)};c.useEffect(()=>(d.user.phone&&E(d.user.phone),window.addEventListener("message",k),()=>{window.removeEventListener("message",k)}),[]);const _=t=>{re.post("/checkout/full",t,{onError:r=>{X(r),j(!1);const N=Object.keys(D).filter(p=>r[p]),Y=N.length?N[0]:null;if(Y){const p=document.getElementById(D[Y]);p&&(p.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{p.querySelector("input").focus()},700))}},onSuccess:r=>{j(!1),r.props.data&&r.props.data.redirect&&(H(!0),R(r.props.data.redirect))}})},J=t=>{P(null),j(!0),q(),t.preventDefault(),g==="credit_card"?a.token?_(Object.assign({},b,a)):SaferpayFields.submit({onSuccess:function(r){n("token",r.token),_(Object.assign({},b,a,{token:r.token}))},onError:function(r){P(r.message),j(!1),document.getElementById("saferpay-wrapper").scrollIntoView({behavior:"smooth"})}}):_(Object.assign({},b,a))},K=(t,r)=>{r?(M(r.id),r?n("country",r.id):n("country",null)):(M(null),n("country",null))},Q=t=>{U(t)},Z=t=>{n("birth_date",v(t,"DD.MM.YYYY").format("YYYY-MM-DD"))},ee=t=>{z(t),n("payment_method",t)};return e.jsx(se,{children:e.jsx(oe,{theme:B,children:e.jsx(le,{dateAdapter:ce,children:e.jsx("div",{className:"mui mb-10",children:e.jsx(A,{className:"mui",children:e.jsxs(A,{className:"px-5",children:[S&&S.error&&e.jsx(ue,{className:"mt-5",children:o("checkout.error")}),e.jsxs("form",{onSubmit:J,className:"",children:[e.jsx(s,{item:!0,xs:12,children:e.jsx("div",{className:"max-w-4xl mx-auto py-5",children:e.jsxs(s,{container:!0,spacing:5,children:[e.jsx(s,{item:!0,xs:12,md:6,children:e.jsxs(m,{loading:x||f,errors:i,active:a.product_id===u.month,product:u.month,paymentError:y,onChange:t=>n("product_id",t),children:[e.jsx(m.header,{title:o("box-pricing.title.month"),active:a.product_id===u.month}),e.jsx(m.body,{}),e.jsxs(m.footer,{children:[e.jsx("span",{className:"text-[80px] font-bold text-primary",children:"2"}),e.jsxs("span",{className:"flex flex-col leading-loose pt-6",children:[e.jsx("span",{className:"text-3xl font-bold text-primary leading-none",children:".90"}),e.jsx("span",{className:"text-sm font-bold text-primary leading-none",dangerouslySetInnerHTML:{__html:o("box-pricing.title.month1")}})]})]})]})}),e.jsx(s,{item:!0,xs:12,md:6,children:e.jsxs(m,{loading:x||f,errors:i,active:a.product_id===u.basic,product:u.basic,paymentError:y,onChange:t=>n("product_id",t),children:[e.jsx(m.header,{title:o("box-pricing.title.year"),active:a.product_id===u.basic}),e.jsx(m.body,{}),e.jsx(m.footer,{children:e.jsxs("div",{className:"flex flex-col relative",children:[e.jsxs("h3",{className:"flex items-start italic",children:[e.jsx("span",{className:"text-[80px] font-bold text-primary",children:"29"}),e.jsx("span",{className:"flex flex-col leading-loose pt-8 pl-2 ",children:e.jsx("span",{className:"text-sm font-bold text-primary leading-none",dangerouslySetInnerHTML:{__html:o("box-pricing.title.year1")}})})]}),e.jsx("span",{className:"text-primary text-sm  whitespace-nowrap -mt-8",dangerouslySetInnerHTML:{__html:o("box-pricing.title.year2")}})]})})]})})]})})}),e.jsx("h3",{className:"font-semibold text-base py-5",children:o("full-registration.title1")}),e.jsxs(s,{container:!0,spacing:1,children:[e.jsx(s,{item:!0,xs:12,id:"input-first-name",children:e.jsx(h,{label:`${o("form.first_name")}*`,error:i.first_name,defaultValue:a.first_name,onChange:t=>n("first_name",t.target.value)})}),e.jsx(s,{item:!0,xs:12,id:"input-last-name",children:e.jsx(h,{label:`${o("form.last_name")}*`,error:i.last_name,defaultValue:a.last_name,onChange:t=>n("last_name",t.target.value)})}),e.jsx(s,{item:!0,xs:12,id:"input-address",children:e.jsx(h,{label:`${o("form.address")}*`,error:i.address,defaultValue:a.address,onChange:t=>n("address",t.target.value)})}),e.jsx(s,{item:!0,xs:12,id:"input-postal-code",children:e.jsx(h,{label:`${o("form.postal_code")}*`,error:i.postal_code,defaultValue:a.postal_code,onChange:t=>n("postal_code",t.target.value)})}),e.jsx(s,{item:!0,xs:12,id:"input-city",children:e.jsx(h,{label:`${o("form.city")}*`,error:i.postal_code,defaultValue:a.city,onChange:t=>n("city",t.target.value)})}),e.jsx(s,{item:!0,xs:12,id:"input-country",children:e.jsx(ae,{fullWidth:!0,children:e.jsx(he,{disablePortal:!0,error:i.country,id:"combo-box-demo",fullWidth:!0,isOptionEqualToValue:(t,r)=>t.id===r.id,options:T,defaultValue:T.find(t=>l?t.id===l.country:!1),onChange:K,renderInput:t=>e.jsx(ie,{fullWidth:!0,...t,error:i.country!==null&&i.country!==void 0,label:o("form.country")})})})}),e.jsx(s,{item:!0,xs:12,id:"input-birth-date",children:e.jsx(xe,{label:`${o("form.birth_date")}*`,fullWidth:!0,className:"shadow",defaultValue:d.user.birthDate?v(d.user.birthDate):"",error:i.birth_date!==null&&i.birth_date!==void 0,onChange:Z,format:"DD.MM.YYYY",readOnly:!1})}),e.jsx(s,{item:!0,xs:12,id:"input-phone",children:e.jsx(de,{type:"text",name:"phone",initialPhoneNumber:a.phone,className:"shadow rounded-[4px] w-full bg-none border border-primary    ",autoComplete:"phone-number",error:i.phone,onPhoneNumberChange:t=>E(t)})}),e.jsx(s,{item:!0,xs:12,children:e.jsx("h3",{className:"font-semibold text-base py-5",children:o("full-registration.title2")})}),e.jsx(s,{item:!0,xs:12,children:e.jsxs(fe,{value:g,exclusive:!0,disabled:x||f,"aria-label":"payment method",fullWidth:!0,color:"brand",size:"large",className:"rounded-none font-semibold h-14",onChange:(t,r)=>ee(r),sx:{"& .MuiButtonBase-root":{color:"#000",borderRadius:0},"&:hover .MuiButtonBase-root.Mui-selected, & .MuiButtonBase-root.Mui-selected":{backgroundColor:B.palette.brand.main,color:"#fff"}},children:[e.jsx(O,{value:"credit_card",className:"font-semibold tracking-tighter",children:o("checkout.payment-method.credit-card")}),e.jsx(O,{value:"twint",className:"font-semibold tracking-tighter",children:"TWINT"})]})}),e.jsx(s,{item:!0,xs:12,children:e.jsx("div",{className:g!=="credit_card"?"hidden":"",id:"saferpay-wrapper",children:e.jsx(me,{token:$,url:F,script:W,onProcessing:Q})})}),e.jsx(s,{item:!0,xs:12,children:e.jsx(ne,{type:"submit",color:"success",fullWidth:!0,loading:x||f,disableElevation:!0,className:"rounded-none h-14 tracking-tighter font-bold text-base",size:"large",variant:"contained",children:o("btns.paid",{price:`CHF ${G[a.product_id]}`})})}),Object.keys(i).length>0&&e.jsx(s,{item:!0,xs:12,children:e.jsxs(I,{severity:"error",children:[e.jsx(L,{children:"Whoops"}),Object.values(i).map((t,r)=>e.jsx("div",{children:t},r))]})}),y&&e.jsx(s,{item:!0,xs:12,children:e.jsxs(I,{severity:"error",children:[e.jsx(L,{children:"Whoops"}),o("checkout.data.error")]})})]})]})]})})})})})})}export{rt as default};

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.