PageSourceSearch

https://www.gs1nz.org/assets/TurnoverConfirmationCm-DoDN1sP4.js

js gs1nz.org collected 2026-10-02 07:44:04 UTC 13,096 bytes, 1 lines download raw bytes

1import{r as t,j as e}from"./react-vendor-DgF5BvPh.js";import{N as X}from"./NzbnLookup-g6eR6GwD.js";import{N as ee,L as G,B as j,A as re,as as se,E as ae,x as M,w as ie,v as ne}from"./index-DQrNnQ_p.js";import{C as m,d,a as u,b as h,c as b}from"./card-BYYhIoy9.js";import{L as p}from"./label-e5uRY8L4.js";import{S as te,a as le,b as oe,c as ce,d as me}from"./select-teeX9NOa.js";import{C as k}from"./checkbox-DFMD3CiB.js";import{T as de}from"./TurnoverExplainerDialog-Cmaj2_kR.js";import{t as B}from"./pricingData-Bpzx2MaW.js";import{C as ue}from"./circle-check-big-bbvkwoUq.js";import{I as he}from"./info-C4264qVI.js";import{B as xe}from"./building-2-9u_SOCMM.js";import{S as pe}from"./square-pen-D6dr439W.js";import{o as ge,s as l,b as O,a as Y,Z as fe}from"./types-Cb0MIZhy.js";import{d as je,L as be}from"./router-CYXz2GUs.js";import"./circle-alert-CxFOqcdt.js";import"./ui-vendor-DLQD4Y5c.js";import"./index-bhMWm8UO.js";import"./index-Jel6unaT.js";import"./chevron-up-l3B_HhUp.js";import"./dialog-CiFjPsoq.js";const D=ge({companyName:l().trim().min(1,"Company name is required").max(200),tradingName:l().trim().max(200).optional(),nzbn:l().trim().max(50).optional(),streetAddress:l().trim().max(500).optional(),mainPhone:l().trim().max(50).optional(),firstName:l().trim().min(1,"First name is required").max(100),surname:l().trim().min(1,"Surname is required").max(100),jobTitle:l().trim().min(1,"Job title is required").max(200),contactEmail:l().trim().email("Please enter a valid email").max(255),annualTurnover:l().trim().min(1,"Please select your annual turnover"),billingEmailConfirmed:O().optional(),correctedBillingEmail:l().trim().max(255).optional(),agreeDeclaration:O().refine(n=>n===!0,"You must confirm this declaration")}),ve=D.refine(n=>n.billingEmailConfirmed===!0,{path:["billingEmailConfirmed"],message:"You must confirm your billing email is correct"}),Ne=D.superRefine((n,g)=>{if(n.billingEmailConfirmed===!0)return;const f=(n.correctedBillingEmail||"").trim();if(!f){g.addIssue({code:Y.custom,path:["billingEmailConfirmed"],message:"Confirm your billing email is correct, or enter the email you'd like us to change it to"});return}/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f)||g.addIssue({code:Y.custom,path:["correctedBillingEmail"],message:"Please enter a valid email"})});function qe(){var L;const[n]=je(),g=n.get("v")==="mygs1",f=n.get("v")==="email",E=t.useMemo(()=>{for(const[r,s]of n.entries())if(s===""&&/^[1-8]$/.test(r))return parseInt(r,10)-1;return 0},[n]),V=((L=B[E])==null?void 0:L.label)||B[0].label,q=t.useMemo(()=>B.slice(E),[E]),[z,S]=t.useState(null),[F,w]=t.useState(!1),[i,v]=t.useState({}),[a,N]=t.useState({}),[I,A]=t.useState(!1),[T,R]=t.useState(!1),[$,P]=t.useState(!1),{toast:H}=ee(),y=t.useRef(null);t.useEffect(()=>{T&&y.current&&y.current.scrollIntoView({behavior:"smooth",block:"start"})},[T]);const J=r=>{S(r),w(!0),v(s=>({...s,nzbn:r.nzbn,companyName:r.companyName,tradingName:r.tradingName||"",streetAddress:r.physicalAddress||"",mainPhone:r.phoneNumber||""}))},U=()=>{w(!1),S({nzbn:"",companyName:"",tradingName:"",industryType:"",postalAddress:"",physicalAddress:"",phoneNumber:"",emailAddress:"",website:""}),v(r=>({...r,nzbn:"",companyName:"",tradingName:"",streetAddress:"",mainPhone:""}))},_=()=>{S(null),w(!1),v({}),N({})},x=(r,s)=>{v(c=>({...c,[r]:s})),a[r]&&N(c=>{const C={...c};return delete C[r],C})},K=async()=>{A(!0),N({});try{const r=(g?ve:f?Ne:D).parse(i);try{const{error:s}=await ne.functions.invoke("send-email",{body:{type:"turnover-confirmation-cm",data:{...r,currentTurnover:V}}});s&&console.error("Email error:",s)}catch(s){console.error("Email send error:",s)}R(!0)}catch(r){if(r instanceof fe){const s={};r.errors.forEach(c=>{c.path[0]&&(s[c.path[0]]=c.message)}),N(s),H({title:"Please fix the errors below",description:Object.values(s).slice(0,3).join(", "),variant:"destructive"})}}finally{A(!1)}},o=(r,s,c=!1,C="text",Q="",Z=!1)=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(p,{htmlFor:s,children:[r," ",c&&e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(M,{id:s,type:C,value:i[s]||"",onChange:W=>x(s,W.target.value),placeholder:Q,disabled:Z,"aria-invalid":!!a[s],className:`${a[s]?"border-destructive":""} ${Z?"bg-muted":""}`}),a[s]&&e.jsx("p",{className:"text-sm text-destructive",children:a[s]})]});return T?e.jsxs(G,{title:"Turnover confirmation submitted | GS1 New Zealand",description:"Your annual turnover confirmation has been submitted.",pageStatus:"published",children:[e.jsx("div",{ref:y,className:"scroll-mt-48"}),e.jsx("div",{className:"container mx-auto px-4 py-20 max-w-2xl text-center",children:e.jsx(m,{children:e.jsxs(d,{className:"pt-10 pb-10 space-y-4",children:[e.jsx(ue,{className:"h-16 w-16 text-green-600 mx-auto"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Turnover confirmation submitted"}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Thank y
1ou. Your annual turnover confirmation has been received and will be processed by our membership team."})]}),e.jsx("div",{className:"pt-4",children:e.jsx(j,{asChild:!0,children:e.jsxs(be,{to:"/membership",children:["Back to membership",e.jsx(re,{className:"ml-2 h-4 w-4"})]})})})]})})})]}):e.jsxs(G,{title:"Confirmation of Annual Turnover | GS1 New Zealand",description:"Confirm your company's annual turnover for GS1 New Zealand membership fee calculation.",pageStatus:"published",children:[e.jsx(se,{children:e.jsx("meta",{name:"robots",content:"noindex, nofollow"})}),e.jsx("div",{ref:y,className:"scroll-mt-48"}),e.jsx("section",{className:"bg-primary text-primary-foreground py-16",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-3xl",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Confirmation of annual turnover"}),e.jsx("p",{className:"text-primary-foreground/80",children:"Declare your company's gross annual turnover to establish your membership fee category."})]})}),e.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-3xl space-y-8",children:[e.jsx(m,{className:"border-primary/20 bg-primary/5",children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(he,{className:"h-5 w-5 text-primary shrink-0 mt-0.5"}),e.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsxs("p",{children:["Your turnover information is ",e.jsx("strong",{children:"confidential"})," to GS1 New Zealand. This form will be filed within your member's file and will not be available for any other purpose."]}),e.jsx("p",{children:"In submitting this form, you are acknowledging that you are authorised by your business to do so (i.e. Director or Financial Controller)."}),e.jsx("p",{children:"This form is provided to GS1 New Zealand to establish the turnover category of your company. Your annual licence fees are based on the turnover category."})]})]})})}),e.jsxs(m,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Find your organisation"}),e.jsx(b,{children:"Search for your company using your business name or NZBN to get started."})]}),e.jsx(d,{children:z?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg border border-accent bg-accent/5 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(xe,{className:"h-5 w-5 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground",children:i.companyName||i.tradingName||"Manual entry"}),i.nzbn&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["NZBN: ",i.nzbn]}),i.streetAddress&&e.jsx("p",{className:"text-sm text-muted-foreground",children:i.streetAddress})]})]})}),e.jsxs(j,{variant:"ghost",size:"sm",onClick:_,className:"text-muted-foreground gap-2",children:[e.jsx(pe,{className:"h-4 w-4"}),"Search for a different company"]})]}):e.jsx(X,{onSelect:J,onManualEntry:U})})]}),z&&e.jsxs(e.Fragment,{children:[e.jsxs(m,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Organisation details"}),e.jsx(b,{children:"Confirm or update your organisation details."})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o("Company name","companyName",!0,"text","",F),o("Trading name","tradingName")]}),o("NZBN","nzbn",!1,"text","",F),o("Street address","streetAddress"),o("Main phone","mainPhone",!1,"tel")]})]}),e.jsxs(m,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Your details"}),e.jsx(b,{children:"The person authorised to submit this declaration (Director or Financial Controller)."})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o("First name","firstName",!0),o("Surname","surname",!0)]}),o("Job title","jobTitle",!0,"text","e.g. Director, Financial Controller"),o("Email address","contactEmail",!0,"email")]})]}),e.jsxs(m,{children:[e.jsx(u,{children:e.jsx(h,{children:"Annual turnover"})}),e.jsx(d,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(p,{children:["Annual turnover ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(te,{value:i.annualTurnover||"",onValueChange:r=>x("annualTurnover",r),children:[e.jsx(le,{"aria-invalid":!!a.annualTurnover,className:a.annualTurnover?"border-destructive":"",children:e.jsx(oe,{placeholder:"Select your annual turnover"})}),e.jsx(ce,{children:q.map(r=>e.jsx(me,{value:r.value,children:r.label},r.value))})]}),a.annualTurnover&&e.jsx("p",{className:"text-sm text-destructive",children:a.annualTurnover}),e.jsxs("div",{className:"pt-1",children:[e.jsx(j,{variant:"link",className:"h-auto p-0 text-sm text-muted-foreground",onClick:()=>P(!0),children:"Unsure why we ask about this?"}),e.jsx(de,{open:$,onOpenChange:P})]})]})})]}),g&&e.jsxs(m,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Billing email"}),e.jsx(b,{children:"Please check that the billing email we have for you is correct (as shown in the 'confirm your turnover and billing' email we sent). If it needs updating, please log in to MyGS1 and update it before submitting this form."})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsx(j,{asChild:!0,variant:"outline",children:e.jsxs("a",{href:"https://my.gs1nz.org/",target:"_blank",rel:"noopener noreferrer",children:["Log in to MyGS1",e.jsx(ae,{className:"ml-2 h-4 w-4"})]})}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(k,{id:"billingEmailConfirmed",checked:!!i.billingEmailConfirmed,onCheckedChange:r=>x("billingEmailConfirmed",r===!0)}),e.jsxs(p,{htmlFor:"billingEmailConfirmed",className:"leading-relaxed cursor-pointer",children:["I confirm that my billing email is correct. ",e.jsx("span",{className:"text-destructive",children:"*"})]})]}),a.billingEmailConfirmed&&e.jsx("p",{className:"text-sm text-destructive",children:a.billingEmailConfirmed})]})]}),f&&e.jsxs(m,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Billing email"}),e.jsx(b,{children:"Please confirm that the billing email we have for you is correct (as shown in the 'confirm your turnover and billing' email we sent). If it isn't, enter the email you'd like us to change it to."})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(k,{id:"billingEmailConfirmed",checked:!!i.billingEmailConfirmed,onCheckedChange:r=>x("billingEmailConfirmed",r===!0)}),e.jsx(p,{htmlFor:"billingEmailConfirmed",className:"leading-relaxed cursor-pointer",children:"I confirm that my billing email is correct."})]}),a.billingEmailConfirmed&&e.jsx("p",{className:"text-sm text-destructive",children:a.billingEmailConfirmed}),!i.billingEmailConfirmed&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"correctedBillingEmail",children:"Correct billing email"}),e.jsx(M,{id:"correctedBillingEmail",type:"email",value:i.correctedBillingEmail||"",onChange:r=>x("correctedBillingEmail",r.target.value),placeholder:"[email protected]","aria-invalid":!!a.correctedBillingEmail,className:a.correctedBillingEmail?"border-destructive":""}),a.correctedBillingEmail&&e.jsx("p",{className:"text-sm text-destructive",children:a.correctedBillingEmail})]})]})]}),e.jsxs(m,{children:[e.jsx(u,{children:e.jsx(h,{children:"Declaration"})}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(k,{id:"agreeDeclaration",checked:!!i.agreeDeclaration,onCheckedChange:r=>x("agreeDeclaration",r)}
1),e.jsxs(p,{htmlFor:"agreeDeclaration",className:"leading-relaxed cursor-pointer",children:["I confirm that the information provided in this form is correct. ",e.jsx("span",{className:"text-destructive",children:"*"})]})]}),a.agreeDeclaration&&e.jsx("p",{className:"text-sm text-destructive",children:a.agreeDeclaration})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{onClick:K,disabled:I,size:"lg",children:I?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"mr-2 h-4 w-4 animate-spin"}),"Submitting…"]}):"Submit declaration"})})]})]})]})}export{qe 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.