@restaround/react 1.0.51 → 1.0.54

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.
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ productId: number;
3
+ onModalClose: () => void;
4
+ }
5
+ declare const ProductInCart: ({ productId, onModalClose }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default ProductInCart;
@@ -0,0 +1 @@
1
+ export { default } from "./ProductInCart";
@@ -1,8 +1,9 @@
1
1
  import { SIZE } from "@sorocraft/ui";
2
2
  interface Props {
3
3
  productId: number;
4
+ variantId?: number;
4
5
  min?: number;
5
6
  size?: SIZE;
6
7
  }
7
- declare const ProductQuantity: ({ productId, min, size }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ declare const ProductQuantity: ({ productId, variantId, min, size }: Props) => import("react/jsx-runtime").JSX.Element;
8
9
  export default ProductQuantity;
@@ -1,15 +1,10 @@
1
1
  export declare const translations: {
2
- en: {
3
- viewOrder: string;
4
- removeFromOrder: string;
5
- updateOrder: string;
6
- addToOrder: string;
7
- };
2
+ en: {};
8
3
  az: {
9
- viewOrder: string;
10
- removeFromOrder: string;
11
- updateOrder: string;
12
- addToOrder: string;
4
+ "View order": string;
5
+ "Remove from order": string;
6
+ "Update order": string;
7
+ "Add to order": string;
13
8
  "Your order": string;
14
9
  Subtotal: string;
15
10
  "Empty order": string;
@@ -20,65 +15,63 @@ export declare const translations: {
20
15
  "Category Selected": string;
21
16
  "Product Details": string;
22
17
  "Product Added to Cart": string;
18
+ "Product choices": string;
19
+ "In order": string;
23
20
  };
24
21
  tr: {
25
- viewOrder: string;
26
- removeFromOrder: string;
27
- updateOrder: string;
28
- addToOrder: string;
22
+ "View order": string;
23
+ "Remove from order": string;
24
+ "Update order": string;
25
+ "Add to order": string;
29
26
  "Your order": string;
30
27
  "Empty order": string;
31
28
  "You don't have any items in your order": string;
32
29
  "Add items": string;
33
30
  Subtotal: string;
34
31
  Events: string;
32
+ "Product choices": string;
33
+ "In order": string;
35
34
  };
36
35
  nl: {
37
- viewOrder: string;
38
- removeFromOrder: string;
39
- updateOrder: string;
40
- addToOrder: string;
36
+ "View order": string;
37
+ "Remove from order": string;
38
+ "Update order": string;
39
+ "Add to order": string;
41
40
  "Your order": string;
42
41
  "Empty order": string;
43
42
  "You don't have any items in your order": string;
44
43
  "Add items": string;
45
44
  Subtotal: string;
46
45
  Events: string;
46
+ "Product choices": string;
47
+ "In order": string;
47
48
  };
48
49
  et: {
49
- viewOrder: string;
50
- removeFromOrder: string;
51
- updateOrder: string;
52
- addToOrder: string;
53
- "Your order": string;
54
- "Empty order": string;
55
- "You don't have any items in your order": string;
56
- "Add items": string;
57
- Subtotal: string;
58
- Events: string;
59
- };
60
- pl: {
61
- viewOrder: string;
62
- removeFromOrder: string;
63
- updateOrder: string;
64
- addToOrder: string;
50
+ "View order": string;
51
+ "Remove from order": string;
52
+ "Update order": string;
53
+ "Add to order": string;
65
54
  "Your order": string;
66
55
  "Empty order": string;
67
56
  "You don't have any items in your order": string;
68
57
  "Add items": string;
69
58
  Subtotal: string;
70
59
  Events: string;
60
+ "Product choices": string;
61
+ "In order": string;
71
62
  };
72
63
  ru: {
73
- viewOrder: string;
74
- removeFromOrder: string;
75
- updateOrder: string;
76
- addToOrder: string;
64
+ "View order": string;
65
+ "Remove from order": string;
66
+ "Update order": string;
67
+ "Add to order": string;
77
68
  "Your order": string;
78
69
  "Empty order": string;
79
70
  "You don't have any items in your order": string;
80
71
  "Add items": string;
81
72
  Subtotal: string;
82
73
  Events: string;
74
+ "Product choices": string;
75
+ "In order": string;
83
76
  };
84
77
  };
@@ -1,6 +1,7 @@
1
- export declare const useTotalCartItemsCount: () => any;
1
+ export declare const useTotalCartItemsCount: () => number;
2
2
  export declare const useCartTotalPrice: () => {
3
3
  totalPrice: number;
4
4
  formattedTotalPrice: string;
5
5
  };
6
- export declare const useProductQuantityInCart: (productId: number) => number;
6
+ export declare const useProductQuantityInCart: (productId: number, variantId?: number | null) => number;
7
+ export declare const useProductQuantityInCartWithAllVariants: (productId: number) => number;
@@ -1,3 +1,3 @@
1
1
  import { Product } from "src/models";
2
2
  export declare const useProductById: (productId: number) => Product;
3
- export declare const useProductQuantity: (productId: number) => number;
3
+ export declare const useProductQuantity: (productId: number, variantId?: number) => number;
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{isEmpty as r,trackEvent as i,priceFormatter as n,classNames as o}from"@sorocraft/js-utils";import{createContext as l,useContext as d,useState as c,useRef as s,useEffect as u,useMemo as m,memo as _,useCallback as h}from"react";import{Row as g,classNames as p,IconLink as v,Tooltip as f,SVGIcon as y,Flex as b,Column as I,Carousel as P,CarouselItem as C,Chip as A,UIElementType as N,Text as w,IconButton as O,Modal as k,Button as L,Drawer as S,Description as D,Container as T,Card as z,DropDown as R,DropDownMenuItem as G,Loading as x,BarChart as j}from"@sorocraft/ui";import{Phone as W,Whatsapp as E,Instagram as H,Telegram as Q,Tiktok as B,Facebook as q,Wifi as Y,MarkerPin as F,Plus as M,Minus as U,Close as $,List as V,Grid as Z}from"@sorocraft/ui/icons";function K(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(a[r[i]]=e[r[i]])}return a}function X(e,t,a,r){return new(a||(a=Promise))((function(i,n){function o(e){try{d(r.next(e))}catch(e){n(e)}}function l(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,l)}d((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var J="PublicMenu-module_container__QLN6U",ee="PublicMenu-module_categories__Iy6NC",te="PublicMenu-module_footer__6G3DQ";const ae="https://images.restaround.co",re=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"",ie=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"https://images.restaround.co/no-photo-128.webp",ne=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ae}/${e}`:"https://images.restaround.co/restaround-doodle.webp",oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",le=(e,t,a)=>oe.charAt(e>>2)+oe.charAt((3&e)<<4|t>>4)+oe.charAt((15&t)<<2|a>>6)+oe.charAt(63&a),de="restaround.co",ce=[de,"restaround.az","restaround.ee","restaround.nl"],se=l({}),ue=({children:t,value:a})=>{const i=r(a)?{}:a;return i.currency||i.currency,i.language||i.language,e(se.Provider,{value:r(a)?{}:a,children:t})},me=()=>d(se),_e="digital_menu",he=`${_e}_category_select`,ge=`${_e}_category_scroll`,pe=`${_e}_product_details`,ve=`${_e}_product_add_cart`,fe=`${_e}_product_view_changed`,ye=[he,ge,pe,ve],be=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}};var Ie="Header-module_container__tenlF",Pe="Header-module_cover__BAWZK",Ce="Header-module_content__Gx4Al",Ae="Header-module_logo__4MTCm",Ne="Header-module_info__IchYA",we="Header-module_name__30wyw",Oe="Header-module_address__WOxXc",ke="Header-module_addressText__lUszI",Le="Header-module_social__AoP0z",Se="Header-module_links__EeQxg",De="Header-module_wifiPassword__VWBTa",Te="Header-module_wifiPasswordIcon__Ukn3D";const ze=t=>{const a=K(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:r}=me()||{};if(r){return e(r,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(i=235,n=59,o=90,`data:image/gif;base64,R0lGODlhAQABAPAA${le(0,i,n)+le(o,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var i,n,o;return e("img",Object.assign({},a))};var Re={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 Ge=()=>{var a;const{language:r,languages:i,onLanguageSelect:n}=me(),[o,l]=c(!1),d=(null==i?void 0:i.length)>1,s=(null===(a=null==i?void 0:i.filter)||void 0===a?void 0:a.call(i,(({code:e})=>e!==r)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return d?e("div",{className:Re.container,onClick:()=>l(!o),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:p(Re,{options:!0,isOpen:o}),children:s.map((({code:t})=>e("img",{src:u(t),className:Re.option,onClick:()=>(e=>{n&&n(e)})(t),alt:t},t)))}),e("img",{src:u(r),alt:r||"",className:Re.currentLanguage})]})}):null},xe=({branch:a,coverImage:i,logoImage:n,name:o,instagram:l,facebook:d,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:p,wifiPassword:P}=a||{},C=r(a),A=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:Ie,children:[e(ze,{src:i,alt:o,className:Pe,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:Ce,children:e(C?()=>t(I,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(ze,{src:n,alt:o,className:Ae,width:96,height:96}),e("div",{className:Ne,children:e("h1",{className:we,children:o})})]}):()=>t(b,{direction:"row",gap:1,alignItems:"center",children:[e(b.Item,{children:e(ze,{src:n,alt:o,className:Ae,width:96,height:96})}),e(b.Item,{shrink:!0,children:e("div",{className:Ne,children:t(I,{gap:.25,children:[e("h1",{className:we,children:o}),e("a",{className:Oe,href:A,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:F,theme:"dark"}),e("span",{className:ke,children:m})]})})]})})})]}),{})}),e(Ge,{}),!C&&e("div",{className:Le,children:e("div",{className:Se,children:e(g,{gap:2,alignItems:"center",children:t(g,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!p&&e(v,{icon:W,href:`tel:+${p}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(v,{icon:E,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(v,{icon:H,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!s&&e(v,{icon:Q,href:s,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(v,{icon:B,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(v,{icon:q,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!P&&e(f,{hint:P,children:e("div",{className:De,children:e(y,{icon:Y,size:"sm",className:Te})})})]})})})})]})},je=({categoryProductMap:t=[],language:a,selectedCategoryId:r,onSelectCategory:n})=>{const o=s({}),l=s(null);return u((()=>{r&&(()=>{var e;const t=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e[r];if(!t||!l.current)return;const a=l.current.clientWidth,i=t.offsetLeft-a/2+t.offsetWidth/2;l.current.scrollTo({left:i,behavior:"smooth"})})()}),[r]),e("div",{className:ee,children:e(P,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(l.current=e.current)},children:(t||[]).map((({id:t,translations:l})=>{const{name:d}=l.find((e=>e.language===a))||{};return e(C,{children:e(A,{onClick:()=>((e,t)=>{e!==r&&(i(he,{name:t}),n(e))})(t,d),type:N.BORDERED_PRIMARY,active:t===r,children:e("div",{ref:e=>o.current[t]=e,children:d})})},t)}))})})};var We="Products-module_container__bF2LF",Ee="Products-module_view__l857X",He="Products-module_products__AoDrY",Qe="Products-module_category__Sp7dE",Be="Products-module_list__LH4v5";const qe=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}},Ye=(e,t,a=0)=>e*t*(1+a/100),Fe=(e,t,a,r=1)=>{const{price:i,vat:o}=e||{},l=Ye(i,r,o);return{totalPrice:l,formattedTotalPrice:n(l,t,a)}};var Me;!function(e){e.LIST="list",e.GRID="grid"}(Me||(Me={}));const Ue=l({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{}}),$e=({children:t})=>{const[a,i]=c({}),[n,o]=c(!1),l=(e,t,a)=>{if(r(e)||t<0)return;const{id:n,price:o,vat:l=0}=e;i((e=>{const r=e[n],i=a?((null==r?void 0:r.quantity)||0)+t:t;if(i<=0){const t=e,a=n;t[a];return K(t,["symbol"==typeof a?a:a+""])}return Object.assign(Object.assign({},e),{[n]:{productId:n,price:o,quantity:i,vat:l}})}))},d=(e,t=1)=>l(e,t,!0),s=(e,t=1)=>l(e,t,!1),u=m((()=>({cart:a,isCartOpen:n,addProduct:d,updateProduct:s,setIsCartOpen:o})),[a,n]);return e(Ue.Provider,{value:u,children:t})},Ve=()=>d(Ue);var Ze={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 Ke=({product:a,currency:r,language:n,onClick:l})=>{const{addProduct:d}=Ve(),{image160:c,volume:s}=a||{},{name:u,description:_}=m((()=>qe(a,n)),[a,n]),{formattedTotalPrice:h}=m((()=>Fe(a,r,n)),[a,r,n]);return t("div",{className:o(Ze,{container:!0,isClickable:!!l}),onClick:l,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:Ze.data,children:t(I,{gap:.25,children:[e("h3",{className:Ze.name,children:u}),e("p",{className:Ze.description,children:_}),t(g,{className:Ze.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:h}),!!s&&e(w,{color:"muted",children:s})]})]})}),c&&e(ze,{src:re(c),alt:u||"menu",className:Ze.image,loading:"lazy",width:160,height:90})]}),e("div",{className:Ze.addToCart,children:e(O,{onClick:e=>{e.preventDefault(),e.stopPropagation(),d(a),i(ve,{name:u,quantity:1})},icon:M,type:N.DEFAULT})})]})};var Xe={container:"ProductsGridItem-module_container__DU5KG",content:"ProductsGridItem-module_content__FXs0Y",isClickable:"ProductsGridItem-module_isClickable__8zhwt",info:"ProductsGridItem-module_info__HkBG-",data:"ProductsGridItem-module_data__Z-N1X",name:"ProductsGridItem-module_name__ZrIx3",description:"ProductsGridItem-module_description__-FQPA",price:"ProductsGridItem-module_price__BFu2H",imageContainer:"ProductsGridItem-module_imageContainer__eHS4Z",image:"ProductsGridItem-module_image__alZWL",addToCart:"ProductsGridItem-module_addToCart__gYVrI",noImage:"ProductsGridItem-module_noImage__78UHW",volume:"ProductsGridItem-module_volume__oxEAr",flexWide:"ProductsGridItem-module_flexWide__qcB5X",slidein:"ProductsGridItem-module_slidein__oKaVb",fadeInOut:"ProductsGridItem-module_fadeInOut__d2zot",heightAnimation:"ProductsGridItem-module_heightAnimation__zgbh9",fadein:"ProductsGridItem-module_fadein__Z067K",floatAnimation:"ProductsGridItem-module_floatAnimation__GXjP-",bottomSheet:"ProductsGridItem-module_bottomSheet__-zrFD",slideRightToLeft:"ProductsGridItem-module_slideRightToLeft__R7hv5"};const Je=({product:a,currency:r,language:n,onClick:l})=>{const{addProduct:d}=Ve(),{volume:c,image580:s,image160:u,image1024:_}=a||{},h=s||_||u,{name:p,description:v}=m((()=>qe(a,n)),[a,n]),{formattedTotalPrice:f}=m((()=>Fe(a,r,n)),[a,r,n]);return e("div",{className:Xe.container,children:t("div",{className:o(Xe,{content:!0,isClickable:!!l,noImage:!h}),onClick:l,children:[h&&e("div",{className:Xe.imageContainer,children:e(ze,{src:re(h),alt:p||"menu",className:Xe.image,loading:"lazy",width:580,height:326})}),e("div",{className:Xe.info,children:e("div",{className:Xe.data,children:t(I,{gap:.25,children:[e("h3",{className:Xe.name,children:p}),e("p",{className:Xe.description,children:v}),t(g,{className:Xe.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:f}),!!c&&e(w,{color:"white",className:Xe.volume,children:c})]})]})})}),e("div",{className:Xe.addToCart,children:e(O,{onClick:e=>{e.preventDefault(),e.stopPropagation(),d(a),i(ve,{name:p,quantity:1})},icon:M,type:N.DEFAULT})})]})})};var et={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",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW",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 tt={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",Events:"Hərəkətlər","Scrolled to Category":"Kateqoriyaya sürüşdürdü","Category Selected":"Kateqoriya seçildi","Product Details":"Məhsul detalına baxıldı","Product Added to Cart":"Səbətə əlavə edildi"},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",Events:"Olaylar"},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",Events:"Gebeurtenissen"},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",Events:"Sündmused"},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",Events:"Wydarzenia"},ru:{viewOrder:"Посмотреть заказ",removeFromOrder:"Удалить из заказа",updateOrder:"Обновить заказ",addToOrder:"Добавить в заказ","Your order":"Ваш заказ","Empty order":"Пустой заказ","You don't have any items in your order":"В вашем заказе нет товаров","Add items":"Добавить товары",Subtotal:"Итого",Events:"События"}},at=e=>{const{language:t}=me(),a=e||t;return{t:e=>{var t;return(null===(t=tt[a])||void 0===t?void 0:t[e])||e}}},rt=()=>{const{cart:e}=Ve();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var it={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 nt=({isDecreaseDisabled:a=!1,quantity:r=1,size:i="md",onIncrease:n,onDecrease:l})=>t(g,{className:o(it,{container:!0},[it[i]]),justifyContent:"space-between",gap:0,children:[e("div",{className:o(it,{quantityAction:!0,isDisabled:a}),onClick:l,children:e(y,{icon:U})}),e("div",{className:it.quantityValue,children:r}),e("div",{className:it.quantityAction,onClick:n,children:e(y,{icon:M})})]}),ot=({product:a,onClose:o})=>{const{language:l,currency:d}=me(),{addProduct:_,updateProduct:h}=Ve(),[p,v]=c(1),[f,y]=c(!1),b=s(),{t:P}=at(),C=(e=>{var t;const{cart:a}=Ve();return r(a)||!e?0:(null===(t=a[e])||void 0===t?void 0:t.quantity)||0})(null==a?void 0:a.id),{name:A,description:N}=m((()=>qe(a,l)),[a,l]),{totalPrice:w,formattedTotalPrice:S}=m((()=>Fe(a,d,l)),[a,d,l]),D=m((()=>p*w),[p,w]),T=m((()=>n(D,d,l)),[D,d,l]),z=f?0===p:1===p,R=m((()=>P(f?0===p?"removeFromOrder":"updateOrder":"addToOrder")),[f,p]);u((()=>{v(C>0?C:1),y(C>0)}),[C,a]);const G=e=>{-1===e&&z||v((t=>Math.max(0,t+e)))};if(r(a))return null;const{image1024:x,volume:j}=a;return e("div",{className:et.container,onClick:e=>{var t,a;(null===(a=null===(t=null==b?void 0:b.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||o&&o()},children:e(k,{onClose:o,ref:b,noBodyPadding:!0,size:"small",content:t("div",{className:et.content,children:[t(I,{gap:0,children:[x&&e(ze,{src:re(x),width:1024,height:400,alt:A||"product",className:et.image}),t(I,{className:et.details,gap:1,children:[e("h2",{className:et.name,children:A}),t(g,{justifyContent:"space-between",children:[e("div",{className:et.price,children:S}),e("div",{className:et.volume,children:j})]}),e("div",{className:et.description,children:N})]})]}),e("div",{className:et.close,children:e(O,{onClick:o,icon:$})})]}),footer:t(g,{className:et.addToCart,gap:.5,children:[e(nt,{isDecreaseDisabled:z,onDecrease:()=>G(-1),onIncrease:()=>G(1),quantity:p}),e(L,{className:et.addAction,label:t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:et.actionTitle,children:R}),e("span",{children:T})]}),onClick:()=>{f?h(a,p):(_(a,p),i(ve,{name:A,quantity:p})),o&&o()},size:"xl",fullWidth:!0})]})})})};var lt="Cart-module_container__3KQtx",dt="Cart-module_content__rkiZa",ct={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 st=({actionText:a,onClick:r})=>{const i=rt(),{formattedTotalPrice:l}=(()=>{const{cart:e}=Ve(),{currency:t,language:a}=me(),r=Object.values(e||{}).reduce(((e,{price:t,quantity:a,vat:r})=>e+Ye(t,a,r)),0);return{totalPrice:r,formattedTotalPrice:n(r,t,a)}})();return t(b,{className:o(ct,{container:!0,isClickable:!!r}),justifyContent:"space-between",alignItems:"center",onClick:r,children:[e(b.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:ct.count,children:i}),e("div",{className:ct.actionText,children:a})]})}),e(b.Item,{className:ct.totalPrice,flex:1,children:l})]})},ut=()=>{const{setIsCartOpen:t}=Ve(),{t:a}=at();return rt()<=0?null:e("div",{className:lt,children:e("div",{className:dt,children:e(st,{onClick:()=>t(!0),actionText:a("viewOrder")})})})};var mt={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"},_t="CartItem-module_container__At7lj",ht="CartItem-module_image__D-zzG",gt="CartItem-module_data__Lo3Fb",pt="CartItem-module_name__EksZu",vt="CartItem-module_price__yJxl6";const ft=e=>{var t;const{products:a}=me();return(null===(t=null==a?void 0:a.find)||void 0===t?void 0:t.call(a,(({id:t})=>t===e)))||{}},yt=({productId:t,min:a=1,size:r="md"})=>{const i=(e=>{const{cart:t}=Ve(),a=t[e];return(null==a?void 0:a.quantity)||1})(t),n=ft(t),{updateProduct:o}=Ve();return e(nt,{isDecreaseDisabled:i===a,onDecrease:()=>o(n,i-1),onIncrease:()=>o(n,i+1),quantity:i,size:r})},bt=({item:a})=>{const{productId:r,quantity:i}=a||{},n=ft(r),{language:o,currency:l}=me(),{image160:d}=n,{name:c}=m((()=>qe(n,o)),[n,o]),{formattedTotalPrice:s}=m((()=>Fe(n,l,o,i)),[n,l,o,i]);return t(g,{className:_t,gap:1,alignItems:"center",children:[d&&e(ze,{src:re(d),alt:c||"menu",className:ht,loading:"lazy",width:80,height:45}),t("div",{className:gt,children:[e("div",{className:pt,children:c}),e("div",{className:vt,children:s})]}),e(yt,{productId:r,size:"sm",min:0})]})},It=()=>{const{isCartOpen:a,cart:i,setIsCartOpen:n}=Ve(),o=s(),{t:l}=at(),d=r(i),c=()=>n(!1);return a?e("div",{className:mt.container,onClick:e=>{var t,a;(null===(a=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||c()},children:e(S,{ref:o,onClose:c,isOpen:a,title:l("Your order"),content:e("div",{className:mt.content,children:d?e((()=>t(I,{className:mt.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(w,{variant:"h2",children:l("Empty order")}),e(D,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:mt.items,children:Object.keys(i||{}).map((t=>e(bt,{item:i[t]},t)))})}),footer:d?e(L,{label:l("Add items"),onClick:c,type:N.PRIMARY,size:"xl",fullWidth:!0}):e(st,{actionText:l("Subtotal")})})}):null},Pt=_((({categoryProductMap:a=[],currency:r,language:n,productBlocksRef:o,containerRef:l,onCategoryInView:d})=>{const[s,m]=c(null),[_,h]=c(Me.LIST),p=[{icon:V,type:Me.LIST},{icon:Z,type:Me.GRID}],v=e=>{const{name:t}=qe(e,n);i(pe,{name:t}),m(e)};return u((()=>{const e=new IntersectionObserver((e=>{var t;const a=((null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let r=null,i=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,n=t.top+t.height/2,o=Math.abs(n-a);o<i&&(i=o,r=e.target.getAttribute("data-category-id"))}})),r&&d(Number(r))}),{threshold:.1});return Object.entries(o.current||{}).forEach((([t,a])=>{a&&(a.setAttribute("data-category-id",t),e.observe(a))})),()=>{e.disconnect()}}),[o,l]),e($e,{children:t("div",{className:We,children:[e(g,{className:Ee,alignItems:"center",children:p.map((({icon:t,type:a})=>e(O,{icon:t,onClick:()=>(e=>{h(e),i(fe,{name:e})})(a),type:a===_?N.PRIMARY:N.DEFAULT},a)))}),e(I,{children:(a||[]).map((a=>{const{name:i}=be(a,n),{id:l,products:d}=a;return t("div",{className:He,ref:e=>o.current[l]=e,"data-category-id":l,children:[e("h2",{className:Qe,children:i}),e("div",{className:Be,children:e(I,{gap:0,children:(d||[]).map((t=>_===Me.GRID?e(Je,{product:t,currency:r,language:n,onClick:()=>v(t)},t.id):e(Ke,{product:t,currency:r,language:n,onClick:()=>v(t)},t.id)))})})]},l)}))}),e(ot,{product:s,onClose:()=>m(null)}),e(ut,{}),e(It,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));var Ct="Branches-module_branches__sOuoV",At="Branches-module_list__vYoT2",Nt="Branches-module_name__K0Z-4";const wt=({branches:t=[],rootPath:a="",onBranchSelect:r})=>{const i=({children:t,id:i})=>r?e("div",{onClick:()=>r(i),children:t}):e("a",{href:`${a}/${i}`,children:t});return e("div",{className:Ct,children:e(T,{className:At,children:t.map((({id:t,name:a})=>e(i,{id:t,children:e(z,{noBottomMargin:!0,children:e(b,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:Nt,children:a})})})},t)))})})},Ot=({data:n})=>{var o;const{name:l,coverImage:d,logoImage:u,branches:m=[],branchId:_,language:h,categories:g,products:p,currency:v,instagram:f,facebook:y,whatsapp:b,telegram:I,tiktok:P,rootPath:C,hostname:A,onBranchSelect:N}=n||{},w=m.length<=1,O=((e,t)=>{const a=t.reduce(((e,t)=>{const a=Number(t.categoryId);return e[a]||(e[a]=[]),e[a].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:a[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(g,p),k=(()=>{var e;return w?(null===(e=null==m?void 0:m[0])||void 0===e?void 0:e.id)?m[0]:{}:m.find((e=>e.id===Number(_)))})(),L=w||!(null==k?void 0:k.name)?l:(null==k?void 0:k.name)||"",[S,D]=c(null===(o=null==g?void 0:g[0])||void 0===o?void 0:o.id),T=s({}),z=s(null),R=s(!0),{url:G,domain:x}=((e,t)=>{const a=ce.includes(e)?e:de;return{url:`https://${a}/${t||"en"}`,domain:a}})(A,h);return t("div",{className:J,ref:z,children:[e(xe,{branch:k,name:L,coverImage:ne(d),logoImage:ie(u),instagram:f,facebook:y,whatsapp:b,telegram:I,tiktok:P}),w||_?t(a,{children:[e(je,{categoryProductMap:O,language:h,selectedCategoryId:S,onSelectCategory:e=>X(void 0,void 0,void 0,(function*(){R.current=!1,D(e),(e=>{var t;const a=null===(t=null==T?void 0:T.current)||void 0===t?void 0:t[e];a&&(setTimeout((()=>{a.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{R.current=!0}),1e3))})(e)}))}),e(Pt,{currency:v,language:h,productBlocksRef:T,containerRef:z,categoryProductMap:O,onCategoryInView:e=>{if(!(null==R?void 0:R.current))return;const t=((e,t,a)=>{var i;const n=null===(i=null==t?void 0:t.find)||void 0===i?void 0:i.call(t,(({id:t})=>t===e));if(r(n))return"";const{name:o}=be(n,a);return o})(e,g,h);i(ge,{name:t}),D(e)}})]}):e(wt,{branches:m,onBranchSelect:N,rootPath:C}),!!A&&e("a",{rel:"noopener",target:"_blank",href:G,className:te,children:x})]})},kt=({data:t})=>e(ue,{value:t,children:e(Ot,{data:t})});var Lt={};const St=({currentGoal:t,language:a,setGoal:r})=>{const{t:i}=at(a),n=s({}),o=e=>{switch(e){case ge:return i("Scrolled to Category");case he:return i("Category Selected");case pe:return i("Product Details");case ve:return i("Product Added to Cart");default:return""}},l=h((e=>{var t,a;r(e),null===(a=null===(t=null==n?void 0:n.current)||void 0===t?void 0:t.close)||void 0===a||a.call(t)}),[r]);return e(R,{action:o(t),actionSize:"large",type:N.BORDERED_PRIMARY,closeRef:n,menu:e("div",{className:Lt.toolbarMenu,children:ye.map((t=>e(G,{onClick:()=>l(t),children:o(t)},t)))})})},Dt=({data:t,isLoading:a=!1,loadingImage:r,language:i,goal:n,setGoal:o})=>{const{t:l}=at(i);return e(z,{title:l("Events"),toolbar:e(St,{language:i,currentGoal:n,setGoal:o}),children:a?e(x,{image:r}):e(j,{data:t})})};export{Dt as Events,kt as PublicMenu};
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{isEmpty as r,trackEvent as i,priceFormatter as n,classNames as o}from"@sorocraft/js-utils";import{createContext as l,useContext as d,useState as c,useRef as s,useEffect as u,useMemo as m,memo as _,useCallback as h}from"react";import{Row as g,classNames as v,IconLink as p,Tooltip as f,SVGIcon as y,Flex as I,Column as P,Carousel as b,CarouselItem as C,Chip as A,UIElementType as N,Text as k,IconButton as w,Modal as S,Input as D,InputType as L,Button as T,Drawer as O,Description as R,Container as G,Card as x,DropDown as q,DropDownMenuItem as j,Loading as W,BarChart as z}from"@sorocraft/ui";import{Phone as E,Whatsapp as Q,Instagram as H,Telegram as B,Tiktok as $,Facebook as M,Wifi as U,MarkerPin as V,Plus as Y,Minus as F,Trash as K,ShoppingBag as X,Close as Z,List as J,Grid as ee}from"@sorocraft/ui/icons";function te(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(a[r[i]]=e[r[i]])}return a}function ae(e,t,a,r){return new(a||(a=Promise))((function(i,n){function o(e){try{d(r.next(e))}catch(e){n(e)}}function l(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,l)}d((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var re="PublicMenu-module_container__QLN6U",ie="PublicMenu-module_categories__Iy6NC",ne="PublicMenu-module_footer__6G3DQ";const oe="https://images.restaround.co",le=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${oe}/${e}`:"",de=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${oe}/${e}`:"https://images.restaround.co/no-photo-128.webp",ce=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${oe}/${e}`:"https://images.restaround.co/restaround-doodle.webp",se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ue=(e,t,a)=>se.charAt(e>>2)+se.charAt((3&e)<<4|t>>4)+se.charAt((15&t)<<2|a>>6)+se.charAt(63&a),me="restaround.co",_e=[me,"restaround.az","restaround.ee","restaround.nl"],he=l({}),ge=({children:t,value:a})=>{const i=r(a)?{}:a;return i.currency||(i.currency="AZN"),i.language||(i.language="az"),e(he.Provider,{value:r(a)?{}:a,children:t})},ve=()=>d(he),pe="digital_menu",fe=`${pe}_category_select`,ye=`${pe}_category_scroll`,Ie=`${pe}_product_details`,Pe=`${pe}_product_add_cart`,be=`${pe}_product_view_changed`,Ce=[fe,ye,Ie,Pe],Ae=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}};var Ne="Header-module_container__tenlF",ke="Header-module_cover__BAWZK",we="Header-module_content__Gx4Al",Se="Header-module_logo__4MTCm",De="Header-module_info__IchYA",Le="Header-module_name__30wyw",Te="Header-module_address__WOxXc",Oe="Header-module_addressText__lUszI",Re="Header-module_social__AoP0z",Ge="Header-module_links__EeQxg",xe="Header-module_wifiPassword__VWBTa",qe="Header-module_wifiPasswordIcon__Ukn3D";const je=t=>{const a=te(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:r}=ve()||{};if(r){return e(r,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(i=235,n=59,o=90,`data:image/gif;base64,R0lGODlhAQABAPAA${ue(0,i,n)+ue(o,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var i,n,o;return e("img",Object.assign({},a))};var We={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 ze=()=>{var a;const{language:r,languages:i,onLanguageSelect:n}=ve(),[o,l]=c(!1),d=(null==i?void 0:i.length)>1,s=(null===(a=null==i?void 0:i.filter)||void 0===a?void 0:a.call(i,(({code:e})=>e!==r)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return d?e("div",{className:We.container,onClick:()=>l(!o),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:v(We,{options:!0,isOpen:o}),children:s.map((({code:t})=>e("img",{src:u(t),className:We.option,onClick:()=>(e=>{n&&n(e)})(t),alt:t},t)))}),e("img",{src:u(r),alt:r||"",className:We.currentLanguage})]})}):null},Ee=({branch:a,coverImage:i,logoImage:n,name:o,instagram:l,facebook:d,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:v,wifiPassword:b}=a||{},C=r(a),A=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:Ne,children:[e(je,{src:i,alt:o,className:ke,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:we,children:e(C?()=>t(P,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(je,{src:n,alt:o,className:Se,width:96,height:96}),e("div",{className:De,children:e("h1",{className:Le,children:o})})]}):()=>t(I,{direction:"row",gap:1,alignItems:"center",fullWidth:!0,children:[e(I.Item,{children:e(je,{src:n,alt:o,className:Se,width:96,height:96})}),e(I.Item,{shrink:!0,className:De,children:t(P,{gap:.25,children:[e("h1",{className:Le,children:o}),e("a",{className:Te,href:A,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:V,theme:"dark"}),e("span",{className:Oe,children:m})]})})]})})]}),{})}),e(ze,{}),!C&&e("div",{className:Re,children:e("div",{className:Ge,children:e(g,{gap:2,alignItems:"center",children:t(g,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!v&&e(p,{icon:E,href:`tel:+${v}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(p,{icon:Q,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(p,{icon:H,href:l,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!s&&e(p,{icon:B,href:s,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(p,{icon:$,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(p,{icon:M,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!b&&e(f,{hint:b,children:e("div",{className:xe,children:e(y,{icon:U,size:"sm",className:qe})})})]})})})})]})},Qe=({categoryProductMap:t=[],language:a,selectedCategoryId:r,onSelectCategory:n})=>{const o=s({}),l=s(null);return u((()=>{r&&(()=>{var e;const t=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e[r];if(!t||!l.current)return;const a=l.current.clientWidth,i=t.offsetLeft-a/2+t.offsetWidth/2;l.current.scrollTo({left:i,behavior:"smooth"})})()}),[r]),e("div",{className:ie,children:e(b,{gap:1,onGetRef:e=>{(null==e?void 0:e.current)&&(l.current=e.current)},children:(t||[]).map((({id:t,translations:l})=>{const{name:d}=l.find((e=>e.language===a))||{};return e(C,{children:e(A,{onClick:()=>((e,t)=>{e!==r&&(i(fe,{name:t}),n(e))})(t,d),type:N.BORDERED_PRIMARY,active:t===r,children:e("div",{ref:e=>{e&&(o.current[t]=e)},children:d})})},t)}))})})};var He="Products-module_container__bF2LF",Be="Products-module_view__l857X",$e="Products-module_products__AoDrY",Me="Products-module_category__Sp7dE",Ue="Products-module_list__LH4v5";const Ve=(e,t,a=0)=>e*t*(1+a/100),Ye=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}},Fe=(e,t,a,r=1)=>{const{price:i,vat:o}=e||{},l=Ve(i,r,o);return{totalPrice:l,formattedTotalPrice:n(l,t,a)}},Ke=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.variants)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.id===t)))||{}},Xe=({variantId:e,currency:t="USD",language:a="en",product:r,quantity:i=1})=>{const o=Ke(r,e),{vat:l}=r||{},{price:d}=o||{},c=Ve(d,i,l);return{totalPrice:c,formattedTotalPrice:n(c,t,a)}},Ze=(e,t)=>{var a,r;return(null===(r=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===r?void 0:r.call(a,(e=>e.language===t)))||{}};var Je;!function(e){e.LIST="list",e.GRID="grid"}(Je||(Je={}));const et=l({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{},removeAllProductVariants:()=>{}}),tt=({children:t})=>{const[a,i]=c({}),[n,o]=c(!1),l=({product:e,quantity:t,isAddOperation:a,variantId:n})=>{var o;if(r(e)||t<0)return;const{id:l,price:d,vat:c=0}=e,s=n?`${l}-${n}`:`${l}`,u=n?null===(o=Ke(e,n))||void 0===o?void 0:o.price:d;i((e=>{const r=e[s],i=a?((null==r?void 0:r.quantity)||0)+t:t;if(i<=0){const t=e,a=s;t[a];return te(t,["symbol"==typeof a?a:a+""])}return Object.assign(Object.assign({},e),{[s]:{productId:l,price:u,quantity:i,vat:c,variantId:n}})}))},d=({product:e,quantity:t=1,variantId:a})=>l({product:e,quantity:t,variantId:a,isAddOperation:!0}),s=({product:e,quantity:t=1,variantId:a})=>l({product:e,quantity:t,variantId:a,isAddOperation:!1}),u=e=>{if(!e||r(a))return;const t=Object.entries(a).reduce(((t,[a,r])=>(r.productId!==e&&(t[a]=r),t)),{});i(t)},_=m((()=>({cart:a,isCartOpen:n,addProduct:d,updateProduct:s,setIsCartOpen:o,removeAllProductVariants:u})),[a,n]);return e(et.Provider,{value:_,children:t})},at=()=>d(et);var rt={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 it=({product:a,currency:r,language:n,onClick:l})=>{var d;const{addProduct:c}=at(),{image160:s,volume:u}=a||{},{name:_,description:h}=m((()=>Ye(a,n)),[a,n]),{formattedTotalPrice:v}=m((()=>Fe(a,r,n)),[a,r,n]),p=(null===(d=null==a?void 0:a.variants)||void 0===d?void 0:d.length)>0;return t("div",{className:o(rt,{container:!0,isClickable:!!l}),onClick:l,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:rt.data,children:t(P,{gap:.25,children:[e("h3",{className:rt.name,children:_}),e("p",{className:rt.description,children:h}),t(g,{className:rt.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:v}),!!u&&e(k,{color:"muted",children:u})]})]})}),s&&e(je,{src:le(s),alt:_||"menu",className:rt.image,loading:"lazy",width:160,height:90})]}),e("div",{className:rt.addToCart,children:e(w,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),p&&l)return l();c({product:a}),i(Pe,{name:_,quantity:1})},icon:Y,type:N.DEFAULT})})]})};var nt={container:"ProductsGridItem-module_container__DU5KG",content:"ProductsGridItem-module_content__FXs0Y",isClickable:"ProductsGridItem-module_isClickable__8zhwt",info:"ProductsGridItem-module_info__HkBG-",data:"ProductsGridItem-module_data__Z-N1X",name:"ProductsGridItem-module_name__ZrIx3",description:"ProductsGridItem-module_description__-FQPA",price:"ProductsGridItem-module_price__BFu2H",imageContainer:"ProductsGridItem-module_imageContainer__eHS4Z",image:"ProductsGridItem-module_image__alZWL",addToCart:"ProductsGridItem-module_addToCart__gYVrI",noImage:"ProductsGridItem-module_noImage__78UHW",volume:"ProductsGridItem-module_volume__oxEAr",flexWide:"ProductsGridItem-module_flexWide__qcB5X",slidein:"ProductsGridItem-module_slidein__oKaVb",fadeInOut:"ProductsGridItem-module_fadeInOut__d2zot",heightAnimation:"ProductsGridItem-module_heightAnimation__zgbh9",fadein:"ProductsGridItem-module_fadein__Z067K",floatAnimation:"ProductsGridItem-module_floatAnimation__GXjP-",bottomSheet:"ProductsGridItem-module_bottomSheet__-zrFD",slideRightToLeft:"ProductsGridItem-module_slideRightToLeft__R7hv5"};const ot=({product:a,currency:r,language:n,onClick:l})=>{var d;const{addProduct:c}=at(),{volume:s,image580:u,image160:_,image1024:h}=a||{},v=u||h||_,{name:p,description:f}=m((()=>Ye(a,n)),[a,n]),{formattedTotalPrice:y}=m((()=>Fe(a,r,n)),[a,r,n]),I=(null===(d=null==a?void 0:a.variants)||void 0===d?void 0:d.length)>0;return e("div",{className:nt.container,children:t("div",{className:o(nt,{content:!0,isClickable:!!l,noImage:!v}),onClick:l,children:[v&&e("div",{className:nt.imageContainer,children:e(je,{src:le(v),alt:p||"menu",className:nt.image,loading:"lazy",width:580,height:326})}),e("div",{className:nt.info,children:e("div",{className:nt.data,children:t(P,{gap:.25,children:[e("h3",{className:nt.name,children:p}),e("p",{className:nt.description,children:f}),t(g,{className:nt.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:y}),!!s&&e(k,{color:"white",className:nt.volume,children:s})]})]})})}),e("div",{className:nt.addToCart,children:e(w,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),I&&l)return l();c({product:a}),i(Pe,{name:p,quantity:1})},icon:Y,type:N.DEFAULT})})]})})};var lt={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",variants:"ProductDetails-module_variants__zOWjJ",focused:"ProductDetails-module_focused__Nsffd",variantsTitle:"ProductDetails-module_variantsTitle__ta-cw",variant:"ProductDetails-module_variant__vQ5yD",close:"ProductDetails-module_close__4cHZ3",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW",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 dt={en:{},az:{"View order":"Şifarişi göstər","Remove from order":"Sifarişdən sil","Update order":"Sifarişi yenilə","Add to order":"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",Events:"Hərəkətlər","Scrolled to Category":"Kateqoriyaya sürüşdürdü","Category Selected":"Kateqoriya seçildi","Product Details":"Məhsul detalına baxıldı","Product Added to Cart":"Səbətə əlavə edildi","Product choices":"Seçimlər","In order":"Sifarişdə"},tr:{"View order":"Siparişi Görüntüle","Remove from order":"Siparişten Kaldır","Update order":"Siparişi Güncelle","Add to order":"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",Events:"Olaylar","Product choices":"Seçenekler","In order":"Siparişte"},nl:{"View order":"Bestelling bekijken","Remove from order":"Uit bestelling verwijderen","Update order":"Bestelling bijwerken","Add to order":"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",Events:"Gebeurtenissen","Product choices":"Productkeuzes","In order":"In bestelling"},et:{"View order":"Vaata tellimust","Remove from order":"Eemalda tellimusest","Update order":"Uuenda tellimust","Add to order":"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",Events:"Sündmused","Product choices":"Tootevalikud","In order":"Tellimuses"},ru:{"View order":"Посмотреть заказ","Remove from order":"Удалить из заказа","Update order":"Обновить заказ","Add to order":"Добавить в заказ","Your order":"Ваш заказ","Empty order":"Пустой заказ","You don't have any items in your order":"В вашем заказе нет товаров","Add items":"Добавить товары",Subtotal:"Итого",Events:"События","Product choices":"Варианты товара","In order":"В заказе"}},ct=e=>{const{language:t}=ve(),a=e||t;return{t:e=>{var t;return(null===(t=dt[a])||void 0===t?void 0:t[e])||e}}},st=(e,t="USD",a="en")=>{const{price:r,vat:i,quantity:o}=e||{},l=Ve(r,o,i);return{totalPrice:l,formattedTotalPrice:n(l,t,a)}},ut=()=>{const{cart:e}=at();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var mt={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 _t=({isDecreaseDisabled:a=!1,quantity:r=1,size:i="md",onIncrease:n,onDecrease:l})=>t(g,{className:o(mt,{container:!0},[mt[i]]),justifyContent:"space-between",gap:0,children:[e("div",{className:o(mt,{quantityAction:!0,isDisabled:a}),onClick:l,children:e(y,{icon:F})}),e("div",{className:mt.quantityValue,children:r}),e("div",{className:mt.quantityAction,onClick:n,children:e(y,{icon:Y})})]});var ht="ProductInCart-module_container__oSrwq",gt="ProductInCart-module_title__Vnc4l";const vt=({productId:a,onModalClose:i})=>{const{setIsCartOpen:n,removeAllProductVariants:o}=at(),{t:l}=ct(),d=(e=>{const{cart:t}=at();return r(t)||!e?0:Object.values(t).filter((t=>t.productId===e)).reduce(((e,t)=>e+t.quantity),0)})(a);return d<=0?null:t(I,{className:ht,fullWidth:!0,justifyContent:"space-between",alignItems:"center",children:[t(I.Item,{flex:1,className:gt,children:[l("In order")," (",d,")"]}),e(I.Item,{flex:0,children:t(g,{children:[e(w,{icon:K,onClick:()=>{o(a)},type:N.DANGER,tooltip:l("Remove from order")}),e(w,{icon:X,onClick:()=>{n(!0),i&&i()},type:N.SUCCESS,tooltip:l("View order")})]})})]})},pt=({product:a,onClose:n})=>{const{language:l,currency:d}=ve(),{addProduct:_,updateProduct:h}=at(),[v,p]=c(1),[f,y]=c(!1),[I,b]=c(null),[C,A]=c(null),N=s(null),{t:k}=ct(),O=((e,t)=>{var a;const{cart:i}=at();return r(i)||!e?0:(null===(a=i[t?`${e}-${t}`:`${e}`])||void 0===a?void 0:a.quantity)||0})(null==a?void 0:a.id,I),{name:R,description:G}=m((()=>Ye(a,l)),[a,l]),{formattedTotalPrice:x}=m((()=>Fe(a,d,l)),[a,d,l]),{formattedTotalPrice:q}=m((()=>(({product:e,variantId:t,quantity:a=1,currency:r,language:i})=>t?Xe({variantId:t,currency:r,language:i,product:e,quantity:a}):Fe(e,r,i,a))({product:a,quantity:v,language:l,currency:d,variantId:I})),[a,v,l,d,I]),j=f?0===v:1===v,W=m((()=>k(f?0===v?"Remove from order":"Update order":"Add to order")),[f,v]);u((()=>{p(O>0?O:1),y(O>0)}),[O,a]),u((()=>{b(null)}),[a]);const z=e=>{-1===e&&j||p((t=>Math.max(0,t+e)))};if(r(a))return null;const{image1024:E,volume:Q,variants:H}=a;return e("div",{className:lt.container,onClick:e=>{var t,a;(null===(a=null===(t=null==N?void 0:N.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||n&&n()},children:e(S,{onClose:n,ref:N,noBodyPadding:!0,size:"small",content:t("div",{className:lt.content,children:[t(P,{gap:0,children:[E&&e(je,{src:le(E),width:1024,height:400,alt:R||"product",className:lt.image}),t(P,{className:lt.details,gap:1,children:[e("h2",{className:lt.name,children:R}),t(g,{justifyContent:"space-between",children:[e("div",{className:lt.price,children:x}),e("div",{className:lt.volume,children:Q})]}),e("div",{className:lt.description,children:G})]}),(null==H?void 0:H.length)>0&&t(P,{className:o(lt,{variants:!0,focused:"variant"===C}),gap:1,fullWidth:!0,children:[e("div",{className:lt.variantsTitle,children:k("Product choices")}),H.map((r=>{const{id:i}=r||{},{formattedTotalPrice:n}=Xe({variantId:i,language:l,currency:d,product:a}),{title:o}=Ze(r,l);return t(g,{justifyContent:"space-between",onClick:()=>b(i),className:lt.variant,children:[e(D,{label:o,name:"variant",onChange:()=>b(i),checked:I===i,type:L.RADIO}),e("div",{className:lt.variantPrice,children:n})]},i)}))]})]}),e("div",{className:lt.close,children:e(w,{onClick:n,icon:Z})})]}),footer:t(P,{children:[e(vt,{productId:null==a?void 0:a.id,onModalClose:n}),t(g,{className:lt.addToCart,gap:.5,children:[e(_t,{isDecreaseDisabled:j,onDecrease:()=>z(-1),onIncrease:()=>z(1),quantity:v}),e(T,{className:lt.addAction,label:t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:lt.actionTitle,children:W}),e("span",{children:q})]}),onClick:()=>{var e;if((null===(e=null==a?void 0:a.variants)||void 0===e?void 0:e.length)>0&&!I)return A("variant"),void setTimeout((()=>{A(null)}),200);f?h({product:a,quantity:v,variantId:I}):(_({product:a,quantity:v,variantId:I}),i(Pe,{name:R,quantity:v})),n&&n()},size:"xl",fullWidth:!0})]})]})})})};var ft="Cart-module_container__3KQtx",yt="Cart-module_content__rkiZa",It={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 Pt=({actionText:a,onClick:r})=>{const i=ut(),{formattedTotalPrice:l}=(()=>{const{cart:e}=at(),{currency:t,language:a}=ve(),r=Object.values(e||{}).reduce(((e,t)=>{const{totalPrice:a}=st(t);return e+a}),0);return{totalPrice:r,formattedTotalPrice:n(r,t,a)}})();return t(I,{className:o(It,{container:!0,isClickable:!!r}),justifyContent:"space-between",alignItems:"center",onClick:r,children:[e(I.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:It.count,children:i}),e("div",{className:It.actionText,children:a})]})}),e(I.Item,{className:It.totalPrice,flex:1,children:l})]})},bt=()=>{const{setIsCartOpen:t}=at(),{t:a}=ct();return ut()<=0?null:e("div",{className:ft,children:e("div",{className:yt,children:e(Pt,{onClick:()=>t(!0),actionText:a("View order")})})})};var Ct={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"},At="CartItem-module_container__At7lj",Nt="CartItem-module_image__D-zzG",kt="CartItem-module_data__Lo3Fb",wt="CartItem-module_name__EksZu",St="CartItem-module_price__yJxl6";const Dt=e=>{var t;const{products:a}=ve();return(null===(t=null==a?void 0:a.find)||void 0===t?void 0:t.call(a,(({id:t})=>t===e)))||{}},Lt=({productId:t,variantId:a,min:r=1,size:i="md"})=>{const n=((e,t)=>{const{cart:a}=at(),r=a[t?`${e}-${t}`:`${e}`];return(null==r?void 0:r.quantity)||1})(t,a),o=Dt(t),{updateProduct:l}=at();return e(_t,{isDecreaseDisabled:n===r,onDecrease:()=>l({product:o,quantity:n-1,variantId:a}),onIncrease:()=>l({product:o,quantity:n+1,variantId:a}),quantity:n,size:i})},Tt=({item:a})=>{const{productId:r,variantId:i}=a||{},n=Dt(r),o=Ke(n,i),{language:l,currency:d}=ve(),{image160:c}=n,{title:s}=Ze(o,l),{name:u}=m((()=>Ye(n,l)),[n,l]),{formattedTotalPrice:_}=m((()=>st(a,d,l)),[a,d,l]);return t(g,{className:At,gap:1,alignItems:"center",children:[c&&e(je,{src:le(c),alt:u||"menu",className:Nt,loading:"lazy",width:80,height:45}),t("div",{className:kt,children:[e("div",{className:wt,children:u}),!!s&&e(k,{color:"muted",variant:"small",children:s}),e("div",{className:St,children:_})]}),e(Lt,{productId:r,variantId:i,size:"sm",min:0})]})},Ot=()=>{const{isCartOpen:a,cart:i,setIsCartOpen:n}=at(),o=s(null),{t:l}=ct(),d=r(i),c=()=>n(!1);return a?e("div",{className:Ct.container,onClick:e=>{var t,a;(null===(a=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains)||void 0===a?void 0:a.call(t,null==e?void 0:e.target))||c()},children:e(O,{ref:o,onClose:c,isOpen:a,title:l("Your order"),content:e("div",{className:Ct.content,children:d?e((()=>t(P,{className:Ct.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(k,{variant:"h2",children:l("Empty order")}),e(R,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:Ct.items,children:Object.keys(i||{}).map((t=>e(Tt,{item:i[t]},t)))})}),footer:d?e(T,{label:l("Add items"),onClick:c,type:N.PRIMARY,size:"xl",fullWidth:!0}):e(Pt,{actionText:l("Subtotal")})})}):null},Rt=_((({categoryProductMap:a=[],currency:r,language:n,productBlocksRef:o,containerRef:l,onCategoryInView:d})=>{const[s,m]=c(null),[_,h]=c(Je.LIST),v=[{icon:J,type:Je.LIST},{icon:ee,type:Je.GRID}],p=e=>{const{name:t}=Ye(e,n);i(Ie,{name:t}),m(e)};return u((()=>{const e=new IntersectionObserver((e=>{var t;const a=((null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.clientHeight)||1e3)/2;let r=null,i=1/0;e.forEach((e=>{if(e.isIntersecting){const t=e.boundingClientRect,n=t.top+t.height/2,o=Math.abs(n-a);o<i&&(i=o,r=e.target.getAttribute("data-category-id"))}})),r&&d(Number(r))}),{threshold:.1});return Object.entries(o.current||{}).forEach((([t,a])=>{a&&(a.setAttribute("data-category-id",t),e.observe(a))})),()=>{e.disconnect()}}),[o,l]),e(tt,{children:t("div",{className:He,children:[e(g,{className:Be,alignItems:"center",children:v.map((({icon:t,type:a})=>e(w,{icon:t,onClick:()=>(e=>{h(e),i(be,{name:e})})(a),type:a===_?N.PRIMARY:N.DEFAULT},a)))}),e(P,{children:(a||[]).map((a=>{const{name:i}=Ae(a,n),{id:l,products:d}=a;return t("div",{className:$e,ref:e=>{e&&(o.current[l]=e)},"data-category-id":l,children:[e("h2",{className:Me,children:i}),e("div",{className:Ue,children:e(P,{gap:0,children:(d||[]).map((t=>_===Je.GRID?e(ot,{product:t,currency:r,language:n,onClick:()=>p(t)},t.id):e(it,{product:t,currency:r,language:n,onClick:()=>p(t)},t.id)))})})]},l)}))}),e(pt,{product:s,onClose:()=>m(null)}),e(bt,{}),e(Ot,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));Rt.displayName="Products";var Gt="Branches-module_branches__sOuoV",xt="Branches-module_list__vYoT2",qt="Branches-module_name__K0Z-4";const jt=({branches:t=[],rootPath:a="",onBranchSelect:r})=>{const i=({children:t,id:i})=>r?e("div",{onClick:()=>r(i),children:t}):e("a",{href:`${a}/${i}`,children:t});return e("div",{className:Gt,children:e(G,{className:xt,children:t.map((({id:t,name:a})=>e(i,{id:t,children:e(x,{noBottomMargin:!0,children:e(I,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:qt,children:a})})})},t)))})})},Wt=({data:n})=>{var o;const{name:l,coverImage:d,logoImage:u,branches:m=[],branchId:_,language:h,categories:g,products:v,currency:p,instagram:f,facebook:y,whatsapp:I,telegram:P,tiktok:b,rootPath:C,hostname:A,onBranchSelect:N}=n||{},k=m.length<=1,w=((e,t)=>{const a=t.reduce(((e,t)=>{const a=Number(t.categoryId);return e[a]||(e[a]=[]),e[a].push(t),e}),{});return e.map((e=>Object.assign(Object.assign({},e),{products:a[Number(e.id)]||[]}))).filter((e=>{var t;return(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t.length)>0}))})(g,v),S=(()=>{var e;return k?(null===(e=null==m?void 0:m[0])||void 0===e?void 0:e.id)?m[0]:{}:m.find((e=>e.id===Number(_)))})(),D=k||!(null==S?void 0:S.name)?l:(null==S?void 0:S.name)||"",[L,T]=c(null===(o=null==g?void 0:g[0])||void 0===o?void 0:o.id),O=s({}),R=s(null),G=s(!0),{url:x,domain:q}=((e,t)=>{const a=_e.includes(e)?e:me;return{url:`https://${a}/${t||"en"}`,domain:a}})(A,h);return t("div",{className:re,ref:R,children:[e(Ee,{branch:S,name:D,coverImage:ce(d),logoImage:de(u),instagram:f,facebook:y,whatsapp:I,telegram:P,tiktok:b}),k||_?t(a,{children:[e(Qe,{categoryProductMap:w,language:h,selectedCategoryId:L,onSelectCategory:e=>ae(void 0,void 0,void 0,(function*(){G.current=!1,T(e),(e=>{var t;const a=null===(t=null==O?void 0:O.current)||void 0===t?void 0:t[e];a&&(setTimeout((()=>{a.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{G.current=!0}),1e3))})(e)}))}),e(Rt,{currency:p,language:h,productBlocksRef:O,containerRef:R,categoryProductMap:w,onCategoryInView:e=>{if(!(null==G?void 0:G.current))return;const t=((e,t,a)=>{var i;const n=null===(i=null==t?void 0:t.find)||void 0===i?void 0:i.call(t,(({id:t})=>t===e));if(r(n))return"";const{name:o}=Ae(n,a);return o})(e,g,h);i(ye,{name:t}),T(e)}})]}):e(jt,{branches:m,onBranchSelect:N,rootPath:C}),!!A&&e("a",{rel:"noopener noreferrer",target:"_blank",href:x,className:ne,children:q})]})},zt=({data:t})=>e(ge,{value:t,children:e(Wt,{data:t})});var Et={};const Qt=({currentGoal:t,language:a,setGoal:r})=>{const{t:i}=ct(a),n=s({}),o=e=>{switch(e){case ye:return i("Scrolled to Category");case fe:return i("Category Selected");case Ie:return i("Product Details");case Pe:return i("Product Added to Cart");default:return""}},l=h((e=>{var t,a;r(e),null===(a=null===(t=null==n?void 0:n.current)||void 0===t?void 0:t.close)||void 0===a||a.call(t)}),[r]);return e(q,{action:o(t),actionSize:"large",type:N.BORDERED_PRIMARY,closeRef:n,menu:e("div",{className:Et.toolbarMenu,children:Ce.map((t=>e(j,{onClick:()=>l(t),children:o(t)},t)))})})},Ht=({data:t,isLoading:a=!1,loadingImage:r,language:i,goal:n,setGoal:o})=>{const{t:l}=ct(i);return e(x,{title:l("Events"),toolbar:e(Qt,{language:i,currentGoal:n,setGoal:o}),children:a?e(W,{image:r}):e(z,{data:t})})};export{Ht as Events,zt as PublicMenu};
2
2
  //# sourceMappingURL=index.esm.js.map