@orderingstack/front-hooks 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var F=require("react"),On=require("@orderingstack/ordering-core-react");function Re(e,t){const r=F.useRef(),[n,a]=F.useState(null);return F.useEffect(()=>{r.current=e},[e]),F.useEffect(()=>{function i(){var s;(s=r.current)==null||s.call(r)}if(t!==null){const s=setInterval(i,t);return a(s),()=>{a(null),clearInterval(s)}}},[t]),()=>{n&&clearInterval(n)}}var X=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Sn=Object.prototype;function wn(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Sn;return e===r}var je=wn;function In(e,t){return function(r){return e(t(r))}}var Cr=In,Dn=Cr,Cn=Dn(Object.keys,Object),Ln=Cn,Rn=je,jn=Ln,Pn=Object.prototype,Nn=Pn.hasOwnProperty;function xn(e){if(!Rn(e))return jn(e);var t=[];for(var r in Object(e))Nn.call(e,r)&&r!="constructor"&&t.push(r);return t}var Lr=xn,Mn=typeof X=="object"&&X&&X.Object===Object&&X,Rr=Mn,Un=Rr,Bn=typeof self=="object"&&self&&self.Object===Object&&self,Fn=Un||Bn||Function("return this")(),K=Fn,Hn=K,Yn=Hn.Symbol,Pe=Yn,wt=Pe,jr=Object.prototype,Gn=jr.hasOwnProperty,Vn=jr.toString,de=wt?wt.toStringTag:void 0;function Wn(e){var t=Gn.call(e,de),r=e[de];try{e[de]=void 0;var n=!0}catch{}var a=Vn.call(e);return n&&(t?e[de]=r:delete e[de]),a}var Kn=Wn,qn=Object.prototype,zn=qn.toString;function kn(e){return zn.call(e)}var Jn=kn,It=Pe,Zn=Kn,Xn=Jn,Qn="[object Null]",ea="[object Undefined]",Dt=It?It.toStringTag:void 0;function ta(e){return e==null?e===void 0?ea:Qn:Dt&&Dt in Object(e)?Zn(e):Xn(e)}var Ne=ta;function ra(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ge=ra,na=Ne,aa=ge,ia="[object AsyncFunction]",sa="[object Function]",oa="[object GeneratorFunction]",ua="[object Proxy]";function fa(e){if(!aa(e))return!1;var t=na(e);return t==sa||t==oa||t==ia||t==ua}var Pr=fa,ca=K,la=ca["__core-js_shared__"],ha=la,We=ha,Ct=function(){var e=/[^.]+$/.exec(We&&We.keys&&We.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function da(e){return!!Ct&&Ct in e}var va=da,pa=Function.prototype,ga=pa.toString;function $a(e){if(e!=null){try{return ga.call(e)}catch{}try{return e+""}catch{}}return""}var Nr=$a,ya=Pr,ma=va,ba=ge,_a=Nr,Aa=/[\\^$.*+?()[\]{}|]/g,Ea=/^\[object .+?Constructor\]$/,Ta=Function.prototype,Oa=Object.prototype,Sa=Ta.toString,wa=Oa.hasOwnProperty,Ia=RegExp("^"+Sa.call(wa).replace(Aa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Da(e){if(!ba(e)||ma(e))return!1;var t=ya(e)?Ia:Ea;return t.test(_a(e))}var Ca=Da;function La(e,t){return e==null?void 0:e[t]}var Ra=La,ja=Ca,Pa=Ra;function Na(e,t){var r=Pa(e,t);return ja(r)?r:void 0}var Q=Na,xa=Q,Ma=K,Ua=xa(Ma,"DataView"),Ba=Ua,Fa=Q,Ha=K,Ya=Fa(Ha,"Map"),ft=Ya,Ga=Q,Va=K,Wa=Ga(Va,"Promise"),Ka=Wa,qa=Q,za=K,ka=qa(za,"Set"),Ja=ka,Za=Q,Xa=K,Qa=Za(Xa,"WeakMap"),ei=Qa,Xe=Ba,Qe=ft,et=Ka,tt=Ja,rt=ei,xr=Ne,ie=Nr,Lt="[object Map]",ti="[object Object]",Rt="[object Promise]",jt="[object Set]",Pt="[object WeakMap]",Nt="[object DataView]",ri=ie(Xe),ni=ie(Qe),ai=ie(et),ii=ie(tt),si=ie(rt),Z=xr;(Xe&&Z(new Xe(new ArrayBuffer(1)))!=Nt||Qe&&Z(new Qe)!=Lt||et&&Z(et.resolve())!=Rt||tt&&Z(new tt)!=jt||rt&&Z(new rt)!=Pt)&&(Z=function(e){var t=xr(e),r=t==ti?e.constructor:void 0,n=r?ie(r):"";if(n)switch(n){case ri:return Nt;case ni:return Lt;case ai:return Rt;case ii:return jt;case si:return Pt}return t});var $e=Z;function oi(e){return e!=null&&typeof e=="object"}var se=oi,ui=Ne,fi=se,ci="[object Arguments]";function li(e){return fi(e)&&ui(e)==ci}var hi=li,xt=hi,di=se,Mr=Object.prototype,vi=Mr.hasOwnProperty,pi=Mr.propertyIsEnumerable,gi=xt(function(){return arguments}())?xt:function(e){return di(e)&&vi.call(e,"callee")&&!pi.call(e,"callee")},Ur=gi,$i=Array.isArray,ye=$i,yi=9007199254740991;function mi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yi}var Br=mi,bi=Pr,_i=Br;function Ai(e){return e!=null&&_i(e.length)&&!bi(e)}var ct=Ai,ae={exports:{}};function Ei(){return!1}var Ti=Ei;(function(e,t){var r=K,n=Ti,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,u=s?r.Buffer:void 0,o=u?u.isBuffer:void 0,l=o||n;e.exports=l})(ae,ae.exports);var Oi=Ne,Si=Br,wi=se,Ii="[object Arguments]",Di="[object Array]",Ci="[object Boolean]",Li="[object Date]",Ri="[object Error]",ji="[object Function]",Pi="[object Map]",Ni="[object Number]",xi="[object Object]",Mi="[object RegExp]",Ui="[object Set]",Bi="[object String]",Fi="[object WeakMap]",Hi="[object ArrayBuffer]",Yi="[object DataView]",Gi="[object Float32Array]",Vi="[object Float64Array]",Wi="[object Int8Array]",Ki="[object Int16Array]",qi="[object Int32Array]",zi="[object Uint8Array]",ki="[object Uint8ClampedArray]",Ji="[object Uint16Array]",Zi="[object Uint32Array]",R={};R[Gi]=R[Vi]=R[Wi]=R[Ki]=R[qi]=R[zi]=R[ki]=R[Ji]=R[Zi]=!0;R[Ii]=R[Di]=R[Hi]=R[Ci]=R[Yi]=R[Li]=R[Ri]=R[ji]=R[Pi]=R[Ni]=R[xi]=R[Mi]=R[Ui]=R[Bi]=R[Fi]=!1;function Xi(e){return wi(e)&&Si(e.length)&&!!R[Oi(e)]}var Qi=Xi;function es(e){return function(t){return e(t)}}var lt=es,ve={exports:{}};(function(e,t){var r=Rr,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,u=function(){try{var o=a&&a.require&&a.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}}();e.exports=u})(ve,ve.exports);var ts=Qi,rs=lt,Mt=ve.exports,Ut=Mt&&Mt.isTypedArray,ns=Ut?rs(Ut):ts,ht=ns,as=Lr,is=$e,ss=Ur,os=ye,us=ct,fs=ae.exports,cs=je,ls=ht,hs="[object Map]",ds="[object Set]",vs=Object.prototype,ps=vs.hasOwnProperty;function gs(e){if(e==null)return!0;if(us(e)&&(os(e)||typeof e=="string"||typeof e.splice=="function"||fs(e)||ls(e)||ss(e)))return!e.length;var t=is(e);if(t==hs||t==ds)return!e.size;if(cs(e))return!as(e).length;for(var r in e)if(ps.call(e,r))return!1;return!0}var dt=gs,Fr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(X,function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(i,s,u){var o=s.prototype;u.utc=function(f){var y={date:f,utc:!0,args:arguments};return new s(y)},o.utc=function(f){var y=u(this.toDate(),{locale:this.$L,utc:!0});return f?y.add(this.utcOffset(),r):y},o.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var l=o.parse;o.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),l.call(this,f)};var m=o.init;o.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else m.call(this)};var v=o.utcOffset;o.utcOffset=function(f,y){var O=this.$utils().u;if(O(f))return this.$u?0:O(this.$offset)?v.call(this):this.$offset;if(typeof f=="string"&&(f=function(D){D===void 0&&(D="");var B=D.match(n);if(!B)return null;var H=(""+B[0]).match(a)||["-",0,0],V=H[0],C=60*+H[1]+ +H[2];return C===0?0:V==="+"?C:-C}(f),f===null))return this;var w=Math.abs(f)<=16?60*f:f,E=this;if(y)return E.$offset=w,E.$u=f===0,E;if(f!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(E=this.local().add(w+P,r)).$offset=w,E.$x.$localOffset=P}else E=this.utc();return E};var c=o.format;o.format=function(f){var y=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,y)},o.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(f){return f==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var $=o.diff;o.diff=function(f,y,O){if(f&&this.$u===f.$u)return $.call(this,f,y,O);var w=this.local(),E=u(f).local();return $.call(w,E,y,O)}}})})(Fr);var $s=Fr.exports,Hr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(X,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(a,i,s){var u,o=function(c,h,$){$===void 0&&($={});var f=new Date(c),y=function(O,w){w===void 0&&(w={});var E=w.timeZoneName||"short",P=O+"|"+E,D=n[P];return D||(D=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:O,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:E}),n[P]=D),D}(h,$);return y.formatToParts(f)},l=function(c,h){for(var $=o(c,h),f=[],y=0;y<$.length;y+=1){var O=$[y],w=O.type,E=O.value,P=r[w];P>=0&&(f[P]=parseInt(E,10))}var D=f[3],B=D===24?0:D,H=f[0]+"-"+f[1]+"-"+f[2]+" "+B+":"+f[4]+":"+f[5]+":000",V=+c;return(s.utc(H).valueOf()-(V-=V%1e3))/6e4},m=i.prototype;m.tz=function(c,h){c===void 0&&(c=u);var $=this.utcOffset(),f=this.toDate(),y=f.toLocaleString("en-US",{timeZone:c}),O=Math.round((f-new Date(y))/1e3/60),w=s(y).$set("millisecond",this.$ms).utcOffset(15*-Math.round(f.getTimezoneOffset()/15)-O,!0);if(h){var E=w.utcOffset();w=w.add($-E,"minute")}return w.$x.$timezone=c,w},m.offsetName=function(c){var h=this.$x.$timezone||s.tz.guess(),$=o(this.valueOf(),h,{timeZoneName:c}).find(function(f){return f.type.toLowerCase()==="timezonename"});return $&&$.value};var v=m.startOf;m.startOf=function(c,h){if(!this.$x||!this.$x.$timezone)return v.call(this,c,h);var $=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return v.call($,c,h).tz(this.$x.$timezone,!0)},s.tz=function(c,h,$){var f=$&&h,y=$||h||u,O=l(+s(),y);if(typeof c!="string")return s(c).tz(y);var w=function(B,H,V){var C=B-60*H*1e3,S=l(C,V);if(H===S)return[C,H];var z=l(C-=60*(S-H)*1e3,V);return S===z?[C,S]:[B-60*Math.min(S,z)*1e3,Math.max(S,z)]}(s.utc(c,f).valueOf(),O,y),E=w[0],P=w[1],D=s(E).utcOffset(P);return D.$x.$timezone=y,D},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(c){u=c}}})})(Hr);var ys=Hr.exports,Yr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(X,function(){var r=1e3,n=6e4,a=36e5,i="millisecond",s="second",u="minute",o="hour",l="day",m="week",v="month",c="quarter",h="year",$="date",f="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},E=function(T,g,d){var b=String(T);return!b||b.length>=g?T:""+Array(g+1-b.length).join(d)+T},P={s:E,z:function(T){var g=-T.utcOffset(),d=Math.abs(g),b=Math.floor(d/60),p=d%60;return(g<=0?"+":"-")+E(b,2,"0")+":"+E(p,2,"0")},m:function T(g,d){if(g.date()<d.date())return-T(d,g);var b=12*(d.year()-g.year())+(d.month()-g.month()),p=g.clone().add(b,v),A=d-p<0,_=g.clone().add(b+(A?-1:1),v);return+(-(b+(d-p)/(A?p-_:_-p))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:v,y:h,w:m,d:l,D:$,h:o,m:u,s,ms:i,Q:c}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},D="en",B={};B[D]=w;var H=function(T){return T instanceof z},V=function T(g,d,b){var p;if(!g)return D;if(typeof g=="string"){var A=g.toLowerCase();B[A]&&(p=A),d&&(B[A]=d,p=A);var _=g.split("-");if(!p&&_.length>1)return T(_[0])}else{var I=g.name;B[I]=g,p=I}return!b&&p&&(D=p),p||!b&&D},C=function(T,g){if(H(T))return T.clone();var d=typeof g=="object"?g:{};return d.date=T,d.args=arguments,new z(d)},S=P;S.l=V,S.i=H,S.w=function(T,g){return C(T,{locale:g.$L,utc:g.$u,x:g.$x,$offset:g.$offset})};var z=function(){function T(d){this.$L=V(d.locale,null,!0),this.parse(d)}var g=T.prototype;return g.parse=function(d){this.$d=function(b){var p=b.date,A=b.utc;if(p===null)return new Date(NaN);if(S.u(p))return new Date;if(p instanceof Date)return new Date(p);if(typeof p=="string"&&!/Z$/i.test(p)){var _=p.match(y);if(_){var I=_[2]-1||0,N=(_[7]||"0").substring(0,3);return A?new Date(Date.UTC(_[1],I,_[3]||1,_[4]||0,_[5]||0,_[6]||0,N)):new Date(_[1],I,_[3]||1,_[4]||0,_[5]||0,_[6]||0,N)}}return new Date(p)}(d),this.$x=d.x||{},this.init()},g.init=function(){var d=this.$d;this.$y=d.getFullYear(),this.$M=d.getMonth(),this.$D=d.getDate(),this.$W=d.getDay(),this.$H=d.getHours(),this.$m=d.getMinutes(),this.$s=d.getSeconds(),this.$ms=d.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return this.$d.toString()!==f},g.isSame=function(d,b){var p=C(d);return this.startOf(b)<=p&&p<=this.endOf(b)},g.isAfter=function(d,b){return C(d)<this.startOf(b)},g.isBefore=function(d,b){return this.endOf(b)<C(d)},g.$g=function(d,b,p){return S.u(d)?this[b]:this.set(p,d)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(d,b){var p=this,A=!!S.u(b)||b,_=S.p(d),I=function(te,Y){var J=S.w(p.$u?Date.UTC(p.$y,Y,te):new Date(p.$y,Y,te),p);return A?J:J.endOf(l)},N=function(te,Y){return S.w(p.toDate()[te].apply(p.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(Y)),p)},j=this.$W,M=this.$M,k=this.$D,q="set"+(this.$u?"UTC":"");switch(_){case h:return A?I(1,0):I(31,11);case v:return A?I(1,M):I(0,M+1);case m:var le=this.$locale().weekStart||0,he=(j<le?j+7:j)-le;return I(A?k-he:k+(6-he),M);case l:case $:return N(q+"Hours",0);case o:return N(q+"Minutes",1);case u:return N(q+"Seconds",2);case s:return N(q+"Milliseconds",3);default:return this.clone()}},g.endOf=function(d){return this.startOf(d,!1)},g.$set=function(d,b){var p,A=S.p(d),_="set"+(this.$u?"UTC":""),I=(p={},p[l]=_+"Date",p[$]=_+"Date",p[v]=_+"Month",p[h]=_+"FullYear",p[o]=_+"Hours",p[u]=_+"Minutes",p[s]=_+"Seconds",p[i]=_+"Milliseconds",p)[A],N=A===l?this.$D+(b-this.$W):b;if(A===v||A===h){var j=this.clone().set($,1);j.$d[I](N),j.init(),this.$d=j.set($,Math.min(this.$D,j.daysInMonth())).$d}else I&&this.$d[I](N);return this.init(),this},g.set=function(d,b){return this.clone().$set(d,b)},g.get=function(d){return this[S.p(d)]()},g.add=function(d,b){var p,A=this;d=Number(d);var _=S.p(b),I=function(M){var k=C(A);return S.w(k.date(k.date()+Math.round(M*d)),A)};if(_===v)return this.set(v,this.$M+d);if(_===h)return this.set(h,this.$y+d);if(_===l)return I(1);if(_===m)return I(7);var N=(p={},p[u]=n,p[o]=a,p[s]=r,p)[_]||1,j=this.$d.getTime()+d*N;return S.w(j,this)},g.subtract=function(d,b){return this.add(-1*d,b)},g.format=function(d){var b=this,p=this.$locale();if(!this.isValid())return p.invalidDate||f;var A=d||"YYYY-MM-DDTHH:mm:ssZ",_=S.z(this),I=this.$H,N=this.$m,j=this.$M,M=p.weekdays,k=p.months,q=function(Y,J,Ve,be){return Y&&(Y[J]||Y(b,A))||Ve[J].slice(0,be)},le=function(Y){return S.s(I%12||12,Y,"0")},he=p.meridiem||function(Y,J,Ve){var be=Y<12?"AM":"PM";return Ve?be.toLowerCase():be},te={YY:String(this.$y).slice(-2),YYYY:this.$y,M:j+1,MM:S.s(j+1,2,"0"),MMM:q(p.monthsShort,j,k,3),MMMM:q(k,j),D:this.$D,DD:S.s(this.$D,2,"0"),d:String(this.$W),dd:q(p.weekdaysMin,this.$W,M,2),ddd:q(p.weekdaysShort,this.$W,M,3),dddd:M[this.$W],H:String(I),HH:S.s(I,2,"0"),h:le(1),hh:le(2),a:he(I,N,!0),A:he(I,N,!1),m:String(N),mm:S.s(N,2,"0"),s:String(this.$s),ss:S.s(this.$s,2,"0"),SSS:S.s(this.$ms,3,"0"),Z:_};return A.replace(O,function(Y,J){return J||te[Y]||_.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(d,b,p){var A,_=S.p(b),I=C(d),N=(I.utcOffset()-this.utcOffset())*n,j=this-I,M=S.m(this,I);return M=(A={},A[h]=M/12,A[v]=M,A[c]=M/3,A[m]=(j-N)/6048e5,A[l]=(j-N)/864e5,A[o]=j/a,A[u]=j/n,A[s]=j/r,A)[_]||j,p?M:S.a(M)},g.daysInMonth=function(){return this.endOf(v).$D},g.$locale=function(){return B[this.$L]},g.locale=function(d,b){if(!d)return this.$L;var p=this.clone(),A=V(d,b,!0);return A&&(p.$L=A),p},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},T}(),St=z.prototype;return C.prototype=St,[["$ms",i],["$s",s],["$m",u],["$H",o],["$W",l],["$M",v],["$y",h],["$D",$]].forEach(function(T){St[T[1]]=function(g){return this.$g(g,T[0],T[1])}}),C.extend=function(T,g){return T.$i||(T(g,z,C),T.$i=!0),C},C.locale=V,C.isDayjs=H,C.unix=function(T){return C(1e3*T)},C.en=B[D],C.Ls=B,C.p={},C})})(Yr);var pe=Yr.exports;pe.extend($s);pe.extend(ys);const Gr=["SUN","MON","TUE","WED","THU","FRI","SAT"],Ie=e=>{const[t,r]=e.split(":");return{hour:parseInt(t||"0",10),minutes:parseInt(r||"0",10)}};function nt(e,t,r){const{availability:n}=e;if(!n)return!0;if(dt(n))return!1;const a=r?pe(r).tz(t):pe().tz(t),i=a.day(),s=n[Gr[i]];if(!Array.isArray(s)||s.length!==2)return!1;const u=a.hour(),o=a.minute(),l=Ie(s[0]),m=Ie(s[1]);return u<l.hour||u===l.hour&&o<l.minutes?!1:!(u>m.hour||u===m.hour&&o>m.minutes)}const at=(e,t=void 0,r=void 0,n=!1)=>n?e.map(i=>{let s;return Array.isArray(i.items)&&(s=at(i.items,t,r,n)),{...i,items:s,outsideAvailabilitySlot:!nt(i,t,r)||(s==null?void 0:s.every(u=>u.outsideAvailabilitySlot))||!1}}):e.filter(i=>nt(i,t,r)).map(i=>Array.isArray(i.items)?{...i,items:at(i.items,t,r)}:i),Bt=(e,t=void 0,r=void 0,n=!1)=>{let a=[];return e.forEach(i=>{if(!Array.isArray(i.items)){a.push(i);return}const s=at(i.items,t,r,n);s.length>0&&a.push({...i,items:s})}),n&&(a=a.map(i=>!i.items||!Array.isArray(i.items)?i:{...i,outsideAvailabilitySlot:!nt(i,t,r)||i.items.every(s=>s.outsideAvailabilitySlot)})),a};function _e(e){const t=e==null?void 0:e.week;if(!e||!e.active||!t)return!1;const r=pe(),n=r.day(),a=t[Gr[n]];return a?a.some(i=>ms(r,i)):!1}function ms(e,t){const r=e.hour(),n=e.minute(),a=Ie(t.from),i=Ie(t.to);return r<a.hour||r===a.hour&&n<a.minutes?!1:!(r>i.hour||r===i.hour&&n>i.minutes)}function bs(){this.__data__=[],this.size=0}var _s=bs;function As(e,t){return e===t||e!==e&&t!==t}var vt=As,Es=vt;function Ts(e,t){for(var r=e.length;r--;)if(Es(e[r][0],t))return r;return-1}var xe=Ts,Os=xe,Ss=Array.prototype,ws=Ss.splice;function Is(e){var t=this.__data__,r=Os(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():ws.call(t,r,1),--this.size,!0}var Ds=Is,Cs=xe;function Ls(e){var t=this.__data__,r=Cs(t,e);return r<0?void 0:t[r][1]}var Rs=Ls,js=xe;function Ps(e){return js(this.__data__,e)>-1}var Ns=Ps,xs=xe;function Ms(e,t){var r=this.__data__,n=xs(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Us=Ms,Bs=_s,Fs=Ds,Hs=Rs,Ys=Ns,Gs=Us;function oe(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}oe.prototype.clear=Bs;oe.prototype.delete=Fs;oe.prototype.get=Hs;oe.prototype.has=Ys;oe.prototype.set=Gs;var Me=oe,Vs=Me;function Ws(){this.__data__=new Vs,this.size=0}var Ks=Ws;function qs(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var zs=qs;function ks(e){return this.__data__.get(e)}var Js=ks;function Zs(e){return this.__data__.has(e)}var Xs=Zs,Qs=Q,eo=Qs(Object,"create"),Ue=eo,Ft=Ue;function to(){this.__data__=Ft?Ft(null):{},this.size=0}var ro=to;function no(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ao=no,io=Ue,so="__lodash_hash_undefined__",oo=Object.prototype,uo=oo.hasOwnProperty;function fo(e){var t=this.__data__;if(io){var r=t[e];return r===so?void 0:r}return uo.call(t,e)?t[e]:void 0}var co=fo,lo=Ue,ho=Object.prototype,vo=ho.hasOwnProperty;function po(e){var t=this.__data__;return lo?t[e]!==void 0:vo.call(t,e)}var go=po,$o=Ue,yo="__lodash_hash_undefined__";function mo(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=$o&&t===void 0?yo:t,this}var bo=mo,_o=ro,Ao=ao,Eo=co,To=go,Oo=bo;function ue(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ue.prototype.clear=_o;ue.prototype.delete=Ao;ue.prototype.get=Eo;ue.prototype.has=To;ue.prototype.set=Oo;var So=ue,Ht=So,wo=Me,Io=ft;function Do(){this.size=0,this.__data__={hash:new Ht,map:new(Io||wo),string:new Ht}}var Co=Do;function Lo(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Ro=Lo,jo=Ro;function Po(e,t){var r=e.__data__;return jo(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Be=Po,No=Be;function xo(e){var t=No(this,e).delete(e);return this.size-=t?1:0,t}var Mo=xo,Uo=Be;function Bo(e){return Uo(this,e).get(e)}var Fo=Bo,Ho=Be;function Yo(e){return Ho(this,e).has(e)}var Go=Yo,Vo=Be;function Wo(e,t){var r=Vo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Ko=Wo,qo=Co,zo=Mo,ko=Fo,Jo=Go,Zo=Ko;function fe(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}fe.prototype.clear=qo;fe.prototype.delete=zo;fe.prototype.get=ko;fe.prototype.has=Jo;fe.prototype.set=Zo;var Vr=fe,Xo=Me,Qo=ft,eu=Vr,tu=200;function ru(e,t){var r=this.__data__;if(r instanceof Xo){var n=r.__data__;if(!Qo||n.length<tu-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new eu(n)}return r.set(e,t),this.size=r.size,this}var nu=ru,au=Me,iu=Ks,su=zs,ou=Js,uu=Xs,fu=nu;function ce(e){var t=this.__data__=new au(e);this.size=t.size}ce.prototype.clear=iu;ce.prototype.delete=su;ce.prototype.get=ou;ce.prototype.has=uu;ce.prototype.set=fu;var Wr=ce,cu="__lodash_hash_undefined__";function lu(e){return this.__data__.set(e,cu),this}var hu=lu;function du(e){return this.__data__.has(e)}var vu=du,pu=Vr,gu=hu,$u=vu;function De(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new pu;++t<r;)this.add(e[t])}De.prototype.add=De.prototype.push=gu;De.prototype.has=$u;var yu=De;function mu(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var bu=mu;function _u(e,t){return e.has(t)}var Au=_u,Eu=yu,Tu=bu,Ou=Au,Su=1,wu=2;function Iu(e,t,r,n,a,i){var s=r&Su,u=e.length,o=t.length;if(u!=o&&!(s&&o>u))return!1;var l=i.get(e),m=i.get(t);if(l&&m)return l==t&&m==e;var v=-1,c=!0,h=r&wu?new Eu:void 0;for(i.set(e,t),i.set(t,e);++v<u;){var $=e[v],f=t[v];if(n)var y=s?n(f,$,v,t,e,i):n($,f,v,e,t,i);if(y!==void 0){if(y)continue;c=!1;break}if(h){if(!Tu(t,function(O,w){if(!Ou(h,w)&&($===O||a($,O,r,n,i)))return h.push(w)})){c=!1;break}}else if(!($===f||a($,f,r,n,i))){c=!1;break}}return i.delete(e),i.delete(t),c}var Kr=Iu,Du=K,Cu=Du.Uint8Array,qr=Cu;function Lu(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var Ru=Lu;function ju(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Pu=ju,Yt=Pe,Gt=qr,Nu=vt,xu=Kr,Mu=Ru,Uu=Pu,Bu=1,Fu=2,Hu="[object Boolean]",Yu="[object Date]",Gu="[object Error]",Vu="[object Map]",Wu="[object Number]",Ku="[object RegExp]",qu="[object Set]",zu="[object String]",ku="[object Symbol]",Ju="[object ArrayBuffer]",Zu="[object DataView]",Vt=Yt?Yt.prototype:void 0,Ke=Vt?Vt.valueOf:void 0;function Xu(e,t,r,n,a,i,s){switch(r){case Zu:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ju:return!(e.byteLength!=t.byteLength||!i(new Gt(e),new Gt(t)));case Hu:case Yu:case Wu:return Nu(+e,+t);case Gu:return e.name==t.name&&e.message==t.message;case Ku:case zu:return e==t+"";case Vu:var u=Mu;case qu:var o=n&Bu;if(u||(u=Uu),e.size!=t.size&&!o)return!1;var l=s.get(e);if(l)return l==t;n|=Fu,s.set(e,t);var m=xu(u(e),u(t),n,a,i,s);return s.delete(e),m;case ku:if(Ke)return Ke.call(e)==Ke.call(t)}return!1}var Qu=Xu;function ef(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var zr=ef,tf=zr,rf=ye;function nf(e,t,r){var n=t(e);return rf(e)?n:tf(n,r(e))}var kr=nf;function af(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[a++]=s)}return i}var sf=af;function of(){return[]}var Jr=of,uf=sf,ff=Jr,cf=Object.prototype,lf=cf.propertyIsEnumerable,Wt=Object.getOwnPropertySymbols,hf=Wt?function(e){return e==null?[]:(e=Object(e),uf(Wt(e),function(t){return lf.call(e,t)}))}:ff,pt=hf;function df(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var vf=df,pf=9007199254740991,gf=/^(?:0|[1-9]\d*)$/;function $f(e,t){var r=typeof e;return t=t==null?pf:t,!!t&&(r=="number"||r!="symbol"&&gf.test(e))&&e>-1&&e%1==0&&e<t}var yf=$f,mf=vf,bf=Ur,_f=ye,Af=ae.exports,Ef=yf,Tf=ht,Of=Object.prototype,Sf=Of.hasOwnProperty;function wf(e,t){var r=_f(e),n=!r&&bf(e),a=!r&&!n&&Af(e),i=!r&&!n&&!a&&Tf(e),s=r||n||a||i,u=s?mf(e.length,String):[],o=u.length;for(var l in e)(t||Sf.call(e,l))&&!(s&&(l=="length"||a&&(l=="offset"||l=="parent")||i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ef(l,o)))&&u.push(l);return u}var Zr=wf,If=Zr,Df=Lr,Cf=ct;function Lf(e){return Cf(e)?If(e):Df(e)}var gt=Lf,Rf=kr,jf=pt,Pf=gt;function Nf(e){return Rf(e,Pf,jf)}var Xr=Nf,Kt=Xr,xf=1,Mf=Object.prototype,Uf=Mf.hasOwnProperty;function Bf(e,t,r,n,a,i){var s=r&xf,u=Kt(e),o=u.length,l=Kt(t),m=l.length;if(o!=m&&!s)return!1;for(var v=o;v--;){var c=u[v];if(!(s?c in t:Uf.call(t,c)))return!1}var h=i.get(e),$=i.get(t);if(h&&$)return h==t&&$==e;var f=!0;i.set(e,t),i.set(t,e);for(var y=s;++v<o;){c=u[v];var O=e[c],w=t[c];if(n)var E=s?n(w,O,c,t,e,i):n(O,w,c,e,t,i);if(!(E===void 0?O===w||a(O,w,r,n,i):E)){f=!1;break}y||(y=c=="constructor")}if(f&&!y){var P=e.constructor,D=t.constructor;P!=D&&"constructor"in e&&"constructor"in t&&!(typeof P=="function"&&P instanceof P&&typeof D=="function"&&D instanceof D)&&(f=!1)}return i.delete(e),i.delete(t),f}var Ff=Bf,qe=Wr,Hf=Kr,Yf=Qu,Gf=Ff,qt=$e,zt=ye,kt=ae.exports,Vf=ht,Wf=1,Jt="[object Arguments]",Zt="[object Array]",Ae="[object Object]",Kf=Object.prototype,Xt=Kf.hasOwnProperty;function qf(e,t,r,n,a,i){var s=zt(e),u=zt(t),o=s?Zt:qt(e),l=u?Zt:qt(t);o=o==Jt?Ae:o,l=l==Jt?Ae:l;var m=o==Ae,v=l==Ae,c=o==l;if(c&&kt(e)){if(!kt(t))return!1;s=!0,m=!1}if(c&&!m)return i||(i=new qe),s||Vf(e)?Hf(e,t,r,n,a,i):Yf(e,t,o,r,n,a,i);if(!(r&Wf)){var h=m&&Xt.call(e,"__wrapped__"),$=v&&Xt.call(t,"__wrapped__");if(h||$){var f=h?e.value():e,y=$?t.value():t;return i||(i=new qe),a(f,y,r,n,i)}}return c?(i||(i=new qe),Gf(e,t,r,n,a,i)):!1}var zf=qf,kf=zf,Qt=se;function Qr(e,t,r,n,a){return e===t?!0:e==null||t==null||!Qt(e)&&!Qt(t)?e!==e&&t!==t:kf(e,t,r,n,Qr,a)}var Jf=Qr,Zf=Jf;function Xf(e,t){return Zf(e,t)}var en=Xf;function Qf(e,t=!1,r=void 0,n=60){const[a,i]=F.useState(e&&Bt(e,r,void 0,t));Re(s,n*1e3);function s(){const u=e&&Bt(e,r,void 0,t);en(u,a)||(console.log("menu has changed",u),i(u))}return F.useEffect(s,[a,e]),a}var er;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(er||(er={}));var tr;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(tr||(tr={}));var it;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query"})(it||(it={}));var rr;(function(e){e.GROUP="group",e.PRODUCT="product"})(rr||(rr={}));var nr;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN"})(nr||(nr={}));var ar;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(ar||(ar={}));var ir;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(ir||(ir={}));var sr;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT"})(sr||(sr={}));var or;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(or||(or={}));var ur;(function(e){e.GROUP="group",e.PRODUCT="product"})(ur||(ur={}));var fr;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.UBER_DELIVERY="UBER_DELIVERY",e.BOLT_DELIVERY="BOLT_DELIVERY",e.WOLT_DELIVERY="WOLT_DELIVERY"})(fr||(fr={}));function ec(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var tc=ec,rc=Q,nc=function(){try{var e=rc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),ac=nc,cr=ac;function ic(e,t,r){t=="__proto__"&&cr?cr(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var tn=ic,sc=tn,oc=vt,uc=Object.prototype,fc=uc.hasOwnProperty;function cc(e,t,r){var n=e[t];(!(fc.call(e,t)&&oc(n,r))||r===void 0&&!(t in e))&&sc(e,t,r)}var rn=cc,lc=rn,hc=tn;function dc(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var u=t[i],o=n?n(r[u],e[u],u,r,e):void 0;o===void 0&&(o=e[u]),a?hc(r,u,o):lc(r,u,o)}return r}var Fe=dc,vc=Fe,pc=gt;function gc(e,t){return e&&vc(t,pc(t),e)}var $c=gc;function yc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var mc=yc,bc=ge,_c=je,Ac=mc,Ec=Object.prototype,Tc=Ec.hasOwnProperty;function Oc(e){if(!bc(e))return Ac(e);var t=_c(e),r=[];for(var n in e)n=="constructor"&&(t||!Tc.call(e,n))||r.push(n);return r}var Sc=Oc,wc=Zr,Ic=Sc,Dc=ct;function Cc(e){return Dc(e)?wc(e,!0):Ic(e)}var $t=Cc,Lc=Fe,Rc=$t;function jc(e,t){return e&&Lc(t,Rc(t),e)}var Pc=jc,st={exports:{}};(function(e,t){var r=K,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,u=s?s.allocUnsafe:void 0;function o(l,m){if(m)return l.slice();var v=l.length,c=u?u(v):new l.constructor(v);return l.copy(c),c}e.exports=o})(st,st.exports);function Nc(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var xc=Nc,Mc=Fe,Uc=pt;function Bc(e,t){return Mc(e,Uc(e),t)}var Fc=Bc,Hc=Cr,Yc=Hc(Object.getPrototypeOf,Object),nn=Yc,Gc=zr,Vc=nn,Wc=pt,Kc=Jr,qc=Object.getOwnPropertySymbols,zc=qc?function(e){for(var t=[];e;)Gc(t,Wc(e)),e=Vc(e);return t}:Kc,an=zc,kc=Fe,Jc=an;function Zc(e,t){return kc(e,Jc(e),t)}var Xc=Zc,Qc=kr,el=an,tl=$t;function rl(e){return Qc(e,tl,el)}var nl=rl,al=Object.prototype,il=al.hasOwnProperty;function sl(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&il.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var ol=sl,lr=qr;function ul(e){var t=new e.constructor(e.byteLength);return new lr(t).set(new lr(e)),t}var yt=ul,fl=yt;function cl(e,t){var r=t?fl(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var ll=cl,hl=/\w*$/;function dl(e){var t=new e.constructor(e.source,hl.exec(e));return t.lastIndex=e.lastIndex,t}var vl=dl,hr=Pe,dr=hr?hr.prototype:void 0,vr=dr?dr.valueOf:void 0;function pl(e){return vr?Object(vr.call(e)):{}}var gl=pl,$l=yt;function yl(e,t){var r=t?$l(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var ml=yl,bl=yt,_l=ll,Al=vl,El=gl,Tl=ml,Ol="[object Boolean]",Sl="[object Date]",wl="[object Map]",Il="[object Number]",Dl="[object RegExp]",Cl="[object Set]",Ll="[object String]",Rl="[object Symbol]",jl="[object ArrayBuffer]",Pl="[object DataView]",Nl="[object Float32Array]",xl="[object Float64Array]",Ml="[object Int8Array]",Ul="[object Int16Array]",Bl="[object Int32Array]",Fl="[object Uint8Array]",Hl="[object Uint8ClampedArray]",Yl="[object Uint16Array]",Gl="[object Uint32Array]";function Vl(e,t,r){var n=e.constructor;switch(t){case jl:return bl(e);case Ol:case Sl:return new n(+e);case Pl:return _l(e,r);case Nl:case xl:case Ml:case Ul:case Bl:case Fl:case Hl:case Yl:case Gl:return Tl(e,r);case wl:return new n;case Il:case Ll:return new n(e);case Dl:return Al(e);case Cl:return new n;case Rl:return El(e)}}var Wl=Vl,Kl=ge,pr=Object.create,ql=function(){function e(){}return function(t){if(!Kl(t))return{};if(pr)return pr(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),zl=ql,kl=zl,Jl=nn,Zl=je;function Xl(e){return typeof e.constructor=="function"&&!Zl(e)?kl(Jl(e)):{}}var Ql=Xl,eh=$e,th=se,rh="[object Map]";function nh(e){return th(e)&&eh(e)==rh}var ah=nh,ih=ah,sh=lt,gr=ve.exports,$r=gr&&gr.isMap,oh=$r?sh($r):ih,uh=oh,fh=$e,ch=se,lh="[object Set]";function hh(e){return ch(e)&&fh(e)==lh}var dh=hh,vh=dh,ph=lt,yr=ve.exports,mr=yr&&yr.isSet,gh=mr?ph(mr):vh,$h=gh,yh=Wr,mh=tc,bh=rn,_h=$c,Ah=Pc,Eh=st.exports,Th=xc,Oh=Fc,Sh=Xc,wh=Xr,Ih=nl,Dh=$e,Ch=ol,Lh=Wl,Rh=Ql,jh=ye,Ph=ae.exports,Nh=uh,xh=ge,Mh=$h,Uh=gt,Bh=$t,Fh=1,Hh=2,Yh=4,sn="[object Arguments]",Gh="[object Array]",Vh="[object Boolean]",Wh="[object Date]",Kh="[object Error]",on="[object Function]",qh="[object GeneratorFunction]",zh="[object Map]",kh="[object Number]",un="[object Object]",Jh="[object RegExp]",Zh="[object Set]",Xh="[object String]",Qh="[object Symbol]",ed="[object WeakMap]",td="[object ArrayBuffer]",rd="[object DataView]",nd="[object Float32Array]",ad="[object Float64Array]",id="[object Int8Array]",sd="[object Int16Array]",od="[object Int32Array]",ud="[object Uint8Array]",fd="[object Uint8ClampedArray]",cd="[object Uint16Array]",ld="[object Uint32Array]",L={};L[sn]=L[Gh]=L[td]=L[rd]=L[Vh]=L[Wh]=L[nd]=L[ad]=L[id]=L[sd]=L[od]=L[zh]=L[kh]=L[un]=L[Jh]=L[Zh]=L[Xh]=L[Qh]=L[ud]=L[fd]=L[cd]=L[ld]=!0;L[Kh]=L[on]=L[ed]=!1;function Oe(e,t,r,n,a,i){var s,u=t&Fh,o=t&Hh,l=t&Yh;if(r&&(s=a?r(e,n,a,i):r(e)),s!==void 0)return s;if(!xh(e))return e;var m=jh(e);if(m){if(s=Ch(e),!u)return Th(e,s)}else{var v=Dh(e),c=v==on||v==qh;if(Ph(e))return Eh(e,u);if(v==un||v==sn||c&&!a){if(s=o||c?{}:Rh(e),!u)return o?Sh(e,Ah(s,e)):Oh(e,_h(s,e))}else{if(!L[v])return a?e:{};s=Lh(e,v,u)}}i||(i=new yh);var h=i.get(e);if(h)return h;i.set(e,s),Mh(e)?e.forEach(function(y){s.add(Oe(y,t,r,y,e,i))}):Nh(e)&&e.forEach(function(y,O){s.set(O,Oe(y,t,r,O,e,i))});var $=l?o?Ih:wh:o?Bh:Uh,f=m?void 0:$(e);return mh(f||e,function(y,O){f&&(O=y,y=e[O]),bh(s,O,Oe(y,t,r,O,e,i))}),s}var hd=Oe,dd=hd,vd=1,pd=4;function gd(e){return dd(e,vd|pd)}var $d=gd;function yd(e,t){if(!t||!t.filter||!e||!e.filter||e.kind!==it.CONFIG)return!0;if(e.filter&&e.items){const r=Object.values(e.filter).flat().filter(n=>{var a,i,s,u;return t.filter[(i=(a=e.items)==null?void 0:a[0])==null?void 0:i.fltCtx]&&Object.values(t.filter[(u=(s=e.items)==null?void 0:s[0])==null?void 0:u.fltCtx]).includes(n)});if(Array.isArray(r)&&r.length===0)return!1}return!0}const Ce=(e,t,r=0)=>{if(!e)return 0;let n=parseFloat(e.price)||0;const{items:a}=e,i=$d(t);return yd(e,i)&&Array.isArray(a)&&a.forEach(s=>{let u=0;if(s.kind!=="3e/product")u=Ce(s,i,r+1);else{const{selected:o={}}=i,{selCtx:l,id:m}=s;l in o&&m in o[l]&&(u=Ce(s,i,r+1)*o[l][m],delete i.selected[l][m])}n+=u}),Math.round(100*n)/100},md=({product:e,state:t,selected:r,cheapestGroupOptionsProduct:n})=>{var o;const a=t?Ce(e,t):0,i=e.state&&!dt((o=e==null?void 0:e.state)==null?void 0:o.selected)?Ce(e,e.state):0,s=e.minPrice&&parseFloat(e.price)===a;let u=r||!!n||parseFloat(e.price)===0?a||i:parseFloat(e.price);return n!==void 0&&(u-=n),s&&e.minPrice&&(u=parseFloat(e.minPrice)),{displayPrice:u,showAsMinPrice:s,calculatedPriceDefaultProductState:i}};function mt(e){const t=[];return e.reduce((r,n)=>{if(r[n.hash]||(r[n.hash]={...n,quantity:0,discounted:0,discounts:[],firstProductQuantity:n.quantity,itemsToRemove:[]},t.push(r[n.hash])),r[n.hash].quantity+=n.quantity,r[n.hash].itemsToRemove.push(n.id),n.discounts){r[n.hash].discounts||(r[n.hash].discounts=[]),r[n.hash].discounts=r[n.hash].discounts.concat(n.discounts),r[n.hash].discounted=0;for(let a=0;a<r[n.hash].discounts.length;a+=1)r[n.hash].discounts[a]&&(r[n.hash].discounted+=parseFloat(r[n.hash].discounts[a].discountPrice))}return r},{}),t}function bd(e){return mt(e)}function _d(e){return!e||e.length===0?null:mt(e.flatMap(t=>t.lines))}var bt={exports:{}},fn=function(t,r){return function(){for(var a=new Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return t.apply(r,a)}},Ad=fn,ee=Object.prototype.toString;function _t(e){return ee.call(e)==="[object Array]"}function ot(e){return typeof e=="undefined"}function Ed(e){return e!==null&&!ot(e)&&e.constructor!==null&&!ot(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Td(e){return ee.call(e)==="[object ArrayBuffer]"}function Od(e){return typeof FormData!="undefined"&&e instanceof FormData}function Sd(e){var t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&e.buffer instanceof ArrayBuffer,t}function wd(e){return typeof e=="string"}function Id(e){return typeof e=="number"}function cn(e){return e!==null&&typeof e=="object"}function Se(e){if(ee.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Dd(e){return ee.call(e)==="[object Date]"}function Cd(e){return ee.call(e)==="[object File]"}function Ld(e){return ee.call(e)==="[object Blob]"}function ln(e){return ee.call(e)==="[object Function]"}function Rd(e){return cn(e)&&ln(e.pipe)}function jd(e){return typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams}function Pd(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Nd(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function At(e,t){if(!(e===null||typeof e=="undefined"))if(typeof e!="object"&&(e=[e]),_t(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}function ut(){var e={};function t(a,i){Se(e[i])&&Se(a)?e[i]=ut(e[i],a):Se(a)?e[i]=ut({},a):_t(a)?e[i]=a.slice():e[i]=a}for(var r=0,n=arguments.length;r<n;r++)At(arguments[r],t);return e}function xd(e,t,r){return At(t,function(a,i){r&&typeof a=="function"?e[i]=Ad(a,r):e[i]=a}),e}function Md(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var G={isArray:_t,isArrayBuffer:Td,isBuffer:Ed,isFormData:Od,isArrayBufferView:Sd,isString:wd,isNumber:Id,isObject:cn,isPlainObject:Se,isUndefined:ot,isDate:Dd,isFile:Cd,isBlob:Ld,isFunction:ln,isStream:Rd,isURLSearchParams:jd,isStandardBrowserEnv:Nd,forEach:At,merge:ut,extend:xd,trim:Pd,stripBOM:Md},re=G;function br(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var hn=function(t,r,n){if(!r)return t;var a;if(n)a=n(r);else if(re.isURLSearchParams(r))a=r.toString();else{var i=[];re.forEach(r,function(o,l){o===null||typeof o=="undefined"||(re.isArray(o)?l=l+"[]":o=[o],re.forEach(o,function(v){re.isDate(v)?v=v.toISOString():re.isObject(v)&&(v=JSON.stringify(v)),i.push(br(l)+"="+br(v))}))}),a=i.join("&")}if(a){var s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t},Ud=G;function He(){this.handlers=[]}He.prototype.use=function(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};He.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};He.prototype.forEach=function(t){Ud.forEach(this.handlers,function(n){n!==null&&t(n)})};var Bd=He,Fd=G,Hd=function(t,r){Fd.forEach(t,function(a,i){i!==r&&i.toUpperCase()===r.toUpperCase()&&(t[r]=a,delete t[i])})},dn=function(t,r,n,a,i){return t.config=r,n&&(t.code=n),t.request=a,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t},Yd=dn,vn=function(t,r,n,a,i){var s=new Error(t);return Yd(s,r,n,a,i)},Gd=vn,Vd=function(t,r,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?t(n):r(Gd("Request failed with status code "+n.status,n.config,null,n.request,n))},Ee=G,Wd=Ee.isStandardBrowserEnv()?function(){return{write:function(r,n,a,i,s,u){var o=[];o.push(r+"="+encodeURIComponent(n)),Ee.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),Ee.isString(i)&&o.push("path="+i),Ee.isString(s)&&o.push("domain="+s),u===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Kd=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},qd=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t},zd=Kd,kd=qd,Jd=function(t,r){return t&&!zd(r)?kd(t,r):r},ze=G,Zd=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Xd=function(t){var r={},n,a,i;return t&&ze.forEach(t.split(`
2
- `),function(u){if(i=u.indexOf(":"),n=ze.trim(u.substr(0,i)).toLowerCase(),a=ze.trim(u.substr(i+1)),n){if(r[n]&&Zd.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([a]):r[n]=r[n]?r[n]+", "+a:a}}),r},_r=G,Qd=_r.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function a(i){var s=i;return t&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=a(window.location.href),function(s){var u=_r.isString(s)?a(s):s;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}(),Te=G,ev=Vd,tv=Wd,rv=hn,nv=Jd,av=Xd,iv=Qd,ke=vn,Ar=function(t){return new Promise(function(n,a){var i=t.data,s=t.headers,u=t.responseType;Te.isFormData(i)&&delete s["Content-Type"];var o=new XMLHttpRequest;if(t.auth){var l=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.Authorization="Basic "+btoa(l+":"+m)}var v=nv(t.baseURL,t.url);o.open(t.method.toUpperCase(),rv(v,t.params,t.paramsSerializer),!0),o.timeout=t.timeout;function c(){if(!!o){var $="getAllResponseHeaders"in o?av(o.getAllResponseHeaders()):null,f=!u||u==="text"||u==="json"?o.responseText:o.response,y={data:f,status:o.status,statusText:o.statusText,headers:$,config:t,request:o};ev(n,a,y),o=null}}if("onloadend"in o?o.onloadend=c:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(c)},o.onabort=function(){!o||(a(ke("Request aborted",t,"ECONNABORTED",o)),o=null)},o.onerror=function(){a(ke("Network Error",t,null,o)),o=null},o.ontimeout=function(){var f="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(f=t.timeoutErrorMessage),a(ke(f,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Te.isStandardBrowserEnv()){var h=(t.withCredentials||iv(v))&&t.xsrfCookieName?tv.read(t.xsrfCookieName):void 0;h&&(s[t.xsrfHeaderName]=h)}"setRequestHeader"in o&&Te.forEach(s,function(f,y){typeof i=="undefined"&&y.toLowerCase()==="content-type"?delete s[y]:o.setRequestHeader(y,f)}),Te.isUndefined(t.withCredentials)||(o.withCredentials=!!t.withCredentials),u&&u!=="json"&&(o.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&o.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&o.upload&&o.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(f){!o||(o.abort(),a(f),o=null)}),i||(i=null),o.send(i)})},x=G,Er=Hd,sv=dn,ov={"Content-Type":"application/x-www-form-urlencoded"};function Tr(e,t){!x.isUndefined(e)&&x.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function uv(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=Ar),e}function fv(e,t,r){if(x.isString(e))try{return(t||JSON.parse)(e),x.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Ye={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:uv(),transformRequest:[function(t,r){return Er(r,"Accept"),Er(r,"Content-Type"),x.isFormData(t)||x.isArrayBuffer(t)||x.isBuffer(t)||x.isStream(t)||x.isFile(t)||x.isBlob(t)?t:x.isArrayBufferView(t)?t.buffer:x.isURLSearchParams(t)?(Tr(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):x.isObject(t)||r&&r["Content-Type"]==="application/json"?(Tr(r,"application/json"),fv(t)):t}],transformResponse:[function(t){var r=this.transitional,n=r&&r.silentJSONParsing,a=r&&r.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||a&&x.isString(t)&&t.length)try{return JSON.parse(t)}catch(s){if(i)throw s.name==="SyntaxError"?sv(s,this,"E_JSON_PARSE"):s}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};Ye.headers={common:{Accept:"application/json, text/plain, */*"}};x.forEach(["delete","get","head"],function(t){Ye.headers[t]={}});x.forEach(["post","put","patch"],function(t){Ye.headers[t]=x.merge(ov)});var Et=Ye,cv=G,lv=Et,hv=function(t,r,n){var a=this||lv;return cv.forEach(n,function(s){t=s.call(a,t,r)}),t},pn=function(t){return!!(t&&t.__CANCEL__)},Or=G,Je=hv,dv=pn,vv=Et;function Ze(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var pv=function(t){Ze(t),t.headers=t.headers||{},t.data=Je.call(t,t.data,t.headers,t.transformRequest),t.headers=Or.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Or.forEach(["delete","get","head","post","put","patch","common"],function(a){delete t.headers[a]});var r=t.adapter||vv.adapter;return r(t).then(function(a){return Ze(t),a.data=Je.call(t,a.data,a.headers,t.transformResponse),a},function(a){return dv(a)||(Ze(t),a&&a.response&&(a.response.data=Je.call(t,a.response.data,a.response.headers,t.transformResponse))),Promise.reject(a)})},U=G,gn=function(t,r){r=r||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function o(c,h){return U.isPlainObject(c)&&U.isPlainObject(h)?U.merge(c,h):U.isPlainObject(h)?U.merge({},h):U.isArray(h)?h.slice():h}function l(c){U.isUndefined(r[c])?U.isUndefined(t[c])||(n[c]=o(void 0,t[c])):n[c]=o(t[c],r[c])}U.forEach(a,function(h){U.isUndefined(r[h])||(n[h]=o(void 0,r[h]))}),U.forEach(i,l),U.forEach(s,function(h){U.isUndefined(r[h])?U.isUndefined(t[h])||(n[h]=o(void 0,t[h])):n[h]=o(void 0,r[h])}),U.forEach(u,function(h){h in r?n[h]=o(t[h],r[h]):h in t&&(n[h]=o(void 0,t[h]))});var m=a.concat(i).concat(s).concat(u),v=Object.keys(t).concat(Object.keys(r)).filter(function(h){return m.indexOf(h)===-1});return U.forEach(v,l),n};const gv="axios",$v="0.21.4",yv="Promise based HTTP client for the browser and node.js",mv="index.js",bv={test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},_v={type:"git",url:"https://github.com/axios/axios.git"},Av=["xhr","http","ajax","promise","node"],Ev="Matt Zabriskie",Tv="MIT",Ov={url:"https://github.com/axios/axios/issues"},Sv="https://axios-http.com",wv={coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},Iv={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Dv="dist/axios.min.js",Cv="dist/axios.min.js",Lv="./index.d.ts",Rv={"follow-redirects":"^1.14.0"},jv=[{path:"./dist/axios.min.js",threshold:"5kB"}];var Pv={name:gv,version:$v,description:yv,main:mv,scripts:bv,repository:_v,keywords:Av,author:Ev,license:Tv,bugs:Ov,homepage:Sv,devDependencies:wv,browser:Iv,jsdelivr:Dv,unpkg:Cv,typings:Lv,dependencies:Rv,bundlesize:jv},$n=Pv,Tt={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Sr={},Nv=$n.version.split(".");function yn(e,t){for(var r=t?t.split("."):Nv,n=e.split("."),a=0;a<3;a++){if(r[a]>n[a])return!0;if(r[a]<n[a])return!1}return!1}Tt.transitional=function(t,r,n){var a=r&&yn(r);function i(s,u){return"[Axios v"+$n.version+"] Transitional option '"+s+"'"+u+(n?". "+n:"")}return function(s,u,o){if(t===!1)throw new Error(i(u," has been removed in "+r));return a&&!Sr[u]&&(Sr[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,u,o):!0}};function xv(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[a],s=t[i];if(s){var u=e[i],o=u===void 0||s(u,i,e);if(o!==!0)throw new TypeError("option "+i+" must be "+o);continue}if(r!==!0)throw Error("Unknown option "+i)}}var Mv={isOlderVersion:yn,assertOptions:xv,validators:Tt},mn=G,Uv=hn,wr=Bd,Ir=pv,Ge=gn,bn=Mv,ne=bn.validators;function me(e){this.defaults=e,this.interceptors={request:new wr,response:new wr}}me.prototype.request=function(t){typeof t=="string"?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=Ge(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&bn.assertOptions(r,{silentJSONParsing:ne.transitional(ne.boolean,"1.0.0"),forcedJSONParsing:ne.transitional(ne.boolean,"1.0.0"),clarifyTimeoutError:ne.transitional(ne.boolean,"1.0.0")},!1);var n=[],a=!0;this.interceptors.request.forEach(function(c){typeof c.runWhen=="function"&&c.runWhen(t)===!1||(a=a&&c.synchronous,n.unshift(c.fulfilled,c.rejected))});var i=[];this.interceptors.response.forEach(function(c){i.push(c.fulfilled,c.rejected)});var s;if(!a){var u=[Ir,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(i),s=Promise.resolve(t);u.length;)s=s.then(u.shift(),u.shift());return s}for(var o=t;n.length;){var l=n.shift(),m=n.shift();try{o=l(o)}catch(v){m(v);break}}try{s=Ir(o)}catch(v){return Promise.reject(v)}for(;i.length;)s=s.then(i.shift(),i.shift());return s};me.prototype.getUri=function(t){return t=Ge(this.defaults,t),Uv(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};mn.forEach(["delete","get","head","options"],function(t){me.prototype[t]=function(r,n){return this.request(Ge(n||{},{method:t,url:r,data:(n||{}).data}))}});mn.forEach(["post","put","patch"],function(t){me.prototype[t]=function(r,n,a){return this.request(Ge(a||{},{method:t,url:r,data:n}))}});var Bv=me;function Ot(e){this.message=e}Ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ot.prototype.__CANCEL__=!0;var _n=Ot,Fv=_n;function Le(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(a){t=a});var r=this;e(function(a){r.reason||(r.reason=new Fv(a),t(r.reason))})}Le.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Le.source=function(){var t,r=new Le(function(a){t=a});return{token:r,cancel:t}};var Hv=Le,Yv=function(t){return function(n){return t.apply(null,n)}},Gv=function(t){return typeof t=="object"&&t.isAxiosError===!0},Dr=G,Vv=fn,we=Bv,Wv=gn,Kv=Et;function An(e){var t=new we(e),r=Vv(we.prototype.request,t);return Dr.extend(r,we.prototype,t),Dr.extend(r,t),r}var W=An(Kv);W.Axios=we;W.create=function(t){return An(Wv(W.defaults,t))};W.Cancel=_n;W.CancelToken=Hv;W.isCancel=pn;W.all=function(t){return Promise.all(t)};W.spread=Yv;W.isAxiosError=Gv;bt.exports=W;bt.exports.default=W;var qv=bt.exports;function En(e,t=600,r=!0,n,a){var O,w;if(!n||!a)throw new Error("baseUrl or tenant was not provided");const i=`${e}_${a}_${n}`,s=`${n.endsWith("/")?n.slice(0,-1):n}/cms-api/content/${a}/${e}`,u=((O=y())==null?void 0:O.value)||null,[o,l]=F.useState(((w=y())==null?void 0:w.timestamp)||0),[m,v]=F.useState(u||null),[c,h]=F.useState(!1);function $(){qv.get(s).then(E=>{if(dt(E.data))throw new Error(`CMS data '${e}' is an empty object`);en(E.data,m)||v(E.data),c&&h(!1),r&&f(E.data)}).catch(E=>{console.error(E),h(!0)})}function f(E){const P=new Date().valueOf(),D=JSON.stringify({value:E,timestamp:P});localStorage.setItem(i,D),l(P)}function y(){try{const E=localStorage.getItem(i);if(E)return JSON.parse(E)}catch(E){console.warn(E)}return null}return F.useEffect(()=>{new Date().valueOf()-o>t*1e3&&$()},[]),Re($,t*1e3),{value:m,isError:c,isLoading:!c&&!m}}function Tn(e,t=600,r=!0,n,a,i){var u,o,l,m;if(!n||!a||!i)throw new Error("baseUrl, tenant or venue was not provided");const s=En(e,t,r,n,a);return{value:((o=(u=s.value)==null?void 0:u.find)==null?void 0:o.call(u,v=>v.venue===i))||((m=(l=s.value)==null?void 0:l.find)==null?void 0:m.call(l,v=>v.venue==="*"))||null,isError:s.isError}}function zv(e,t,r,n=300,a=!0){var m,v,c,h;const i=F.useContext(On.ConfigContext);if(!i)throw new Error("Missing config context");const{value:s,isError:u}=Tn(e,n,a,i.baseUrl,i.tenant,t);let o=null,l=null;return s&&((m=s==null?void 0:s.url)==null?void 0:m.length)>0&&(o=((v=s.url.find($=>$.locale===r))==null?void 0:v.value)||((c=s.url.find($=>$.locale==="*"))==null?void 0:c.value)||null),!o&&s&&((h=s==null?void 0:s.url)==null?void 0:h.length)>0&&(l=s.url[0].value),{url:o,fallbackUrl:l,isError:u}}function kv(e,t){F.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function Jv(e){const[t,r]=F.useState(_e(e==null?void 0:e.DINE_IN)),[n,a]=F.useState(_e(e==null?void 0:e.TAKE_AWAY));function i(){const s=_e(e==null?void 0:e.DINE_IN),u=_e(e==null?void 0:e.TAKE_AWAY);s!==t&&(console.log("dine in open changed",t,"=>",s),r(s)),u!==n&&(console.log("take away open changed",n,"=>",u),a(u))}return F.useEffect(()=>{i()},[e]),Re(i,6e4),{dineInOpen:t,takeAwayOpen:n}}exports.getGroupedBucketLines=_d;exports.groupOrderLines=mt;exports.useAvailability=Qf;exports.useCms=En;exports.useDisplayPrice=md;exports.useGroupOrderLines=bd;exports.useInterval=Re;exports.useKioskChannelsAvailability=Jv;exports.useLocalizedVenueMedia=zv;exports.useOnClickOutside=kv;exports.useVenueCms=Tn;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var F=require("react"),On=require("@orderingstack/ordering-core-react");function Re(e,t){const r=F.useRef(),[n,a]=F.useState(null);return F.useEffect(()=>{r.current=e},[e]),F.useEffect(()=>{function i(){var s;(s=r.current)==null||s.call(r)}if(t!==null){const s=setInterval(i,t);return a(s),()=>{a(null),clearInterval(s)}}},[t]),()=>{n&&clearInterval(n)}}var X=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Sn=Object.prototype;function wn(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Sn;return e===r}var je=wn;function In(e,t){return function(r){return e(t(r))}}var Lr=In,Dn=Lr,Cn=Dn(Object.keys,Object),Ln=Cn,Rn=je,jn=Ln,Pn=Object.prototype,Nn=Pn.hasOwnProperty;function xn(e){if(!Rn(e))return jn(e);var t=[];for(var r in Object(e))Nn.call(e,r)&&r!="constructor"&&t.push(r);return t}var Rr=xn,Un=typeof X=="object"&&X&&X.Object===Object&&X,jr=Un,Mn=jr,Bn=typeof self=="object"&&self&&self.Object===Object&&self,Fn=Mn||Bn||Function("return this")(),q=Fn,Hn=q,Yn=Hn.Symbol,Pe=Yn,It=Pe,Pr=Object.prototype,Gn=Pr.hasOwnProperty,Kn=Pr.toString,ve=It?It.toStringTag:void 0;function Wn(e){var t=Gn.call(e,ve),r=e[ve];try{e[ve]=void 0;var n=!0}catch{}var a=Kn.call(e);return n&&(t?e[ve]=r:delete e[ve]),a}var qn=Wn,kn=Object.prototype,Vn=kn.toString;function Jn(e){return Vn.call(e)}var zn=Jn,Dt=Pe,Zn=qn,Xn=zn,Qn="[object Null]",ea="[object Undefined]",Ct=Dt?Dt.toStringTag:void 0;function ta(e){return e==null?e===void 0?ea:Qn:Ct&&Ct in Object(e)?Zn(e):Xn(e)}var Ne=ta;function ra(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ge=ra,na=Ne,aa=ge,ia="[object AsyncFunction]",sa="[object Function]",oa="[object GeneratorFunction]",ua="[object Proxy]";function fa(e){if(!aa(e))return!1;var t=na(e);return t==sa||t==oa||t==ia||t==ua}var Nr=fa,ca=q,la=ca["__core-js_shared__"],ha=la,We=ha,Lt=function(){var e=/[^.]+$/.exec(We&&We.keys&&We.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function va(e){return!!Lt&&Lt in e}var da=va,pa=Function.prototype,ga=pa.toString;function $a(e){if(e!=null){try{return ga.call(e)}catch{}try{return e+""}catch{}}return""}var xr=$a,ya=Nr,ma=da,ba=ge,_a=xr,Aa=/[\\^$.*+?()[\]{}|]/g,Ea=/^\[object .+?Constructor\]$/,Ta=Function.prototype,Oa=Object.prototype,Sa=Ta.toString,wa=Oa.hasOwnProperty,Ia=RegExp("^"+Sa.call(wa).replace(Aa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Da(e){if(!ba(e)||ma(e))return!1;var t=ya(e)?Ia:Ea;return t.test(_a(e))}var Ca=Da;function La(e,t){return e==null?void 0:e[t]}var Ra=La,ja=Ca,Pa=Ra;function Na(e,t){var r=Pa(e,t);return ja(r)?r:void 0}var Q=Na,xa=Q,Ua=q,Ma=xa(Ua,"DataView"),Ba=Ma,Fa=Q,Ha=q,Ya=Fa(Ha,"Map"),ft=Ya,Ga=Q,Ka=q,Wa=Ga(Ka,"Promise"),qa=Wa,ka=Q,Va=q,Ja=ka(Va,"Set"),za=Ja,Za=Q,Xa=q,Qa=Za(Xa,"WeakMap"),ei=Qa,Xe=Ba,Qe=ft,et=qa,tt=za,rt=ei,Ur=Ne,ie=xr,Rt="[object Map]",ti="[object Object]",jt="[object Promise]",Pt="[object Set]",Nt="[object WeakMap]",xt="[object DataView]",ri=ie(Xe),ni=ie(Qe),ai=ie(et),ii=ie(tt),si=ie(rt),Z=Ur;(Xe&&Z(new Xe(new ArrayBuffer(1)))!=xt||Qe&&Z(new Qe)!=Rt||et&&Z(et.resolve())!=jt||tt&&Z(new tt)!=Pt||rt&&Z(new rt)!=Nt)&&(Z=function(e){var t=Ur(e),r=t==ti?e.constructor:void 0,n=r?ie(r):"";if(n)switch(n){case ri:return xt;case ni:return Rt;case ai:return jt;case ii:return Pt;case si:return Nt}return t});var $e=Z;function oi(e){return e!=null&&typeof e=="object"}var se=oi,ui=Ne,fi=se,ci="[object Arguments]";function li(e){return fi(e)&&ui(e)==ci}var hi=li,Ut=hi,vi=se,Mr=Object.prototype,di=Mr.hasOwnProperty,pi=Mr.propertyIsEnumerable,gi=Ut(function(){return arguments}())?Ut:function(e){return vi(e)&&di.call(e,"callee")&&!pi.call(e,"callee")},Br=gi,$i=Array.isArray,ye=$i,yi=9007199254740991;function mi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yi}var Fr=mi,bi=Nr,_i=Fr;function Ai(e){return e!=null&&_i(e.length)&&!bi(e)}var ct=Ai,ae={exports:{}};function Ei(){return!1}var Ti=Ei;(function(e,t){var r=q,n=Ti,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,u=s?r.Buffer:void 0,o=u?u.isBuffer:void 0,l=o||n;e.exports=l})(ae,ae.exports);var Oi=Ne,Si=Fr,wi=se,Ii="[object Arguments]",Di="[object Array]",Ci="[object Boolean]",Li="[object Date]",Ri="[object Error]",ji="[object Function]",Pi="[object Map]",Ni="[object Number]",xi="[object Object]",Ui="[object RegExp]",Mi="[object Set]",Bi="[object String]",Fi="[object WeakMap]",Hi="[object ArrayBuffer]",Yi="[object DataView]",Gi="[object Float32Array]",Ki="[object Float64Array]",Wi="[object Int8Array]",qi="[object Int16Array]",ki="[object Int32Array]",Vi="[object Uint8Array]",Ji="[object Uint8ClampedArray]",zi="[object Uint16Array]",Zi="[object Uint32Array]",R={};R[Gi]=R[Ki]=R[Wi]=R[qi]=R[ki]=R[Vi]=R[Ji]=R[zi]=R[Zi]=!0;R[Ii]=R[Di]=R[Hi]=R[Ci]=R[Yi]=R[Li]=R[Ri]=R[ji]=R[Pi]=R[Ni]=R[xi]=R[Ui]=R[Mi]=R[Bi]=R[Fi]=!1;function Xi(e){return wi(e)&&Si(e.length)&&!!R[Oi(e)]}var Qi=Xi;function es(e){return function(t){return e(t)}}var lt=es,de={exports:{}};(function(e,t){var r=jr,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,u=function(){try{var o=a&&a.require&&a.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}}();e.exports=u})(de,de.exports);var ts=Qi,rs=lt,Mt=de.exports,Bt=Mt&&Mt.isTypedArray,ns=Bt?rs(Bt):ts,ht=ns,as=Rr,is=$e,ss=Br,os=ye,us=ct,fs=ae.exports,cs=je,ls=ht,hs="[object Map]",vs="[object Set]",ds=Object.prototype,ps=ds.hasOwnProperty;function gs(e){if(e==null)return!0;if(us(e)&&(os(e)||typeof e=="string"||typeof e.splice=="function"||fs(e)||ls(e)||ss(e)))return!e.length;var t=is(e);if(t==hs||t==vs)return!e.size;if(cs(e))return!as(e).length;for(var r in e)if(ps.call(e,r))return!1;return!0}var vt=gs,Hr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(X,function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(i,s,u){var o=s.prototype;u.utc=function(c){var m={date:c,utc:!0,args:arguments};return new s(m)},o.utc=function(c){var m=u(this.toDate(),{locale:this.$L,utc:!0});return c?m.add(this.utcOffset(),r):m},o.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var l=o.parse;o.parse=function(c){c.utc&&(this.$u=!0),this.$utils().u(c.$offset)||(this.$offset=c.$offset),l.call(this,c)};var y=o.init;o.init=function(){if(this.$u){var c=this.$d;this.$y=c.getUTCFullYear(),this.$M=c.getUTCMonth(),this.$D=c.getUTCDate(),this.$W=c.getUTCDay(),this.$H=c.getUTCHours(),this.$m=c.getUTCMinutes(),this.$s=c.getUTCSeconds(),this.$ms=c.getUTCMilliseconds()}else y.call(this)};var v=o.utcOffset;o.utcOffset=function(c,m){var O=this.$utils().u;if(O(c))return this.$u?0:O(this.$offset)?v.call(this):this.$offset;if(typeof c=="string"&&(c=function(D){D===void 0&&(D="");var B=D.match(n);if(!B)return null;var H=(""+B[0]).match(a)||["-",0,0],K=H[0],C=60*+H[1]+ +H[2];return C===0?0:K==="+"?C:-C}(c),c===null))return this;var w=Math.abs(c)<=16?60*c:c,E=this;if(m)return E.$offset=w,E.$u=c===0,E;if(c!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(E=this.local().add(w+P,r)).$offset=w,E.$x.$localOffset=P}else E=this.utc();return E};var f=o.format;o.format=function(c){var m=c||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,m)},o.valueOf=function(){var c=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*c},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(c){return c==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var $=o.diff;o.diff=function(c,m,O){if(c&&this.$u===c.$u)return $.call(this,c,m,O);var w=this.local(),E=u(c).local();return $.call(w,E,m,O)}}})})(Hr);var $s=Hr.exports,Yr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(X,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(a,i,s){var u,o=function(f,h,$){$===void 0&&($={});var c=new Date(f),m=function(O,w){w===void 0&&(w={});var E=w.timeZoneName||"short",P=O+"|"+E,D=n[P];return D||(D=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:O,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:E}),n[P]=D),D}(h,$);return m.formatToParts(c)},l=function(f,h){for(var $=o(f,h),c=[],m=0;m<$.length;m+=1){var O=$[m],w=O.type,E=O.value,P=r[w];P>=0&&(c[P]=parseInt(E,10))}var D=c[3],B=D===24?0:D,H=c[0]+"-"+c[1]+"-"+c[2]+" "+B+":"+c[4]+":"+c[5]+":000",K=+f;return(s.utc(H).valueOf()-(K-=K%1e3))/6e4},y=i.prototype;y.tz=function(f,h){f===void 0&&(f=u);var $=this.utcOffset(),c=this.toDate(),m=c.toLocaleString("en-US",{timeZone:f}),O=Math.round((c-new Date(m))/1e3/60),w=s(m).$set("millisecond",this.$ms).utcOffset(15*-Math.round(c.getTimezoneOffset()/15)-O,!0);if(h){var E=w.utcOffset();w=w.add($-E,"minute")}return w.$x.$timezone=f,w},y.offsetName=function(f){var h=this.$x.$timezone||s.tz.guess(),$=o(this.valueOf(),h,{timeZoneName:f}).find(function(c){return c.type.toLowerCase()==="timezonename"});return $&&$.value};var v=y.startOf;y.startOf=function(f,h){if(!this.$x||!this.$x.$timezone)return v.call(this,f,h);var $=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return v.call($,f,h).tz(this.$x.$timezone,!0)},s.tz=function(f,h,$){var c=$&&h,m=$||h||u,O=l(+s(),m);if(typeof f!="string")return s(f).tz(m);var w=function(B,H,K){var C=B-60*H*1e3,S=l(C,K);if(H===S)return[C,H];var V=l(C-=60*(S-H)*1e3,K);return S===V?[C,S]:[B-60*Math.min(S,V)*1e3,Math.max(S,V)]}(s.utc(f,c).valueOf(),O,m),E=w[0],P=w[1],D=s(E).utcOffset(P);return D.$x.$timezone=m,D},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(f){u=f}}})})(Yr);var ys=Yr.exports,Gr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(X,function(){var r=1e3,n=6e4,a=36e5,i="millisecond",s="second",u="minute",o="hour",l="day",y="week",v="month",f="quarter",h="year",$="date",c="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},E=function(T,g,d){var b=String(T);return!b||b.length>=g?T:""+Array(g+1-b.length).join(d)+T},P={s:E,z:function(T){var g=-T.utcOffset(),d=Math.abs(g),b=Math.floor(d/60),p=d%60;return(g<=0?"+":"-")+E(b,2,"0")+":"+E(p,2,"0")},m:function T(g,d){if(g.date()<d.date())return-T(d,g);var b=12*(d.year()-g.year())+(d.month()-g.month()),p=g.clone().add(b,v),A=d-p<0,_=g.clone().add(b+(A?-1:1),v);return+(-(b+(d-p)/(A?p-_:_-p))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:v,y:h,w:y,d:l,D:$,h:o,m:u,s,ms:i,Q:f}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},D="en",B={};B[D]=w;var H=function(T){return T instanceof V},K=function T(g,d,b){var p;if(!g)return D;if(typeof g=="string"){var A=g.toLowerCase();B[A]&&(p=A),d&&(B[A]=d,p=A);var _=g.split("-");if(!p&&_.length>1)return T(_[0])}else{var I=g.name;B[I]=g,p=I}return!b&&p&&(D=p),p||!b&&D},C=function(T,g){if(H(T))return T.clone();var d=typeof g=="object"?g:{};return d.date=T,d.args=arguments,new V(d)},S=P;S.l=K,S.i=H,S.w=function(T,g){return C(T,{locale:g.$L,utc:g.$u,x:g.$x,$offset:g.$offset})};var V=function(){function T(d){this.$L=K(d.locale,null,!0),this.parse(d)}var g=T.prototype;return g.parse=function(d){this.$d=function(b){var p=b.date,A=b.utc;if(p===null)return new Date(NaN);if(S.u(p))return new Date;if(p instanceof Date)return new Date(p);if(typeof p=="string"&&!/Z$/i.test(p)){var _=p.match(m);if(_){var I=_[2]-1||0,N=(_[7]||"0").substring(0,3);return A?new Date(Date.UTC(_[1],I,_[3]||1,_[4]||0,_[5]||0,_[6]||0,N)):new Date(_[1],I,_[3]||1,_[4]||0,_[5]||0,_[6]||0,N)}}return new Date(p)}(d),this.$x=d.x||{},this.init()},g.init=function(){var d=this.$d;this.$y=d.getFullYear(),this.$M=d.getMonth(),this.$D=d.getDate(),this.$W=d.getDay(),this.$H=d.getHours(),this.$m=d.getMinutes(),this.$s=d.getSeconds(),this.$ms=d.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return this.$d.toString()!==c},g.isSame=function(d,b){var p=C(d);return this.startOf(b)<=p&&p<=this.endOf(b)},g.isAfter=function(d,b){return C(d)<this.startOf(b)},g.isBefore=function(d,b){return this.endOf(b)<C(d)},g.$g=function(d,b,p){return S.u(d)?this[b]:this.set(p,d)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(d,b){var p=this,A=!!S.u(b)||b,_=S.p(d),I=function(te,Y){var z=S.w(p.$u?Date.UTC(p.$y,Y,te):new Date(p.$y,Y,te),p);return A?z:z.endOf(l)},N=function(te,Y){return S.w(p.toDate()[te].apply(p.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(Y)),p)},j=this.$W,U=this.$M,J=this.$D,k="set"+(this.$u?"UTC":"");switch(_){case h:return A?I(1,0):I(31,11);case v:return A?I(1,U):I(0,U+1);case y:var le=this.$locale().weekStart||0,he=(j<le?j+7:j)-le;return I(A?J-he:J+(6-he),U);case l:case $:return N(k+"Hours",0);case o:return N(k+"Minutes",1);case u:return N(k+"Seconds",2);case s:return N(k+"Milliseconds",3);default:return this.clone()}},g.endOf=function(d){return this.startOf(d,!1)},g.$set=function(d,b){var p,A=S.p(d),_="set"+(this.$u?"UTC":""),I=(p={},p[l]=_+"Date",p[$]=_+"Date",p[v]=_+"Month",p[h]=_+"FullYear",p[o]=_+"Hours",p[u]=_+"Minutes",p[s]=_+"Seconds",p[i]=_+"Milliseconds",p)[A],N=A===l?this.$D+(b-this.$W):b;if(A===v||A===h){var j=this.clone().set($,1);j.$d[I](N),j.init(),this.$d=j.set($,Math.min(this.$D,j.daysInMonth())).$d}else I&&this.$d[I](N);return this.init(),this},g.set=function(d,b){return this.clone().$set(d,b)},g.get=function(d){return this[S.p(d)]()},g.add=function(d,b){var p,A=this;d=Number(d);var _=S.p(b),I=function(U){var J=C(A);return S.w(J.date(J.date()+Math.round(U*d)),A)};if(_===v)return this.set(v,this.$M+d);if(_===h)return this.set(h,this.$y+d);if(_===l)return I(1);if(_===y)return I(7);var N=(p={},p[u]=n,p[o]=a,p[s]=r,p)[_]||1,j=this.$d.getTime()+d*N;return S.w(j,this)},g.subtract=function(d,b){return this.add(-1*d,b)},g.format=function(d){var b=this,p=this.$locale();if(!this.isValid())return p.invalidDate||c;var A=d||"YYYY-MM-DDTHH:mm:ssZ",_=S.z(this),I=this.$H,N=this.$m,j=this.$M,U=p.weekdays,J=p.months,k=function(Y,z,Ke,be){return Y&&(Y[z]||Y(b,A))||Ke[z].slice(0,be)},le=function(Y){return S.s(I%12||12,Y,"0")},he=p.meridiem||function(Y,z,Ke){var be=Y<12?"AM":"PM";return Ke?be.toLowerCase():be},te={YY:String(this.$y).slice(-2),YYYY:this.$y,M:j+1,MM:S.s(j+1,2,"0"),MMM:k(p.monthsShort,j,J,3),MMMM:k(J,j),D:this.$D,DD:S.s(this.$D,2,"0"),d:String(this.$W),dd:k(p.weekdaysMin,this.$W,U,2),ddd:k(p.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(I),HH:S.s(I,2,"0"),h:le(1),hh:le(2),a:he(I,N,!0),A:he(I,N,!1),m:String(N),mm:S.s(N,2,"0"),s:String(this.$s),ss:S.s(this.$s,2,"0"),SSS:S.s(this.$ms,3,"0"),Z:_};return A.replace(O,function(Y,z){return z||te[Y]||_.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(d,b,p){var A,_=S.p(b),I=C(d),N=(I.utcOffset()-this.utcOffset())*n,j=this-I,U=S.m(this,I);return U=(A={},A[h]=U/12,A[v]=U,A[f]=U/3,A[y]=(j-N)/6048e5,A[l]=(j-N)/864e5,A[o]=j/a,A[u]=j/n,A[s]=j/r,A)[_]||j,p?U:S.a(U)},g.daysInMonth=function(){return this.endOf(v).$D},g.$locale=function(){return B[this.$L]},g.locale=function(d,b){if(!d)return this.$L;var p=this.clone(),A=K(d,b,!0);return A&&(p.$L=A),p},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},T}(),wt=V.prototype;return C.prototype=wt,[["$ms",i],["$s",s],["$m",u],["$H",o],["$W",l],["$M",v],["$y",h],["$D",$]].forEach(function(T){wt[T[1]]=function(g){return this.$g(g,T[0],T[1])}}),C.extend=function(T,g){return T.$i||(T(g,V,C),T.$i=!0),C},C.locale=K,C.isDayjs=H,C.unix=function(T){return C(1e3*T)},C.en=B[D],C.Ls=B,C.p={},C})})(Gr);var pe=Gr.exports;pe.extend($s);pe.extend(ys);const Kr=["SUN","MON","TUE","WED","THU","FRI","SAT"],Ie=e=>{const[t,r]=e.split(":");return{hour:parseInt(t||"0",10),minutes:parseInt(r||"0",10)}};function nt(e,t,r){const{availability:n}=e;if(!n)return!0;if(vt(n))return!1;const a=r?pe(r).tz(t):pe().tz(t),i=a.day(),s=n[Kr[i]];if(!Array.isArray(s)||s.length!==2)return!1;const u=a.hour(),o=a.minute(),l=Ie(s[0]),y=Ie(s[1]);return u<l.hour||u===l.hour&&o<l.minutes?!1:!(u>y.hour||u===y.hour&&o>y.minutes)}const at=(e,t=void 0,r=void 0,n=!1)=>n?e.map(i=>{let s;return Array.isArray(i.items)&&(s=at(i.items,t,r,n)),{...i,items:s,outsideAvailabilitySlot:!nt(i,t,r)||(s==null?void 0:s.every(u=>u.outsideAvailabilitySlot))||!1}}):e.filter(i=>nt(i,t,r)).map(i=>Array.isArray(i.items)?{...i,items:at(i.items,t,r)}:i),Ft=(e,t=void 0,r=void 0,n=!1)=>{let a=[];return e.forEach(i=>{if(!Array.isArray(i.items)){a.push(i);return}const s=at(i.items,t,r,n);s.length>0&&a.push({...i,items:s})}),n&&(a=a.map(i=>!i.items||!Array.isArray(i.items)?i:{...i,outsideAvailabilitySlot:!nt(i,t,r)||i.items.every(s=>s.outsideAvailabilitySlot)})),a};function _e(e){const t=e==null?void 0:e.week;if(!e||!e.active||!t)return!1;const r=pe(),n=r.day(),a=t[Kr[n]];return a?a.some(i=>ms(r,i)):!1}function ms(e,t){const r=e.hour(),n=e.minute(),a=Ie(t.from),i=Ie(t.to);return r<a.hour||r===a.hour&&n<a.minutes?!1:!(r>i.hour||r===i.hour&&n>i.minutes)}function bs(){this.__data__=[],this.size=0}var _s=bs;function As(e,t){return e===t||e!==e&&t!==t}var dt=As,Es=dt;function Ts(e,t){for(var r=e.length;r--;)if(Es(e[r][0],t))return r;return-1}var xe=Ts,Os=xe,Ss=Array.prototype,ws=Ss.splice;function Is(e){var t=this.__data__,r=Os(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():ws.call(t,r,1),--this.size,!0}var Ds=Is,Cs=xe;function Ls(e){var t=this.__data__,r=Cs(t,e);return r<0?void 0:t[r][1]}var Rs=Ls,js=xe;function Ps(e){return js(this.__data__,e)>-1}var Ns=Ps,xs=xe;function Us(e,t){var r=this.__data__,n=xs(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Ms=Us,Bs=_s,Fs=Ds,Hs=Rs,Ys=Ns,Gs=Ms;function oe(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}oe.prototype.clear=Bs;oe.prototype.delete=Fs;oe.prototype.get=Hs;oe.prototype.has=Ys;oe.prototype.set=Gs;var Ue=oe,Ks=Ue;function Ws(){this.__data__=new Ks,this.size=0}var qs=Ws;function ks(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Vs=ks;function Js(e){return this.__data__.get(e)}var zs=Js;function Zs(e){return this.__data__.has(e)}var Xs=Zs,Qs=Q,eo=Qs(Object,"create"),Me=eo,Ht=Me;function to(){this.__data__=Ht?Ht(null):{},this.size=0}var ro=to;function no(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ao=no,io=Me,so="__lodash_hash_undefined__",oo=Object.prototype,uo=oo.hasOwnProperty;function fo(e){var t=this.__data__;if(io){var r=t[e];return r===so?void 0:r}return uo.call(t,e)?t[e]:void 0}var co=fo,lo=Me,ho=Object.prototype,vo=ho.hasOwnProperty;function po(e){var t=this.__data__;return lo?t[e]!==void 0:vo.call(t,e)}var go=po,$o=Me,yo="__lodash_hash_undefined__";function mo(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=$o&&t===void 0?yo:t,this}var bo=mo,_o=ro,Ao=ao,Eo=co,To=go,Oo=bo;function ue(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ue.prototype.clear=_o;ue.prototype.delete=Ao;ue.prototype.get=Eo;ue.prototype.has=To;ue.prototype.set=Oo;var So=ue,Yt=So,wo=Ue,Io=ft;function Do(){this.size=0,this.__data__={hash:new Yt,map:new(Io||wo),string:new Yt}}var Co=Do;function Lo(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Ro=Lo,jo=Ro;function Po(e,t){var r=e.__data__;return jo(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Be=Po,No=Be;function xo(e){var t=No(this,e).delete(e);return this.size-=t?1:0,t}var Uo=xo,Mo=Be;function Bo(e){return Mo(this,e).get(e)}var Fo=Bo,Ho=Be;function Yo(e){return Ho(this,e).has(e)}var Go=Yo,Ko=Be;function Wo(e,t){var r=Ko(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var qo=Wo,ko=Co,Vo=Uo,Jo=Fo,zo=Go,Zo=qo;function fe(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}fe.prototype.clear=ko;fe.prototype.delete=Vo;fe.prototype.get=Jo;fe.prototype.has=zo;fe.prototype.set=Zo;var Wr=fe,Xo=Ue,Qo=ft,eu=Wr,tu=200;function ru(e,t){var r=this.__data__;if(r instanceof Xo){var n=r.__data__;if(!Qo||n.length<tu-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new eu(n)}return r.set(e,t),this.size=r.size,this}var nu=ru,au=Ue,iu=qs,su=Vs,ou=zs,uu=Xs,fu=nu;function ce(e){var t=this.__data__=new au(e);this.size=t.size}ce.prototype.clear=iu;ce.prototype.delete=su;ce.prototype.get=ou;ce.prototype.has=uu;ce.prototype.set=fu;var qr=ce,cu="__lodash_hash_undefined__";function lu(e){return this.__data__.set(e,cu),this}var hu=lu;function vu(e){return this.__data__.has(e)}var du=vu,pu=Wr,gu=hu,$u=du;function De(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new pu;++t<r;)this.add(e[t])}De.prototype.add=De.prototype.push=gu;De.prototype.has=$u;var yu=De;function mu(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var bu=mu;function _u(e,t){return e.has(t)}var Au=_u,Eu=yu,Tu=bu,Ou=Au,Su=1,wu=2;function Iu(e,t,r,n,a,i){var s=r&Su,u=e.length,o=t.length;if(u!=o&&!(s&&o>u))return!1;var l=i.get(e),y=i.get(t);if(l&&y)return l==t&&y==e;var v=-1,f=!0,h=r&wu?new Eu:void 0;for(i.set(e,t),i.set(t,e);++v<u;){var $=e[v],c=t[v];if(n)var m=s?n(c,$,v,t,e,i):n($,c,v,e,t,i);if(m!==void 0){if(m)continue;f=!1;break}if(h){if(!Tu(t,function(O,w){if(!Ou(h,w)&&($===O||a($,O,r,n,i)))return h.push(w)})){f=!1;break}}else if(!($===c||a($,c,r,n,i))){f=!1;break}}return i.delete(e),i.delete(t),f}var kr=Iu,Du=q,Cu=Du.Uint8Array,Vr=Cu;function Lu(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var Ru=Lu;function ju(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Pu=ju,Gt=Pe,Kt=Vr,Nu=dt,xu=kr,Uu=Ru,Mu=Pu,Bu=1,Fu=2,Hu="[object Boolean]",Yu="[object Date]",Gu="[object Error]",Ku="[object Map]",Wu="[object Number]",qu="[object RegExp]",ku="[object Set]",Vu="[object String]",Ju="[object Symbol]",zu="[object ArrayBuffer]",Zu="[object DataView]",Wt=Gt?Gt.prototype:void 0,qe=Wt?Wt.valueOf:void 0;function Xu(e,t,r,n,a,i,s){switch(r){case Zu:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case zu:return!(e.byteLength!=t.byteLength||!i(new Kt(e),new Kt(t)));case Hu:case Yu:case Wu:return Nu(+e,+t);case Gu:return e.name==t.name&&e.message==t.message;case qu:case Vu:return e==t+"";case Ku:var u=Uu;case ku:var o=n&Bu;if(u||(u=Mu),e.size!=t.size&&!o)return!1;var l=s.get(e);if(l)return l==t;n|=Fu,s.set(e,t);var y=xu(u(e),u(t),n,a,i,s);return s.delete(e),y;case Ju:if(qe)return qe.call(e)==qe.call(t)}return!1}var Qu=Xu;function ef(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var Jr=ef,tf=Jr,rf=ye;function nf(e,t,r){var n=t(e);return rf(e)?n:tf(n,r(e))}var zr=nf;function af(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[a++]=s)}return i}var sf=af;function of(){return[]}var Zr=of,uf=sf,ff=Zr,cf=Object.prototype,lf=cf.propertyIsEnumerable,qt=Object.getOwnPropertySymbols,hf=qt?function(e){return e==null?[]:(e=Object(e),uf(qt(e),function(t){return lf.call(e,t)}))}:ff,pt=hf;function vf(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var df=vf,pf=9007199254740991,gf=/^(?:0|[1-9]\d*)$/;function $f(e,t){var r=typeof e;return t=t==null?pf:t,!!t&&(r=="number"||r!="symbol"&&gf.test(e))&&e>-1&&e%1==0&&e<t}var yf=$f,mf=df,bf=Br,_f=ye,Af=ae.exports,Ef=yf,Tf=ht,Of=Object.prototype,Sf=Of.hasOwnProperty;function wf(e,t){var r=_f(e),n=!r&&bf(e),a=!r&&!n&&Af(e),i=!r&&!n&&!a&&Tf(e),s=r||n||a||i,u=s?mf(e.length,String):[],o=u.length;for(var l in e)(t||Sf.call(e,l))&&!(s&&(l=="length"||a&&(l=="offset"||l=="parent")||i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ef(l,o)))&&u.push(l);return u}var Xr=wf,If=Xr,Df=Rr,Cf=ct;function Lf(e){return Cf(e)?If(e):Df(e)}var gt=Lf,Rf=zr,jf=pt,Pf=gt;function Nf(e){return Rf(e,Pf,jf)}var Qr=Nf,kt=Qr,xf=1,Uf=Object.prototype,Mf=Uf.hasOwnProperty;function Bf(e,t,r,n,a,i){var s=r&xf,u=kt(e),o=u.length,l=kt(t),y=l.length;if(o!=y&&!s)return!1;for(var v=o;v--;){var f=u[v];if(!(s?f in t:Mf.call(t,f)))return!1}var h=i.get(e),$=i.get(t);if(h&&$)return h==t&&$==e;var c=!0;i.set(e,t),i.set(t,e);for(var m=s;++v<o;){f=u[v];var O=e[f],w=t[f];if(n)var E=s?n(w,O,f,t,e,i):n(O,w,f,e,t,i);if(!(E===void 0?O===w||a(O,w,r,n,i):E)){c=!1;break}m||(m=f=="constructor")}if(c&&!m){var P=e.constructor,D=t.constructor;P!=D&&"constructor"in e&&"constructor"in t&&!(typeof P=="function"&&P instanceof P&&typeof D=="function"&&D instanceof D)&&(c=!1)}return i.delete(e),i.delete(t),c}var Ff=Bf,ke=qr,Hf=kr,Yf=Qu,Gf=Ff,Vt=$e,Jt=ye,zt=ae.exports,Kf=ht,Wf=1,Zt="[object Arguments]",Xt="[object Array]",Ae="[object Object]",qf=Object.prototype,Qt=qf.hasOwnProperty;function kf(e,t,r,n,a,i){var s=Jt(e),u=Jt(t),o=s?Xt:Vt(e),l=u?Xt:Vt(t);o=o==Zt?Ae:o,l=l==Zt?Ae:l;var y=o==Ae,v=l==Ae,f=o==l;if(f&&zt(e)){if(!zt(t))return!1;s=!0,y=!1}if(f&&!y)return i||(i=new ke),s||Kf(e)?Hf(e,t,r,n,a,i):Yf(e,t,o,r,n,a,i);if(!(r&Wf)){var h=y&&Qt.call(e,"__wrapped__"),$=v&&Qt.call(t,"__wrapped__");if(h||$){var c=h?e.value():e,m=$?t.value():t;return i||(i=new ke),a(c,m,r,n,i)}}return f?(i||(i=new ke),Gf(e,t,r,n,a,i)):!1}var Vf=kf,Jf=Vf,er=se;function en(e,t,r,n,a){return e===t?!0:e==null||t==null||!er(e)&&!er(t)?e!==e&&t!==t:Jf(e,t,r,n,en,a)}var zf=en,Zf=zf;function Xf(e,t){return Zf(e,t)}var tn=Xf;function Qf(e,t=!1,r=void 0,n=60){const[a,i]=F.useState(e&&Ft(e,r,void 0,t));Re(s,n*1e3);function s(){const u=e&&Ft(e,r,void 0,t);tn(u,a)||(console.log("menu has changed",u),i(u))}return F.useEffect(s,[a,e]),a}var tr;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(tr||(tr={}));var rr;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(rr||(rr={}));var it;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query"})(it||(it={}));var nr;(function(e){e.GROUP="group",e.PRODUCT="product"})(nr||(nr={}));var ar;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN"})(ar||(ar={}));var ir;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(ir||(ir={}));var sr;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(sr||(sr={}));var or;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT"})(or||(or={}));var ur;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(ur||(ur={}));var fr;(function(e){e.GROUP="group",e.PRODUCT="product"})(fr||(fr={}));var cr;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.UBER_DELIVERY="UBER_DELIVERY",e.BOLT_DELIVERY="BOLT_DELIVERY",e.WOLT_DELIVERY="WOLT_DELIVERY"})(cr||(cr={}));function ec(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var tc=ec,rc=Q,nc=function(){try{var e=rc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),ac=nc,lr=ac;function ic(e,t,r){t=="__proto__"&&lr?lr(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var rn=ic,sc=rn,oc=dt,uc=Object.prototype,fc=uc.hasOwnProperty;function cc(e,t,r){var n=e[t];(!(fc.call(e,t)&&oc(n,r))||r===void 0&&!(t in e))&&sc(e,t,r)}var nn=cc,lc=nn,hc=rn;function vc(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var u=t[i],o=n?n(r[u],e[u],u,r,e):void 0;o===void 0&&(o=e[u]),a?hc(r,u,o):lc(r,u,o)}return r}var Fe=vc,dc=Fe,pc=gt;function gc(e,t){return e&&dc(t,pc(t),e)}var $c=gc;function yc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var mc=yc,bc=ge,_c=je,Ac=mc,Ec=Object.prototype,Tc=Ec.hasOwnProperty;function Oc(e){if(!bc(e))return Ac(e);var t=_c(e),r=[];for(var n in e)n=="constructor"&&(t||!Tc.call(e,n))||r.push(n);return r}var Sc=Oc,wc=Xr,Ic=Sc,Dc=ct;function Cc(e){return Dc(e)?wc(e,!0):Ic(e)}var $t=Cc,Lc=Fe,Rc=$t;function jc(e,t){return e&&Lc(t,Rc(t),e)}var Pc=jc,st={exports:{}};(function(e,t){var r=q,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,u=s?s.allocUnsafe:void 0;function o(l,y){if(y)return l.slice();var v=l.length,f=u?u(v):new l.constructor(v);return l.copy(f),f}e.exports=o})(st,st.exports);function Nc(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var xc=Nc,Uc=Fe,Mc=pt;function Bc(e,t){return Uc(e,Mc(e),t)}var Fc=Bc,Hc=Lr,Yc=Hc(Object.getPrototypeOf,Object),an=Yc,Gc=Jr,Kc=an,Wc=pt,qc=Zr,kc=Object.getOwnPropertySymbols,Vc=kc?function(e){for(var t=[];e;)Gc(t,Wc(e)),e=Kc(e);return t}:qc,sn=Vc,Jc=Fe,zc=sn;function Zc(e,t){return Jc(e,zc(e),t)}var Xc=Zc,Qc=zr,el=sn,tl=$t;function rl(e){return Qc(e,tl,el)}var nl=rl,al=Object.prototype,il=al.hasOwnProperty;function sl(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&il.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var ol=sl,hr=Vr;function ul(e){var t=new e.constructor(e.byteLength);return new hr(t).set(new hr(e)),t}var yt=ul,fl=yt;function cl(e,t){var r=t?fl(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var ll=cl,hl=/\w*$/;function vl(e){var t=new e.constructor(e.source,hl.exec(e));return t.lastIndex=e.lastIndex,t}var dl=vl,vr=Pe,dr=vr?vr.prototype:void 0,pr=dr?dr.valueOf:void 0;function pl(e){return pr?Object(pr.call(e)):{}}var gl=pl,$l=yt;function yl(e,t){var r=t?$l(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var ml=yl,bl=yt,_l=ll,Al=dl,El=gl,Tl=ml,Ol="[object Boolean]",Sl="[object Date]",wl="[object Map]",Il="[object Number]",Dl="[object RegExp]",Cl="[object Set]",Ll="[object String]",Rl="[object Symbol]",jl="[object ArrayBuffer]",Pl="[object DataView]",Nl="[object Float32Array]",xl="[object Float64Array]",Ul="[object Int8Array]",Ml="[object Int16Array]",Bl="[object Int32Array]",Fl="[object Uint8Array]",Hl="[object Uint8ClampedArray]",Yl="[object Uint16Array]",Gl="[object Uint32Array]";function Kl(e,t,r){var n=e.constructor;switch(t){case jl:return bl(e);case Ol:case Sl:return new n(+e);case Pl:return _l(e,r);case Nl:case xl:case Ul:case Ml:case Bl:case Fl:case Hl:case Yl:case Gl:return Tl(e,r);case wl:return new n;case Il:case Ll:return new n(e);case Dl:return Al(e);case Cl:return new n;case Rl:return El(e)}}var Wl=Kl,ql=ge,gr=Object.create,kl=function(){function e(){}return function(t){if(!ql(t))return{};if(gr)return gr(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Vl=kl,Jl=Vl,zl=an,Zl=je;function Xl(e){return typeof e.constructor=="function"&&!Zl(e)?Jl(zl(e)):{}}var Ql=Xl,eh=$e,th=se,rh="[object Map]";function nh(e){return th(e)&&eh(e)==rh}var ah=nh,ih=ah,sh=lt,$r=de.exports,yr=$r&&$r.isMap,oh=yr?sh(yr):ih,uh=oh,fh=$e,ch=se,lh="[object Set]";function hh(e){return ch(e)&&fh(e)==lh}var vh=hh,dh=vh,ph=lt,mr=de.exports,br=mr&&mr.isSet,gh=br?ph(br):dh,$h=gh,yh=qr,mh=tc,bh=nn,_h=$c,Ah=Pc,Eh=st.exports,Th=xc,Oh=Fc,Sh=Xc,wh=Qr,Ih=nl,Dh=$e,Ch=ol,Lh=Wl,Rh=Ql,jh=ye,Ph=ae.exports,Nh=uh,xh=ge,Uh=$h,Mh=gt,Bh=$t,Fh=1,Hh=2,Yh=4,on="[object Arguments]",Gh="[object Array]",Kh="[object Boolean]",Wh="[object Date]",qh="[object Error]",un="[object Function]",kh="[object GeneratorFunction]",Vh="[object Map]",Jh="[object Number]",fn="[object Object]",zh="[object RegExp]",Zh="[object Set]",Xh="[object String]",Qh="[object Symbol]",ev="[object WeakMap]",tv="[object ArrayBuffer]",rv="[object DataView]",nv="[object Float32Array]",av="[object Float64Array]",iv="[object Int8Array]",sv="[object Int16Array]",ov="[object Int32Array]",uv="[object Uint8Array]",fv="[object Uint8ClampedArray]",cv="[object Uint16Array]",lv="[object Uint32Array]",L={};L[on]=L[Gh]=L[tv]=L[rv]=L[Kh]=L[Wh]=L[nv]=L[av]=L[iv]=L[sv]=L[ov]=L[Vh]=L[Jh]=L[fn]=L[zh]=L[Zh]=L[Xh]=L[Qh]=L[uv]=L[fv]=L[cv]=L[lv]=!0;L[qh]=L[un]=L[ev]=!1;function Oe(e,t,r,n,a,i){var s,u=t&Fh,o=t&Hh,l=t&Yh;if(r&&(s=a?r(e,n,a,i):r(e)),s!==void 0)return s;if(!xh(e))return e;var y=jh(e);if(y){if(s=Ch(e),!u)return Th(e,s)}else{var v=Dh(e),f=v==un||v==kh;if(Ph(e))return Eh(e,u);if(v==fn||v==on||f&&!a){if(s=o||f?{}:Rh(e),!u)return o?Sh(e,Ah(s,e)):Oh(e,_h(s,e))}else{if(!L[v])return a?e:{};s=Lh(e,v,u)}}i||(i=new yh);var h=i.get(e);if(h)return h;i.set(e,s),Uh(e)?e.forEach(function(m){s.add(Oe(m,t,r,m,e,i))}):Nh(e)&&e.forEach(function(m,O){s.set(O,Oe(m,t,r,O,e,i))});var $=l?o?Ih:wh:o?Bh:Mh,c=y?void 0:$(e);return mh(c||e,function(m,O){c&&(O=m,m=e[O]),bh(s,O,Oe(m,t,r,O,e,i))}),s}var hv=Oe,vv=hv,dv=1,pv=4;function gv(e){return vv(e,dv|pv)}var $v=gv;function yv(e,t){if(!t||!t.filter||!e||!e.filter||e.kind!==it.CONFIG)return!0;if(e.filter&&e.items){const r=Object.values(e.filter).flat().filter(n=>{var a,i,s,u;return t.filter[(i=(a=e.items)==null?void 0:a[0])==null?void 0:i.fltCtx]&&Object.values(t.filter[(u=(s=e.items)==null?void 0:s[0])==null?void 0:u.fltCtx]).includes(n)});if(Array.isArray(r)&&r.length===0)return!1}return!0}const Ce=(e,t,r=0)=>{if(!e)return 0;let n=parseFloat(e.price)||0;const{items:a}=e,i=$v(t);return yv(e,i)&&Array.isArray(a)&&a.forEach(s=>{let u=0;if(s.kind!=="3e/product")u=Ce(s,i,r+1);else{const{selected:o={}}=i,{selCtx:l,id:y}=s;l in o&&y in o[l]&&(u=Ce(s,i,r+1)*o[l][y],delete i.selected[l][y])}n+=u}),Math.round(100*n)/100},mv=({product:e,state:t,selected:r,cheapestGroupOptionsProduct:n})=>{var o;const a=t?Ce(e,t):0,i=e.state&&!vt((o=e==null?void 0:e.state)==null?void 0:o.selected)?Ce(e,e.state):0,s=e.minPrice&&parseFloat(e.price)===a;let u=r||!!n||parseFloat(e.price)===0?a||i:parseFloat(e.price);return n!==void 0&&(u-=n),s&&e.minPrice&&(u=parseFloat(e.minPrice)),{displayPrice:u,showAsMinPrice:s,calculatedPriceDefaultProductState:i}};function mt(e){const t=[];return e.reduce((r,n)=>{if(r[n.hash]||(r[n.hash]={...n,quantity:0,discounted:0,discounts:[],firstProductQuantity:n.quantity,itemsToRemove:[]},t.push(r[n.hash])),r[n.hash].quantity+=n.quantity,r[n.hash].itemsToRemove.push(n.id),n.discounts){r[n.hash].discounts||(r[n.hash].discounts=[]),r[n.hash].discounts=r[n.hash].discounts.concat(n.discounts),r[n.hash].discounted=0;for(let a=0;a<r[n.hash].discounts.length;a+=1)r[n.hash].discounts[a]&&(r[n.hash].discounted+=parseFloat(r[n.hash].discounts[a].discountPrice))}return r},{}),t}function bv(e){return mt(e)}function _v(e){return!e||e.length===0?null:mt(e.flatMap(t=>t.lines))}var bt={exports:{}},cn=function(t,r){return function(){for(var a=new Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return t.apply(r,a)}},Av=cn,ee=Object.prototype.toString;function _t(e){return ee.call(e)==="[object Array]"}function ot(e){return typeof e=="undefined"}function Ev(e){return e!==null&&!ot(e)&&e.constructor!==null&&!ot(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Tv(e){return ee.call(e)==="[object ArrayBuffer]"}function Ov(e){return typeof FormData!="undefined"&&e instanceof FormData}function Sv(e){var t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&e.buffer instanceof ArrayBuffer,t}function wv(e){return typeof e=="string"}function Iv(e){return typeof e=="number"}function ln(e){return e!==null&&typeof e=="object"}function Se(e){if(ee.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Dv(e){return ee.call(e)==="[object Date]"}function Cv(e){return ee.call(e)==="[object File]"}function Lv(e){return ee.call(e)==="[object Blob]"}function hn(e){return ee.call(e)==="[object Function]"}function Rv(e){return ln(e)&&hn(e.pipe)}function jv(e){return typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams}function Pv(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Nv(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function At(e,t){if(!(e===null||typeof e=="undefined"))if(typeof e!="object"&&(e=[e]),_t(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}function ut(){var e={};function t(a,i){Se(e[i])&&Se(a)?e[i]=ut(e[i],a):Se(a)?e[i]=ut({},a):_t(a)?e[i]=a.slice():e[i]=a}for(var r=0,n=arguments.length;r<n;r++)At(arguments[r],t);return e}function xv(e,t,r){return At(t,function(a,i){r&&typeof a=="function"?e[i]=Av(a,r):e[i]=a}),e}function Uv(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var G={isArray:_t,isArrayBuffer:Tv,isBuffer:Ev,isFormData:Ov,isArrayBufferView:Sv,isString:wv,isNumber:Iv,isObject:ln,isPlainObject:Se,isUndefined:ot,isDate:Dv,isFile:Cv,isBlob:Lv,isFunction:hn,isStream:Rv,isURLSearchParams:jv,isStandardBrowserEnv:Nv,forEach:At,merge:ut,extend:xv,trim:Pv,stripBOM:Uv},re=G;function _r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var vn=function(t,r,n){if(!r)return t;var a;if(n)a=n(r);else if(re.isURLSearchParams(r))a=r.toString();else{var i=[];re.forEach(r,function(o,l){o===null||typeof o=="undefined"||(re.isArray(o)?l=l+"[]":o=[o],re.forEach(o,function(v){re.isDate(v)?v=v.toISOString():re.isObject(v)&&(v=JSON.stringify(v)),i.push(_r(l)+"="+_r(v))}))}),a=i.join("&")}if(a){var s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t},Mv=G;function He(){this.handlers=[]}He.prototype.use=function(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};He.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};He.prototype.forEach=function(t){Mv.forEach(this.handlers,function(n){n!==null&&t(n)})};var Bv=He,Fv=G,Hv=function(t,r){Fv.forEach(t,function(a,i){i!==r&&i.toUpperCase()===r.toUpperCase()&&(t[r]=a,delete t[i])})},dn=function(t,r,n,a,i){return t.config=r,n&&(t.code=n),t.request=a,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t},Yv=dn,pn=function(t,r,n,a,i){var s=new Error(t);return Yv(s,r,n,a,i)},Gv=pn,Kv=function(t,r,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?t(n):r(Gv("Request failed with status code "+n.status,n.config,null,n.request,n))},Ee=G,Wv=Ee.isStandardBrowserEnv()?function(){return{write:function(r,n,a,i,s,u){var o=[];o.push(r+"="+encodeURIComponent(n)),Ee.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),Ee.isString(i)&&o.push("path="+i),Ee.isString(s)&&o.push("domain="+s),u===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),qv=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},kv=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t},Vv=qv,Jv=kv,zv=function(t,r){return t&&!Vv(r)?Jv(t,r):r},Ve=G,Zv=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Xv=function(t){var r={},n,a,i;return t&&Ve.forEach(t.split(`
2
+ `),function(u){if(i=u.indexOf(":"),n=Ve.trim(u.substr(0,i)).toLowerCase(),a=Ve.trim(u.substr(i+1)),n){if(r[n]&&Zv.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([a]):r[n]=r[n]?r[n]+", "+a:a}}),r},Ar=G,Qv=Ar.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function a(i){var s=i;return t&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=a(window.location.href),function(s){var u=Ar.isString(s)?a(s):s;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}(),Te=G,ed=Kv,td=Wv,rd=vn,nd=zv,ad=Xv,id=Qv,Je=pn,Er=function(t){return new Promise(function(n,a){var i=t.data,s=t.headers,u=t.responseType;Te.isFormData(i)&&delete s["Content-Type"];var o=new XMLHttpRequest;if(t.auth){var l=t.auth.username||"",y=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.Authorization="Basic "+btoa(l+":"+y)}var v=nd(t.baseURL,t.url);o.open(t.method.toUpperCase(),rd(v,t.params,t.paramsSerializer),!0),o.timeout=t.timeout;function f(){if(!!o){var $="getAllResponseHeaders"in o?ad(o.getAllResponseHeaders()):null,c=!u||u==="text"||u==="json"?o.responseText:o.response,m={data:c,status:o.status,statusText:o.statusText,headers:$,config:t,request:o};ed(n,a,m),o=null}}if("onloadend"in o?o.onloadend=f:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(f)},o.onabort=function(){!o||(a(Je("Request aborted",t,"ECONNABORTED",o)),o=null)},o.onerror=function(){a(Je("Network Error",t,null,o)),o=null},o.ontimeout=function(){var c="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(c=t.timeoutErrorMessage),a(Je(c,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Te.isStandardBrowserEnv()){var h=(t.withCredentials||id(v))&&t.xsrfCookieName?td.read(t.xsrfCookieName):void 0;h&&(s[t.xsrfHeaderName]=h)}"setRequestHeader"in o&&Te.forEach(s,function(c,m){typeof i=="undefined"&&m.toLowerCase()==="content-type"?delete s[m]:o.setRequestHeader(m,c)}),Te.isUndefined(t.withCredentials)||(o.withCredentials=!!t.withCredentials),u&&u!=="json"&&(o.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&o.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&o.upload&&o.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(c){!o||(o.abort(),a(c),o=null)}),i||(i=null),o.send(i)})},x=G,Tr=Hv,sd=dn,od={"Content-Type":"application/x-www-form-urlencoded"};function Or(e,t){!x.isUndefined(e)&&x.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function ud(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=Er),e}function fd(e,t,r){if(x.isString(e))try{return(t||JSON.parse)(e),x.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Ye={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:ud(),transformRequest:[function(t,r){return Tr(r,"Accept"),Tr(r,"Content-Type"),x.isFormData(t)||x.isArrayBuffer(t)||x.isBuffer(t)||x.isStream(t)||x.isFile(t)||x.isBlob(t)?t:x.isArrayBufferView(t)?t.buffer:x.isURLSearchParams(t)?(Or(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):x.isObject(t)||r&&r["Content-Type"]==="application/json"?(Or(r,"application/json"),fd(t)):t}],transformResponse:[function(t){var r=this.transitional,n=r&&r.silentJSONParsing,a=r&&r.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||a&&x.isString(t)&&t.length)try{return JSON.parse(t)}catch(s){if(i)throw s.name==="SyntaxError"?sd(s,this,"E_JSON_PARSE"):s}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};Ye.headers={common:{Accept:"application/json, text/plain, */*"}};x.forEach(["delete","get","head"],function(t){Ye.headers[t]={}});x.forEach(["post","put","patch"],function(t){Ye.headers[t]=x.merge(od)});var Et=Ye,cd=G,ld=Et,hd=function(t,r,n){var a=this||ld;return cd.forEach(n,function(s){t=s.call(a,t,r)}),t},gn=function(t){return!!(t&&t.__CANCEL__)},Sr=G,ze=hd,vd=gn,dd=Et;function Ze(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var pd=function(t){Ze(t),t.headers=t.headers||{},t.data=ze.call(t,t.data,t.headers,t.transformRequest),t.headers=Sr.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Sr.forEach(["delete","get","head","post","put","patch","common"],function(a){delete t.headers[a]});var r=t.adapter||dd.adapter;return r(t).then(function(a){return Ze(t),a.data=ze.call(t,a.data,a.headers,t.transformResponse),a},function(a){return vd(a)||(Ze(t),a&&a.response&&(a.response.data=ze.call(t,a.response.data,a.response.headers,t.transformResponse))),Promise.reject(a)})},M=G,$n=function(t,r){r=r||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function o(f,h){return M.isPlainObject(f)&&M.isPlainObject(h)?M.merge(f,h):M.isPlainObject(h)?M.merge({},h):M.isArray(h)?h.slice():h}function l(f){M.isUndefined(r[f])?M.isUndefined(t[f])||(n[f]=o(void 0,t[f])):n[f]=o(t[f],r[f])}M.forEach(a,function(h){M.isUndefined(r[h])||(n[h]=o(void 0,r[h]))}),M.forEach(i,l),M.forEach(s,function(h){M.isUndefined(r[h])?M.isUndefined(t[h])||(n[h]=o(void 0,t[h])):n[h]=o(void 0,r[h])}),M.forEach(u,function(h){h in r?n[h]=o(t[h],r[h]):h in t&&(n[h]=o(void 0,t[h]))});var y=a.concat(i).concat(s).concat(u),v=Object.keys(t).concat(Object.keys(r)).filter(function(h){return y.indexOf(h)===-1});return M.forEach(v,l),n};const gd="axios",$d="0.21.4",yd="Promise based HTTP client for the browser and node.js",md="index.js",bd={test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},_d={type:"git",url:"https://github.com/axios/axios.git"},Ad=["xhr","http","ajax","promise","node"],Ed="Matt Zabriskie",Td="MIT",Od={url:"https://github.com/axios/axios/issues"},Sd="https://axios-http.com",wd={coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},Id={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Dd="dist/axios.min.js",Cd="dist/axios.min.js",Ld="./index.d.ts",Rd={"follow-redirects":"^1.14.0"},jd=[{path:"./dist/axios.min.js",threshold:"5kB"}];var Pd={name:gd,version:$d,description:yd,main:md,scripts:bd,repository:_d,keywords:Ad,author:Ed,license:Td,bugs:Od,homepage:Sd,devDependencies:wd,browser:Id,jsdelivr:Dd,unpkg:Cd,typings:Ld,dependencies:Rd,bundlesize:jd},yn=Pd,Tt={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var wr={},Nd=yn.version.split(".");function mn(e,t){for(var r=t?t.split("."):Nd,n=e.split("."),a=0;a<3;a++){if(r[a]>n[a])return!0;if(r[a]<n[a])return!1}return!1}Tt.transitional=function(t,r,n){var a=r&&mn(r);function i(s,u){return"[Axios v"+yn.version+"] Transitional option '"+s+"'"+u+(n?". "+n:"")}return function(s,u,o){if(t===!1)throw new Error(i(u," has been removed in "+r));return a&&!wr[u]&&(wr[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,u,o):!0}};function xd(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[a],s=t[i];if(s){var u=e[i],o=u===void 0||s(u,i,e);if(o!==!0)throw new TypeError("option "+i+" must be "+o);continue}if(r!==!0)throw Error("Unknown option "+i)}}var Ud={isOlderVersion:mn,assertOptions:xd,validators:Tt},bn=G,Md=vn,Ir=Bv,Dr=pd,Ge=$n,_n=Ud,ne=_n.validators;function me(e){this.defaults=e,this.interceptors={request:new Ir,response:new Ir}}me.prototype.request=function(t){typeof t=="string"?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=Ge(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&_n.assertOptions(r,{silentJSONParsing:ne.transitional(ne.boolean,"1.0.0"),forcedJSONParsing:ne.transitional(ne.boolean,"1.0.0"),clarifyTimeoutError:ne.transitional(ne.boolean,"1.0.0")},!1);var n=[],a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(a=a&&f.synchronous,n.unshift(f.fulfilled,f.rejected))});var i=[];this.interceptors.response.forEach(function(f){i.push(f.fulfilled,f.rejected)});var s;if(!a){var u=[Dr,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(i),s=Promise.resolve(t);u.length;)s=s.then(u.shift(),u.shift());return s}for(var o=t;n.length;){var l=n.shift(),y=n.shift();try{o=l(o)}catch(v){y(v);break}}try{s=Dr(o)}catch(v){return Promise.reject(v)}for(;i.length;)s=s.then(i.shift(),i.shift());return s};me.prototype.getUri=function(t){return t=Ge(this.defaults,t),Md(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};bn.forEach(["delete","get","head","options"],function(t){me.prototype[t]=function(r,n){return this.request(Ge(n||{},{method:t,url:r,data:(n||{}).data}))}});bn.forEach(["post","put","patch"],function(t){me.prototype[t]=function(r,n,a){return this.request(Ge(a||{},{method:t,url:r,data:n}))}});var Bd=me;function Ot(e){this.message=e}Ot.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ot.prototype.__CANCEL__=!0;var An=Ot,Fd=An;function Le(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(a){t=a});var r=this;e(function(a){r.reason||(r.reason=new Fd(a),t(r.reason))})}Le.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Le.source=function(){var t,r=new Le(function(a){t=a});return{token:r,cancel:t}};var Hd=Le,Yd=function(t){return function(n){return t.apply(null,n)}},Gd=function(t){return typeof t=="object"&&t.isAxiosError===!0},Cr=G,Kd=cn,we=Bd,Wd=$n,qd=Et;function En(e){var t=new we(e),r=Kd(we.prototype.request,t);return Cr.extend(r,we.prototype,t),Cr.extend(r,t),r}var W=En(qd);W.Axios=we;W.create=function(t){return En(Wd(W.defaults,t))};W.Cancel=An;W.CancelToken=Hd;W.isCancel=gn;W.all=function(t){return Promise.all(t)};W.spread=Yd;W.isAxiosError=Gd;bt.exports=W;bt.exports.default=W;var kd=bt.exports;const Vd=(e,t)=>{var r,n,a;return e&&((r=e==null?void 0:e.url)==null?void 0:r.length)>0&&(((n=e.url.find(i=>i.locale===t))==null?void 0:n.value)||((a=e.url.find(i=>i.locale==="*"))==null?void 0:a.value))||null},Jd=(e,t)=>{var r,n;return((r=e==null?void 0:e.find)==null?void 0:r.call(e,a=>a.venue===t))||((n=e==null?void 0:e.find)==null?void 0:n.call(e,a=>a.venue==="*"))};function St(e,t=600,r=!0,n,a){var O,w;if(!n||!a)throw new Error("baseUrl or tenant was not provided");const i=`${e}_${a}_${n}`,s=`${n.endsWith("/")?n.slice(0,-1):n}/cms-api/content/${a}/${e}`,u=((O=m())==null?void 0:O.value)||null,[o,l]=F.useState(((w=m())==null?void 0:w.timestamp)||0),[y,v]=F.useState(u||null),[f,h]=F.useState(!1);function $(){kd.get(s).then(E=>{if(vt(E.data))throw new Error(`CMS data '${e}' is an empty object`);tn(E.data,y)||v(E.data),f&&h(!1),r&&c(E.data)}).catch(E=>{console.error(E),h(!0)})}function c(E){const P=new Date().valueOf(),D=JSON.stringify({value:E,timestamp:P});localStorage.setItem(i,D),l(P)}function m(){try{const E=localStorage.getItem(i);if(E)return JSON.parse(E)}catch(E){console.warn(E)}return null}return F.useEffect(()=>{new Date().valueOf()-o>t*1e3&&$()},[]),Re($,t*1e3),{value:y,isError:f,isLoading:!f&&!y}}function Tn(e,t=600,r=!0,n,a,i){var u,o,l,y;if(!n||!a||!i)throw new Error("baseUrl, tenant or venue was not provided");const s=St(e,t,r,n,a);return{value:((o=(u=s.value)==null?void 0:u.find)==null?void 0:o.call(u,v=>v.venue===i))||((y=(l=s.value)==null?void 0:l.find)==null?void 0:y.call(l,v=>v.venue==="*"))||null,isError:s.isError}}function zd(e,t,r,n=300,a=!0){var y,v,f,h;const i=F.useContext(On.ConfigContext);if(!i)throw new Error("Missing config context");const{value:s,isError:u}=Tn(e,n,a,i.baseUrl,i.tenant,t);let o=null,l=null;return s&&((y=s==null?void 0:s.url)==null?void 0:y.length)>0&&(o=((v=s.url.find($=>$.locale===r))==null?void 0:v.value)||((f=s.url.find($=>$.locale==="*"))==null?void 0:f.value)||null),!o&&s&&((h=s==null?void 0:s.url)==null?void 0:h.length)>0&&(l=s.url[0].value),{url:o,fallbackUrl:l,isError:u}}function Zd({kioskMediaId:e,kioskMediaType:t,intervalSeconds:r=600,withLocalStorage:n=!0,baseUrl:a,tenant:i,venue:s,locale:u}){var c;const{value:o,isError:l,isLoading:y}=St(e,r,n,a,i),v=(o==null?void 0:o[t])||[],f=Jd(v,s),h=Vd(f,u),$=!h&&f&&((c=f==null?void 0:f.url)==null?void 0:c.length)>0?f.url[0].value:null;return{url:h,fallbackUrl:$,mediaType:f==null?void 0:f.mediaType,isError:l,isLoading:y}}function Xd(e,t){F.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function Qd(e){const[t,r]=F.useState(_e(e==null?void 0:e.DINE_IN)),[n,a]=F.useState(_e(e==null?void 0:e.TAKE_AWAY));function i(){const s=_e(e==null?void 0:e.DINE_IN),u=_e(e==null?void 0:e.TAKE_AWAY);s!==t&&(console.log("dine in open changed",t,"=>",s),r(s)),u!==n&&(console.log("take away open changed",n,"=>",u),a(u))}return F.useEffect(()=>{i()},[e]),Re(i,6e4),{dineInOpen:t,takeAwayOpen:n}}exports.getGroupedBucketLines=_v;exports.groupOrderLines=mt;exports.useAvailability=Qf;exports.useCms=St;exports.useDisplayPrice=mv;exports.useGroupOrderLines=bv;exports.useInterval=Re;exports.useKioskChannelsAvailability=Qd;exports.useKioskMediaCms=Zd;exports.useLocalizedVenueMedia=zd;exports.useOnClickOutside=Xd;exports.useVenueCms=Tn;
3
3
  //# sourceMappingURL=index.cjs.js.map