@restaround/react 1.0.62 → 1.0.64

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.
@@ -17,6 +17,7 @@ export declare const translations: {
17
17
  "Product Added to Cart": string;
18
18
  "Product choices": string;
19
19
  "In order": string;
20
+ "Not available": string;
20
21
  };
21
22
  tr: {
22
23
  "View order": string;
@@ -31,6 +32,7 @@ export declare const translations: {
31
32
  Events: string;
32
33
  "Product choices": string;
33
34
  "In order": string;
35
+ "Not available": string;
34
36
  };
35
37
  nl: {
36
38
  "View order": string;
@@ -45,6 +47,7 @@ export declare const translations: {
45
47
  Events: string;
46
48
  "Product choices": string;
47
49
  "In order": string;
50
+ "Not available": string;
48
51
  };
49
52
  et: {
50
53
  "View order": string;
@@ -59,6 +62,7 @@ export declare const translations: {
59
62
  Events: string;
60
63
  "Product choices": string;
61
64
  "In order": string;
65
+ "Not available": string;
62
66
  };
63
67
  ru: {
64
68
  "View order": string;
@@ -73,5 +77,6 @@ export declare const translations: {
73
77
  Events: string;
74
78
  "Product choices": string;
75
79
  "In order": string;
80
+ "Not available": string;
76
81
  };
77
82
  };
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{isEmpty as r,trackEvent as i,priceFormatter as a,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,Column as I,Flex as P,Carousel as b,CarouselItem as A,Chip as C,UIElementType as N,Text as S,IconButton as k,Input as w,InputType as L,Modal as T,Button as O,Drawer as D,Description as R,Container as j,Card as G,DropDown as q,DropDownMenuItem as V,Loading as E,BarChart as x}from"@sorocraft/ui";import{Phone as z,Whatsapp as W,Instagram as H,Telegram as B,Tiktok as U,Facebook as Q,Wifi as M,MarkerPin as $,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 n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[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])&&(n[r[i]]=e[r[i]])}return n}function ne(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{d(r.next(e))}catch(e){a(e)}}function l(e){try{d(r.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((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",ae="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,n)=>se.charAt(e>>2)+se.charAt((3&e)<<4|t>>4)+se.charAt((15&t)<<2|n>>6)+se.charAt(63&n),me="restaround.co",_e=[me,"restaround.az","restaround.ee","restaround.nl"],he=l({}),ge=({children:t,value:n})=>{const i=r(n)?{}:n;return i.currency||(i.currency="AZN"),i.language||(i.language="az"),e(he.Provider,{value:r(n)?{}:n,children:t})},pe=()=>d(he),ve="digital_menu",fe=`${ve}_category_select`,ye=`${ve}_category_scroll`,Ie=`${ve}_product_details`,Pe=`${ve}_product_add_cart`,be=`${ve}_product_view_changed`,Ae=[fe,ye,Ie,Pe],Ce=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}};var Ne="Header-module_container__tenlF",Se="Header-module_cover__BAWZK",ke="Header-module_content__Gx4Al",we="Header-module_logo__4MTCm",Le="Header-module_info__IchYA",Te="Header-module_name__30wyw",Oe="Header-module_address__WOxXc",De="Header-module_addressText__lUszI",Re="Header-module_social__AoP0z",je="Header-module_links__EeQxg",Ge="Header-module_wifiPassword__VWBTa",qe="Header-module_wifiPasswordIcon__Ukn3D";const Ve=t=>{const{priority:n,blurDataURL:r,quality:i,placeholder:a,fetchPriority:o}=t,l=te(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:d}=pe()||{};if(d){return e(d,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(c=235,s=59,u=90,`data:image/gif;base64,R0lGODlhAQABAPAA${ue(0,c,s)+ue(u,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var c,s,u;return e("img",Object.assign({},l))};var Ee={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 xe=()=>{var n;const{language:r,languages:i,onLanguageSelect:a}=pe(),[o,l]=c(!1),d=(null==i?void 0:i.length)>1,s=(null===(n=null==i?void 0:i.filter)||void 0===n?void 0:n.call(i,(({code:e})=>e!==r)))||[],u=e=>`https://images.restaround.co/languages/${e}.svg`;return d?e("div",{className:Ee.container,onClick:()=>l(!o),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:p(Ee,{options:!0,isOpen:o}),children:s.map((({code:t})=>e("img",{src:u(t),className:Ee.option,onClick:()=>(e=>{a&&a(e)})(t),alt:t},t)))}),e("img",{src:u(r),alt:r||"",className:Ee.currentLanguage})]})}):null},ze=({branch:n,coverImage:i,logoImage:a,name:o,instagram:l,facebook:d,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:p,wifiPassword:b}=n||{},A=r(n),C=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:Ne,children:[e(Ve,{src:i,alt:o,className:Se,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:ke,children:e(A?()=>t(I,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(Ve,{src:a,alt:o,className:we,width:96,height:96}),e("div",{className:Le,children:e("h1",{className:Te,children:o})})]}):()=>t(P,{direction:"row",gap:1,alignItems:"center",fullWidth:!0,children:[e(P.Item,{children:e(Ve,{src:a,alt:o,className:we,width:96,height:96})}),e(P.Item,{shrink:!0,className:Le,children:t(I,{gap:.25,children:[e("h1",{className:Te,children:o}),e("a",{className:Oe,href:C,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:$,theme:"dark"}),e("span",{className:De,children:m})]})})]})})]}),{})}),e(xe,{}),!A&&e("div",{className:Re,children:e("div",{className:je,children:e(g,{gap:2,alignItems:"center",children:t(g,{alignItems:"center",justifyContent:"center",gap:.5,children:[!!p&&e(v,{icon:z,href:`tel:+${p}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(v,{icon:W,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:B,href:s,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!u&&e(v,{icon:U,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"}),!!b&&e(f,{hint:b,children:e("div",{className:Ge,children:e(y,{icon:M,size:"sm",className:qe})})})]})})})})]})},We=({categoryProductMap:t=[],language:n,selectedCategoryId:r,onSelectCategory:a})=>{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 n=l.current.clientWidth,i=t.offsetLeft-n/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===n))||{};return e(A,{children:e(C,{onClick:()=>((e,t)=>{e!==r&&(i(fe,{name:t}),a(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",Ue="Products-module_products__AoDrY",Qe="Products-module_category__Sp7dE",Me="Products-module_list__LH4v5";const $e=(e=0,t=1,n=0)=>e*t*(1+n/100);var Ye;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}(Ye||(Ye={}));const Fe=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},Ke=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},Xe=(e,t)=>{var n;return(null===(n=((null==e?void 0:e.options)||[]).find((({id:e})=>e===t)))||void 0===n?void 0:n.price)||0},Ze=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},Je=(e,t=1)=>{const{price:n=0,vat:r=0}=e||{};return $e(n,t,r)},et=(e,t,n,r=1)=>{const i=Je(e,r);return{totalPrice:i,formattedTotalPrice:a(i,t,n)}},tt=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.variants)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.id===t)))||{}},nt=(e,t,n)=>{const r=tt(t,e),{vat:i}=t||{},{price:a}=r||{};return $e(a,n,i)},rt=(e,t)=>{var n,r;return(null===(r=null===(n=null==e?void 0:e.translations)||void 0===n?void 0:n.find)||void 0===r?void 0:r.call(n,(e=>e.language===t)))||{}},it=({product:e,variantId:t,quantity:n=1,selectedAddons:i,noVat:a=!1})=>{if(r(e))return{price:0,optionsPrice:0,total:0};const o=Object.assign(Object.assign({},e),{vat:a?0:e.vat}),l=((e,t={},n)=>((null==e?void 0:e.addons)||[]).filter((e=>Object.prototype.hasOwnProperty.call(t,e.id))).reduce(((e,n)=>{const{id:r,selectType:i}=n;if(i===Ye.SINGLE){const i=t[r];return e+Xe(n,i)}return e+(t[r]||[]).reduce(((e,t)=>e+Xe(n,t)),0)}),0)*n)(o,i,n),d=t?nt(t,o,n):Je(o,n);return{price:d,optionsPrice:l,total:d+l}};var at;!function(e){e.LIST="list",e.GRID="grid"}(at||(at={}));const ot=(e,t="USD",n="en")=>{const{price:r,vat:i,quantity:o,optionsPrice:l}=e||{},d=$e(r,o,i)+l*o;return{totalPrice:d,formattedTotalPrice:a(d,t,n)}},lt=(e,t,n)=>{if(!e)throw new Error("Product ID is required");let r=`${e}`;t&&(r+=`-${t}`);const i=Object.entries(n||{}).map((([e,t])=>{if(!e||!t)return null;const n=Array.isArray(t)?t.filter(Boolean).join("-"):`${t}`;return n?`${e}-${n}`:null})).filter(Boolean).join("-");return i&&(r+=`-${i}`),r},dt=l({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{},removeAllProductVariants:()=>{}}),ct=({children:t})=>{const[n,i]=c({}),[a,o]=c(!1),l=({product:e,quantity:t,isAddOperation:n,variantId:a,selectedAddons:o})=>{if(r(e)||t<0)return;const{id:l,vat:d=0}=e,c=lt(l,a,o),{price:s,optionsPrice:u}=it({product:e,variantId:a,quantity:1,selectedAddons:o,noVat:!0});i((e=>{const r=e[c],i=n?((null==r?void 0:r.quantity)||0)+t:t;if(i<=0){const t=e,n=c;t[n];return te(t,["symbol"==typeof n?n:n+""])}return Object.assign(Object.assign({},e),{[c]:{productId:l,price:s,optionsPrice:u,quantity:i,vat:d,variantId:a,selectedAddons:o}})}))},d=({product:e,quantity:t=1,variantId:n,selectedAddons:r})=>l({product:e,quantity:t,variantId:n,selectedAddons:r,isAddOperation:!0}),s=({product:e,quantity:t=1,variantId:n,selectedAddons:r})=>l({product:e,quantity:t,variantId:n,selectedAddons:r,isAddOperation:!1}),u=e=>{if(!e||r(n))return;const t=Object.entries(n).reduce(((t,[n,r])=>(r.productId!==e&&(t[n]=r),t)),{});i(t)},_=m((()=>({cart:n,isCartOpen:a,addProduct:d,updateProduct:s,setIsCartOpen:o,removeAllProductVariants:u})),[n,a]);return e(dt.Provider,{value:_,children:t})},st=()=>d(dt);var ut={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",info:"ProductsListItem-module_info__4s4j2",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",noImage:"ProductsListItem-module_noImage__G4E-a",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 mt=({product:n,currency:r,language:a,onClick:l})=>{var d,c;const{addProduct:s}=st(),{image160:u,volume:_}=n||{},{name:h,description:p}=m((()=>Ze(n,a)),[n,a]),{formattedTotalPrice:v}=m((()=>et(n,r,a)),[n,r,a]),f=(null===(d=null==n?void 0:n.variants)||void 0===d?void 0:d.length)>0,y=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0,P=!!u;return t("div",{className:o(ut,{container:!0,isClickable:!!l,noImage:!P}),onClick:l,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:ut.info,children:t(I,{gap:.25,children:[e("h3",{className:ut.name,children:h}),e("p",{className:ut.description,children:p}),t(g,{className:ut.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:v}),!!_&&e(S,{color:"muted",children:_})]})]})}),P&&e(Ve,{src:le(u),alt:h||"menu",className:ut.image,loading:"lazy",width:160,height:90})]}),e("div",{className:ut.addToCart,children:e(k,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(f||y)&&l)return l();s({product:n}),i(Pe,{name:h,quantity:1})},icon:Y,type:N.DEFAULT})})]})};var _t={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 ht=({product:n,currency:r,language:a,onClick:l})=>{var d,c;const{addProduct:s}=st(),{volume:u,image580:_,image160:h,image1024:p}=n||{},v=_||p||h,{name:f,description:y}=m((()=>Ze(n,a)),[n,a]),{formattedTotalPrice:P}=m((()=>et(n,r,a)),[n,r,a]),b=(null===(d=null==n?void 0:n.variants)||void 0===d?void 0:d.length)>0,A=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0;return e("div",{className:_t.container,children:t("div",{className:o(_t,{content:!0,isClickable:!!l,noImage:!v}),onClick:l,children:[v&&e("div",{className:_t.imageContainer,children:e(Ve,{src:le(v),alt:f||"menu",className:_t.image,loading:"lazy",width:580,height:326})}),e("div",{className:_t.info,children:e("div",{className:_t.data,children:t(I,{gap:.25,children:[e("h3",{className:_t.name,children:f}),e("p",{className:_t.description,children:y}),t(g,{className:_t.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:P}),!!u&&e(S,{color:"white",className:_t.volume,children:u})]})]})})}),e("div",{className:_t.addToCart,children:e(k,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(b||A)&&l)return l();s({product:n}),i(Pe,{name:f,quantity:1})},icon:Y,type:N.DEFAULT})})]})})};var gt={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",choices:"ProductDetails-module_choices__4tHaA",close:"ProductDetails-module_close__4cHZ3",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW"};const pt={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":"В заказе"}},vt=e=>{const{language:t}=pe(),n=e||t;return{t:e=>{var t;return(null===(t=pt[n])||void 0===t?void 0:t[e])||e}}},ft=()=>{const{cart:e}=st();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var yt={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 It=({isDecreaseDisabled:n=!1,quantity:r=1,size:i="md",onIncrease:a,onDecrease:l})=>t(g,{className:o(yt,{container:!0},[yt[i]]),justifyContent:"space-between",gap:0,children:[e("div",{className:o(yt,{quantityAction:!0,isDisabled:n}),onClick:l,children:e(y,{icon:F})}),e("div",{className:yt.quantityValue,children:r}),e("div",{className:yt.quantityAction,onClick:a,children:e(y,{icon:Y})})]});var Pt="ProductInCart-module_container__oSrwq",bt="ProductInCart-module_title__Vnc4l";const At=({productId:n,onModalClose:i})=>{const{setIsCartOpen:a,removeAllProductVariants:o}=st(),{t:l}=vt(),d=(e=>{const{cart:t}=st();return r(t)||!e?0:Object.values(t).filter((t=>t.productId===e)).reduce(((e,t)=>e+t.quantity),0)})(n);return d<=0?null:t(P,{className:Pt,fullWidth:!0,justifyContent:"space-between",alignItems:"center",children:[t(P.Item,{flex:1,className:bt,children:[l("In order")," (",d,")"]}),e(P.Item,{flex:0,children:t(g,{children:[e(k,{icon:K,onClick:()=>{o(n)},type:N.DANGER,tooltip:l("Remove from order")}),e(k,{icon:X,onClick:()=>{a(!0),i&&i()},type:N.SUCCESS,tooltip:l("View order")})]})})]})};var Ct={container:"ProductVariants-module_container__r059N",variantsTitle:"ProductVariants-module_variantsTitle__G3wTr",variant:"ProductVariants-module_variant__Pk6eP",focused:"ProductVariants-module_focused__tdy2R",flexWide:"ProductVariants-module_flexWide__CQO0G",slidein:"ProductVariants-module_slidein__9xYoM",fadeInOut:"ProductVariants-module_fadeInOut__NcGdX",heightAnimation:"ProductVariants-module_heightAnimation__c7ORS",fadein:"ProductVariants-module_fadein__qqdC5",floatAnimation:"ProductVariants-module_floatAnimation__Fy-NX",bottomSheet:"ProductVariants-module_bottomSheet__JVxKH",slideRightToLeft:"ProductVariants-module_slideRightToLeft__lHsqZ"};const Nt=({product:n,selectedVariant:r,focusedSection:i,onSelectVariant:l})=>{const{language:d,currency:c}=pe(),{t:m}=vt(),_=s(null),{variants:h}=n||{},p="variant"===i;return u((()=>{p&&_.current&&_.current.scrollIntoView({behavior:"smooth"})}),[i]),t(I,{className:o(Ct,{container:!0,focused:p}),gap:1,fullWidth:!0,children:[e("div",{className:Ct.variantsTitle,ref:_,children:m("Product choices")}),(h||[]).map((i=>{const{id:o}=i||{},{formattedTotalPrice:s}=(({variantId:e,currency:t="USD",language:n="en",product:r,quantity:i=1})=>{const o=nt(e,r,i);return{totalPrice:o,formattedTotalPrice:a(o,t,n)}})({variantId:o,language:d,currency:c,product:n}),{title:u}=rt(i,d);return t(g,{justifyContent:"space-between",onClick:()=>l(o),className:Ct.variant,children:[e(w,{label:u,name:"variant",onChange:()=>l(o),checked:r===o,type:L.RADIO,size:"small"}),e("div",{className:Ct.variantPrice,children:s})]},o)}))]})};var St={container:"ProductAddons-module_container__DRnT7"};const kt=({product:n,selectedAddons:r,onOptionSelect:i})=>{const{language:o,currency:l}=pe(),{addons:d}=n||{};return e(I,{className:St.container,gap:1.5,fullWidth:!0,children:(d||[]).map((n=>{const{id:d,options:c,selectType:s}=n||{},{title:u}=Fe(n,o);return t(I,{children:[e(S,{variant:"bold",children:u}),e(I,{gap:1,fullWidth:!0,children:(c||[]).map((n=>{const{id:c}=n||{},{formattedTotalPrice:u}=(({option:e,currency:t="USD",language:n="en"})=>{const{price:r}=e||{};return{totalPrice:r,formattedTotalPrice:a(r,t,n)}})({option:n,language:o,currency:l}),{title:m}=Ke(n,o),_=s===Ye.SINGLE,h=_?r[d]===c:(r[d]||[]).includes(c);return t(g,{justifyContent:"space-between",className:St.option,children:[e(w,{label:m,name:`option-${d}`,onChange:()=>i({addonId:d,optionId:c,isSingle:_,isRemove:!_&&h}),checked:h,type:_?L.RADIO:L.CHECKBOX,size:"small"}),e("div",{className:St.optionPrice,children:u})]},c)}))})]},d)}))})},wt=({product:n,onClose:o})=>{const{language:l,currency:d}=pe(),{addProduct:_,updateProduct:h}=st(),[p,v]=c(1),[f,y]=c(!1),[P,b]=c(null),[A,C]=c(null),[N,S]=c({}),w=s(null),{t:L}=vt(),D=(({productId:e,variantId:t,selectedAddons:n})=>{var i;const{cart:a}=st();return r(a)||!e?0:(null===(i=a[lt(e,t,n)])||void 0===i?void 0:i.quantity)||0})({productId:null==n?void 0:n.id,variantId:P,selectedAddons:N}),{name:R,description:j}=m((()=>Ze(n,l)),[n,l]),{formattedTotalPrice:G}=m((()=>et(n,d,l)),[n,d,l]),{formattedTotalPrice:q}=m((()=>(({product:e,variantId:t,quantity:n=1,currency:r,language:i,selectedAddons:o,noVat:l=!1})=>{const{total:d}=it({product:e,variantId:t,quantity:n,selectedAddons:o,noVat:l});return{totalPrice:d,formattedTotalPrice:a(d,r,i)}})({product:n,quantity:p,language:l,currency:d,variantId:P,selectedAddons:N})),[n,p,l,d,P,N]),V=f?0===p:1===p,E=m((()=>L(f?0===p?"Remove from order":"Update order":"Add to order")),[f,p]);u((()=>{v(D>0?D:1),y(D>0)}),[D,n]),u((()=>{b(null),S({})}),[n]);const x=e=>{-1===e&&V||v((t=>Math.max(0,t+e)))};if(r(n))return null;const{image1024:z,volume:W,variants:H,addons:B}=n,U=(null==H?void 0:H.length)>0,Q=(null==B?void 0:B.length)>0;return e("div",{className:gt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==w?void 0:w.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||o&&o()},children:e(T,{onClose:o,ref:w,noBodyPadding:!0,size:"small",content:t("div",{className:gt.content,children:[t(I,{gap:0,children:[z&&e(Ve,{src:le(z),width:1024,height:400,alt:R||"product",className:gt.image}),t(I,{className:gt.details,gap:1,children:[e("h2",{className:gt.name,children:R}),t(g,{justifyContent:"space-between",children:[e("div",{className:gt.price,children:G}),e("div",{className:gt.volume,children:W})]}),e("div",{className:gt.description,children:j})]}),(U||Q)&&t(I,{gap:0,className:gt.choices,children:[U&&e(Nt,{product:n,selectedVariant:P,focusedSection:A,onSelectVariant:b}),Q&&e(kt,{product:n,selectedAddons:N,onOptionSelect:({addonId:e,optionId:t,isSingle:n,isRemove:r=!1})=>{S((i=>{if(n)return Object.assign(Object.assign({},i),{[e]:t});const a=i[e]||[],o=r?a.filter((e=>e!==t)):[...new Set([...a,t])];return Object.assign(Object.assign({},i),{[e]:o})}))}})]})]}),e("div",{className:gt.close,children:e(k,{onClick:o,icon:Z})})]}),footer:t(I,{children:[e(At,{productId:null==n?void 0:n.id,onModalClose:o}),t(g,{className:gt.addToCart,gap:.5,children:[e(It,{isDecreaseDisabled:V,onDecrease:()=>x(-1),onIncrease:()=>x(1),quantity:p}),e(O,{className:gt.addAction,label:t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:gt.actionTitle,children:E}),e("span",{children:q})]}),onClick:()=>{var e;if((null===(e=null==n?void 0:n.variants)||void 0===e?void 0:e.length)>0&&!P)return C("variant"),void setTimeout((()=>{C(null)}),200);f?h({product:n,quantity:p,variantId:P,selectedAddons:N}):(_({product:n,quantity:p,variantId:P,selectedAddons:N}),i(Pe,{name:R,quantity:p})),o&&o()},size:"xl",fullWidth:!0})]})]})})})};var Lt="Cart-module_container__3KQtx",Tt="Cart-module_content__rkiZa",Ot={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 Dt=({actionText:n,onClick:r})=>{const i=ft(),{formattedTotalPrice:l}=(()=>{const{cart:e}=st(),{currency:t,language:n}=pe(),r=Object.values(e||{}).reduce(((e,t)=>{const{totalPrice:n}=ot(t);return e+n}),0);return{totalPrice:r,formattedTotalPrice:a(r,t,n)}})();return t(P,{className:o(Ot,{container:!0,isClickable:!!r}),justifyContent:"space-between",alignItems:"center",onClick:r,children:[e(P.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:Ot.count,children:i}),e("div",{className:Ot.actionText,children:n})]})}),e(P.Item,{className:Ot.totalPrice,flex:1,children:l})]})},Rt=()=>{const{setIsCartOpen:t}=st(),{t:n}=vt();return ft()<=0?null:e("div",{className:Lt,children:e("div",{className:Tt,children:e(Dt,{onClick:()=>t(!0),actionText:n("View order")})})})};var jt={container:"CartDrawer-module_container__zvapw",content:"CartDrawer-module_content__ELSiG"},Gt="CartItem-module_container__At7lj",qt="CartItem-module_image__D-zzG",Vt="CartItem-module_data__Lo3Fb",Et="CartItem-module_name__EksZu",xt="CartItem-module_price__yJxl6";const zt=e=>{var t;const{products:n}=pe();return(null===(t=null==n?void 0:n.find)||void 0===t?void 0:t.call(n,(({id:t})=>t===e)))||{}},Wt=({productId:t,variantId:n,min:r=1,size:i="md",selectedAddons:a})=>{const o=(({productId:e,variantId:t,selectedAddons:n})=>{const{cart:r}=st(),i=r[lt(e,t,n)];return(null==i?void 0:i.quantity)||1})({productId:t,variantId:n,selectedAddons:a}),l=zt(t),{updateProduct:d}=st();return e(It,{isDecreaseDisabled:o===r,onDecrease:()=>d({product:l,quantity:o-1,variantId:n,selectedAddons:a}),onIncrease:()=>d({product:l,quantity:o+1,variantId:n,selectedAddons:a}),quantity:o,size:i})},Ht=({item:i,product:a,language:o})=>{const{selectedAddons:l}=i||{};return e(n,{children:Object.entries(l||{}).map((([e,n])=>{const i=((e,t)=>((null==e?void 0:e.addons)||[]).find((({id:e})=>e===t))||{})(a,Number(e));if(r(i)||r(i.options)||!Array.isArray(i.options))return null;let l="";if(Array.isArray(n)){const e=i.options.filter((({id:e})=>n.includes(e)));if(r(e))return null;l=e.map((e=>{const{title:t}=Ke(e,o);return t})).filter(Boolean).join(", ")}else{const e=i.options.find((({id:e})=>e===n));if(r(e))return null;const{title:t}=Ke(e,o);l=t}const{title:d}=Fe(i,o);return t(S,{color:"muted",variant:"small",children:[d,": ",l]},e)})).filter(Boolean)})},Bt=({item:n})=>{const{productId:r,variantId:i,selectedAddons:a}=n||{},o=zt(r),l=tt(o,i),{language:d,currency:c}=pe(),{image160:s}=o,{title:u}=rt(l,d),{name:_}=m((()=>Ze(o,d)),[o,d]),{formattedTotalPrice:h}=m((()=>ot(n,c,d)),[n,c,d]);return t(g,{className:Gt,gap:1,alignItems:"flex-start",children:[s&&e(Ve,{src:le(s),alt:_||"menu",className:qt,loading:"lazy",width:80,height:45}),t("div",{className:Vt,children:[e("div",{className:Et,children:_}),t(I,{gap:0,children:[!!u&&e(S,{color:"muted",variant:"small",children:u}),e(Ht,{item:n,product:o,language:d})]}),e("div",{className:xt,children:h})]}),e(Wt,{productId:r,variantId:i,selectedAddons:a,size:"sm",min:0})]})},Ut=()=>{const{isCartOpen:n,cart:i,setIsCartOpen:a}=st(),o=s(null),{t:l}=vt(),d=r(i),c=()=>a(!1);return n?e("div",{className:jt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||c()},children:e(D,{ref:o,onClose:c,isOpen:n,title:l("Your order"),content:e("div",{className:jt.content,children:d?e((()=>t(I,{className:jt.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(S,{variant:"h2",children:l("Empty order")}),e(R,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:jt.items,children:Object.keys(i||{}).map((t=>e(Bt,{item:i[t]},t)))})}),footer:d?e(O,{label:l("Add items"),onClick:c,type:N.PRIMARY,size:"xl",fullWidth:!0}):e(Dt,{actionText:l("Subtotal")})})}):null},Qt=_((({categoryProductMap:n=[],currency:r,language:a,productBlocksRef:o,containerRef:l,onCategoryInView:d})=>{const[s,m]=c(null),[_,h]=c(at.LIST),p=[{icon:J,type:at.LIST},{icon:ee,type:at.GRID}],v=e=>{const{name:t}=Ze(e,a);i(Ie,{name:t}),m(e)};return u((()=>{const e=new IntersectionObserver((e=>{var t;const n=((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,a=t.top+t.height/2,o=Math.abs(a-n);o<i&&(i=o,r=e.target.getAttribute("data-category-id"))}})),r&&d(Number(r))}),{threshold:.1});return Object.entries(o.current||{}).forEach((([t,n])=>{n&&(n.setAttribute("data-category-id",t),e.observe(n))})),()=>{e.disconnect()}}),[o,l]),e(ct,{children:t("div",{className:He,children:[e(g,{className:Be,alignItems:"center",children:p.map((({icon:t,type:n})=>e(k,{icon:t,onClick:()=>(e=>{h(e),i(be,{name:e})})(n),type:n===_?N.PRIMARY:N.DEFAULT},n)))}),e(I,{children:(n||[]).map((n=>{const{name:i}=Ce(n,a),{id:l,products:d}=n;return t("div",{className:Ue,ref:e=>{e&&(o.current[l]=e)},"data-category-id":l,children:[e("h2",{className:Qe,children:i}),e("div",{className:Me,children:e(I,{gap:0,children:(d||[]).map((t=>_===at.GRID?e(ht,{product:t,currency:r,language:a,onClick:()=>v(t)},t.id):e(mt,{product:t,currency:r,language:a,onClick:()=>v(t)},t.id)))})})]},l)}))}),e(wt,{product:s,onClose:()=>m(null)}),e(Rt,{}),e(Ut,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));Qt.displayName="Products";var Mt="Branches-module_branches__sOuoV",$t="Branches-module_list__vYoT2",Yt="Branches-module_name__K0Z-4";const Ft=({branches:t=[],rootPath:n="",onBranchSelect:r})=>{const i=({children:t,id:i})=>r?e("div",{onClick:()=>r(i),children:t}):e("a",{href:`${n}/${i}`,children:t});return e("div",{className:Mt,children:e(j,{className:$t,children:t.map((({id:t,name:n})=>e(i,{id:t,children:e(G,{noBottomMargin:!0,children:e(P,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:Yt,children:n})})})},t)))})})},Kt=({data:a})=>{var o;const{name:l,coverImage:d,logoImage:m,branches:_=[],branchId:h,language:g,categories:p,products:v,currency:f,instagram:y,facebook:I,whatsapp:P,telegram:b,tiktok:A,rootPath:C,hostname:N,onBranchSelect:S}=a||{},k=_.length<=1,w=((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}))})(p,v),L=(()=>{var e;return k?(null===(e=null==_?void 0:_[0])||void 0===e?void 0:e.id)?_[0]:{}:_.find((e=>e.id===Number(h)))})(),T=k||!(null==L?void 0:L.name)?l:(null==L?void 0:L.name)||"",[O,D]=c(null===(o=null==p?void 0:p[0])||void 0===o?void 0:o.id),R=s({}),j=s(null),G=s(!0),{url:q,domain:V}=((e,t)=>{const n=_e.includes(e)?e:me;return{url:`https://${n}/${t||"en"}`,domain:n}})(N,g),E=e=>ne(void 0,void 0,void 0,(function*(){G.current=!1,D(e),(e=>{var t;const n=null===(t=null==R?void 0:R.current)||void 0===t?void 0:t[e];n&&(setTimeout((()=>{n.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{G.current=!0}),1e3))})(e)}));return u((()=>{(()=>{if("undefined"==typeof window)return;const e=new URLSearchParams(window.location.search),t=Number(e.get("category"));if(!t)return;const n=(p||[]).find((({id:e})=>e===t));r(n)||E(t)})()}),[]),t("div",{className:re,ref:j,children:[e(ze,{branch:L,name:T,coverImage:ce(d),logoImage:de(m),instagram:y,facebook:I,whatsapp:P,telegram:b,tiktok:A}),k||h?t(n,{children:[e(We,{categoryProductMap:w,language:g,selectedCategoryId:O,onSelectCategory:E}),e(Qt,{currency:f,language:g,productBlocksRef:R,containerRef:j,categoryProductMap:w,onCategoryInView:e=>{if(!(null==G?void 0:G.current))return;const t=((e,t,n)=>{var i;const a=null===(i=null==t?void 0:t.find)||void 0===i?void 0:i.call(t,(({id:t})=>t===e));if(r(a))return"";const{name:o}=Ce(a,n);return o})(e,p,g);i(ye,{name:t}),D(e)}})]}):e(Ft,{branches:_,onBranchSelect:S,rootPath:C}),!!N&&e("a",{rel:"noopener noreferrer",target:"_blank",href:q,className:ae,children:V})]})},Xt=({data:t})=>e(ge,{value:t,children:e(Kt,{data:t})});var Zt={};const Jt=({currentGoal:t,language:n,setGoal:r})=>{const{t:i}=vt(n),a=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,n;r(e),null===(n=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.close)||void 0===n||n.call(t)}),[r]);return e(q,{action:o(t),actionSize:"large",type:N.BORDERED_PRIMARY,closeRef:a,menu:e("div",{className:Zt.toolbarMenu,children:Ae.map((t=>e(V,{onClick:()=>l(t),children:o(t)},t)))})})},en=({data:t,isLoading:n=!1,loadingImage:r,language:i,goal:a,setGoal:o})=>{const{t:l}=vt(i);return e(G,{title:l("Events"),toolbar:e(Jt,{language:i,currentGoal:a,setGoal:o}),children:n?e(E,{image:r}):e(x,{data:t})})};export{en as Events,Xt as PublicMenu};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{isEmpty as a,trackEvent as r,priceFormatter as i,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,Column as I,Flex as P,Carousel as b,CarouselItem as A,Chip as C,UIElementType as N,Text as S,IconButton as k,Input as w,InputType as L,Modal as T,Button as O,Drawer as D,Description as R,Container as G,Card as j,DropDown as q,DropDownMenuItem as E,Loading as V,BarChart as x}from"@sorocraft/ui";import{Phone as z,Whatsapp as H,Instagram as W,Telegram as B,Tiktok as M,Facebook as U,Wifi as Q,MarkerPin as $,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 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}function ne(e,t,n,a){return new(n||(n=Promise))((function(r,i){function o(e){try{d(a.next(e))}catch(e){i(e)}}function l(e){try{d(a.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}d((a=a.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var ae="PublicMenu-module_container__QLN6U",re="PublicMenu-module_categories__Iy6NC",ie="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,n)=>se.charAt(e>>2)+se.charAt((3&e)<<4|t>>4)+se.charAt((15&t)<<2|n>>6)+se.charAt(63&n),me="restaround.co",_e=[me,"restaround.az","restaround.ee","restaround.nl"],he=l({}),ge=({children:t,value:n})=>{const r=a(n)?{}:n;return r.currency||(r.currency="AZN"),r.language||(r.language="az"),e(he.Provider,{value:a(n)?{}:n,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`,Ae=[fe,ye,Ie,Pe],Ce=(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)))||{}};var Ne="Header-module_container__tenlF",Se="Header-module_cover__BAWZK",ke="Header-module_content__Gx4Al",we="Header-module_logo__4MTCm",Le="Header-module_info__IchYA",Te="Header-module_name__30wyw",Oe="Header-module_address__WOxXc",De="Header-module_addressText__lUszI",Re="Header-module_social__AoP0z",Ge="Header-module_links__EeQxg",je="Header-module_wifiPassword__VWBTa",qe="Header-module_wifiPasswordIcon__Ukn3D";const Ee=t=>{const{priority:n,blurDataURL:a,quality:r,placeholder:i,fetchPriority:o}=t,l=te(t,["priority","blurDataURL","quality","placeholder","fetchPriority"]),{imageTag:d}=ve()||{};if(d){return e(d,Object.assign({},t,{quality:t.quality||100,placeholder:"blur",blurDataURL:(c=235,s=59,u=90,`data:image/gif;base64,R0lGODlhAQABAPAA${ue(0,c,s)+ue(u,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`)}))}var c,s,u;return e("img",Object.assign({},l))};var Ve={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 xe=()=>{var n;const{language:a,languages:r,onLanguageSelect:i}=ve(),[o,l]=c(!1),d=(null==r?void 0:r.length)>1,s=(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 d?e("div",{className:Ve.container,onClick:()=>l(!o),children:t(g,{alignItems:"center",gap:0,children:[e(g,{alignItems:"center",className:v(Ve,{options:!0,isOpen:o}),children:s.map((({code:t})=>e("img",{src:u(t),className:Ve.option,onClick:()=>(e=>{i&&i(e)})(t),alt:t},t)))}),e("img",{src:u(a),alt:a||"",className:Ve.currentLanguage})]})}):null},ze=({branch:n,coverImage:r,logoImage:i,name:o,instagram:l,facebook:d,whatsapp:c,telegram:s,tiktok:u})=>{const{address:m,latitude:_,longitude:h,phone:v,wifiPassword:b}=n||{},A=a(n),C=`https://www.google.com/maps/place/${_},${h}`;return t("div",{className:Ne,children:[e(Ee,{src:r,alt:o,className:Se,width:1024,height:400,priority:!0,sizes:"100vw",fetchPriority:"high",loading:"eager"}),e("div",{className:ke,children:e(A?()=>t(I,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e(Ee,{src:i,alt:o,className:we,width:96,height:96}),e("div",{className:Le,children:e("h1",{className:Te,children:o})})]}):()=>t(P,{direction:"row",gap:1,alignItems:"center",fullWidth:!0,children:[e(P.Item,{children:e(Ee,{src:i,alt:o,className:we,width:96,height:96})}),e(P.Item,{shrink:!0,className:Le,children:t(I,{gap:.25,children:[e("h1",{className:Te,children:o}),e("a",{className:Oe,href:C,target:"_blank",rel:"noopener noreferrer",children:t(g,{alignItems:"center",gap:.5,children:[e(y,{icon:$,theme:"dark"}),e("span",{className:De,children:m})]})})]})})]}),{})}),e(xe,{}),!A&&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:z,href:`tel:+${v}`,size:"sm",shape:"circle",theme:"light"}),!!c&&e(p,{icon:H,href:`https://wa.me/${c}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!l&&e(p,{icon:W,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:M,href:u,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!d&&e(p,{icon:U,href:d,size:"sm",shape:"circle",theme:"light",target:"_blank"}),!!b&&e(f,{hint:b,children:e("div",{className:je,children:e(y,{icon:Q,size:"sm",className:qe})})})]})})})})]})},He=({categoryProductMap:t=[],language:n,selectedCategoryId:a,onSelectCategory:i})=>{const o=s({}),l=s(null);return u((()=>{a&&(()=>{var e;const t=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e[a];if(!t||!l.current)return;const n=l.current.clientWidth,r=t.offsetLeft-n/2+t.offsetWidth/2;l.current.scrollTo({left:r,behavior:"smooth"})})()}),[a]),e("div",{className:re,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===n))||{};return e(A,{children:e(C,{onClick:()=>((e,t)=>{e!==a&&(r(fe,{name:t}),i(e))})(t,d),type:N.BORDERED_PRIMARY,active:t===a,children:e("div",{ref:e=>{e&&(o.current[t]=e)},children:d})})},t)}))})})};var We="Products-module_container__bF2LF",Be="Products-module_view__l857X",Me="Products-module_products__AoDrY",Ue="Products-module_category__Sp7dE",Qe="Products-module_list__LH4v5";const $e=(e=0,t=1,n=0)=>e*t*(1+n/100);var Ye;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}(Ye||(Ye={}));const Fe=(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)))||{}},Ke=(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)))||{}},Xe=(e,t)=>{var n;return(null===(n=((null==e?void 0:e.options)||[]).find((({id:e})=>e===t)))||void 0===n?void 0:n.price)||0},Ze=(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)))||{}},Je=(e,t=1)=>{const{price:n=0,vat:a=0}=e||{};return $e(n,t,a)},et=(e,t,n,a=1)=>{const r=Je(e,a);return{totalPrice:r,formattedTotalPrice:i(r,t,n)}},tt=(e,t)=>{var n,a;return(null===(a=null===(n=null==e?void 0:e.variants)||void 0===n?void 0:n.find)||void 0===a?void 0:a.call(n,(e=>e.id===t)))||{}},nt=(e,t,n)=>{const a=tt(t,e),{vat:r}=t||{},{price:i}=a||{};return $e(i,n,r)},at=(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)))||{}},rt=({product:e,variantId:t,quantity:n=1,selectedAddons:r,noVat:i=!1})=>{if(a(e))return{price:0,optionsPrice:0,total:0};const o=Object.assign(Object.assign({},e),{vat:i?0:e.vat}),l=((e,t={},n)=>((null==e?void 0:e.addons)||[]).filter((e=>Object.prototype.hasOwnProperty.call(t,e.id))).reduce(((e,n)=>{const{id:a,selectType:r}=n;if(r===Ye.SINGLE){const r=t[a];return e+Xe(n,r)}return e+(t[a]||[]).reduce(((e,t)=>e+Xe(n,t)),0)}),0)*n)(o,r,n),d=t?nt(t,o,n):Je(o,n);return{price:d,optionsPrice:l,total:d+l}};var it;!function(e){e.LIST="list",e.GRID="grid"}(it||(it={}));const ot=(e,t="USD",n="en")=>{const{price:a,vat:r,quantity:o,optionsPrice:l}=e||{},d=$e(a,o,r)+l*o;return{totalPrice:d,formattedTotalPrice:i(d,t,n)}},lt=(e,t,n)=>{if(!e)throw new Error("Product ID is required");let a=`${e}`;t&&(a+=`-${t}`);const r=Object.entries(n||{}).map((([e,t])=>{if(!e||!t)return null;const n=Array.isArray(t)?t.filter(Boolean).join("-"):`${t}`;return n?`${e}-${n}`:null})).filter(Boolean).join("-");return r&&(a+=`-${r}`),a},dt=l({cart:{},isCartOpen:!1,addProduct:()=>{},updateProduct:()=>{},setIsCartOpen:()=>{},removeAllProductVariants:()=>{}}),ct=({children:t})=>{const[n,r]=c({}),[i,o]=c(!1),l=({product:e,quantity:t,isAddOperation:n,variantId:i,selectedAddons:o})=>{if(a(e)||t<0)return;const{id:l,vat:d=0}=e,c=lt(l,i,o),{price:s,optionsPrice:u}=rt({product:e,variantId:i,quantity:1,selectedAddons:o,noVat:!0});r((e=>{const a=e[c],r=n?((null==a?void 0:a.quantity)||0)+t:t;if(r<=0){const t=e,n=c;t[n];return te(t,["symbol"==typeof n?n:n+""])}return Object.assign(Object.assign({},e),{[c]:{productId:l,price:s,optionsPrice:u,quantity:r,vat:d,variantId:i,selectedAddons:o}})}))},d=({product:e,quantity:t=1,variantId:n,selectedAddons:a})=>l({product:e,quantity:t,variantId:n,selectedAddons:a,isAddOperation:!0}),s=({product:e,quantity:t=1,variantId:n,selectedAddons:a})=>l({product:e,quantity:t,variantId:n,selectedAddons:a,isAddOperation:!1}),u=e=>{if(!e||a(n))return;const t=Object.entries(n).reduce(((t,[n,a])=>(a.productId!==e&&(t[n]=a),t)),{});r(t)},_=m((()=>({cart:n,isCartOpen:i,addProduct:d,updateProduct:s,setIsCartOpen:o,removeAllProductVariants:u})),[n,i]);return e(dt.Provider,{value:_,children:t})},st=()=>d(dt);var ut={container:"ProductsListItem-module_container__i9tFs",isClickable:"ProductsListItem-module_isClickable__iHHdI",info:"ProductsListItem-module_info__4s4j2",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",price:"ProductsListItem-module_price__V1GRM",image:"ProductsListItem-module_image__h6Wbi",notAvailable:"ProductsListItem-module_notAvailable__TeMCr",addToCart:"ProductsListItem-module_addToCart__WXrQZ",noImage:"ProductsListItem-module_noImage__G4E-a",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 mt={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ə","Not available":"Mövcud deyil"},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","Not available":"Mevcut değil"},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","Not available":"Niet beschikbaar"},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","Not available":"Ei ole saadaval"},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":"В заказе","Not available":"Не доступен"}},_t=e=>{const{language:t}=ve(),n=e||t;return{t:e=>{var t;return(null===(t=mt[n])||void 0===t?void 0:t[e])||e}}},ht=({product:n,currency:a,language:i,onClick:l})=>{var d,c;const{addProduct:s}=st(),{image160:u,volume:_,available:h}=n||{},{name:v,description:p}=m((()=>Ze(n,i)),[n,i]),{formattedTotalPrice:f}=m((()=>et(n,a,i)),[n,a,i]),{t:y}=_t(),P=(null===(d=null==n?void 0:n.variants)||void 0===d?void 0:d.length)>0,b=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0,A=!!u;return t("div",{className:o(ut,{container:!0,isClickable:!!l,noImage:!A}),onClick:l,children:[t(g,{justifyContent:"space-between",gap:0,children:[e("div",{className:ut.info,children:t(I,{gap:.25,children:[e("h3",{className:ut.name,children:v}),e("p",{className:ut.description,children:p}),t(g,{className:ut.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:f}),!!_&&e(S,{color:"muted",children:_})]}),!h&&e(S,{variant:"small",color:"danger",className:ut.notAvailableText,children:y("Not available")})]})}),A&&e(Ee,{src:le(u),alt:v||"menu",className:o(ut,{image:!0,notAvailable:!h}),loading:"lazy",width:160,height:90})]}),h&&e("div",{className:ut.addToCart,children:e(k,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(P||b)&&l)return l();s({product:n}),r(Pe,{name:v,quantity:1})},icon:Y,type:N.DEFAULT})})]})};var gt={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",notAvailable:"ProductsGridItem-module_notAvailable__i4-HA",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 vt=({product:n,currency:a,language:i,onClick:l})=>{var d,c;const{addProduct:s}=st(),{volume:u,image580:_,image160:h,image1024:v,available:p}=n||{},f=_||v||h,{name:y,description:P}=m((()=>Ze(n,i)),[n,i]),{formattedTotalPrice:b}=m((()=>et(n,a,i)),[n,a,i]),{t:A}=_t(),C=(null===(d=null==n?void 0:n.variants)||void 0===d?void 0:d.length)>0,w=(null===(c=null==n?void 0:n.addons)||void 0===c?void 0:c.length)>0;return e("div",{className:gt.container,children:t("div",{className:o(gt,{content:!0,isClickable:!!l,noImage:!f}),onClick:l,children:[f&&e("div",{className:gt.imageContainer,children:e(Ee,{src:le(f),alt:y||"menu",className:o(gt,{image:!0,notAvailable:!p}),loading:"lazy",width:580,height:326})}),e("div",{className:gt.info,children:e("div",{className:gt.data,children:t(I,{gap:.25,children:[e("h3",{className:gt.name,children:y}),e("p",{className:gt.description,children:P}),t(g,{className:gt.price,gap:.5,fullWidth:!0,justifyContent:"space-between",children:[e("span",{children:b}),!!u&&e(S,{color:"white",className:gt.volume,children:u})]}),!p&&e(S,{color:"white",variant:"small",className:gt.notAvailableText,children:A("Not available")})]})})}),p&&e("div",{className:gt.addToCart,children:e(k,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),(C||w)&&l)return l();s({product:n}),r(Pe,{name:y,quantity:1})},icon:Y,type:N.DEFAULT})})]})})};var pt={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",choices:"ProductDetails-module_choices__4tHaA",close:"ProductDetails-module_close__4cHZ3",addAction:"ProductDetails-module_addAction__o4T5R",actionTitle:"ProductDetails-module_actionTitle__NIJGW"};const ft=()=>{const{cart:e}=st();return Object.values(e||{}).reduce(((e,t)=>e+t.quantity),0)};var yt={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 It=({isDecreaseDisabled:n=!1,quantity:a=1,size:r="md",onIncrease:i,onDecrease:l})=>t(g,{className:o(yt,{container:!0},[yt[r]]),justifyContent:"space-between",gap:0,children:[e("div",{className:o(yt,{quantityAction:!0,isDisabled:n}),onClick:l,children:e(y,{icon:F})}),e("div",{className:yt.quantityValue,children:a}),e("div",{className:yt.quantityAction,onClick:i,children:e(y,{icon:Y})})]});var Pt="ProductInCart-module_container__oSrwq",bt="ProductInCart-module_title__Vnc4l";const At=({productId:n,onModalClose:r})=>{const{setIsCartOpen:i,removeAllProductVariants:o}=st(),{t:l}=_t(),d=(e=>{const{cart:t}=st();return a(t)||!e?0:Object.values(t).filter((t=>t.productId===e)).reduce(((e,t)=>e+t.quantity),0)})(n);return d<=0?null:t(P,{className:Pt,fullWidth:!0,justifyContent:"space-between",alignItems:"center",children:[t(P.Item,{flex:1,className:bt,children:[l("In order")," (",d,")"]}),e(P.Item,{flex:0,children:t(g,{children:[e(k,{icon:K,onClick:()=>{o(n)},type:N.DANGER,tooltip:l("Remove from order")}),e(k,{icon:X,onClick:()=>{i(!0),r&&r()},type:N.SUCCESS,tooltip:l("View order")})]})})]})};var Ct={container:"ProductVariants-module_container__r059N",variantsTitle:"ProductVariants-module_variantsTitle__G3wTr",variant:"ProductVariants-module_variant__Pk6eP",focused:"ProductVariants-module_focused__tdy2R",flexWide:"ProductVariants-module_flexWide__CQO0G",slidein:"ProductVariants-module_slidein__9xYoM",fadeInOut:"ProductVariants-module_fadeInOut__NcGdX",heightAnimation:"ProductVariants-module_heightAnimation__c7ORS",fadein:"ProductVariants-module_fadein__qqdC5",floatAnimation:"ProductVariants-module_floatAnimation__Fy-NX",bottomSheet:"ProductVariants-module_bottomSheet__JVxKH",slideRightToLeft:"ProductVariants-module_slideRightToLeft__lHsqZ"};const Nt=({product:n,selectedVariant:a,focusedSection:r,onSelectVariant:l})=>{const{language:d,currency:c}=ve(),{t:m}=_t(),_=s(null),{variants:h}=n||{},v="variant"===r;return u((()=>{v&&_.current&&_.current.scrollIntoView({behavior:"smooth"})}),[r]),t(I,{className:o(Ct,{container:!0,focused:v}),gap:1,fullWidth:!0,children:[e("div",{className:Ct.variantsTitle,ref:_,children:m("Product choices")}),(h||[]).map((r=>{const{id:o}=r||{},{formattedTotalPrice:s}=(({variantId:e,currency:t="USD",language:n="en",product:a,quantity:r=1})=>{const o=nt(e,a,r);return{totalPrice:o,formattedTotalPrice:i(o,t,n)}})({variantId:o,language:d,currency:c,product:n}),{title:u}=at(r,d);return t(g,{justifyContent:"space-between",onClick:()=>l(o),className:Ct.variant,children:[e(w,{label:u,name:"variant",onChange:()=>l(o),checked:a===o,type:L.RADIO,size:"small"}),e("div",{className:Ct.variantPrice,children:s})]},o)}))]})};var St={container:"ProductAddons-module_container__DRnT7"};const kt=({product:n,selectedAddons:a,onOptionSelect:r})=>{const{language:o,currency:l}=ve(),{addons:d}=n||{};return e(I,{className:St.container,gap:1.5,fullWidth:!0,children:(d||[]).map((n=>{const{id:d,options:c,selectType:s}=n||{},{title:u}=Fe(n,o);return t(I,{children:[e(S,{variant:"bold",children:u}),e(I,{gap:1,fullWidth:!0,children:(c||[]).map((n=>{const{id:c}=n||{},{formattedTotalPrice:u}=(({option:e,currency:t="USD",language:n="en"})=>{const{price:a}=e||{};return{totalPrice:a,formattedTotalPrice:i(a,t,n)}})({option:n,language:o,currency:l}),{title:m}=Ke(n,o),_=s===Ye.SINGLE,h=_?a[d]===c:(a[d]||[]).includes(c);return t(g,{justifyContent:"space-between",className:St.option,children:[e(w,{label:m,name:`option-${d}`,onChange:()=>r({addonId:d,optionId:c,isSingle:_,isRemove:!_&&h}),checked:h,type:_?L.RADIO:L.CHECKBOX,size:"small"}),e("div",{className:St.optionPrice,children:u})]},c)}))})]},d)}))})},wt=({product:n,onClose:o})=>{const{language:l,currency:d}=ve(),{addProduct:_,updateProduct:h}=st(),[v,p]=c(1),[f,y]=c(!1),[P,b]=c(null),[A,C]=c(null),[N,S]=c({}),w=s(null),{t:L}=_t(),D=(({productId:e,variantId:t,selectedAddons:n})=>{var r;const{cart:i}=st();return a(i)||!e?0:(null===(r=i[lt(e,t,n)])||void 0===r?void 0:r.quantity)||0})({productId:null==n?void 0:n.id,variantId:P,selectedAddons:N}),{name:R,description:G}=m((()=>Ze(n,l)),[n,l]),{formattedTotalPrice:j}=m((()=>et(n,d,l)),[n,d,l]),{formattedTotalPrice:q}=m((()=>(({product:e,variantId:t,quantity:n=1,currency:a,language:r,selectedAddons:o,noVat:l=!1})=>{const{total:d}=rt({product:e,variantId:t,quantity:n,selectedAddons:o,noVat:l});return{totalPrice:d,formattedTotalPrice:i(d,a,r)}})({product:n,quantity:v,language:l,currency:d,variantId:P,selectedAddons:N})),[n,v,l,d,P,N]),E=f?0===v:1===v,V=m((()=>L(f?0===v?"Remove from order":"Update order":"Add to order")),[f,v]);u((()=>{p(D>0?D:1),y(D>0)}),[D,n]),u((()=>{b(null),S({})}),[n]);const x=e=>{-1===e&&E||p((t=>Math.max(0,t+e)))};if(a(n))return null;const{image1024:z,volume:H,variants:W,addons:B,available:M}=n,U=(null==W?void 0:W.length)>0,Q=(null==B?void 0:B.length)>0;return e("div",{className:pt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==w?void 0:w.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||o&&o()},children:e(T,{onClose:o,ref:w,noBodyPadding:!0,size:"small",content:t("div",{className:pt.content,children:[t(I,{gap:0,children:[z&&e(Ee,{src:le(z),width:1024,height:400,alt:R||"product",className:pt.image}),t(I,{className:pt.details,gap:1,children:[e("h2",{className:pt.name,children:R}),t(g,{justifyContent:"space-between",children:[e("div",{className:pt.price,children:j}),e("div",{className:pt.volume,children:H})]}),e("div",{className:pt.description,children:G})]}),(U||Q)&&t(I,{gap:0,className:pt.choices,children:[U&&e(Nt,{product:n,selectedVariant:P,focusedSection:A,onSelectVariant:b}),Q&&e(kt,{product:n,selectedAddons:N,onOptionSelect:({addonId:e,optionId:t,isSingle:n,isRemove:a=!1})=>{S((r=>{if(n)return Object.assign(Object.assign({},r),{[e]:t});const i=r[e]||[],o=a?i.filter((e=>e!==t)):[...new Set([...i,t])];return Object.assign(Object.assign({},r),{[e]:o})}))}})]})]}),e("div",{className:pt.close,children:e(k,{onClick:o,icon:Z})})]}),footer:t(I,{children:[e(At,{productId:null==n?void 0:n.id,onModalClose:o}),t(g,{className:pt.addToCart,gap:.5,children:[e(It,{isDecreaseDisabled:E,onDecrease:()=>x(-1),onIncrease:()=>x(1),quantity:v}),e(O,{className:pt.addAction,label:M?t(g,{fullWidth:!0,justifyContent:"space-between",children:[e("span",{className:pt.actionTitle,children:V}),e("span",{children:q})]}):L("Not available"),onClick:()=>{var e;if((null===(e=null==n?void 0:n.variants)||void 0===e?void 0:e.length)>0&&!P)return C("variant"),void setTimeout((()=>{C(null)}),200);f?h({product:n,quantity:v,variantId:P,selectedAddons:N}):(_({product:n,quantity:v,variantId:P,selectedAddons:N}),r(Pe,{name:R,quantity:v})),o&&o()},size:"xl",fullWidth:!0,disabled:!M})]})]})})})};var Lt="Cart-module_container__3KQtx",Tt="Cart-module_content__rkiZa",Ot={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 Dt=({actionText:n,onClick:a})=>{const r=ft(),{formattedTotalPrice:l}=(()=>{const{cart:e}=st(),{currency:t,language:n}=ve(),a=Object.values(e||{}).reduce(((e,t)=>{const{totalPrice:n}=ot(t);return e+n}),0);return{totalPrice:a,formattedTotalPrice:i(a,t,n)}})();return t(P,{className:o(Ot,{container:!0,isClickable:!!a}),justifyContent:"space-between",alignItems:"center",onClick:a,children:[e(P.Item,{flex:1,children:t(g,{alignItems:"center",children:[e("div",{className:Ot.count,children:r}),e("div",{className:Ot.actionText,children:n})]})}),e(P.Item,{className:Ot.totalPrice,flex:1,children:l})]})},Rt=()=>{const{setIsCartOpen:t}=st(),{t:n}=_t();return ft()<=0?null:e("div",{className:Lt,children:e("div",{className:Tt,children:e(Dt,{onClick:()=>t(!0),actionText:n("View order")})})})};var Gt={container:"CartDrawer-module_container__zvapw",content:"CartDrawer-module_content__ELSiG"},jt="CartItem-module_container__At7lj",qt="CartItem-module_image__D-zzG",Et="CartItem-module_data__Lo3Fb",Vt="CartItem-module_name__EksZu",xt="CartItem-module_price__yJxl6";const zt=e=>{var t;const{products:n}=ve();return(null===(t=null==n?void 0:n.find)||void 0===t?void 0:t.call(n,(({id:t})=>t===e)))||{}},Ht=({productId:t,variantId:n,min:a=1,size:r="md",selectedAddons:i})=>{const o=(({productId:e,variantId:t,selectedAddons:n})=>{const{cart:a}=st(),r=a[lt(e,t,n)];return(null==r?void 0:r.quantity)||1})({productId:t,variantId:n,selectedAddons:i}),l=zt(t),{updateProduct:d}=st();return e(It,{isDecreaseDisabled:o===a,onDecrease:()=>d({product:l,quantity:o-1,variantId:n,selectedAddons:i}),onIncrease:()=>d({product:l,quantity:o+1,variantId:n,selectedAddons:i}),quantity:o,size:r})},Wt=({item:r,product:i,language:o})=>{const{selectedAddons:l}=r||{};return e(n,{children:Object.entries(l||{}).map((([e,n])=>{const r=((e,t)=>((null==e?void 0:e.addons)||[]).find((({id:e})=>e===t))||{})(i,Number(e));if(a(r)||a(r.options)||!Array.isArray(r.options))return null;let l="";if(Array.isArray(n)){const e=r.options.filter((({id:e})=>n.includes(e)));if(a(e))return null;l=e.map((e=>{const{title:t}=Ke(e,o);return t})).filter(Boolean).join(", ")}else{const e=r.options.find((({id:e})=>e===n));if(a(e))return null;const{title:t}=Ke(e,o);l=t}const{title:d}=Fe(r,o);return t(S,{color:"muted",variant:"small",children:[d,": ",l]},e)})).filter(Boolean)})},Bt=({item:n})=>{const{productId:a,variantId:r,selectedAddons:i}=n||{},o=zt(a),l=tt(o,r),{language:d,currency:c}=ve(),{image160:s}=o,{title:u}=at(l,d),{name:_}=m((()=>Ze(o,d)),[o,d]),{formattedTotalPrice:h}=m((()=>ot(n,c,d)),[n,c,d]);return t(g,{className:jt,gap:1,alignItems:"flex-start",children:[s&&e(Ee,{src:le(s),alt:_||"menu",className:qt,loading:"lazy",width:80,height:45}),t("div",{className:Et,children:[e("div",{className:Vt,children:_}),t(I,{gap:0,children:[!!u&&e(S,{color:"muted",variant:"small",children:u}),e(Wt,{item:n,product:o,language:d})]}),e("div",{className:xt,children:h})]}),e(Ht,{productId:a,variantId:r,selectedAddons:i,size:"sm",min:0})]})},Mt=()=>{const{isCartOpen:n,cart:r,setIsCartOpen:i}=st(),o=s(null),{t:l}=_t(),d=a(r),c=()=>i(!1);return n?e("div",{className:Gt.container,onClick:e=>{var t,n;(null===(n=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,null==e?void 0:e.target))||c()},children:e(D,{ref:o,onClose:c,isOpen:n,title:l("Your order"),content:e("div",{className:Gt.content,children:d?e((()=>t(I,{className:Gt.noItems,fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",gap:0,children:[e(S,{variant:"h2",children:l("Empty order")}),e(R,{text:l("You don't have any items in your order")})]})),{}):e("div",{className:Gt.items,children:Object.keys(r||{}).map((t=>e(Bt,{item:r[t]},t)))})}),footer:d?e(O,{label:l("Add items"),onClick:c,type:N.PRIMARY,size:"xl",fullWidth:!0}):e(Dt,{actionText:l("Subtotal")})})}):null},Ut=_((({categoryProductMap:n=[],currency:a,language:i,productBlocksRef:o,containerRef:l,onCategoryInView:d})=>{const[s,m]=c(null),[_,h]=c(it.LIST),v=[{icon:J,type:it.LIST},{icon:ee,type:it.GRID}],p=e=>{const{name:t}=Ze(e,i);r(Ie,{name:t}),m(e)};return u((()=>{const e=new IntersectionObserver((e=>{var t;const n=((null===(t=null==l?void 0:l.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&&d(Number(a))}),{threshold:.1});return Object.entries(o.current||{}).forEach((([t,n])=>{n&&(n.setAttribute("data-category-id",t),e.observe(n))})),()=>{e.disconnect()}}),[o,l]),e(ct,{children:t("div",{className:We,children:[e(g,{className:Be,alignItems:"center",children:v.map((({icon:t,type:n})=>e(k,{icon:t,onClick:()=>(e=>{h(e),r(be,{name:e})})(n),type:n===_?N.PRIMARY:N.DEFAULT},n)))}),e(I,{children:(n||[]).map((n=>{const{name:r}=Ce(n,i),{id:l,products:d}=n;return t("div",{className:Me,ref:e=>{e&&(o.current[l]=e)},"data-category-id":l,children:[e("h2",{className:Ue,children:r}),e("div",{className:Qe,children:e(I,{gap:0,children:(d||[]).map((t=>_===it.GRID?e(vt,{product:t,currency:a,language:i,onClick:()=>p(t)},t.id):e(ht,{product:t,currency:a,language:i,onClick:()=>p(t)},t.id)))})})]},l)}))}),e(wt,{product:s,onClose:()=>m(null)}),e(Rt,{}),e(Mt,{})]})})}),((e,t)=>e.categoryProductMap===t.categoryProductMap&&e.currency===t.currency&&e.language===t.language));Ut.displayName="Products";var Qt="Branches-module_branches__sOuoV",$t="Branches-module_list__vYoT2",Yt="Branches-module_name__K0Z-4";const Ft=({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:Qt,children:e(G,{className:$t,children:t.map((({id:t,name:n})=>e(r,{id:t,children:e(j,{noBottomMargin:!0,children:e(P,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e("h2",{className:Yt,children:n})})})},t)))})})},Kt=({data:i})=>{var o;const{name:l,coverImage:d,logoImage:m,branches:_=[],branchId:h,language:g,categories:v,products:p,currency:f,instagram:y,facebook:I,whatsapp:P,telegram:b,tiktok:A,rootPath:C,hostname:N,onBranchSelect:S}=i||{},k=_.length<=1,w=((e,t)=>{const n=t.reduce(((e,t)=>{if(!t.visible)return e;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}))})(v,p),L=(()=>{var e;return k?(null===(e=null==_?void 0:_[0])||void 0===e?void 0:e.id)?_[0]:{}:_.find((e=>e.id===Number(h)))})(),T=k||!(null==L?void 0:L.name)?l:(null==L?void 0:L.name)||"",[O,D]=c(null===(o=null==v?void 0:v[0])||void 0===o?void 0:o.id),R=s({}),G=s(null),j=s(!0),{url:q,domain:E}=((e,t)=>{const n=_e.includes(e)?e:me;return{url:`https://${n}/${t||"en"}`,domain:n}})(N,g),V=e=>ne(void 0,void 0,void 0,(function*(){j.current=!1,D(e),(e=>{var t;const n=null===(t=null==R?void 0:R.current)||void 0===t?void 0:t[e];n&&(setTimeout((()=>{n.scrollIntoView({behavior:"smooth",block:"start"})}),100),setTimeout((()=>{j.current=!0}),1e3))})(e)}));return u((()=>{(()=>{if("undefined"==typeof window)return;const e=new URLSearchParams(window.location.search),t=Number(e.get("category"));if(!t)return;const n=(v||[]).find((({id:e})=>e===t));a(n)||V(t)})()}),[]),t("div",{className:ae,ref:G,children:[e(ze,{branch:L,name:T,coverImage:ce(d),logoImage:de(m),instagram:y,facebook:I,whatsapp:P,telegram:b,tiktok:A}),k||h?t(n,{children:[e(He,{categoryProductMap:w,language:g,selectedCategoryId:O,onSelectCategory:V}),e(Ut,{currency:f,language:g,productBlocksRef:R,containerRef:G,categoryProductMap:w,onCategoryInView:e=>{if(!(null==j?void 0:j.current))return;const t=((e,t,n)=>{var r;const i=null===(r=null==t?void 0:t.find)||void 0===r?void 0:r.call(t,(({id:t})=>t===e));if(a(i))return"";const{name:o}=Ce(i,n);return o})(e,v,g);r(ye,{name:t}),D(e)}})]}):e(Ft,{branches:_,onBranchSelect:S,rootPath:C}),!!N&&e("a",{rel:"noopener noreferrer",target:"_blank",href:q,className:ie,children:E})]})},Xt=({data:t})=>e(ge,{value:t,children:e(Kt,{data:t})});var Zt={};const Jt=({currentGoal:t,language:n,setGoal:a})=>{const{t:r}=_t(n),i=s({}),o=e=>{switch(e){case ye:return r("Scrolled to Category");case fe:return r("Category Selected");case Ie:return r("Product Details");case Pe:return r("Product Added to Cart");default:return""}},l=h((e=>{var t,n;a(e),null===(n=null===(t=null==i?void 0:i.current)||void 0===t?void 0:t.close)||void 0===n||n.call(t)}),[a]);return e(q,{action:o(t),actionSize:"large",type:N.BORDERED_PRIMARY,closeRef:i,menu:e("div",{className:Zt.toolbarMenu,children:Ae.map((t=>e(E,{onClick:()=>l(t),children:o(t)},t)))})})},en=({data:t,isLoading:n=!1,loadingImage:a,language:r,goal:i,setGoal:o})=>{const{t:l}=_t(r);return e(j,{title:l("Events"),toolbar:e(Jt,{language:r,currentGoal:i,setGoal:o}),children:n?e(V,{image:a}):e(x,{data:t})})};export{en as Events,Xt as PublicMenu};
2
2
  //# sourceMappingURL=index.esm.js.map