PageSourceSearch

https://petwellhk.com/assets/Compare-CVOrncBD.js

js petwellhk.com collected 2026-10-06 05:23:37 UTC 17,078 bytes, 1 lines download raw bytes

1import{j as e,L as n}from"./react-vendor-BDHNqS4B.js";import{b as z}from"./Header-BkbupWq-.js";import{F as $}from"./Footer-CtylQEAH.js";import{a_ as A,A as y,B as c,X as _,b as j,n as M}from"./main-m_sUF2N4.js";import{u as H}from"./useSEO-CoArDrdl.js";import{a as I,T as R,g as f}from"./usePriceReviewProducts-BeYKlbKA.js";import{R as O}from"./ReviewPriceDisplay-DfIoLGNY.js";import{P as E}from"./ProductReviewRatingBadge-CyxkMrfM.js";import{g,s as p,j as k}from"./priceReviewPricing-BlvAWvXm.js";import{C as L,A as T}from"./chevron-right-CpkQxGj-.js";import{S as W}from"./scale-B2l5za8q.js";import{S as C}from"./store-DWI30bPC.js";import{Z as U}from"./zap-CowlN_Ex.js";import{S as V}from"./shield-check-we62WOC3.js";import{E as B}from"./external-link-BIpC4MGv.js";import{S as Z}from"./sparkles-BcmYxR0H.js";import{C as F}from"./check-DS0-tR9o.js";import"./amplify-DYDcjoow.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";import"./priceReviewApi-BFijUeFQ.js";import"./star-Dim9pf51.js";const q=[{key:"lowest",label:"最低價"},{key:"savings",label:"慳幅"},{key:"stores",label:"店舖數量"},{key:"bestStore",label:"最低店舖"},{key:"highest",label:"最高報價"},{key:"size",label:"規格"}],Re=()=>{const{ids:s,remove:r,clear:t,max:o}=A(),{data:x,isLoading:l,isError:m,error:d}=I(s),i=(x==null?void 0:x.items)||[];if(H({title:"產品比較 | PetWell Review",description:"並排比較寵物用品真實價格、店舖數量及最低報價。",canonicalUrl:"https://petwellhk.com/compare",noindex:!0}),s.length===0)return e.jsx(S,{max:o});const v=i.length>0?Math.min(...i.map(a=>g(a).lowestPrice)):0,u=i.length>0?Math.max(...i.map(a=>a.storeCount)):0,h=i.length>0?Math.max(...i.map(a=>p(a))):0;return e.jsxs("div",{className:"review-page min-h-screen",children:[e.jsx(z,{}),e.jsx("div",{className:"border-b border-[hsl(var(--review-line))] bg-white",children:e.jsxs("div",{className:"container mx-auto flex items-center gap-1 overflow-x-auto whitespace-nowrap px-4 py-2.5 text-[12px] text-muted-foreground",children:[e.jsxs(n,{to:"/review",className:"inline-flex items-center gap-1 hover:text-primary",children:[e.jsx(y,{className:"h-3 w-3"})," 格價"]}),e.jsx(L,{className:"h-3 w-3 shrink-0 opacity-40"}),e.jsx("span",{className:"font-medium text-foreground",children:"產品比較"})]})}),e.jsxs("section",{className:"container mx-auto px-4 py-4 md:py-6",children:[e.jsxs("div",{className:"review-panel overflow-hidden bg-white",children:[e.jsxs("div",{className:"flex flex-col gap-4 border-b border-[hsl(var(--review-line))] p-4 sm:flex-row sm:items-center sm:justify-between md:p-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"review-chip inline-flex items-center gap-1 border border-primary/20 bg-secondary/60 px-2 py-0.5 text-[11px] font-semibold text-primary",children:[e.jsx(W,{className:"h-3 w-3"}),"產品比較"]}),e.jsxs("span",{className:"review-stat-pill px-2 py-0.5 text-[11px] text-muted-foreground",children:[s.length," / ",o," 件"]})]}),e.jsx("h1",{className:"review-display text-xl leading-snug md:text-2xl",children:"並排比較報價"}),e.jsx("p",{className:"mt-1.5 text-[13px] text-muted-foreground",children:"並排睇清楚邊款最抵、邊間店舖最多選擇。"})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx(c,{variant:"outline",size:"sm",asChild:!0,className:"h-8 rounded-md border-[hsl(var(--review-line))] text-[12px]",children:e.jsxs(n,{to:"/review",children:[e.jsx(y,{className:"mr-1 h-3.5 w-3.5"}),"繼續格價"]})}),e.jsx(c,{variant:"outline",size:"sm",onClick:t,className:"h-8 rounded-md border-[hsl(var(--review-line))] text-[12px]",children:"清除全部"})]})]}),i.length>0&&!l&&e.jsxs("div",{className:"grid grid-cols-3 divide-x divide-[hsl(var(--review-line))] border-b border-[hsl(var(--review-line))]",children:[e.jsx(w,{icon:R,label:"最低價",value:k(v)}),e.jsx(w,{icon:C,label:"最多店舖",value:`${u} 間`}),e.jsx(w,{icon:U,label:"最大慳幅",value:h>0?`${h}%`:"—"})]})]}),e.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[e.jsx(V,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),"價格每日更新 · 落單前請以店舖頁面為準"]})]}),e.jsx("section",{className:"container mx-auto px-4 pb-8 md:pb-10",children:l?e.jsx(Q,{}):m?e.jsx(Y,{message:d.message}):i.length===0?e.jsx(S,{max:o}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-2 md:hidden",children:i.map(a=>e.jsx(J,{product:a,onRemove:()=>r(a.id),bestPrice:v,bestStores:u,bestSavings:h},a.id))}),e.jsx("div",{className:"review-panel hidden overflow-hidden bg-white md:block",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("div",{className:"review-stagger min-w-max",style:{display:"grid",gridTemplateColumns:`132px repeat(${i.length}, minmax(220px, 1fr))`},children:[e.jsx("div",{className:"border-b border-r border-[hsl(var(--review-line))] bg-[hsl(var(--review-canvas))]/50 p-4"}),i.map(a=>e.jsx(D,{product:a,onRemove:()=>r(a.id)},a.id)),q.map(a=>e.jsx(G,{label:a.label,products:i,rowKey:a.key,bestPrice:v,bestStores:u,bestSavings:h},a.key)),e.jsx("div",{className:"border-r border-[hsl(var(--review-line))] bg-[hsl(var(--review-canvas))]/50 p-4 text-[12px] font-medium text-muted-foreground",children:"行動"}),i.map(a=>{var P;return e.jsx("div",{className:"border-b border-[hsl(var(--review-line))] p-4 last:border-b-0",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(c,{asChild:!0,size:"sm",className:"h-8 flex-1 rounded-md text-[12px]",children:e.jsx(n,{to:f(a),children:"睇詳情"})}),((P=a.topOffers[0])==null?void 0:P.url)&&e.jsx(c,{asChild:!0,size:"sm",variant:"outline",className:"h-8 rounded-md border-[hsl(var(--review-line))] px-2.5",children:e.jsx("a",{href:a.topOffers[0].url,target:"_blank",rel:"noopener noreferrer","aria-label":"去店舖購買",children:e.jsx(B,{className:"h-3.5 w-3.5"})})})]})},`actions-${a.id}`)})]})})})]})}),e.jsx("section",{className:"border-t border-[hsl(var(--review-line))] bg-white",children:e.jsxs("div",{className:"container mx-auto grid gap-6 px-4 py-8 md:grid-cols-[1.4fr_1fr] md:py-10",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[12px] text-muted-foreground",children:"關於 PetWell 格價"}),e.jsxs("h2",{className:"review-display mt-2 text-xl leading-snug md:text-2xl",children:["我哋唔賣嘢,只係幫你",e.jsx("span",{className:"text-primary",children:"睇清楚"}),"價錢"]}),e.jsx("p",{className:"mt-2 max-w-lg text-[14px] leading-relaxed text-muted-foreground",children:"所有價格由 PetWell 編
1輯部整理自香港寵物店公開報價。價格與庫存可能隨時變動,落單前請以店舖頁面為準。"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(N,{icon:Z,label:"想我哋加邊款?",sub:"WhatsApp 編輯部",href:"https://wa.me/85255954078"}),e.jsx(N,{icon:C,label:"店主合作",sub:"加入比價聯盟",href:"/other-services",internal:!0}),e.jsx(N,{icon:R,label:"格價公平守則",sub:"點解信得過",href:"/about",internal:!0})]})]})}),e.jsx($,{})]})};function D({product:s,onRemove:r}){return e.jsxs("div",{className:"relative border-b border-r border-[hsl(var(--review-line))] p-4 last:border-r-0",children:[e.jsx("button",{type:"button",onClick:r,"aria-label":"移除",className:"absolute right-3 top-3 flex h-7 w-7 items-center justify-center rounded-md border border-[hsl(var(--review-line))] bg-white text-muted-foreground transition-colors hover:border-primary/30 hover:text-foreground",children:e.jsx(_,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"pr-8",children:[e.jsx(n,{to:f(s),className:"group mb-3 block aspect-square max-h-[120px] overflow-hidden rounded-md bg-[hsl(var(--review-canvas))]/40 p-2",children:s.image?e.jsx("img",{src:s.image,alt:s.name,className:"h-full w-full object-contain transition-transform duration-300 group-hover:scale-[1.03]"}):e.jsx("div",{className:"flex h-full items-center justify-center text-[12px] text-muted-foreground",children:"—"})}),e.jsx(n,{to:`/review/brand/${encodeURIComponent(s.brand)}`,className:"review-chip mb-1.5 inline-block border border-primary/20 bg-secondary/60 px-2 py-0.5 text-[10px] font-semibold text-primary hover:border-primary/40",children:s.brand}),e.jsx(n,{to:f(s),children:e.jsx("p",{className:"line-clamp-2 text-[13px] font-semibold leading-snug text-foreground hover:text-primary",children:s.name})}),e.jsx(E,{avgRating:s.avgRating,numReviews:s.numReviews,className:"mt-1.5"})]})]})}function G({label:s,products:r,rowKey:t,bestPrice:o,bestStores:x,bestSavings:l}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-b border-r border-[hsl(var(--review-line))] bg-[hsl(var(--review-canvas))]/50 p-4 text-[12px] font-medium text-muted-foreground",children:s}),r.map(m=>{const d=K(m,t,o,x,l),i=ee(m,t);return e.jsx("div",{className:j("border-b border-r border-[hsl(var(--review-line))] p-4 text-center last:border-r-0",d&&"bg-primary/[0.04]"),children:t==="lowest"?e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx(O,{product:m,size:"sm",highlight:d}),d&&e.jsxs("span",{className:"review-savings-pill inline-flex items-center gap-0.5 rounded-sm px-1.5 py-0.5 text-[10px]",children:[e.jsx(F,{className:"h-3 w-3"})," 最抵"]})]}):t==="savings"?e.jsx("div",{className:"flex flex-col items-center gap-1",children:p(m)>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:j("text-[14px] font-bold",d?"text-primary":"text-foreground"),children:[p(m),"%"]}),d&&e.jsx("span",{className:"text-[10px] font-medium text-primary",children:"慳最多"})]}):e.jsx("span",{className:"text-[13px] text-muted-foreground",children:"—"})}):e.jsx(X,{value:i,highlight:d})},`${t}-${m.id}`)})]})}function X({value:s,highlight:r}){return e.jsxs("p",{className:j("text-[13px]",r?"font-semibold text-primary":"text-foreground"),children:[r&&e.jsx(F,{className:"mr-1 inline h-3.5 w-3.5"}),s]})}function J({product:s,onRemove:r,bestPrice:t,bestStores:o,bestSavings:x}){var u,h;const l=p(s),d=g(s).lowestPrice===t,i=s.storeCount===o,v=l===x&&l>0;return e.jsxs("article",{className:"review-panel review-card-product overflow-hidden bg-white",children:[e.jsxs("div",{className:"flex gap-3 p-3",children:[e.jsxs(n,{to:f(s),className:"relative block h-[88px] w-[88px] shrink-0 overflow-hidden rounded-md bg-[hsl(var(--review-canvas))]/40 p-1.5",children:[s.image?e.jsx("img",{src:s.image,alt:s.name,className:"h-full w-full object-contain"}):e.jsx("div",{className:"flex h-full items-center justify-center text-[11px] text-muted-foreground",children:"—"}),l>0&&e.jsxs("span",{className:"review-savings-pill absolute left-1 top-1 rounded-sm px-1 py-px text-[9px] leading-none",children:["慳",l,"%"]})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(n,{to:`/review/brand/${encodeURIComponent(s.brand)}`,className:"review-chip mb-1 inline-block border border-primary/20 bg-secondary/60 px-1.5 py-px text-[10px] font-semibold text-primary",children:s.brand}),e.jsx(n,{to:f(s),children:e.jsx("h3",{className:"line-clamp-2 text-[13px] font-semibold leading-snug text-foreground hover:text-primary",children:s.name})}),e.jsx(E,{avgRating:s.avgRating,numReviews:s.numReviews,className:"mt-1"})]}),e.jsx("button",{type:"button",onClick:r,"aria-label":"移除",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--review-line))] text-muted-foreground hover:text-foreground",children:e.jsx(_,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-1.5",children:[e.jsx(b,{label:"最低價",active:d,children:e.jsx(O,{product:s,size:"xs",highlight:d,showPurchaseNote:!1})}),e.jsx(b,{label:"店舖",active:i,children:e.jsxs("span",{className:j("text-[13px] font-bold",i&&"text-primary"),children:[s.storeCount," 間"]})}),e.jsx(b,{label:"慳幅",active:v,children:e.jsx("span",{className:j("text-[13px] font-bold",v?"text-primary":"text-foreground"),children:l>0?`${l}%`:"—"})})]}),e.jsxs("p",{className:"mt-2 flex items-center gap-1 text-[11px] text-muted-foreground",children:[e.jsx(C,{className:"h-3 w-3 shrink-0"}),((u=s.topOffers[0])==null?void 0:u.store)||"—"]}
1)]})]}),e.jsxs("div",{className:"flex gap-2 border-t border-[hsl(var(--review-line))] p-3",children:[e.jsx(c,{asChild:!0,size:"sm",className:"h-8 flex-1 rounded-md text-[12px]",children:e.jsx(n,{to:f(s),children:"睇詳情"})}),((h=s.topOffers[0])==null?void 0:h.url)&&e.jsx(c,{asChild:!0,size:"sm",variant:"outline",className:"h-8 rounded-md border-[hsl(var(--review-line))] px-3 text-[12px]",children:e.jsxs("a",{href:s.topOffers[0].url,target:"_blank",rel:"noopener noreferrer",children:["去購買 ",e.jsx(B,{className:"ml-1 h-3 w-3"})]})})]})]})}function b({label:s,active:r,children:t}){return e.jsxs("div",{className:j("rounded-md border px-2 py-1.5 text-center",r?"border-primary/20 bg-primary/[0.05]":"border-[hsl(var(--review-line))] bg-[hsl(var(--review-canvas))]/30"),children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:s}),e.jsx("div",{className:"mt-0.5",children:t})]})}function w({icon:s,label:r,value:t}){return e.jsxs("div",{className:"review-pdp-stat px-3 py-3 text-center md:px-4 md:py-4",children:[e.jsx(s,{className:"mx-auto mb-1 h-4 w-4 text-primary",strokeWidth:2}),e.jsx("p",{className:"text-[16px] font-bold tabular-nums text-foreground md:text-[18px]",children:t}),e.jsx("p",{className:"text-[10px] text-muted-foreground md:text-[11px]",children:r})]})}function N({icon:s,label:r,sub:t,href:o,internal:x}){const l="group flex items-center gap-3 rounded-lg border border-[hsl(var(--review-line))] bg-white px-3 py-2.5 hover:border-primary/30",m=e.jsxs(e.Fragment,{children:[e.jsx(s,{className:"h-4 w-4 text-primary",strokeWidth:2}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx("p",{className:"text-[14px] font-medium",children:r}),e.jsx("p",{className:"text-[12px] text-muted-foreground",children:t})]}),e.jsx(T,{className:"h-3.5 w-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"})]});return x?e.jsx(n,{to:o,className:l,children:m}):e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:l,children:m})}function Q(){return e.jsxs("div",{className:"review-panel flex items-center justify-center p-12 text-[14px] text-muted-foreground",children:[e.jsx(M,{className:"mr-2 h-5 w-5 animate-spin text-primary"}),"正在整理比較資料…"]})}function Y({message:s}){return e.jsxs("div",{className:"review-panel border-destructive/30 p-6 text-center",children:[e.jsx("h2",{className:"review-display text-xl",children:"暫時未能載入"}),e.jsx("p",{className:"mx-auto mt-2 max-w-xl text-[14px] text-muted-foreground",children:s}),e.jsx(c,{asChild:!0,className:"mt-4 rounded-md",children:e.jsx(n,{to:"/review",children:"返回格價"})})]})}function S({max:s}){return e.jsxs("div",{className:"review-page min-h-screen",children:[e.jsx(z,{}),e.jsx("div",{className:"border-b border-[hsl(var(--review-line))] bg-white",children:e.jsxs("div",{className:"container mx-auto flex items-center gap-1 px-4 py-2.5 text-[12px] text-muted-foreground",children:[e.jsxs(n,{to:"/review",className:"inline-flex items-center gap-1 hover:text-primary",children:[e.jsx(y,{className:"h-3 w-3"})," 格價"]}),e.jsx(L,{className:"h-3 w-3 shrink-0 opacity-40"}),e.jsx("span",{className:"font-medium text-foreground",children:"產品比較"})]})}),e.jsx("main",{className:"container mx-auto flex flex-1 items-center justify-center px-4 py-12 md:py-16",children:e.jsxs("div",{className:"review-panel w-full max-w-md p-8 text-center md:p-10",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-md border border-primary/20 bg-secondary/60",children:e.jsx(W,{className:"h-7 w-7 text-primary",strokeWidth:1.75})}),e.jsx("h1",{className:"review-display text-xl md:text-2xl",children:"未有產品可比較"}),e.jsxs("p",{className:"mt-2 text-[13px] leading-relaxed text-muted-foreground",children:["喺格價頁面剔選 2 至 ",s," 件產品,再返嚟並排比較。"]}),e.jsx(c,{asChild:!0,className:"mt-5 rounded-md",children:e.jsx(n,{to:"/review",children:"前往格價"})})]})}),e.jsx($,{})]})}function K(s,r,t,o,x){switch(r){case"lowest":return g(s).lowestPrice===t;case"savings":return p(s)===x&&x>0;case"stores":return s.storeCount===o;case"bestStore":case"highest":case"size":return!1;default:return r}}function ee(s,r){var t;switch(r){case"lowest":return k(g(s).lowestPrice);case"savings":return p(s)>0?`${p(s)}%`:"—";case"stores":return`${s.storeCount} 間`;case"bestStore":return((t=s.topOffers[0])==null?void 0:t.store)||"—";case"highest":return k(g(s).highestPrice);case"size":return s.size||"—";default:return r}}export{Re 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.