1import{q as T,n as F,r as a,j as e,L as $}from"./react-vendor-BDHNqS4B.js";import{b as D}from"./Header-BkbupWq-.js";import{F as q}from"./Footer-CtylQEAH.js";import{e as H,n as M,B as A,L as P,I as O,U as x}from"./main-m_sUF2N4.js";import{u as W}from"./useSEO-CoArDrdl.js";import{e as G,g as E,M as Y,f as u,k as d}from"./midAutumnFestival2026-GVaMxjdF.js";import{f as z,a as J,b as K,c as X}from"./midAutumnMetaPixel-CU7nfzNg.js";import{M as Q}from"./message-circle-B5m25ymx.js";import{U as V}from"./upload-B1g5jdtK.js";import"./amplify-DYDcjoow.js";import"./chevron-right-CpkQxGj-.js";import"./check-DS0-tR9o.js";import"./tag-D40gy_Nl.js";import"./query-7-WHkg5t.js";import"./textarea-D7qsgB_p.js";import"./reportService-tEzofQZ6.js";import"./phone-B2rvvDkK.js";import"./type-CVgQCqWZ.js";const Z=5*1024*1024,ee=["image/jpeg","image/png","image/webp","image/heic","image/heif"];function te(r){switch(r.kind){case"item":case"bundle":return u(r.price);case"gift":return"è´é";case"discount":return`â${u(r.amount)}`;default:return r}}function se(r){switch(r.kind){case"item":case"bundle":case"gift":return r.label;case"discount":return`${r.label}ï¼${r.code}ï¼`;default:return r}}function re(r){if(r<=0)return"00:00:00";const o=Math.floor(r/1e3),p=Math.floor(o/3600),m=Math.floor(o%3600/60),c=o%60;return[p,m,c].map(s=>String(s).padStart(2,"0")).join(":")}const ve=()=>{const[r]=T(),o=F(),{isAuthenticated:p,userInfo:m}=H(),c=r.get("ref")??"",[s,_]=a.useState(null),[U,f]=a.useState(!1),[h,l]=a.useState(!0),[I,R]=a.useState(Date.now()),[g,j]=a.useState(null),[i,N]=a.useState(null),[y,S]=a.useState(""),[v,k]=a.useState(!1);W({title:"仿¬¾ç¢ºèªï½æ¯å©æ²æµ¸å¼å°ç£ä¸ç§ç¥",description:"è«åå¿«ä»æ¬¾ä¸¦ä¸å³æ¶æï¼ä»¥ç¢ºèªå·¥ä½ååé¡ã",canonicalUrl:`https://petwellhk.com${G}`,noindex:!0}),a.useEffect(()=>{let t=!1;if(!c){f(!0),l(!1);return}return l(!0),z(c).then(n=>{if(!t){if(!n){f(!0),l(!1);return}if(n.status==="paid"||n.status==="registered"){o(`${E}?ref=${encodeURIComponent(n.id)}`,{replace:!0});return}_(n),l(!1)}}).catch(n=>{console.error("Failed to load mid-autumn booking:",n),t||(f(!0),l(!1))}),()=>{t=!0}},[o,c]),a.useEffect(()=>{s&&J(K(s))},[s]),a.useEffect(()=>{const t=window.setInterval(()=>R(Date.now()),1e3);return()=>window.clearInterval(t)},[]),a.useEffect(()=>()=>{i&&URL.revokeObjectURL(i)},[i]);const w=s?Date.parse(s.payBy)-I:0,b=w<=0,C=a.useMemo(()=>s?new Date(s.payBy).toLocaleString("zh-HK",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):"",[s]),L=t=>{if(i&&URL.revokeObjectURL(i),N(null),j(null),!!t){if(t.size>Z){x.error("è«ä¸å³å°æ¼ 5MB çåç");return}if(t.type&&!ee.includes(t.type)&&!t.type.startsWith("image/")){x.error("è«ä¸å³ JPGãPNGãWEBP æ HEIC åç");return}j(t),N(URL.createObjectURL(t))}},B=async()=>{if(s){if(!g){x.error("è«ä¸å³ä»æ¬¾æªå");return}k(!0);try{const t=await X({booking:s,file:g,paymentReference:y,reporterId:p===!0?(m==null?void 0:m.userId)??null:null});o(`${E}?ref=${encodeURIComponent(t.id)}`,{replace:!0})}catch(t){console.error("Failed to submit payment proof:",t),x.error("ä¸å³å¤±æï¼è«ç¨å¾å試æ WhatsApp è¯çµ¡æå",{duration:4e3}),k(!1)}}};return e.jsxs("div",{className:"min-h-[100dvh] bg-[hsl(30_20%_97%)]",children:[e.jsx(D,{}),e.jsxs("main",{className:"container mx-auto max-w-xl px-4 py-10 md:py-14",children:[h&&e.jsxs("div",{className:"rounded-lg border border-border bg-background p-8 text-center shadow-sm",children:[e.jsx(M,{className:"mx-auto h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"æ£å¨è¼å
¥å ±åè³æ"})]}),!h&&U&&e.jsxs("div",{className:"rounded-lg border border-border bg-background p-8 text-center shadow-sm",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"æ¾ä¸å°æ¤å ±åç´é"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"仿¬¾é£çµå¯è½å·²éææç·¨è䏿£ç¢ºãè«éæ°å ±åï¼æ WhatsApp è¯çµ¡æå並æä¾å ±åç·¨èã"}),e.jsx(A,{asChild:!0,className:"mt-6",children:e.jsx($,{to:Y,children:"è¿åå ±åé "})})]}),!h&&s&&e.jsxs("div",{className:"rounded-lg border border-border bg-background shadow-sm",children:[e.jsxs("div",{className:"border-b border-border px-6 py-5 md:px-8",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"仿¬¾ç¢ºèª"}),e.jsx("h1",{className:"mt-1 text-xl font-semibold",children:"è«æ¼ 24 å°æå
§ä»æ¬¾"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"å·¥ä½ååé¡å·²æ«æä¿çãè«åå¿«å®æä»æ¬¾ä¸¦ä¸å³æ¶æã"})]}),e.jsxs("div",{className:"space-y-6 px-6 py-6 md:px-8",children:[e.jsxs("div",{className:b?"rounded-md border border-destructive/30 bg-destructive/[0.04] px-4 py-4 text-center":"rounded-md border border-primary/30 bg-primary/[0.04] px-4 py-4 text-center",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"å©é¤æé"}),e.jsx("p",{className:"mt-1 font-mono text-3xl font-semibold tabular-nums tracking-wide",children:re(w)}),e.jsx("p",{className:b?"mt-1 text-sm font-medium text-destructive":"mt-1 text-sm font-medium text-primary",children:b?"æéå·²å°ï¼è«åå¿«":"è«åå¿«"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["æªæ¢ ",C]})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-muted/15 px-4 py-4 sm:px-5",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"æä»éé¡"}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[e.jsx("p",{className:"text-3xl font-semibold tabular-nums tracking-tight text-foreground",children:u(s.quote.total)}),s.quote.discountAmount>0&&s.quote.subtotal>s.quote.total&&e.jsx("p",{className:"text-base text-muted-foreground line-through tabular-nums",children:u(s.quote.subtotal)}),s.quote.discountAmount>0&&e.jsxs("span",{className:"rounded-full bg-primary/10 px-2.5 py-0.5 text-sm font-semibold text-primary",children:["å·²æ¸ ",u(s.quote.discountAmount)]})]}),e.jsxs("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["å ±åç·¨
1è ",s.id]}),e.jsx("ul",{className:"mt-4 space-y-2 border-t border-border/80 pt-3 text-sm",children:s.quote.lines.map((t,n)=>e.jsxs("li",{className:t.kind==="discount"?"flex justify-between gap-3 font-medium text-primary":"flex justify-between gap-3",children:[e.jsx("span",{className:t.kind==="discount"?void 0:"text-muted-foreground",children:se(t)}),e.jsx("span",{className:"tabular-nums",children:te(t)})]},`${t.kind}-${n}`))})]}),e.jsxs("p",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-sm leading-relaxed",children:[e.jsx(Q,{className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{children:"æå顿ä¸å³æå°é£ï¼å¯"}),e.jsxs("a",{href:`https://wa.me/${d.whatsapp}?text=`+encodeURIComponent(`ä½ å¥½ï¼ææ³æ¥è©¢æ¯å©æ²æµ¸å¼å°ç£ä¸ç§ç¥ä»æ¬¾ãå ±åç·¨è ${s.id}`),target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary underline underline-offset-2",children:["WhatsApp ",d.whatsappDisplay]}),e.jsx("span",{children:"ï¼ä¸¦è¨»æå ±åç·¨èã"})]}),e.jsxs("div",{className:"space-y-4 rounded-md border border-border bg-muted/20 p-4 text-sm",children:[e.jsx("p",{className:"font-semibold",children:"仿¬¾æ¹æ³"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"1. éè¡è½å¸³"}),e.jsxs("dl",{className:"mt-2 grid grid-cols-[7.5rem_1fr] gap-x-3 gap-y-1.5",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Account Name"}),e.jsx("dd",{children:d.accountName}),e.jsx("dt",{className:"text-muted-foreground",children:"Bank Code"}),e.jsx("dd",{children:d.bankCode}),e.jsx("dt",{className:"text-muted-foreground",children:"Branch Code"}),e.jsx("dd",{children:d.branchCode}),e.jsx("dt",{className:"text-muted-foreground",children:"Bank Name"}),e.jsx("dd",{children:d.bankName}),e.jsx("dt",{className:"text-muted-foreground",children:"Account Number"}),e.jsx("dd",{className:"font-medium tabular-nums",children:d.accountNumber})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"2. PayMe"}),e.jsx("a",{href:d.paymeUrl,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-block font-medium text-primary underline underline-offset-2",children:d.paymeUrl})]}),e.jsx("p",{children:"ä»å®è«åè¦ã已仿¬¾ã並ä¸å³æªåãå顿éï¼ç¢ºèªæ¶æ¬¾å¾å
ç®æ£å¼å ±åæåã"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["仿¬¾å註è«å¡«å¯«å ±åç·¨è ",s.id,"ï¼ä»¥ä¾¿æ ¸å°ã"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(P,{htmlFor:"paymentReference",className:"text-sm font-medium",children:["仿¬¾åèè碼æè½å¸³æé",e.jsx("span",{className:"ml-1 font-normal text-muted-foreground",children:"ï¼é¸å¡«ï¼"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ä¾å¦ï¼PayMe 12:30 / åèè碼 123456"}),e.jsx(O,{id:"paymentReference",value:y,onChange:t=>S(t.target.value),className:"bg-background"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(P,{htmlFor:"receipt",className:"text-sm font-medium",children:["ä¸å³å·²ä»æ¬¾æªå",e.jsx("span",{className:"ml-0.5 text-destructive",children:"*"})]}),e.jsxs("label",{htmlFor:"receipt",className:"flex cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-border bg-muted/10 px-4 py-8 text-center transition-colors hover:border-primary/40",children:[e.jsx(V,{className:"mb-2 h-5 w-5 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:"黿ä¸å³ä»æ¬¾æªå"}),e.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:"JPG / PNG / WEBP / HEICï¼æå¤§ 5MB"}),e.jsx("input",{id:"receipt",type:"file",accept:"image/*",className:"sr-only",onChange:t=>{var n;return L(((n=t.target.files)==null?void 0:n[0])??null)}})]}),i&&e.jsx("img",{src:i,alt:"仿¬¾èæé 覽",className:"mt-2 max-h-56 w-full rounded-md border border-border object-contain bg-muted/20"})]}),e.jsx(A,{type:"button",onClick:B,disabled:v,className:"min-h-11 w-full",children:v?e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"mr-2 h-4 w-4 animate-spin"}),"ä¸å³ä¸"]}):"確èªå·²ä»æ¬¾"})]})]})]}),e.jsx(q,{})]})};export{ve 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.