PageSourceSearch

https://wbk-assets.webook.com/0.7.8.2/assets/index-ngrN4glF.js

js webook.com collected 2026-10-03 20:44:08 UTC 6,546 bytes, 1 lines download raw bytes

1import{C as V,j as e,u as W}from"./@wbk/hooks-FtCTMeyH.js";import{e as _,f as q,r as F,L as P}from"./vendor-Cc9w-i99.js";import{I as v,d as U,B as S}from"./@wbk/ui-DZdD23Ta.js";import{c9 as R,ca as $,cb as E}from"./@wbk/queue-8-09eRJS.js";import{S as z,F as T}from"./index-DZ2Htu0z.js";import{u as B,C}from"./react-hook-form-D_m77UuM.js";import{W as D}from"./@wbk/config-DuwrGB8a.js";import{u as w}from"./react-i18next-Dxy0wzdl.js";import{AuthForm as G}from"./@wbk/auth-Djoddyo0.js";import{k as M}from"./@wbk/svg-Bua7FxzL.js";import"./@wbk/api-DFKMxA3e.js";import"./@wbk/logger-DfNVpG3P.js";import"./i18next-Ce0fiPMx.js";import"./i18next-http-backend-C2uFdLra.js";import"./i18next-browser-languagedetector-Bv2FoO1s.js";import"./react-helmet-BcOPeyN0.js";import"./@wbk/analytics-B-_ZPhJq.js";import"./@wbk/contentful-C-wfS48z.js";import"./@wbk/currency-BxlCDaIM.js";import"./@wbk/ticketing-Og7zkUfp.js";import"./@wbk/payment-cL5x8D1N.js";import"./@wbk/flights-Cjxxns74.js";import"./@wbk/hotels-CFdSoV_6.js";import"./@smc/ads-C1pDiBF5.js";import"./@wbk/auction-CsNezADS.js";const H=({token:n})=>{var y,N,k;const{lang:d}=_(),{t:a}=w(["common","profile"]),{mutateAsync:l,isPending:u,error:o}=R(),f=q(),{register:x,control:h,setValue:p,handleSubmit:L,formState:{errors:m},watch:A}=B({defaultValues:{token:n,selected_country:V.find(s=>s.code==="SA")}}),t=A("selected_country"),O=async s=>{try{const{selected_country:i,...r}=s;await l({...r,country_code:i==null?void 0:i.code,lang:d}),f(`/${d}/profile/bookings`,{replace:!0})}catch{}};return e.jsx(D,{children:e.jsx("form",{className:"container my-8 max-w-lg",onSubmit:L(O),noValidate:!0,children:e.jsxs("div",{className:"bg-body-level-1 space-y-4 rounded-lg p-4",children:[e.jsx("div",{className:"mt-1 flex flex-col-reverse items-center justify-between gap-4 sm:flex-row",children:e.jsxs("div",{className:"grow space-y-2",children:[e.jsx("h4",{className:"text-2xl",children:a("profile:claim_your_tickets")}),e.jsx("p",{className:"text-sm text-zinc-500",children:a("profile:claim_your_tickets_desc")})]})}),e.jsxs("fieldset",{className:"flex flex-col gap-2 space-y-4 py-1 sm:flex-row sm:space-y-0",children:[e.jsx("div",{className:"grow",children:e.jsx(v,{id:"first_name",label:a("profile:form.first_name"),...x("first_name",{required:a("common:validation.required"),maxLength:{value:25,message:a("common:validation.max_length",{length:25})}}),onChange:s=>{p("first_name",s)},error:(y=m.first_name)==null?void 0:y.message})}),e.jsx("div",{className:"grow",children:e.jsx(v,{id:"last_name",autoComplete:"off",label:a("profile:form.last_name"),...x("last_name",{required:a("common:validation.required"),maxLength:{value:25,message:a("common:validation.max_length",{length:25})}}),onChange:s=>{p("last_name",s)},error:(N=m.last_name)==null?void 0:N.message})})]}),e.jsx("fieldset",{className:"my-4",children:e.jsx("div",{className:"relative",children:e.jsx(v,{id:"email",autoComplete:"off",label:a("profile:form.email"),...x("email",{required:a("common:validation.required")}),onChange:s=>{p("email",s)},error:(k=m.email)==null?void 0:k.message})})}),e.jsx("fieldset",{children:e.jsx(C,{control:h,name:"password",rules:{required:a("common:validation.required"),minLength:{value:8,message:a("common:validation.invalid_password")}},defaultValue:"",render:({field:{onChange:s,...i}})=>{var r;return e.jsx(v,{...i,type:"password",label:a("common:auth.password"),autoComplete:"off",onChange:c=>{s(c)},error:(r=m.password)==null?void 0:r.message})}})}),e.jsx(C,{name:"phone",control:h,rules:{required:a("common:validation.required"),validate:s=>{var r,c,g;const i=(r=t==null?void 0:t.mobile_starts_with)==null?void 0:r.length;if(s.includes(" "))return a("common:validation.invalid_mobile");if(i){const j=(c=t==null?void 0:t.mobile_starts_with)==null?void 0:c.some(I=>s.startsWith(I)),b=s.length>=Number((g=t==null?void 0:t.phone_number_lengths)==null?void 0:g[0]);return j&&b||a("common:validation.invalid_mobile")}}},render:({field:{value:s,...i}})=>{var r,c,g;return e.jsx(U,{label:a("profile:form.mobile"),...i,country:t,mobile:s||"",onChange:(j,b)=>{p(j==="country"?"selected_country":"phone",b)}
1,error:(r=m==null?void 0:m.phone)==null?void 0:r.message,placeholder:t?`${((c=t==null?void 0:t.mobile_starts_with)==null?void 0:c[0])||""}${"x".repeat((((g=t.phone_number_lengths)==null?void 0:g[0])||7)-1)}`:""})}}),e.jsxs("div",{className:"pt-4",children:[(o==null?void 0:o.message)&&e.jsx("p",{className:"text-error py-2 text-center text-sm",children:o.message}),e.jsx(S,{type:"submit",className:"w-full",loading:u,children:e.jsx("span",{className:"text-lg font-bold",children:a("profile:claim_your_tickets")})})]})]})})})},J=({token:n})=>{const{mutateAsync:d,isPending:a,error:l}=$(),{lang:u}=_(),{t:o}=w("profile"),f=q(),{isWebView:x}=W(),h=async()=>{try{await d(n),f(`/${u}/profile/bookings`,{replace:!0})}catch{}};return e.jsx("section",{"data-webview":!!x,className:"after:bg-body/80 relative -mt-20 flex min-h-[95vh] items-center after:absolute after:inset-0 data-[webview=false]:before:absolute data-[webview=false]:before:inset-0 data-[webview=false]:before:z-[-1] data-[webview=false]:before:bg-[url(/images/default-cover.jpg)] data-[webview=false]:before:bg-cover data-[webview=false]:before:bg-no-repeat",children:e.jsx("div",{className:"relative z-10 mx-auto w-full max-w-lg p-4",children:l!=null&&l.message?e.jsx("div",{className:"bg-body-level-1 text-error rounded-lg p-4 py-20 text-center",children:e.jsx("p",{children:l.message})}):a?e.jsx("div",{className:"bg-body-level-1 rounded-lg p-4 py-20",children:e.jsx(M,{className:"mx-auto w-60"})}):e.jsx(G,{title:o("profile:login_to_claim"),onSuccess:h})})})},je=()=>{const{token:n,lang:d}=_(),{t:a}=w(["common","booking"]),{mutateAsync:l,isPending:u,error:o,data:f}=E();return F.useEffect(()=>{l({token:decodeURIComponent(n||"")})},[]),o?e.jsx("section",{className:"mx-auto my-20 max-w-xl p-4",children:e.jsxs("div",{className:"bg-body-level-1 space-y-8 rounded-lg px-6 py-20 shadow-md",children:[e.jsx("p",{className:"text-error text-center text-2xl",children:(o==null?void 0:o.message)||a("common:unknown_error")}),e.jsx("div",{className:"mx-auto w-full max-w-xs",children:e.jsx(S,{as:P,to:`/${d}`,theme:"white",shape:"outlined",className:"w-full text-lg",children:a("common:go_home")})})]})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{title:a("booking:claim_order_title")}),u?e.jsx(T,{}):f&&e.jsx(e.Fragment,{children:f.is_guest_user?e.jsx(H,{token:decodeURIComponent(n||"")}):e.jsx(J,{token:decodeURIComponent(n||"")})})]})};export{je 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.