PageSourceSearch

https://admin.pickyourplayground.com/assets/giftVoucher-2b6da8e0.js

js pickyourplayground.com collected 2026-10-02 01:40:53 UTC 3,831 bytes, 1 lines download raw bytes

1import{ar as V,as as t,at as A,Z as P,r as m,u as q,q as w,j as e,aO as F,n as I,aI as u,b3 as M,aX as T,aJ as $,B as G,b9 as L}from"./index-fb3c7097.js";const _=n=>V({name:t().min(1,"Please enter Name").max(25,"Name cannot be more than 25 characters").regex(/^[^\d]+$/,"Name cannot contain numbers"),value:A().transform(s=>{const l=Number(s);return isNaN(l)?void 0:l}).refine(s=>typeof s=="number",{message:"Price is Required"}).refine(s=>s>=1,{message:"Minimun price should be 1"}).refine(s=>s!==void 0,{message:"Price is required"}),currency:t({required_error:"Please select category",invalid_type_error:"Please select category"}).min(1,"Please select category"),email:t().min(1,"Email address is required").email("Invalid email address"),message:t().min(1,"Message is required").max(200,"Message is too long"),tickets:n?t().refine(s=>!isNaN(Number(s))&&Number(s)>=1,{message:"Number of tickets must be at least 1"}):t().optional()}),O=()=>{var p;const{data:n}=P(),[s,l]=m.useState(!1),v=q(),[b,g]=m.useState([]),j=w(),{activityId:a,regift:y,name:x,price:o,country:N,voucherId:f,countryId:E}=j.state||{},C=async c=>{try{l(!0),l(!1);let r=a?{...c,activityId:a,country:N}:c;y&&(r={...r,voucherId:f,regift:y});const i=b.find(d=>d.value===r.currency);v("../gift-voucher/review-details",{state:{...r,country:i==null?void 0:i.label,countryId:E}})}finally{l(!1)}};return m.useEffect(()=>{const r=Object.values(L).map(i=>({label:`${i.currency} (${i.country})`,value:i.currency}));g(r)},[]),e.jsxs(F,{title:"Category",children:[e.jsx("div",{className:"header-wrapper",children:e.jsx("h3",{className:"semi-bold f-32 ",children:x?`Gift Voucher(${x})`:"Gift Voucher"})}),e.jsx("div",{className:"row d-none",children:e.jsx("div",{className:"col-12",children:e.jsx("form",{})})}),e.jsx("div",{className:"dashboard-card gray border-0 rounded add-user-form mt-5 ",children:e.jsx("div",{className:"my-4 Category-box col-11 mx-auto",children:e.jsx(I,{schema:_(a),onSubmit:C,options:{defaultValues:{name:"",email:"",value:o?Math.ceil(o):0,currency:((p=n==null?void 0:n.data)==null?void 0:p.countryCurrency)??"",message:"",tickets:a?1:void 0}},children:({register:c,formState:r,control:i,setValue:d,watch:k})=>{const h=k("tickets");return m.useEffect(()=>{a&&h&&o&&d("value",Math.ceil(o)*h)},[h,o,a,d]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"row mt-4",children:[e.jsx("div",{className:"col-12 col-md-12 mb-2",children:e.jsx(u,{error:r.errors.value,registration:c("value"),type:"number",label:"Amount",placeholder:"Amount",disabled:a})}),e.jsxs("div",{className:"col-12 curncy-tag col-md-12 mb-2",children:[e.jsx("label",{htmlFor:"Category",className:"form-label",children:"Currency"}),e.jsx(M,{disable:a,error:r.errors.currency,name:"currency",control:i,options:b,placeholder:"Select currency",className:"select-currency",label:""})]}),e.jsx("div",{className:"col-12 col-md-12 mb-2",children:e.jsx(u,{error:r.errors.name,registration:c("name"),type:"text",label:"Enter receiver name",placeholder:"Enter Name"})}),e.jsx("div",{className:"col-12 col-md-12 mb-2",children:e.jsx(u,{error:r.errors.email,registration:c("email"),type:"email",label:"Enter receiver email address",placeholder:"Enter Email"})}),e.jsx("div",{className:"col-12 col-md-12 mb-2",children:e.jsx(T,{error:r.errors.message,label:"Add a message for receiver",registration:c("message"),rows:2,placeholder:"Enter message...."})}),a&&e.jsx("div",{className:"col-12 col-md-12 mb-2",children:e.jsx(u,{error:r.errors.tickets,registration:c("tickets"),type:"number",label:"Enter number of tickets",placeholder:"Number of tickets"})}),$("addVoucher")&&e.jsx("div",{className:"row mt-4",children:e.jsx("div",{className:"col-12 text-center",children:e.jsx(G,{isLoading:s,type:"submit",className:"px-4",children:"Save"})})})]})})}})})})]})};export{O as GiftVoucher,_ as schema};

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.