@colabcommerce/elements 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/QuoteForm.js CHANGED
@@ -1,31 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{c as l}from"react/compiler-runtime";import{createContext as o,useState as s,useContext as r,useRef as n,useId as c,useEffect as i}from"react";import{u as d,a as m}from"./useStoreLocatorConfig-CLD8ogGE.js";import{u}from"./useGeolocation-BEKRqeV7.js";import*as h from"@radix-ui/react-popover";import*as p from"@radix-ui/react-scroll-area";import"@radix-ui/react-slot";import{b as f,c as x,u as g,I as v,A as y,a as b,M as N,m as _,i as S,j as w,k,L as I,n as C,l as L,B as A}from"./index-CPPzJjs-.js";import{useTranslation as j}from"react-i18next";import{c as z,S as M,M as D,B as F,C as O,a as P,L as T}from"./translations-WfjA8013.js";import"@radix-ui/react-collapsible";const q=o(),U=t=>{const a=l(36),{organizationId:o,locale:r,baseUrl:n,products:c,productKey:i,filterBy:h,children:p}=t,f=void 0===n?"/retailers":n;let x;a[0]!==c?(x=void 0===c?[]:c,a[0]=c,a[1]=x):x=a[1];const g=x;let v;a[2]!==h?(v=void 0===h?{stocked:["sku"],available:["sku"]}:h,a[2]=h,a[3]=v):v=a[3];const y=v,[b,N]=s(0),[_,S]=s(null),[w,k]=s(null),[I,C]=s(null),[L,A]=s(!1),[j,z]=s("300mi"),[M,D]=s(null),[F,O]=s("geolocation");let P;a[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(P={autoGeoLocate:!1},a[4]=P):P=a[4];const{location:T,Locate:U}=u(P),E="geolocation"===F?T:M||T;let B;a[5]!==E||a[6]!==o||a[7]!==j?(B={organizationId:o,location:E,page:1,radius:j,pageSize:10},a[5]=E,a[6]=o,a[7]=j,a[8]=B):B=a[8];const{stores:$,meta:H,isLoading:K,error:R}=d(B),{config:W,isLoading:Z,error:J}=m(o);let G;a[9]!==U||a[10]!==f||a[11]!==W||a[12]!==J||a[13]!==Z||a[14]!==y||a[15]!==w||a[16]!==r||a[17]!==E||a[18]!==L||a[19]!==I||a[20]!==H||a[21]!==o||a[22]!==i||a[23]!==g||a[24]!==R||a[25]!==K||a[26]!==M||a[27]!==j||a[28]!==_||a[29]!==b||a[30]!==$||a[31]!==F?(G={stepIndex:b,setStepIndex:N,selectedStoreId:_,setSelectedStoreId:S,focusedStoreId:w,setFocusedStoreId:k,organizationId:o,location:E,locale:r,stores:$,meta:H,searchIsLoading:K,searchError:R,config:W,configIsLoading:Z,configError:J,messageDialogOpen:L,setMessageDialogOpen:A,messageStoreId:I,setMessageStoreId:C,baseUrl:f,searchRadius:j,setSearchRadius:z,searchLocation:M,setSearchLocation:D,useLocationType:F,setUseLocationType:O,products:g,productKey:i,filterBy:y,Locate:U},a[9]=U,a[10]=f,a[11]=W,a[12]=J,a[13]=Z,a[14]=y,a[15]=w,a[16]=r,a[17]=E,a[18]=L,a[19]=I,a[20]=H,a[21]=o,a[22]=i,a[23]=g,a[24]=R,a[25]=K,a[26]=M,a[27]=j,a[28]=_,a[29]=b,a[30]=$,a[31]=F,a[32]=G):G=a[32];const V=G;let Q;return a[33]!==p||a[34]!==V?(Q=/* @__PURE__ */e(q.Provider,{value:V,children:p}),a[33]=p,a[34]=V,a[35]=Q):Q=a[35],Q},E=()=>r(q),B=z("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),$=z("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function H(e){return e?.label??e?.description??e?.text??e?.placePrediction?.text?.text??e?.placePrediction?.structuredFormat?.mainText?.text??""}function K(){const o=l(66),{t:r}=j(),[d,m]=s("");s(!1);const[u,g]=s(!1),[v,y]=s(-1),{location:b,setSearchLocation:N,setUseLocationType:_,Locate:S}=E();let w,k,I;o[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(w={lat:37.7937,lng:-122.3965},o[0]=w):w=o[0],o[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(k=["locality","postal_code"],o[1]=k):k=o[1],o[2]!==d?(I={query:d,apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",center:w,radiusMeters:1e4,types:k},o[2]=d,o[3]=I):I=o[3];const{results:C,isLoading:L,error:A}=f(I);let z;o[4]!==C?(z=Array.isArray(C)?C:[],o[4]=C,o[5]=z):z=o[5];const F=z,O=n(null),P=c(),T=v>=0?`${P}-opt-${v}`:void 0;let q,U,B;o[6]!==L||o[7]!==F.length||o[8]!==u?(q=()=>{u&&(L||y(F.length?0:-1))},U=[u,L,F.length],o[6]=L,o[7]=F.length,o[8]=u,o[9]=q,o[10]=U):(q=o[9],U=o[10]),i(q,U),o[11]!==N||o[12]!==_?(B=e=>{const t=H(e);if(!t)return;m(t),g(!1),requestAnimationFrame(()=>O.current?.focus());const a={latitude:e.location?.lat??null,longitude:e.location?.lng??null,accuracy:null,altitude:0,altitudeAccuracy:null,heading:null,speed:null,city:e.city??null,region:e.region??null,country:e.country??null,postal:e.postalCode??null,timezone:null,ip:null,type:"search",raw:e};N(a),_("search")},o[11]=N,o[12]=_,o[13]=B):B=o[13];const $=B;let K;o[14]!==v||o[15]!==$||o[16]!==F||o[17]!==u?(K=e=>{if(u||"ArrowDown"!==e.key&&"ArrowUp"!==e.key){if(u)e:switch(e.key){case"ArrowDown":e.preventDefault(),y(e=>Math.min(e+1,F.length-1));break e;case"ArrowUp":e.preventDefault(),y(Z);break e;case"Enter":v>=0&&F[v]&&(e.preventDefault(),$(F[v]));break e;case"Escape":e.preventDefault(),g(!1)}}else g(!0)},o[14]=v,o[15]=$,o[16]=F,o[17]=u,o[18]=K):K=o[18];const J=K;let G;o[19]!==S||o[20]!==_?(G=()=>{_("geolocation"),g(!1),m(""),S()},o[19]=S,o[20]=_,o[21]=G):G=o[21];const V=G;let Q;o[22]!==A||o[23]!==L||o[24]!==F.length||o[25]!==u||o[26]!==d?(Q=u&&!L&&!A&&d.trim().length>0&&0===F.length,o[22]=A,o[23]=L,o[24]=F.length,o[25]=u,o[26]=d,o[27]=Q):Q=o[27];const Y=Q,X=L||!!A||Y||F.length>0;let ee,te,ae,le,oe,se,re,ne,ce,ie,de,me;return o[28]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ee=/* @__PURE__ */e(M,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),o[28]=ee):ee=o[28],o[29]!==b||o[30]!==r?(te=b?.city?r("default:location_search_placeholder_w_location",{location:b.city}):r("default:location_search_placeholder"),o[29]=b,o[30]=r,o[31]=te):te=o[31],o[32]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ae=e=>{m(e.target.value),g(!0)},le=()=>g(!0),o[32]=ae,o[33]=le):(ae=o[32],le=o[33]),o[34]!==T||o[35]!==P||o[36]!==J||o[37]!==u||o[38]!==d||o[39]!==te?(oe=/* @__PURE__ */e(h.Anchor,{asChild:!0,children:/* @__PURE__ */t("div",{className:"flex-1 relative",children:[ee,
2
- /* @__PURE__ */e(x,{ref:O,type:"text",placeholder:te,value:d,onChange:ae,onFocus:le,onKeyDown:J,className:"pl-10 h-12",role:"combobox","aria-autocomplete":"list","aria-expanded":u,"aria-controls":P,"aria-activedescendant":T})]})}),o[34]=T,o[35]=P,o[36]=J,o[37]=u,o[38]=d,o[39]=te,o[40]=oe):oe=o[40],o[41]!==v||o[42]!==$||o[43]!==A||o[44]!==L||o[45]!==F||o[46]!==P||o[47]!==X||o[48]!==Y||o[49]!==r?(se=X?/* @__PURE__ */t(a,{children:[
3
- /* @__PURE__ */e(p.Viewport,{children:/* @__PURE__ */t("div",{id:P,role:"listbox",className:"p-2",children:[A?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm rounded-md border border-destructive/30 bg-destructive/10 text-destructive",children:String(A)}):null,L?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:r("default:loading")}):null,Y?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:r("default:no_results")}):null,!L&&!A&&F.map((a,l)=>{const o=l===v,s=H(a),r=(n=a,n?.secondary??n?.secondary_text??n?.placePrediction?.structuredFormat?.secondaryText?.text??n?.placePrediction?.structuredFormat?.secondaryText??"");var n;const c=function(e,t){return e?.id??e?.place_id??e?.placePrediction?.placeId??t}(a,`${l}`);return s?/* @__PURE__ */t("div",{id:`${P}-opt-${l}`,role:"option","aria-selected":o,onMouseEnter:()=>y(l),onMouseDown:R,onClick:()=>$(a),className:["cursor-pointer rounded-lg px-3 py-2",o?"bg-muted":"hover:bg-muted/60"].join(" "),children:[
4
- /* @__PURE__ */e("div",{className:"text-sm text-left font-medium leading-tight",children:s}),r?/* @__PURE__ */e("div",{className:"text-xs text-left text-muted-foreground mt-1 leading-tight",children:r}):null]},c):null})]})}),
5
- /* @__PURE__ */e(p.Scrollbar,{orientation:"vertical",className:"flex select-none touch-none p-0.5 bg-transparent",children:/* @__PURE__ */e(p.Thumb,{className:"flex-1 bg-border rounded-full"})})]}):null,o[41]=v,o[42]=$,o[43]=A,o[44]=L,o[45]=F,o[46]=P,o[47]=X,o[48]=Y,o[49]=r,o[50]=se):se=o[50],o[51]!==se?(re=/* @__PURE__ */e(h.Content,{sideOffset:6,align:"start",onOpenAutoFocus:W,className:"w-[var(--radix-popover-trigger-width)] max-w-[560px] rounded-xl border rounded bg-background shadow-lg overflow-hidden",children:/* @__PURE__ */e(p.Root,{className:"max-h-80",children:se})}),o[51]=se,o[52]=re):re=o[52],o[53]!==u||o[54]!==oe||o[55]!==re?(ne=/* @__PURE__ */e("div",{className:"flex flex-row gap-4",children:/* @__PURE__ */t(h.Root,{open:u,onOpenChange:g,children:[oe,re]})}),o[53]=u,o[54]=oe,o[55]=re,o[56]=ne):ne=o[56],o[57]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ce=/* @__PURE__ */e(D,{className:"w-4 h-4"}),o[57]=ce):ce=o[57],o[58]!==r?(ie=r("default:use_my_location"),o[58]=r,o[59]=ie):ie=o[59],o[60]!==V||o[61]!==ie?(de=/* @__PURE__ */t("div",{className:"mt-2 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[ce,
6
- /* @__PURE__ */e("button",{className:"text-primary hover:underline font-medium",type:"button",onClick:V,children:ie})]}),o[60]=V,o[61]=ie,o[62]=de):de=o[62],o[63]!==ne||o[64]!==de?(me=/* @__PURE__ */e("div",{className:"max-w-3xl mx-auto",children:/* @__PURE__ */t("div",{className:"rounded-xl p-6",children:[ne,de]})}),o[63]=ne,o[64]=de,o[65]=me):me=o[65],me}function R(e){return e.preventDefault()}function W(e){return e.preventDefault()}function Z(e){return Math.max(e-1,0)}const J=a=>{const o=l(29),{store:r,isSelected:n,onClick:c,onSelect:i}=a,[,d]=s(!1),[m,u]=g();let h;o[0]!==c||o[1]!==r.id?(h=()=>{c&&c(r.id)},o[0]=c,o[1]=r.id,o[2]=h):h=o[2];const p=h;let f;o[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=()=>d(!1),o[3]=f):f=o[3];const x=f,b=n;let N;o[4]!==i||o[5]!==r.id?(N=e=>{e.stopPropagation(),i&&i(r.id)},o[4]=i,o[5]=r.id,o[6]=N):N=o[6];const _=N,S=1*r.address?.latitude,w=1*r.address?.longitude;let k;o[7]!==S||o[8]!==w?(k={lat:S,lng:w},o[7]=S,o[8]=w,o[9]=k):k=o[9];const I="w-8 h-8 hover:cursor-pointer "+(n?"text-primary fill-white z-10":"z-1 fill-white text-muted-foreground");let C,L,A;return o[10]!==I?(C=/* @__PURE__ */e(D,{className:I,size:32}),o[10]=I,o[11]=C):C=o[11],o[12]!==_||o[13]!==u||o[14]!==b||o[15]!==r.address?.city||o[16]!==r.address?.postal_code||o[17]!==r.address?.province||o[18]!==r.address?.street_line_one||o[19]!==r.address?.street_line_two||o[20]!==r.retailer_name?(L=b&&/* @__PURE__ */t(v,{anchor:u,headerContent:/* @__PURE__ */e("h3",{className:"cc-iw-title font-bold text-sm align-center text-left mb-2",style:{color:"#111827"},children:r.retailer_name}),onClose:x,children:[
7
- /* @__PURE__ */t("p",{className:"text-xs text-left text-muted-foreground",children:[r.address?.street_line_one,r.address?.street_line_two?`, ${r.address?.street_line_two}`:""]}),
8
- /* @__PURE__ */t("p",{className:"text-xs text-left text-muted-foreground mb-2",children:[r.address?.city,", ",r.address?.province," ",r.address?.postal_code]}),
9
- /* @__PURE__ */e("div",{className:"flex flex-row gap-2 mb-1",children:/* @__PURE__ */e(F,{className:"flex-1 md:flex-row",size:"sm",onClick:_,children:"Select"})})]}),o[12]=_,o[13]=u,o[14]=b,o[15]=r.address?.city,o[16]=r.address?.postal_code,o[17]=r.address?.province,o[18]=r.address?.street_line_one,o[19]=r.address?.street_line_two,o[20]=r.retailer_name,o[21]=L):L=o[21],o[22]!==p||o[23]!==m||o[24]!==r.name||o[25]!==k||o[26]!==C||o[27]!==L?(A=/* @__PURE__ */t(y,{position:k,ref:m,title:r.name,onClick:p,children:[C,L]}),o[22]=p,o[23]=m,o[24]=r.name,o[25]=k,o[26]=C,o[27]=L,o[28]=A):A=o[28],A},G=()=>{const a=l(46),{location:o,stores:s,focusedStoreId:r,setFocusedStoreId:n,setSelectedStoreId:c,setStepIndex:d}=E(),m=b();let u;a[0]!==m?(u=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e+1)},a[0]=m,a[1]=u):u=a[1];const h=u;let p;a[2]!==m?(p=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e-1)},a[2]=m,a[3]=p):p=a[3];const f=p;let x,g,v,y,_;a[4]!==o||a[5]!==m?(x=()=>{m&&o?.latitude&&o?.longitude&&(m.panTo({lat:o.latitude,lng:o.longitude}),m.setZoom(9))},g=[o,m],a[4]=o,a[5]=m,a[6]=x,a[7]=g):(x=a[6],g=a[7]),i(x,g),a[8]!==r||a[9]!==m||a[10]!==s?(v=()=>{if(!m||!r)return;const e=s.find(e=>e.id===r);e&&e.address&&m.panTo({lat:1*e.address.latitude,lng:1*e.address.longitude})},y=[r,s,m],a[8]=r,a[9]=m,a[10]=s,a[11]=v,a[12]=y):(v=a[11],y=a[12]),i(v,y),a[13]!==n?(_=e=>{n(e)},a[13]=n,a[14]=_):_=a[14];const S=_;let w;a[15]!==c||a[16]!==d?(w=e=>{c(e),d(1)},a[15]=c,a[16]=d,a[17]=w):w=a[17];const k=w;let I,C,L,A,j,z,M,D,F,O,P;if(a[18]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(I={width:"100%",height:"300px"},C={lat:22.54992,lng:0},a[18]=I,a[19]=C):(I=a[18],C=a[19]),a[20]!==r||a[21]!==S||a[22]!==k||a[23]!==s){let t;a[25]!==r||a[26]!==S||a[27]!==k?(t=t=>/* @__PURE__ */e(J,{store:t,isSelected:r===t.id,onClick:S,onSelect:k},t.id),a[25]=r,a[26]=S,a[27]=k,a[28]=t):t=a[28],L=s.map(t),a[20]=r,a[21]=S,a[22]=k,a[23]=s,a[24]=L}else L=a[24];return a[29]!==L?(A=/* @__PURE__ */e("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/5 to-muted",children:/* @__PURE__ */e("div",{className:"text-center w-full",children:/* @__PURE__ */e(N,{style:I,defaultCenter:C,defaultZoom:3,gestureHandling:"greedy",disableDefaultUI:!0,mapId:"b1e4f5f5f8c7e2d9",children:L})})}),a[29]=L,a[30]=A):A=a[30],a[31]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(j=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),a[31]=j):j=a[31],a[32]!==h?(z=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:h,children:j}),a[32]=h,a[33]=z):z=a[33],a[34]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(M=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})}),a[34]=M):M=a[34],a[35]!==f?(D=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:f,children:M}),a[35]=f,a[36]=D):D=a[36],a[37]!==z||a[38]!==D?(F=/* @__PURE__ */t("div",{className:"absolute top-4 right-4 flex flex-col gap-2",children:[z,D]}),a[37]=z,a[38]=D,a[39]=F):F=a[39],a[40]!==s.length?(O=/* @__PURE__ */t("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 bg-card border shadow-lg rounded-full px-4 py-2 text-sm font-medium",children:[
10
- /* @__PURE__ */e("span",{className:"text-primary",children:s.length})," stores found"]}),a[40]=s.length,a[41]=O):O=a[41],a[42]!==A||a[43]!==F||a[44]!==O?(P=/* @__PURE__ */e("div",{className:"relative",children:/* @__PURE__ */t("div",{className:"bg-muted rounded-xl overflow-hidden border shadow-md h-[300px]",children:[A,F,O]})}),a[42]=A,a[43]=F,a[44]=O,a[45]=P):P=a[45],P},V=a=>{const o=l(61),{id:s,name:r,addressLineOne:n,city:c,province:i,postalCode:d,hours:m,distance:u,services:h,isFocused:p,handleFocus:f,handleSelect:x,requestedProducts:g,locationProducts:v,filterBy:y}=a,b=void 0===h?[]:h;let N;o[0]!==g?(N=void 0===g?[]:g,o[0]=g,o[1]=N):N=o[1];const w=N;let k;o[2]!==v?(k=void 0===v?[]:v,o[2]=v,o[3]=k):k=o[3];const I=k,C=void 0===y?"sku":y,{t:L}=j(),{availabilitySummary:A}=((e,t,a=["sku"])=>{const l={};t.map(t=>{const o=e.find(e=>a.some(a=>e[a]===t.key));l[t.sku]=o?{stocked:o.stocked,available:o.available}:{stocked:!1,available:!1}});const o=Object.values(l).every(e=>e.stocked),s=Object.values(l).every(e=>e.available),r=Object.values(l).every(e=>!e.stocked),n=Object.values(l).every(e=>!e.available);let c="mixed";return o?c="allStocked":s?c="allAvailable":r&&n&&(c="none"),{availability:l,allAvailable:s,allStocked:o,noneStocked:r,noneAvailable:n,availabilitySummary:c}})(I,w,C);let z;o[4]!==x||o[5]!==s?(z=e=>{e.stopPropagation(),x(s)},o[4]=x,o[5]=s,o[6]=z):z=o[6];const M=z,P="bg-card border rounded-xl p-6 transition-all hover:shadow-lg cursor-pointer "+(p?"ring-2 ring-primary shadow-lg":"");let T,q,U,E,H,K,R,W,Z,J,G,V,X,ee;o[7]!==f||o[8]!==s?(T=()=>f(s),o[7]=f,o[8]=s,o[9]=T):T=o[9],o[10]!==r?(q=/* @__PURE__ */e("div",{className:"flex items-start justify-between gap-4 mb-3",children:/* @__PURE__ */e("div",{children:/* @__PURE__ */e("h3",{className:"font-bold text-lg text-left mb-1",children:r})})}),o[10]=r,o[11]=q):q=o[11],o[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(U=/* @__PURE__ */e(D,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),o[12]=U):U=o[12],o[13]!==n?(E=/* @__PURE__ */e("p",{className:"font-medium text-left",children:n}),o[13]=n,o[14]=E):E=o[14],o[15]!==c||o[16]!==d||o[17]!==i?(H=/* @__PURE__ */t("p",{className:"text-muted-foreground text-left",children:[c,", ",i," ",d]}),o[15]=c,o[16]=d,o[17]=i,o[18]=H):H=o[18],o[19]!==u||o[20]!==L?(K=L("default:distance_away",{distance:_(u).toFixed(1),distanceUnit:"miles"}),o[19]=u,o[20]=L,o[21]=K):K=o[21],o[22]!==K?(R=/* @__PURE__ */e("p",{className:"text-primary font-medium mt-1 text-left",children:K}),o[22]=K,o[23]=R):R=o[23],o[24]!==E||o[25]!==H||o[26]!==R?(W=/* @__PURE__ */t("div",{className:"flex items-start gap-2",children:[U,
11
- /* @__PURE__ */t("div",{children:[E,H,R]})]}),o[24]=E,o[25]=H,o[26]=R,o[27]=W):W=o[27],o[28]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(Z=/* @__PURE__ */e("div",{className:"mt-2.5",children:/* @__PURE__ */e(O,{className:"w-4 h-4 text-muted-foreground"})}),o[28]=Z):Z=o[28],o[29]!==m?(J=/* @__PURE__ */t("div",{className:"flex items-top gap-2",children:[Z,
12
- /* @__PURE__ */e("span",{className:"text-muted-foreground",children:/* @__PURE__ */e(S,{hours:m})})]}),o[29]=m,o[30]=J):J=o[30],o[31]!==W||o[32]!==J?(G=/* @__PURE__ */t("div",{className:"space-y-2 text-sm",children:[W,J]}),o[31]=W,o[32]=J,o[33]=G):G=o[33],o[34]!==A?(V="allStocked"===A&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-green-50 text-green-600 text-xs font-medium rounded-full",children:[
13
- /* @__PURE__ */e(B,{className:"w-4 h-4 text-green-600 me-1"}),"All Items Stocked"]}),o[34]=A,o[35]=V):V=o[35],o[36]!==A?(X="allAvailable"===A&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-medium rounded-full",children:[
14
- /* @__PURE__ */e($,{className:"w-4 me-1 h-4 text-orange-600"}),"Available by Special Order"]}),o[36]=A,o[37]=X):X=o[37],o[38]!==A?(ee="mixed"===A&&/* @__PURE__ */t("div",{children:[
15
- /* @__PURE__ */t("div",{className:"flex items-center gap-2 mt-4 text-sm",children:[
16
- /* @__PURE__ */e("span",{className:"font-bold w-28 text-wrap",children:"Braxton"}),
17
- /* @__PURE__ */t("span",{className:"flex items-center px-3 py-1 bg-orange-50 text-orange-600 text-xs font-medium rounded-full",children:[
18
- /* @__PURE__ */e($,{className:"w-4 me-1 h-4 text-orange-600"}),"Special Order"]})]}),
19
- /* @__PURE__ */t("div",{className:"flex items-center gap-2 mt-4 text-sm",children:[
20
- /* @__PURE__ */e("span",{className:"font-bold w-28 text-wrap",children:"Juno"}),
21
- /* @__PURE__ */t("span",{className:"flex items-center px-3 py-1 bg-green-50 text-green-600 text-xs font-medium rounded-full",children:[
22
- /* @__PURE__ */e(B,{className:"w-4 me-1 h-4 text-green-600"}),"Stocked"]})]})]}),o[38]=A,o[39]=ee):ee=o[39];const te=b.filter(Q).map(Y);let ae,le,oe,se,re,ne;return o[40]!==te?(ae=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2 mt-4",children:te}),o[40]=te,o[41]=ae):ae=o[41],o[42]!==q||o[43]!==G||o[44]!==V||o[45]!==X||o[46]!==ee||o[47]!==ae?(le=/* @__PURE__ */t("div",{className:"flex-1",children:[q,G,V,X,ee,ae]}),o[42]=q,o[43]=G,o[44]=V,o[45]=X,o[46]=ee,o[47]=ae,o[48]=le):le=o[48],o[49]!==L?(oe=L("default:select_store"),o[49]=L,o[50]=oe):oe=o[50],o[51]!==M||o[52]!==oe?(se=/* @__PURE__ */e("div",{className:"flex md:flex-col gap-2",children:/* @__PURE__ */e(F,{onClick:M,variant:"default",className:"whitespace-nowrap",children:oe})}),o[51]=M,o[52]=oe,o[53]=se):se=o[53],o[54]!==le||o[55]!==se?(re=/* @__PURE__ */t("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[le,se]}),o[54]=le,o[55]=se,o[56]=re):re=o[56],o[57]!==re||o[58]!==P||o[59]!==T?(ne=/* @__PURE__ */e("div",{className:P,onClick:T,children:re}),o[57]=re,o[58]=P,o[59]=T,o[60]=ne):ne=o[60],ne};function Q(e){return e}function Y(t){/* @__PURE__ */
23
- return e("span",{className:"px-3 py-1 bg-primary/10 text-primary text-xs font-medium rounded-full",children:t},t)}function X(){const a=l(28),{stores:o,location:s,products:r,setStepIndex:n,productKey:c,setSelectedStoreId:i,searchIsLoading:d,searchError:m,baseUrl:u,focusedStoreId:h,setFocusedStoreId:p}=E();let f;a[0]!==i||a[1]!==n?(f=e=>{i(e),n(1)},a[0]=i,a[1]=n,a[2]=f):f=a[2];const x=f;let g,v,y,b,N;return a[3]!==m||a[4]!==d||a[5]!==o?(g=!d&&!m&&0===o.length&&/* @__PURE__ */e(w,{}),a[3]=m,a[4]=d,a[5]=o,a[6]=g):g=a[6],a[7]!==d?(v=d&&/* @__PURE__ */e("div",{className:"flex items-center justify-center h-48",children:/* @__PURE__ */e(I,{})}),a[7]=d,a[8]=v):v=a[8],a[9]!==u||a[10]!==h||a[11]!==x||a[12]!==s||a[13]!==c||a[14]!==r||a[15]!==m||a[16]!==d||a[17]!==p||a[18]!==o?(y=!d&&!m&&o.map(t=>/* @__PURE__ */e(V,{id:t.id,name:t.retailer_name,placeId:t.place_id,addressLineOne:t.address?.street_line_one,addressLineTwo:t.address?.street_line_two,city:t.address?.city,province:t.address?.province,postalCode:t.address?.postal_code,country:t.address?.country,distance:k(s.latitude,s.longitude,t.address?.latitude,t.address?.longitude),phone:t.phone_number,hours:t.retailer_location_hours,services:[t.store_type],isFocused:h===t.id,handleFocus:p,href:`${u}/${t.id}`,handleSelect:x,locationProducts:t.retailer_location_products,requestedProducts:r,filterBy:[c]},t.id)),a[9]=u,a[10]=h,a[11]=x,a[12]=s,a[13]=c,a[14]=r,a[15]=m,a[16]=d,a[17]=p,a[18]=o,a[19]=y):y=a[19],a[20]!==m||a[21]!==d?(b=!d&&m&&/* @__PURE__ */e("div",{className:"text-red-600 text-center",children:"An error occurred while searching for stores. Please try again."}),a[20]=m,a[21]=d,a[22]=b):b=a[22],a[23]!==g||a[24]!==v||a[25]!==y||a[26]!==b?(N=/* @__PURE__ */t("div",{className:"space-y-4",children:[g,v,y,b]}),a[23]=g,a[24]=v,a[25]=y,a[26]=b,a[27]=N):N=a[27],N}const ee=a=>{const o=l(30),{onClose:s,onSuccess:r}=a,{organizationId:n,location:c,selectedStoreId:i,products:d,stores:m,productKey:u}=E();let h,p,f,x,g,v;if(o[0]!==c||o[1]!==s||o[2]!==r||o[3]!==n||o[4]!==u||o[5]!==d||o[6]!==i||o[7]!==m){let a;o[12]!==i?(a=e=>e.id===i,o[12]=i,o[13]=a):a=o[13];const l=m.find(a),g=l?.retailer_location_products?.filter(e=>d.map(te).includes(e[u]));let v;o[14]!==r?(v=(e,t)=>{r&&r({formValues:e,lead:t})},o[14]=r,o[15]=v):v=o[15];const y=v;f=/* @__PURE__ */t("div",{className:"mb-3",children:["Selected location ",
24
- /* @__PURE__ */e("strong",{children:l?.retailer_name})]}),o[16]!==y||o[17]!==c||o[18]!==s||o[19]!==n||o[20]!==d||o[21]!==i?(x=/* @__PURE__ */e(C,{onClose:s,products:d,activityType:"LeadActivity::QuoteRequest",onSuccess:y,location:c,organizationId:n,selectedLocationId:i}),o[16]=y,o[17]=c,o[18]=s,o[19]=n,o[20]=d,o[21]=i,o[22]=x):x=o[22],h="mt-5",p=g?.map(a=>/* @__PURE__ */t("div",{className:"grid grid-cols-2 gap-4",children:[
25
- /* @__PURE__ */e("img",{src:a.images[0],alt:a.name,className:"w-full"}),
26
- /* @__PURE__ */t("div",{children:[
27
- /* @__PURE__ */e("div",{className:"font-semibold fs-lg",children:a.name}),
28
- /* @__PURE__ */e("div",{children:a.category})]})]},a[u])),o[0]=c,o[1]=s,o[2]=r,o[3]=n,o[4]=u,o[5]=d,o[6]=i,o[7]=m,o[8]=h,o[9]=p,o[10]=f,o[11]=x}else h=o[8],p=o[9],f=o[10],x=o[11];return o[23]!==h||o[24]!==p?(g=/* @__PURE__ */e("div",{className:h,children:p}),o[23]=h,o[24]=p,o[25]=g):g=o[25],o[26]!==f||o[27]!==x||o[28]!==g?(v=/* @__PURE__ */t("div",{children:[f,x,g]}),o[26]=f,o[27]=x,o[28]=g,o[29]=v):v=o[29],v};function te(e){return e.key}function ae(t){const a=l(8),{active:o,children:s,className:r}=t,n=o?"open":"closed";let c,i,d;return a[0]!==r?(c=P("absolute inset-0","transition duration-300 ease-out will-change-transform","data-[state=closed]:pointer-events-none",r),a[0]=r,a[1]=c):c=a[1],a[2]!==s?(i=/* @__PURE__ */e("div",{className:"w-full h-[100%]",children:s}),a[2]=s,a[3]=i):i=a[3],a[4]!==n||a[5]!==c||a[6]!==i?(d=/* @__PURE__ */e("div",{"data-state":n,className:c,children:i}),a[4]=n,a[5]=c,a[6]=i,a[7]=d):d=a[7],d}const le=a=>{const o=l(31),{onClose:s,onSuccess:r}=a,{stepIndex:n,setStepIndex:c}=E();let i;o[0]!==s?(i=()=>{s&&s()},o[0]=s,o[1]=i):i=o[1];const d=i;let m;o[2]!==r||o[3]!==c?(m=e=>{c(2),r&&r(e)},o[2]=r,o[3]=c,o[4]=m):m=o[4];const u=m,h=0===n;let p,f,x,g;o[5]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(p=P("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6"),o[5]=p):p=o[5],o[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=/* @__PURE__ */e(K,{}),o[6]=f):f=o[6],o[7]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(x=/* @__PURE__ */t("div",{className:"relative px-1 h-screen overflow-y-scroll",children:[f,
29
- /* @__PURE__ */e("div",{className:"pb-8",children:/* @__PURE__ */e(L,{apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",children:/* @__PURE__ */e(G,{})})}),
30
- /* @__PURE__ */e(X,{})]}),o[7]=x):x=o[7],o[8]!==h?(g=/* @__PURE__ */e(ae,{active:h,className:p,children:x}),o[8]=h,o[9]=g):g=o[9];const v=1===n;let y,b,N,_;o[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=P("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),o[10]=y):y=o[10],o[11]!==c?(b=()=>c(0),o[11]=c,o[12]=b):b=o[12],o[13]!==u||o[14]!==b?(N=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */e(ee,{onClose:b,onSuccess:u})}),o[13]=u,o[14]=b,o[15]=N):N=o[15],o[16]!==N||o[17]!==v?(_=/* @__PURE__ */e(ae,{active:v,className:y,children:N}),o[16]=N,o[17]=v,o[18]=_):_=o[18];const S=2===n;let w,k,I,C,j,z;return o[19]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(w=P("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),o[19]=w):w=o[19],o[20]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(k=/* @__PURE__ */e("h2",{className:"text-2xl font-semibold mb-4",children:"Thank you!"}),I=/* @__PURE__ */e("p",{className:"mb-8",children:"Your quote request has been submitted successfully. We will get back to you shortly."}),o[20]=k,o[21]=I):(k=o[20],I=o[21]),o[22]!==d?(C=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */t("div",{className:"text-center py-20 px-4",children:[k,I,
31
- /* @__PURE__ */e(A,{onClick:d,children:"Close"})]})}),o[22]=d,o[23]=C):C=o[23],o[24]!==S||o[25]!==C?(j=/* @__PURE__ */e(ae,{active:S,className:w,children:C}),o[24]=S,o[25]=C,o[26]=j):j=o[26],o[27]!==_||o[28]!==j||o[29]!==g?(z=/* @__PURE__ */e("div",{className:"relative overflow-hidden h-[100%] py-1",children:/* @__PURE__ */t("div",{className:"h-[100%] relative",children:[g,_,j]})}),o[27]=_,o[28]=j,o[29]=g,o[30]=z):z=o[30],z},oe=t=>{const a=l(17),{organizationId:o,products:s,locale:r,onClose:n,onSuccess:c}=t;let i,d,m,u,h;return a[0]!==r?(i={lng:r},a[0]=r,a[1]=i):i=a[1],a[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(d={height:"100%"},a[2]=d):d=a[2],a[3]!==r||a[4]!==n||a[5]!==c||a[6]!==o||a[7]!==s?(m=/* @__PURE__ */e("div",{className:"cc",style:d,children:/* @__PURE__ */e(le,{organizationId:o,products:s,locale:r,onClose:n,onSuccess:c})}),a[3]=r,a[4]=n,a[5]=c,a[6]=o,a[7]=s,a[8]=m):m=a[8],a[9]!==r||a[10]!==o||a[11]!==s||a[12]!==m?(u=/* @__PURE__ */e(U,{organizationId:o,products:s,locale:r,children:m}),a[9]=r,a[10]=o,a[11]=s,a[12]=m,a[13]=u):u=a[13],a[14]!==i||a[15]!==u?(h=/* @__PURE__ */e(T,{options:i,children:u}),a[14]=i,a[15]=u,a[16]=h):h=a[16],h};export{oe as default};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import"react";import{Q as s,u as c,a as o,b as l,c as n,P as r,d as i}from"./index-DIIxVsLf.js";import{L as d,a as m}from"./translations-WfjA8013.js";import{A as h,B as p}from"./index-Bl_B7cwM.js";const y=s=>{const d=t(31),{onClose:y,onSuccess:x}=s,{stepIndex:u,setStepIndex:f}=c();let v;d[0]!==y?(v=()=>{y&&y()},d[0]=y,d[1]=v):v=d[1];const b=v;let _;d[2]!==x||d[3]!==f?(_=e=>{f(2),x&&x(e)},d[2]=x,d[3]=f,d[4]=_):_=d[4];const N=_,S=0===u;let I,g,j,z;d[5]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(I=m("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6"),d[5]=I):I=d[5],d[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(g=/* @__PURE__ */e(o,{}),d[6]=g):g=d[6],d[7]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(j=/* @__PURE__ */a("div",{className:"relative px-1 h-screen overflow-y-scroll",children:[g,
2
+ /* @__PURE__ */e("div",{className:"pb-8",children:/* @__PURE__ */e(h,{apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",children:/* @__PURE__ */e(l,{})})}),
3
+ /* @__PURE__ */e(n,{})]}),d[7]=j):j=d[7],d[8]!==S?(z=/* @__PURE__ */e(r,{active:S,className:I,children:j}),d[8]=S,d[9]=z):z=d[9];const C=1===u;let k,q,w,A;d[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(k=m("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),d[10]=k):k=d[10],d[11]!==f?(q=()=>f(0),d[11]=f,d[12]=q):q=d[12],d[13]!==N||d[14]!==q?(w=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */e(i,{onClose:q,onSuccess:N})}),d[13]=N,d[14]=q,d[15]=w):w=d[15],d[16]!==w||d[17]!==C?(A=/* @__PURE__ */e(r,{active:C,className:k,children:w}),d[16]=w,d[17]=C,d[18]=A):A=d[18];const W=2===u;let E,H,B,D,J,K;return d[19]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(E=m("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),d[19]=E):E=d[19],d[20]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(H=/* @__PURE__ */e("h2",{className:"text-2xl font-semibold mb-4",children:"Thank you!"}),B=/* @__PURE__ */e("p",{className:"mb-8",children:"Your quote request has been submitted successfully. We will get back to you shortly."}),d[20]=H,d[21]=B):(H=d[20],B=d[21]),d[22]!==b?(D=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */a("div",{className:"text-center py-20 px-4",children:[H,B,
4
+ /* @__PURE__ */e(p,{onClick:b,children:"Close"})]})}),d[22]=b,d[23]=D):D=d[23],d[24]!==W||d[25]!==D?(J=/* @__PURE__ */e(r,{active:W,className:E,children:D}),d[24]=W,d[25]=D,d[26]=J):J=d[26],d[27]!==A||d[28]!==J||d[29]!==z?(K=/* @__PURE__ */e("div",{className:"relative overflow-hidden h-[100%] py-1",children:/* @__PURE__ */a("div",{className:"h-[100%] relative",children:[z,A,J]})}),d[27]=A,d[28]=J,d[29]=z,d[30]=K):K=d[30],K},x=a=>{const c=t(17),{organizationId:o,products:l,locale:n,onClose:r,onSuccess:i}=a;let m,h,p,x,u;return c[0]!==n?(m={lng:n},c[0]=n,c[1]=m):m=c[1],c[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(h={height:"100%"},c[2]=h):h=c[2],c[3]!==n||c[4]!==r||c[5]!==i||c[6]!==o||c[7]!==l?(p=/* @__PURE__ */e("div",{className:"cc",style:h,children:/* @__PURE__ */e(y,{organizationId:o,products:l,locale:n,onClose:r,onSuccess:i})}),c[3]=n,c[4]=r,c[5]=i,c[6]=o,c[7]=l,c[8]=p):p=c[8],c[9]!==n||c[10]!==o||c[11]!==l||c[12]!==p?(x=/* @__PURE__ */e(s,{organizationId:o,products:l,locale:n,children:p}),c[9]=n,c[10]=o,c[11]=l,c[12]=p,c[13]=x):x=c[13],c[14]!==m||c[15]!==x?(u=/* @__PURE__ */e(d,{options:m,children:x}),c[14]=m,c[15]=x,c[16]=u):u=c[16],u};export{x as default};
@@ -0,0 +1,4 @@
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{useState as r}from"react";import{Q as i,u as o,a as c,b as s,c as l,P as d,d as n}from"./index-DIIxVsLf.js";import{L as m,a as p}from"./translations-WfjA8013.js";import{B as u,A as x}from"./index-Bl_B7cwM.js";import"@radix-ui/react-accessible-icon";import"@radix-ui/react-accordion";import"@radix-ui/react-alert-dialog";import"@radix-ui/react-aspect-ratio";import"@radix-ui/react-avatar";import"@radix-ui/react-checkbox";import"@radix-ui/react-collapsible";import"@radix-ui/react-context-menu";import*as h from"@radix-ui/react-dialog";import"@radix-ui/react-direction";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-form";import"@radix-ui/react-hover-card";import"@radix-ui/react-label";import"@radix-ui/react-menubar";import"@radix-ui/react-navigation-menu";import"@radix-ui/react-one-time-password-field";import"@radix-ui/react-password-toggle-field";import"@radix-ui/react-popover";import"@radix-ui/react-portal";import"@radix-ui/react-progress";import"@radix-ui/react-radio-group";import"@radix-ui/react-scroll-area";import"@radix-ui/react-select";import"@radix-ui/react-separator";import"@radix-ui/react-slider";import"@radix-ui/react-slot";import"@radix-ui/react-switch";import"@radix-ui/react-tabs";import"@radix-ui/react-toast";import"@radix-ui/react-toggle";import"@radix-ui/react-toggle-group";import"@radix-ui/react-toolbar";import"@radix-ui/react-tooltip";import"@radix-ui/react-visually-hidden";const y=r=>{const i=t(32),{onClose:m,onSuccess:h}=r,{stepIndex:y,setStepIndex:f}=o();let b;i[0]!==m?(b=()=>{m&&m()},i[0]=m,i[1]=b):b=i[1];const g=b;let v;i[2]!==h||i[3]!==f?(v=e=>{f(2),h&&h(e)},i[2]=h,i[3]=f,i[4]=v):v=i[4];const _=v;let N;i[5]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(N={maxHeight:"80vh"},i[5]=N):N=i[5];const S=0===y;let w,C,I,j;i[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(w=p("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6"),i[6]=w):w=i[6],i[7]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(C=/* @__PURE__ */e(c,{}),i[7]=C):C=i[7],i[8]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(I=/* @__PURE__ */a("div",{className:"relative px-1 h-[100%] overflow-y-scroll",children:[C,
2
+ /* @__PURE__ */e("div",{className:"pb-8",children:/* @__PURE__ */e(x,{apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",children:/* @__PURE__ */e(s,{})})}),
3
+ /* @__PURE__ */e(l,{})]}),i[8]=I):I=i[8],i[9]!==S?(j=/* @__PURE__ */e(d,{active:S,className:w,children:I}),i[9]=S,i[10]=j):j=i[10];const k=1===y;let z,K,q,A;i[11]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(z=p("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),i[11]=z):z=i[11],i[12]!==f?(K=()=>f(0),i[12]=f,i[13]=K):K=i[13],i[14]!==_||i[15]!==K?(q=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */e(n,{onClose:K,onSuccess:_})}),i[14]=_,i[15]=K,i[16]=q):q=i[16],i[17]!==q||i[18]!==k?(A=/* @__PURE__ */e(d,{active:k,className:z,children:q}),i[17]=q,i[18]=k,i[19]=A):A=i[19];const H=2===y;let W,E,O,Q,R,T;return i[20]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(W=p("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),i[20]=W):W=i[20],i[21]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(E=/* @__PURE__ */e("h2",{className:"text-2xl font-semibold mb-4",children:"Thank you!"}),O=/* @__PURE__ */e("p",{className:"mb-8",children:"Your quote request has been submitted successfully. We will get back to you shortly."}),i[21]=E,i[22]=O):(E=i[21],O=i[22]),i[23]!==g?(Q=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */a("div",{className:"text-center py-20 px-4",children:[E,O,
4
+ /* @__PURE__ */e(u,{onClick:g,children:"Close"})]})}),i[23]=g,i[24]=Q):Q=i[24],i[25]!==H||i[26]!==Q?(R=/* @__PURE__ */e(d,{active:H,className:W,children:Q}),i[25]=H,i[26]=Q,i[27]=R):R=i[27],i[28]!==A||i[29]!==R||i[30]!==j?(T=/* @__PURE__ */e("div",{className:"relative overflow-hidden h-[100%] py-1",style:N,children:/* @__PURE__ */a("div",{className:"h-[100%] relative",children:[j,A,R]})}),i[28]=A,i[29]=R,i[30]=j,i[31]=T):T=i[31],T},f=o=>{const c=t(26),{organizationId:s,products:l,productKey:d,locale:n,onClose:p,onSuccess:x}=o,[f,b]=r(!1);let g;c[0]!==p?(g=()=>{b(!1),p&&p()},c[0]=p,c[1]=g):g=c[1];const v=g;let _,N,S,w,C,I,j,k;return c[2]!==n?(_={lng:n},c[2]=n,c[3]=_):_=c[3],c[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(N={height:"100%"},c[4]=N):N=c[4],c[5]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(S=/* @__PURE__ */e(h.Trigger,{asChild:!0,children:/* @__PURE__ */e(u,{children:"Get a Quote"})}),w=/* @__PURE__ */e(h.Overlay,{className:"fixed inset-0 bg-black/50"}),c[5]=S,c[6]=w):(S=c[5],w=c[6]),c[7]!==v||c[8]!==n||c[9]!==x||c[10]!==s||c[11]!==d||c[12]!==l?(C=/* @__PURE__ */e(h.Content,{className:"fixed top-1/2 left-1/2 max-h-[85vh] w-[90vw] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg bg-white p-6 shadow-lg focus:outline-none",children:/* @__PURE__ */e("div",{className:"h-screen",children:/* @__PURE__ */e(y,{organizationId:s,products:l,productKey:d,locale:n,onClose:v,onSuccess:x})})}),c[7]=v,c[8]=n,c[9]=x,c[10]=s,c[11]=d,c[12]=l,c[13]=C):C=c[13],c[14]!==f||c[15]!==C?(I=/* @__PURE__ */e("div",{className:"cc",style:N,children:/* @__PURE__ */a(h.Root,{open:f,onOpenChange:b,children:[S,w,C]})}),c[14]=f,c[15]=C,c[16]=I):I=c[16],c[17]!==n||c[18]!==s||c[19]!==d||c[20]!==l||c[21]!==I?(j=/* @__PURE__ */e(i,{organizationId:s,products:l,locale:n,productKey:d,children:I}),c[17]=n,c[18]=s,c[19]=d,c[20]=l,c[21]=I,c[22]=j):j=c[22],c[23]!==_||c[24]!==j?(k=/* @__PURE__ */e(m,{options:_,children:j}),c[23]=_,c[24]=j,c[25]=k):k=c[25],k};export{f as default};
package/dist/Store.js CHANGED
@@ -1,37 +1,34 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import{Slot as n}from"@radix-ui/react-slot";import{c as o,a as l,b as s,M as i,C as c,P as d,B as m,S as u,I as p,L as f}from"./translations-WfjA8013.js";import{useTranslation as h}from"react-i18next";import*as g from"react";import{createContext as b,useState as y,useEffect as x,useContext as v}from"react";import"@radix-ui/react-collapsible";import{N as _}from"./navigation-QgfKnxTJ.js";const N=o("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),w=o("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),S=o("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),M=o("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),D=s("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90"}},defaultVariants:{variant:"default"}});function T(t){const a=r(12);let o,s,i,c;a[0]!==t?(({className:o,variant:c,asChild:i,...s}=t),a[0]=t,a[1]=o,a[2]=s,a[3]=i,a[4]=c):(o=a[1],s=a[2],i=a[3],c=a[4]);const d=void 0!==i&&i?n:"span";let m,u;return a[5]!==o||a[6]!==c?(m=l(D({variant:c}),o),a[5]=o,a[6]=c,a[7]=m):m=a[7],a[8]!==d||a[9]!==s||a[10]!==m?(u=/* @__PURE__ */e(d,{"data-slot":"badge",className:m,...s}),a[8]=d,a[9]=s,a[10]=m,a[11]=u):u=a[11],u}const k=b(),z=({organizationId:t,id:a,locale:r,baseUrl:n="/retailers",initialData:o=null,children:l})=>{const[s,i]=y(o?.company_retailer_location||null);x(()=>{!async function(){if(a)try{const e=await fetch(`https://api.colabcommerce.com/widget_api/company_retailer_locations/${a}`);if(!e.ok)throw new Error(`Error fetching retailer: ${e.statusText}`);const t=await e.json();i(t?.company_retailer_location||null)}catch(e){i(null)}else i(null)}()},[t,a,n]);const c={organizationId:t,id:a,locale:r,baseUrl:n,store:s};/* @__PURE__ */
2
- return e(k.Provider,{value:c,children:l})},$=()=>{const e=v(k);if(void 0===e)throw new Error("useStore must be used within a StoreProvider");return e},I=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function L(e){return[e.day,e]}function A(e){return e?.timezone}function C(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return U(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?F({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function j(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=F({storeHour:e.close_at_hour,storeMinute:e.close_at_minute,utcOffsetMinute:e.utc_offset_minute,anchorDate:t||void 0});return a&&t?(a.getTime()<=t.getTime()&&(a=new Date(a.getTime()+864e5)),a):a}function F({storeHour:e,storeMinute:t,utcOffsetMinute:a,anchorDate:r}){const n=r?new Date(r):/* @__PURE__ */new Date,o=n.getFullYear(),l=n.getMonth(),s=n.getDate(),i=Date.UTC(o,l,s,e,t,0)-60*a*1e3,c=new Date(i);return U(c)?c:null}function U(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function O(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function H(){const a=r(33),{t:n}=h(),{store:o}=$(),l=o?.retailer_location_hours;let s;a[0]!==n||a[1]!==l?(s={hours:l,t:n},a[0]=n,a[1]=l,a[2]=s):s=a[2];const{computed:d}=function(e){const t=r(17),{hours:a,openingSoonMinutes:n,closingSoonMinutes:o,t:l}=e,s=void 0===n?60:n,i=void 0===o?60:o;let c,d,m,u;if(t[0]!==i||t[1]!==a||t[2]!==s||t[3]!==l){const e=Array.isArray(a)?a:[],r=e.find(A)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,n=/* @__PURE__ */new Date,o=function(e,t){switch(new Intl.DateTimeFormat("en-US",{weekday:"short",timeZone:t}).format(e)){case"Sun":return 0;case"Mon":return 1;case"Tue":return 2;case"Wed":return 3;case"Thu":return 4;case"Fri":return 5;case"Sat":return 6;default:return new Date(e).getDay()}}(n,r);d=function({now:e,today:t,openingSoonMinutes:a,closingSoonMinutes:r,t:n}){if(!t||!t.open)return{label:n("default:closed"),detail:""};const o=C(t),l=j(t,o);if(!o||!l)return{label:n("default:open"),detail:""};const s=e.getTime(),i=o.getTime(),c=l.getTime(),d=i-60*a*1e3,m=c-60*r*1e3,u=n("default:opens_at",{time:O(o)}),p=n("default:closes_at",{time:O(l)});return s<i?s>=d?{label:n("default:opening_soon"),detail:u}:{label:n("default:closed"),detail:u}:s>=i&&s<c?s>=m?{label:n("default:closing_soon"),detail:p}:{label:n("default:open"),detail:p}:{label:n("default:closed"),detail:u}}({now:n,today:e.find(e=>e?.day===o),openingSoonMinutes:s,closingSoonMinutes:i,t:l});const p=[1,2,3,4,5,6,0],f=new Map(e.map(L));c=p.map(e=>{const t=f.get(e),a=l(`default:${I[e].toLowerCase()}`),r=e===o;let n=l("default:closed");if(t?.open){const e=C(t),a=j(t,e);n=e&&a?`${O(e)} - ${O(a)}`:l("default:open")}return{dayIdx:e,label:a,text:n,isToday:r}}),u=l,m=d.label.toLowerCase().replace(" ","_"),t[0]=i,t[1]=a,t[2]=s,t[3]=l,t[4]=c,t[5]=d,t[6]=m,t[7]=u}else c=t[4],d=t[5],m=t[6],u=t[7];const p=`default:${m}`;let f,h;t[8]!==u||t[9]!==p?(f=u(p),t[8]=u,t[9]=p,t[10]=f):f=t[10],t[11]!==c||t[12]!==d.detail||t[13]!==f?(h={statusLabel:f,statusDetail:d.detail,rows:c},t[11]=c,t[12]=d.detail,t[13]=f,t[14]=h):h=t[14];const g=h;let b;return t[15]!==g?(b={computed:g},t[15]=g,t[16]=b):b=t[16],b}(s);let m;a[3]!==o?.store_type?(m=o?.store_type?.toLowerCase(),a[3]=o?.store_type,a[4]=m):m=a[4];const u=`default:store.types.${m}`;let p,f;a[5]!==n||a[6]!==u?(p=n(u),a[5]=n,a[6]=u,a[7]=p):p=a[7],a[8]!==p?(f=/* @__PURE__ */e("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:/* @__PURE__ */e(T,{variant:"secondary",className:"text-sm",children:p})}),a[8]=p,a[9]=f):f=a[9];const g=o?.retailer_name;let b,y;a[10]!==g?(b=/* @__PURE__ */e("h1",{className:"text-4xl lg:text-5xl font-bold mb-4 text-balance",children:g}),a[10]=g,a[11]=b):b=a[11],a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=/* @__PURE__ */e(i,{className:"w-4 h-4"}),a[12]=y):y=a[12];const x=o?.address?.city,v=o?.address?.province;let _,N;a[13]!==v||a[14]!==x?(_=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[y,
3
- /* @__PURE__ */t("span",{className:"text-sm",children:[x,", ",v]})]}),a[13]=v,a[14]=x,a[15]=_):_=a[15],a[16]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(N=/* @__PURE__ */e(c,{className:"w-4 h-4"}),a[16]=N):N=a[16];const w="text-sm font-medium "+(d.statusLabel===n("default:open")?"text-green-600":"text-red-600");let S,M;a[17]!==d.statusLabel||a[18]!==w?(S=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[N,
4
- /* @__PURE__ */e("span",{className:w,children:d.statusLabel})]}),a[17]=d.statusLabel,a[18]=w,a[19]=S):S=a[19],a[20]!==_||a[21]!==S?(M=/* @__PURE__ */t("div",{className:"flex flex-wrap items-center gap-4 mb-6",children:[_,S]}),a[20]=_,a[21]=S,a[22]=M):M=a[22];const D=o?.retailer_name||"our store";let k,z,F;return a[23]!==n||a[24]!==D?(k=n("default:store_romance",{name:D}),a[23]=n,a[24]=D,a[25]=k):k=a[25],a[26]!==k?(z=/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground leading-relaxed mb-6",children:k}),a[26]=k,a[27]=z):z=a[27],a[28]!==M||a[29]!==z||a[30]!==f||a[31]!==b?(F=/* @__PURE__ */e("section",{className:"bg-gradient-to-b from-primary/5 to-background py-12 lg:py-16",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */t("div",{className:"max-w-4xl",children:[f,b,M,z]})})}),a[28]=M,a[29]=z,a[30]=f,a[31]=b,a[32]=F):F=a[32],F}function P(t){const a=r(8);let n,o,s,i;return a[0]!==t?(({className:n,...o}=t),a[0]=t,a[1]=n,a[2]=o):(n=a[1],o=a[2]),a[3]!==n?(s=l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),a[3]=n,a[4]=s):s=a[4],a[5]!==o||a[6]!==s?(i=/* @__PURE__ */e("div",{"data-slot":"card",className:s,...o}),a[5]=o,a[6]=s,a[7]=i):i=a[7],i}const W=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function E({hours:r,openingSoonMinutes:n=60,closingSoonMinutes:o=60,className:l=""}){const{t:s}=h(),[i,c]=g.useState(!1),d=g.useMemo(()=>{const e=Array.isArray(r)?r:[],t=e.find(e=>e?.timezone)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,a=/* @__PURE__ */new Date,l=function(e,t){switch(new Intl.DateTimeFormat("en-US",{weekday:"short",timeZone:t}).format(e)){case"Sun":return 0;case"Mon":return 1;case"Tue":return 2;case"Wed":return 3;case"Thu":return 4;case"Fri":return 5;case"Sat":return 6;default:return new Date(e).getDay()}}(a,t),i=function({now:e,today:t,openingSoonMinutes:a,closingSoonMinutes:r,t:n}){if(!t||!t.open)return{label:n("default:closed"),detail:""};const o=V(t),l=Z(t,o);if(!o||!l)return{label:n("default:open"),detail:""};const s=e.getTime(),i=o.getTime(),c=l.getTime(),d=i-60*a*1e3,m=c-60*r*1e3,u=n("default:opens_at",{time:G(o)}),p=n("default:closes_at",{time:G(l)});return s<i?s>=d?{label:n("default:opening_soon"),detail:u}:{label:n("default:closed"),detail:u}:s>=i&&s<c?s>=m?{label:n("default:closing_soon"),detail:p}:{label:n("default:open"),detail:p}:{label:n("default:closed"),detail:u}}({now:a,today:e.find(e=>e?.day===l),openingSoonMinutes:n,closingSoonMinutes:o,t:s}),c=new Map(e.map(e=>[e.day,e])),d=[1,2,3,4,5,6,0].map(e=>{const t=c.get(e),a=s(`default:${W[e].toLowerCase()}`),r=e===l;let n=s("default:closed");if(t?.open){const e=V(t),a=Z(t,e);n=e&&a?`${G(e)} - ${G(a)}`:s("default:open")}return{dayIdx:e,label:a,text:n,isToday:r}});return{statusLabel:s(`default:${i.label.toLowerCase().replace(" ","_")}`),statusDetail:i.detail,rows:d}},[r,n,o]);/* @__PURE__ */
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import{Slot as n}from"@radix-ui/react-slot";import{c as o,a as l,b as s,M as i,C as c,P as d,B as m,S as u,I as f,L as p}from"./translations-WfjA8013.js";import{useTranslation as h}from"react-i18next";import*as g from"react";import{createContext as b,useState as y,useEffect as x,useContext as _}from"react";import"@radix-ui/react-collapsible";import{N as v}from"./navigation-QgfKnxTJ.js";const N=o("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),w=o("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),S=s("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90"}},defaultVariants:{variant:"default"}});function M(t){const a=r(12);let o,s,i,c;a[0]!==t?(({className:o,variant:c,asChild:i,...s}=t),a[0]=t,a[1]=o,a[2]=s,a[3]=i,a[4]=c):(o=a[1],s=a[2],i=a[3],c=a[4]);const d=void 0!==i&&i?n:"span";let m,u;return a[5]!==o||a[6]!==c?(m=l(S({variant:c}),o),a[5]=o,a[6]=c,a[7]=m):m=a[7],a[8]!==d||a[9]!==s||a[10]!==m?(u=/* @__PURE__ */e(d,{"data-slot":"badge",className:m,...s}),a[8]=d,a[9]=s,a[10]=m,a[11]=u):u=a[11],u}const D=b(),T=({organizationId:t,id:a,locale:r,baseUrl:n="/retailers",initialData:o=null,children:l})=>{const[s,i]=y(o?.company_retailer_location||null);x(()=>{!async function(){if(a)try{const e=await fetch(`https://api.colabcommerce.com/widget_api/company_retailer_locations/${a}`);if(!e.ok)throw new Error(`Error fetching retailer: ${e.statusText}`);const t=await e.json();i(t?.company_retailer_location||null)}catch(e){i(null)}else i(null)}()},[t,a,n]);const c={organizationId:t,id:a,locale:r,baseUrl:n,store:s};/* @__PURE__ */
2
+ return e(D.Provider,{value:c,children:l})},k=()=>{const e=_(D);if(void 0===e)throw new Error("useStore must be used within a StoreProvider");return e},z=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function $(e){return[e.day,e]}function I(e){return e?.timezone}function C(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return A(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?j({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function L(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=j({storeHour:e.close_at_hour,storeMinute:e.close_at_minute,utcOffsetMinute:e.utc_offset_minute,anchorDate:t||void 0});return a&&t?(a.getTime()<=t.getTime()&&(a=new Date(a.getTime()+864e5)),a):a}function j({storeHour:e,storeMinute:t,utcOffsetMinute:a,anchorDate:r}){const n=r?new Date(r):/* @__PURE__ */new Date,o=n.getFullYear(),l=n.getMonth(),s=n.getDate(),i=Date.UTC(o,l,s,e,t,0)-60*a*1e3,c=new Date(i);return A(c)?c:null}function A(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function F(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function U(){const a=r(30),{t:n}=h(),{store:o}=k(),l=o?.retailer_location_hours;let s;a[0]!==n||a[1]!==l?(s={hours:l,t:n},a[0]=n,a[1]=l,a[2]=s):s=a[2];const{computed:d}=function(e){const t=r(17),{hours:a,openingSoonMinutes:n,closingSoonMinutes:o,t:l}=e,s=void 0===n?60:n,i=void 0===o?60:o;let c,d,m,u;if(t[0]!==i||t[1]!==a||t[2]!==s||t[3]!==l){const e=Array.isArray(a)?a:[],r=e.find(I)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,n=/* @__PURE__ */new Date,o=function(e,t){switch(new Intl.DateTimeFormat("en-US",{weekday:"short",timeZone:t}).format(e)){case"Sun":return 0;case"Mon":return 1;case"Tue":return 2;case"Wed":return 3;case"Thu":return 4;case"Fri":return 5;case"Sat":return 6;default:return new Date(e).getDay()}}(n,r);d=function({now:e,today:t,openingSoonMinutes:a,closingSoonMinutes:r,t:n}){if(!t||!t.open)return{label:n("default:closed"),detail:""};const o=C(t),l=L(t,o);if(!o||!l)return{label:n("default:open"),detail:""};const s=e.getTime(),i=o.getTime(),c=l.getTime(),d=i-60*a*1e3,m=c-60*r*1e3,u=n("default:opens_at",{time:F(o)}),f=n("default:closes_at",{time:F(l)});return s<i?s>=d?{label:n("default:opening_soon"),detail:u}:{label:n("default:closed"),detail:u}:s>=i&&s<c?s>=m?{label:n("default:closing_soon"),detail:f}:{label:n("default:open"),detail:f}:{label:n("default:closed"),detail:u}}({now:n,today:e.find(e=>e?.day===o),openingSoonMinutes:s,closingSoonMinutes:i,t:l});const f=[1,2,3,4,5,6,0],p=new Map(e.map($));c=f.map(e=>{const t=p.get(e),a=l(`default:${z[e].toLowerCase()}`),r=e===o;let n=l("default:closed");if(t?.open){const e=C(t),a=L(t,e);n=e&&a?`${F(e)} - ${F(a)}`:l("default:open")}return{dayIdx:e,label:a,text:n,isToday:r}}),u=l,m=d.label.toLowerCase().replace(" ","_"),t[0]=i,t[1]=a,t[2]=s,t[3]=l,t[4]=c,t[5]=d,t[6]=m,t[7]=u}else c=t[4],d=t[5],m=t[6],u=t[7];const f=`default:${m}`;let p,h;t[8]!==u||t[9]!==f?(p=u(f),t[8]=u,t[9]=f,t[10]=p):p=t[10],t[11]!==c||t[12]!==d.detail||t[13]!==p?(h={statusLabel:p,statusDetail:d.detail,rows:c},t[11]=c,t[12]=d.detail,t[13]=p,t[14]=h):h=t[14];const g=h;let b;return t[15]!==g?(b={computed:g},t[15]=g,t[16]=b):b=t[16],b}(s);let m;a[3]!==o?.store_type||a[4]!==n?(m=o?.store_type&&/* @__PURE__ */e("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:/* @__PURE__ */e(M,{variant:"secondary",className:"text-sm",children:n(`default:store.types.${o?.store_type?.toLowerCase()}`)})}),a[3]=o?.store_type,a[4]=n,a[5]=m):m=a[5];const u=o?.retailer_name;let f,p;a[6]!==u?(f=/* @__PURE__ */e("h1",{className:"text-4xl lg:text-5xl font-bold mb-4 text-balance",children:u}),a[6]=u,a[7]=f):f=a[7],a[8]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(p=/* @__PURE__ */e(i,{className:"w-4 h-4"}),a[8]=p):p=a[8];const g=o?.address?.city,b=o?.address?.province;let y,x;a[9]!==g||a[10]!==b?(y=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[p,
3
+ /* @__PURE__ */t("span",{className:"text-sm",children:[g,", ",b]})]}),a[9]=g,a[10]=b,a[11]=y):y=a[11],a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(x=/* @__PURE__ */e(c,{className:"w-4 h-4"}),a[12]=x):x=a[12];const _="text-sm font-medium "+(d.statusLabel===n("default:open")?"text-green-600":"text-red-600");let v,N;a[13]!==d.statusLabel||a[14]!==_?(v=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[x,
4
+ /* @__PURE__ */e("span",{className:_,children:d.statusLabel})]}),a[13]=d.statusLabel,a[14]=_,a[15]=v):v=a[15],a[16]!==v||a[17]!==y?(N=/* @__PURE__ */t("div",{className:"flex flex-wrap items-center gap-4 mb-6",children:[y,v]}),a[16]=v,a[17]=y,a[18]=N):N=a[18];const w=o?.retailer_name||"our store",S=o?.address?.city||"our city";let D,T,j;return a[19]!==n||a[20]!==w||a[21]!==S?(D=n("default:store_romance",{name:w,city:S}),a[19]=n,a[20]=w,a[21]=S,a[22]=D):D=a[22],a[23]!==D?(T=/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground leading-relaxed mb-6",children:D}),a[23]=D,a[24]=T):T=a[24],a[25]!==N||a[26]!==T||a[27]!==m||a[28]!==f?(j=/* @__PURE__ */e("section",{className:"bg-gradient-to-b from-primary/5 to-background py-12 lg:py-16",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */t("div",{className:"max-w-4xl",children:[m,f,N,T]})})}),a[25]=N,a[26]=T,a[27]=m,a[28]=f,a[29]=j):j=a[29],j}function H(t){const a=r(8);let n,o,s,i;return a[0]!==t?(({className:n,...o}=t),a[0]=t,a[1]=n,a[2]=o):(n=a[1],o=a[2]),a[3]!==n?(s=l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),a[3]=n,a[4]=s):s=a[4],a[5]!==o||a[6]!==s?(i=/* @__PURE__ */e("div",{"data-slot":"card",className:s,...o}),a[5]=o,a[6]=s,a[7]=i):i=a[7],i}const O=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function P({hours:r,openingSoonMinutes:n=60,closingSoonMinutes:o=60,className:l=""}){const{t:s}=h(),[i,c]=g.useState(!1),d=g.useMemo(()=>{const e=Array.isArray(r)?r:[],t=e.find(e=>e?.timezone)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,a=/* @__PURE__ */new Date,l=function(e,t){switch(new Intl.DateTimeFormat("en-US",{weekday:"short",timeZone:t}).format(e)){case"Sun":return 0;case"Mon":return 1;case"Tue":return 2;case"Wed":return 3;case"Thu":return 4;case"Fri":return 5;case"Sat":return 6;default:return new Date(e).getDay()}}(a,t),i=function({now:e,today:t,openingSoonMinutes:a,closingSoonMinutes:r,t:n}){if(!t||!t.open)return{label:n("default:closed"),detail:""};const o=W(t),l=E(t,o);if(!o||!l)return{label:n("default:open"),detail:""};const s=e.getTime(),i=o.getTime(),c=l.getTime(),d=i-60*a*1e3,m=c-60*r*1e3,u=n("default:opens_at",{time:q(o)}),f=n("default:closes_at",{time:q(l)});return s<i?s>=d?{label:n("default:opening_soon"),detail:u}:{label:n("default:closed"),detail:u}:s>=i&&s<c?s>=m?{label:n("default:closing_soon"),detail:f}:{label:n("default:open"),detail:f}:{label:n("default:closed"),detail:u}}({now:a,today:e.find(e=>e?.day===l),openingSoonMinutes:n,closingSoonMinutes:o,t:s}),c=new Map(e.map(e=>[e.day,e])),d=[1,2,3,4,5,6,0].map(e=>{const t=c.get(e),a=s(`default:${O[e].toLowerCase()}`),r=e===l;let n=s("default:closed");if(t?.open){const e=W(t),a=E(t,e);n=e&&a?`${q(e)} - ${q(a)}`:s("default:open")}return{dayIdx:e,label:a,text:n,isToday:r}});return{statusLabel:s(`default:${i.label.toLowerCase().replace(" ","_")}`),statusDetail:i.detail,rows:d}},[r,n,o]);/* @__PURE__ */
5
5
  return e(a,{children:d.rows.map(r=>/* @__PURE__ */e(a,{children:/* @__PURE__ */t("div",{className:"flex justify-between items-center py-2 "+(r.isToday?"bg-primary/5 -mx-4 px-4 rounded-lg":""),children:[
6
6
  /* @__PURE__ */t("span",{className:"font-medium "+(r.isToday?"text-primary":""),children:[r.label,r.isToday&&/* @__PURE__ */e("span",{className:"ml-2 text-xs",children:"(Today)"})]}),
7
- /* @__PURE__ */e("span",{className:"text-muted-foreground",children:r.text})]},r.dayIdx)}))})}function V(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return B(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?q({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function Z(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=q({storeHour:e.close_at_hour,storeMinute:e.close_at_minute,utcOffsetMinute:e.utc_offset_minute,anchorDate:t||void 0});return a&&t?(a.getTime()<=t.getTime()&&(a=new Date(a.getTime()+864e5)),a):a}function q({storeHour:e,storeMinute:t,utcOffsetMinute:a,anchorDate:r}){const n=r?new Date(r):/* @__PURE__ */new Date,o=n.getFullYear(),l=n.getMonth(),s=n.getDate(),i=Date.UTC(o,l,s,e,t,0)-60*a*1e3,c=new Date(i);return B(c)?c:null}function B(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function G(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function R(){const a=r(36),{store:n}=$(),o=`https://www.google.com/maps/dir/?api=1&destination=${n?.name}&destination_place_id=${n?.placeId}`;let l,s,u;a[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(l=/* @__PURE__ */e("h2",{className:"text-2xl font-bold mb-6",children:"Contact Information"}),a[0]=l):l=a[0],a[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(s=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(i,{className:"w-5 h-5 text-primary"})}),u=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Address"}),a[1]=s,a[2]=u):(s=a[1],u=a[2]);const p=n?.address?.street_line_one,f=n?.address?.street_line_two&&`, ${n.address.street_line_two}`;let h;a[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(h=/* @__PURE__ */e("br",{}),a[3]=h):h=a[3];const g=n?.address?.city,b=n?.address?.province,y=n?.address?.postal_code;let x,v,_,N,S,D;a[4]!==p||a[5]!==f||a[6]!==g||a[7]!==b||a[8]!==y?(x=/* @__PURE__ */t("div",{className:"text-muted-foreground",children:[p," ",f,h,g,", ",b," ",y]}),a[4]=p,a[5]=f,a[6]=g,a[7]=b,a[8]=y,a[9]=x):x=a[9],a[10]!==o?(v=/* @__PURE__ */e("a",{className:"px-0 h-auto mt-2 text-primary hover:underline py-3 ",href:o,target:"_blank",rel:"noopener noreferrer",children:"Get Directions →"}),a[10]=o,a[11]=v):v=a[11],a[12]!==v||a[13]!==x?(_=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[s,
8
- /* @__PURE__ */t("div",{children:[u,x,v]})]}),a[12]=v,a[13]=x,a[14]=_):_=a[14],a[15]!==n?.phone_number?(N=n?.phone_number&&/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[
7
+ /* @__PURE__ */e("span",{className:"text-muted-foreground",children:r.text})]},r.dayIdx)}))})}function W(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return Z(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?V({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function E(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=V({storeHour:e.close_at_hour,storeMinute:e.close_at_minute,utcOffsetMinute:e.utc_offset_minute,anchorDate:t||void 0});return a&&t?(a.getTime()<=t.getTime()&&(a=new Date(a.getTime()+864e5)),a):a}function V({storeHour:e,storeMinute:t,utcOffsetMinute:a,anchorDate:r}){const n=r?new Date(r):/* @__PURE__ */new Date,o=n.getFullYear(),l=n.getMonth(),s=n.getDate(),i=Date.UTC(o,l,s,e,t,0)-60*a*1e3,c=new Date(i);return Z(c)?c:null}function Z(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function q(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function B(){const a=r(36),{store:n}=k(),o=`https://www.google.com/maps/dir/?api=1&destination=${n?.name}&destination_place_id=${n?.placeId}`;let l,s,u;a[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(l=/* @__PURE__ */e("h2",{className:"text-2xl font-bold mb-6",children:"Contact Information"}),a[0]=l):l=a[0],a[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(s=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(i,{className:"w-5 h-5 text-primary"})}),u=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Address"}),a[1]=s,a[2]=u):(s=a[1],u=a[2]);const f=n?.address?.street_line_one,p=n?.address?.street_line_two&&`, ${n.address.street_line_two}`;let h;a[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(h=/* @__PURE__ */e("br",{}),a[3]=h):h=a[3];const g=n?.address?.city,b=n?.address?.province,y=n?.address?.postal_code;let x,_,v,S,M,D;a[4]!==f||a[5]!==p||a[6]!==g||a[7]!==b||a[8]!==y?(x=/* @__PURE__ */t("div",{className:"text-muted-foreground",children:[f," ",p,h,g,", ",b," ",y]}),a[4]=f,a[5]=p,a[6]=g,a[7]=b,a[8]=y,a[9]=x):x=a[9],a[10]!==o?(_=/* @__PURE__ */e("a",{className:"px-0 h-auto mt-2 text-primary hover:underline py-3 ",href:o,target:"_blank",rel:"noopener noreferrer",children:"Get Directions →"}),a[10]=o,a[11]=_):_=a[11],a[12]!==_||a[13]!==x?(v=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[s,
8
+ /* @__PURE__ */t("div",{children:[u,x,_]})]}),a[12]=_,a[13]=x,a[14]=v):v=a[14],a[15]!==n?.phone_number?(S=n?.phone_number&&/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[
9
9
  /* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(d,{className:"w-5 h-5 text-primary"})}),
10
10
  /* @__PURE__ */t("div",{children:[
11
11
  /* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Phone"}),
12
- /* @__PURE__ */e("a",{href:`tel:${n?.phone_number?.phone_number}`,className:"text-primary hover:underline",children:n?.phone_number?.formatted})]})]}),a[15]=n?.phone_number,a[16]=N):N=a[16],a[17]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(S=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(w,{className:"w-5 h-5 text-primary"})}),D=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Website"}),a[17]=S,a[18]=D):(S=a[17],D=a[18]);const T=n?.website,k=n?.website;let z,I,L,A,C,j;a[19]!==T||a[20]!==k?(z=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[S,
12
+ /* @__PURE__ */e("a",{href:`tel:${n?.phone_number?.phone_number}`,className:"text-primary hover:underline",children:n?.phone_number?.formatted})]})]}),a[15]=n?.phone_number,a[16]=S):S=a[16],a[17]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(M=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(N,{className:"w-5 h-5 text-primary"})}),D=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Website"}),a[17]=M,a[18]=D):(M=a[17],D=a[18]);const T=n?.website,z=n?.website;let $,I,C,L,j,A;a[19]!==T||a[20]!==z?($=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[M,
13
13
  /* @__PURE__ */t("div",{children:[D,
14
- /* @__PURE__ */e("a",{href:T,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:k})]})]}),a[19]=T,a[20]=k,a[21]=z):z=a[21],a[22]!==_||a[23]!==N||a[24]!==z?(I=/* @__PURE__ */t("div",{className:"space-y-4",children:[_,N,z]}),a[22]=_,a[23]=N,a[24]=z,a[25]=I):I=a[25],a[26]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(L=/* @__PURE__ */t(m,{className:"flex-1 sm:flex-none",children:[
15
- /* @__PURE__ */e(d,{className:"w-4 h-4 mr-2"}),"Call Now"]}),a[26]=L):L=a[26],a[27]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(A=/* @__PURE__ */t("div",{className:"flex flex-wrap gap-3 mt-6 pt-6 border-t",children:[L,
14
+ /* @__PURE__ */e("a",{href:T,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:z})]})]}),a[19]=T,a[20]=z,a[21]=$):$=a[21],a[22]!==v||a[23]!==S||a[24]!==$?(I=/* @__PURE__ */t("div",{className:"space-y-4",children:[v,S,$]}),a[22]=v,a[23]=S,a[24]=$,a[25]=I):I=a[25],a[26]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(C=/* @__PURE__ */t(m,{className:"flex-1 sm:flex-none",children:[
15
+ /* @__PURE__ */e(d,{className:"w-4 h-4 mr-2"}),"Call Now"]}),a[26]=C):C=a[26],a[27]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(L=/* @__PURE__ */t("div",{className:"flex flex-wrap gap-3 mt-6 pt-6 border-t",children:[C,
16
16
  /* @__PURE__ */t(m,{variant:"outline",className:"flex-1 sm:flex-none bg-transparent",children:[
17
- /* @__PURE__ */e(M,{className:"w-4 h-4 mr-2"}),"Send Message"]})]}),a[27]=A):A=a[27],a[28]!==I?(C=/* @__PURE__ */t(P,{className:"p-6",children:[l,I,A]}),a[28]=I,a[29]=C):C=a[29],a[30]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(j=/* @__PURE__ */t("div",{className:"flex items-center gap-3 mb-6",children:[
17
+ /* @__PURE__ */e(w,{className:"w-4 h-4 mr-2"}),"Send Message"]})]}),a[27]=L):L=a[27],a[28]!==I?(j=/* @__PURE__ */t(H,{className:"p-6",children:[l,I,L]}),a[28]=I,a[29]=j):j=a[29],a[30]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(A=/* @__PURE__ */t("div",{className:"flex items-center gap-3 mb-6",children:[
18
18
  /* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:/* @__PURE__ */e(c,{className:"w-5 h-5 text-primary"})}),
19
- /* @__PURE__ */e("h2",{className:"text-2xl font-bold",children:"Hours of Operation"})]}),a[30]=j):j=a[30];const F=n?.retailer_location_hours;let U,O;return a[31]!==F?(U=/* @__PURE__ */t(P,{className:"p-6",children:[j,
20
- /* @__PURE__ */e("div",{className:"space-y-3",children:/* @__PURE__ */e(E,{hours:F})})]}),a[31]=F,a[32]=U):U=a[32],a[33]!==C||a[34]!==U?(O=/* @__PURE__ */t("div",{className:"space-y-6",children:[C,U]}),a[33]=C,a[34]=U,a[35]=O):O=a[35],O}const Y=t=>{const a=r(7),{center:n,zoom:o,size:l,markers:s}=t,i=void 0===l?"400x600":l;let c;if(a[0]!==n||a[1]!==s||a[2]!==i||a[3]!==o){const e=new URLSearchParams;e.append("center",n),e.append("zoom",o),e.append("size",i),e.append("maptype","roadmap"),s.forEach(t=>{const a=`${t.lat},${t.lng}`;e.append("markers",a)}),e.append("key","AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M"),c=e.toString(),a[0]=n,a[1]=s,a[2]=i,a[3]=o,a[4]=c}else c=a[4];const d=`https://maps.googleapis.com/maps/api/staticmap?${c}`;let m;return a[5]!==d?(m=/* @__PURE__ */e("img",{src:d,alt:"Static Map"}),a[5]=d,a[6]=m):m=a[6],m};function J(){const a=r(9),{store:n}=$(),o=`${n?.address?.latitude},${n?.address?.longitude}`,l=n?.address?.latitude,s=n?.address?.longitude;let i,c,d,u;return a[0]!==l||a[1]!==s?(i=[{lat:l,lng:s}],a[0]=l,a[1]=s,a[2]=i):i=a[2],a[3]!==o||a[4]!==i?(c=/* @__PURE__ */e(Y,{center:o,zoom:15,markers:i}),a[3]=o,a[4]=i,a[5]=c):c=a[5],a[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(d=/* @__PURE__ */e("div",{className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 flex items-center justify-center",children:/* @__PURE__ */e("div",{className:"text-center",children:/* @__PURE__ */t(m,{variant:"outline",size:"sm",children:[
21
- /* @__PURE__ */e(_,{className:"w-4 h-4 mr-2"}),"View on Google Maps"]})})}),a[6]=d):d=a[6],a[7]!==c?(u=/* @__PURE__ */e(P,{className:"p-0 overflow-hidden sticky top-24",children:/* @__PURE__ */t("div",{className:"relative w-full h-[500px] bg-gradient-to-br from-primary/10 to-primary/5",children:[c,d]})}),a[7]=c,a[8]=u):u=a[8],u}function K(){const a=r(28),[n,o]=y(""),[l,s]=y("all"),{store:i}=$();let c,d,f,h,g,b,x;if(a[0]!==n||a[1]!==l||a[2]!==i?.retailer_location_products){const r=i?.retailer_location_products||[],g=[{id:"all",label:"All Products"},...Array.from(new Set(r.map(ee))).map(X)];let b,y,x,v,_,N;a[7]!==n||a[8]!==l?(b=e=>{const t=e.name.toLowerCase().includes(n.toLowerCase()),a="all"===l||e.category===l;return t&&a},a[7]=n,a[8]=l,a[9]=b):b=a[9],c=r.filter(b),a[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=/* @__PURE__ */e("h2",{className:"text-3xl font-bold mb-4",children:"Available Products"}),x=/* @__PURE__ */e("p",{className:"text-muted-foreground mb-6",children:"Browse our current inventory of quality furniture pieces. All items shown are available for immediate viewing at our showroom."}),a[10]=y,a[11]=x):(y=a[10],x=a[11]),a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(v=/* @__PURE__ */e(u,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),a[12]=v):v=a[12],a[13]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(_=e=>o(e.target.value),a[13]=_):_=a[13],a[14]!==n?(N=/* @__PURE__ */e("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:/* @__PURE__ */t("div",{className:"relative flex-1",children:[v,
22
- /* @__PURE__ */e(p,{type:"text",placeholder:"Search products...",value:n,onChange:_,className:"pl-10"})]})}),a[14]=n,a[15]=N):N=a[15];const w=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2",children:g.map(t=>/* @__PURE__ */e(m,{variant:l===t.id?"default":"outline",size:"sm",onClick:()=>s(t.id),children:t.label},t.id))});a[16]!==N||a[17]!==w?(h=/* @__PURE__ */t("div",{className:"mb-8",children:[y,x,N,w]}),a[16]=N,a[17]=w,a[18]=h):h=a[18],d="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",f=c.map(Q),a[0]=n,a[1]=l,a[2]=i?.retailer_location_products,a[3]=c,a[4]=d,a[5]=f,a[6]=h}else c=a[3],d=a[4],f=a[5],h=a[6];return a[19]!==d||a[20]!==f?(g=/* @__PURE__ */e("div",{className:d,children:f}),a[19]=d,a[20]=f,a[21]=g):g=a[21],a[22]!==c.length?(b=0===c.length&&/* @__PURE__ */e("div",{className:"text-center py-12",children:/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground",children:"No products found matching your criteria."})}),a[22]=c.length,a[23]=b):b=a[23],a[24]!==h||a[25]!==g||a[26]!==b?(x=/* @__PURE__ */t("div",{children:[h,g,b]}),a[24]=h,a[25]=g,a[26]=b,a[27]=x):x=a[27],x}function Q(a){/* @__PURE__ */
23
- return t(P,{className:"group overflow-hidden",children:[
19
+ /* @__PURE__ */e("h2",{className:"text-2xl font-bold",children:"Hours of Operation"})]}),a[30]=A):A=a[30];const F=n?.retailer_location_hours;let U,O;return a[31]!==F?(U=/* @__PURE__ */t(H,{className:"p-6",children:[A,
20
+ /* @__PURE__ */e("div",{className:"space-y-3",children:/* @__PURE__ */e(P,{hours:F})})]}),a[31]=F,a[32]=U):U=a[32],a[33]!==j||a[34]!==U?(O=/* @__PURE__ */t("div",{className:"space-y-6",children:[j,U]}),a[33]=j,a[34]=U,a[35]=O):O=a[35],O}const G=t=>{const a=r(7),{center:n,zoom:o,size:l,markers:s}=t,i=void 0===l?"400x600":l;let c;if(a[0]!==n||a[1]!==s||a[2]!==i||a[3]!==o){const e=new URLSearchParams;e.append("center",n),e.append("zoom",o),e.append("size",i),e.append("maptype","roadmap"),s.forEach(t=>{const a=`${t.lat},${t.lng}`;e.append("markers",a)}),e.append("key","AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M"),c=e.toString(),a[0]=n,a[1]=s,a[2]=i,a[3]=o,a[4]=c}else c=a[4];const d=`https://maps.googleapis.com/maps/api/staticmap?${c}`;let m;return a[5]!==d?(m=/* @__PURE__ */e("img",{src:d,alt:"Static Map"}),a[5]=d,a[6]=m):m=a[6],m};function R(){const a=r(9),{store:n}=k(),o=`${n?.address?.latitude},${n?.address?.longitude}`,l=n?.address?.latitude,s=n?.address?.longitude;let i,c,d,u;return a[0]!==l||a[1]!==s?(i=[{lat:l,lng:s}],a[0]=l,a[1]=s,a[2]=i):i=a[2],a[3]!==o||a[4]!==i?(c=/* @__PURE__ */e(G,{center:o,zoom:15,markers:i}),a[3]=o,a[4]=i,a[5]=c):c=a[5],a[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(d=/* @__PURE__ */e("div",{className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 flex items-center justify-center",children:/* @__PURE__ */e("div",{className:"text-center",children:/* @__PURE__ */t(m,{variant:"outline",size:"sm",children:[
21
+ /* @__PURE__ */e(v,{className:"w-4 h-4 mr-2"}),"View on Google Maps"]})})}),a[6]=d):d=a[6],a[7]!==c?(u=/* @__PURE__ */e(H,{className:"p-0 overflow-hidden sticky top-24",children:/* @__PURE__ */t("div",{className:"relative w-full h-[500px] bg-gradient-to-br from-primary/10 to-primary/5",children:[c,d]})}),a[7]=c,a[8]=u):u=a[8],u}function Y(){const a=r(28),[n,o]=y(""),[l,s]=y("all"),{store:i}=k();let c,d,p,h,g,b,x;if(a[0]!==n||a[1]!==l||a[2]!==i?.retailer_location_products){const r=i?.retailer_location_products.filter(ee)||[],g=[{id:"all",label:"All Products"},...Array.from(new Set(r.filter(X).map(Q))).map(K)];let b,y,x,_,v,N;a[7]!==n||a[8]!==l?(b=e=>{const t=e.name.toLowerCase().includes(n.toLowerCase()),a="all"===l||e.category===l;return t&&a},a[7]=n,a[8]=l,a[9]=b):b=a[9],c=r.filter(b),a[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=/* @__PURE__ */e("h2",{className:"text-3xl font-bold mb-4",children:"Available Products"}),x=/* @__PURE__ */e("p",{className:"text-muted-foreground mb-6",children:"Browse our current inventory of quality furniture pieces. All items shown are available for immediate viewing at our showroom."}),a[10]=y,a[11]=x):(y=a[10],x=a[11]),a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(_=/* @__PURE__ */e(u,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),a[12]=_):_=a[12],a[13]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(v=e=>o(e.target.value),a[13]=v):v=a[13],a[14]!==n?(N=/* @__PURE__ */e("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:/* @__PURE__ */t("div",{className:"relative flex-1",children:[_,
22
+ /* @__PURE__ */e(f,{type:"text",placeholder:"Search products...",value:n,onChange:v,className:"pl-10"})]})}),a[14]=n,a[15]=N):N=a[15];const w=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2",children:g.map(t=>/* @__PURE__ */e(m,{variant:l===t.id?"default":"outline",size:"sm",onClick:()=>s(t.id),children:t.label},t.id))});a[16]!==N||a[17]!==w?(h=/* @__PURE__ */t("div",{className:"mb-8",children:[y,x,N,w]}),a[16]=N,a[17]=w,a[18]=h):h=a[18],d="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",p=c.map(J),a[0]=n,a[1]=l,a[2]=i?.retailer_location_products,a[3]=c,a[4]=d,a[5]=p,a[6]=h}else c=a[3],d=a[4],p=a[5],h=a[6];return a[19]!==d||a[20]!==p?(g=/* @__PURE__ */e("div",{className:d,children:p}),a[19]=d,a[20]=p,a[21]=g):g=a[21],a[22]!==c.length?(b=0===c.length&&/* @__PURE__ */e("div",{className:"text-center py-12",children:/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground",children:"No products found matching your criteria."})}),a[22]=c.length,a[23]=b):b=a[23],a[24]!==h||a[25]!==g||a[26]!==b?(x=/* @__PURE__ */t("div",{children:[h,g,b]}),a[24]=h,a[25]=g,a[26]=b,a[27]=x):x=a[27],x}function J(a){/* @__PURE__ */
23
+ return t(H,{className:"group overflow-hidden",children:[
24
24
  /* @__PURE__ */t("div",{className:"relative bg-muted overflow-hidden",children:[
25
- /* @__PURE__ */e("img",{src:a.images?.[0]||"/placeholder.svg",alt:a.name,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-300"}),a.available&&/* @__PURE__ */e(T,{className:"absolute top-3 left-3 bg-primary text-primary-foreground",children:"Special Order"}),!a.stocked&&/* @__PURE__ */e(T,{className:"absolute top-3 left-3 bg-red-600 text-white",children:"Out of Stock"}),
26
- /* @__PURE__ */t("div",{className:"absolute top-3 right-3 flex flex-col gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[
27
- /* @__PURE__ */e(m,{size:"icon",variant:"secondary",className:"h-9 w-9",children:/* @__PURE__ */e(S,{className:"w-4 h-4"})}),
28
- /* @__PURE__ */e(m,{size:"icon",variant:"secondary",className:"h-9 w-9",children:/* @__PURE__ */e(N,{className:"w-4 h-4"})})]})]}),
25
+ /* @__PURE__ */e("img",{src:a.images?.[0]||"/placeholder.svg",alt:a.name,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-300"}),a.available&&/* @__PURE__ */e(M,{className:"absolute top-3 left-3 bg-primary text-primary-foreground",children:"Special Order"})]}),
29
26
  /* @__PURE__ */t("div",{className:"p-4",children:[
30
27
  /* @__PURE__ */e("h3",{className:"font-semibold mb-1 group-hover:text-primary transition-colors",children:a.name}),
31
28
  /* @__PURE__ */e("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2",children:a.description}),
32
29
  /* @__PURE__ */t("div",{className:"flex items-center justify-between",children:[
33
30
  /* @__PURE__ */e("span",{className:"text-2xl font-bold text-primary",children:a?.price&&a.price.toLocaleString()}),
34
- /* @__PURE__ */e(m,{size:"sm",disabled:!a.stocked,children:a.stocked?"View Details":"Unavailable"})]})]})]},a.id)}function X(e){return{id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}}function ee(e){return e.category}const te=a=>{const n=r(11),{storeId:o,locale:l,initialData:s}=a,i=void 0===l?"en":l,c=void 0===s?null:s;let d,m,u,p,h,g;return n[0]!==i?(d={lng:i},n[0]=i,n[1]=d):d=n[1],n[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(m=/* @__PURE__ */e(H,{}),n[2]=m):m=n[2],n[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(u=/* @__PURE__ */e("section",{className:"py-12 lg:py-16 bg-muted/30",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */t("div",{className:"grid lg:grid-cols-3 gap-8",children:[
35
- /* @__PURE__ */e("div",{className:"lg:col-span-2",children:/* @__PURE__ */e(R,{})}),
36
- /* @__PURE__ */e("div",{children:/* @__PURE__ */e(J,{})})]})})}),n[3]=u):u=n[3],n[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(p=/* @__PURE__ */e("div",{className:"cc",children:/* @__PURE__ */t("main",{className:"flex-1",children:[m,u,
37
- /* @__PURE__ */e("section",{className:"py-12 lg:py-16",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */e(K,{})})})]})}),n[4]=p):p=n[4],n[5]!==c||n[6]!==o?(h=/* @__PURE__ */e(z,{id:o,initialData:c,children:p}),n[5]=c,n[6]=o,n[7]=h):h=n[7],n[8]!==d||n[9]!==h?(g=/* @__PURE__ */e(f,{options:d,children:h}),n[8]=d,n[9]=h,n[10]=g):g=n[10],g};export{te as default};
31
+ /* @__PURE__ */e(m,{size:"sm",disabled:!a.stocked,children:"View Details"})]})]})]},a.id)}function K(e){return{id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}}function Q(e){return e.category}function X(e){return e.category}function ee(e){return e.stocked||e.available}const te=a=>{const n=r(11),{storeId:o,locale:l,initialData:s}=a,i=void 0===l?"en":l,c=void 0===s?null:s;let d,m,u,f,h,g;return n[0]!==i?(d={lng:i},n[0]=i,n[1]=d):d=n[1],n[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(m=/* @__PURE__ */e(U,{}),n[2]=m):m=n[2],n[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(u=/* @__PURE__ */e("section",{className:"py-12 lg:py-16 bg-muted/30",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */t("div",{className:"grid lg:grid-cols-3 gap-8",children:[
32
+ /* @__PURE__ */e("div",{className:"lg:col-span-2",children:/* @__PURE__ */e(B,{})}),
33
+ /* @__PURE__ */e("div",{children:/* @__PURE__ */e(R,{})})]})})}),n[3]=u):u=n[3],n[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=/* @__PURE__ */e("div",{className:"cc",children:/* @__PURE__ */t("main",{className:"flex-1",children:[m,u,
34
+ /* @__PURE__ */e("section",{className:"py-12 lg:py-16",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */e(Y,{})})})]})}),n[4]=f):f=n[4],n[5]!==c||n[6]!==o?(h=/* @__PURE__ */e(T,{id:o,initialData:c,children:f}),n[5]=c,n[6]=o,n[7]=h):h=n[7],n[8]!==d||n[9]!==h?(g=/* @__PURE__ */e(p,{options:d,children:h}),n[8]=d,n[9]=h,n[10]=g):g=n[10],g};export{te as default};
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{c as a}from"react/compiler-runtime";import{u as l,S as i}from"./store-locator-Cu5fUiVm.js";import{u as n,I as o,A as s,a as d,M as c,b as m,c as u,B as h,d as p,e as g,f,g as x,C as b,U as v,h as y,S as N,m as _,i as w,j as S,k,L as C,l as M}from"./index-CPPzJjs-.js";import{useState as B,useEffect as I,useRef as z,useId as j}from"react";import{c as D,B as A,M as L,S as q,I as P,a as O,P as $,C as T,L as U}from"./translations-WfjA8013.js";import{N as W}from"./navigation-QgfKnxTJ.js";import*as E from"@radix-ui/react-popover";import*as R from"@radix-ui/react-scroll-area";import{useTranslation as F}from"react-i18next";import"@radix-ui/react-accessible-icon";import"@radix-ui/react-accordion";import"@radix-ui/react-alert-dialog";import"@radix-ui/react-aspect-ratio";import"@radix-ui/react-avatar";import"@radix-ui/react-checkbox";import"@radix-ui/react-collapsible";import"@radix-ui/react-context-menu";import*as H from"@radix-ui/react-dialog";import"@radix-ui/react-direction";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-form";import"@radix-ui/react-hover-card";import"@radix-ui/react-label";import"@radix-ui/react-menubar";import"@radix-ui/react-navigation-menu";import"@radix-ui/react-one-time-password-field";import"@radix-ui/react-password-toggle-field";import"@radix-ui/react-portal";import"@radix-ui/react-progress";import"@radix-ui/react-radio-group";import"@radix-ui/react-select";import"@radix-ui/react-separator";import"@radix-ui/react-slider";import"@radix-ui/react-slot";import"@radix-ui/react-switch";import"@radix-ui/react-tabs";import"@radix-ui/react-toast";import"@radix-ui/react-toggle";import"@radix-ui/react-toggle-group";import"@radix-ui/react-toolbar";import"@radix-ui/react-tooltip";import"@radix-ui/react-visually-hidden";const V=D("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]),Z=D("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]),K=r=>{const l=a(25),{store:i,isSelected:d,onClick:c}=r,[,m]=B(!1),[u,h]=n();let p;l[0]!==c||l[1]!==i.id?(p=()=>{c&&c(i.id)},l[0]=c,l[1]=i.id,l[2]=p):p=l[2];const g=p;let f;l[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=()=>m(!1),l[3]=f):f=l[3];const x=f,b=d,v=1*i.address?.latitude,y=1*i.address?.longitude;let N;l[4]!==v||l[5]!==y?(N={lat:v,lng:y},l[4]=v,l[5]=y,l[6]=N):N=l[6];const _="w-8 h-8 hover:cursor-pointer "+(d?"text-primary fill-white z-10":"z-1 fill-white text-muted-foreground");let w,S,k;return l[7]!==_?(w=/* @__PURE__ */t(L,{className:_,size:32}),l[7]=_,l[8]=w):w=l[8],l[9]!==h||l[10]!==b||l[11]!==i.address?.city||l[12]!==i.address?.postal_code||l[13]!==i.address?.province||l[14]!==i.address?.street_line_one||l[15]!==i.address?.street_line_two||l[16]!==i.retailer_name?(S=b&&/* @__PURE__ */e(o,{anchor:h,headerContent:/* @__PURE__ */t("h3",{className:"cc-iw-title font-bold text-sm align-center text-left mb-2",style:{color:"#111827"},children:i.retailer_name}),onClose:x,children:[
1
+ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{c as a}from"react/compiler-runtime";import{u as l,S as i}from"./store-locator-Cu5fUiVm.js";import{a as n,b as o,c as s,d,M as c,u as m,I as u,B as h,h as p,i as g,j as f,k as x,C as b,U as v,l as y,n as N,m as _,S as w,e as S,f as k,L as C,A as M}from"./index-Bl_B7cwM.js";import{useState as B,useEffect as I,useRef as z,useId as j}from"react";import{c as D,B as A,M as L,S as q,I as P,a as O,P as $,C as T,L as U}from"./translations-WfjA8013.js";import{N as W}from"./navigation-QgfKnxTJ.js";import*as E from"@radix-ui/react-popover";import*as R from"@radix-ui/react-scroll-area";import{useTranslation as F}from"react-i18next";import"@radix-ui/react-accessible-icon";import"@radix-ui/react-accordion";import"@radix-ui/react-alert-dialog";import"@radix-ui/react-aspect-ratio";import"@radix-ui/react-avatar";import"@radix-ui/react-checkbox";import"@radix-ui/react-collapsible";import"@radix-ui/react-context-menu";import*as H from"@radix-ui/react-dialog";import"@radix-ui/react-direction";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-form";import"@radix-ui/react-hover-card";import"@radix-ui/react-label";import"@radix-ui/react-menubar";import"@radix-ui/react-navigation-menu";import"@radix-ui/react-one-time-password-field";import"@radix-ui/react-password-toggle-field";import"@radix-ui/react-portal";import"@radix-ui/react-progress";import"@radix-ui/react-radio-group";import"@radix-ui/react-select";import"@radix-ui/react-separator";import"@radix-ui/react-slider";import"@radix-ui/react-slot";import"@radix-ui/react-switch";import"@radix-ui/react-tabs";import"@radix-ui/react-toast";import"@radix-ui/react-toggle";import"@radix-ui/react-toggle-group";import"@radix-ui/react-toolbar";import"@radix-ui/react-tooltip";import"@radix-ui/react-visually-hidden";const V=D("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]),Z=D("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]),K=r=>{const l=a(25),{store:i,isSelected:d,onClick:c}=r,[,m]=B(!1),[u,h]=n();let p;l[0]!==c||l[1]!==i.id?(p=()=>{c&&c(i.id)},l[0]=c,l[1]=i.id,l[2]=p):p=l[2];const g=p;let f;l[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=()=>m(!1),l[3]=f):f=l[3];const x=f,b=d,v=1*i.address?.latitude,y=1*i.address?.longitude;let N;l[4]!==v||l[5]!==y?(N={lat:v,lng:y},l[4]=v,l[5]=y,l[6]=N):N=l[6];const _="w-8 h-8 hover:cursor-pointer "+(d?"text-primary fill-white z-10":"z-1 fill-white text-muted-foreground");let w,S,k;return l[7]!==_?(w=/* @__PURE__ */t(L,{className:_,size:32}),l[7]=_,l[8]=w):w=l[8],l[9]!==h||l[10]!==b||l[11]!==i.address?.city||l[12]!==i.address?.postal_code||l[13]!==i.address?.province||l[14]!==i.address?.street_line_one||l[15]!==i.address?.street_line_two||l[16]!==i.retailer_name?(S=b&&/* @__PURE__ */e(o,{anchor:h,headerContent:/* @__PURE__ */t("h3",{className:"cc-iw-title font-bold text-sm align-center text-left mb-2",style:{color:"#111827"},children:i.retailer_name}),onClose:x,children:[
2
2
  /* @__PURE__ */e("p",{className:"text-sm text-left text-muted-foreground",children:[i.address?.street_line_one,i.address?.street_line_two?`, ${i.address?.street_line_two}`:""]}),
3
3
  /* @__PURE__ */e("p",{className:"text-sm text-left text-muted-foreground mb-4",children:[i.address?.city,", ",i.address?.province," ",i.address?.postal_code]}),
4
4
  /* @__PURE__ */e("div",{className:"flex md:flex-col gap-2",children:[
@@ -28,4 +28,4 @@ return C.createElement(fD,mD({},o,{ref:r,metadata:s,labels:a}))});return t.propT
28
28
  /* @__PURE__ */e("animate",{attributeName:"stroke-opacity",begin:"0s",dur:"1.8s",values:"1; 0",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.3, 0.61, 0.355, 1",repeatCount:"indefinite"})]}),s[2]=B):B=s[2],s[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(u=/* @__PURE__ */e("svg",{viewBox:"0 0 44 44",xmlns:"http://www.w3.org/2000/svg",stroke:"#7033FFFF",children:/* @__PURE__ */t("g",{fill:"none","fill-rule":"evenodd","stroke-width":"2",children:[B,
29
29
  /* @__PURE__ */t("circle",{cx:"22",cy:"22",r:"1",children:[
30
30
  /* @__PURE__ */e("animate",{attributeName:"r",begin:"-0.9s",dur:"1.8s",values:"1; 20",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.165, 0.84, 0.44, 1",repeatCount:"indefinite"}),
31
- /* @__PURE__ */e("animate",{attributeName:"stroke-opacity",begin:"-0.9s",dur:"1.8s",values:"1; 0",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.3, 0.61, 0.355, 1",repeatCount:"indefinite"})]})]})}),s[3]=u):u=s[3],s[4]!==o?(l=/* @__PURE__ */e("div",{className:"flex items-center justify-center",style:o,children:u}),s[4]=o,s[5]=l):l=s[5],l};export{ye as A,T as B,k as C,Ae as I,Lm as L,ce as M,N as S,P as U,fe as a,R as b,L as c,Nm as d,Cm as e,ym as f,pc as g,I as h,WB as i,Rm as j,VB as k,Z as l,zB as m,Fm as n,we as u};
31
+ /* @__PURE__ */e("animate",{attributeName:"stroke-opacity",begin:"-0.9s",dur:"1.8s",values:"1; 0",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.3, 0.61, 0.355, 1",repeatCount:"indefinite"})]})]})}),s[3]=u):u=s[3],s[4]!==o?(l=/* @__PURE__ */e("div",{className:"flex items-center justify-center",style:o,children:u}),s[4]=o,s[5]=l):l=s[5],l};export{Z as A,T as B,k as C,L as I,Lm as L,ce as M,WB as S,P as U,we as a,Ae as b,ye as c,fe as d,Rm as e,VB as f,Fm as g,Nm as h,Cm as i,ym as j,pc as k,I as l,zB as m,N as n,R as u};
@@ -0,0 +1,28 @@
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import{createContext as l,useState as o,useContext as s,useRef as n,useId as i,useEffect as c}from"react";import*as d from"@radix-ui/react-popover";import*as m from"@radix-ui/react-scroll-area";import"@radix-ui/react-slot";import{u,I as h,a as p,b as f,c as g,d as x,M as v,m as y,S as b,e as N,f as _,L as w,g as S}from"./index-Bl_B7cwM.js";import{useTranslation as k}from"react-i18next";import{c as I,S as L,M as C,B as A,C as j,a as M}from"./translations-WfjA8013.js";import"@radix-ui/react-collapsible";import{u as z,a as D}from"./useStoreLocatorConfig-CLD8ogGE.js";import{u as F}from"./useGeolocation-BEKRqeV7.js";const P=l(),O=t=>{const a=r(36),{organizationId:l,locale:s,baseUrl:n,products:i,productKey:c,filterBy:d,children:m}=t,u=void 0===n?"/retailers":n;let h;a[0]!==i?(h=void 0===i?[]:i,a[0]=i,a[1]=h):h=a[1];const p=h;let f;a[2]!==d?(f=void 0===d?{stocked:["sku"],available:["sku"]}:d,a[2]=d,a[3]=f):f=a[3];const g=f,[x,v]=o(0),[y,b]=o(null),[N,_]=o(null),[w,S]=o(null),[k,I]=o(!1),[L,C]=o("300mi"),[A,j]=o(null),[M,O]=o("geolocation");let T;a[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(T={autoGeoLocate:!1},a[4]=T):T=a[4];const{location:U,Locate:q}=F(T),B="geolocation"===M?U:A||U;let E;a[5]!==B||a[6]!==l||a[7]!==L?(E={organizationId:l,location:B,page:1,radius:L,pageSize:10},a[5]=B,a[6]=l,a[7]=L,a[8]=E):E=a[8];const{stores:$,meta:K,isLoading:R,error:Z}=z(E),{config:H,isLoading:W,error:G}=D(l);let J;a[9]!==q||a[10]!==u||a[11]!==H||a[12]!==G||a[13]!==W||a[14]!==g||a[15]!==N||a[16]!==s||a[17]!==B||a[18]!==k||a[19]!==w||a[20]!==K||a[21]!==l||a[22]!==c||a[23]!==p||a[24]!==Z||a[25]!==R||a[26]!==A||a[27]!==L||a[28]!==y||a[29]!==x||a[30]!==$||a[31]!==M?(J={stepIndex:x,setStepIndex:v,selectedStoreId:y,setSelectedStoreId:b,focusedStoreId:N,setFocusedStoreId:_,organizationId:l,location:B,locale:s,stores:$,meta:K,searchIsLoading:R,searchError:Z,config:H,configIsLoading:W,configError:G,messageDialogOpen:k,setMessageDialogOpen:I,messageStoreId:w,setMessageStoreId:S,baseUrl:u,searchRadius:L,setSearchRadius:C,searchLocation:A,setSearchLocation:j,useLocationType:M,setUseLocationType:O,products:p,productKey:c,filterBy:g,Locate:q},a[9]=q,a[10]=u,a[11]=H,a[12]=G,a[13]=W,a[14]=g,a[15]=N,a[16]=s,a[17]=B,a[18]=k,a[19]=w,a[20]=K,a[21]=l,a[22]=c,a[23]=p,a[24]=Z,a[25]=R,a[26]=A,a[27]=L,a[28]=y,a[29]=x,a[30]=$,a[31]=M,a[32]=J):J=a[32];const Q=J;let V;return a[33]!==m||a[34]!==Q?(V=/* @__PURE__ */e(P.Provider,{value:Q,children:m}),a[33]=m,a[34]=Q,a[35]=V):V=a[35],V},T=()=>s(P),U=I("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),q=I("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function B(e){return e?.label??e?.description??e?.text??e?.placePrediction?.text?.text??e?.placePrediction?.structuredFormat?.mainText?.text??""}function E(){const l=r(66),{t:s}=k(),[p,f]=o("");o(!1);const[g,x]=o(!1),[v,y]=o(-1),{location:b,setSearchLocation:N,setUseLocationType:_,Locate:w}=T();let S,I,A;l[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(S={lat:37.7937,lng:-122.3965},l[0]=S):S=l[0],l[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(I=["locality","postal_code"],l[1]=I):I=l[1],l[2]!==p?(A={query:p,apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",center:S,radiusMeters:1e4,types:I},l[2]=p,l[3]=A):A=l[3];const{results:j,isLoading:M,error:z}=u(A);let D;l[4]!==j?(D=Array.isArray(j)?j:[],l[4]=j,l[5]=D):D=l[5];const F=D,P=n(null),O=i(),U=v>=0?`${O}-opt-${v}`:void 0;let q,E,Z;l[6]!==M||l[7]!==F.length||l[8]!==g?(q=()=>{g&&(M||y(F.length?0:-1))},E=[g,M,F.length],l[6]=M,l[7]=F.length,l[8]=g,l[9]=q,l[10]=E):(q=l[9],E=l[10]),c(q,E),l[11]!==N||l[12]!==_?(Z=e=>{const t=B(e);if(!t)return;f(t),x(!1),requestAnimationFrame(()=>P.current?.focus());const a={latitude:e.location?.lat??null,longitude:e.location?.lng??null,accuracy:null,altitude:0,altitudeAccuracy:null,heading:null,speed:null,city:e.city??null,region:e.region??null,country:e.country??null,postal:e.postalCode??null,timezone:null,ip:null,type:"search",raw:e};N(a),_("search")},l[11]=N,l[12]=_,l[13]=Z):Z=l[13];const H=Z;let W;l[14]!==v||l[15]!==H||l[16]!==F||l[17]!==g?(W=e=>{if(g||"ArrowDown"!==e.key&&"ArrowUp"!==e.key){if(g)e:switch(e.key){case"ArrowDown":e.preventDefault(),y(e=>Math.min(e+1,F.length-1));break e;case"ArrowUp":e.preventDefault(),y(R);break e;case"Enter":v>=0&&F[v]&&(e.preventDefault(),H(F[v]));break e;case"Escape":e.preventDefault(),x(!1)}}else x(!0)},l[14]=v,l[15]=H,l[16]=F,l[17]=g,l[18]=W):W=l[18];const G=W;let J;l[19]!==w||l[20]!==_?(J=()=>{_("geolocation"),x(!1),f(""),w()},l[19]=w,l[20]=_,l[21]=J):J=l[21];const Q=J;let V;l[22]!==z||l[23]!==M||l[24]!==F.length||l[25]!==g||l[26]!==p?(V=g&&!M&&!z&&p.trim().length>0&&0===F.length,l[22]=z,l[23]=M,l[24]=F.length,l[25]=g,l[26]=p,l[27]=V):V=l[27];const X=V,Y=M||!!z||X||F.length>0;let ee,te,ae,re,le,oe,se,ne,ie,ce,de,me;return l[28]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ee=/* @__PURE__ */e(L,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),l[28]=ee):ee=l[28],l[29]!==b||l[30]!==s?(te=b?.city?s("default:location_search_placeholder_w_location",{location:b.city}):s("default:location_search_placeholder"),l[29]=b,l[30]=s,l[31]=te):te=l[31],l[32]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ae=e=>{f(e.target.value),x(!0)},re=()=>x(!0),l[32]=ae,l[33]=re):(ae=l[32],re=l[33]),l[34]!==U||l[35]!==O||l[36]!==G||l[37]!==g||l[38]!==p||l[39]!==te?(le=/* @__PURE__ */e(d.Anchor,{asChild:!0,children:/* @__PURE__ */t("div",{className:"flex-1 relative",children:[ee,
2
+ /* @__PURE__ */e(h,{ref:P,type:"text",placeholder:te,value:p,onChange:ae,onFocus:re,onKeyDown:G,className:"pl-10 h-12",role:"combobox","aria-autocomplete":"list","aria-expanded":g,"aria-controls":O,"aria-activedescendant":U})]})}),l[34]=U,l[35]=O,l[36]=G,l[37]=g,l[38]=p,l[39]=te,l[40]=le):le=l[40],l[41]!==v||l[42]!==H||l[43]!==z||l[44]!==M||l[45]!==F||l[46]!==O||l[47]!==Y||l[48]!==X||l[49]!==s?(oe=Y?/* @__PURE__ */t(a,{children:[
3
+ /* @__PURE__ */e(m.Viewport,{children:/* @__PURE__ */t("div",{id:O,role:"listbox",className:"p-2",children:[z?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm rounded-md border border-destructive/30 bg-destructive/10 text-destructive",children:String(z)}):null,M?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:s("default:loading")}):null,X?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:s("default:no_results")}):null,!M&&!z&&F.map((a,r)=>{const l=r===v,o=B(a),s=(n=a,n?.secondary??n?.secondary_text??n?.placePrediction?.structuredFormat?.secondaryText?.text??n?.placePrediction?.structuredFormat?.secondaryText??"");var n;const i=function(e,t){return e?.id??e?.place_id??e?.placePrediction?.placeId??t}(a,`${r}`);return o?/* @__PURE__ */t("div",{id:`${O}-opt-${r}`,role:"option","aria-selected":l,onMouseEnter:()=>y(r),onMouseDown:$,onClick:()=>H(a),className:["cursor-pointer rounded-lg px-3 py-2",l?"bg-muted":"hover:bg-muted/60"].join(" "),children:[
4
+ /* @__PURE__ */e("div",{className:"text-sm text-left font-medium leading-tight",children:o}),s?/* @__PURE__ */e("div",{className:"text-xs text-left text-muted-foreground mt-1 leading-tight",children:s}):null]},i):null})]})}),
5
+ /* @__PURE__ */e(m.Scrollbar,{orientation:"vertical",className:"flex select-none touch-none p-0.5 bg-transparent",children:/* @__PURE__ */e(m.Thumb,{className:"flex-1 bg-border rounded-full"})})]}):null,l[41]=v,l[42]=H,l[43]=z,l[44]=M,l[45]=F,l[46]=O,l[47]=Y,l[48]=X,l[49]=s,l[50]=oe):oe=l[50],l[51]!==oe?(se=/* @__PURE__ */e(d.Content,{sideOffset:6,align:"start",onOpenAutoFocus:K,className:"w-[var(--radix-popover-trigger-width)] max-w-[560px] rounded-xl border rounded bg-background shadow-lg overflow-hidden",children:/* @__PURE__ */e(m.Root,{className:"max-h-80",children:oe})}),l[51]=oe,l[52]=se):se=l[52],l[53]!==g||l[54]!==le||l[55]!==se?(ne=/* @__PURE__ */e("div",{className:"flex flex-row gap-4",children:/* @__PURE__ */t(d.Root,{open:g,onOpenChange:x,children:[le,se]})}),l[53]=g,l[54]=le,l[55]=se,l[56]=ne):ne=l[56],l[57]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ie=/* @__PURE__ */e(C,{className:"w-4 h-4"}),l[57]=ie):ie=l[57],l[58]!==s?(ce=s("default:use_my_location"),l[58]=s,l[59]=ce):ce=l[59],l[60]!==Q||l[61]!==ce?(de=/* @__PURE__ */t("div",{className:"mt-2 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[ie,
6
+ /* @__PURE__ */e("button",{className:"text-primary hover:underline font-medium",type:"button",onClick:Q,children:ce})]}),l[60]=Q,l[61]=ce,l[62]=de):de=l[62],l[63]!==ne||l[64]!==de?(me=/* @__PURE__ */e("div",{className:"max-w-3xl mx-auto",children:/* @__PURE__ */t("div",{className:"rounded-xl p-6",children:[ne,de]})}),l[63]=ne,l[64]=de,l[65]=me):me=l[65],me}function $(e){return e.preventDefault()}function K(e){return e.preventDefault()}function R(e){return Math.max(e-1,0)}const Z=a=>{const l=r(29),{store:s,isSelected:n,onClick:i,onSelect:c}=a,[,d]=o(!1),[m,u]=p();let h;l[0]!==i||l[1]!==s.id?(h=()=>{i&&i(s.id)},l[0]=i,l[1]=s.id,l[2]=h):h=l[2];const x=h;let v;l[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(v=()=>d(!1),l[3]=v):v=l[3];const y=v,b=n;let N;l[4]!==c||l[5]!==s.id?(N=e=>{e.stopPropagation(),c&&c(s.id)},l[4]=c,l[5]=s.id,l[6]=N):N=l[6];const _=N,w=1*s.address?.latitude,S=1*s.address?.longitude;let k;l[7]!==w||l[8]!==S?(k={lat:w,lng:S},l[7]=w,l[8]=S,l[9]=k):k=l[9];const I="w-8 h-8 hover:cursor-pointer "+(n?"text-primary fill-white z-10":"z-1 fill-white text-muted-foreground");let L,j,M;return l[10]!==I?(L=/* @__PURE__ */e(C,{className:I,size:32}),l[10]=I,l[11]=L):L=l[11],l[12]!==_||l[13]!==u||l[14]!==b||l[15]!==s.address?.city||l[16]!==s.address?.postal_code||l[17]!==s.address?.province||l[18]!==s.address?.street_line_one||l[19]!==s.address?.street_line_two||l[20]!==s.retailer_name?(j=b&&/* @__PURE__ */t(f,{anchor:u,headerContent:/* @__PURE__ */e("h3",{className:"cc-iw-title font-bold text-sm align-center text-left mb-2",style:{color:"#111827"},children:s.retailer_name}),onClose:y,children:[
7
+ /* @__PURE__ */t("p",{className:"text-xs text-left text-muted-foreground",children:[s.address?.street_line_one,s.address?.street_line_two?`, ${s.address?.street_line_two}`:""]}),
8
+ /* @__PURE__ */t("p",{className:"text-xs text-left text-muted-foreground mb-2",children:[s.address?.city,", ",s.address?.province," ",s.address?.postal_code]}),
9
+ /* @__PURE__ */e("div",{className:"flex flex-row gap-2 mb-1",children:/* @__PURE__ */e(A,{className:"flex-1 md:flex-row",size:"sm",onClick:_,children:"Select"})})]}),l[12]=_,l[13]=u,l[14]=b,l[15]=s.address?.city,l[16]=s.address?.postal_code,l[17]=s.address?.province,l[18]=s.address?.street_line_one,l[19]=s.address?.street_line_two,l[20]=s.retailer_name,l[21]=j):j=l[21],l[22]!==x||l[23]!==m||l[24]!==s.name||l[25]!==k||l[26]!==L||l[27]!==j?(M=/* @__PURE__ */t(g,{position:k,ref:m,title:s.name,onClick:x,children:[L,j]}),l[22]=x,l[23]=m,l[24]=s.name,l[25]=k,l[26]=L,l[27]=j,l[28]=M):M=l[28],M},H=()=>{const a=r(46),{location:l,stores:o,focusedStoreId:s,setFocusedStoreId:n,setSelectedStoreId:i,setStepIndex:d}=T(),m=x();let u;a[0]!==m?(u=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e+1)},a[0]=m,a[1]=u):u=a[1];const h=u;let p;a[2]!==m?(p=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e-1)},a[2]=m,a[3]=p):p=a[3];const f=p;let g,y,b,N,_;a[4]!==l||a[5]!==m?(g=()=>{m&&l?.latitude&&l?.longitude&&(m.panTo({lat:l.latitude,lng:l.longitude}),m.setZoom(9))},y=[l,m],a[4]=l,a[5]=m,a[6]=g,a[7]=y):(g=a[6],y=a[7]),c(g,y),a[8]!==s||a[9]!==m||a[10]!==o?(b=()=>{if(!m||!s)return;const e=o.find(e=>e.id===s);e&&e.address&&m.panTo({lat:1*e.address.latitude,lng:1*e.address.longitude})},N=[s,o,m],a[8]=s,a[9]=m,a[10]=o,a[11]=b,a[12]=N):(b=a[11],N=a[12]),c(b,N),a[13]!==n?(_=e=>{n(e)},a[13]=n,a[14]=_):_=a[14];const w=_;let S;a[15]!==i||a[16]!==d?(S=e=>{i(e),d(1)},a[15]=i,a[16]=d,a[17]=S):S=a[17];const k=S;let I,L,C,A,j,M,z,D,F,P,O;if(a[18]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(I={width:"100%",height:"300px"},L={lat:22.54992,lng:0},a[18]=I,a[19]=L):(I=a[18],L=a[19]),a[20]!==s||a[21]!==w||a[22]!==k||a[23]!==o){let t;a[25]!==s||a[26]!==w||a[27]!==k?(t=t=>/* @__PURE__ */e(Z,{store:t,isSelected:s===t.id,onClick:w,onSelect:k},t.id),a[25]=s,a[26]=w,a[27]=k,a[28]=t):t=a[28],C=o.map(t),a[20]=s,a[21]=w,a[22]=k,a[23]=o,a[24]=C}else C=a[24];return a[29]!==C?(A=/* @__PURE__ */e("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/5 to-muted",children:/* @__PURE__ */e("div",{className:"text-center w-full",children:/* @__PURE__ */e(v,{style:I,defaultCenter:L,defaultZoom:3,gestureHandling:"greedy",disableDefaultUI:!0,mapId:"b1e4f5f5f8c7e2d9",children:C})})}),a[29]=C,a[30]=A):A=a[30],a[31]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(j=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),a[31]=j):j=a[31],a[32]!==h?(M=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:h,children:j}),a[32]=h,a[33]=M):M=a[33],a[34]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(z=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})}),a[34]=z):z=a[34],a[35]!==f?(D=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:f,children:z}),a[35]=f,a[36]=D):D=a[36],a[37]!==M||a[38]!==D?(F=/* @__PURE__ */t("div",{className:"absolute top-4 right-4 flex flex-col gap-2",children:[M,D]}),a[37]=M,a[38]=D,a[39]=F):F=a[39],a[40]!==o.length?(P=/* @__PURE__ */t("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 bg-card border shadow-lg rounded-full px-4 py-2 text-sm font-medium",children:[
10
+ /* @__PURE__ */e("span",{className:"text-primary",children:o.length})," stores found"]}),a[40]=o.length,a[41]=P):P=a[41],a[42]!==A||a[43]!==F||a[44]!==P?(O=/* @__PURE__ */e("div",{className:"relative",children:/* @__PURE__ */t("div",{className:"bg-muted rounded-xl overflow-hidden border shadow-md h-[300px]",children:[A,F,P]})}),a[42]=A,a[43]=F,a[44]=P,a[45]=O):O=a[45],O},W=a=>{const l=r(61),{id:o,name:s,addressLineOne:n,city:i,province:c,postalCode:d,hours:m,distance:u,services:h,isFocused:p,handleFocus:f,handleSelect:g,requestedProducts:x,locationProducts:v,filterBy:N}=a,_=void 0===h?[]:h;let w;l[0]!==x?(w=void 0===x?[]:x,l[0]=x,l[1]=w):w=l[1];const S=w;let I;l[2]!==v?(I=void 0===v?[]:v,l[2]=v,l[3]=I):I=l[3];const L=I,M=void 0===N?"sku":N,{t:z}=k(),{availabilitySummary:D}=((e,t,a=["sku"])=>{const r={};t.map(t=>{const l=e.find(e=>a.some(a=>e[a]===t.key));r[t.sku]=l?{stocked:l.stocked,available:l.available}:{stocked:!1,available:!1}});const l=Object.values(r).every(e=>e.stocked),o=Object.values(r).every(e=>e.available),s=Object.values(r).every(e=>!e.stocked),n=Object.values(r).every(e=>!e.available);let i="mixed";return l?i="allStocked":o?i="allAvailable":s&&n&&(i="none"),{availability:r,allAvailable:o,allStocked:l,noneStocked:s,noneAvailable:n,availabilitySummary:i}})(L,S,M);let F;l[4]!==g||l[5]!==o?(F=e=>{e.stopPropagation(),g(o)},l[4]=g,l[5]=o,l[6]=F):F=l[6];const P=F,O="bg-card border rounded-xl p-6 transition-all hover:shadow-lg cursor-pointer "+(p?"ring-2 ring-primary shadow-lg":"");let T,B,E,$,K,R,Z,H,W,Q,V,X,Y,ee;l[7]!==f||l[8]!==o?(T=()=>f(o),l[7]=f,l[8]=o,l[9]=T):T=l[9],l[10]!==s?(B=/* @__PURE__ */e("div",{className:"flex items-start justify-between gap-4 mb-3",children:/* @__PURE__ */e("div",{children:/* @__PURE__ */e("h3",{className:"font-bold text-lg text-left mb-1",children:s})})}),l[10]=s,l[11]=B):B=l[11],l[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(E=/* @__PURE__ */e(C,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),l[12]=E):E=l[12],l[13]!==n?($=/* @__PURE__ */e("p",{className:"font-medium text-left",children:n}),l[13]=n,l[14]=$):$=l[14],l[15]!==i||l[16]!==d||l[17]!==c?(K=/* @__PURE__ */t("p",{className:"text-muted-foreground text-left",children:[i,", ",c," ",d]}),l[15]=i,l[16]=d,l[17]=c,l[18]=K):K=l[18],l[19]!==u||l[20]!==z?(R=z("default:distance_away",{distance:y(u).toFixed(1),distanceUnit:"miles"}),l[19]=u,l[20]=z,l[21]=R):R=l[21],l[22]!==R?(Z=/* @__PURE__ */e("p",{className:"text-primary font-medium mt-1 text-left",children:R}),l[22]=R,l[23]=Z):Z=l[23],l[24]!==$||l[25]!==K||l[26]!==Z?(H=/* @__PURE__ */t("div",{className:"flex items-start gap-2",children:[E,
11
+ /* @__PURE__ */t("div",{children:[$,K,Z]})]}),l[24]=$,l[25]=K,l[26]=Z,l[27]=H):H=l[27],l[28]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(W=/* @__PURE__ */e("div",{className:"mt-2.5",children:/* @__PURE__ */e(j,{className:"w-4 h-4 text-muted-foreground"})}),l[28]=W):W=l[28],l[29]!==m?(Q=/* @__PURE__ */t("div",{className:"flex items-top gap-2",children:[W,
12
+ /* @__PURE__ */e("span",{className:"text-muted-foreground",children:/* @__PURE__ */e(b,{hours:m})})]}),l[29]=m,l[30]=Q):Q=l[30],l[31]!==H||l[32]!==Q?(V=/* @__PURE__ */t("div",{className:"space-y-2 text-sm",children:[H,Q]}),l[31]=H,l[32]=Q,l[33]=V):V=l[33],l[34]!==D?(X="allStocked"===D&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-green-50 text-green-600 text-xs font-medium rounded-full",children:[
13
+ /* @__PURE__ */e(U,{className:"w-4 h-4 text-green-600 me-1"}),"All Items Stocked"]}),l[34]=D,l[35]=X):X=l[35],l[36]!==D?(Y="allAvailable"===D&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-medium rounded-full",children:[
14
+ /* @__PURE__ */e(q,{className:"w-4 me-1 h-4 text-orange-600"}),"Available by Special Order"]}),l[36]=D,l[37]=Y):Y=l[37],l[38]!==D?(ee="mixed"===D&&/* @__PURE__ */t("div",{children:[
15
+ /* @__PURE__ */t("div",{className:"flex items-center gap-2 mt-4 text-sm",children:[
16
+ /* @__PURE__ */e("span",{className:"font-bold w-28 text-wrap",children:"Braxton"}),
17
+ /* @__PURE__ */t("span",{className:"flex items-center px-3 py-1 bg-orange-50 text-orange-600 text-xs font-medium rounded-full",children:[
18
+ /* @__PURE__ */e(q,{className:"w-4 me-1 h-4 text-orange-600"}),"Special Order"]})]}),
19
+ /* @__PURE__ */t("div",{className:"flex items-center gap-2 mt-4 text-sm",children:[
20
+ /* @__PURE__ */e("span",{className:"font-bold w-28 text-wrap",children:"Juno"}),
21
+ /* @__PURE__ */t("span",{className:"flex items-center px-3 py-1 bg-green-50 text-green-600 text-xs font-medium rounded-full",children:[
22
+ /* @__PURE__ */e(U,{className:"w-4 me-1 h-4 text-green-600"}),"Stocked"]})]})]}),l[38]=D,l[39]=ee):ee=l[39];const te=_.filter(G).map(J);let ae,re,le,oe,se,ne;return l[40]!==te?(ae=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2 mt-4",children:te}),l[40]=te,l[41]=ae):ae=l[41],l[42]!==B||l[43]!==V||l[44]!==X||l[45]!==Y||l[46]!==ee||l[47]!==ae?(re=/* @__PURE__ */t("div",{className:"flex-1",children:[B,V,X,Y,ee,ae]}),l[42]=B,l[43]=V,l[44]=X,l[45]=Y,l[46]=ee,l[47]=ae,l[48]=re):re=l[48],l[49]!==z?(le=z("default:select_store"),l[49]=z,l[50]=le):le=l[50],l[51]!==P||l[52]!==le?(oe=/* @__PURE__ */e("div",{className:"flex md:flex-col gap-2",children:/* @__PURE__ */e(A,{onClick:P,variant:"default",className:"whitespace-nowrap",children:le})}),l[51]=P,l[52]=le,l[53]=oe):oe=l[53],l[54]!==re||l[55]!==oe?(se=/* @__PURE__ */t("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[re,oe]}),l[54]=re,l[55]=oe,l[56]=se):se=l[56],l[57]!==se||l[58]!==O||l[59]!==T?(ne=/* @__PURE__ */e("div",{className:O,onClick:T,children:se}),l[57]=se,l[58]=O,l[59]=T,l[60]=ne):ne=l[60],ne};function G(e){return e}function J(t){/* @__PURE__ */
23
+ return e("span",{className:"px-3 py-1 bg-primary/10 text-primary text-xs font-medium rounded-full",children:t},t)}function Q(){const a=r(28),{stores:l,location:o,products:s,setStepIndex:n,productKey:i,setSelectedStoreId:c,searchIsLoading:d,searchError:m,baseUrl:u,focusedStoreId:h,setFocusedStoreId:p}=T();let f;a[0]!==c||a[1]!==n?(f=e=>{c(e),n(1)},a[0]=c,a[1]=n,a[2]=f):f=a[2];const g=f;let x,v,y,b,S;return a[3]!==m||a[4]!==d||a[5]!==l?(x=!d&&!m&&0===l.length&&/* @__PURE__ */e(N,{}),a[3]=m,a[4]=d,a[5]=l,a[6]=x):x=a[6],a[7]!==d?(v=d&&/* @__PURE__ */e("div",{className:"flex items-center justify-center h-48",children:/* @__PURE__ */e(w,{})}),a[7]=d,a[8]=v):v=a[8],a[9]!==u||a[10]!==h||a[11]!==g||a[12]!==o||a[13]!==i||a[14]!==s||a[15]!==m||a[16]!==d||a[17]!==p||a[18]!==l?(y=!d&&!m&&l.map(t=>/* @__PURE__ */e(W,{id:t.id,name:t.retailer_name,placeId:t.place_id,addressLineOne:t.address?.street_line_one,addressLineTwo:t.address?.street_line_two,city:t.address?.city,province:t.address?.province,postalCode:t.address?.postal_code,country:t.address?.country,distance:_(o.latitude,o.longitude,t.address?.latitude,t.address?.longitude),phone:t.phone_number,hours:t.retailer_location_hours,services:[t.store_type],isFocused:h===t.id,handleFocus:p,href:`${u}/${t.id}`,handleSelect:g,locationProducts:t.retailer_location_products,requestedProducts:s,filterBy:[i]},t.id)),a[9]=u,a[10]=h,a[11]=g,a[12]=o,a[13]=i,a[14]=s,a[15]=m,a[16]=d,a[17]=p,a[18]=l,a[19]=y):y=a[19],a[20]!==m||a[21]!==d?(b=!d&&m&&/* @__PURE__ */e("div",{className:"text-red-600 text-center",children:"An error occurred while searching for stores. Please try again."}),a[20]=m,a[21]=d,a[22]=b):b=a[22],a[23]!==x||a[24]!==v||a[25]!==y||a[26]!==b?(S=/* @__PURE__ */t("div",{className:"space-y-4",children:[x,v,y,b]}),a[23]=x,a[24]=v,a[25]=y,a[26]=b,a[27]=S):S=a[27],S}const V=a=>{const l=r(30),{onClose:o,onSuccess:s}=a,{organizationId:n,location:i,selectedStoreId:c,products:d,stores:m,productKey:u}=T();let h,p,f,g,x,v;if(l[0]!==i||l[1]!==o||l[2]!==s||l[3]!==n||l[4]!==u||l[5]!==d||l[6]!==c||l[7]!==m){let a;l[12]!==c?(a=e=>e.id===c,l[12]=c,l[13]=a):a=l[13];const r=m.find(a),x=r?.retailer_location_products?.filter(e=>d.map(X).includes(e[u]));let v;l[14]!==s?(v=(e,t)=>{s&&s({formValues:e,lead:t})},l[14]=s,l[15]=v):v=l[15];const y=v;f=/* @__PURE__ */t("div",{className:"mb-3",children:["Selected location ",
24
+ /* @__PURE__ */e("strong",{children:r?.retailer_name})]}),l[16]!==y||l[17]!==i||l[18]!==o||l[19]!==n||l[20]!==d||l[21]!==c?(g=/* @__PURE__ */e(S,{onClose:o,products:d,activityType:"LeadActivity::QuoteRequest",onSuccess:y,location:i,organizationId:n,selectedLocationId:c}),l[16]=y,l[17]=i,l[18]=o,l[19]=n,l[20]=d,l[21]=c,l[22]=g):g=l[22],h="mt-5",p=x?.map(a=>/* @__PURE__ */t("div",{className:"grid grid-cols-2 gap-4",children:[
25
+ /* @__PURE__ */e("img",{src:a.images[0],alt:a.name,className:"w-full"}),
26
+ /* @__PURE__ */t("div",{children:[
27
+ /* @__PURE__ */e("div",{className:"font-semibold fs-lg",children:a.name}),
28
+ /* @__PURE__ */e("div",{children:a.category})]})]},a[u])),l[0]=i,l[1]=o,l[2]=s,l[3]=n,l[4]=u,l[5]=d,l[6]=c,l[7]=m,l[8]=h,l[9]=p,l[10]=f,l[11]=g}else h=l[8],p=l[9],f=l[10],g=l[11];return l[23]!==h||l[24]!==p?(x=/* @__PURE__ */e("div",{className:h,children:p}),l[23]=h,l[24]=p,l[25]=x):x=l[25],l[26]!==f||l[27]!==g||l[28]!==x?(v=/* @__PURE__ */t("div",{children:[f,g,x]}),l[26]=f,l[27]=g,l[28]=x,l[29]=v):v=l[29],v};function X(e){return e.key}function Y(t){const a=r(8),{active:l,children:o,className:s}=t,n=l?"open":"closed";let i,c,d;return a[0]!==s?(i=M("absolute inset-0","transition duration-300 ease-out will-change-transform","data-[state=closed]:pointer-events-none",s),a[0]=s,a[1]=i):i=a[1],a[2]!==o?(c=/* @__PURE__ */e("div",{className:"w-full h-[100%]",children:o}),a[2]=o,a[3]=c):c=a[3],a[4]!==n||a[5]!==i||a[6]!==c?(d=/* @__PURE__ */e("div",{"data-state":n,className:i,children:c}),a[4]=n,a[5]=i,a[6]=c,a[7]=d):d=a[7],d}export{Y as P,O as Q,E as a,H as b,Q as c,V as d,T as u};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@colabcommerce/elements",
3
3
  "license": "UNLICENSED",
4
- "version": "0.9.4",
4
+ "version": "0.9.6",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -22,6 +22,7 @@
22
22
  ],
23
23
  "exports": {
24
24
  "./QuoteForm": "./dist/QuoteForm.js",
25
+ "./QuoteFormButton": "./dist/QuoteFormButton.js",
25
26
  "./StoreLocator": "./dist/StoreLocator.js",
26
27
  "./Store": "./dist/Store.js",
27
28
  "./*.css": "./dist/*.css"