@restaround/react 1.0.40 → 1.0.44
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/components/PublicMenu/Cart/Cart.d.ts +2 -0
- package/dist/components/PublicMenu/Cart/index.d.ts +1 -0
- package/dist/components/PublicMenu/CartDrawer/CartDrawer.d.ts +2 -0
- package/dist/components/PublicMenu/CartDrawer/index.d.ts +1 -0
- package/dist/components/PublicMenu/CartItem/CartItem.d.ts +6 -0
- package/dist/components/PublicMenu/CartItem/index.d.ts +1 -0
- package/dist/components/PublicMenu/CartStepper/CartStepper.d.ts +6 -0
- package/dist/components/PublicMenu/CartStepper/index.d.ts +1 -0
- package/dist/components/PublicMenu/ProductQuantity/ProductQuantity.d.ts +8 -0
- package/dist/components/PublicMenu/ProductQuantity/index.d.ts +1 -0
- package/dist/components/Quantity/Quantity.d.ts +10 -0
- package/dist/components/Quantity/index.d.ts +1 -0
- package/dist/constants/translations.d.ts +74 -0
- package/dist/hooks/cart.d.ts +6 -0
- package/dist/hooks/product.d.ts +3 -0
- package/dist/hooks/translation.d.ts +3 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/order.d.ts +43 -0
- package/dist/store/cart.d.ts +15 -0
- package/dist/styles/ui.css +1 -1
- package/dist/styles/ui.css.map +1 -1
- package/dist/utils/product.d.ts +7 -0
- package/dist/utils/utils/product.d.ts +7 -0
- package/package.json +2 -2
- package/dist/components/PublicMenu/PublicMenu.constants.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Cart";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./CartDrawer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./CartItem";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./CartStepper";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ProductQuantity";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SIZE } from "@sorocraft/ui";
|
|
2
|
+
interface Props {
|
|
3
|
+
isDecreaseDisabled?: boolean;
|
|
4
|
+
quantity?: number;
|
|
5
|
+
size?: SIZE;
|
|
6
|
+
onIncrease: () => void;
|
|
7
|
+
onDecrease: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const Quantity: ({ isDecreaseDisabled, quantity, size, onIncrease, onDecrease, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Quantity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Quantity";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare const translations: {
|
|
2
|
+
en: {
|
|
3
|
+
viewOrder: string;
|
|
4
|
+
removeFromOrder: string;
|
|
5
|
+
updateOrder: string;
|
|
6
|
+
addToOrder: string;
|
|
7
|
+
};
|
|
8
|
+
az: {
|
|
9
|
+
viewOrder: string;
|
|
10
|
+
removeFromOrder: string;
|
|
11
|
+
updateOrder: string;
|
|
12
|
+
addToOrder: string;
|
|
13
|
+
"Your order": string;
|
|
14
|
+
Subtotal: string;
|
|
15
|
+
"Empty order": string;
|
|
16
|
+
"You don't have any items in your order": string;
|
|
17
|
+
"Add items": string;
|
|
18
|
+
};
|
|
19
|
+
tr: {
|
|
20
|
+
viewOrder: string;
|
|
21
|
+
removeFromOrder: string;
|
|
22
|
+
updateOrder: string;
|
|
23
|
+
addToOrder: string;
|
|
24
|
+
"Your order": string;
|
|
25
|
+
"Empty order": string;
|
|
26
|
+
"You don't have any items in your order": string;
|
|
27
|
+
"Add items": string;
|
|
28
|
+
Subtotal: string;
|
|
29
|
+
};
|
|
30
|
+
nl: {
|
|
31
|
+
viewOrder: string;
|
|
32
|
+
removeFromOrder: string;
|
|
33
|
+
updateOrder: string;
|
|
34
|
+
addToOrder: string;
|
|
35
|
+
"Your order": string;
|
|
36
|
+
"Empty order": string;
|
|
37
|
+
"You don't have any items in your order": string;
|
|
38
|
+
"Add items": string;
|
|
39
|
+
Subtotal: string;
|
|
40
|
+
};
|
|
41
|
+
et: {
|
|
42
|
+
viewOrder: string;
|
|
43
|
+
removeFromOrder: string;
|
|
44
|
+
updateOrder: string;
|
|
45
|
+
addToOrder: string;
|
|
46
|
+
"Your order": string;
|
|
47
|
+
"Empty order": string;
|
|
48
|
+
"You don't have any items in your order": string;
|
|
49
|
+
"Add items": string;
|
|
50
|
+
Subtotal: string;
|
|
51
|
+
};
|
|
52
|
+
pl: {
|
|
53
|
+
viewOrder: string;
|
|
54
|
+
removeFromOrder: string;
|
|
55
|
+
updateOrder: string;
|
|
56
|
+
addToOrder: string;
|
|
57
|
+
"Your order": string;
|
|
58
|
+
"Empty order": string;
|
|
59
|
+
"You don't have any items in your order": string;
|
|
60
|
+
"Add items": string;
|
|
61
|
+
Subtotal: string;
|
|
62
|
+
};
|
|
63
|
+
ru: {
|
|
64
|
+
viewOrder: string;
|
|
65
|
+
removeFromOrder: string;
|
|
66
|
+
updateOrder: string;
|
|
67
|
+
addToOrder: string;
|
|
68
|
+
"Your order": string;
|
|
69
|
+
"Empty order": string;
|
|
70
|
+
"You don't have any items in your order": string;
|
|
71
|
+
"Add items": string;
|
|
72
|
+
Subtotal: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{createContext as a,useContext as r,useState as i,useRef as o,useEffect as l,memo as c}from"react";import{isEmpty as s,priceFormatter as d,classNames as u}from"@sorocraft/js-utils";import{Row as m,classNames as h,IconLink as g,Tooltip as _,SVGIcon as p,Flex as v,Column as f,Carousel as b,CarouselItem as y,Chip as N,UIElementType as P,Modal as I,IconButton as A,Container as L,Card as k}from"@sorocraft/ui";import{Phone as w,Whatsapp as C,Instagram as O,Telegram as H,Tiktok as j,Facebook as D,Wifi as M,MarkerPin as B,Close as R}from"@sorocraft/ui/icons";function z(e,t,n,a){return new(n||(n=Promise))((function(r,i){function o(e){try{c(a.next(e))}catch(e){i(e)}}function l(e){try{c(a.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}c((a=a.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var S="PublicMenu-module_container__QLN6U",W="PublicMenu-module_categories__Iy6NC",$="PublicMenu-module_footer__6G3DQ";const x="https://images.restaround.co",E=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${x}/${e}`:"",T=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${x}/${e}`:"https://images.restaround.co/no-photo-128.webp",Q=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${x}/${e}`:"https://images.restaround.co/restaround-doodle.webp",U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",F=(e,t,n)=>U.charAt(e>>2)+U.charAt((3&e)<<4|t>>4)+U.charAt((15&t)<<2|n>>6)+U.charAt(63&n),V="restaround.co",G=[V,"restaround.az","restaround.ee","restaround.nl"],q=a({}),Y=({children:t,value:n})=>e(q.Provider,{value:s(n)?{}:n,children:t}),Z=()=>r(q);var J="Header-module_container__tenlF",K="Header-module_cover__BAWZK",X="Header-module_content__Gx4Al",ee="Header-module_logo__4MTCm",te="Header-module_info__IchYA",ne="Header-module_name__30wyw",ae="Header-module_address__WOxXc",re="Header-module_addressText__lUszI",ie="Header-module_social__AoP0z",oe="Header-module_links__EeQxg",le="Header-module_wifiPassword__VWBTa",ce="Header-module_wifiPasswordIcon__Ukn3D";const se=t=>{const n=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n}(t,["priority","blurDataURL","quality","placeholder"]),{imageTag:a}=Z()||{};if(a){return e(a,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(r=235,i=59,o=90,`data:image/gif;base64,R0lGODlhAQABAPAA${F(0,r,i)+F(o,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var r,i,o;return e("img",Object.assign({},n))};var de={container:"Languages-module_container__nJeK1",currentLanguage:"Languages-module_currentLanguage__EFw6Q",options:"Languages-module_options__6jLRm",option:"Languages-module_option__QkVQd",isOpen:"Languages-module_isOpen__eUGbg",flexWide:"Languages-module_flexWide__zQ9jN",slidein:"Languages-module_slidein__C4UHU",fadeInOut:"Languages-module_fadeInOut__U-vhH",heightAnimation:"Languages-module_heightAnimation__gIQkF",fadein:"Languages-module_fadein__vPmsX",floatAnimation:"Languages-module_floatAnimation__L-kPH",bottomSheet:"Languages-module_bottomSheet__-t-q8"};const ue=()=>{var n;const{language:a,languages:r,onLanguageSelect:o}=Z(),[l,c]=i(!1),s=(null==r?void 0:r.length)>1,d=(null===(n=null==r?void 0:r.filter)||void 0===n?void 0:n.call(r,(({code:e})=>e!==a)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return s?e("div",{className:de.container,onClick:()=>c(!l),children:t(m,{alignItems:"center",gap:0,children:[e(m,{alignItems:"center",className:h(de,{options:!0,isOpen:l}),children:d.map((({code:t})=>e("img",{src:u(t),className:de.option,onClick:()=>(e=>{o&&o(e)})(t),alt:t},t)))}),e("img",{src:u(a),alt:a||"",className:de.currentLanguage})]})}):null},me=({branch:n,coverImage:a,logoImage:r,name:i,instagram:o,facebook:l,whatsapp:c,telegram:d,tiktok:u})=>{const{address:h,latitude:b,longitude:y,phone:N,wifiPassword:P}=n||{},I=s(n),A=`https://www.google.com/maps/place/${b},${y}`;return t("div",{className:J,children:[e(se,{src:a,alt:i,className:K,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:X,children:e(I?()=>t(f,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(se,{src:r,alt:i,className:ee,width:96,height:96}),e("div",{className:te,children:e("h1",{className:ne,children:i})})]}):()=>t(v,{direction:"row",gap:1,alignItems:"center",children:[e(v.Item,{children:e(se,{src:r,alt:i,className:ee,width:96,height:96})}),e(v.Item,{shrink:!0,children:e("div",{className:te,children:t(f,{gap:.25,children:[e("h1",{className:ne,children:i}),e("a",{className:ae,href:A,target:"_blank",rel:"noopener noreferrer",children:t(m,{alignItems:"center",gap:.5,children:[e(p,{icon:B,theme:"dark"}),e("span",{className:re,children:h})]})})]})})})]}),{})}),e(ue,{}),!I&&e("div",{className:ie,children:e("div",{className:oe,children:e(m,{gap:2,alignItems:"center",children:t(m,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!N&&e(g,{icon:w,href:`tel:+${N}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(g,{icon:C,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!o&&e(g,{icon:O,href:o,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(g,{icon:H,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(g,{icon:j,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(g,{icon:D,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!P&&e(_,{hint:P,children:e("div",{className:le,children:e(p,{icon:M,size:"sm",className:ce})})})]})})})})]})},he=({categoryProductMap:t=[],language:n,selectedCategoryId:a,onSelectCategory:r})=>{const i=o({}),c=o(null);return l((()=>{a&&(()=>{var e;const t=null===(e=null==i?void 0:i.current)||void 0===e?void 0:e[a];if(!t||!c.current)return;const n=c.current.clientWidth,r=t.offsetLeft-n/2+t.offsetWidth/2;c.current.scrollTo({left:r,behavior:"smooth"})})()}),[a]),e("div",{className:W,children:e(b,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(c.current=e.current)},children:(t||[]).map((({id:t,translations:o})=>{const{name:l}=o.find((e=>e.language===n))||{};return e(y,{children:e(N,{onClick:()=>(e=>{e!==a&&r(e)})(t),type:P.BORDERED_PRIMARY,active:t===a,children:e("div",{ref:e=>i.current[t]=e,children:l})})},t)}))})})};var ge="Products-module_container__bF2LF",_e="Products-module_products__AoDrY",pe="Products-module_category__Sp7dE",ve="Products-module_list__LH4v5";var fe={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",price:"ProductsListItem-module_price__V1GRM",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV",bottomSheet:"ProductsListItem-module_bottomSheet__-YAdd"};const be=({product:n,currency:a,language:r,onClick:i})=>{const{translations:o,price:l,image160:c}=n||{},{name:s,description:h}=o.find((e=>e.language===r))||{},g=d(l,a||"AZN",r);return e("div",{className:u(fe,{container:!0,isClickable:!!i}),onClick:i,children:t(m,{justifyContent:"space-between",children:[e("div",{className:fe.data,children:t(f,{gap:.25,children:[e("h3",{className:fe.name,children:s}),e("div",{className:fe.description,children:h}),e("div",{className:fe.price,children:g})]})}),c&&e(se,{src:E(c),alt:s||"menu",className:fe.image,loading:"lazy",width:160,height:90})]})})};var ye="ProductDetails-module_container__oa07j",Ne="ProductDetails-module_content__Db3NC",Pe="ProductDetails-module_image__BlMfl",Ie="ProductDetails-module_details__zfnlt",Ae="ProductDetails-module_name__ganLM",Le="ProductDetails-module_price__W34k9",ke="ProductDetails-module_volume__RWG5s",we="ProductDetails-module_description__HBufi",Ce="ProductDetails-module_close__4cHZ3";const Oe=({product:n,onClose:a})=>{const{language:r,currency:i}=Z(),l=o();if(s(n))return null;const{image1024:c,translations:u,price:h,volume:g}=n,{name:_,description:p}=u.find((e=>e.language===r))||{},v=d(h,i||"AZN",r);return e("div",{className:ye,onClick:e=>{var t,n;(null===(n=null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||a&&a()},children:e(I,{onClose:a,ref:l,noBodyPadding:!0,content:t("div",{className:Ne,children:[t(f,{gap:0,children:[c&&e(se,{src:E(c),width:1024,height:400,alt:_||"product",className:Pe}),t(f,{className:Ie,gap:1,children:[e("h2",{className:Ae,children:_}),t(m,{justifyContent:"space-between",children:[e("div",{className:Le,children:v}),e("div",{className:ke,children:g})]}),e("div",{className:we,children:p})]})]}),e("div",{className:Ce,children:e(A,{onClick:a,icon:R})})]}),size:"small"})})},He=c((({categoryProductMap:n=[],currency:a,language:r,productBlocksRef:o,containerRef:c,onCategoryInView:s})=>{const[d,u]=i(null);return l((()=>{const e=new IntersectionObserver((e=>{var t;const n=((null===(t=null==c?void 0:c.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let a=null,r=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,i=t.top+t.height/2,o=Math.abs(i-n);o<r&&(r=o,a=e.target.getAttribute("data-category-id"))}})),a&&s(Number(a))}),{threshold:.5});return Object.entries(o.current||{}).forEach((([t,n])=>{n&&(n.setAttribute("data-category-id",t),e.observe(n))})),()=>{e.disconnect()}}),[o,c]),t("div",{className:ge,children:[e(f,{children:(n||[]).map((n=>{const{name:i}=((e,t)=>{var n,a;return(null===(a=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===a?void 0:a.call(n,(e=>e.language===t)))||{}})(n,r),{id:l,products:c}=n;return t("div",{className:_e,ref:e=>o.current[l]=e,"data-category-id":l,children:[e("h2",{className:pe,children:i}),e("div",{className:ve,children:e(f,{gap:0,children:(c||[]).map((t=>e(be,{product:t,currency:a,language:r,onClick:()=>u(t)},t.id)))})})]},l)}))}),e(Oe,{product:d,onClose:()=>u(null)})]})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));var je="Branches-module_branches__sOuoV",De="Branches-module_list__vYoT2",Me="Branches-module_name__K0Z-4";const Be=({branches:t=[],rootPath:n="",onBranchSelect:a})=>{const r=({children:t,id:r})=>a?e("div",{onClick:()=>a(r),children:t}):e("a",{href:`${n}/${r}`,children:t});return e("div",{className:je,children:e(L,{className:De,children:t.map((({id:t,name:n})=>e(r,{id:t,children:e(k,{noBottomMargin:!0,children:e(v,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:Me,children:n})})})},t)))})})},Re=({data:a})=>{var r;const{name:l,coverImage:c,logoImage:s,branches:d=[],branchId:u,language:m,categories:h,products:g,currency:_,instagram:p,facebook:v,whatsapp:f,telegram:b,tiktok:y,rootPath:N,hostname:P,onBranchSelect:I}=a||{},A=d.length<=1,L=((e,t)=>{const n=t.reduce(((e,t)=>{const n=Number(t.categoryId);return e[n]||(e[n]=[]),e[n].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:n[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(h,g),k=(()=>{var e;return A?(null===(e=null==d?void 0:d[0])||void 0===e?void 0:e.id)?d[0]:{}:d.find((e=>e.id===Number(u)))})(),w=A||!(null==k?void 0:k.name)?l:(null==k?void 0:k.name)||"",[C,O]=i(null===(r=null==h?void 0:h[0])||void 0===r?void 0:r.id),H=o({}),j=o(null),D=o(!0),{url:M,domain:B}=((e,t)=>{const n=G.includes(e)?e:V;return{url:`https://${n}/${t||"en"}`,domain:n}})(P,m);return t("div",{className:S,ref:j,children:[e(me,{branch:k,name:w,coverImage:Q(c),logoImage:T(s),instagram:p,facebook:v,whatsapp:f,telegram:b,tiktok:y}),A||u?t(n,{children:[e(he,{categoryProductMap:L,language:m,selectedCategoryId:C,onSelectCategory:e=>z(void 0,void 0,void 0,(function*(){D.current=!1,O(e),(e=>{var t;const n=null===(t=null==H?void 0:H.current)||void 0===t?void 0:t[e];n&&(setTimeout((()=>{n.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{D.current=!0}),1e3))})(e)}))}),e(He,{currency:_,language:m,productBlocksRef:H,containerRef:j,categoryProductMap:L,onCategoryInView:e=>{(null==D?void 0:D.current)&&O(e)}})]}):e(Be,{branches:d,onBranchSelect:I,rootPath:N}),!!P&&e("a",{rel:"noopener",target:"_blank",href:M,className:$,children:B})]})},ze=({data:t})=>e(Y,{value:t,children:e(Re,{data:t})});export{ze as PublicMenu};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{createContext as a,useContext as i,useState as n,useRef as o,useEffect as l,useMemo as d,memo as c}from"react";import{isEmpty as s,priceFormatter as u,classNames as m}from"@sorocraft/js-utils";import{Row as _,classNames as h,IconLink as g,Tooltip as p,SVGIcon as v,Flex as f,Column as y,Carousel as b,CarouselItem as C,Chip as P,UIElementType as I,IconButton as A,Modal as w,Button as O,Drawer as N,Text as k,Description as L,Container as S,Card as D}from"@sorocraft/ui";import{Phone as T,Whatsapp as z,Instagram as j,Telegram as x,Tiktok as R,Facebook as Q,Wifi as W,MarkerPin as H,Plus as B,Minus as E,Close as q}from"@sorocraft/ui/icons";function Y(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]])}return r}function M(e,t,r,a){return new(r||(r=Promise))((function(i,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function l(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,l)}d((a=a.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var F="PublicMenu-module_container__QLN6U",U="PublicMenu-module_categories__Iy6NC",V="PublicMenu-module_footer__6G3DQ";const $="https://images.restaround.co",G=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${$}/${e}`:"",Z=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${$}/${e}`:"https://images.restaround.co/no-photo-128.webp",K=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${$}/${e}`:"https://images.restaround.co/restaround-doodle.webp",X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",J=(e,t,r)=>X.charAt(e>>2)+X.charAt((3&e)<<4|t>>4)+X.charAt((15&t)<<2|r>>6)+X.charAt(63&r),ee="restaround.co",te=[ee,"restaround.az","restaround.ee","restaround.nl"],re=a({}),ae=({children:t,value:r})=>{const a=s(r)?{}:r;return a.currency||a.currency,a.language||a.language,e(re.Provider,{value:s(r)?{}:r,children:t})},ie=()=>i(re);var ne="Header-module_container__tenlF",oe="Header-module_cover__BAWZK",le="Header-module_content__Gx4Al",de="Header-module_logo__4MTCm",ce="Header-module_info__IchYA",se="Header-module_name__30wyw",ue="Header-module_address__WOxXc",me="Header-module_addressText__lUszI",_e="Header-module_social__AoP0z",he="Header-module_links__EeQxg",ge="Header-module_wifiPassword__VWBTa",pe="Header-module_wifiPasswordIcon__Ukn3D";const ve=t=>{const r=Y(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:a}=ie()||{};if(a){return e(a,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(i=235,n=59,o=90,`data:image/gif;base64,R0lGODlhAQABAPAA${J(0,i,n)+J(o,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var i,n,o;return e("img",Object.assign({},r))};var fe={container:"Languages-module_container__nJeK1",currentLanguage:"Languages-module_currentLanguage__EFw6Q",options:"Languages-module_options__6jLRm",option:"Languages-module_option__QkVQd",isOpen:"Languages-module_isOpen__eUGbg",flexWide:"Languages-module_flexWide__zQ9jN",slidein:"Languages-module_slidein__C4UHU",fadeInOut:"Languages-module_fadeInOut__U-vhH",heightAnimation:"Languages-module_heightAnimation__gIQkF",fadein:"Languages-module_fadein__vPmsX",floatAnimation:"Languages-module_floatAnimation__L-kPH",bottomSheet:"Languages-module_bottomSheet__-t-q8",slideRightToLeft:"Languages-module_slideRightToLeft__y0l-f"};const ye=()=>{var r;const{language:a,languages:i,onLanguageSelect:o}=ie(),[l,d]=n(!1),c=(null==i?void 0:i.length)>1,s=(null===(r=null==i?void 0:i.filter)||void 0===r?void 0:r.call(i,(({code:e})=>e!==a)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return c?e("div",{className:fe.container,onClick:()=>d(!l),children:t(_,{alignItems:"center",gap:0,children:[e(_,{alignItems:"center",className:h(fe,{options:!0,isOpen:l}),children:s.map((({code:t})=>e("img",{src:u(t),className:fe.option,onClick:()=>(e=>{o&&o(e)})(t),alt:t},t)))}),e("img",{src:u(a),alt:a||"",className:fe.currentLanguage})]})}):null},be=({branch:r,coverImage:a,logoImage:i,name:n,instagram:o,facebook:l,whatsapp:d,telegram:c,tiktok:u})=>{const{address:m,latitude:h,longitude:b,phone:C,wifiPassword:P}=r||{},I=s(r),A=`https://www.google.com/maps/place/${h},${b}`;return t("div",{className:ne,children:[e(ve,{src:a,alt:n,className:oe,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:le,children:e(I?()=>t(y,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(ve,{src:i,alt:n,className:de,width:96,height:96}),e("div",{className:ce,children:e("h1",{className:se,children:n})})]}):()=>t(f,{direction:"row",gap:1,alignItems:"center",children:[e(f.Item,{children:e(ve,{src:i,alt:n,className:de,width:96,height:96})}),e(f.Item,{shrink:!0,children:e("div",{className:ce,children:t(y,{gap:.25,children:[e("h1",{className:se,children:n}),e("a",{className:ue,href:A,target:"_blank",rel:"noopener noreferrer",children:t(_,{alignItems:"center",gap:.5,children:[e(v,{icon:H,theme:"dark"}),e("span",{className:me,children:m})]})})]})})})]}),{})}),e(ye,{}),!I&&e("div",{className:_e,children:e("div",{className:he,children:e(_,{gap:2,alignItems:"center",children:t(_,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!C&&e(g,{icon:T,href:`tel:+${C}`,size:"sm",shape:"circle",theme:"light"}),!!d&&e(g,{icon:z,href:`https://wa.me/${d}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!o&&e(g,{icon:j,href:o,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!c&&e(g,{icon:x,href:c,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(g,{icon:R,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(g,{icon:Q,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!P&&e(p,{hint:P,children:e("div",{className:ge,children:e(v,{icon:W,size:"sm",className:pe})})})]})})})})]})},Ce=({categoryProductMap:t=[],language:r,selectedCategoryId:a,onSelectCategory:i})=>{const n=o({}),d=o(null);return l((()=>{a&&(()=>{var e;const t=null===(e=null==n?void 0:n.current)||void 0===e?void 0:e[a];if(!t||!d.current)return;const r=d.current.clientWidth,i=t.offsetLeft-r/2+t.offsetWidth/2;d.current.scrollTo({left:i,behavior:"smooth"})})()}),[a]),e("div",{className:U,children:e(b,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(d.current=e.current)},children:(t||[]).map((({id:t,translations:o})=>{const{name:l}=o.find((e=>e.language===r))||{};return e(C,{children:e(P,{onClick:()=>(e=>{e!==a&&i(e)})(t),type:I.BORDERED_PRIMARY,active:t===a,children:e("div",{ref:e=>n.current[t]=e,children:l})})},t)}))})})};var Pe="Products-module_container__bF2LF",Ie="Products-module_products__AoDrY",Ae="Products-module_category__Sp7dE",we="Products-module_list__LH4v5";const Oe=a({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{}}),Ne=({children:t})=>{const[r,a]=n({}),[i,o]=n(!1),l=(e,t,r)=>{if(s(e)||t<0)return;const{id:i,price:n,vat:o=0}=e;a((e=>{const a=e[i],l=r?((null==a?void 0:a.quantity)||0)+t:t;if(l<=0){const t=e,r=i;t[r];return Y(t,["symbol"==typeof r?r:r+""])}return Object.assign(Object.assign({},e),{[i]:{productId:i,price:n,quantity:l,vat:o}})}))},c=(e,t=1)=>l(e,t,!0),u=(e,t=1)=>l(e,t,!1),m=d((()=>({cart:r,isCartOpen:i,addProduct:c,updateProduct:u,setIsCartOpen:o})),[r,i]);return e(Oe.Provider,{value:m,children:t})},ke=()=>i(Oe);var Le={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",price:"ProductsListItem-module_price__V1GRM",image:"ProductsListItem-module_image__h6Wbi",addToCart:"ProductsListItem-module_addToCart__WXrQZ",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV",bottomSheet:"ProductsListItem-module_bottomSheet__-YAdd",slideRightToLeft:"ProductsListItem-module_slideRightToLeft__oXk26"};const Se=(e,t)=>{var r,a;return(null===(a=null===(r=null==e?void 0:e.translations)||void 0===r?void 0:r.find)||void 0===a?void 0:a.call(r,(e=>e.language===t)))||{}},De=(e,t,r=0)=>e*t*(1+r/100),Te=(e,t,r,a=1)=>{const{price:i,vat:n}=e||{},o=De(i,a,n);return{totalPrice:o,formattedTotalPrice:u(o,t,r)}},ze=({product:r,currency:a,language:i,onClick:n})=>{const{addProduct:o}=ke(),{image160:l}=r||{},{name:c,description:s}=d((()=>Se(r,i)),[r,i]),{formattedTotalPrice:u}=d((()=>Te(r,a,i)),[r,a,i]);return t("div",{className:m(Le,{container:!0,isClickable:!!n}),onClick:n,children:[t(_,{justifyContent:"space-between",gap:0,children:[e("div",{className:Le.data,children:t(y,{gap:.25,children:[e("h3",{className:Le.name,children:c}),e("div",{className:Le.description,children:s}),e("div",{className:Le.price,children:u})]})}),l&&e(ve,{src:G(l),alt:c||"menu",className:Le.image,loading:"lazy",width:160,height:90})]}),e("div",{className:Le.addToCart,children:e(A,{onClick:e=>{e.preventDefault(),e.stopPropagation(),o(r)},icon:B,type:I.DEFAULT})})]})};var je={container:"ProductDetails-module_container__oa07j",content:"ProductDetails-module_content__Db3NC",image:"ProductDetails-module_image__BlMfl",details:"ProductDetails-module_details__zfnlt",name:"ProductDetails-module_name__ganLM",price:"ProductDetails-module_price__W34k9",volume:"ProductDetails-module_volume__RWG5s",description:"ProductDetails-module_description__HBufi",close:"ProductDetails-module_close__4cHZ3",flexWide:"ProductDetails-module_flexWide__w06FX",slidein:"ProductDetails-module_slidein__N8f4g",fadeInOut:"ProductDetails-module_fadeInOut__hYRtK",heightAnimation:"ProductDetails-module_heightAnimation__hLQyz",fadein:"ProductDetails-module_fadein__QN4mI",floatAnimation:"ProductDetails-module_floatAnimation__dTQbc",bottomSheet:"ProductDetails-module_bottomSheet__HO2S-",slideRightToLeft:"ProductDetails-module_slideRightToLeft__hbtJg"};const xe={en:{viewOrder:"View order",removeFromOrder:"Remove from order",updateOrder:"Update order",addToOrder:"Add to order"},az:{viewOrder:"Şifarişi göstər",removeFromOrder:"Sifarişdən sil",updateOrder:"Sifarişi yenilə",addToOrder:"Sifarişə əlavə et","Your order":"Sifarişiniz",Subtotal:"Ümumi","Empty order":"Boş sifariş","You don't have any items in your order":"Sifarişinizdə heç bir məhsul yoxdur","Add items":"Məhsul əlavə et"},tr:{viewOrder:"Siparişi Görüntüle",removeFromOrder:"Siparişten Kaldır",updateOrder:"Siparişi Güncelle",addToOrder:"Siparişe Ekle","Your order":"Siparişiniz","Empty order":"Boş sipariş","You don't have any items in your order":"Siparişinizde hiç bir ürün yok","Add items":"Ürün ekle",Subtotal:"Toplam"},nl:{viewOrder:"Bestelling bekijken",removeFromOrder:"Uit bestelling verwijderen",updateOrder:"Bestelling bijwerken",addToOrder:"Aan bestelling toevoegen","Your order":"Uw bestelling","Empty order":"Lege bestelling","You don't have any items in your order":"U heeft geen items in uw bestelling","Add items":"Items toevoegen",Subtotal:"Totaal"},et:{viewOrder:"Vaata tellimust",removeFromOrder:"Eemalda tellimusest",updateOrder:"Uuenda tellimust",addToOrder:"Lisa tellimusele","Your order":"Teie tellimus","Empty order":"Tühi tellimus","You don't have any items in your order":"Teie tellimuses pole ühtegi eset","Add items":"Lisa esemeid",Subtotal:"Kokku"},pl:{viewOrder:"Zobacz zamówienie",removeFromOrder:"Usuń z zamówienia",updateOrder:"Zaktualizuj zamówienie",addToOrder:"Dodaj do zamówienia","Your order":"Twoje zamówienie","Empty order":"Puste zamówienie","You don't have any items in your order":"Nie masz żadnych pozycji w zamówieniu","Add items":"Dodaj przedmioty",Subtotal:"Suma"},ru:{viewOrder:"Посмотреть заказ",removeFromOrder:"Удалить из заказа",updateOrder:"Обновить заказ",addToOrder:"Добавить в заказ","Your order":"Ваш заказ","Empty order":"Пустой заказ","You don't have any items in your order":"В вашем заказе нет товаров","Add items":"Добавить товары",Subtotal:"Итого"}},Re=()=>{const{language:e}=ie();return{t:t=>{var r;return(null===(r=xe[e])||void 0===r?void 0:r[t])||t}}},Qe=()=>{const{cart:e}=ke();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var We={container:"Quantity-module_container__01ySb",quantityAction:"Quantity-module_quantityAction__wRV2F",quantityValue:"Quantity-module_quantityValue__BBpyw",isDisabled:"Quantity-module_isDisabled__crQCf",sm:"Quantity-module_sm__0Hgp2",md:"Quantity-module_md__hu7a8",lg:"Quantity-module_lg__GA4jn",flexWide:"Quantity-module_flexWide__R95Jw",slidein:"Quantity-module_slidein__5yeWf",fadeInOut:"Quantity-module_fadeInOut__cllco",heightAnimation:"Quantity-module_heightAnimation__dhOgA",fadein:"Quantity-module_fadein__Cof2o",floatAnimation:"Quantity-module_floatAnimation__DSqQr",bottomSheet:"Quantity-module_bottomSheet__5-5iY",slideRightToLeft:"Quantity-module_slideRightToLeft__cjDHk"};const He=({isDecreaseDisabled:r=!1,quantity:a=1,size:i="md",onIncrease:n,onDecrease:o})=>t(_,{className:m(We,{container:!0},[We[i]]),justifyContent:"space-between",gap:0,children:[e("div",{className:m(We,{quantityAction:!0,isDisabled:r}),onClick:o,children:e(v,{icon:E})}),e("div",{className:We.quantityValue,children:a}),e("div",{className:We.quantityAction,onClick:n,children:e(v,{icon:B})})]}),Be=({product:r,onClose:a})=>{const{language:i,currency:c}=ie(),{addProduct:m,updateProduct:h}=ke(),[g,p]=n(1),[v,f]=n(!1),b=o(),{t:C}=Re(),P=(e=>{var t;const{cart:r}=ke();return s(r)||!e?0:(null===(t=r[e])||void 0===t?void 0:t.quantity)||0})(null==r?void 0:r.id),{name:I,description:N}=d((()=>Se(r,i)),[r,i]),{totalPrice:k,formattedTotalPrice:L}=d((()=>Te(r,c,i)),[r,c,i]),S=d((()=>g*k),[g,k]),D=d((()=>u(S,c,i)),[S,c,i]),T=v?0===g:1===g,z=d((()=>C(v?0===g?"removeFromOrder":"updateOrder":"addToOrder")),[v,g]);l((()=>{p(P>0?P:1),f(P>0)}),[P]);const j=e=>{-1===e&&T||p((t=>Math.max(0,t+e)))};if(s(r))return null;const{image1024:x,volume:R}=r;return e("div",{className:je.container,onClick:e=>{var t,r;(null===(r=null===(t=null==b?void 0:b.current)||void 0===t?void 0:t.contains)||void 0===r?void 0:r.call(t,null==e?void 0:e.target))||a&&a()},children:e(w,{onClose:a,ref:b,noBodyPadding:!0,size:"small",content:t("div",{className:je.content,children:[t(y,{gap:0,children:[x&&e(ve,{src:G(x),width:1024,height:400,alt:I||"product",className:je.image}),t(y,{className:je.details,gap:1,children:[e("h2",{className:je.name,children:I}),t(_,{justifyContent:"space-between",children:[e("div",{className:je.price,children:L}),e("div",{className:je.volume,children:R})]}),e("div",{className:je.description,children:N})]})]}),e("div",{className:je.close,children:e(A,{onClick:a,icon:q})})]}),footer:t(_,{className:je.addToCart,gap:.5,children:[e(He,{isDecreaseDisabled:T,onDecrease:()=>j(-1),onIncrease:()=>j(1),quantity:g}),e(O,{className:je.addAction,label:t(_,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:z}),e("span",{children:D})]}),onClick:()=>{v?h(r,g):m(r,g),a&&a()},size:"xl",fullWidth:!0})]})})})};var Ee="Cart-module_container__3KQtx",qe="Cart-module_content__rkiZa",Ye={container:"CartStepper-module_container__4CF1L",count:"CartStepper-module_count__E-RBg",actionText:"CartStepper-module_actionText__-rVKA",totalPrice:"CartStepper-module_totalPrice__QboRN",isClickable:"CartStepper-module_isClickable__mDptU",flexWide:"CartStepper-module_flexWide__eXxCr",slidein:"CartStepper-module_slidein__d5JQ-",fadeInOut:"CartStepper-module_fadeInOut__pS8nn",heightAnimation:"CartStepper-module_heightAnimation__7-e5Z",fadein:"CartStepper-module_fadein__-Ba0-",floatAnimation:"CartStepper-module_floatAnimation__rq6zX",bottomSheet:"CartStepper-module_bottomSheet__1wHHD",slideRightToLeft:"CartStepper-module_slideRightToLeft__0KLAo"};const Me=({actionText:r,onClick:a})=>{const i=Qe(),{formattedTotalPrice:n}=(()=>{const{cart:e}=ke(),{currency:t,language:r}=ie(),a=Object.values(e||{}).reduce(((e,{price:t,quantity:r,vat:a})=>e+De(t,r,a)),0);return{totalPrice:a,formattedTotalPrice:u(a,t,r)}})();return t(f,{className:m(Ye,{container:!0,isClickable:!!a}),justifyContent:"space-between",alignItems:"center",onClick:a,children:[e(f.Item,{flex:1,children:t(_,{alignItems:"center",children:[e("div",{className:Ye.count,children:i}),e("div",{className:Ye.actionText,children:r})]})}),e(f.Item,{className:Ye.totalPrice,flex:1,children:n})]})},Fe=()=>{const{setIsCartOpen:t}=ke(),{t:r}=Re();return Qe()<=0?null:e("div",{className:Ee,children:e("div",{className:qe,children:e(Me,{onClick:()=>t(!0),actionText:r("viewOrder")})})})};var Ue={container:"CartDrawer-module_container__zvapw",content:"CartDrawer-module_content__ELSiG",flexWide:"CartDrawer-module_flexWide__ySgY-",slidein:"CartDrawer-module_slidein__XC9AW",fadeInOut:"CartDrawer-module_fadeInOut__w9h6X",heightAnimation:"CartDrawer-module_heightAnimation__tBgkj",fadein:"CartDrawer-module_fadein__QNPoQ",floatAnimation:"CartDrawer-module_floatAnimation__nZWoY",bottomSheet:"CartDrawer-module_bottomSheet__m0wy7",slideRightToLeft:"CartDrawer-module_slideRightToLeft__gpixh"},Ve="CartItem-module_container__At7lj",$e="CartItem-module_image__D-zzG",Ge="CartItem-module_data__Lo3Fb",Ze="CartItem-module_name__EksZu",Ke="CartItem-module_price__yJxl6";const Xe=e=>{var t;const{products:r}=ie();return(null===(t=null==r?void 0:r.find)||void 0===t?void 0:t.call(r,(({id:t})=>t===e)))||{}},Je=({productId:t,min:r=1,size:a="md"})=>{const i=(e=>{const{cart:t}=ke(),r=t[e];return(null==r?void 0:r.quantity)||1})(t),n=Xe(t),{updateProduct:o}=ke();return e(He,{isDecreaseDisabled:i===r,onDecrease:()=>o(n,i-1),onIncrease:()=>o(n,i+1),quantity:i,size:a})},et=({item:r})=>{const{productId:a,quantity:i}=r||{},n=Xe(a),{language:o,currency:l}=ie(),{image160:c}=n,{name:s}=d((()=>Se(n,o)),[n,o]),{formattedTotalPrice:u}=d((()=>Te(n,l,o,i)),[n,l,o,i]);return t(_,{className:Ve,gap:1,alignItems:"center",children:[c&&e(ve,{src:G(c),alt:s||"menu",className:$e,loading:"lazy",width:80,height:45}),t("div",{className:Ge,children:[e("div",{className:Ze,children:s}),e("div",{className:Ke,children:u})]}),e(Je,{productId:a,size:"sm",min:0})]})},tt=()=>{const{isCartOpen:r,cart:a,setIsCartOpen:i}=ke(),n=o(),{t:l}=Re(),d=s(a),c=()=>i(!1);return r?e("div",{className:Ue.container,onClick:e=>{var t,r;(null===(r=null===(t=null==n?void 0:n.current)||void 0===t?void 0:t.contains)||void 0===r?void 0:r.call(t,null==e?void 0:e.target))||c()},children:e(N,{ref:n,onClose:c,isOpen:r,title:l("Your order"),content:e("div",{className:Ue.content,children:d?e((()=>t(y,{className:Ue.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(k,{variant:"h2",children:l("Empty order")}),e(L,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:Ue.items,children:Object.keys(a||{}).map((t=>e(et,{item:a[t]},t)))})}),footer:d?e(O,{label:l("Add items"),onClick:c,type:I.PRIMARY,size:"xl",fullWidth:!0}):e(Me,{actionText:l("Subtotal")})})}):null},rt=c((({categoryProductMap:r=[],currency:a,language:i,productBlocksRef:o,containerRef:d,onCategoryInView:c})=>{const[s,u]=n(null);return l((()=>{const e=new IntersectionObserver((e=>{var t;const r=((null===(t=null==d?void 0:d.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let a=null,i=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,n=t.top+t.height/2,o=Math.abs(n-r);o<i&&(i=o,a=e.target.getAttribute("data-category-id"))}})),a&&c(Number(a))}),{threshold:.5});return Object.entries(o.current||{}).forEach((([t,r])=>{r&&(r.setAttribute("data-category-id",t),e.observe(r))})),()=>{e.disconnect()}}),[o,d]),e(Ne,{children:t("div",{className:Pe,children:[e(y,{children:(r||[]).map((r=>{const{name:n}=((e,t)=>{var r,a;return(null===(a=null===(r=null==e?void 0:e.translations)||void 0===r?void 0:r.find)||void 0===a?void 0:a.call(r,(e=>e.language===t)))||{}})(r,i),{id:l,products:d}=r;return t("div",{className:Ie,ref:e=>o.current[l]=e,"data-category-id":l,children:[e("h2",{className:Ae,children:n}),e("div",{className:we,children:e(y,{gap:0,children:(d||[]).map((t=>e(ze,{product:t,currency:a,language:i,onClick:()=>u(t)},t.id)))})})]},l)}))}),e(Be,{product:s,onClose:()=>u(null)}),e(Fe,{}),e(tt,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));var at="Branches-module_branches__sOuoV",it="Branches-module_list__vYoT2",nt="Branches-module_name__K0Z-4";const ot=({branches:t=[],rootPath:r="",onBranchSelect:a})=>{const i=({children:t,id:i})=>a?e("div",{onClick:()=>a(i),children:t}):e("a",{href:`${r}/${i}`,children:t});return e("div",{className:at,children:e(S,{className:it,children:t.map((({id:t,name:r})=>e(i,{id:t,children:e(D,{noBottomMargin:!0,children:e(f,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:nt,children:r})})})},t)))})})},lt=({data:a})=>{var i;const{name:l,coverImage:d,logoImage:c,branches:s=[],branchId:u,language:m,categories:_,products:h,currency:g,instagram:p,facebook:v,whatsapp:f,telegram:y,tiktok:b,rootPath:C,hostname:P,onBranchSelect:I}=a||{},A=s.length<=1,w=((e,t)=>{const r=t.reduce(((e,t)=>{const r=Number(t.categoryId);return e[r]||(e[r]=[]),e[r].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:r[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(_,h),O=(()=>{var e;return A?(null===(e=null==s?void 0:s[0])||void 0===e?void 0:e.id)?s[0]:{}:s.find((e=>e.id===Number(u)))})(),N=A||!(null==O?void 0:O.name)?l:(null==O?void 0:O.name)||"",[k,L]=n(null===(i=null==_?void 0:_[0])||void 0===i?void 0:i.id),S=o({}),D=o(null),T=o(!0),{url:z,domain:j}=((e,t)=>{const r=te.includes(e)?e:ee;return{url:`https://${r}/${t||"en"}`,domain:r}})(P,m);return t("div",{className:F,ref:D,children:[e(be,{branch:O,name:N,coverImage:K(d),logoImage:Z(c),instagram:p,facebook:v,whatsapp:f,telegram:y,tiktok:b}),A||u?t(r,{children:[e(Ce,{categoryProductMap:w,language:m,selectedCategoryId:k,onSelectCategory:e=>M(void 0,void 0,void 0,(function*(){T.current=!1,L(e),(e=>{var t;const r=null===(t=null==S?void 0:S.current)||void 0===t?void 0:t[e];r&&(setTimeout((()=>{r.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{T.current=!0}),1e3))})(e)}))}),e(rt,{currency:g,language:m,productBlocksRef:S,containerRef:D,categoryProductMap:w,onCategoryInView:e=>{(null==T?void 0:T.current)&&L(e)}})]}):e(ot,{branches:s,onBranchSelect:I,rootPath:C}),!!P&&e("a",{rel:"noopener",target:"_blank",href:z,className:V,children:j})]})},dt=({data:t})=>e(ae,{value:t,children:e(lt,{data:t})});export{dt as PublicMenu};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|