@colabcommerce/elements 0.9.4 → 0.9.5
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
|
|
2
|
-
/* @__PURE__ */e(
|
|
3
|
-
/* @__PURE__ */e(
|
|
4
|
-
/* @__PURE__ */e("
|
|
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/StoreLocator.js
CHANGED
|
@@ -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{
|
|
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{
|
|
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
|
+
"version": "0.9.5",
|
|
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"
|