@inno_user/inno_clouds_lib 9.1.1 → 9.1.3

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.
@@ -1,6 +1,6 @@
1
- (function(z,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("vue-router"),require("pinia"),require("vue"),require("@vueuse/core"),require("motion-v")):typeof define=="function"&&define.amd?define(["exports","vue-router","pinia","vue","@vueuse/core","motion-v"],K):(z=typeof globalThis<"u"?globalThis:z||self,K(z.InnoCloudsLib={},z.VueRouter,z.Pinia,z.Vue,z.VueuseCore,z.motionV))})(this,function(z,K,U,e,Ee,pe){"use strict";var Xd=Object.defineProperty;var Fo=z=>{throw TypeError(z)};var Zd=(z,K,U)=>K in z?Xd(z,K,{enumerable:!0,configurable:!0,writable:!0,value:U}):z[K]=U;var ee=(z,K,U)=>Zd(z,typeof K!="symbol"?K+"":K,U),Lo=(z,K,U)=>K.has(z)||Fo("Cannot "+U);var Ne=(z,K,U)=>(Lo(z,K,"read from private field"),U?U.call(z):K.get(z)),$t=(z,K,U)=>K.has(z)?Fo("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(z):K.set(z,U),Me=(z,K,U,e)=>(Lo(z,K,"write to private field"),e?e.call(z,U):K.set(z,U),U);var dn=(z,K,U,e)=>({set _(Ee){Me(z,K,Ee,U)},get _(){return Ne(z,K,e)}});var we,De,qe;function Uo(t){return t}const jo=[];function Ho(){return K.createRouter({history:K.createWebHistory(),routes:jo})}const Tt=(t,n)=>n.some(o=>t instanceof o);let un,fn;function qo(){return un||(un=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Wo(){return fn||(fn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Mt=new WeakMap,Pt=new WeakMap,ut=new WeakMap;function Go(t){const n=new Promise((o,r)=>{const a=()=>{t.removeEventListener("success",s),t.removeEventListener("error",i)},s=()=>{o(Ie(t.result)),a()},i=()=>{r(t.error),a()};t.addEventListener("success",s),t.addEventListener("error",i)});return ut.set(n,t),n}function Ko(t){if(Mt.has(t))return;const n=new Promise((o,r)=>{const a=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",i),t.removeEventListener("abort",i)},s=()=>{o(),a()},i=()=>{r(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",s),t.addEventListener("error",i),t.addEventListener("abort",i)});Mt.set(t,n)}let Vt={get(t,n,o){if(t instanceof IDBTransaction){if(n==="done")return Mt.get(t);if(n==="store")return o.objectStoreNames[1]?void 0:o.objectStore(o.objectStoreNames[0])}return Ie(t[n])},set(t,n,o){return t[n]=o,!0},has(t,n){return t instanceof IDBTransaction&&(n==="done"||n==="store")?!0:n in t}};function mn(t){Vt=t(Vt)}function Jo(t){return Wo().includes(t)?function(...n){return t.apply(It(this),n),Ie(this.request)}:function(...n){return Ie(t.apply(It(this),n))}}function Xo(t){return typeof t=="function"?Jo(t):(t instanceof IDBTransaction&&Ko(t),Tt(t,qo())?new Proxy(t,Vt):t)}function Ie(t){if(t instanceof IDBRequest)return Go(t);if(Pt.has(t))return Pt.get(t);const n=Xo(t);return n!==t&&(Pt.set(t,n),ut.set(n,t)),n}const It=t=>ut.get(t);function Zo(t,n,{blocked:o,upgrade:r,blocking:a,terminated:s}={}){const i=indexedDB.open(t,n),l=Ie(i);return r&&i.addEventListener("upgradeneeded",c=>{r(Ie(i.result),c.oldVersion,c.newVersion,Ie(i.transaction),c)}),o&&i.addEventListener("blocked",c=>o(c.oldVersion,c.newVersion,c)),l.then(c=>{s&&c.addEventListener("close",()=>s()),a&&c.addEventListener("versionchange",d=>a(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}function Yo(t,{blocked:n}={}){const o=indexedDB.deleteDatabase(t);return n&&o.addEventListener("blocked",r=>n(r.oldVersion,r)),Ie(o).then(()=>{})}const Qo=["get","getKey","getAll","getAllKeys","count"],er=["put","add","delete","clear"],Rt=new Map;function pn(t,n){if(!(t instanceof IDBDatabase&&!(n in t)&&typeof n=="string"))return;if(Rt.get(n))return Rt.get(n);const o=n.replace(/FromIndex$/,""),r=n!==o,a=er.includes(o);if(!(o in(r?IDBIndex:IDBObjectStore).prototype)||!(a||Qo.includes(o)))return;const s=async function(i,...l){const c=this.transaction(i,a?"readwrite":"readonly");let d=c.store;return r&&(d=d.index(l.shift())),(await Promise.all([d[o](...l),a&&c.done]))[0]};return Rt.set(n,s),s}mn(t=>({...t,get:(n,o,r)=>pn(n,o)||t.get(n,o,r),has:(n,o)=>!!pn(n,o)||t.has(n,o)}));const tr=["continue","continuePrimaryKey","advance"],hn={},Dt=new WeakMap,_n=new WeakMap,nr={get(t,n){if(!tr.includes(n))return t[n];let o=hn[n];return o||(o=hn[n]=function(...r){Dt.set(this,_n.get(this)[n](...r))}),o}};async function*or(...t){let n=this;if(n instanceof IDBCursor||(n=await n.openCursor(...t)),!n)return;n=n;const o=new Proxy(n,nr);for(_n.set(o,n),ut.set(o,It(n));n;)yield o,n=await(Dt.get(o)||n.continue()),Dt.delete(o)}function gn(t,n){return n===Symbol.asyncIterator&&Tt(t,[IDBIndex,IDBObjectStore,IDBCursor])||n==="iterate"&&Tt(t,[IDBIndex,IDBObjectStore])}mn(t=>({...t,get(n,o,r){return gn(n,o)?or:t.get(n,o,r)},has(n,o){return gn(n,o)||t.has(n,o)}}));let We;async function Oe(){return We||(We=Zo("data",1,{upgrade(t){t.objectStoreNames.contains("groups")||t.createObjectStore("groups",{keyPath:"id"}),t.objectStoreNames.contains("media")||t.createObjectStore("media",{keyPath:"id"}),t.objectStoreNames.contains("products")||t.createObjectStore("products",{keyPath:"id"})}})),We}async function Ot(t){return(await Oe()).transaction("groups","readonly").objectStore("groups").get(t)}async function Qe(t,n){const r=(await Oe()).transaction("groups","readwrite");await r.objectStore("groups").put({id:t,data:n,timestamp:Date.now()}),await r.done}async function rr(t,n){const o=JSON.parse(JSON.stringify(e.toRaw(n.value)));await Qe(t,o)}async function Ft(t,n){const r=(await Oe()).transaction("media","readwrite");await r.objectStore("media").put({id:t,blob:n,timestamp:Date.now()}),await r.done}async function Ge(t){const a=await(await Oe()).transaction("media","readonly").objectStore("media").get(t);return a==null?void 0:a.blob}async function ar(t){const o=(await Oe()).transaction("products","readwrite"),r=o.objectStore("products"),a=t.id;await r.put({id:a,product:t,timestamp:Date.now()}),await o.done}async function yn(t){const a=await(await Oe()).transaction("products","readonly").objectStore("products").get(t);return a==null?void 0:a.product}async function sr(){if(We){const t=await We.catch(()=>null);t&&t.close(),We=void 0}try{await Yo("data",{blocked(){console.warn("Удаление заблокировано. открыты другие вкладки с сайтом.")}})}catch(t){console.error("Не удалось удалить базу: [lib, indexedDB]",t)}}function ft(t){"@babel/helpers - typeof";return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ft(t)}var ir=/^\s+/,lr=/\s+$/;function q(t,n){if(t=t||"",n=n||{},t instanceof q)return t;if(!(this instanceof q))return new q(t,n);var o=cr(t);this._originalInput=t,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||o.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}q.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),o,r,a,s,i,l;return o=n.r/255,r=n.g/255,a=n.b/255,o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),a<=.03928?l=a/12.92:l=Math.pow((a+.055)/1.055,2.4),.2126*s+.7152*i+.0722*l},setAlpha:function(n){return this._a=En(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=wn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=wn(this._r,this._g,this._b),o=Math.round(n.h*360),r=Math.round(n.s*100),a=Math.round(n.v*100);return this._a==1?"hsv("+o+", "+r+"%, "+a+"%)":"hsva("+o+", "+r+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var n=bn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=bn(this._r,this._g,this._b),o=Math.round(n.h*360),r=Math.round(n.s*100),a=Math.round(n.l*100);return this._a==1?"hsl("+o+", "+r+"%, "+a+"%)":"hsla("+o+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(n){return kn(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return mr(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(le(this._r,255)*100)+"%",g:Math.round(le(this._g,255)*100)+"%",b:Math.round(le(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(le(this._r,255)*100)+"%, "+Math.round(le(this._g,255)*100)+"%, "+Math.round(le(this._b,255)*100)+"%)":"rgba("+Math.round(le(this._r,255)*100)+"%, "+Math.round(le(this._g,255)*100)+"%, "+Math.round(le(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Nr[kn(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var o="#"+Cn(this._r,this._g,this._b,this._a),r=o,a=this._gradientType?"GradientType = 1, ":"";if(n){var s=q(n);r="#"+Cn(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+o+",endColorstr="+r+")"},toString:function(n){var o=!!n;n=n||this._format;var r=!1,a=this._a<1&&this._a>=0,s=!o&&a&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return s?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(r=this.toRgbString()),n==="prgb"&&(r=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(r=this.toHexString()),n==="hex3"&&(r=this.toHexString(!0)),n==="hex4"&&(r=this.toHex8String(!0)),n==="hex8"&&(r=this.toHex8String()),n==="name"&&(r=this.toName()),n==="hsl"&&(r=this.toHslString()),n==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(n,o){var r=n.apply(null,[this].concat([].slice.call(o)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(gr,arguments)},brighten:function(){return this._applyModification(yr,arguments)},darken:function(){return this._applyModification(br,arguments)},desaturate:function(){return this._applyModification(pr,arguments)},saturate:function(){return this._applyModification(hr,arguments)},greyscale:function(){return this._applyModification(_r,arguments)},spin:function(){return this._applyModification(wr,arguments)},_applyCombination:function(n,o){return n.apply(null,[this].concat([].slice.call(o)))},analogous:function(){return this._applyCombination(Sr,arguments)},complement:function(){return this._applyCombination(kr,arguments)},monochromatic:function(){return this._applyCombination(Er,arguments)},splitcomplement:function(){return this._applyCombination(Cr,arguments)},triad:function(){return this._applyCombination(Sn,[3])},tetrad:function(){return this._applyCombination(Sn,[4])}},q.fromRatio=function(t,n){if(ft(t)=="object"){var o={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?o[r]=t[r]:o[r]=et(t[r]));t=o}return q(t,n)};function cr(t){var n={r:0,g:0,b:0},o=1,r=null,a=null,s=null,i=!1,l=!1;return typeof t=="string"&&(t=vr(t)),ft(t)=="object"&&(Pe(t.r)&&Pe(t.g)&&Pe(t.b)?(n=dr(t.r,t.g,t.b),i=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Pe(t.h)&&Pe(t.s)&&Pe(t.v)?(r=et(t.s),a=et(t.v),n=fr(t.h,r,a),i=!0,l="hsv"):Pe(t.h)&&Pe(t.s)&&Pe(t.l)&&(r=et(t.s),s=et(t.l),n=ur(t.h,r,s),i=!0,l="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=En(o),{ok:i,format:t.format||l,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:o}}function dr(t,n,o){return{r:le(t,255)*255,g:le(n,255)*255,b:le(o,255)*255}}function bn(t,n,o){t=le(t,255),n=le(n,255),o=le(o,255);var r=Math.max(t,n,o),a=Math.min(t,n,o),s,i,l=(r+a)/2;if(r==a)s=i=0;else{var c=r-a;switch(i=l>.5?c/(2-r-a):c/(r+a),r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}return{h:s,s:i,l}}function ur(t,n,o){var r,a,s;t=le(t,360),n=le(n,100),o=le(o,100);function i(d,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(n===0)r=a=s=o;else{var l=o<.5?o*(1+n):o+n-o*n,c=2*o-l;r=i(c,l,t+1/3),a=i(c,l,t),s=i(c,l,t-1/3)}return{r:r*255,g:a*255,b:s*255}}function wn(t,n,o){t=le(t,255),n=le(n,255),o=le(o,255);var r=Math.max(t,n,o),a=Math.min(t,n,o),s,i,l=r,c=r-a;if(i=r===0?0:c/r,r==a)s=0;else{switch(r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}return{h:s,s:i,v:l}}function fr(t,n,o){t=le(t,360)*6,n=le(n,100),o=le(o,100);var r=Math.floor(t),a=t-r,s=o*(1-n),i=o*(1-a*n),l=o*(1-(1-a)*n),c=r%6,d=[o,i,s,s,l,o][c],u=[l,o,o,i,s,s][c],f=[s,s,l,o,o,i][c];return{r:d*255,g:u*255,b:f*255}}function kn(t,n,o,r){var a=[xe(Math.round(t).toString(16)),xe(Math.round(n).toString(16)),xe(Math.round(o).toString(16))];return r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function mr(t,n,o,r,a){var s=[xe(Math.round(t).toString(16)),xe(Math.round(n).toString(16)),xe(Math.round(o).toString(16)),xe(Nn(r))];return a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function Cn(t,n,o,r){var a=[xe(Nn(r)),xe(Math.round(t).toString(16)),xe(Math.round(n).toString(16)),xe(Math.round(o).toString(16))];return a.join("")}q.equals=function(t,n){return!t||!n?!1:q(t).toRgbString()==q(n).toRgbString()},q.random=function(){return q.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function pr(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.s-=n/100,o.s=mt(o.s),q(o)}function hr(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.s+=n/100,o.s=mt(o.s),q(o)}function _r(t){return q(t).desaturate(100)}function gr(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.l+=n/100,o.l=mt(o.l),q(o)}function yr(t,n){n=n===0?0:n||10;var o=q(t).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(255*-(n/100)))),o.g=Math.max(0,Math.min(255,o.g-Math.round(255*-(n/100)))),o.b=Math.max(0,Math.min(255,o.b-Math.round(255*-(n/100)))),q(o)}function br(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.l-=n/100,o.l=mt(o.l),q(o)}function wr(t,n){var o=q(t).toHsl(),r=(o.h+n)%360;return o.h=r<0?360+r:r,q(o)}function kr(t){var n=q(t).toHsl();return n.h=(n.h+180)%360,q(n)}function Sn(t,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var o=q(t).toHsl(),r=[q(t)],a=360/n,s=1;s<n;s++)r.push(q({h:(o.h+s*a)%360,s:o.s,l:o.l}));return r}function Cr(t){var n=q(t).toHsl(),o=n.h;return[q(t),q({h:(o+72)%360,s:n.s,l:n.l}),q({h:(o+216)%360,s:n.s,l:n.l})]}function Sr(t,n,o){n=n||6,o=o||30;var r=q(t).toHsl(),a=360/o,s=[q(t)];for(r.h=(r.h-(a*n>>1)+720)%360;--n;)r.h=(r.h+a)%360,s.push(q(r));return s}function Er(t,n){n=n||6;for(var o=q(t).toHsv(),r=o.h,a=o.s,s=o.v,i=[],l=1/n;n--;)i.push(q({h:r,s:a,v:s})),s=(s+l)%1;return i}q.mix=function(t,n,o){o=o===0?0:o||50;var r=q(t).toRgb(),a=q(n).toRgb(),s=o/100,i={r:(a.r-r.r)*s+r.r,g:(a.g-r.g)*s+r.g,b:(a.b-r.b)*s+r.b,a:(a.a-r.a)*s+r.a};return q(i)},q.readability=function(t,n){var o=q(t),r=q(n);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},q.isReadable=function(t,n,o){var r=q.readability(t,n),a,s;switch(s=!1,a=$r(o),a.level+a.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s},q.mostReadable=function(t,n,o){var r=null,a=0,s,i,l,c;o=o||{},i=o.includeFallbackColors,l=o.level,c=o.size;for(var d=0;d<n.length;d++)s=q.readability(t,n[d]),s>a&&(a=s,r=q(n[d]));return q.isReadable(t,r,{level:l,size:c})||!i?r:(o.includeFallbackColors=!1,q.mostReadable(t,["#fff","#000"],o))};var Lt=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Nr=q.hexNames=xr(Lt);function xr(t){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[t[o]]=o);return n}function En(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function le(t,n){Br(t)&&(t="100%");var o=Ar(t);return t=Math.min(n,Math.max(0,parseFloat(t))),o&&(t=parseInt(t*n,10)/100),Math.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function mt(t){return Math.min(1,Math.max(0,t))}function Ce(t){return parseInt(t,16)}function Br(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function Ar(t){return typeof t=="string"&&t.indexOf("%")!=-1}function xe(t){return t.length==1?"0"+t:""+t}function et(t){return t<=1&&(t=t*100+"%"),t}function Nn(t){return Math.round(parseFloat(t)*255).toString(16)}function xn(t){return Ce(t)/255}var Be=function(){var t="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",o="(?:"+n+")|(?:"+t+")",r="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?",a="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?";return{CSS_UNIT:new RegExp(o),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Pe(t){return!!Be.CSS_UNIT.exec(t)}function vr(t){t=t.replace(ir,"").replace(lr,"").toLowerCase();var n=!1;if(Lt[t])t=Lt[t],n=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var o;return(o=Be.rgb.exec(t))?{r:o[1],g:o[2],b:o[3]}:(o=Be.rgba.exec(t))?{r:o[1],g:o[2],b:o[3],a:o[4]}:(o=Be.hsl.exec(t))?{h:o[1],s:o[2],l:o[3]}:(o=Be.hsla.exec(t))?{h:o[1],s:o[2],l:o[3],a:o[4]}:(o=Be.hsv.exec(t))?{h:o[1],s:o[2],v:o[3]}:(o=Be.hsva.exec(t))?{h:o[1],s:o[2],v:o[3],a:o[4]}:(o=Be.hex8.exec(t))?{r:Ce(o[1]),g:Ce(o[2]),b:Ce(o[3]),a:xn(o[4]),format:n?"name":"hex8"}:(o=Be.hex6.exec(t))?{r:Ce(o[1]),g:Ce(o[2]),b:Ce(o[3]),format:n?"name":"hex"}:(o=Be.hex4.exec(t))?{r:Ce(o[1]+""+o[1]),g:Ce(o[2]+""+o[2]),b:Ce(o[3]+""+o[3]),a:xn(o[4]+""+o[4]),format:n?"name":"hex8"}:(o=Be.hex3.exec(t))?{r:Ce(o[1]+""+o[1]),g:Ce(o[2]+""+o[2]),b:Ce(o[3]+""+o[3]),format:n?"name":"hex"}:!1}function $r(t){var n,o;return t=t||{level:"AA",size:"small"},n=(t.level||"AA").toUpperCase(),o=(t.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),o!=="small"&&o!=="large"&&(o="small"),{level:n,size:o}}const tt=U.defineStore("imageCache",()=>{const t=e.ref({});let n=!1;function o(c,d){const u=String(c);t.value[u]&&URL.revokeObjectURL(t.value[u]);const f=URL.createObjectURL(d);t.value={...t.value,[u]:f}}async function r(c){if(!c){console.warn("initCacheSingle called with null/undefined id");return}const d=String(c);if(t.value[d])return;const u=await Ge(d);u&&(o(d,u),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:d,blob:u}})))}function a(c){const{id:d,blob:u}=c.detail;d&&u&&o(d,u)}function s(){typeof window>"u"||n||(window.addEventListener("image-cached",a),n=!0)}function i(){typeof window>"u"||!n||(window.removeEventListener("image-cached",a),n=!1)}function l(){Object.values(t.value).forEach(URL.revokeObjectURL),t.value={}}return typeof window<"u"&&s(),{cache:t,initCacheSingle:r,updateCacheFromBlob:o,cleanup:l,setupEventListener:s,removeEventListener:i}}),_e=U.defineStore("themeLib",()=>{const t=tt(),{initCacheSingle:n}=t,o=e.ref({id:"",created_at:null,logo:null,primary_color:null,accent_color:null,accent_light_color:null,accent_dark_color:null,bg_button_color:null,inactive_button_color:null,cards_color:null,text_color:null,nonworking_bg_color:null,splash_image_url:null,splash_video:null,splash_duration:0,splash_type:null,fallback_image:null,adult_disclaimer_text:null,adult_disclaimer_image:null,kiosk_banner:null,kiosk_preloader:null,organization:"",gradientStyle:null,kiosk_inactivity_timeout:null,kiosk_show_loyalty_card_button:null,kiosk_show_loyalty_phone_input_button:null,cart_loyalty_button:{cart_loyalty_button_sticker:null,cart_loyalty_button_text:null},show_order_comment:null,show_nutrition_in_cart:null,apply_custom_size_picker_fonts:null,size_picker_unselected_font_size:null,size_picker_selected_font_size:null}),r=async s=>{if(!s)return;o.value={...s};const i=await Ge("banner"),l=await Ge("preloader"),c=await Ge("defaultImage");i||a(s.kiosk_banner,"banner"),l||a(s.kiosk_preloader,"preloader"),c||a(s.fallback_image,"defaultImage"),document.documentElement.style.setProperty("--primaryColor",s.primary_color),document.documentElement.style.setProperty("--accentColor",s.accent_color),document.documentElement.style.setProperty("--accentLightColor",s.accent_light_color),document.documentElement.style.setProperty("--accentDarkColor",s.accent_dark_color),document.documentElement.style.setProperty("--bgButtonColor",s.bg_button_color),document.documentElement.style.setProperty("--inactiveButtonColor",s.inactive_button_color),document.documentElement.style.setProperty("--cardsColor",s.cards_color),document.documentElement.style.setProperty("--textColor",s.text_color),document.documentElement.style.setProperty("--nonworkingBgColor",s.nonworking_bg_color),s.apply_custom_size_picker_fonts&&s.size_picker_unselected_font_size&&s.size_picker_unselected_font_size>0&&document.documentElement.style.setProperty("--sizePickerUnselectedFontSize",`${s.size_picker_unselected_font_size}rem`),s.apply_custom_size_picker_fonts&&s.size_picker_selected_font_size&&s.size_picker_selected_font_size>0&&document.documentElement.style.setProperty("--sizePickerSelectedFontSize",`${s.size_picker_selected_font_size}rem`);const d=o.value.primary_color||"#F2F7FF",u=q(d).setAlpha(.7).toRgbString(),f=`linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`,g=`-webkit-linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`;return o.value.gradientStyle={background:f,backgroundColor:g},o.value},a=async(s,i)=>{if(s){const l=await fetch(s);if(!l.ok)throw new Error("Network error");const c=await l.blob();Ft(i,c),n(i)}};return{itemThemes:o,updateColor:r}}),nt=t=>{if(!t)return 0;if((t.price===0||t.price===null)&&t.sizes&&t.sizes.length>0){const n=t.sizes.find(o=>o.is_default===!0);return n?n.price:t.sizes.length>1&&t.sizes[1].price||t.sizes[0].price}return t.price};class ot extends Error{}ot.prototype.name="InvalidTokenError";function Tr(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,o)=>{let r=o.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function Mr(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Tr(n)}catch{return atob(n)}}function Bn(t,n){if(typeof t!="string")throw new ot("Invalid token specified: must be a string");n||(n={});const o=n.header===!0?0:1,r=t.split(".")[o];if(typeof r!="string")throw new ot(`Invalid token specified: missing part #${o+1}`);let a;try{a=Mr(r)}catch(s){throw new ot(`Invalid token specified: invalid base64 for part #${o+1} (${s.message})`)}try{return JSON.parse(a)}catch(s){throw new ot(`Invalid token specified: invalid json for part #${o+1} (${s.message})`)}}const Pr=(t,n)=>{if(typeof window<"u"){const o=localStorage.getItem(t);return o?JSON.parse(o):n}return n},Vr=(t,n)=>{if(typeof window<"u"){const o=localStorage.getItem(t);if(o)try{return Bn(JSON.parse(o))}catch(r){return console.error("Failed to decode JWT:",r),n}}return n},An=(t,n,o="normal")=>{const r=e.ref(o==="jwt"?Vr(t,n):Pr(t,n));return e.watchEffect(()=>{r.value===null||r.value===void 0?localStorage.removeItem(t):o!=="jwt"&&localStorage.setItem(t,JSON.stringify(r.value))}),r},Ke=t=>{t.forEach(n=>{try{localStorage.removeItem(n)}catch(o){console.error(`Ошибка при удалении ключа "${n}":`,o)}})};class Ir{constructor(n,o={}){ee(this,"url");ee(this,"options");ee(this,"ws");ee(this,"reconnectInterval");ee(this,"listeners");ee(this,"isConnected");ee(this,"heartbeat");ee(this,"pingTimeout");ee(this,"pingResponseTimeout");ee(this,"_shouldReconnect",!0);this.url=n,this.options=o,this.ws=null,this.reconnectInterval=5e3,this.pingResponseTimeout=5e3,this.listeners=new Map,this.isConnected=e.ref(!1)}connect(){if(this.ws&&this.ws.readyState===WebSocket.OPEN){console.warn("WebSocket already open");return}if(!this._shouldReconnect){console.warn("Reconnection disabled");return}const n=`${this.url}`;this.ws=new WebSocket(n),this.ws.onopen=()=>{console.warn("WebSocket connected"),this.isConnected.value=!0,this.emit("open"),this.heartbeat=setInterval(()=>this.sendPing(),3e5)},this.ws.onmessage=o=>{try{const r=JSON.parse(o.data);this.emit("message",r),r!=null&&r.type&&r.type!=="ping"&&clearTimeout(this.pingTimeout)}catch(r){console.error("Error parsing WebSocket message:",r)}},this.ws.onerror=o=>{console.error("WebSocket error:",o),this.emit("error",o),this.close(!0)},this.ws.onclose=()=>{this.isConnected.value=!1,console.warn("WebSocket closed"),this.emit("close"),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this._shouldReconnect&&(console.log(`Reconnecting in ${this.reconnectInterval}ms...`),setTimeout(()=>this.connect(),this.reconnectInterval))}}sendPing(){var n;this.isConnected.value&&((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify({type:"ping"})),this.pingTimeout=setTimeout(()=>{console.warn("No pong received, reconnecting..."),this.close(!0),this.connect()},this.pingResponseTimeout)):console.warn("WebSocket not connected, cannot send ping")}send(n){var o;this.isConnected.value&&((o=this.ws)==null?void 0:o.readyState)===WebSocket.OPEN?this.ws.send(JSON.stringify(n)):console.warn("WebSocket not connected")}close(n=!1){this.ws&&(this._shouldReconnect=!n,this.ws.close(),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this.ws=null,this.listeners.clear())}on(n,o){this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(o)}off(n,o){const r=this.listeners.get(n);r&&this.listeners.set(n,r.filter(a=>a!==o))}emit(n,o=null){const r=this.listeners.get(n);r&&r.forEach(a=>a(o))}getConnectionStatus(){return this.isConnected}}let pt=new Map;function ht(t,n={}){var r;if(pt.has(t)){const a=pt.get(t);if(a.isConnected.value&&((r=a.ws)==null?void 0:r.readyState)===WebSocket.OPEN)return a;a.close(!0),pt.delete(t)}const o=new Ir(t,n);return pt.set(t,o),o}const ce=U.defineStore("mainLib",()=>{const t=e.ref(),n=e.ref(!1),o=e.ref(localStorage.getItem("kiosk_timeout")),r=e.ref(0),a=e.ref(!1),s=e.ref(sessionStorage.getItem("is_adult")==="true"),i=e.ref([]),l=e.ref([]),c=e.ref(),d=e.ref(""),u=e.ref(0),f=e.ref(!1),g=e.ref(!1),_=e.ref(!0),m=e.ref(localStorage.getItem("apiKey")===null),y=e.ref(!1),S=e.ref({textNotification:""}),w=e.ref([]);let h=null;const p=b=>{const x=`wss://${c.value.area}/ws/device/${b}/`;h=ht(x);function V(){console.log("WebSocket connection opened")}function L(H){if(H.error)y.value=!0,S.value.textNotification=H.error,h==null||h.close(!0);else{if(!(H!=null&&H.params))return;typeof H.params.components.shift.is_ok!==null?_.value=H.params.components.shift.is_ok:_.value=!0}}function W(H){console.error("WebSocket error:",H),h.close(!0)}h.on("open",V),h.on("message",L),h.on("error",W),h.connect()},v=b=>{r.value=b,localStorage.setItem("kiosk_timeout",b)},D=b=>{n.value=b},O=e.ref(null),R=e.computed(()=>i.value.reduce((b,x)=>{let V=0,L=0;return x.group_modifiers&&(V=x.group_modifiers.reduce((W,H)=>H.modifiers?W+H.modifiers.reduce((X,te)=>X+te.old_price*te.amount,0):0,0)*x.amount),x.modifiers&&(L=x.modifiers.reduce((W,H)=>W+H.old_price*H.amount,0)*x.amount),b+x.old_price*x.amount+V+L},0)),M=e.computed({get:()=>i.value.length===0?0:O.value&&O.value!==0?O.value:i.value.reduce((b,x)=>{const V=nt(x)*x.amount;let L=0,W=0;return x.group_modifiers&&(L=x.group_modifiers.reduce((H,X)=>X.modifiers?H+X.modifiers.reduce((te,ue)=>te+ue.price*ue.amount,0):0,0)*x.amount),x.modifiers&&(W=x.modifiers.reduce((H,X)=>H+X.price*X.amount,0)*x.amount),b+V+L+W},0),set(b){O.value=b}}),k=b=>{u.value=b,localStorage.removeItem("bonus"),An("bonus",u.value)},N=b=>{Ke(b)},B=b=>{b={...b,idSystem:crypto.randomUUID()};const x=P(b);i.value.push(x),I()},I=()=>{try{if(!i.value||i.value.length===0){localStorage.removeItem("cart");return}localStorage.setItem("cart",JSON.stringify(e.toRaw(i.value)))}catch(b){console.error("Failed to update cart in localStorage:",b)}},P=b=>e.reactive({...b,amount:b.amount??1,price:b.old_price,new_price:null,total_new_price:null,discounts:[],modifiers:(b.modifiers||[]).map(x=>e.reactive({...x,price:x.old_price,new_price:null,total_new_price:null})),group_modifiers:(b.group_modifiers||[]).map(x=>e.reactive({...x,modifiers:(x.modifiers||[]).map(V=>e.reactive({...V,price:V.old_price,new_price:null,total_new_price:null}))}))}),T=b=>{const x=i.value.find(V=>V.idSystem===b);x&&(x.amount+=1),I()},C=b=>{const x=i.value.find(V=>V.idSystem===b);x&&(x.amount>=1&&(x.amount-=1),I())},A=()=>{try{const b=localStorage.getItem("cart");if(b){const x=JSON.parse(b);i.value.splice(0,i.value.length,...x.map(P)),O.value=null}}catch(b){console.error("Failed to load cart from localStorage:",b)}};return A(),{cartProducts_lib:i,activeScrolling_lib:l,config_lib:c,totalPrice_lib:M,initialCartPrice_lib:R,is_notification_lib:y,notificationData_lib:S,xApiKey_lib:d,countBonus:u,toggleDrum:n,is_showApiKey:m,openApiKey:f,kiosk_timeout:o,kiosk_FirstTimeout:r,is_OpenLoyal:g,profile:t,is_18_above_content:a,is18Allowed:s,healthState:_,displayCards:w,removeFromLocalStorage:N,setKioskTimeout:v,setBonus:k,setStateDrum:D,addToCart:B,plusAmount:T,minusAmount:C,loadCart:A,deleteItemFromCart:b=>{if(b){const x=i.value.findIndex(V=>V.idSystem===b);if(x===-1)return;i.value.splice(x,1),I(),O.value=null}else i.value=[],I()},updateCartInLocalStorage:I,makeProductFullyReactive:P,checkHeartbeatApp:p}}),Fe=U.defineStore("cartLib",()=>{const t=K.useRouter(),n=K.useRoute(),o=_e(),r=ce(),{config_lib:a,countBonus:s,totalPrice_lib:i,initialCartPrice_lib:l,is18Allowed:c}=U.storeToRefs(r),{itemThemes:d}=U.storeToRefs(o),u=e.ref(!1),f=e.ref(""),g=e.ref(null),_=e.ref("wait"),m=e.ref(0),y=e.ref(null),S=e.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry"]),w=e.ref("Оплатить"),h=e.ref(null),p=e.ref(!1),v=e.ref(null),D=e.ref(0),O=e.ref(!1),R=e.ref({textNotification:""});let M=null;const k=V=>{O.value=!0,R.value.textNotification=V},N=async(V,L,W=!1)=>{if(!V)return console.warn("makeInitPaymentLinkRequest","orderId is empry");try{const X=await Ve.create().initPaymentLink(V,L);x(null,L),W?(M==null||M.close(!0),b(),x("profile",L)):L||window.location.replace(X.url)}catch(H){v.value=null,r.loadCart(),H.response.data.user_friendly_message?(k(H.response.data.user_friendly_message),M==null||M.close(!0),L&&S.value.includes(H.response.status)?x("retryPage",L):W?(b(),x("",L)):(s.value=0,L||t.push(`/${n.params.orgId}/errorPayment`))):W?b():L||(s.value=0,t.push(`/${n.params.orgId}/errorPayment`))}},B=(V,L,W=!1)=>{M&&(M.off("open",X),M.off("message",te),M.off("error",ue),M.close(!0));const H=`wss://${a.value.area}/ws/order/${V}/`;M=ht(H);function X(){console.log("WebSocket connection opened")}function te(oe){if(oe!=null&&oe.params)if(h.value=oe,oe.error)k(oe.error),v.value=null,M==null||M.close(!0);else if(oe.params.status==="sent"){if(a.value.has_rms_discount)return oe.params.new_discounts&&(m.value=Number(oe.params.new_total_cost)-l.value,i.value=Number(oe.params.new_total_cost),k("К заказу были добавлены скидки")),p.value=!1;N(V,L,W)}else oe.params.status==="payment_initiation_retry"||oe.params.status==="fiscalized"?(v.value=2,Ve.create().orderPay(V).then(F=>{y.value=F.data.order_number}).catch(F=>{F.response.data.user_friendly_message&&(k(F.response.data.user_friendly_message),M.close(!0),L?S.value.includes(F.response.status)&&(x("retryPage",L),v.value=null):(s.value=0,t.push(`/${n.params.orgId}/errorPayment`),v.value=null))}).finally(()=>{p.value=!1})):oe.params.status==="paid"?(v.value=3,M.close(!0),localStorage.removeItem("cart")):S.value.includes(oe.params.status)&&(L?(x("retryPage",L),v.value=null):W?(b(),k("Ошибка создания заказа. Пожалуйста попробуйте еще раз")):(s.value=0,t.push(`/${n.params.orgId}/errorPayment`),v.value=null))}function ue(oe){console.error("WebSocket error:",oe),M.close(!0),p.value=!1,v.value=null}M.on("open",X),M.on("message",te),M.on("error",ue),M.connect()},I=e.computed(()=>!!g.value),P=V=>{_.value=V},T=V=>g.value=V,C=()=>{d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?u.value=!0:!d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?r.is_OpenLoyal=!0:u.value=!0,_.value="wait",f.value=""},A=()=>{u.value=!1,_.value="wait",f.value=""},$=()=>{g.value=null,f.value="",_.value="wait",A()},b=()=>{s.value=0,p.value=!1,v.value=null},x=(V=null,L=!1)=>{r.cartProducts_lib=[],Ke(["cart"]),L&&(Ke(["authTokensAccess","authTokensRefresh","user"]),r.profile=null,sessionStorage.removeItem("is_adult"),c.value=!1),V&&t.push(`/${n.params.orgId}/${V}`)};return{statusWSCreate:h,isButtonDisabled:p,orderCompleted_lib:v,extraDiscount:m,orderNumber:y,is_notification_lib:O,notificationData_lib:R,textPaymentBtn_lib:w,count:D,guestInfo:g,error:f,isDrawerOpen:u,currentState:_,isAuthorized:I,orderSocket:B,deleteCart:x,setGuestInfo:T,setState:P,openDrawer:C,closeDrawer:A,clearCard:$,makeInitPaymentLinkRequest:N,showNotification:k}}),me=U.defineStore("cardLib",()=>{const t=()=>({openCard:null,currentModifier:null,groupModifiers:[],groupModifiersSelected:[],groupCurrentOpen:null,isModifiedAmount:!1,selectedSize:{},productSizes:[],addedProducts:[],plusButtonsRefs:[],modalCount:1,isSectionModifier:!1,isAnimationFly:!0,textErrorRequaired:""}),n=e.ref(t()),o=()=>n.value=t(),r=e.ref(!1),a=e.ref(!1),s=e.ref(!1),i=e.ref(),l=e.ref([]),c=e.ref({id:null,visible:!1}),d=e.ref(!0),u=e.computed(()=>{const k=n.value.groupModifiersSelected.findIndex(N=>N.group===n.value.groupCurrentOpen.id);return f(k)}),f=k=>k===-1?0:(n.value.groupModifiersSelected[k].modifiers||[]).reduce((B,I)=>B+(I.amount||0),0),g=e.computed(()=>{var N;const k=(N=n.value.openCard)==null?void 0:N.group_modifiers.findIndex(B=>B.id===n.value.groupCurrentOpen.id);return k===-1||!n.value.openCard?0:n.value.openCard.modifiers.length>0&&k===0?n.value.openCard.modifiers.reduce((B,I)=>B+I.max_amount,0):n.value.groupModifiers[k].max_amount}),_=e.computed(()=>{var N;const k=(n.value.addedProducts??[]).reduce((B,I)=>B+I.price,0);if(n.value.openCard){const B=n.value.openCard,I=nt(B)||0,P=B.amount||1;return(n.value.groupModifiersSelected.reduce((C,A)=>(A.modifiers.forEach($=>{var b,x;$.sizes&&($.price=((x=(b=$.sizes)==null?void 0:b.find(V=>V.id===n.value.selectedSize.id))==null?void 0:x.price)??$.price),C+=$.price*$.amount}),C),0)+I)*P+k}return(N=n.value.addedProducts)!=null&&N.length?k:0}),m=e.computed(()=>{const k=n.value.groupModifiers,N=n.value.groupModifiersSelected;for(let B=0;B<k.length;B++){const I=k[B],P=N[B];if(I.min_amount>0&&f(B)<I.min_amount)return n.value.textErrorRequaired=`В группе "${I.name}" должно содержаться не меньше ${I.min_amount} модификатора(ов)`,{haveRequaire:!0,group:I};for(const T of I.group_modifiers)if(T.min_amount>0){const C=P.modifiers.find(A=>A.id===T.id);if(!C||C.amount<T.min_amount)return n.value.textErrorRequaired=`В группе "${I.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:I}}}return{haveRequaire:!1,group:k[0]}}),y=()=>{n.value.groupModifiers.forEach((k,N)=>{n.value.groupCurrentOpen={...k,index:N},k.group_modifiers.forEach(B=>{B.default_amount>0&&(B.amount=B.default_amount,R(B,!0))})})},S=k=>{n.value.addedProducts.push(k)},w=k=>{n.value.openCard=k},h=k=>{l.value=[...k]},p=(k,N)=>{var I,P;const B=k.id!==((I=n.value.groupCurrentOpen)==null?void 0:I.id);n.value.groupCurrentOpen={...k,index:N},B?n.value.isSectionModifier=!0:n.value.isSectionModifier=!n.value.isSectionModifier,document.body.style.overflow=n.value.isSectionModifier?"hidden":"",(P=n.value.plusButtonsRefs[N])==null||P.scrollIntoView({behavior:"smooth",block:"start"})},v=()=>{n.value.modalCount>n.value.currentModifier.min_amount&&n.value.modalCount>=2&&(n.value.modalCount-=1)},D=()=>{n.value.groupCurrentOpen&&n.value.modalCount+u.value<g.value&&(n.value.currentModifier.max_amount===0||n.value.currentModifier.max_amount>n.value.modalCount)&&(n.value.modalCount+=1)},O=(k,N)=>{var I;const B=(I=n.value.groupCurrentOpen)==null?void 0:I.id.toUpperCase();if(!k&&!n.value.isModifiedAmount&&N.max_amount!==1){if(B==="Добавки2000"&&N.max_amount>1)return!0;if(Math.abs(g.value-u.value)>1&&B!=="Добавки2000")return!0}return!1},R=(k,N=!1)=>{n.value.modalCount=1,n.value.currentModifier=k;const B=n.value.groupModifiersSelected.findIndex(I=>I.group===n.value.groupCurrentOpen.id);M(B,k,N)},M=(k,N,B)=>{let I=n.value.groupModifiersSelected;if(N.sizes.length>0&&N.sizes.find(P=>{var T;return P.id===((T=n.value.selectedSize)==null?void 0:T.id)}),k===-1)O(B,N)?n.value.isModifiedAmount=!0:I[n.value.groupCurrentOpen.index]={group:n.value.groupCurrentOpen.id,modifier_count:0,modifiers:[{...N,amount:(N==null?void 0:N.amount)??1}]};else{const P=n.value.groupModifiers[k].group_modifiers.findIndex(C=>C.id===N.id);if(I[k].modifiers.findIndex(C=>C.id===N.id)===-1){if(g.value===1)I[k].modifiers=[];else if(u.value>=g.value)return;O(B,N)?n.value.isModifiedAmount=!0:(I[k].modifiers.push({...N,amount:(N==null?void 0:N.amount)??1}),I[k].modifier_count=I[k].modifiers.reduce((C,A)=>C+=A.amount,0),n.value.isAnimationFly=!0)}else I[k].modifiers=I[k].modifiers.filter(C=>C.id!==N.id),I[k].modifier_count=I[k].modifiers.reduce((C,A)=>C+=A.amount,0),n.value.groupModifiers[k].group_modifiers[P].amount=1,n.value.groupModifiers[k].group_modifiers[P].default_amount=0,n.value.isAnimationFly=!1}n.value.groupModifiersSelected=I};return{stateCard:n,totalPrice_libCard:_,recountGroupTotalAmount:u,groupTotalAmount:g,isOpenWindow:r,isUpSale:a,checkedRequiredBtn:m,dataUpSale:i,productCards:l,isAddToCard:s,openProduct:c,is_startPage:d,setProduct:h,summModifierAmount:f,setAddedProducts:S,setCurrentCard:w,minusAmount:v,plusAmount:D,toggleNotRequire:p,modifierSelect:R,defaultAmountModifiers:y,reset:o}});function vn(t,n){return function(){return t.apply(n,arguments)}}const{toString:Rr}=Object.prototype,{getPrototypeOf:zt}=Object,{iterator:_t,toStringTag:$n}=Symbol,gt=(t=>n=>{const o=Rr.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ae=t=>(t=t.toLowerCase(),n=>gt(n)===t),yt=t=>n=>typeof n===t,{isArray:Je}=Array,Xe=yt("undefined");function rt(t){return t!==null&&!Xe(t)&&t.constructor!==null&&!Xe(t.constructor)&&ge(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Tn=Ae("ArrayBuffer");function Dr(t){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(t):n=t&&t.buffer&&Tn(t.buffer),n}const Or=yt("string"),ge=yt("function"),Mn=yt("number"),at=t=>t!==null&&typeof t=="object",Fr=t=>t===!0||t===!1,bt=t=>{if(gt(t)!=="object")return!1;const n=zt(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!($n in t)&&!(_t in t)},Lr=t=>{if(!at(t)||rt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},zr=Ae("Date"),Ur=Ae("File"),jr=Ae("Blob"),Hr=Ae("FileList"),qr=t=>at(t)&&ge(t.pipe),Wr=t=>{let n;return t&&(typeof FormData=="function"&&t instanceof FormData||ge(t.append)&&((n=gt(t))==="formdata"||n==="object"&&ge(t.toString)&&t.toString()==="[object FormData]"))},Gr=Ae("URLSearchParams"),[Kr,Jr,Xr,Zr]=["ReadableStream","Request","Response","Headers"].map(Ae),Yr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function st(t,n,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let r,a;if(typeof t!="object"&&(t=[t]),Je(t))for(r=0,a=t.length;r<a;r++)n.call(null,t[r],r,t);else{if(rt(t))return;const s=o?Object.getOwnPropertyNames(t):Object.keys(t),i=s.length;let l;for(r=0;r<i;r++)l=s[r],n.call(null,t[l],l,t)}}function Pn(t,n){if(rt(t))return null;n=n.toLowerCase();const o=Object.keys(t);let r=o.length,a;for(;r-- >0;)if(a=o[r],n===a.toLowerCase())return a;return null}const Le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Vn=t=>!Xe(t)&&t!==Le;function Ut(){const{caseless:t,skipUndefined:n}=Vn(this)&&this||{},o={},r=(a,s)=>{const i=t&&Pn(o,s)||s;bt(o[i])&&bt(a)?o[i]=Ut(o[i],a):bt(a)?o[i]=Ut({},a):Je(a)?o[i]=a.slice():(!n||!Xe(a))&&(o[i]=a)};for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&st(arguments[a],r);return o}const Qr=(t,n,o,{allOwnKeys:r}={})=>(st(n,(a,s)=>{o&&ge(a)?t[s]=vn(a,o):t[s]=a},{allOwnKeys:r}),t),ea=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ta=(t,n,o,r)=>{t.prototype=Object.create(n.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:n.prototype}),o&&Object.assign(t.prototype,o)},na=(t,n,o,r)=>{let a,s,i;const l={};if(n=n||{},t==null)return n;do{for(a=Object.getOwnPropertyNames(t),s=a.length;s-- >0;)i=a[s],(!r||r(i,t,n))&&!l[i]&&(n[i]=t[i],l[i]=!0);t=o!==!1&&zt(t)}while(t&&(!o||o(t,n))&&t!==Object.prototype);return n},oa=(t,n,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=n.length;const r=t.indexOf(n,o);return r!==-1&&r===o},ra=t=>{if(!t)return null;if(Je(t))return t;let n=t.length;if(!Mn(n))return null;const o=new Array(n);for(;n-- >0;)o[n]=t[n];return o},aa=(t=>n=>t&&n instanceof t)(typeof Uint8Array<"u"&&zt(Uint8Array)),sa=(t,n)=>{const r=(t&&t[_t]).call(t);let a;for(;(a=r.next())&&!a.done;){const s=a.value;n.call(t,s[0],s[1])}},ia=(t,n)=>{let o;const r=[];for(;(o=t.exec(n))!==null;)r.push(o);return r},la=Ae("HTMLFormElement"),ca=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,r,a){return r.toUpperCase()+a}),In=(({hasOwnProperty:t})=>(n,o)=>t.call(n,o))(Object.prototype),da=Ae("RegExp"),Rn=(t,n)=>{const o=Object.getOwnPropertyDescriptors(t),r={};st(o,(a,s)=>{let i;(i=n(a,s,t))!==!1&&(r[s]=i||a)}),Object.defineProperties(t,r)},ua=t=>{Rn(t,(n,o)=>{if(ge(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const r=t[o];if(ge(r)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},fa=(t,n)=>{const o={},r=a=>{a.forEach(s=>{o[s]=!0})};return Je(t)?r(t):r(String(t).split(n)),o},ma=()=>{},pa=(t,n)=>t!=null&&Number.isFinite(t=+t)?t:n;function ha(t){return!!(t&&ge(t.append)&&t[$n]==="FormData"&&t[_t])}const _a=t=>{const n=new Array(10),o=(r,a)=>{if(at(r)){if(n.indexOf(r)>=0)return;if(rt(r))return r;if(!("toJSON"in r)){n[a]=r;const s=Je(r)?[]:{};return st(r,(i,l)=>{const c=o(i,a+1);!Xe(c)&&(s[l]=c)}),n[a]=void 0,s}}return r};return o(t,0)},ga=Ae("AsyncFunction"),ya=t=>t&&(at(t)||ge(t))&&ge(t.then)&&ge(t.catch),Dn=((t,n)=>t?setImmediate:n?((o,r)=>(Le.addEventListener("message",({source:a,data:s})=>{a===Le&&s===o&&r.length&&r.shift()()},!1),a=>{r.push(a),Le.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",ge(Le.postMessage)),ba=typeof queueMicrotask<"u"?queueMicrotask.bind(Le):typeof process<"u"&&process.nextTick||Dn,E={isArray:Je,isArrayBuffer:Tn,isBuffer:rt,isFormData:Wr,isArrayBufferView:Dr,isString:Or,isNumber:Mn,isBoolean:Fr,isObject:at,isPlainObject:bt,isEmptyObject:Lr,isReadableStream:Kr,isRequest:Jr,isResponse:Xr,isHeaders:Zr,isUndefined:Xe,isDate:zr,isFile:Ur,isBlob:jr,isRegExp:da,isFunction:ge,isStream:qr,isURLSearchParams:Gr,isTypedArray:aa,isFileList:Hr,forEach:st,merge:Ut,extend:Qr,trim:Yr,stripBOM:ea,inherits:ta,toFlatObject:na,kindOf:gt,kindOfTest:Ae,endsWith:oa,toArray:ra,forEachEntry:sa,matchAll:ia,isHTMLForm:la,hasOwnProperty:In,hasOwnProp:In,reduceDescriptors:Rn,freezeMethods:ua,toObjectSet:fa,toCamelCase:ca,noop:ma,toFiniteNumber:pa,findKey:Pn,global:Le,isContextDefined:Vn,isSpecCompliantForm:ha,toJSONObject:_a,isAsyncFn:ga,isThenable:ya,setImmediate:Dn,asap:ba,isIterable:t=>t!=null&&ge(t[_t])};function J(t,n,o,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",n&&(this.code=n),o&&(this.config=o),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}E.inherits(J,Error,{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:E.toJSONObject(this.config),code:this.code,status:this.status}}});const On=J.prototype,Fn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Fn[t]={value:t}}),Object.defineProperties(J,Fn),Object.defineProperty(On,"isAxiosError",{value:!0}),J.from=(t,n,o,r,a,s)=>{const i=Object.create(On);E.toFlatObject(t,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=n==null&&t?t.code:n;return J.call(i,l,c,o,r,a),t&&i.cause==null&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",s&&Object.assign(i,s),i};const wa=null;function jt(t){return E.isPlainObject(t)||E.isArray(t)}function Ln(t){return E.endsWith(t,"[]")?t.slice(0,-2):t}function zn(t,n,o){return t?t.concat(n).map(function(a,s){return a=Ln(a),!o&&s?"["+a+"]":a}).join(o?".":""):n}function ka(t){return E.isArray(t)&&!t.some(jt)}const Ca=E.toFlatObject(E,{},null,function(n){return/^is[A-Z]/.test(n)});function wt(t,n,o){if(!E.isObject(t))throw new TypeError("target must be an object");n=n||new FormData,o=E.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,S){return!E.isUndefined(S[y])});const r=o.metaTokens,a=o.visitor||u,s=o.dots,i=o.indexes,c=(o.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(n);if(!E.isFunction(a))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(E.isBoolean(m))return m.toString();if(!c&&E.isBlob(m))throw new J("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,y,S){let w=m;if(m&&!S&&typeof m=="object"){if(E.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&ka(m)||(E.isFileList(m)||E.endsWith(y,"[]"))&&(w=E.toArray(m)))return y=Ln(y),w.forEach(function(p,v){!(E.isUndefined(p)||p===null)&&n.append(i===!0?zn([y],v,s):i===null?y:y+"[]",d(p))}),!1}return jt(m)?!0:(n.append(zn(S,y,s),d(m)),!1)}const f=[],g=Object.assign(Ca,{defaultVisitor:u,convertValue:d,isVisitable:jt});function _(m,y){if(!E.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(m),E.forEach(m,function(w,h){(!(E.isUndefined(w)||w===null)&&a.call(n,w,E.isString(h)?h.trim():h,y,g))===!0&&_(w,y?y.concat(h):[h])}),f.pop()}}if(!E.isObject(t))throw new TypeError("data must be an object");return _(t),n}function Un(t){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return n[r]})}function Ht(t,n){this._pairs=[],t&&wt(t,this,n)}const jn=Ht.prototype;jn.append=function(n,o){this._pairs.push([n,o])},jn.toString=function(n){const o=n?function(r){return n.call(this,r,Un)}:Un;return this._pairs.map(function(a){return o(a[0])+"="+o(a[1])},"").join("&")};function Sa(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Hn(t,n,o){if(!n)return t;const r=o&&o.encode||Sa;E.isFunction(o)&&(o={serialize:o});const a=o&&o.serialize;let s;if(a?s=a(n,o):s=E.isURLSearchParams(n)?n.toString():new Ht(n,o).toString(r),s){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class qn{constructor(){this.handlers=[]}use(n,o,r){return this.handlers.push({fulfilled:n,rejected:o,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){E.forEach(this.handlers,function(r){r!==null&&n(r)})}}const Wn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ea={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ht,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},qt=typeof window<"u"&&typeof document<"u",Wt=typeof navigator=="object"&&navigator||void 0,Na=qt&&(!Wt||["ReactNative","NativeScript","NS"].indexOf(Wt.product)<0),xa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ba=qt&&window.location.href||"http://localhost",he={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qt,hasStandardBrowserEnv:Na,hasStandardBrowserWebWorkerEnv:xa,navigator:Wt,origin:Ba},Symbol.toStringTag,{value:"Module"})),...Ea};function Aa(t,n){return wt(t,new he.classes.URLSearchParams,{visitor:function(o,r,a,s){return he.isNode&&E.isBuffer(o)?(this.append(r,o.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...n})}function va(t){return E.matchAll(/\w+|\[(\w*)]/g,t).map(n=>n[0]==="[]"?"":n[1]||n[0])}function $a(t){const n={},o=Object.keys(t);let r;const a=o.length;let s;for(r=0;r<a;r++)s=o[r],n[s]=t[s];return n}function Gn(t){function n(o,r,a,s){let i=o[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),c=s>=o.length;return i=!i&&E.isArray(a)?a.length:i,c?(E.hasOwnProp(a,i)?a[i]=[a[i],r]:a[i]=r,!l):((!a[i]||!E.isObject(a[i]))&&(a[i]=[]),n(o,r,a[i],s)&&E.isArray(a[i])&&(a[i]=$a(a[i])),!l)}if(E.isFormData(t)&&E.isFunction(t.entries)){const o={};return E.forEachEntry(t,(r,a)=>{n(va(r),a,o,0)}),o}return null}function Ta(t,n,o){if(E.isString(t))try{return(n||JSON.parse)(t),E.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(t)}const it={transitional:Wn,adapter:["xhr","http","fetch"],transformRequest:[function(n,o){const r=o.getContentType()||"",a=r.indexOf("application/json")>-1,s=E.isObject(n);if(s&&E.isHTMLForm(n)&&(n=new FormData(n)),E.isFormData(n))return a?JSON.stringify(Gn(n)):n;if(E.isArrayBuffer(n)||E.isBuffer(n)||E.isStream(n)||E.isFile(n)||E.isBlob(n)||E.isReadableStream(n))return n;if(E.isArrayBufferView(n))return n.buffer;if(E.isURLSearchParams(n))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Aa(n,this.formSerializer).toString();if((l=E.isFileList(n))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return wt(l?{"files[]":n}:n,c&&new c,this.formSerializer)}}return s||a?(o.setContentType("application/json",!1),Ta(n)):n}],transformResponse:[function(n){const o=this.transitional||it.transitional,r=o&&o.forcedJSONParsing,a=this.responseType==="json";if(E.isResponse(n)||E.isReadableStream(n))return n;if(n&&E.isString(n)&&(r&&!this.responseType||a)){const i=!(o&&o.silentJSONParsing)&&a;try{return JSON.parse(n,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?J.from(l,J.ERR_BAD_RESPONSE,this,null,this.response):l}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:he.classes.FormData,Blob:he.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],t=>{it.headers[t]={}});const Ma=E.toObjectSet(["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"]),Pa=t=>{const n={};let o,r,a;return t&&t.split(`
2
- `).forEach(function(i){a=i.indexOf(":"),o=i.substring(0,a).trim().toLowerCase(),r=i.substring(a+1).trim(),!(!o||n[o]&&Ma[o])&&(o==="set-cookie"?n[o]?n[o].push(r):n[o]=[r]:n[o]=n[o]?n[o]+", "+r:r)}),n},Kn=Symbol("internals");function lt(t){return t&&String(t).trim().toLowerCase()}function kt(t){return t===!1||t==null?t:E.isArray(t)?t.map(kt):String(t)}function Va(t){const n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(t);)n[r[1]]=r[2];return n}const Ia=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Gt(t,n,o,r,a){if(E.isFunction(r))return r.call(this,n,o);if(a&&(n=o),!!E.isString(n)){if(E.isString(r))return n.indexOf(r)!==-1;if(E.isRegExp(r))return r.test(n)}}function Ra(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,o,r)=>o.toUpperCase()+r)}function Da(t,n){const o=E.toCamelCase(" "+n);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+o,{value:function(a,s,i){return this[r].call(this,n,a,s,i)},configurable:!0})})}let ye=class{constructor(n){n&&this.set(n)}set(n,o,r){const a=this;function s(l,c,d){const u=lt(c);if(!u)throw new Error("header name must be a non-empty string");const f=E.findKey(a,u);(!f||a[f]===void 0||d===!0||d===void 0&&a[f]!==!1)&&(a[f||c]=kt(l))}const i=(l,c)=>E.forEach(l,(d,u)=>s(d,u,c));if(E.isPlainObject(n)||n instanceof this.constructor)i(n,o);else if(E.isString(n)&&(n=n.trim())&&!Ia(n))i(Pa(n),o);else if(E.isObject(n)&&E.isIterable(n)){let l={},c,d;for(const u of n){if(!E.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?E.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(l,o)}else n!=null&&s(o,n,r);return this}get(n,o){if(n=lt(n),n){const r=E.findKey(this,n);if(r){const a=this[r];if(!o)return a;if(o===!0)return Va(a);if(E.isFunction(o))return o.call(this,a,r);if(E.isRegExp(o))return o.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,o){if(n=lt(n),n){const r=E.findKey(this,n);return!!(r&&this[r]!==void 0&&(!o||Gt(this,this[r],r,o)))}return!1}delete(n,o){const r=this;let a=!1;function s(i){if(i=lt(i),i){const l=E.findKey(r,i);l&&(!o||Gt(r,r[l],l,o))&&(delete r[l],a=!0)}}return E.isArray(n)?n.forEach(s):s(n),a}clear(n){const o=Object.keys(this);let r=o.length,a=!1;for(;r--;){const s=o[r];(!n||Gt(this,this[s],s,n,!0))&&(delete this[s],a=!0)}return a}normalize(n){const o=this,r={};return E.forEach(this,(a,s)=>{const i=E.findKey(r,s);if(i){o[i]=kt(a),delete o[s];return}const l=n?Ra(s):String(s).trim();l!==s&&delete o[s],o[l]=kt(a),r[l]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const o=Object.create(null);return E.forEach(this,(r,a)=>{r!=null&&r!==!1&&(o[a]=n&&E.isArray(r)?r.join(", "):r)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,o])=>n+": "+o).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...o){const r=new this(n);return o.forEach(a=>r.set(a)),r}static accessor(n){const r=(this[Kn]=this[Kn]={accessors:{}}).accessors,a=this.prototype;function s(i){const l=lt(i);r[l]||(Da(a,i),r[l]=!0)}return E.isArray(n)?n.forEach(s):s(n),this}};ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(ye.prototype,({value:t},n)=>{let o=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(r){this[o]=r}}}),E.freezeMethods(ye);function Kt(t,n){const o=this||it,r=n||o,a=ye.from(r.headers);let s=r.data;return E.forEach(t,function(l){s=l.call(o,s,a.normalize(),n?n.status:void 0)}),a.normalize(),s}function Jn(t){return!!(t&&t.__CANCEL__)}function Ze(t,n,o){J.call(this,t??"canceled",J.ERR_CANCELED,n,o),this.name="CanceledError"}E.inherits(Ze,J,{__CANCEL__:!0});function Xn(t,n,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?t(o):n(new J("Request failed with status code "+o.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function Oa(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function Fa(t,n){t=t||10;const o=new Array(t),r=new Array(t);let a=0,s=0,i;return n=n!==void 0?n:1e3,function(c){const d=Date.now(),u=r[s];i||(i=d),o[a]=c,r[a]=d;let f=s,g=0;for(;f!==a;)g+=o[f++],f=f%t;if(a=(a+1)%t,a===s&&(s=(s+1)%t),d-i<n)return;const _=u&&d-u;return _?Math.round(g*1e3/_):void 0}}function La(t,n){let o=0,r=1e3/n,a,s;const i=(d,u=Date.now())=>{o=u,a=null,s&&(clearTimeout(s),s=null),t(...d)};return[(...d)=>{const u=Date.now(),f=u-o;f>=r?i(d,u):(a=d,s||(s=setTimeout(()=>{s=null,i(a)},r-f)))},()=>a&&i(a)]}const Ct=(t,n,o=3)=>{let r=0;const a=Fa(50,250);return La(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,c=i-r,d=a(c),u=i<=l;r=i;const f={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:s,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(f)},o)},Zn=(t,n)=>{const o=t!=null;return[r=>n[0]({lengthComputable:o,total:t,loaded:r}),n[1]]},Yn=t=>(...n)=>E.asap(()=>t(...n)),za=he.hasStandardBrowserEnv?((t,n)=>o=>(o=new URL(o,he.origin),t.protocol===o.protocol&&t.host===o.host&&(n||t.port===o.port)))(new URL(he.origin),he.navigator&&/(msie|trident)/i.test(he.navigator.userAgent)):()=>!0,Ua=he.hasStandardBrowserEnv?{write(t,n,o,r,a,s,i){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(n)}`];E.isNumber(o)&&l.push(`expires=${new Date(o).toUTCString()}`),E.isString(r)&&l.push(`path=${r}`),E.isString(a)&&l.push(`domain=${a}`),s===!0&&l.push("secure"),E.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ja(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ha(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function Qn(t,n,o){let r=!ja(n);return t&&(r||o==!1)?Ha(t,n):n}const eo=t=>t instanceof ye?{...t}:t;function ze(t,n){n=n||{};const o={};function r(d,u,f,g){return E.isPlainObject(d)&&E.isPlainObject(u)?E.merge.call({caseless:g},d,u):E.isPlainObject(u)?E.merge({},u):E.isArray(u)?u.slice():u}function a(d,u,f,g){if(E.isUndefined(u)){if(!E.isUndefined(d))return r(void 0,d,f,g)}else return r(d,u,f,g)}function s(d,u){if(!E.isUndefined(u))return r(void 0,u)}function i(d,u){if(E.isUndefined(u)){if(!E.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function l(d,u,f){if(f in n)return r(d,u);if(f in t)return r(void 0,d)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,u,f)=>a(eo(d),eo(u),f,!0)};return E.forEach(Object.keys({...t,...n}),function(u){const f=c[u]||a,g=f(t[u],n[u],u);E.isUndefined(g)&&f!==l||(o[u]=g)}),o}const to=t=>{const n=ze({},t);let{data:o,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:s,headers:i,auth:l}=n;if(n.headers=i=ye.from(i),n.url=Hn(Qn(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),E.isFormData(o)){if(he.hasStandardBrowserEnv||he.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(E.isFunction(o.getHeaders)){const c=o.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,f])=>{d.includes(u.toLowerCase())&&i.set(u,f)})}}if(he.hasStandardBrowserEnv&&(r&&E.isFunction(r)&&(r=r(n)),r||r!==!1&&za(n.url))){const c=a&&s&&Ua.read(s);c&&i.set(a,c)}return n},qa=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(o,r){const a=to(t);let s=a.data;const i=ye.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=a,u,f,g,_,m;function y(){_&&_(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let S=new XMLHttpRequest;S.open(a.method.toUpperCase(),a.url,!0),S.timeout=a.timeout;function w(){if(!S)return;const p=ye.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),D={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:p,config:t,request:S};Xn(function(R){o(R),y()},function(R){r(R),y()},D),S=null}"onloadend"in S?S.onloadend=w:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(w)},S.onabort=function(){S&&(r(new J("Request aborted",J.ECONNABORTED,t,S)),S=null)},S.onerror=function(v){const D=v&&v.message?v.message:"Network Error",O=new J(D,J.ERR_NETWORK,t,S);O.event=v||null,r(O),S=null},S.ontimeout=function(){let v=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const D=a.transitional||Wn;a.timeoutErrorMessage&&(v=a.timeoutErrorMessage),r(new J(v,D.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,t,S)),S=null},s===void 0&&i.setContentType(null),"setRequestHeader"in S&&E.forEach(i.toJSON(),function(v,D){S.setRequestHeader(D,v)}),E.isUndefined(a.withCredentials)||(S.withCredentials=!!a.withCredentials),l&&l!=="json"&&(S.responseType=a.responseType),d&&([g,m]=Ct(d,!0),S.addEventListener("progress",g)),c&&S.upload&&([f,_]=Ct(c),S.upload.addEventListener("progress",f),S.upload.addEventListener("loadend",_)),(a.cancelToken||a.signal)&&(u=p=>{S&&(r(!p||p.type?new Ze(null,t,S):p),S.abort(),S=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const h=Oa(a.url);if(h&&he.protocols.indexOf(h)===-1){r(new J("Unsupported protocol "+h+":",J.ERR_BAD_REQUEST,t));return}S.send(s||null)})},Wa=(t,n)=>{const{length:o}=t=t?t.filter(Boolean):[];if(n||o){let r=new AbortController,a;const s=function(d){if(!a){a=!0,l();const u=d instanceof Error?d:this.reason;r.abort(u instanceof J?u:new Ze(u instanceof Error?u.message:u))}};let i=n&&setTimeout(()=>{i=null,s(new J(`timeout ${n} of ms exceeded`,J.ETIMEDOUT))},n);const l=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),t=null)};t.forEach(d=>d.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>E.asap(l),c}},Ga=function*(t,n){let o=t.byteLength;if(o<n){yield t;return}let r=0,a;for(;r<o;)a=r+n,yield t.slice(r,a),r=a},Ka=async function*(t,n){for await(const o of Ja(t))yield*Ga(o,n)},Ja=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:o,value:r}=await n.read();if(o)break;yield r}}finally{await n.cancel()}},no=(t,n,o,r)=>{const a=Ka(t,n);let s=0,i,l=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await a.next();if(d){l(),c.close();return}let f=u.byteLength;if(o){let g=s+=f;o(g)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},oo=64*1024,{isFunction:St}=E,Xa=(({Request:t,Response:n})=>({Request:t,Response:n}))(E.global),{ReadableStream:ro,TextEncoder:ao}=E.global,so=(t,...n)=>{try{return!!t(...n)}catch{return!1}},Za=t=>{t=E.merge.call({skipUndefined:!0},Xa,t);const{fetch:n,Request:o,Response:r}=t,a=n?St(n):typeof fetch=="function",s=St(o),i=St(r);if(!a)return!1;const l=a&&St(ro),c=a&&(typeof ao=="function"?(m=>y=>m.encode(y))(new ao):async m=>new Uint8Array(await new o(m).arrayBuffer())),d=s&&l&&so(()=>{let m=!1;const y=new o(he.origin,{body:new ro,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!y}),u=i&&l&&so(()=>E.isReadableStream(new r("").body)),f={stream:u&&(m=>m.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(y,S)=>{let w=y&&y[m];if(w)return w.call(y);throw new J(`Response type '${m}' is not supported`,J.ERR_NOT_SUPPORT,S)})});const g=async m=>{if(m==null)return 0;if(E.isBlob(m))return m.size;if(E.isSpecCompliantForm(m))return(await new o(he.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(E.isArrayBufferView(m)||E.isArrayBuffer(m))return m.byteLength;if(E.isURLSearchParams(m)&&(m=m+""),E.isString(m))return(await c(m)).byteLength},_=async(m,y)=>{const S=E.toFiniteNumber(m.getContentLength());return S??g(y)};return async m=>{let{url:y,method:S,data:w,signal:h,cancelToken:p,timeout:v,onDownloadProgress:D,onUploadProgress:O,responseType:R,headers:M,withCredentials:k="same-origin",fetchOptions:N}=to(m),B=n||fetch;R=R?(R+"").toLowerCase():"text";let I=Wa([h,p&&p.toAbortSignal()],v),P=null;const T=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let C;try{if(O&&d&&S!=="get"&&S!=="head"&&(C=await _(M,w))!==0){let L=new o(y,{method:"POST",body:w,duplex:"half"}),W;if(E.isFormData(w)&&(W=L.headers.get("content-type"))&&M.setContentType(W),L.body){const[H,X]=Zn(C,Ct(Yn(O)));w=no(L.body,oo,H,X)}}E.isString(k)||(k=k?"include":"omit");const A=s&&"credentials"in o.prototype,$={...N,signal:I,method:S.toUpperCase(),headers:M.normalize().toJSON(),body:w,duplex:"half",credentials:A?k:void 0};P=s&&new o(y,$);let b=await(s?B(P,N):B(y,$));const x=u&&(R==="stream"||R==="response");if(u&&(D||x&&T)){const L={};["status","statusText","headers"].forEach(te=>{L[te]=b[te]});const W=E.toFiniteNumber(b.headers.get("content-length")),[H,X]=D&&Zn(W,Ct(Yn(D),!0))||[];b=new r(no(b.body,oo,H,()=>{X&&X(),T&&T()}),L)}R=R||"text";let V=await f[E.findKey(f,R)||"text"](b,m);return!x&&T&&T(),await new Promise((L,W)=>{Xn(L,W,{data:V,headers:ye.from(b.headers),status:b.status,statusText:b.statusText,config:m,request:P})})}catch(A){throw T&&T(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,m,P),{cause:A.cause||A}):J.from(A,A&&A.code,m,P)}}},Ya=new Map,io=t=>{let n=t&&t.env||{};const{fetch:o,Request:r,Response:a}=n,s=[r,a,o];let i=s.length,l=i,c,d,u=Ya;for(;l--;)c=s[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Za(n)),u=d;return d};io();const Jt={http:wa,xhr:qa,fetch:{get:io}};E.forEach(Jt,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const lo=t=>`- ${t}`,Qa=t=>E.isFunction(t)||t===null||t===!1;function es(t,n){t=E.isArray(t)?t:[t];const{length:o}=t;let r,a;const s={};for(let i=0;i<o;i++){r=t[i];let l;if(a=r,!Qa(r)&&(a=Jt[(l=String(r)).toLowerCase()],a===void 0))throw new J(`Unknown adapter '${l}'`);if(a&&(E.isFunction(a)||(a=a.get(n))))break;s[l||"#"+i]=a}if(!a){const i=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=o?i.length>1?`since :
4
- `+i.map(lo).join(`
5
- `):" "+lo(i[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a}const co={getAdapter:es,adapters:Jt};function Xt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ze(null,t)}function uo(t){return Xt(t),t.headers=ye.from(t.headers),t.data=Kt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),co.getAdapter(t.adapter||it.adapter,t)(t).then(function(r){return Xt(t),r.data=Kt.call(t,t.transformResponse,r),r.headers=ye.from(r.headers),r},function(r){return Jn(r)||(Xt(t),r&&r.response&&(r.response.data=Kt.call(t,t.transformResponse,r.response),r.response.headers=ye.from(r.response.headers))),Promise.reject(r)})}const fo="1.13.2",Et={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{Et[t]=function(r){return typeof r===t||"a"+(n<1?"n ":" ")+t}});const mo={};Et.transitional=function(n,o,r){function a(s,i){return"[Axios v"+fo+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,l)=>{if(n===!1)throw new J(a(i," has been removed"+(o?" in "+o:"")),J.ERR_DEPRECATED);return o&&!mo[i]&&(mo[i]=!0,console.warn(a(i," has been deprecated since v"+o+" and will be removed in the near future"))),n?n(s,i,l):!0}},Et.spelling=function(n){return(o,r)=>(console.warn(`${r} is likely a misspelling of ${n}`),!0)};function ts(t,n,o){if(typeof t!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let a=r.length;for(;a-- >0;){const s=r[a],i=n[s];if(i){const l=t[s],c=l===void 0||i(l,s,t);if(c!==!0)throw new J("option "+s+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}}const Nt={assertOptions:ts,validators:Et},Te=Nt.validators;let Ue=class{constructor(n){this.defaults=n||{},this.interceptors={request:new qn,response:new qn}}async request(n,o){try{return await this._request(n,o)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const s=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+s):r.stack=s}catch{}}throw r}}_request(n,o){typeof n=="string"?(o=o||{},o.url=n):o=n||{},o=ze(this.defaults,o);const{transitional:r,paramsSerializer:a,headers:s}=o;r!==void 0&&Nt.assertOptions(r,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),a!=null&&(E.isFunction(a)?o.paramsSerializer={serialize:a}:Nt.assertOptions(a,{encode:Te.function,serialize:Te.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Nt.assertOptions(o,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=s&&E.merge(s.common,s[o.method]);s&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),o.headers=ye.concat(i,s);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(o)===!1||(c=c&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let u,f=0,g;if(!c){const m=[uo.bind(this),void 0];for(m.unshift(...l),m.push(...d),g=m.length,u=Promise.resolve(o);f<g;)u=u.then(m[f++],m[f++]);return u}g=l.length;let _=o;for(;f<g;){const m=l[f++],y=l[f++];try{_=m(_)}catch(S){y.call(this,S);break}}try{u=uo.call(this,_)}catch(m){return Promise.reject(m)}for(f=0,g=d.length;f<g;)u=u.then(d[f++],d[f++]);return u}getUri(n){n=ze(this.defaults,n);const o=Qn(n.baseURL,n.url,n.allowAbsoluteUrls);return Hn(o,n.params,n.paramsSerializer)}};E.forEach(["delete","get","head","options"],function(n){Ue.prototype[n]=function(o,r){return this.request(ze(r||{},{method:n,url:o,data:(r||{}).data}))}}),E.forEach(["post","put","patch"],function(n){function o(r){return function(s,i,l){return this.request(ze(l||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Ue.prototype[n]=o(),Ue.prototype[n+"Form"]=o(!0)});let ns=class zo{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(s){o=s});const r=this;this.promise.then(a=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](a);r._listeners=null}),this.promise.then=a=>{let s;const i=new Promise(l=>{r.subscribe(l),s=l}).then(a);return i.cancel=function(){r.unsubscribe(s)},i},n(function(s,i,l){r.reason||(r.reason=new Ze(s,i,l),o(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const o=this._listeners.indexOf(n);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const n=new AbortController,o=r=>{n.abort(r)};return this.subscribe(o),n.signal.unsubscribe=()=>this.unsubscribe(o),n.signal}static source(){let n;return{token:new zo(function(a){n=a}),cancel:n}}};function os(t){return function(o){return t.apply(null,o)}}function rs(t){return E.isObject(t)&&t.isAxiosError===!0}const Zt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Zt).forEach(([t,n])=>{Zt[n]=t});function po(t){const n=new Ue(t),o=vn(Ue.prototype.request,n);return E.extend(o,Ue.prototype,n,{allOwnKeys:!0}),E.extend(o,n,null,{allOwnKeys:!0}),o.create=function(a){return po(ze(t,a))},o}const ae=po(it);ae.Axios=Ue,ae.CanceledError=Ze,ae.CancelToken=ns,ae.isCancel=Jn,ae.VERSION=fo,ae.toFormData=wt,ae.AxiosError=J,ae.Cancel=ae.CanceledError,ae.all=function(n){return Promise.all(n)},ae.spread=os,ae.isAxiosError=rs,ae.mergeConfig=ze,ae.AxiosHeaders=ye,ae.formToJSON=t=>Gn(E.isHTMLForm(t)?new FormData(t):t),ae.getAdapter=co.getAdapter,ae.HttpStatusCode=Zt,ae.default=ae;const{Axios:ru,AxiosError:au,CanceledError:su,isCancel:iu,CancelToken:lu,VERSION:cu,all:du,Cancel:uu,isAxiosError:fu,spread:mu,toFormData:pu,AxiosHeaders:hu,HttpStatusCode:_u,formToJSON:gu,getAdapter:yu,mergeConfig:bu}=ae;var as=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ss(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ho={exports:{}};(function(t,n){(function(o,r){t.exports=r()})(as,function(){var o=1e3,r=6e4,a=36e5,s="millisecond",i="second",l="minute",c="hour",d="day",u="week",f="month",g="quarter",_="year",m="date",y="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,h={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("_"),ordinal:function(T){var C=["th","st","nd","rd"],A=T%100;return"["+T+(C[(A-20)%10]||C[A]||C[0])+"]"}},p=function(T,C,A){var $=String(T);return!$||$.length>=C?T:""+Array(C+1-$.length).join(A)+T},v={s:p,z:function(T){var C=-T.utcOffset(),A=Math.abs(C),$=Math.floor(A/60),b=A%60;return(C<=0?"+":"-")+p($,2,"0")+":"+p(b,2,"0")},m:function T(C,A){if(C.date()<A.date())return-T(A,C);var $=12*(A.year()-C.year())+(A.month()-C.month()),b=C.clone().add($,f),x=A-b<0,V=C.clone().add($+(x?-1:1),f);return+(-($+(A-b)/(x?b-V:V-b))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:f,y:_,w:u,d,D:m,h:c,m:l,s:i,ms:s,Q:g}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},D="en",O={};O[D]=h;var R="$isDayjsObject",M=function(T){return T instanceof I||!(!T||!T[R])},k=function T(C,A,$){var b;if(!C)return D;if(typeof C=="string"){var x=C.toLowerCase();O[x]&&(b=x),A&&(O[x]=A,b=x);var V=C.split("-");if(!b&&V.length>1)return T(V[0])}else{var L=C.name;O[L]=C,b=L}return!$&&b&&(D=b),b||!$&&D},N=function(T,C){if(M(T))return T.clone();var A=typeof C=="object"?C:{};return A.date=T,A.args=arguments,new I(A)},B=v;B.l=k,B.i=M,B.w=function(T,C){return N(T,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var I=function(){function T(A){this.$L=k(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[R]=!0}var C=T.prototype;return C.parse=function(A){this.$d=function($){var b=$.date,x=$.utc;if(b===null)return new Date(NaN);if(B.u(b))return new Date;if(b instanceof Date)return new Date(b);if(typeof b=="string"&&!/Z$/i.test(b)){var V=b.match(S);if(V){var L=V[2]-1||0,W=(V[7]||"0").substring(0,3);return x?new Date(Date.UTC(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,W)):new Date(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,W)}}return new Date(b)}(A),this.init()},C.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},C.$utils=function(){return B},C.isValid=function(){return this.$d.toString()!==y},C.isSame=function(A,$){var b=N(A);return this.startOf($)<=b&&b<=this.endOf($)},C.isAfter=function(A,$){return N(A)<this.startOf($)},C.isBefore=function(A,$){return this.endOf($)<N(A)},C.$g=function(A,$,b){return B.u(A)?this[$]:this.set(b,A)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(A,$){var b=this,x=!!B.u($)||$,V=B.p(A),L=function(F,Q){var j=B.w(b.$u?Date.UTC(b.$y,Q,F):new Date(b.$y,Q,F),b);return x?j:j.endOf(d)},W=function(F,Q){return B.w(b.toDate()[F].apply(b.toDate("s"),(x?[0,0,0,0]:[23,59,59,999]).slice(Q)),b)},H=this.$W,X=this.$M,te=this.$D,ue="set"+(this.$u?"UTC":"");switch(V){case _:return x?L(1,0):L(31,11);case f:return x?L(1,X):L(0,X+1);case u:var oe=this.$locale().weekStart||0,G=(H<oe?H+7:H)-oe;return L(x?te-G:te+(6-G),X);case d:case m:return W(ue+"Hours",0);case c:return W(ue+"Minutes",1);case l:return W(ue+"Seconds",2);case i:return W(ue+"Milliseconds",3);default:return this.clone()}},C.endOf=function(A){return this.startOf(A,!1)},C.$set=function(A,$){var b,x=B.p(A),V="set"+(this.$u?"UTC":""),L=(b={},b[d]=V+"Date",b[m]=V+"Date",b[f]=V+"Month",b[_]=V+"FullYear",b[c]=V+"Hours",b[l]=V+"Minutes",b[i]=V+"Seconds",b[s]=V+"Milliseconds",b)[x],W=x===d?this.$D+($-this.$W):$;if(x===f||x===_){var H=this.clone().set(m,1);H.$d[L](W),H.init(),this.$d=H.set(m,Math.min(this.$D,H.daysInMonth())).$d}else L&&this.$d[L](W);return this.init(),this},C.set=function(A,$){return this.clone().$set(A,$)},C.get=function(A){return this[B.p(A)]()},C.add=function(A,$){var b,x=this;A=Number(A);var V=B.p($),L=function(X){var te=N(x);return B.w(te.date(te.date()+Math.round(X*A)),x)};if(V===f)return this.set(f,this.$M+A);if(V===_)return this.set(_,this.$y+A);if(V===d)return L(1);if(V===u)return L(7);var W=(b={},b[l]=r,b[c]=a,b[i]=o,b)[V]||1,H=this.$d.getTime()+A*W;return B.w(H,this)},C.subtract=function(A,$){return this.add(-1*A,$)},C.format=function(A){var $=this,b=this.$locale();if(!this.isValid())return b.invalidDate||y;var x=A||"YYYY-MM-DDTHH:mm:ssZ",V=B.z(this),L=this.$H,W=this.$m,H=this.$M,X=b.weekdays,te=b.months,ue=b.meridiem,oe=function(Q,j,Y,re){return Q&&(Q[j]||Q($,x))||Y[j].slice(0,re)},G=function(Q){return B.s(L%12||12,Q,"0")},F=ue||function(Q,j,Y){var re=Q<12?"AM":"PM";return Y?re.toLowerCase():re};return x.replace(w,function(Q,j){return j||function(Y){switch(Y){case"YY":return String($.$y).slice(-2);case"YYYY":return B.s($.$y,4,"0");case"M":return H+1;case"MM":return B.s(H+1,2,"0");case"MMM":return oe(b.monthsShort,H,te,3);case"MMMM":return oe(te,H);case"D":return $.$D;case"DD":return B.s($.$D,2,"0");case"d":return String($.$W);case"dd":return oe(b.weekdaysMin,$.$W,X,2);case"ddd":return oe(b.weekdaysShort,$.$W,X,3);case"dddd":return X[$.$W];case"H":return String(L);case"HH":return B.s(L,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return F(L,W,!0);case"A":return F(L,W,!1);case"m":return String(W);case"mm":return B.s(W,2,"0");case"s":return String($.$s);case"ss":return B.s($.$s,2,"0");case"SSS":return B.s($.$ms,3,"0");case"Z":return V}return null}(Q)||V.replace(":","")})},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(A,$,b){var x,V=this,L=B.p($),W=N(A),H=(W.utcOffset()-this.utcOffset())*r,X=this-W,te=function(){return B.m(V,W)};switch(L){case _:x=te()/12;break;case f:x=te();break;case g:x=te()/3;break;case u:x=(X-H)/6048e5;break;case d:x=(X-H)/864e5;break;case c:x=X/a;break;case l:x=X/r;break;case i:x=X/o;break;default:x=X}return b?x:B.a(x)},C.daysInMonth=function(){return this.endOf(f).$D},C.$locale=function(){return O[this.$L]},C.locale=function(A,$){if(!A)return this.$L;var b=this.clone(),x=k(A,$,!0);return x&&(b.$L=x),b},C.clone=function(){return B.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},T}(),P=I.prototype;return N.prototype=P,[["$ms",s],["$s",i],["$m",l],["$H",c],["$W",d],["$M",f],["$y",_],["$D",m]].forEach(function(T){P[T[1]]=function(C){return this.$g(C,T[0],T[1])}}),N.extend=function(T,C){return T.$i||(T(C,I,N),T.$i=!0),N},N.locale=k,N.isDayjs=M,N.unix=function(T){return N(1e3*T)},N.en=O[D],N.Ls=O,N.p={},N})})(ho);var is=ho.exports;const _o=ss(is),ls=t=>{const n=K.useRouter(),o=K.useRoute(),r=`${t.domain}/api/`,a=ae.create({baseURL:r}),s=ae.create({baseURL:r}),i=ae.create({baseURL:r}),l=ae.create({baseURL:r}),c=ae.create({baseURL:r}),d=ae.create({baseURL:r}),u=ae.create({baseURL:r}),f=p=>{try{const v=JSON.parse(localStorage.getItem("authTokensAccess")||"");v.length>0&&(p.headers.Authorization=`Bearer ${v}`)}catch{console.warn("accessToken is undefined [useAxios]")}return p},g=p=>{const v=localStorage.getItem("apiKey"),D=(v==null?void 0:v.replace(/^.(.*).$/,"$1"))||"";return p.headers={"Content-Type":"application/json","x-api-key":D},p},_=async p=>{if(!t.user)return p;const v=t.user.exp??0;if(!(_o.unix(v).diff(_o())<3e3))return p;const O=An("authTokensRefresh",null,"string");try{const R=await ae.post(`${r}user/token/refresh/`,{refresh:O.value});if(!R.data.access)return h(),p;localStorage.setItem("authTokensAccess",JSON.stringify(R.data.access)),S(R.data),w(Bn(R.data.access)),p.headers={...p.headers,Authorization:`Bearer ${R.data.access}`}}catch(R){console.error("Failed to refresh token:",R),h()}return p},m=p=>{p.interceptors.request.use(v=>_(f(v)),v=>Promise.reject(v))};m(i),m(c),m(u);const y=p=>{p.interceptors.request.use(v=>g(v))};y(d),y(s),y(u);const S=(p,v=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(p.access)),v&&localStorage.setItem("authTokensRefresh",JSON.stringify(p.refresh))},w=p=>{t.user=p,localStorage.setItem("user",JSON.stringify(p))},h=()=>{t.user=null,Ke(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),n.push(`/${o.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:i,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:u,axiosInstancePost:l,axiosInstanceGet:a,axiosInstanceGetApiKey:s,axiosInstancePostApiKey:d}},Z=class Z{constructor(){ee(this,"axiosInstanceGet");ee(this,"axiosInstancePost");ee(this,"axiosInstanceAuthenticationGet");ee(this,"axiosInstanceAuthenticationPost");ee(this,"axiosInstanceGetApiKey");ee(this,"axiosInstancePostApiKey");ee(this,"axiosInstanceAuthenticationPostApiKey");ee(this,"currentUpsaleController",null);ee(this,"controller",new AbortController);this.axiosInstanceGet=Z._axiosGet,this.axiosInstancePost=Z._axiosPost,this.axiosInstanceGetApiKey=Z._axiosPostApiKey,this.axiosInstancePostApiKey=Z._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=Z._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=Z._axiosAuthGet,this.axiosInstanceAuthenticationPost=Z._axiosAuthPost}static create(n){return n&&!Z._config&&Z._initialize(n),Z._config||console.warn("InitConnection не инициализирован"),new Z}static _initialize(n,o=null){const r=ce(),a=me(),{config_lib:s}=U.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l}=U.storeToRefs(a);Z._config=n,Z._cardStore=a,Z._stateCard=i,Z._recountGroupTotalAmount=l,s.value=n;const c=ls(n);Z._axiosPostApiKey=c.axiosInstanceGetApiKey,Z._axiosPostApiKey=c.axiosInstancePostApiKey,Z._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,Z._axiosGet=c.axiosInstanceGet,Z._axiosPost=c.axiosInstancePost,Z._axiosAuthGet=c.axiosInstanceAuthenticationGet,Z._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return Z._config}get cardStore(){return Z._cardStore}get stateCard(){return Z._stateCard}get recountGroupTotalAmount(){return Z._recountGroupTotalAmount}async updateTheme(){var s,i;const n=JSON.parse(localStorage.getItem("themeConfig"))??null,o=_e();if(n!==null){o.updateColor(n);return}const r=ce(),a=await((i=this.axiosInstanceGet)==null?void 0:i.get(`org/organizations/${(s=this.config)==null?void 0:s.orgId}/design/`));r.setStateDrum(a==null?void 0:a.data.hide_barban),r.setKioskTimeout(a==null?void 0:a.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(a.data)),o.updateColor(a.data)}async getGroupByID(n){var o,r;try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/group/${n}`));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка в request.ts[getGroupByID]",a),a}}async loadGroupProducts(n){var o,r;try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/products/?group=${n}`)),s=(a==null?void 0:a.data)||[];for(const i of s)i&&await ar(i);return await this.cacheImagesInBackground(s),s}catch(a){return console.error("Ошибка загрузки группы:",a),[]}}async getGroup(){var n,o;try{const r=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(n=this.config)==null?void 0:n.pointId}/groups/`));return r==null?void 0:r.data}catch(r){return console.error("Error fetching products:",r),[]}}async fetchAndCacheAllPages(){var n,o;try{const r=((n=this.config)==null?void 0:n.pointId)||"",a=await Ot(r);if(a)return a.data;const s=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${r}/group/`)),i=(s==null?void 0:s.data)||[],l=[];for(const c of i){c.products=c.products||[],await Qe(c.id,c),l.push(c);const d=await this.loadGroupProducts(c.id);c.products=d}return await this.cacheImagesInBackground(i),await Qe(r,i),l}catch(r){return console.error("fetchAndCacheAllPages error:",r),[]}}cacheImagesInBackground(n){n.forEach(o=>{var r;o.video_link&&this.loadAndCacheMedia(o.video_link,o.id+"_video"),o.image_link&&this.loadAndCacheMedia(o.image_link,o.id+"_image"),(r=o.products)==null||r.forEach(a=>{a.video_link&&this.loadAndCacheMedia(a.video_link,a.id+"_video"),a.image_link&&this.loadAndCacheMedia(a.image_link,a.id+"_image")})})}async loadAndCacheMedia(n,o){const r=await Ge(o);if(r){this.dispatchImageCachedEvent(o,r);return}try{const a=await fetch(n);if(!a.ok)throw new Error("Network error");const s=await a.blob();if(s.size===0)throw new Error("Empty blob");await Ft(o,s),this.dispatchImageCachedEvent(o,s)}catch(a){console.warn(`[ImageCache] Failed for ${o}:`,a)}}dispatchImageCachedEvent(n,o){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:o}}))}async getProduct(n=null){var o,r;if(!n)return[];try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/products/${n}`));return a==null?void 0:a.data}catch(a){return console.error("Error fetching cardProducts:",a),[]}}async getSingleProduct(n){var a;const o=ce(),{config_lib:r}=U.storeToRefs(o);try{let s=await yn(n);if(s)this._fullCardProduct(s);else{const i=await((a=this.axiosInstanceGet)==null?void 0:a.get(`${r.value.pointId}/products/${n}`));(i==null?void 0:i.status)===200&&this._fullCardProduct(i.data)}}catch(s){throw console.log("store card[getFetchProducts]:",s),s}}_fullCardProduct(n){const o=me();o.stateCard.openCard={...n,amount:1},o.stateCard.groupModifiers=n.group_modifiers,n.modifiers.length>0&&o.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:n.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:n.modifiers.reduce((r,a)=>r+=a.min_amount,0),name:"Добавки",required:!1}),o.stateCard.groupModifiersSelected=new Array(o.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),o.stateCard.productSizes=n.sizes,o.defaultAmountModifiers(),n.show_recommendations&&this.productUpsale(n.id)}async getTheme(){try{this.updateTheme()}catch(n){return console.error("Error fetching products:",n),[]}}async authorizeByCard(n){var o,r;try{const a=await((r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.domain}/api/user/validate-card/`,{card_number:n}));return localStorage.setItem("authTokensAccess",JSON.stringify(a==null?void 0:a.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(a==null?void 0:a.data.refresh)),a==null?void 0:a.data}catch(a){throw console.error("Ошибка авторизации:",a),a}}async getLoyalSmsCode(n){var o,r;try{const a=await((r=this.axiosInstancePostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.domain}/api/device/auth/request-otp/`,{phone:n}));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка получения sms-code:",a),a}}async sendSmsCodeForAuth(n,o){var r,a;try{const s=await((a=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:a.post(`${(r=this.config)==null?void 0:r.domain}/api/device/auth/`,{code:n,phone:o}));return s==null?void 0:s.data}catch(s){throw console.error("Ошибка отправки sms-code:",s),s}}async callStaff(n,o){var r,a,s,i;try{const l=await((s=this.axiosInstancePost)==null?void 0:s.post(`${(r=this.config)==null?void 0:r.domain}/api/org_unit/${(a=this.config)==null?void 0:a.pointId}/table/${n}/call-staff/`,{reason:o}));return(i=l==null?void 0:l.data)==null?void 0:i.response_text}catch(l){throw console.error("Ошибка[callWaiter]",l),l}}async createOrder(n,o,r=!0,a,s=!1,i=!1){var _,m,y;const l=Fe(),c=s?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,d=r?c:this.axiosInstanceAuthenticationPost,u=r?"/device/order/create":"/order/create",f=r?(_=this.config)==null?void 0:_.pointId:(m=this.config)==null?void 0:m.pointId,g=await(d==null?void 0:d.post(`${(y=this.config)==null?void 0:y.domain}/api/org_unit/${f}${u}`,{items:n,table:o||null,comment:a}));return(g==null?void 0:g.status)===201&&l.orderSocket(g==null?void 0:g.data.id,r,i),g}async initPaymentLink(n,o=!0){const r=o?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,a=ce(),s=o?"TERMINAL":"YOOKASSA",i=await(r==null?void 0:r.post("payment/init",{by_bonuses:a.countBonus,order:n,provider_type:s}));return i==null?void 0:i.data}async orderPay(n){var o;return(o=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:o.post(`order/${n}/pay/`,{order_id:n})}async getProfile(){var o,r;const n=await((r=this.axiosInstanceAuthenticationGet)==null?void 0:r.get(`user/current?organization=${(o=this.config)==null?void 0:o.orgId}`));if((n==null?void 0:n.status)===200){const a=ce();return a.profile=n.data,a.is18Allowed=sessionStorage.getItem("is_adult")==="true",n.data}else return n}async calculateDiscount(n,o=!0,r=!1){var c,d;const a=r?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,s=o?a:this.axiosInstanceAuthenticationPost,i=o?(c=this.config)==null?void 0:c.pointId:(d=this.config)==null?void 0:d.pointId,l=await(s==null?void 0:s.post(`/org_unit/${i}/cart/calculate-discount/`,n));return(l==null?void 0:l.status)===200?l.data:l}async getDeviceInfo(){var o;const n=await((o=this.axiosInstanceGetApiKey)==null?void 0:o.get("/device/current/"));return(n==null?void 0:n.status)===200?n.data:n}async productUpsale(n){var s,i,l;const o=me(),{dataUpSale:r}=U.storeToRefs(o);(s=this.currentUpsaleController)==null||s.abort();const a=new AbortController;this.currentUpsaleController=a;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(i=this.config)==null?void 0:i.pointId}/products/${n}/recommendation/`,{signal:a.signal}));a.signal.aborted||(r.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.log("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===a&&(this.currentUpsaleController=null)}}};ee(Z,"_config",null),ee(Z,"_axiosGet"),ee(Z,"_axiosGetApiKey"),ee(Z,"_axiosPostApiKey"),ee(Z,"_axiosAuthPostApiKey"),ee(Z,"_axiosPost"),ee(Z,"_axiosAuthGet"),ee(Z,"_axiosAuthPost"),ee(Z,"_cardStore",null),ee(Z,"_stateCard",null),ee(Z,"_recountGroupTotalAmount",null);let Ve=Z;const cs=e.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(t,{expose:n}){const o=t,r=ce(),a=e.ref(null),s=async l=>{if(!a.value||!l)return;let c=window;o.container&&(c=typeof o.container=="string"?document.querySelector(o.container)||window:o.container);const d={behavior:o.behavior};if(o.axis==="x"){const u=c===window?window.innerWidth:c.clientWidth,f=l.offsetWidth;let g=l.offsetLeft;if(c!==window){const _=c.getBoundingClientRect();g=l.getBoundingClientRect().left-_.left+c.scrollLeft}g-=(u-f)/2,d.left=Math.max(0,g)}else{const u=c===window?window.innerHeight:c.clientHeight,f=l.offsetHeight;let g=l.offsetTop;if(c!==window){const _=c.getBoundingClientRect();g=l.getBoundingClientRect().top-_.top+c.scrollTop}g-=(u-f)/2,d.top=Math.max(0,g)}try{c===window?window.scrollTo(d):c.scrollTo(d)}catch(u){console.error("Scroll error:",u)}};e.onMounted(async()=>{if(o.autoScroll){let l=null;if(await e.nextTick(),r.activeScrolling_lib){const c=r.activeScrolling_lib.findIndex(d=>d.id===o.idActive);o.idActive?(l=document.getElementById(`scrolling${o.idActive}`),l&&c!==-1&&(r.activeScrolling_lib[c]=l)):r.activeScrolling_lib[c]&&(l=r.activeScrolling_lib[c]),s(l)}}});const i=async l=>{o.clearContainer&&(r.activeScrolling_lib=[]);const c=l.currentTarget;await e.nextTick(),r.activeScrolling_lib.includes(c)||r.activeScrolling_lib.push(c),s(c)};return n({scrollToElement:s}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:a,class:"scroll-to-wrapper"},[e.renderSlot(l.$slots,"default",{handleTargetClick:i},void 0,!0)],512))}}),ne=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Yt=ne(cs,[["__scopeId","data-v-b510c3f1"]]),ds={},us={id:"custom_svg_lib",width:"26.000000",height:"26.000000",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function fs(t,n){return e.openBlock(),e.createElementBlock("svg",us,[...n[0]||(n[0]=[e.createElementVNode("defs",null,null,-1),e.createElementVNode("path",{id:"custom_svg_color",d:"M11.83 26L11.83 14.15L0 14.15L0 11.84L11.83 11.84L11.83 0L14.15 0L14.15 11.84L26 11.84L26 14.15L14.15 14.15L14.15 26L11.83 26Z",fill:"#FF6D2E","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const Qt=ne(ds,[["render",fs]]),ms=["id","onClick"],ps={class:"modified_plus_btn"},hs=["src"],_s={key:2,class:"wrapper_modifier_item"},gs={key:0,class:"modifier_item_n_wrapper"},ys=["src"],bs={key:1,class:"modifier_plus_item"},ws=["src"],ks=["src"],go=ne(e.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(t){const n=me(),o=_e(),{stateCard:r}=U.storeToRefs(n),{itemThemes:a}=U.storeToRefs(o),s=e.ref([]),i=e.ref([]),l=e.ref(null),c=e.ref(null),d=f=>{f instanceof HTMLElement&&!s.value.includes(f)&&s.value.push(f)},u=f=>{c.value=f};return e.onMounted(async()=>{await e.nextTick(),r.value.plusButtonsRefs=s.value}),e.watchEffect(()=>{i.value=r.value.groupModifiersSelected,document.body.style.overflow=""}),e.onBeforeUnmount(()=>{s.value=[],r.value.plusButtonsRefs=[]}),(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({card_modified_wrapper_many:e.unref(r).groupModifiers.length>=5})},[e.unref(r).groupModifiersSelected?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["card_modified_wrapper",[e.unref(r).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l},[e.createVNode(Yt,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:e.withCtx(({handleTargetClick:_})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).groupModifiers,(m,y)=>{var S,w;return e.openBlock(),e.createElementBlock("div",{class:"button_modified",key:m.id,ref_for:!0,ref:d,id:"scrolling"+m.id,"data-clickable":"true",onClick:h=>{t.toggleNotRequire&&t.toggleNotRequire(m,y),u(m.id),_(h)}},[e.createElementVNode("div",ps,[i.value[y].modifiers.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{modified_plus_btn_active:m.id===((S=e.unref(r).groupCurrentOpen)==null?void 0:S.id)&&t.isSectionModifier},"modified_plus_active"])},[e.createVNode(Qt,{"aria-label":`Открыть группу модификаторов ${m.name}`},null,8,["aria-label"])],2)):i.value[y].modifiers.length===1?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:m.id===((w=e.unref(r).groupCurrentOpen)==null?void 0:w.id)&&t.isSectionModifier}])},[e.createElementVNode("img",{src:i.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",alt:"Модификатор"},null,8,hs)],2)):(e.openBlock(),e.createElementBlock("div",_s,[i.value[y].modifiers.length>2?(e.openBlock(),e.createElementBlock("div",gs,[i.value[y].modifiers.length===3?(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:i.value[y].modifiers[2].image_link||e.unref(a).fallback_image||""},null,8,ys)):(e.openBlock(),e.createElementBlock("p",bs," + "+e.toDisplayString(i.value[y].modifiers.length-2),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[i.value[y].modifiers.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,ws)):e.createCommentVNode("",!0),i.value[y].modifiers.length>1?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.value[y].modifiers[1].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,ks)):e.createCommentVNode("",!0)])]))]),e.createElementVNode("p",null,e.toDisplayString(m.name),1)],8,ms)}),128))]),_:1},8,["container","idActive"])],2)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-589e71ca"]]),Cs={},Ss={id:"custom_svg_lib",width:"21.847656",height:"21.846924",viewBox:"0 0 21.8477 21.8469",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Es(t,n){return e.openBlock(),e.createElementBlock("svg",Ss,[...n[0]||(n[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),e.createElementVNode("path",{id:"Vector",d:"M12.38 15.9L12.89 15.39C12.96 15.33 13 15.25 13 15.16C13 15.08 12.96 15 12.89 14.93L8.84 11L12.89 7.06C12.96 6.99 13 6.91 13 6.83C13 6.74 12.96 6.66 12.89 6.6L12.38 6.1C12.31 6.03 12.23 6 12.14 6C12.05 6 11.97 6.03 11.9 6.1L7.1 10.76C7.03 10.83 7 10.91 7 11C7 11.08 7.03 11.16 7.1 11.23L11.9 15.9C11.97 15.96 12.05 16 12.14 16C12.23 16 12.31 15.96 12.38 15.9Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const en=ne(Cs,[["render",Es]]),Ns={class:"wrapper_modifiers"},xs={class:"wrapper_nutritional_value"},Bs={class:"nutritional_scheme"},As={key:0,class:"nutritional_parameters"},vs={key:1,class:"nutritional_parameters"},$s={key:2,class:"nutritional_parameters"},Ts={key:3,class:"nutritional_parameters"},Ms={ref:"modifierBody",class:"modifier_shadow"},Ps={class:"wrapper_modifiers_title"},Vs={class:"wrapper_text_count_modifiers"},Is=["id","aria-label","onClick","onKeydown"],Rs={key:0,class:"counter_modifier"},Ds={class:"hide_image_corners"},Os=["src","alt"],Fs={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},Ls=["src"],zs={class:"modifier_title"},Us=ne(e.defineComponent({__name:"SectionModifiers",emits:["close"],setup(t,{emit:n}){const o=n,r=_e(),a=me(),{itemThemes:s}=U.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l,groupTotalAmount:c}=U.storeToRefs(a),d=e.ref(null),u=Ee.useTemplateRefsList(),f=g=>{if(!g)return;const _=i.value.groupModifiers.findIndex(h=>h.id===i.value.groupCurrentOpen.id),m=i.value.plusButtonsRefs[_]||i.value.plusButtonsRefs[0];if(!m)return;const y=g.getBoundingClientRect(),S=m.getBoundingClientRect(),w=g.cloneNode(!0);w.classList.add("flyer"),Object.assign(w.style,{width:`${y.width}px`,height:`${y.height}px`,left:`${y.left}px`,top:`${y.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(w),d.value=w,requestAnimationFrame(()=>{const h=S.left+S.width/3-(y.left+y.width/2),p=S.top+S.height/4-(y.top+y.height/2),v=S.width/y.width*.2;w.style.transform=`translate(${h}px, ${p}px) scale(${v})`,w.style.opacity="0.4",w.style.transition="transform 0.5s ease, opacity 0.5s ease"}),w.addEventListener("transitionend",()=>{w.remove(),d.value=null,m.classList.add("bump"),setTimeout(()=>m.classList.remove("bump"),300)},{once:!0})};return e.watch(()=>i.value.isAnimationFly,g=>{g===!0&&i.value.currentModifier&&(f(u.value.find(_=>_.id===i.value.currentModifier.id)),i.value.isAnimationFly=!1)}),(g,_)=>{var m,y,S,w,h,p,v,D,O,R,M,k;return e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",xs,[e.createElementVNode("div",{class:e.normalizeClass(["card_header_inner_back",[(m=e.unref(i).openCard)!=null&&m.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:_[0]||(_[0]=N=>o("close"))},[e.createVNode(en,{class:"arrow_bottom"})],2),e.createElementVNode("div",Bs,[(y=e.unref(i).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(i).openCard)==null?void 0:S.energy_amount),1),_[1]||(_[1]=e.createElementVNode("p",null,"Килокалории",-1))])):e.createCommentVNode("",!0),(w=e.unref(i).openCard)!=null&&w.proteins_amount?(e.openBlock(),e.createElementBlock("div",vs,[e.createElementVNode("b",null,e.toDisplayString((h=e.unref(i).openCard)==null?void 0:h.proteins_amount),1),_[2]||(_[2]=e.createElementVNode("p",null,"Белки",-1))])):e.createCommentVNode("",!0),(p=e.unref(i).openCard)!=null&&p.fat_amount?(e.openBlock(),e.createElementBlock("div",$s,[e.createElementVNode("b",null,e.toDisplayString((v=e.unref(i).openCard)==null?void 0:v.fat_amount),1),_[3]||(_[3]=e.createElementVNode("p",null,"Жиры",-1))])):e.createCommentVNode("",!0),(D=e.unref(i).openCard)!=null&&D.carbohydrates_amount?(e.openBlock(),e.createElementBlock("div",Ts,[e.createElementVNode("b",null,e.toDisplayString((O=e.unref(i).openCard)==null?void 0:O.carbohydrates_amount),1),_[4]||(_[4]=e.createElementVNode("p",null,"Углеводы",-1))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ms,[e.createElementVNode("p",Ps,e.toDisplayString((R=e.unref(i).groupCurrentOpen)==null?void 0:R.name),1),e.createElementVNode("p",Vs,"Выбрано "+e.toDisplayString(e.unref(l))+" из "+e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",{class:e.normalizeClass((M=e.unref(i).groupModifiers.find(N=>{var B;return N.id===((B=e.unref(i).groupCurrentOpen)==null?void 0:B.id)}))!=null&&M.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((k=e.unref(i).groupCurrentOpen)==null?void 0:k.group_modifiers)||[],N=>{var B,I,P;return e.openBlock(),e.createElementBlock("div",{key:N.id,ref_for:!0,ref:e.unref(u).set,id:N.id,class:e.normalizeClass(["modifier_card",{hidden_modifier_card:N.default_amount===0&&((B=e.unref(i).groupCurrentOpen)==null?void 0:B.id)==="Добавки2000"&&N.min_amount===0&&N.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${N.name}`,onClick:T=>e.unref(a).modifierSelect(N),onKeydown:e.withKeys(T=>e.unref(a).modifierSelect(N),["enter"])},[e.createElementVNode("div",{class:e.normalizeClass([{modifier_card_active:e.unref(i).groupModifiersSelected.some(T=>{var C;return T.group===((C=e.unref(i).groupCurrentOpen)==null?void 0:C.id)&&T.modifiers.some(A=>A.id===N.id)})},"wrapper_image_corners"])},[N.amount>1?(e.openBlock(),e.createElementBlock("div",Rs,e.toDisplayString(N.amount),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[N.video_link?(e.openBlock(),e.createElementBlock("video",Fs,[e.createElementVNode("source",{src:N.video_link||"",type:"video/webm"},null,8,Ls)])):(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_image",src:N.image_link||e.unref(s).fallback_image||"",alt:N.name},null,8,Os)),e.createElementVNode("div",{class:e.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:N.min_amount>0||N.required}])},[e.createElementVNode("h3",zs,e.toDisplayString(N.name),1),e.createElementVNode("p",null,"+"+e.toDisplayString(((P=(I=N.sizes)==null?void 0:I.find(T=>T.id===e.unref(i).selectedSize.id))==null?void 0:P.price)||N.price||0)+"₽",1)],2)])],2)],42,Is)}),128))],2)],512)])}}}),[["__scopeId","data-v-22d945f1"]]),js={key:0,class:"card_size_place"},Hs=["onClick","onKeydown","aria-label"],qs={key:1,class:"card_size static"},Ws=["onClick","onKeydown","aria-label"],tn=3,Gs=ne(e.defineComponent({__name:"SizeModifier",setup(t){const n=me(),{stateCard:o}=U.storeToRefs(n),r=e.ref(null),a=e.ref(50),s=e.ref(),i=e.ref(0),l=e.ref(0),c=e.ref(null),d=e.computed(()=>{var p;if(o.value.productSizes.length<=3)return o.value.productSizes[s.value.index]||o.value.productSizes[0];const w=i.value+1,h=((p=f.value[w])==null?void 0:p.originalIndex)??1;return o.value.productSizes[h]}),u=()=>{c.value&&o.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/tn)},f=e.computed(()=>{if(o.value.productSizes.length<=3)return o.value.productSizes;const w=o.value.productSizes;return[...w.map((h,p)=>({...h,originalIndex:p})),...w.map((h,p)=>({...h,originalIndex:p})),...w.map((h,p)=>({...h,originalIndex:p}))]}),g=(w,h)=>{if(s.value={id:w.id,title:w.name,index:h,is_default:w.is_default},w.price!==null&&o.value.openCard&&(o.value.openCard={...o.value.openCard,price:w.price}),o.value.selectedSize=w,o.value.productSizes.length>3){u();const p=i.value+1;h<p?_():h>p&&m()}else{const p=o.value.productSizes.length,v=(h+.5)*(100/p);a.value=v}},_=()=>{var w;if(!(o.value.productSizes.length<=3)){if(i.value--,i.value<o.value.productSizes.length-tn+1){i.value+=o.value.productSizes.length;const h=(w=c.value)==null?void 0:w.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}y()}},m=()=>{var w;if(!(o.value.productSizes.length<=3)){if(i.value++,i.value>=o.value.productSizes.length*2){i.value-=o.value.productSizes.length;const h=(w=c.value)==null?void 0:w.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}y()}},y=()=>{var v;if(o.value.productSizes.length<=3)return;const w=i.value+1,h=((v=f.value[w])==null?void 0:v.originalIndex)??0,p=o.value.productSizes[h];s.value={id:p.id,title:p.name,index:h,is_default:p.is_default}};e.watch(()=>[o.value.productSizes,c.value],([w=[],h])=>{if(Array.isArray(w)&&w.length>0&&h!==null){let p=w.findIndex(v=>v.is_default===!0);w.length<3&&r.value&&parseInt(r.value.style.minWidth)<767&&(r.value.style.width="100px"),p>-1?(i.value=p,g(w[p],p),l.value=120/tn):w.length===2||w.length===1?(g(w[0],0),a.value=(0+.5)*(100/2)):(g(w[1],1),a.value=(1+.5)*(100/3))}}),e.watch(()=>{var w;return[(w=o.value.selectedSize)==null?void 0:w.id,o.value.groupModifiersSelected]},([w,h])=>{if(!w||!Array.isArray(h))return;const p=h.map(v=>({...v,modifiers:v.modifiers.map(D=>{if(!D.sizes||D.sizes.length===0)return D;const O=D.sizes.find(R=>R.id===w);return O?{...D,size:O,price:O.price??D.price}:D})}));JSON.stringify(p)!==JSON.stringify(o.value.groupModifiersSelected)&&(o.value.groupModifiersSelected=p)},{deep:!0});const S={mounted:u};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",u)}),(w,h)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:r},[e.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[e.unref(o).productSizes.length>1&&s.value?(e.openBlock(),e.createElementBlock("div",js,[e.unref(o).productSizes.length>3?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"card_size",style:e.normalizeStyle({transform:`translateX(-${i.value*l.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(p,v)=>(e.openBlock(),e.createElementBlock("li",{key:`${p.id}-${v}`,onClick:D=>g(p,v),onKeydown:e.withKeys(D=>g(p,v),["enter"]),class:e.normalizeClass({active:s.value.id===p.id&&s.value.index===p.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${p.name}`},e.toDisplayString(p.alt_name?p.alt_name:p.name),43,Hs))),128))],4)):(e.openBlock(),e.createElementBlock("ul",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).productSizes,(p,v)=>(e.openBlock(),e.createElementBlock("li",{key:`${p.id}-${v}`,onClick:D=>g(p,v),onKeydown:e.withKeys(D=>g(p,v),["enter"]),class:e.normalizeClass({active:s.value.id===p.id&&s.value.index===v}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${p.name}`},e.toDisplayString(p.alt_name?p.alt_name:p.name),43,Ws))),128))])),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:2,class:"size_active",style:e.normalizeStyle(e.unref(o).productSizes.length<=3?{left:`${a.value}%`}:{})},[e.createElementVNode("p",null,e.toDisplayString(d.value.alt_name?d.value.alt_name:d.value.name),1)],4)),[[S]]):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],512)),[[e.vShow,e.unref(o).productSizes.length>1&&s.value]])}}),[["__scopeId","data-v-bc00f0e8"]]),Ks="data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.3063%2019.7525C8.12104%2019.7525%208.78152%2019.1097%208.78152%2018.3167C8.78152%2017.5236%208.12104%2016.8808%207.3063%2016.8808C6.49156%2016.8808%205.83108%2017.5236%205.83108%2018.3167C5.83108%2019.1097%206.49156%2019.7525%207.3063%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M7.3063%2019.2525C7.83733%2019.2525%208.26782%2018.8335%208.26782%2018.3167C8.26782%2017.7998%207.83733%2017.3808%207.3063%2017.3808C6.77526%2017.3808%206.34478%2017.7998%206.34478%2018.3167C6.34478%2018.8335%206.77526%2019.2525%207.3063%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M14.4716%2019.7525C15.2864%2019.7525%2015.9469%2019.1097%2015.9469%2018.3167C15.9469%2017.5236%2015.2864%2016.8808%2014.4716%2016.8808C13.6569%2016.8808%2012.9964%2017.5236%2012.9964%2018.3167C12.9964%2019.1097%2013.6569%2019.7525%2014.4716%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M14.4716%2019.2525C15.0027%2019.2525%2015.4332%2018.8335%2015.4332%2018.3167C15.4332%2017.7998%2015.0027%2017.3808%2014.4716%2017.3808C13.9406%2017.3808%2013.5101%2017.7998%2013.5101%2018.3167C13.5101%2018.8335%2013.9406%2019.2525%2014.4716%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M0.770536%203.75L4.56158%206.21L6.66771%2015.23H15.1025L17.2086%208.26'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.19507%2011.95H12.2669H15.945'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.1908%200.830648V7.34648L8.26615%204.49981C8.03242%204.27231%207.64886%204.27231%207.41513%204.49981C7.35957%204.55378%207.3155%204.61788%207.28542%204.68845C7.25535%204.75902%207.23987%204.83467%207.23987%204.91106C7.23987%204.98746%207.25535%205.06311%207.28542%205.13368C7.3155%205.20425%207.35957%205.26835%207.41513%205.32231L11.3646%209.16648C11.5983%209.39398%2011.9759%209.39398%2012.2096%209.16648L16.159%205.32231C16.2145%205.26831%2016.2585%205.20419%2016.2885%205.13363C16.3186%205.06307%2016.334%204.98744%2016.334%204.91106C16.334%204.83469%2016.3186%204.75906%2016.2885%204.6885C16.2585%204.61794%2016.2145%204.55382%2016.159%204.49981C16.1035%204.44581%2016.0377%204.40297%2015.9652%204.37374C15.8927%204.34451%2015.815%204.32947%2015.7365%204.32947C15.658%204.32947%2015.5803%204.34451%2015.5078%204.37374C15.4353%204.40297%2015.3695%204.44581%2015.314%204.49981L12.3894%207.34648V0.830648C12.3894%200.509814%2012.1197%200.247314%2011.7901%200.247314C11.4604%200.247314%2011.1908%200.509814%2011.1908%200.830648Z'%20fill='%23F2F7FF'/%3e%3c/svg%3e",Js={class:"counter_container"},Xs={class:"card_size_place_wrapper",ref:"sliderWrapper"},Zs={class:"cart_amount_counter"},Ys={class:"button_circle_number"},Qs=ne(e.defineComponent({__name:"NumberModifier",setup(t){const n=me(),{stateCard:o}=U.storeToRefs(n),r=()=>{var s,i;(s=o.value.openCard)!=null&&s.amount&&((i=o.value.openCard)==null?void 0:i.amount)>1&&(o.value.openCard.amount-=1)},a=()=>{var s;(s=o.value.openCard)!=null&&s.amount&&(o.value.openCard.amount+=1)};return(s,i)=>{var l,c;return e.openBlock(),e.createElementBlock("div",Js,[e.createElementVNode("div",Xs,[e.createElementVNode("div",Zs,[e.createElementVNode("p",{class:e.normalizeClass(["cart_circle_minus",[((l=e.unref(o).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:e.withModifiers(r,["stop","prevent"])},[...i[0]||(i[0]=[e.createElementVNode("span",null,null,-1)])],2),e.createElementVNode("p",Ys,e.toDisplayString((c=e.unref(o).openCard)==null?void 0:c.amount),1),e.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:e.withModifiers(a,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-c3d45434"]]);function yo(t,n=800){const o=e.ref(t),r=e.ref(t);let a=null,s=null,i=t;const l=c=>{s||(s=c);const d=c-s,u=Math.min(d/n,1),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;o.value=Math.round(i+(r.value-i)*f),u<1?a=requestAnimationFrame(l):(o.value=r.value,a=null)};return e.watch(r,()=>{a&&cancelAnimationFrame(a),i=o.value,s=null,a=requestAnimationFrame(l)},{immediate:!0}),e.onUnmounted(()=>{a&&cancelAnimationFrame(a)}),{displayNumber:o,targetNumber:r,update:c=>{r.value=c}}}const ve=e.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(t){const n=t,{displayNumber:o,update:r}=yo(n.price||0,n.duration||800);return e.watchEffect(()=>{r(n.price)}),(a,s)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(e.unref(o).toFixed(t.fixedFloat)),1))}}),ei=["disabled","id"],Re=e.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(t){const n=t,o=()=>{n.onClick()};return(r,a)=>(e.openBlock(),e.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:t.disabled,onClick:o,id:t.disabled?"buttonDefaultDisabled":""},e.toDisplayString(t.textButtonDefault),9,ei))}}),ti={class:"notification_info"},ni={key:0,class:"notification_18plus"},oi={class:"notification_18plus_image"},ri=["src"],ai={class:"notification_18plus_text"},si={class:"notification_18plus_accept"},ii={key:1,class:"notification_text"},li={key:0,class:"wrapper_button_accept"},nn=e.defineComponent({__name:"NotificationWindow",props:e.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean},is_qr:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t){const n=t,o=_e(),r=ce(),{is18Allowed:a,notificationData_lib:s}=U.storeToRefs(r),{itemThemes:i}=U.storeToRefs(o),l=e.computed(()=>n.backgroundColor||"rgba(50, 50, 50, 0.9)"),c=e.useModel(t,"visible"),d=()=>{s.value.fastAdd&&(r.addToCart(s.value.fastAdd),s.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),a.value=!0,c.value=!1},u=()=>{c.value=!1};return(f,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"notificationBlack",appear:""},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"notification_background_black",onClick:u})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"notification",appear:""},{default:e.withCtx(()=>{var _;return[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"notification_overlay",onClick:u},[e.createElementVNode("div",{class:"notification_wrapper",style:e.normalizeStyle({"background-color":l.value,border:`2px solid ${l.value}`})},[e.createElementVNode("div",ti,[t.type?(e.openBlock(),e.createElementBlock("div",ni,[e.createElementVNode("div",oi,[e.createElementVNode("img",{src:e.unref(i).adult_disclaimer_image||e.unref(i).fallback_image,alt:"Дисклеймер"},null,8,ri)]),e.createElementVNode("div",ai,e.toDisplayString(e.unref(i).adult_disclaimer_text),1),e.createElementVNode("div",si,[g[0]||(g[0]=e.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой.",-1)),e.createVNode(Re,{textButtonDefault:"Мне есть 18",onClick:d,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(e.openBlock(),e.createElementBlock("div",ii,[e.createTextVNode(e.toDisplayString(t.textNotificationDefault)+" ",1),(_=t.buttonAccept)!=null&&_.state?(e.openBlock(),e.createElementBlock("div",li,[e.createVNode(Re,{class:"button_accept",textButtonDefault:t.buttonAccept.text,onClick:t.buttonAccept.acceptBtn,disabled:t.buttonAccept.disabled},null,8,["textButtonDefault","onClick","disabled"])])):e.createCommentVNode("",!0)]))])],4)])):e.createCommentVNode("",!0)]}),_:1})],64))}}),ci={class:"button_price button_price_modifiers"},di=["src"],ui={class:"button_text_container"},fi={class:"button_text_price"},mi=ne(e.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(t){const n=K.useRouter(),o=K.useRoute(),r=me(),a=ce(),s=_e(),i=e.ref([]),l=e.ref([]),c=t,{stateCard:d,totalPrice_libCard:u,isOpenWindow:f,isAddToCard:g}=U.storeToRefs(r),{itemThemes:_}=U.storeToRefs(s),m=e.ref(!0),y=e.ref(!1),S=()=>{var h,p,v,D,O,R;if(m.value){r.setCurrentCard(d.value.openCard),y.value=!0;const M=d.value.groupModifiers.findIndex(k=>r.checkedRequiredBtn.group.id===k.id);r.checkedRequiredBtn.haveRequaire&&r.toggleNotRequire(r.checkedRequiredBtn.group,M);return}const w=d.value.groupModifiersSelected||[];if(i.value=[],l.value=[],Array.isArray(w)&&w.length>0&&w.forEach(M=>{const k=M.group,N=M.modifiers||[];k==="Добавки2000"?i.value=N.map(B=>{var I;return{...B,old_price:B.price,size:Array.isArray(B.size)?B.size.map(P=>P.id).filter(Boolean):(I=B.size)!=null&&I.id?B.size.id:void 0}}):N.length>0&&l.value.push({group:k,modifiers:N.map(B=>{var I;return{...B,old_price:B.price,size:Array.isArray(B.size)?B.size.map(P=>P.id).filter(Boolean):(I=B.size)!=null&&I.id?B.size.id:void 0}})})}),document.body.style.overflow="",d.value.openCard){const M={id:d.value.openCard.id,is_fake:d.value.openCard.is_fake||!1,amount:d.value.openCard.amount,name:d.value.openCard.name,image_link:d.value.openCard.image_link,price:d.value.openCard.price,old_price:d.value.openCard.price,size:((h=d.value.selectedSize)==null?void 0:h.id)??((v=(p=d.value.openCard.sizes)==null?void 0:p.find(k=>k.is_default))==null?void 0:v.id),sizes:((D=d.value.selectedSize)==null?void 0:D.id)??((R=(O=d.value.openCard.sizes)==null?void 0:O.find(k=>k.is_default))==null?void 0:R.id),modifiers:i.value,groups:d.value.openCard.groups,group_modifiers:l.value,energy_amount:d.value.openCard.energy_amount??0,proteins_amount:d.value.openCard.proteins_amount??0,fat_amount:d.value.openCard.fat_amount??0,carbohydrates_amount:d.value.openCard.carbohydrates_amount??0};c.closeProduct&&c.closeProduct(),a.addToCart(M),g.value=!0}f.value=!1,n.push(`/${o.params.orgId}/`)};return e.watch(()=>d.value.productSizes,w=>{!w||w.length===0||!d.value.selectedSize||(d.value.selectedSize={...d.value.selectedSize})},{immediate:!0}),e.watchEffect(()=>{r.checkedRequiredBtn.haveRequaire?m.value=!0:m.value=!1}),e.onMounted(()=>{g.value=!1}),(w,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(nn,{visible:y.value,textNotificationDefault:e.unref(d).textErrorRequaired,backgroundColor:e.unref(_).accent_color?e.unref(_).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":h[0]||(h[0]=p=>y.value=p)},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:h[3]||(h[3]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[4]||(h[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ci,[e.createVNode(Qs),e.createElementVNode("div",{class:e.normalizeClass(["card_product_button_buy",{buy_active:!m.value}]),"data-clickable":"true",onClick:S,onTouchstart:h[1]||(h[1]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[2]||(h[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{src:e.unref(Ks),class:"card_product_button_icon"},null,8,di),e.createElementVNode("div",ui,[e.createElementVNode("p",fi,[e.createVNode(ve,{price:+e.unref(u),fixedFloat:2},null,8,["price"]),h[5]||(h[5]=e.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-dbbf98fb"]]),pi={class:"modified_amount"},hi={class:"hide_image_corners"},_i=["src"],gi={class:"wrapper_modifier_title"},yi={class:"amount_title"},bi={class:"wrapper_amount_counter"},wi={class:"amount_count"},ki={class:"amount_wrapper"},Ci={class:"add_counter_amount"},Si=ne(e.defineComponent({__name:"ModalAmount",setup(t){const n=me(),o=_e(),{itemThemes:r}=U.storeToRefs(o),{stateCard:a}=U.storeToRefs(n),s=e.computed(()=>{var c,d,u;return((u=(d=(c=a.value.currentModifier)==null?void 0:c.sizes)==null?void 0:d.find(f=>f.id===a.value.selectedSize.id))==null?void 0:u.price)??nt(a.value.currentModifier)}),i=()=>{a.value.currentModifier&&(a.value.currentModifier.amount=a.value.modalCount),n.modifierSelect(a.value.currentModifier),a.value.isModifiedAmount=!1},l=()=>{a.value.modalCount=1,a.value.currentModifier.amount=1};return(c,d)=>{var u,f;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",pi,[e.createElementVNode("div",hi,[e.createElementVNode("img",{class:"modifier_image",src:((u=e.unref(a).currentModifier)==null?void 0:u.image_link)||e.unref(r).fallback_image||""},null,8,_i),e.createElementVNode("div",gi,[e.createElementVNode("p",yi,e.toDisplayString((f=e.unref(a).currentModifier)==null?void 0:f.name),1),e.createElementVNode("p",null,"+ "+e.toDisplayString(s.value)+"₽",1)])])]),e.createElementVNode("div",bi,[e.createElementVNode("div",{class:"amount_mines",onClick:d[0]||(d[0]=e.withModifiers((...g)=>e.unref(n).minusAmount&&e.unref(n).minusAmount(...g),["stop"]))},[...d[1]||(d[1]=[e.createElementVNode("div",null,null,-1)])]),e.createElementVNode("p",wi,e.toDisplayString(e.unref(a).modalCount),1),e.createElementVNode("div",ki,[e.createVNode(Qt,{onClick:e.withModifiers(e.unref(n).plusAmount,["stop"])},null,8,["onClick"])])]),e.createElementVNode("p",{class:"clear_count",onClick:e.withModifiers(l,["stop"])},"Убрать все"),e.createElementVNode("div",Ci,[e.createVNode(Re,{textButtonDefault:"Добавить",onClick:i,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-6b4f039c"]]),Ei=(t,n,o)=>Math.max(n,Math.min(t,o)),Ni=(t,n)=>Math.pow(t,n*5),bo=(t,n,o)=>n===0||Math.abs(n)===1/0?Ni(t,o):t*n*o/(n+o*t),xt=(t,n)=>n*parseFloat(t)/100,on=(t,n,o,r=.15)=>r===0?Ei(t,n,o):t<n?-bo(n-t,o-n,r)+n:t>o?+bo(t-o,o-n,r)+o:t,Se=(t,{min:n,max:o})=>n!==void 0&&t<n?n:o!==void 0&&t>o?o:t;function xi(t,n,o){const r=e.ref(0),a=e.computed(()=>t.value.map(c=>typeof c=="string"?xt(c,o.value):c)),s=e.computed(()=>Math.min(...a.value)),i=e.computed(()=>Math.max(...a.value)),l=e.computed(()=>{const c=a.value.reduce((d,u)=>Math.abs(u-n.value)<Math.abs(d-n.value)?u:d);return a.value.indexOf(c)});return{currentSnapPointIndex:r,flattenedSnapPoints:a,minSnapPoint:s,maxSnapPoint:i,closestSnapPointIndex:l}}const wo=ne(e.defineComponent({__name:"BottomSheet",props:{duration:{default:250},snapPoints:{},initialSnapPoint:{},blocking:{type:Boolean,default:!0},canSwipeClose:{type:Boolean,default:!0},swipeCloseThreshold:{},canBackdropClose:{type:Boolean,default:!0},expandOnContentDrag:{type:Boolean,default:!0},modelValue:{type:Boolean},teleportTo:{default:"body"},teleportDefer:{type:Boolean,default:!1},headerClass:{},contentClass:{},footerClass:{}},emits:["opened","opening-started","closed","closing-started","ready","dragging-up","dragging-down","snapped","instinctHeight","update:modelValue"],setup(t,{expose:n,emit:o}){const r=t,a=o,s=Ee.useVModel(r,"modelValue",a,{passive:!0});e.watch(s,j=>{j&&x()}),e.onMounted(()=>{s.value&&x()});const i=e.ref(),l=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),f=e.ref(r.expandOnContentDrag),{height:g}=Ee.useWindowSize(),{height:_}=Ee.useElementBounding(i),{height:m}=Ee.useElementBounding(l),{height:y}=Ee.useElementBounding(u),{height:S}=Ee.useElementBounding(c),w=e.computed({get(){return Se(Math.ceil(y.value+m.value+S.value),{max:g.value})},set(j){[m.value,y.value,S.value]=j}}),h=e.ref(0),p=e.ref(0),v=pe.useMotionValue(0),D=pe.useMotionValue(0),{snapPoints:O}=e.toRefs(r),R=e.computed(()=>O.value??[w.value]),{flattenedSnapPoints:M,currentSnapPointIndex:k,closestSnapPointIndex:N,minSnapPoint:B,maxSnapPoint:I}=xi(R,h,g);let P;function T(j){f.value=!0,C(j)}function C(j){f.value&&j.preventDefault()}const A=j=>{j.key==="Escape"&&L()},$=()=>{r.canBackdropClose&&L()};let b=!1;const x=async()=>{if(b)return;s.value=!0,b=!0,a("opening-started"),await e.nextTick();const j=i.value.$el;_.value=j.getBoundingClientRect().height;const Y=j.querySelector("[data-vsbs-content]"),re=j.querySelector("[data-vsbs-header]"),ie=j.querySelector("[data-vsbs-footer]");if(w.value=[re.getBoundingClientRect().height,Y.getBoundingClientRect().height,ie.getBoundingClientRect().height],await e.nextTick(),k.value=M.value.findIndex(se=>se===B.value),r.initialSnapPoint){const se=r.initialSnapPoint;if(se<0||se>=R.value.length)return console.warn("Index out of bounds");h.value=typeof R.value[se]=="number"?Se(R.value[se],{max:g.value}):xt(R.value[se],g.value)}else h.value=Se(B.value,{max:g.value});p.value=h.value,v.jump(h.value),D.jump(h.value),requestAnimationFrame(()=>{P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut"}),P=pe.animate(D,0,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>{r.blocking&&a("opened")}})}),window.addEventListener("keydown",A),b=!1};let V=!1;const L=()=>{V||(s.value=!1,V=!0,a("closing-started"),window.removeEventListener("keydown",A),setTimeout(()=>{a("closed"),V=!1},r.duration))},W=j=>{if(R.value){if(j<0||j>=R.value.length){console.warn("Index out of bounds");return}k.value=j,h.value=typeof R.value[j]=="number"?Se(R.value[j],{max:g.value}):xt(R.value[j],g.value),P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",R.value.indexOf(R.value[j]))})}};function H(j){j>0?a("dragging-down"):j<0&&a("dragging-up")}const X=()=>{h.value=_.value,p.value=D.get(),v.jump(h.value),D.jump(p.value)},te=async(j,Y)=>{await e.nextTick(),i.value&&(p.value<=0&&(h.value-=Y.delta.y),h.value<=B.value&&(h.value=B.value,p.value+=Y.delta.y,D.set(r.canSwipeClose?Se(p.value,{min:0}):Se(on(p.value,-_.value,0,.5),{min:0}))),v.set(Se(on(h.value,0,I.value,.25),{min:0,max:g.value})),H(Y.delta.y))},ue=()=>{if(r.canSwipeClose){let j=h.value/2;r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="number"&&(j=r.swipeCloseThreshold),r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="string"&&r.swipeCloseThreshold.includes("%")&&(j=h.value*(Number(r.swipeCloseThreshold.replace("%",""))/100)),Math.abs(p.value)>j&&(p.value=h.value)}else p.value=0;P=pe.animate(D,p.value,{duration:r.duration/1e3,ease:"easeInOut"}),p.value===h.value&&(p.value=0,L()),k.value=N.value,h.value=typeof R.value[N.value]=="number"?Se(R.value[N.value],{max:g.value}):xt(R.value[N.value],g.value),P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",R.value.indexOf(R.value[N.value]))}),P=pe.animate(D,0,{duration:r.duration/1e3,ease:"easeInOut"})},oe=(j,Y)=>{if(h.value=_.value,p.value=D.get(),P&&P.stop(),!d.value)return;const re=d.value.scrollTop===0,ie=Y.delta.y>0,se=M.value.length===1,fe=.5>Math.abs(h.value-I.value);if(se){if(!r.expandOnContentDrag)return f.value=!1;D.get()===0&&re&&ie&&(f.value=!0),D.get()===0&&re&&!ie&&(f.value=!1)}else{if(!r.expandOnContentDrag)return f.value=!1;f.value=!0,fe&&(ie&&re&&(f.value=!0),!ie&&re&&(f.value=!1),re||(f.value=!1))}},G=async(j,Y)=>{if(await e.nextTick(),!r.expandOnContentDrag)return f.value=!1;if(!i.value)return;p.value===0&&f.value&&r.expandOnContentDrag&&(h.value-=Y.delta.y),h.value<=B.value&&(h.value=B.value,f.value&&r.expandOnContentDrag&&(p.value+=Y.delta.y),p.value=Se(p.value,{min:0,max:B.value}),D.set(r.canSwipeClose?Se(p.value,{min:0}):Se(on(p.value,-_.value,0,.5),{min:0}))),h.value>I.value&&(h.value=I.value),h.value=Se(h.value,{max:g.value}),!(M.value.length===1)&&h.value===I.value&&(f.value=!1),v.set(h.value),H(Y.delta.y)},F=()=>{if(!d.value)return;const j=d.value.scrollTop===0;f.value=j},Q=Ee.useDebounceFn(j=>W(j),r.duration);return e.watch(R,(j,Y)=>{if(s.value===!1||!j||!Y)return;const re=j[k.value],ie=Y[k.value];typeof re!="string"&&typeof ie!="string"&&(h.value=Se(re,{max:g.value}),re!==ie&&(P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut"})))}),e.watch(g,()=>Q(k.value)),e.watch(w,j=>a("instinctHeight",j)),n({open:x,close:L,snapToPoint:W}),(j,Y)=>(e.openBlock(),e.createBlock(e.Teleport,{to:t.teleportTo,defer:t.teleportDefer},[e.createElementVNode("div",e.mergeProps(j.$attrs,{"data-vsbs-container":""}),[e.createVNode(e.unref(pe.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(s)&&t.blocking?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref:"backdrop","data-vsbs-backdrop":"",onClick:Y[0]||(Y[0]=re=>$()),transition:{ease:"easeInOut",duration:t.duration/1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},null,8,["transition"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(pe.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref_key:"sheet",ref:i,exit:{y:"100%",height:e.unref(_),opacity:0},initial:!1,style:e.normalizeStyle({y:e.unref(D),z:1,height:e.unref(v)}),"data-vsbs-shadow":!t.blocking,"data-vsbs-sheet-show":e.unref(s),"aria-modal":"true","data-vsbs-sheet":"",tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe.Motion),{ref_key:"sheetHeader",ref:l,"data-vsbs-header":"",onPanStart:X,onPan:te,onPanEnd:ue,onTouchmove:T,class:e.normalizeClass(t.headerClass)},{default:e.withCtx(()=>[e.renderSlot(j.$slots,"header",{},void 0,!0)]),_:3},8,["class"]),e.createElementVNode("div",{ref_key:"sheetScroll",ref:d,"data-vsbs-scroll":"",onScrollend:F},[e.createVNode(e.unref(pe.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:oe,onPan:G,onPanEnd:ue,onTouchmove:C},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"sheetContent",ref:u,"data-vsbs-content":"",class:e.normalizeClass(t.contentClass)},[e.renderSlot(j.$slots,"default",{},void 0,!0)],2)]),_:3},512)],544),e.createVNode(e.unref(pe.Motion),{ref_key:"sheetFooter",ref:c,"data-vsbs-footer":"",onPanStart:X,onPan:te,onPanEnd:ue,onTouchmove:T,class:e.normalizeClass(t.footerClass)},{default:e.withCtx(()=>[e.renderSlot(j.$slots,"footer",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["exit","style","data-vsbs-shadow","data-vsbs-sheet-show"])):e.createCommentVNode("",!0)]),_:3})],16)],8,["to","defer"]))}}),[["__scopeId","data-v-8bf4388d"]]);function je(t,n=null){const o=tt();o.initCacheSingle("defaultImage");const r=e.computed(()=>o.cache.defaultImage||null),a=e.shallowRef(!1),s=e.computed(()=>{var d;return((d=e.toValue(t))==null?void 0:d.toString())||null}),i=Ee.computedAsync(async()=>{const d=s.value;return d?(await o.initCacheSingle(d),o.cache[d]||null):null},null,{evaluating:a}),l=e.computed(()=>a.value&&s.value!==null);return{mediaUrl:e.computed(()=>i.value||e.toValue(n)||r.value||null),isLoading:l}}const Bi={class:"card_product_wrapper"},Ai={class:"card_product_modifiers_sheet_body"},vi={class:"card__pictures"},$i=["src"],Ti=["src"],Mi={class:"card_header_wrapper"},Pi={key:0,class:"card_fire_kkal_wrapper"},Vi={class:"card_content"},Ii={class:"wrapper_size"},Ri={key:0,class:"description"},Di={key:1},Oi=ne(e.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(t){const n=_e(),o=me(),{stateCard:r,isOpenWindow:a}=U.storeToRefs(o),{itemThemes:s}=U.storeToRefs(n),i=K.useRouter(),l=K.useRoute(),c=t,{mediaUrl:d}=je(()=>{var g,_;return(g=r.value.openCard)!=null&&g.video_link?`${r.value.openCard.id}_video`:(_=r.value.openCard)!=null&&_.image_link?`${r.value.openCard.id}_image`:null},()=>{var g,_;return((g=r.value.openCard)==null?void 0:g.video_link)||((_=r.value.openCard)==null?void 0:_.image_link)||null}),u=()=>{c.configPage.qr_menu?i.push(`/${l.params.orgId}`):c.configPage.closeProduct()},f=()=>{r.value.isModifiedAmount=!1};return e.watch(()=>c.configPage.data,o.setCurrentCard),e.watchEffect(()=>{a.value||(a.value=c.configPage.is_closeProduct)}),e.onBeforeUnmount(()=>o.reset()),(g,_)=>{var m,y,S,w,h,p;return e.openBlock(),e.createElementBlock("div",Bi,[e.createVNode(e.unref(wo),{modelValue:e.unref(r).isSectionModifier,"onUpdate:modelValue":_[1]||(_[1]=v=>e.unref(r).isSectionModifier=v),class:"card_product_modifiers_sheet"},{default:e.withCtx(()=>[e.createElementVNode("div",Ai,[e.createVNode(Us,{onClose:_[0]||(_[0]=v=>e.unref(r).isSectionModifier=!1)}),e.createVNode(go,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(r).isModifiedAmount?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:e.withModifiers(f,["stop"])},[e.createVNode(Si)])):e.createCommentVNode("",!0)])),e.createElementVNode("div",vi,[(m=e.unref(r).openCard)!=null&&m.video_link&&e.unref(d)?(e.openBlock(),e.createElementBlock("video",{key:e.unref(d),loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,$i)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"card__pictures_images",src:e.unref(d)||"",alt:"Product image"},null,8,Ti)),e.createElementVNode("div",Mi,[e.createVNode(en,{class:"card_header_back",onClick:u,"aria-label":"Вернуться назад"}),(y=e.unref(r).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",Pi,[_[3]||(_[3]=e.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),e.createElementVNode("p",null,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(r).openCard)==null?void 0:S.energy_amount),1),_[2]||(_[2]=e.createTextVNode(" Ккал ",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("h4",null,e.toDisplayString((w=e.unref(r).openCard)==null?void 0:w.name),1),e.createElementVNode("div",{class:"card__pictures__gradient",style:e.normalizeStyle(e.unref(s).gradientStyle)},null,4)]),e.createElementVNode("div",Vi,[e.createElementVNode("div",Ii,[e.createVNode(Gs)]),(h=e.unref(r).openCard)!=null&&h.description?(e.openBlock(),e.createElementBlock("p",Ri,e.toDisplayString((p=e.unref(r).openCard)==null?void 0:p.description),1)):e.createCommentVNode("",!0),e.unref(r).groupModifiers.length?(e.openBlock(),e.createElementBlock("div",Di,[_[4]||(_[4]=e.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),e.createVNode(go,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):e.createCommentVNode("",!0),e.createVNode(mi,{qr_menu:t.configPage.qr_menu,closeProduct:t.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-732bba57"]]),Fi={key:0,class:"popupWindowDefault_overlay"},ko=ne(e.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:n}){const o=t,r=n,a=()=>{r("update:visible",!1)};return e.watch(()=>o.visible,async s=>{s&&await e.nextTick(),o.isVisible=s}),(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:i[0]||(i[0]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"background_black",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:i[1]||(i[1]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",Fi,[e.renderSlot(s.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),Li={},zi={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ui(t,n){return e.openBlock(),e.createElementBlock("svg",zi,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M18 18L12 12M12 12L6 6M12 12L18 6M12 12L6 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const ji=ne(Li,[["render",Ui]]),rn=U.defineStore("modals",()=>{const t=new Map,n=(a,s)=>{const i=r(a).value;i.visible=!0,i.context=s},o=a=>{const s=r(a).value;s.visible=!1},r=a=>(t.has(a)||t.set(a,e.ref({visible:!1})),t.get(a));return{state:r,open:n,close:o}}),Hi=["src"],qi={class:"cart_box_content_wrapper"},Wi={class:"cart_box_content_info"},Gi={class:"cart_amount"},Ki={class:"cart_amount_count"},Ji={class:"cart_box_info_more"},Xi={key:1,class:"cart_modifier_info"},Zi={class:"cart_modifier_content"},Yi={class:"wrapper_price_count_cart"},Qi={class:"count_cart_box"},el={class:"wrapper_modifiers_discount"},Co=ne(e.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(t,{emit:n}){const o=t,r=ce(),a=_e(),s=rn(),{itemThemes:i}=U.storeToRefs(a),l=e.ref(0),c=e.ref(0),d=e.ref(!1),u=e.ref(!1),f=e.ref(!1),{displayNumber:g,update:_}=yo(0,800),m=e.computed(()=>{var B,I;const k=((B=o.cardItem)==null?void 0:B.modifiers)??[],N=(((I=o.cardItem)==null?void 0:I.group_modifiers)??[]).flatMap(P=>P.modifiers??[]);return[...k,...N]}),{mediaUrl:y}=je(()=>{var k;return((k=o.cardItem)==null?void 0:k.id)+"_image"},()=>{var k;return(k=o.cardItem)==null?void 0:k.image_link}),S=e.computed(()=>{var k,N;return((k=o.cardItem)==null?void 0:k.total_new_price)||nt(o.cardItem)*((N=o.cardItem)==null?void 0:N.amount)}),w=()=>s.open("cart-delete-confirm",o.cardItem),h=()=>{f.value=!f.value},p=()=>{r.plusAmount(o.cardItem.idSystem)},v=()=>{o.cardItem.amount>1?r.minusAmount(o.cardItem.idSystem):w()},D=k=>{l.value=k.touches[0].clientX,d.value=!0},O=k=>{d.value&&(c.value=k.touches[0].clientX-l.value,c.value>0&&(c.value=0))},R=()=>{d.value=!1,c.value<-115&&w(),c.value=0};e.onMounted(()=>{o.index===0&&(u.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,u.value=!1},700)},0))});const M=e.computed(()=>{const k=o.index===0&&u.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:k,transition:d.value?"none":"transform 0.7s, opacity 0.7s"}});return e.watch(S,_,{immediate:!0}),(k,N)=>{var B,I,P,T;return e.openBlock(),e.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:D,onTouchmove:O,onTouchend:R,style:e.normalizeStyle(M.value)},[N[2]||(N[2]=e.createElementVNode("div",{class:"wrapper_cart_delete"},[e.createElementVNode("div",{class:"cart_delete"})],-1)),e.createElementVNode("img",{src:e.unref(y)||"",class:"cart_box_image"},null,8,Hi),e.createElementVNode("div",qi,[e.createElementVNode("div",Wi,[e.createElementVNode("p",null,e.toDisplayString((B=t.cardItem)==null?void 0:B.name),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((I=o.cardItem)==null?void 0:I.discounts)||[],(C,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:"discount_banner"},[e.createElementVNode("p",null,e.toDisplayString(C.name),1),e.createElementVNode("p",null,e.toDisplayString(C.discount)+"₽",1)]))),128)),e.createElementVNode("div",Gi,[e.createElementVNode("button",{onClick:v},"-"),e.createElementVNode("p",Ki,e.toDisplayString(o.cardItem.amount),1),e.createElementVNode("button",{onClick:p},"+")])]),e.createElementVNode("div",Ji,[e.createElementVNode("div",{class:"cart_box_remove_item",onClick:w},[e.createVNode(ji)]),(P=o.cardItem)!=null&&P.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(T=o.cardItem)==null?void 0:T.new_price})},e.toDisplayString((o.cardItem.new_price*o.cardItem.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString(e.unref(g).toFixed(2)+"₽"),1)])]),!f.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:e.withModifiers(h,["stop"])},[...N[0]||(N[0]=[e.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),e.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",Xi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,C=>{var A;return e.openBlock(),e.createElementBlock("div",{class:"cart_modifier_item",key:C.id},[e.createElementVNode("div",Zi,[e.createVNode(Qt,{id:"plus_orange"}),e.createElementVNode("p",null,e.toDisplayString(C.name),1)]),e.createElementVNode("div",Yi,[e.createElementVNode("p",Qi,e.toDisplayString(`x${C.amount}`),1),e.createElementVNode("div",el,[C!=null&&C.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(A=C==null?void 0:C.new_price)==null?void 0:A.toFixed(2)})},e.toDisplayString((C.new_price*C.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString((C.total_new_price||C.price*C.amount).toFixed(2)+"₽"),1)])])])}),128)),e.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:e.withModifiers(h,["stop"])},[...N[1]||(N[1]=[e.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),e.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):e.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-e48a9689"]]),tl={},nl={class:"nfc_x",viewBox:"0 0 48 48"};function ol(t,n){return e.openBlock(),e.createElementBlock("svg",nl,[...n[0]||(n[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),e.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const rl=ne(tl,[["render",ol]]),al={},sl={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function il(t,n){return e.openBlock(),e.createElementBlock("svg",sl,[...n[0]||(n[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const ll=ne(al,[["render",il]]),cl={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},dl=e.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(t){return(n,o)=>t.styleRetry?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",cl,[...o[0]||(o[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),ul={class:"sheet_header"},fl={class:"sheet_title",id:"sheetTitle"},ml={class:"sheet_body"},pl={class:"sheet_card"},hl={class:"nfc_title"},_l={class:"lead"},gl={class:"wrapper_input_accept"},yl={key:0,class:"card_phone_auth_wrapper"},bl={class:"sr_only","aria-live":"polite"},So=e.defineComponent({__name:"CardReader",setup(t){const n=ce(),o=_e(),{is_OpenLoyal:r}=U.storeToRefs(n),{itemThemes:a}=U.storeToRefs(o),s=Fe(),i=e.ref(),l=e.ref(),c=e.ref(null),d=e.ref(""),u={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},f=e.computed({get:()=>d.value,set:$=>{d.value=$.replace(/\s/g,"")}}),g=e.computed(()=>s.currentState),_=e.computed(()=>s.isDrawerOpen),m=e.computed(()=>{var $;return(($=u[g.value])==null?void 0:$.text)||""}),y=e.computed(()=>{var $;($=u[g.value])!=null&&$.title}),S=e.computed(()=>g.value==="success"?"Добро пожаловать!":a.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),w=e.computed(()=>({ok:g.value==="success",warn:g.value==="not_found"})),h=e.computed(()=>{const $=[];return g.value==="wait"&&$.push("pulse","show-x"),g.value==="not_found"&&$.push("pulse","show-x"),g.value==="success"&&$.push("pulse","show-ok"),$}),p=e.computed(()=>g.value==="not_found"),v=e.computed(()=>g.value==="success"),D=e.computed(()=>g.value==="not_found"),O=e.computed(()=>["not_found"].includes(g.value)),R=e.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[g.value]||""),M=()=>{s.closeDrawer(),r.value=!0},k=async $=>{var b,x;s.error="",c.value=null;try{const V=new Ve;await V.authorizeByCard($.trim()),await V.getProfile(),n.loadCart(),s.setState("success"),s.isDrawerOpen=!1,s.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(V){s.error=((x=(b=V.response)==null?void 0:b.data)==null?void 0:x.user_friendly_message)||"Ошибка",s.setState("not_found"),c.value=f.value,f.value=""}},N=()=>{var $;s.setState("wait"),s.error="",f.value="",c.value=null,($=i.value)==null||$.focus()},B=()=>{s.closeDrawer(),c.value=null,f.value=""},I=()=>{var $,b;s.setState("wait"),(b=($=f.value)==null?void 0:$.trim())!=null&&b.length&&k(f.value.trim())},P=$=>{$.stopPropagation(),document.activeElement!==l.value&&T()},T=()=>{e.nextTick(()=>{l.value&&(l.value.focus(),d.value&&l.value.select())})},C=$=>{const b=document.activeElement===l.value;if(!_.value||b)return;const x=$.key.toLowerCase();if(x==="backspace")return f.value=f.value.slice(0,-1);if(x==="escape")return B();if(x==="r"&&D.value)return N();if(x==="c"&&g.value==="success")return B();if(x==="enter")return I();f.value+=x},A={mounted($){$==null||$.focus()}};return e.onMounted(()=>{document==null||document.addEventListener("keydown",C)}),e.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",C)}),e.watchEffect(()=>{_.value&&(s.error="")}),($,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"backdrop show",onClick:B,"aria-hidden":"true"})):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["sheet show",{sheet_retry:D.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:P},[e.createElementVNode("header",ul,[e.createElementVNode("div",fl,e.toDisplayString(m.value),1),D.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sheet_status",w.value])},e.toDisplayString(c.value),3)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"sheet_close",onClick:B,"aria-label":"Закрыть"}," Закрыть ")]),e.createElementVNode("div",ml,[e.createElementVNode("div",pl,[e.createElementVNode("div",{class:e.normalizeClass(["nfc",h.value])},[e.createVNode(dl,{styleRetry:O.value},null,8,["styleRetry"]),p.value?(e.openBlock(),e.createBlock(rl,{key:0})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"overlay check",style:e.normalizeStyle({display:v.value?"grid":"none"}),"aria-hidden":"true"},[e.createVNode(ll)],4)],2),e.createElementVNode("h2",hl,e.toDisplayString(y.value),1),e.createElementVNode("p",_l,e.toDisplayString(S.value),1),e.createElementVNode("div",gl,[e.withDirectives(e.createElementVNode("input",{ref_key:"cardInputManualRef",ref:l,"onUpdate:modelValue":b[0]||(b[0]=x=>f.value=x),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:e.withKeys(I,["enter"])},null,544),[[e.vModelText,f.value],[A]]),D.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:N},"Повторить")):(e.openBlock(),e.createElementBlock("button",{key:1,class:"btn btn_ghost",onClick:b[1]||(b[1]=x=>D.value?B:I())},"Отправить"))]),g.value==="wait"&&e.unref(a).kiosk_show_loyalty_phone_input_button?(e.openBlock(),e.createElementBlock("div",yl,[e.createElementVNode("button",{class:"card_phone_auth_button",onClick:M},"Войти по номеру телефона")])):e.createCommentVNode("",!0)])]),e.createElementVNode("input",{ref_key:"cardInputRef",ref:i,type:"text",class:"sr_only","aria-live":"polite"},null,512),e.createElementVNode("div",bl,e.toDisplayString(R.value),1)],2)):e.createCommentVNode("",!0)],64))}}),wl={class:"start_page"},kl=["src"],Cl={class:"wrap"},Sl={class:"wrap_box"},El={class:"title_fiscal_order"},Nl={class:"wrapper_accept"},xl={ref:"barRef",class:"bar_complete","aria-hidden":"true"},Bl=ne(e.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(t){const n=ce(),o=Fe(),r=me(),a=_e(),{cartProducts_lib:s}=U.storeToRefs(n),{orderNumber:i,orderCompleted_lib:l}=U.storeToRefs(o),{is_startPage:c}=U.storeToRefs(r),{mediaUrl:d}=je(()=>a.itemThemes.kiosk_preloader?"preloader":null),u=K.useRouter(),f=K.useRoute();let g=null;e.onMounted(()=>{g=setTimeout(()=>{c.value=!0,u.replace(`/${f.params.orgId}`)},1e4)});const _=()=>{Ke(["cart","authTokensAccess","authTokensRefresh"]),s.value=[],l.value=null,o.clearCard(),n.profile=null,u.replace(`/${f.params.orgId}`)};return e.onUnmounted(()=>{g&&clearInterval(g)}),(m,y)=>(e.openBlock(),e.createElementBlock("div",wl,[(e.openBlock(),e.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:e.unref(d)},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,kl)])),y[4]||(y[4]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",Cl,[e.createElementVNode("div",Sl,[y[1]||(y[1]=e.createElementVNode("div",{class:"icon","aria-hidden":"true"},[e.createElementVNode("svg",{viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),y[2]||(y[2]=e.createElementVNode("h1",null," Заказ успешно оплачен ",-1)),e.createElementVNode("p",El,"№ "+e.toDisplayString(e.unref(i)),1),y[3]||(y[3]=e.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),e.createElementVNode("div",Nl,[e.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:_},[y[0]||(y[0]=e.createElementVNode("span",{class:"label"},"Новый заказ",-1)),e.createElementVNode("span",xl,null,512)])])])])]))}}),[["__scopeId","data-v-c07b734f"]]),Al={};function vl(t,n){return n[0]||(n[0]=e.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-3e03a6dc><i data-v-3e03a6dc></i></div><h1 class="title_fiscal" data-v-3e03a6dc>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-3e03a6dc>Не забудьте <b data-v-3e03a6dc>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-3e03a6dc><div class="printer" data-v-3e03a6dc><div class="led" data-v-3e03a6dc></div><div class="slot" data-v-3e03a6dc></div><div class="receipt" data-v-3e03a6dc><div class="tear" data-v-3e03a6dc></div><div class="line accent" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div></div></div></div>',4))}const $l=ne(Al,[["render",vl],["__scopeId","data-v-3e03a6dc"]]),Tl={},Ml={class:"center"};function Pl(t,n){return e.openBlock(),e.createElementBlock("div",Ml,[...n[0]||(n[0]=[e.createStaticVNode('<div class="stack" data-v-f0859fd1><h1 class="title_fiscal" data-v-f0859fd1>Приложите карту для оплаты</h1><p class="reminder" data-v-f0859fd1>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f0859fd1><div class="waves" data-v-f0859fd1><span data-v-f0859fd1></span><span data-v-f0859fd1></span><span data-v-f0859fd1></span></div><div class="nfc" data-v-f0859fd1><svg viewBox="0 0 24 24" data-v-f0859fd1><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f0859fd1></path><path d="M10 6c4 4 4 8 0 12" data-v-f0859fd1></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f0859fd1></path></svg></div><div class="card" data-v-f0859fd1><div class="logo" data-v-f0859fd1>inno.</div><div class="chip" data-v-f0859fd1></div><div class="digits" data-v-f0859fd1>4815 1623 4200 0900</div><div class="holder" data-v-f0859fd1>Гость</div></div></div></div>',1)])])}const Vl=ne(Tl,[["render",Pl],["__scopeId","data-v-f0859fd1"]]),Il={key:0,class:"wrapper_qr"},Rl={key:1,class:"wrapper_qr"},Dl={key:2,class:"wrapper_qr"},Ol=ne(e.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(t){const n=Fe(),o=_e(),{orderNumber:r,orderCompleted_lib:a}=U.storeToRefs(n),{mediaUrl:s}=je(()=>o.itemThemes.kiosk_preloader?"preloader":null);return(i,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)&&e.unref(a)===1?(e.openBlock(),e.createElementBlock("section",Il,[e.createVNode($l)])):e.unref(a)&&e.unref(a)===2?(e.openBlock(),e.createElementBlock("section",Rl,[e.createVNode(Vl)])):e.createCommentVNode("",!0),e.unref(a)&&e.unref(a)===3?(e.openBlock(),e.createElementBlock("section",Dl,[e.createVNode(Bl,{orderNumber:e.unref(r),mediaUrl:e.unref(s)},null,8,["orderNumber","mediaUrl"])])):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-a3446a00"]]),Fl={},Ll={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function zl(t,n){return e.openBlock(),e.createElementBlock("svg",Ll,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M19 20H20M16 20H14V17M17 17H20V14H19M14 14H16M4 16.9997C4 16.0679 4 15.6019 4.15224 15.2344C4.35523 14.7443 4.74432 14.3552 5.23438 14.1522C5.60192 14 6.06786 14 6.99974 14C7.93163 14 8.39808 14 8.76562 14.1522C9.25568 14.3552 9.64467 14.7443 9.84766 15.2344C9.9999 15.6019 9.9999 16.0681 9.9999 17C9.9999 17.9319 9.9999 18.3978 9.84766 18.7654C9.64467 19.2554 9.25568 19.6447 8.76562 19.8477C8.39808 19.9999 7.93162 19.9999 6.99974 19.9999C6.06786 19.9999 5.60192 19.9999 5.23438 19.8477C4.74432 19.6447 4.35523 19.2557 4.15224 18.7656C4 18.3981 4 17.9316 4 16.9997ZM14 6.99974C14 6.06786 14 5.60192 14.1522 5.23438C14.3552 4.74432 14.7443 4.35523 15.2344 4.15224C15.6019 4 16.0679 4 16.9997 4C17.9316 4 18.3981 4 18.7656 4.15224C19.2557 4.35523 19.6447 4.74432 19.8477 5.23438C19.9999 5.60192 19.9999 6.06812 19.9999 7C19.9999 7.93188 19.9999 8.39783 19.8477 8.76537C19.6447 9.25542 19.2557 9.64467 18.7656 9.84766C18.3981 9.9999 17.9316 9.9999 16.9997 9.9999C16.0679 9.9999 15.6019 9.9999 15.2344 9.84766C14.7443 9.64467 14.3552 9.25568 14.1522 8.76562C14 8.39808 14 7.93163 14 6.99974ZM4 6.99974C4 6.06786 4 5.60192 4.15224 5.23438C4.35523 4.74432 4.74432 4.35523 5.23438 4.15224C5.60192 4 6.06786 4 6.99974 4C7.93163 4 8.39808 4 8.76562 4.15224C9.25568 4.35523 9.64467 4.74432 9.84766 5.23438C9.9999 5.60192 9.9999 6.06812 9.9999 7C9.9999 7.93188 9.9999 8.39783 9.84766 8.76537C9.64467 9.25542 9.25568 9.64467 8.76562 9.84766C8.39808 9.9999 7.93162 9.9999 6.99974 9.9999C6.06786 9.9999 5.60192 9.9999 5.23438 9.84766C4.74432 9.64467 4.35523 9.25568 4.15224 8.76562C4 8.39808 4 7.93163 4 6.99974Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const Ul=ne(Fl,[["render",zl]]),Eo=t=>{const n=rn(),o=l=>n.open(t,l),r=()=>n.close(t),a=n.state(t),s=e.computed({get:()=>a.value.visible,set:l=>l&&o()||r()}),i=e.computed(()=>a.value.context);return{visible:s,context:i,open:o,close:r}},jl={class:"cart_deletion_modal_content"},Hl={class:"cart_deletion_modal_title"},ql={class:"cart_deletion_modal_footer"},Wl=ne(e.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(t,{emit:n}){const o=n,{visible:r,context:a,close:s}=Eo("cart-delete-confirm"),i=()=>{o("confirm",a.value.idSystem),s()};return(l,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=e.withModifiers((...d)=>e.unref(s)&&e.unref(s)(...d),["self"]))},[e.createElementVNode("div",jl,[e.createElementVNode("div",Hl,"Удалить "+e.toDisplayString(e.unref(a).name)+"?",1),c[2]||(c[2]=e.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),e.createElementVNode("div",ql,[e.createElementVNode("button",{class:"primary",onClick:i}," Удалить "),e.createElementVNode("button",{onClick:c[0]||(c[0]=(...d)=>e.unref(s)&&e.unref(s)(...d))},"Отмена")])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),Gl={class:"cart_wrapper"},Kl={class:"cart_header_content"},Jl={class:"cart_kso_loyal_wrapper"},Xl={key:0},Zl={class:"cart_header_wrapper"},Yl=["src"],Ql={class:"cart_header_info"},ec={class:"cart_header_info"},tc={class:"cart_header_info"},nc={class:"cart_header_info"},oc={key:0},rc={key:0,class:"wrapper_comment"},ac={class:"wrapper_limit_in_area"},sc={class:"limit_comment"},ic={class:"cart_cards"},lc={class:"cart_footer_wrapper"},cc={key:0,class:"footer_title"},dc=["disabled","max"],uc={key:1,class:"footer_sales"},fc=["max"],mc={class:"list_price"},pc={key:0},hc={key:1},_c={key:2},gc={class:"accept_field"},yc={class:"accept_field"},bc={key:3},wc={class:"accept_field"},kc={class:"accept_field"},Cc={class:"accept_field"},Sc={class:"wrapper_footer_cart_btn"},Ec=e.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(t){const n=ce(),o=Fe(),r=_e(),a=me(),s=t,{totalPrice_lib:i,countBonus:l,config_lib:c,cartProducts_lib:d,profile:u}=U.storeToRefs(n),{itemThemes:f}=U.storeToRefs(r),{textPaymentBtn_lib:g,isButtonDisabled:_,orderCompleted_lib:m,orderNumber:y,extraDiscount:S,is_notification_lib:w,notificationData_lib:h}=U.storeToRefs(o),{isAddToCard:p}=U.storeToRefs(a),v=K.useRouter(),D=K.useRoute(),O=e.useTemplateRef("stickerLoyality"),R=e.ref(!1),M=e.ref(!1),k=e.ref(""),N=e.ref(!1),B=e.ref(0),I=e.ref(!1),P=e.ref(0),T=e.ref(),{width:C}=Ee.useElementSize(O,{width:0,height:0},{box:"border-box"}),A=e.computed(()=>{const G={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return d.value.reduce((F,Q)=>(F.energy_amount+=(Q.energy_amount||0)*(Q.amount||0),F.proteins_amount+=(Q.proteins_amount||0)*(Q.amount||0),F.fat_amount+=(Q.fat_amount||0)*(Q.amount||0),F.carbohydrates_amount+=(Q.carbohydrates_amount||0)*(Q.amount||0),F),G)}),$=()=>v.push(`/${D.params.orgId}/`),b=G=>{["a","A","+","-",".",","].includes(G.key)&&G.preventDefault()},x=G=>{n.deleteItemFromCart(G)},V=()=>{N.value=!N.value,k.value.length},L=()=>{var F,Q,j;let G=Math.floor(l.value);G<0||!G?G=0:((F=u.value)==null?void 0:F.balance)>i.value?G>i.value-1&&(G=i.value-1):G>((Q=u.value)==null?void 0:Q.balance)&&(G=(j=u.value)==null?void 0:j.balance),G!==l.value&&n.setBonus(G)};e.watchEffect(()=>{L(),n.setBonus(i.value===0?0:Math.floor(l.value))});const W=()=>d.value.map(G=>({id:G.id,front_item_id:G.idSystem,is_fake:!!G.is_fake,removals:G.removals??null,amount:G.amount,size:G.size,modifiers:G.modifiers??[],group_modifiers:G.group_modifiers??[]})),H=async()=>{_.value=!0;try{return await Ve.create().createOrder(W(),s.configPage.tableDataId,s.configPage.kiosk_menu,k.value,!!s.configPage.userData||!!u.value,s.configPage.is_tableservice)}catch(G){throw s.configPage.kiosk_menu?(G.status===403&&(localStorage.removeItem("apiKey"),n.is_showApiKey=!0,v.push(`/${D.params.orgId}/retryPage`)),o.deleteCart("retryPage",s.configPage.kiosk_menu)):s.configPage.is_tableservice?o.showNotification(G.response.data.user_friendly_message):v.push(`/${D.params.orgId}/errorPayment`),_.value=!1,G}},X=()=>{if(!u.value&&s.configPage.qr_menu){v.push(`/${D.params.orgId}/register`);return}p.value=!1,m.value=1,c.value.has_rms_discount?o.makeInitPaymentLinkRequest(T.value,s.configPage.kiosk_menu,s.configPage.is_tableservice).then(()=>T.value=null):H()},te=async()=>{var Q;S.value=0,_.value=!0;const G={items:[...W()],combos:[]},F=Ve.create();try{I.value=!0;const j=await F.calculateDiscount(G,s.configPage.kiosk_menu,!!s.configPage.userData||!!u.value);if(!d.value)return;if(d.value.forEach(Y=>{const re=j.items.find(ie=>ie.front_item_id===Y.idSystem);if(re&&(Y.group_modifiers.forEach(ie=>{const se=re.group_modifiers.find(fe=>fe.group===ie.group);se&&ie.modifiers.forEach(fe=>{const ke=se.modifiers.find(de=>de.id===fe.id);if(ke&&Number(fe.price)!==Number(ke==null?void 0:ke.new_price)){const de=(ke.discounts||[]).reduce((Oo,Jd)=>Oo+=+Jd.discount,0);B.value+=de,fe.new_price=fe.price,fe.price=Number(ke==null?void 0:ke.new_price),fe.total_new_price=Number(ke.total_new_price)}})}),Y.modifiers.forEach(ie=>{const se=re.modifiers.find(fe=>fe.id===ie.id);if(se&&Number(ie.price)!==Number(se==null?void 0:se.new_price)){const fe=(se.discounts||[]).reduce((ke,de)=>ke+=+de.discount,0);B.value+=fe,ie.new_price=ie.price,ie.price=Number(se==null?void 0:se.new_price),ie.total_new_price=Number(se.total_new_price)}}),Y.price!==Number(re.new_price))){const ie=(re.discounts||[]).reduce((se,fe)=>se+=+fe.discount,0);B.value=B.value+ie,Y.new_price=Y.price,Y.price=re.new_price,Y.discounts=re.discounts,Y.total_new_price=Number(re.total_new_price)}}),d.value=[...d.value],B.value!==0&&(i.value=j.total_cart_price),c.value.has_rms_discount){const Y=await H();T.value=(Q=Y.data)==null?void 0:Q.id}else _.value=!1;M.value=!1}catch(j){console.log("Ошибка скидок [CartPage calculateDiscount]",j),o.showNotification("Скидки временно недоступны"),I.value=!1,M.value=c.value.has_rms_discount,_.value=!1}},ue=()=>{var G;(G=u.value)!=null&&G.balance?u.value.balance>=1&&(R.value=!R.value):o.showNotification("У Вас пока нет бонусов")},oe=()=>{var G,F;c.value.has_rms_discount&&(s.configPage.kiosk_menu||s.configPage.qr_menu&&u.value)?(T.value=null,M.value=!0):((G=c.value)==null?void 0:G.loyalty)==="IIKO"&&(c.value.has_loyalty_default_user||u.value)&&s.configPage.kiosk_menu||((F=c.value)==null?void 0:F.loyalty)==="IIKO"&&s.configPage.qr_menu&&u.value?M.value=!0:M.value=!1};return e.onMounted(async()=>{g.value=s.textPaymentBtn,n.loadCart(),m.value=null,i.value=null,S.value=0,d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive))}),e.onUnmounted(()=>{T.value=null,m.value=null,i.value=null,S.value=0,d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive))}),e.watchEffect(()=>{!c.value.has_rms_discount&&["ОПЛАТИТЬ","СОЗДАТЬ ЗАКАЗ"].includes(g.value.toUpperCase())?_.value=n.cartProducts_lib.length===0||i.value===0:(_.value=!1,m.value=null)}),e.watch([()=>n.cartProducts_lib,u],G=>{if(P.value>0){P.value--;return}G&&!I.value&&(oe(),d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive)),B.value=0,i.value=null,S.value=0,P.value=1),I.value=!1},{deep:!0}),(G,F)=>{var Q,j,Y,re,ie,se,fe,ke;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Gl,[e.createVNode(Wl,{onConfirm:x}),e.createVNode(ko,{visible:e.unref(o).isDrawerOpen,"onUpdate:visible":F[0]||(F[0]=de=>e.unref(o).isDrawerOpen=de)},{default:e.withCtx(()=>[e.createVNode(So)]),_:1},8,["visible"]),e.createElementVNode("header",Kl,[e.createElementVNode("div",Jl,[e.createElementVNode("div",{class:e.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:s.configPage.kiosk_menu}]),onClick:$},[e.createVNode(en,{class:"cart_header_back_button"}),s.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("span",Xl,"Назад")):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Zl,[(e.unref(f).kiosk_show_loyalty_card_button||e.unref(f).kiosk_show_loyalty_phone_input_button)&&!s.config_qr?(e.openBlock(),e.createElementBlock("button",{key:0,class:"buttonDefaultWrapper button_payment_cart button_payment_cart_loyal",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(C)/2+10)}px`,paddingRight:(Q=e.unref(f).cart_loyalty_button)!=null&&Q.cart_loyalty_button_sticker?0:""}),onClick:F[1]||(F[1]=(...de)=>e.unref(o).openDrawer&&e.unref(o).openDrawer(...de))},[e.createElementVNode("p",{class:"cart_loyal_program",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(C)/2)}px`})},e.toDisplayString(((j=e.unref(f).cart_loyalty_button)==null?void 0:j.cart_loyalty_button_text)||"Программа лояльности"),5),(Y=e.unref(f).cart_loyalty_button)!=null&&Y.cart_loyalty_button_sticker?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"stickerLoyality",ref:O,class:"cart_loyal_program_icon",style:e.normalizeStyle({"--sticker-mask":`url(${e.unref(f).cart_loyalty_button.cart_loyalty_button_sticker})`})},[e.createElementVNode("img",{src:e.unref(f).cart_loyalty_button.cart_loyalty_button_sticker},null,8,Yl)],4)):(e.openBlock(),e.createBlock(Ul,{key:1,class:"cart_loyal_qr"}))],4)):e.createCommentVNode("",!0),e.unref(f).show_nutrition_in_cart?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cart_header",style:e.normalizeStyle({paddingTop:s.config_qr?0:"10px"})},[e.createElementVNode("div",Ql,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.energy_amount,duration:800},null,8,["price"]),F[6]||(F[6]=e.createTextVNode(" г",-1))]),F[7]||(F[7]=e.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),e.createElementVNode("div",ec,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.proteins_amount,duration:900},null,8,["price"]),F[8]||(F[8]=e.createTextVNode(" г",-1))]),F[9]||(F[9]=e.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),e.createElementVNode("div",tc,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.fat_amount,duration:1e3},null,8,["price"]),F[10]||(F[10]=e.createTextVNode(" г",-1))]),F[11]||(F[11]=e.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),e.createElementVNode("div",nc,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.carbohydrates_amount,duration:1100},null,8,["price"]),F[12]||(F[12]=e.createTextVNode(" г",-1))]),F[13]||(F[13]=e.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):e.createCommentVNode("",!0)])]),t.config_qr&&e.unref(f).show_order_comment?(e.openBlock(),e.createElementBlock("div",oc,[N.value?(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ac,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:"Ваш комментарий к заказу...",name:"comment",maxlength:"50","onUpdate:modelValue":F[2]||(F[2]=de=>k.value=de)},null,512),[[e.vModelText,k.value]]),e.createElementVNode("p",sc,e.toDisplayString(k.value.length+" / 50"),1)]),e.createVNode(Re,{textButtonDefault:"Сохранить",onClick:V,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),!N.value&&e.unref(d).length>0?(e.openBlock(),e.createBlock(Re,{key:1,textButtonDefault:k.value.length>0?"Редактировать":"Комментарий к заказу",onClick:()=>N.value=!N.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),de=>(e.openBlock(),e.createBlock(Co,{key:de.idSystem,cardItem:de,onDelete:Oo=>x(de.idSystem)},null,8,["cardItem","onDelete"]))),128))]),e.createElementVNode("div",lc,[R.value?(e.openBlock(),e.createElementBlock("p",cc,[F[14]||(F[14]=e.createTextVNode(" Списать ",-1)),e.withDirectives(e.createElementVNode("input",{type:"number",placeholder:"0",style:e.normalizeStyle({maxWidth:`${e.unref(l).toString().length||1}em`}),disabled:e.unref(u)===null||((re=e.unref(u))==null?void 0:re.balance)===0,"onUpdate:modelValue":F[3]||(F[3]=de=>e.isRef(l)?l.value=de:null),onInput:L,min:"0",max:((ie=e.unref(u))==null?void 0:ie.balance)>e.unref(i)?Math.floor(e.unref(i)):(se=e.unref(u))==null?void 0:se.balance,onKeypress:b},null,44,dc),[[e.vModelText,e.unref(l),void 0,{number:!0}]]),F[15]||(F[15]=e.createTextVNode(" бонусов ",-1))])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("p",uc,"У вас есть "+e.toDisplayString(e.unref(u)?e.unref(u).balance:0)+" B",1)):e.createCommentVNode("",!0),R.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"range",class:"footer_range","onUpdate:modelValue":F[4]||(F[4]=de=>e.isRef(l)?l.value=de:null),min:0,max:((fe=e.unref(u))==null?void 0:fe.balance)>e.unref(i)?Math.floor(e.unref(i)-1):(ke=e.unref(u))==null?void 0:ke.balance},null,8,fc)),[[e.vModelText,e.unref(l),void 0,{number:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("ul",mc,[R.value?(e.openBlock(),e.createElementBlock("li",pc,[F[17]||(F[17]=e.createElementVNode("p",null,"Сумма заказа:",-1)),e.createElementVNode("p",null,[e.createVNode(ve,{price:e.unref(i),fixedFloat:2},null,8,["price"]),F[16]||(F[16]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("li",hc,[F[19]||(F[19]=e.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),e.createElementVNode("p",null,[e.createVNode(ve,{price:e.unref(l),fixedFloat:2},null,8,["price"]),F[18]||(F[18]=e.createTextVNode(" Б",-1))])])):e.createCommentVNode("",!0),e.unref(S)!==0?(e.openBlock(),e.createElementBlock("li",_c,[e.createElementVNode("p",gc,e.toDisplayString(e.unref(S)>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",yc,[e.createVNode(ve,{price:Math.abs(e.unref(S)),fixedFloat:2},null,8,["price"]),F[20]||(F[20]=e.createTextVNode(" ₽",-1))])])):B.value!==0?(e.openBlock(),e.createElementBlock("li",bc,[e.createElementVNode("p",wc,e.toDisplayString(B.value>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",kc,[e.createVNode(ve,{price:Math.abs(B.value),fixedFloat:2},null,8,["price"]),F[21]||(F[21]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),e.createElementVNode("li",null,[F[23]||(F[23]=e.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),e.createElementVNode("p",Cc,[e.createVNode(ve,{price:e.unref(i)-e.unref(l),fixedFloat:2},null,8,["price"]),F[22]||(F[22]=e.createTextVNode(" ₽",-1))])])]),e.createElementVNode("div",Sc,[e.unref(u)?(e.openBlock(),e.createBlock(Re,{key:0,textButtonDefault:"Бонусы",onClick:ue,class:"button_bonus_cart"})):e.createCommentVNode("",!0),e.createVNode(Re,{textButtonDefault:M.value?"Рассчитать скидки":e.unref(g),onClick:M.value?te:X,class:"button_payment_cart",disabled:e.unref(_)},null,8,["textButtonDefault","onClick","disabled"])])])]),t.configPage.kiosk_menu?(e.openBlock(),e.createBlock(Ol,{key:0,orderNumber:e.unref(y),pageNumber:1},null,8,["orderNumber"])):e.createCommentVNode("",!0),e.createVNode(nn,{visible:e.unref(w),"onUpdate:visible":F[5]||(F[5]=de=>e.isRef(w)?w.value=de:null),textNotificationDefault:e.unref(h).textNotification,backgroundColor:e.unref(f).accent_color?e.unref(f).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"])],64)}}}),Nc={},xc={viewBox:"0 0 24 24"};function Bc(t,n){return e.openBlock(),e.createElementBlock("svg",xc,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ac=ne(Nc,[["render",Bc]]),vc={class:"retry_screen"},$c={class:"retry_all_in_screen"},Tc={class:"retry_content"},Mc={class:"retry_icon_wrap"},Pc={class:"retry_icon_circle"},Vc={class:"retry_error_x"},Ic=e.defineComponent({__name:"RetryPage",setup(t){const n=Fe(),o=K.useRouter(),r=K.useRoute(),a=ce(),s=()=>{n.notificationData_lib.textNotification="",n.is_notification_lib=!1,a.openApiKey=!0,o.replace(`/${r.params.orgId}/`)};return(i,l)=>(e.openBlock(),e.createElementBlock("section",vc,[e.createElementVNode("div",$c,[e.createElementVNode("main",Tc,[e.createElementVNode("div",Mc,[e.createElementVNode("div",Pc,[l[0]||(l[0]=e.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),e.createElementVNode("div",Vc,[e.createVNode(Ac)])])]),l[1]||(l[1]=e.createElementVNode("div",{class:"retry_oops"},"OOPS",-1)),l[2]||(l[2]=e.createElementVNode("h1",{class:"retry_title"},"Что-то пошло не так",-1)),l[3]||(l[3]=e.createElementVNode("div",{class:"retry_hint"},[e.createElementVNode("p",null,"Похоже, произошёл технический сбой."),e.createElementVNode("p",null,"Мы уже знаем о проблеме и сейчас разбираемся."),e.createElementVNode("p",null,"Приносим извинения за доставленные неудобства."),e.createElementVNode("p",null,"Попробуйте начать новый заказ.")],-1))]),e.createElementVNode("div",{class:"retry_footer"},[e.createElementVNode("button",{onClick:s,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=e.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),Rc={class:"wrapper_loader"},Dc=e.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Rc,[e.createElementVNode("div",{class:"loader",style:e.normalizeStyle({width:t.size})},null,4)]))}}),Oc=ne(e.defineComponent({__name:"AnimationLoader",props:{id:{}},setup(t){const n=e.ref(!0);return e.watch(()=>n.value,()=>{n.value=!1,setTimeout(()=>{n.value=!0},0)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"opacity-animation",key:t.id},[e.renderSlot(o.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-c6b97942"]]),Fc={key:0},Lc={class:"card__main__wrapper"},zc={key:0,class:"folder_content_top"},Uc={key:0,class:"loader_card_main"},jc={key:1,class:"card__main_content"},Hc=["src","alt"],qc={class:"card_title_price_wrapper"},Wc={class:"title"},Gc={key:0,class:"price"},Kc={key:1,class:"card_button_add_wrapper"},No=ne(e.defineComponent({__name:"CardMain",props:{data:{},activeTags:{},is_group:{type:Boolean},parent:{},isLoading:{type:Boolean},selectGroupChild:{type:Function},takeCurrentCard:{type:Function}},setup(t){const n=_e(),o=ce(),r=me(),{itemThemes:a}=U.storeToRefs(n),{is_18_above_content:s,is18Allowed:i,notificationData_lib:l}=U.storeToRefs(o),c=t,d=(_,m)=>{var w,h,p;const y={id:_.id,is_fake:_.is_fake||!1,amount:_.amount||1,name:_.name,image_link:_.image_link,price:_.price,old_price:_.price,size:void 0,sizes:[],modifiers:[],groups:_.groups,group_modifiers:[],energy_amount:_.energy_amount??0,proteins_amount:_.proteins_amount??0,fat_amount:_.fat_amount??0,carbohydrates_amount:_.carbohydrates_amount??0},S=!((w=_.modifiers)!=null&&w.length)&&!((h=_.group_modifiers)!=null&&h.length)&&!((p=_.sizes)!=null&&p.length);if(r.isUpSale=!1,_.adult&&!i.value){s.value=!0,S&&(l.value.fastAdd=y);return}if(S){o.addToCart(y);return}if(_.amount||(_.amount=1),c.is_group&&c.selectGroupChild){c.selectGroupChild({..._,parent:c.parent,child:m.child_groups});return}c.takeCurrentCard&&c.takeCurrentCard(m.id)},u=_=>{if(c.is_group&&c.selectGroupChild){_={..._,parent:c.parent,child:_.child_groups},c.selectGroupChild(_);return}if(_.adult&&!i.value){s.value=!0;return}c.takeCurrentCard&&c.takeCurrentCard(_.id)},f=e.computed(()=>c.activeTags.every(_=>c.data.tags.includes(_))),{mediaUrl:g}=je(()=>c.data.id+"_image",()=>c.data.image_link);return(_,m)=>{var y;return((y=c.activeTags)==null?void 0:y.length)===0||f.value||c.is_group?(e.openBlock(),e.createElementBlock("div",Fc,[e.createVNode(Oc,{id:c.data.id},{opacityLoader:e.withCtx(()=>[e.createElementVNode("div",Lc,[t.is_group?(e.openBlock(),e.createElementBlock("div",zc)):e.createCommentVNode("",!0),e.createElementVNode("div",{onClick:m[0]||(m[0]=S=>u(c.data)),class:e.normalizeClass(["card__main",{card__main_folder:t.is_group}])},[t.isLoading?(e.openBlock(),e.createElementBlock("div",Uc,[e.createVNode(Dc)])):(e.openBlock(),e.createElementBlock("div",jc,[e.createElementVNode("img",{src:e.unref(g)||"",class:e.normalizeClass(["img",{card_blur_image:c.data.adult&&!e.unref(i)}]),loading:"lazy",alt:t.data.name},null,10,Hc),e.createElementVNode("div",qc,[e.createElementVNode("p",Wc,e.toDisplayString(t.data.name),1),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Gc,e.toDisplayString(e.unref(nt)(t.data))+" ₽",1))])]))],2),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Kc,[e.createElementVNode("div",{onClick:m[1]||(m[1]=S=>d(t.data,c.data)),class:"add_button"},[...m[2]||(m[2]=[e.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1},8,["id"])])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-06431027"]]),Jc=["id","onClick"],Xc=ne(e.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(t){const n=e.ref(null);return(o,r)=>t.menuGroup.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:n},[e.createVNode(Yt,{axis:"x",behavior:"smooth",container:n.value,autoScroll:!0,idActive:t.idActiveGroup,clearContainer:!0},{default:e.withCtx(({handleTargetClick:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuGroup,(s,i)=>(e.openBlock(),e.createElementBlock("li",{key:s.id,id:"scrolling"+s.id,onClick:l=>{t.activeTakeGroup&&t.activeTakeGroup(s.id,i),a(l)},style:e.normalizeStyle(t.idActiveGroup==s.id?{fontFamily:"Bounded"}:{})},e.toDisplayString(s.name),13,Jc))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),Zc=["id","onClick"],Yc=ne(e.defineComponent({__name:"TagsMain",props:{menuTags:{default:()=>[]},groupIndex:{default:null},isSolo:{type:Boolean,default:!1},currentActiveTag:{},activeTakeTags:{type:Function,default:void 0},activeTakeTagsSolo:{type:Function,default:void 0}},setup(t){const n=t,o=e.ref(null),r=e.computed(()=>{if(n.isSolo&&!n.groupIndex)return Array.isArray(n.currentActiveTag)?n.currentActiveTag:[];if(n.groupIndex!==null&&n.groupIndex!==void 0){const a=n.currentActiveTag[n.groupIndex];return Array.isArray(a)?a:[]}return[]});return(a,s)=>t.menuTags.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:o},[e.createVNode(Yt,{axis:"x",behavior:"smooth",container:o.value,autoScroll:!0,idActive:r.value?r.value[t.currentActiveTag.length-1]:null,clearContainer:!1},{default:e.withCtx(({handleTargetClick:i})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuTags,(l,c)=>(e.openBlock(),e.createElementBlock("li",{key:c,id:`scrolling${l}`,onClick:d=>{t.activeTakeTags&&(t.groupIndex||t.groupIndex===0)?t.activeTakeTags(l,t.groupIndex):t.activeTakeTagsSolo&&t.activeTakeTagsSolo(l),i(d)},class:e.normalizeClass({main__filter_active:(r.value??[]).includes(l)})},e.toDisplayString(l),11,Zc))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-818940a4"]]),Qc=["data-id"],ed=["src"],td=["src"],nd=ne(e.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(t){const n=t,{mediaUrl:o}=je(()=>{var r,a;return(r=n.group)!=null&&r.video_link?`${n.group.id}_video`:(a=n.group)!=null&&a.image_link?`${n.group.id}_image`:null});return(r,a)=>t.group?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["drum_item",{active:n.active}]),"data-id":t.group.id},[t.group.video_link?(e.openBlock(),e.createElementBlock("video",{key:e.unref(o),loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},[e.createElementVNode("source",{src:e.unref(o)||"",type:"video/webm"},null,8,ed)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"drum_img",src:e.unref(o)||""},null,8,td)),e.createElementVNode("p",null,e.toDisplayString(t.group.name),1)],10,Qc)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-b948bda1"]]),od={},rd={width:"9.998535",height:"10.000000",viewBox:"0 0 9.99854 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function ad(t,n){return e.openBlock(),e.createElementBlock("svg",rd,[...n[0]||(n[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("path",{id:"Форма 5",d:"M4.23 10L5.76 10L5.76 5.74L9.99 5.74L9.99 4.25L5.76 4.25L5.76 0L4.23 0L4.23 4.25L0 4.25L0 5.74L4.23 5.74L4.23 10Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const sd=ne(od,[["render",ad]]),id={class:"recommendation_wrapper"},ld={class:"recommendation_header"},cd={class:"recommendation_info"},dd=ne(e.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(t){const n=me(),{isUpSale:o,dataUpSale:r}=U.storeToRefs(n),a=()=>{o.value=!1};return e.onUnmounted(()=>{r.value=null}),(s,i)=>(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",ld,[i[0]||(i[0]=e.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),e.createElementVNode("div",{class:"header_close",onClick:a},[e.createVNode(sd,{class:"close_icon"})])]),e.createElementVNode("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),l=>(e.openBlock(),e.createBlock(No,{data:l,key:l.id,parent:l.id,is_group:!1,is_product:!0,class:"card",activeTags:[],isLoading:!1,closeCurrentCard:t.closeCurrentCard,takeCurrentCard:()=>t.openCurrentCard(l.id,!0)},null,8,["data","parent","closeCurrentCard","takeCurrentCard"]))),128))])]))}}),[["__scopeId","data-v-d545ec45"]]),ud=e.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(t){const n=t;return e.watch(()=>n.data,o=>{document.body.style.overflow=o?"hidden":""}),()=>{}}}),fd={class:"wrapper_modal"},md={class:"card_modal"},pd=ne(e.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(t){const n=t,o=me(),{isUpSale:r}=U.storeToRefs(o),a=()=>{r.value=!1};return(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ud,{data:n.visible},null,8,["data"]),e.createElementVNode("div",{class:"black_modal",onClick:a}),e.createElementVNode("div",fd,[e.createElementVNode("div",md,[e.renderSlot(s.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]),an=U.defineStore("modulesLib",()=>{const t=e.ref(!1),n=e.ref({textNotification:""});return{is_notification_lib:t,notificationData_lib:n}}),Bt=Symbol("clickOutside"),hd={mounted(t,n){t[Bt]=o=>{t.contains(o.target)||n.value(o)},document.addEventListener("click",t[Bt])},unmounted(t){t[Bt]&&document.removeEventListener("click",t[Bt])}};class _d{constructor(n){ee(this,"value");ee(this,"next");this.value=n}}class gd{constructor(){$t(this,we);$t(this,De);$t(this,qe);this.clear()}enqueue(n){const o=new _d(n);Ne(this,we)?(Ne(this,De).next=o,Me(this,De,o)):(Me(this,we,o),Me(this,De,o)),dn(this,qe)._++}dequeue(){const n=Ne(this,we);if(n)return Me(this,we,Ne(this,we).next),dn(this,qe)._--,Ne(this,we)||Me(this,De,void 0),n.value}peek(){if(Ne(this,we))return Ne(this,we).value}clear(){Me(this,we,void 0),Me(this,De,void 0),Me(this,qe,0)}get size(){return Ne(this,qe)}*[Symbol.iterator](){let n=Ne(this,we);for(;n;)yield n.value,n=n.next}*drain(){for(;Ne(this,we);)yield this.dequeue()}}we=new WeakMap,De=new WeakMap,qe=new WeakMap;function yd(t){xo(t);const n=new gd;let o=0;const r=()=>{o<t&&n.size>0&&(o++,n.dequeue()())},a=()=>{o--,r()},s=async(c,d,u)=>{const f=(async()=>c(...u))();d(f);try{await f}catch{}a()},i=(c,d,u)=>{new Promise(f=>{n.enqueue(f)}).then(s.bind(void 0,c,d,u)),o<t&&r()},l=(c,...d)=>new Promise(u=>{i(c,u,d)});return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>n.size},clearQueue:{value(){n.clear()}},concurrency:{get:()=>t,set(c){xo(c),t=c,queueMicrotask(()=>{for(;o<t&&n.size>0;)r()})}},map:{async value(c,d){const u=Array.from(c,(f,g)=>this(d,f,g));return Promise.all(u)}}}),l}function xo(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let be=null;const Bo=yd(5),bd=async(t,n)=>{be&&Sd();const o=ce(),r=an(),a=me(),{displayCards:s}=U.storeToRefs(o),{is_notification_lib:i,notificationData_lib:l}=U.storeToRefs(r),{stateCard:c,openProduct:d}=U.storeToRefs(a),u=Ve.create();await wd(t),be=ht(`wss://${n}/ws/org-unit/${t}/`),be.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",t,")")),be.on("error",f=>console.warn("WebSocket ошибка:",f)),be.on("close",()=>console.warn("Realtime WebSocket закрыт")),be.on("message",async f=>{if(f.type)return;l.value.textNotification="Мы обновили меню";const g=f.params||f,_=g.active_groups||[],m=g.updated_groups||[],y=g.updated_product_groups||[],S=await Oe(),w=new Set(_.map(k=>k)),h=new Map(s.value.map(k=>[k.id,k])),p=[],v=S.transaction("groups","readwrite");let O=await v.objectStore("groups").openCursor();for(;O;){const k=O.key;!w.has(k)&&k!==t&&(p.push(k),await O.delete(),h.delete(k)),O=await O.continue()}await v.done,s.value=Array.from(h.values()),p.length>0&&await kd(w);const R=[...m.map(k=>Bo(async()=>{const[N,B]=await Promise.all([u.getGroupByID(k),u.loadGroupProducts(k)]);N.products=B,h.set(k,N),await Qe(k,N),await vo(N,B,!0)})),...y.map(k=>Bo(async()=>{const[N,B]=await Promise.all([u.getGroupByID(k),u.loadGroupProducts(k)]);N.products=B,h.set(k,N),await Qe(k,N),await vo(N,B,!0),await Cd(B,k)}))];await Promise.all(R),s.value=Array.from(h.values()),await rr(t,s),i.value=!0;const M=c.value.openCard;if(M!=null&&M.id){const k=new Set(M.groups??[]),N=new Set;let B=!1;for(const P of h.values()){const T=P==null?void 0:P.products;if(!Array.isArray(T))continue;const C=T.find(A=>(A==null?void 0:A.id)===M.id);if((C==null?void 0:C.adult)===!0){d.value={id:null,visible:!1},a.reset();return}C&&(P==null?void 0:P.id)!=null&&(N.add(P.id),(m.includes(P.id)||y.includes(P.id))&&(B=!0))}if(N.size===0){d.value={id:null,visible:!1},a.reset();return}(!(k.size===N.size&&[...k].every(P=>N.has(P)))||B)&&await u.getSingleProduct(M==null?void 0:M.id)}}),be.connect()},wd=async t=>{try{const n=ce(),o=await Ot(t);o!=null&&o.data&&(n.displayCards=o.data)}catch(n){console.error("Ошибка загрузки кэша групп:",n)}},Ao=async t=>{const n=ce(),o=an(),r=me(),{stateCard:a,openProduct:s}=U.storeToRefs(r),{cartProducts_lib:i}=U.storeToRefs(n),l=i.value,c=[],d=[],u=a.value.openCard;for(const f of l)t(f)?(c.push(f),(f.id===(u==null?void 0:u.id)||u!=null&&u.adult)&&(s.value={id:null,visible:!1})):d.push(f);if(c.length>0){const f=c.map(g=>g.name).slice(0,3).join(", ");o.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${f}${c.length>3?` и ещё ${c.length-3}`:""}`,i.value=d,n.updateCartInLocalStorage()}},kd=async t=>{await Ao(n=>{var o;return(o=n.groups)!=null&&o.length?!n.groups.some(r=>t.has(r)):!0})},Cd=async(t,n)=>{const o=ce(),r=new Set(t.filter(a=>!a.adult||o.is18Allowed).map(a=>a.id));await Ao(a=>{var s;return(s=a.groups)!=null&&s.includes(n)?!r.has(a.id):!1})},vo=async(t,n,o=!0)=>{if(t.video_link&&At(t.video_link,`${t.id}_video`,o),t.image_link&&At(t.image_link,`${t.id}_image`,o),n!=null&&n.length)for(const r of n)r.video_link&&At(r.video_link,`${r.id}_video`,o),r.image_link&&At(r.image_link,`${r.id}_image`,o)},At=async(t,n,o=!1)=>{try{const r=tt();if(!o){const i=await Ge(n);if(i){r.updateCacheFromBlob(n,i),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:i}}));return}}const a=await fetch(t);if(!a.ok)throw new Error("Network error");const s=await a.blob();if(s.size===0)throw new Error("Empty blob");await Ft(n,s),r.updateCacheFromBlob(n,s),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:s}}))}catch(r){console.warn(`[MediaCache] Failed for ${n}:`,r)}},Sd=()=>{be&&(be.off("open"),be.off("message"),be.off("error"),be.off("close"),be.close(!0),be=null)},Ed={class:"button_price_bg"},Nd={class:"wrapper_container_price_bg"},xd={class:"button_price"},Bd={key:0,class:"image_product_container"},Ad=["src"],vd=e.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(t){const n=ce(),o=tt(),{totalPrice_lib:r,cartProducts_lib:a}=U.storeToRefs(n);o.initCacheSingle("defaultImage");const s=e.computed(()=>o.cache.defaultImage||""),i=c=>{const d=`${c}_image`;return o.initCacheSingle(d),o.cache[d]||s.value},l=e.computed(()=>{var c;return(c=a.value)!=null&&c.length,a.value.slice(0,3).map(d=>({id:d.id,url:i(d.id)}))});return(c,d)=>(e.openBlock(),e.createElementBlock("div",Ed,[e.createElementVNode("div",Nd,[e.createElementVNode("div",xd,[e.unref(r)>0&&l.value.length>0?(e.openBlock(),e.createElementBlock("div",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"filter_image_product"},[e.createElementVNode("img",{src:u.url,class:"img_product"},null,8,Ad)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"button_default_main",onClick:d[0]||(d[0]=u=>c.$emit("goToCart"))},[d[2]||(d[2]=e.createElementVNode("div",{class:"icont_cart"},null,-1)),e.createElementVNode("p",null,[e.createVNode(ve,{price:e.unref(r),fixedFloat:2},null,8,["price"]),d[1]||(d[1]=e.createTextVNode(" ₽",-1))])])])])]))}}),ct=null,{min:He,max:$e,abs:$o,floor:$d}=Math,To=(t,n,o)=>He(o,$e(n,t)),Mo=t=>[...t].sort((n,o)=>n-o),Td=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)},sn=()=>{let t;return[new Promise(n=>{t=n}),t]},Po=t=>{let n;return()=>(t&&(n=t(),t=void 0),n)},dt=(t,n,o)=>{const r=o?"unshift":"push";for(let a=0;a<n;a++)t[r](-1);return t},Vo=(t,n)=>{const o=t.t[n];return o===-1?t.o:o},Md=(t,n,o)=>{const r=t.t[n]===-1;return t.t[n]=o,t.i=He(n,t.i),r},vt=(t,n)=>{if(!t.l)return 0;if(t.i>=n)return t.u[n];t.i<0&&(t.u[0]=0,t.i=0);let o=t.i,r=t.u[o];for(;o<n;)r+=Vo(t,o),t.u[++o]=r;return t.i=n,r},Ye=(t,n,o=0,r=t.l-1)=>{let a=o;for(;o<=r;){const s=$d((o+r)/2);vt(t,s)<=n?(a=s,o=s+1):r=s-1}return To(a,0,t.l-1)},Io=(t,n,o)=>{const r=n-t.l;return t.i=o?-1:He(n-1,t.i),t.l=n,r>0?(dt(t.u,r),dt(t.t,r,o),t.o*r):(t.u.splice(r),(o?t.t.splice(0,-r):t.t.splice(r)).reduce((a,s)=>a-(s===-1?t.o:s),0))},Pd=t=>t.documentElement,Vd=t=>t.ownerDocument,Id=t=>t.defaultView,Ro=Po(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),Rd=Po(()=>"scrollBehavior"in Pd(document).style),Dd=(t,n=40,o=0,r,a=!1)=>{let s=!!o,i=1,l=0,c=0,d=0,u=0,f=0,g=0,_=0,m=0,y=ct,S=[0,s?$e(o-1,0):-1],w=0,h=!1;const p=((P,T,C)=>({o:T,t:C?dt(C.slice(0,He(P,C.length)),$e(0,P-C.length)):dt([],P),l:P,i:-1,u:dt([],P+1)}))(t,r?r[1]:n,r&&r[0]),v=new Set,D=()=>d-c,O=()=>D()+f+u,R=(P,T)=>((C,A,$,b)=>{if(b=He(b,C.l-1),vt(C,b)<=A){const x=Ye(C,$,b);return[Ye(C,A,b,x),x]}{const x=Ye(C,A,void 0,b);return[x,Ye(C,$,x)]}})(p,P,T,S[0]),M=()=>vt(p,p.l),k=(P,T)=>{const C=vt(p,P)-f;return T?M()-C-N(P):C},N=P=>Vo(p,P),B=(P,T=-1)=>p.t[P]===T,I=P=>{P&&(Ro()&&_!==0||y&&m===1?f+=P:u+=P)};return{p:()=>{v.clear()},h:()=>i,m:()=>(P=>[P.t.slice(),P.o])(p),v:(P=200)=>{if(!h||s)return S;let T,C;if(g)[T,C]=S;else{let A=$e(0,O()),$=A+l;a||(P=$e(0,P),_!==1&&(A-=P),_!==2&&($+=P)),[T,C]=S=R($e(0,A),$e(0,$)),y&&(T=He(T,y[0]),C=$e(C,y[1]))}return[$e(T,0),He(C,p.l-1)]},S:P=>Ye(p,P-c),I:B,O:k,k:N,j:()=>p.l,N:()=>d,B:()=>_!==0,T:()=>l,q:()=>c,M,P:()=>(g=u,u=0,[g,m===2]),R:(P,T)=>{const C=[P,T];return v.add(C),()=>{v.delete(C)}},A:(P,T)=>{let C,A,$=0;switch(P){case 1:{if(T===d&&m===0)break;const b=g;g=0;const x=T-d,V=$o(x);b&&V<$o(b)+1||m!==0||(_=x<0?2:1),s&&(s=!1),d=T,$=4;const L=D();L>=-l&&L<=M()&&($+=1,A=V>l);break}case 2:$=8,_!==0&&(C=!0,$+=1),_=0,m=0,y=ct;break;case 3:{const b=T.filter(([x,V])=>!B(x,V));if(!b.length)break;I(b.reduce((x,[V,L])=>((m===2||(y&&m===1?V<y[0]:k(V+(_===0&&m===0?1:0))<D()))&&(x+=L-N(V)),x),0));for(const[x,V]of b){const L=N(x),W=Md(p,x,V);a&&(w+=W?V:V-L)}a&&l&&w>l&&(I(((x,V)=>{let L=0;const W=[];x.t.forEach((G,F)=>{G!==-1&&(W.push(G),F<V&&L++)}),x.i=-1;const H=Mo(W),X=H.length,te=X/2|0,ue=X%2==0?(H[te-1]+H[te])/2:H[te],oe=x.o;return((x.o=ue)-oe)*$e(V-L,0)})(p,Ye(p,O()))),a=!1),$=3,A=!0;break}case 4:l!==T&&(l||(h=A=!0),l=T,$=3);break;case 5:T[1]?(I(Io(p,T[0],!0)),m=2,$=1):(Io(p,T[0]),$=1);break;case 6:c=T;break;case 7:m=1;break;case 8:y=R(T,T+l),$=1}$&&(i=1+(2147483647&i),C&&f&&(u+=f,f=0),v.forEach(([b,x])=>{$&b&&x(A)}))}}},ln=setTimeout,cn=(t,n)=>n?-t:t,Od=(t,n,o,r,a,s)=>{const i=Date.now;let l=0,c=!1,d=!1,u=!1,f=!1;const g=(()=>{let w;const h=()=>{w!=ct&&clearTimeout(w)},p=()=>{h(),w=ln(()=>{w=ct,(()=>{if(c||d)return c=!1,void g();u=!1,t.A(2)})()},150)};return p.C=h,p})(),_=()=>{l=i(),u&&(f=!0),t.A(1,r()),g()},m=w=>{if(c||!t.B()||w.ctrlKey)return;const h=i()-l;150>h&&50<h&&(o?w.deltaX:w.deltaY)&&(c=!0)},y=()=>{d=!0,u=f=!1},S=()=>{d=!1,Ro()&&(u=!0)};return n.addEventListener("scroll",_),n.addEventListener("wheel",m,{passive:!0}),n.addEventListener("touchstart",y,{passive:!0}),n.addEventListener("touchend",S,{passive:!0}),{H:()=>{n.removeEventListener("scroll",_),n.removeEventListener("wheel",m),n.removeEventListener("touchstart",y),n.removeEventListener("touchend",S),g.C()},V:()=>{const[w,h]=t.P();w&&(a(w,h,f),f=!1,h&&t.T()>t.M()&&t.A(1,r()))}}},Fd=(t,n,o)=>{let r;return[async(a,s)=>{if(!await n())return;r&&r();const i=()=>{const[l,c]=sn();return r=()=>{c(!1)},t.T()&&ln(r,150),[l,t.R(2,()=>{c(!0)})]};if(s&&Rd())t.A(8,a()),Td(async()=>{for(;;){let l=!0;for(let[u,f]=t.v();u<=f;u++)if(t.I(u)){l=!1;break}if(l)break;const[c,d]=i();try{if(!await c)return}finally{d()}}t.A(7),o(a(),s)});else for(;;){const[l,c]=i();try{if(t.A(7),o(a()),!await l)return}finally{c()}}},()=>{r&&r()}]},Ld=t=>{let n;return{F(o){(n||(n=new(Id(Vd(o))).ResizeObserver(t))).observe(o)},J(o){n.unobserve(o)},H(){n&&n.disconnect()}}},zd=e.defineComponent({props:{L:{type:Object,required:!0},W:{type:Object,required:!0},X:{type:Object,required:!0},Y:{type:Function,required:!0},D:{type:Number,required:!0},U:{type:Boolean},G:{type:Boolean},K:{type:Boolean},Z:{type:String,required:!0},ee:Object},setup(t){const n=e.ref(),o=e.computed(()=>t.L.value&&t.W.O(t.D,t.K)),r=e.computed(()=>t.L.value&&t.W.I(t.D));return e.watch(()=>n.value&&t.D,(a,s,i)=>{i(t.Y(n.value,t.D))},{flush:"post"}),()=>{var a;const{X:s,U:i,G:l,Z:c}=t,d=r.value,{style:u,...f}=(a=t.ee)!==null&&a!==void 0?a:{},g={contain:"layout style",position:d&&l?void 0:"absolute",[i?"height":"width"]:"100%",[i?"top":"left"]:"0px",[i?"left":"top"]:o.value+"px",visibility:!d||l?void 0:"hidden",...u};return i&&(g.display="inline-flex"),e.createVNode(c,e.mergeProps({ref:n,style:g},f),typeof(_=s)=="function"||Object.prototype.toString.call(_)==="[object Object]"&&!e.isVNode(_)?s:{default:()=>[s],_:2},16,["style"]);var _}}}),Ud=(t,n)=>{const o=t.key;return o??"_"+n},jd=(t,n)=>t[0]===n[0]&&t[1]===n[1],Do=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,startMargin:{type:Number,default:0},ssrCount:Number,scrollRef:Object,as:{type:String,default:"div"},item:{type:String,default:"div"},itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(t,{emit:n,expose:o,slots:r}){let a=!!t.ssrCount;const s=t.horizontal,i=e.ref(),l=Dd(t.data.length,t.itemSize,t.ssrCount,t.cache,!t.itemSize),c=((m,y)=>{let S;const w=y?"width":"height",h=new WeakMap,p=Ld(v=>{const D=[];for(const{target:O,contentRect:R}of v)if(O.offsetParent)if(O===S)m.A(4,R[w]);else{const M=h.get(O);M!=ct&&D.push([M,R[w]])}D.length&&m.A(3,D)});return{te(v){p.F(S=v)},re:(v,D)=>(h.set(v,D),p.F(v),()=>{h.delete(v),p.J(v)}),p:p.H}})(l,s),d=((m,y)=>{let S,w,h=sn(),p=!1;const v=y?"scrollLeft":"scrollTop",D=y?"overflowX":"overflowY",[O,R]=Fd(m,()=>h[0],(M,k)=>{M=cn(M,p),k?S.scrollTo({[y?"left":"top"]:M,behavior:"smooth"}):S[v]=M});return{oe(M){S=M,y&&(p=getComputedStyle(M).direction==="rtl"),w=Od(m,M,y,()=>cn(M[v],p),(k,N,B)=>{if(B){const I=M.style,P=I[D];I[D]="hidden",ln(()=>{I[D]=P})}M[v]=cn(m.N()+k,p),N&&R()}),h[1](!0)},p(){w&&w.H(),h[1](!1),h=sn()},ne:()=>p,se(M){O(()=>M)},ie(M){M+=m.N(),O(()=>M)},le(M,{align:k,smooth:N,offset:B=0}={}){if(M=To(M,0,m.j()-1),k==="nearest"){const I=m.O(M),P=m.N();if(I<P)k="start";else{if(!(I+m.k(M)>P+m.T()))return;k="end"}}O(()=>B+m.q()+m.O(M)+(k==="end"?m.k(M)-m.T():k==="center"?(m.k(M)-m.T())/2:0),N)},ce:()=>{w&&w.V()}}})(l,s),u=e.ref(l.h());l.R(1,()=>{u.value=l.h()}),l.R(4,()=>{n("scroll",l.N())}),l.R(8,()=>{n("scrollEnd")});const f=e.computed(m=>{u.value;const y=l.v(t.bufferSize);return m&&jd(m,y)?m:y}),g=e.computed(()=>u.value&&l.B()),_=e.computed(()=>u.value&&l.M());return e.onMounted(()=>{a=!1;const m=requestAnimationFrame(()=>{const y=S=>{c.te(S),d.oe(S)};t.scrollRef?y(t.scrollRef):y(i.value.parentElement)});e.onUnmounted(()=>{cancelAnimationFrame(m)})}),e.onUnmounted(()=>{l.p(),c.p(),d.p()}),e.watch(()=>t.data.length,m=>{l.A(5,[m,t.shift])}),e.watch(()=>t.startMargin,m=>{l.A(6,m)},{immediate:!0}),e.watch([u],()=>{d.ce()},{flush:"post"}),o({get cache(){return l.m()},get scrollOffset(){return l.N()},get scrollSize(){return(m=>$e(m.M(),m.T()))(l)},get viewportSize(){return l.T()},findItemIndex:l.S,getItemOffset:l.O,getItemSize:l.k,scrollToIndex:d.le,scrollTo:d.se,scrollBy:d.ie}),()=>{const m=t.as,y=t.item,S=_.value,w=d.ne(),h=!s&&w?"unshift":"push",p=[],v=O=>{var R;const M=r.default({item:t.data[O],index:O})[0];return e.createVNode(zd,{key:Ud(M,O),L:u,W:l,Y:c.re,D:O,X:M,U:s,K:w,G:a,Z:y,ee:(R=t.itemProps)===null||R===void 0?void 0:R.call(t,{item:t.data[O],index:O})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(t.keepMounted){const O=new Set(t.keepMounted);for(let[R,M]=f.value;R<=M;R++)O.add(R);Mo([...O]).forEach(R=>{p[h](v(R))})}else for(let[O,R]=f.value;O<=R;O++)p[h](v(O));return e.createVNode(m,{ref:i,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:s?S+"px":"100%",height:s?"100%":S+"px",pointerEvents:g.value?"none":void 0}},typeof(D=p)=="function"||Object.prototype.toString.call(D)==="[object Object]"&&!e.isVNode(D)?p:{default:()=>[p],_:2},8,["style"]);var D}}}),Hd=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,ssrCount:Number,itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(t,{emit:n,expose:o,slots:r}){const a=t.horizontal,s=c=>{n("scroll",c)},i=()=>{n("scrollEnd")},l=e.ref();return o({get cache(){return l.value.cache},get scrollOffset(){return l.value.scrollOffset},get scrollSize(){return l.value.scrollSize},get viewportSize(){return l.value.viewportSize},findItemIndex:(...c)=>l.value.findItemIndex(...c),getItemOffset:(...c)=>l.value.getItemOffset(...c),getItemSize:(...c)=>l.value.getItemSize(...c),scrollToIndex:(...c)=>l.value.scrollToIndex(...c),scrollTo:(...c)=>l.value.scrollTo(...c),scrollBy:(...c)=>l.value.scrollBy(...c)}),()=>{return e.createVNode("div",{style:{display:a?"inline-block":"block",[a?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%"}},[e.createVNode(Do,{ref:l,data:t.data,bufferSize:t.bufferSize,itemSize:t.itemSize,itemProps:t.itemProps,shift:t.shift,ssrCount:t.ssrCount,horizontal:a,keepMounted:t.keepMounted,cache:t.cache,onScroll:s,onScrollEnd:i},(c=r,typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!e.isVNode(c)?r:{default:()=>[r],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var c}}}),qd=(t,n=10)=>new Promise(o=>{let r=0,a=0,s=0;const i=()=>{const l=t.scrollSize;l===s&&l>0?r++:(r=0)&&(s=l),a++,r>=2||a>=n?o():requestAnimationFrame(i)};requestAnimationFrame(i)});function Wd(t,n){const o=(n==null?void 0:n.align)??"start";let r=!1;const a=e.ref(null),s=e.ref(!1),i=e.ref("measure"),l=e.computed(()=>e.toValue(t).length),c=e.computed(()=>i.value==="measure"?1:5),d=e.computed(()=>Array.from({length:l.value*c.value},(S,w)=>w)),u=async()=>{if(a.value&&(i.value="measure",r=!1,s.value=!1,await e.nextTick(),i.value==="measure")){if(await qd(a.value),s.value=a.value.scrollSize>a.value.viewportSize,!s.value){r=!1;return}r=!0,i.value="loop",await e.nextTick(),a.value.scrollToIndex(l.value*3,{align:o})}},f=S=>i.value==="measure"?S:l.value===0?0:S%l.value,g=(S,w)=>{a.value&&a.value.scrollToIndex(S,w)},_=(S,w)=>!r||i.value!=="loop"?w:w+Math.round((S-w)/l.value)*l.value,m=S=>{if(!r||i.value!=="loop"||!a.value)return;const w=l.value-1,h=l.value*4;if(S<w)return g(l.value*3-1,{align:"start"});if(S>=h)return g(l.value*3,{align:"start"})},y=()=>{if(!a.value||!r)return;const S=a.value.findItemIndex(a.value.scrollOffset);m(S)};return e.onMounted(u),e.onUnmounted(()=>a.value=null),e.watch(l,()=>e.nextTick(u)),{listRef:a,items:d,hasScroll:s,realIndex:f,findNearestIndex:_,scrollToIndex:g,init:u,onScroll:y}}const Gd={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},Kd=t=>{var o;const n=Object.assign({},Gd,t);if(n.pinch&&(document.addEventListener("touchstart",r=>r.touches.length>1&&r.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",r=>r.preventDefault(),{passive:!1})),n.doubleTap){let r=0;document.addEventListener("touchend",a=>{const s=Date.now();s-r<=250&&a.preventDefault(),r=s},{passive:!1})}n.wheel&&document.addEventListener("wheel",r=>(r.ctrlKey||r.metaKey)&&r.preventDefault(),{passive:!1}),(o=n.buttons)!=null&&o.length&&document.addEventListener("keydown",r=>(r.ctrlKey||r.metaKey)&&n.buttons.includes(r.key)&&r.preventDefault())};Object.defineProperty(z,"useRoute",{enumerable:!0,get:()=>K.useRoute}),Object.defineProperty(z,"useRouter",{enumerable:!0,get:()=>K.useRouter}),z.BasketButton=vd,z.BottomSheet=wo,z.ButtonDefault=Re,z.CardMain=No,z.CardProductPage=Oi,z.CardReader=So,z.CartBox=Co,z.CartPage=Ec,z.DrumItem=nd,z.GroupMain=Xc,z.InitConnection=Ve,z.ModalWindows=pd,z.NotificationWindow=nn,z.PopupWindowDefault=ko,z.Recommendation=dd,z.RetryPage=Ic,z.TagsMain=Yc,z.VList=Hd,z.Virtualizer=Do,z.clearAllProductDB=sr,z.clearLocalStorage=Ke,z.getCachedGroup=Ot,z.getCachedProduct=yn,z.getWebSocketInstance=ht,z.initPinia=Uo,z.initRouter=Ho,z.preventZoom=Kd,z.updateIndexedDB=bd,z.useCachedMedia=je,z.useCardLibStore=me,z.useCartLibStore=Fe,z.useImageCacheStore=tt,z.useMainLibStore=ce,z.useModal=Eo,z.useModalStore=rn,z.useModulesLibStore=an,z.useThemeStore=_e,z.useVirtuaLoop=Wd,z.vClickOutside=hd,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
1
+ (function(H,Q){typeof exports=="object"&&typeof module<"u"?Q(exports,require("vue-router"),require("pinia"),require("vue"),require("@vueuse/core"),require("motion-v")):typeof define=="function"&&define.amd?define(["exports","vue-router","pinia","vue","@vueuse/core","motion-v"],Q):(H=typeof globalThis<"u"?globalThis:H||self,Q(H.InnoCloudsLib={},H.VueRouter,H.Pinia,H.Vue,H.VueuseCore,H.motionV))})(this,function(H,Q,q,e,ve,_e){"use strict";var mf=Object.defineProperty;var mr=H=>{throw TypeError(H)};var hf=(H,Q,q)=>Q in H?mf(H,Q,{enumerable:!0,configurable:!0,writable:!0,value:q}):H[Q]=q;var X=(H,Q,q)=>hf(H,typeof Q!="symbol"?Q+"":Q,q),hr=(H,Q,q)=>Q.has(H)||mr("Cannot "+q);var Me=(H,Q,q)=>(hr(H,Q,"read from private field"),q?q.call(H):Q.get(H)),Wt=(H,Q,q)=>Q.has(H)?mr("Cannot add the same private member more than once"):Q instanceof WeakSet?Q.add(H):Q.set(H,q),Le=(H,Q,q,e)=>(hr(H,Q,"write to private field"),e?e.call(H,q):Q.set(H,q),q);var xn=(H,Q,q,e)=>({set _(ve){Le(H,Q,ve,q)},get _(){return Me(H,Q,e)}});var Be,je,et;function _r(n){return n}const yr=[];function br(){return Q.createRouter({history:Q.createWebHistory(),routes:yr})}const Gt=(n,t)=>t.some(o=>n instanceof o);let vn,Tn;function wr(){return vn||(vn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function kr(){return Tn||(Tn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Kt=new WeakMap,Jt=new WeakMap,St=new WeakMap;function Cr(n){const t=new Promise((o,r)=>{const s=()=>{n.removeEventListener("success",a),n.removeEventListener("error",i)},a=()=>{o(Ue(n.result)),s()},i=()=>{r(n.error),s()};n.addEventListener("success",a),n.addEventListener("error",i)});return St.set(t,n),t}function Sr(n){if(Kt.has(n))return;const t=new Promise((o,r)=>{const s=()=>{n.removeEventListener("complete",a),n.removeEventListener("error",i),n.removeEventListener("abort",i)},a=()=>{o(),s()},i=()=>{r(n.error||new DOMException("AbortError","AbortError")),s()};n.addEventListener("complete",a),n.addEventListener("error",i),n.addEventListener("abort",i)});Kt.set(n,t)}let Xt={get(n,t,o){if(n instanceof IDBTransaction){if(t==="done")return Kt.get(n);if(t==="store")return o.objectStoreNames[1]?void 0:o.objectStore(o.objectStoreNames[0])}return Ue(n[t])},set(n,t,o){return n[t]=o,!0},has(n,t){return n instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in n}};function $n(n){Xt=n(Xt)}function Er(n){return kr().includes(n)?function(...t){return n.apply(Yt(this),t),Ue(this.request)}:function(...t){return Ue(n.apply(Yt(this),t))}}function Br(n){return typeof n=="function"?Er(n):(n instanceof IDBTransaction&&Sr(n),Gt(n,wr())?new Proxy(n,Xt):n)}function Ue(n){if(n instanceof IDBRequest)return Cr(n);if(Jt.has(n))return Jt.get(n);const t=Br(n);return t!==n&&(Jt.set(n,t),St.set(t,n)),t}const Yt=n=>St.get(n);function Nr(n,t,{blocked:o,upgrade:r,blocking:s,terminated:a}={}){const i=indexedDB.open(n,t),l=Ue(i);return r&&i.addEventListener("upgradeneeded",c=>{r(Ue(i.result),c.oldVersion,c.newVersion,Ue(i.transaction),c)}),o&&i.addEventListener("blocked",c=>o(c.oldVersion,c.newVersion,c)),l.then(c=>{a&&c.addEventListener("close",()=>a()),s&&c.addEventListener("versionchange",d=>s(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}function xr(n,{blocked:t}={}){const o=indexedDB.deleteDatabase(n);return t&&o.addEventListener("blocked",r=>t(r.oldVersion,r)),Ue(o).then(()=>{})}const vr=["get","getKey","getAll","getAllKeys","count"],Tr=["put","add","delete","clear"],Zt=new Map;function An(n,t){if(!(n instanceof IDBDatabase&&!(t in n)&&typeof t=="string"))return;if(Zt.get(t))return Zt.get(t);const o=t.replace(/FromIndex$/,""),r=t!==o,s=Tr.includes(o);if(!(o in(r?IDBIndex:IDBObjectStore).prototype)||!(s||vr.includes(o)))return;const a=async function(i,...l){const c=this.transaction(i,s?"readwrite":"readonly");let d=c.store;return r&&(d=d.index(l.shift())),(await Promise.all([d[o](...l),s&&c.done]))[0]};return Zt.set(t,a),a}$n(n=>({...n,get:(t,o,r)=>An(t,o)||n.get(t,o,r),has:(t,o)=>!!An(t,o)||n.has(t,o)}));const $r=["continue","continuePrimaryKey","advance"],Mn={},Qt=new WeakMap,Pn=new WeakMap,Ar={get(n,t){if(!$r.includes(t))return n[t];let o=Mn[t];return o||(o=Mn[t]=function(...r){Qt.set(this,Pn.get(this)[t](...r))}),o}};async function*Mr(...n){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...n)),!t)return;t=t;const o=new Proxy(t,Ar);for(Pn.set(o,t),St.set(o,Yt(t));t;)yield o,t=await(Qt.get(o)||t.continue()),Qt.delete(o)}function In(n,t){return t===Symbol.asyncIterator&&Gt(n,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Gt(n,[IDBIndex,IDBObjectStore])}$n(n=>({...n,get(t,o,r){return In(t,o)?Mr:n.get(t,o,r)},has(t,o){return In(t,o)||n.has(t,o)}}));let tt;async function We(){return tt||(tt=Nr("data",1,{upgrade(n){n.objectStoreNames.contains("groups")||n.createObjectStore("groups",{keyPath:"id"}),n.objectStoreNames.contains("media")||n.createObjectStore("media",{keyPath:"id"}),n.objectStoreNames.contains("products")||n.createObjectStore("products",{keyPath:"id"})}})),tt}async function en(n){return(await We()).transaction("groups","readonly").objectStore("groups").get(n)}async function lt(n,t){const r=(await We()).transaction("groups","readwrite");await r.objectStore("groups").put({id:n,data:t,timestamp:Date.now()}),await r.done}async function Pr(n,t){const o=JSON.parse(JSON.stringify(e.toRaw(t.value)));await lt(n,o)}async function tn(n,t){const r=(await We()).transaction("media","readwrite");await r.objectStore("media").put({id:n,blob:t,timestamp:Date.now()}),await r.done}async function nt(n){const s=await(await We()).transaction("media","readonly").objectStore("media").get(n);return s==null?void 0:s.blob}async function Ir(n){const o=(await We()).transaction("products","readwrite"),r=o.objectStore("products"),s=n.id;await r.put({id:s,product:n,timestamp:Date.now()}),await o.done}async function Vn(n){const s=await(await We()).transaction("products","readonly").objectStore("products").get(n);return s==null?void 0:s.product}async function Vr(){if(tt){const n=await tt.catch(()=>null);n&&n.close(),tt=void 0}try{await xr("data",{blocked(){console.warn("Удаление заблокировано. открыты другие вкладки с сайтом.")}})}catch(n){console.error("Не удалось удалить базу: [lib, indexedDB]",n)}}function Et(n){"@babel/helpers - typeof";return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(n)}var Rr=/^\s+/,Dr=/\s+$/;function K(n,t){if(n=n||"",t=t||{},n instanceof K)return n;if(!(this instanceof K))return new K(n,t);var o=Or(n);this._originalInput=n,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||o.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}K.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),o,r,s,a,i,l;return o=t.r/255,r=t.g/255,s=t.b/255,o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*a+.7152*i+.0722*l},setAlpha:function(t){return this._a=zn(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Dn(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Dn(this._r,this._g,this._b),o=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.v*100);return this._a==1?"hsv("+o+", "+r+"%, "+s+"%)":"hsva("+o+", "+r+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var t=Rn(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Rn(this._r,this._g,this._b),o=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.l*100);return this._a==1?"hsl("+o+", "+r+"%, "+s+"%)":"hsla("+o+", "+r+"%, "+s+"%, "+this._roundA+")"},toHex:function(t){return On(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return Ur(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ue(this._r,255)*100)+"%",g:Math.round(ue(this._g,255)*100)+"%",b:Math.round(ue(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ue(this._r,255)*100)+"%, "+Math.round(ue(this._g,255)*100)+"%, "+Math.round(ue(this._b,255)*100)+"%)":"rgba("+Math.round(ue(this._r,255)*100)+"%, "+Math.round(ue(this._g,255)*100)+"%, "+Math.round(ue(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:es[On(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var o="#"+Ln(this._r,this._g,this._b,this._a),r=o,s=this._gradientType?"GradientType = 1, ":"";if(t){var a=K(t);r="#"+Ln(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+o+",endColorstr="+r+")"},toString:function(t){var o=!!t;t=t||this._format;var r=!1,s=this._a<1&&this._a>=0,a=!o&&s&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return K(this.toString())},_applyModification:function(t,o){var r=t.apply(null,[this].concat([].slice.call(o)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(Wr,arguments)},brighten:function(){return this._applyModification(Gr,arguments)},darken:function(){return this._applyModification(Kr,arguments)},desaturate:function(){return this._applyModification(Hr,arguments)},saturate:function(){return this._applyModification(jr,arguments)},greyscale:function(){return this._applyModification(qr,arguments)},spin:function(){return this._applyModification(Jr,arguments)},_applyCombination:function(t,o){return t.apply(null,[this].concat([].slice.call(o)))},analogous:function(){return this._applyCombination(Zr,arguments)},complement:function(){return this._applyCombination(Xr,arguments)},monochromatic:function(){return this._applyCombination(Qr,arguments)},splitcomplement:function(){return this._applyCombination(Yr,arguments)},triad:function(){return this._applyCombination(Fn,[3])},tetrad:function(){return this._applyCombination(Fn,[4])}},K.fromRatio=function(n,t){if(Et(n)=="object"){var o={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?o[r]=n[r]:o[r]=ct(n[r]));n=o}return K(n,t)};function Or(n){var t={r:0,g:0,b:0},o=1,r=null,s=null,a=null,i=!1,l=!1;return typeof n=="string"&&(n=rs(n)),Et(n)=="object"&&(Fe(n.r)&&Fe(n.g)&&Fe(n.b)?(t=Lr(n.r,n.g,n.b),i=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Fe(n.h)&&Fe(n.s)&&Fe(n.v)?(r=ct(n.s),s=ct(n.v),t=zr(n.h,r,s),i=!0,l="hsv"):Fe(n.h)&&Fe(n.s)&&Fe(n.l)&&(r=ct(n.s),a=ct(n.l),t=Fr(n.h,r,a),i=!0,l="hsl"),n.hasOwnProperty("a")&&(o=n.a)),o=zn(o),{ok:i,format:n.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:o}}function Lr(n,t,o){return{r:ue(n,255)*255,g:ue(t,255)*255,b:ue(o,255)*255}}function Rn(n,t,o){n=ue(n,255),t=ue(t,255),o=ue(o,255);var r=Math.max(n,t,o),s=Math.min(n,t,o),a,i,l=(r+s)/2;if(r==s)a=i=0;else{var c=r-s;switch(i=l>.5?c/(2-r-s):c/(r+s),r){case n:a=(t-o)/c+(t<o?6:0);break;case t:a=(o-n)/c+2;break;case o:a=(n-t)/c+4;break}a/=6}return{h:a,s:i,l}}function Fr(n,t,o){var r,s,a;n=ue(n,360),t=ue(t,100),o=ue(o,100);function i(d,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(t===0)r=s=a=o;else{var l=o<.5?o*(1+t):o+t-o*t,c=2*o-l;r=i(c,l,n+1/3),s=i(c,l,n),a=i(c,l,n-1/3)}return{r:r*255,g:s*255,b:a*255}}function Dn(n,t,o){n=ue(n,255),t=ue(t,255),o=ue(o,255);var r=Math.max(n,t,o),s=Math.min(n,t,o),a,i,l=r,c=r-s;if(i=r===0?0:c/r,r==s)a=0;else{switch(r){case n:a=(t-o)/c+(t<o?6:0);break;case t:a=(o-n)/c+2;break;case o:a=(n-t)/c+4;break}a/=6}return{h:a,s:i,v:l}}function zr(n,t,o){n=ue(n,360)*6,t=ue(t,100),o=ue(o,100);var r=Math.floor(n),s=n-r,a=o*(1-t),i=o*(1-s*t),l=o*(1-(1-s)*t),c=r%6,d=[o,i,a,a,l,o][c],u=[l,o,o,i,a,a][c],f=[a,a,l,o,o,i][c];return{r:d*255,g:u*255,b:f*255}}function On(n,t,o,r){var s=[Pe(Math.round(n).toString(16)),Pe(Math.round(t).toString(16)),Pe(Math.round(o).toString(16))];return r&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function Ur(n,t,o,r,s){var a=[Pe(Math.round(n).toString(16)),Pe(Math.round(t).toString(16)),Pe(Math.round(o).toString(16)),Pe(Un(r))];return s&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function Ln(n,t,o,r){var s=[Pe(Un(r)),Pe(Math.round(n).toString(16)),Pe(Math.round(t).toString(16)),Pe(Math.round(o).toString(16))];return s.join("")}K.equals=function(n,t){return!n||!t?!1:K(n).toRgbString()==K(t).toRgbString()},K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Hr(n,t){t=t===0?0:t||10;var o=K(n).toHsl();return o.s-=t/100,o.s=Bt(o.s),K(o)}function jr(n,t){t=t===0?0:t||10;var o=K(n).toHsl();return o.s+=t/100,o.s=Bt(o.s),K(o)}function qr(n){return K(n).desaturate(100)}function Wr(n,t){t=t===0?0:t||10;var o=K(n).toHsl();return o.l+=t/100,o.l=Bt(o.l),K(o)}function Gr(n,t){t=t===0?0:t||10;var o=K(n).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(255*-(t/100)))),o.g=Math.max(0,Math.min(255,o.g-Math.round(255*-(t/100)))),o.b=Math.max(0,Math.min(255,o.b-Math.round(255*-(t/100)))),K(o)}function Kr(n,t){t=t===0?0:t||10;var o=K(n).toHsl();return o.l-=t/100,o.l=Bt(o.l),K(o)}function Jr(n,t){var o=K(n).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,K(o)}function Xr(n){var t=K(n).toHsl();return t.h=(t.h+180)%360,K(t)}function Fn(n,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=K(n).toHsl(),r=[K(n)],s=360/t,a=1;a<t;a++)r.push(K({h:(o.h+a*s)%360,s:o.s,l:o.l}));return r}function Yr(n){var t=K(n).toHsl(),o=t.h;return[K(n),K({h:(o+72)%360,s:t.s,l:t.l}),K({h:(o+216)%360,s:t.s,l:t.l})]}function Zr(n,t,o){t=t||6,o=o||30;var r=K(n).toHsl(),s=360/o,a=[K(n)];for(r.h=(r.h-(s*t>>1)+720)%360;--t;)r.h=(r.h+s)%360,a.push(K(r));return a}function Qr(n,t){t=t||6;for(var o=K(n).toHsv(),r=o.h,s=o.s,a=o.v,i=[],l=1/t;t--;)i.push(K({h:r,s,v:a})),a=(a+l)%1;return i}K.mix=function(n,t,o){o=o===0?0:o||50;var r=K(n).toRgb(),s=K(t).toRgb(),a=o/100,i={r:(s.r-r.r)*a+r.r,g:(s.g-r.g)*a+r.g,b:(s.b-r.b)*a+r.b,a:(s.a-r.a)*a+r.a};return K(i)},K.readability=function(n,t){var o=K(n),r=K(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},K.isReadable=function(n,t,o){var r=K.readability(n,t),s,a;switch(a=!1,s=ss(o),s.level+s.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a},K.mostReadable=function(n,t,o){var r=null,s=0,a,i,l,c;o=o||{},i=o.includeFallbackColors,l=o.level,c=o.size;for(var d=0;d<t.length;d++)a=K.readability(n,t[d]),a>s&&(s=a,r=K(t[d]));return K.isReadable(n,r,{level:l,size:c})||!i?r:(o.includeFallbackColors=!1,K.mostReadable(n,["#fff","#000"],o))};var nn=K.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},es=K.hexNames=ts(nn);function ts(n){var t={};for(var o in n)n.hasOwnProperty(o)&&(t[n[o]]=o);return t}function zn(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function ue(n,t){ns(n)&&(n="100%");var o=os(n);return n=Math.min(t,Math.max(0,parseFloat(n))),o&&(n=parseInt(n*t,10)/100),Math.abs(n-t)<1e-6?1:n%t/parseFloat(t)}function Bt(n){return Math.min(1,Math.max(0,n))}function Te(n){return parseInt(n,16)}function ns(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function os(n){return typeof n=="string"&&n.indexOf("%")!=-1}function Pe(n){return n.length==1?"0"+n:""+n}function ct(n){return n<=1&&(n=n*100+"%"),n}function Un(n){return Math.round(parseFloat(n)*255).toString(16)}function Hn(n){return Te(n)/255}var Ie=function(){var n="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",o="(?:"+t+")|(?:"+n+")",r="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?",s="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?";return{CSS_UNIT:new RegExp(o),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Fe(n){return!!Ie.CSS_UNIT.exec(n)}function rs(n){n=n.replace(Rr,"").replace(Dr,"").toLowerCase();var t=!1;if(nn[n])n=nn[n],t=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var o;return(o=Ie.rgb.exec(n))?{r:o[1],g:o[2],b:o[3]}:(o=Ie.rgba.exec(n))?{r:o[1],g:o[2],b:o[3],a:o[4]}:(o=Ie.hsl.exec(n))?{h:o[1],s:o[2],l:o[3]}:(o=Ie.hsla.exec(n))?{h:o[1],s:o[2],l:o[3],a:o[4]}:(o=Ie.hsv.exec(n))?{h:o[1],s:o[2],v:o[3]}:(o=Ie.hsva.exec(n))?{h:o[1],s:o[2],v:o[3],a:o[4]}:(o=Ie.hex8.exec(n))?{r:Te(o[1]),g:Te(o[2]),b:Te(o[3]),a:Hn(o[4]),format:t?"name":"hex8"}:(o=Ie.hex6.exec(n))?{r:Te(o[1]),g:Te(o[2]),b:Te(o[3]),format:t?"name":"hex"}:(o=Ie.hex4.exec(n))?{r:Te(o[1]+""+o[1]),g:Te(o[2]+""+o[2]),b:Te(o[3]+""+o[3]),a:Hn(o[4]+""+o[4]),format:t?"name":"hex8"}:(o=Ie.hex3.exec(n))?{r:Te(o[1]+""+o[1]),g:Te(o[2]+""+o[2]),b:Te(o[3]+""+o[3]),format:t?"name":"hex"}:!1}function ss(n){var t,o;return n=n||{level:"AA",size:"small"},t=(n.level||"AA").toUpperCase(),o=(n.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),o!=="small"&&o!=="large"&&(o="small"),{level:t,size:o}}const dt=q.defineStore("imageCache",()=>{const n=e.ref({});let t=!1;function o(c,d){const u=String(c);n.value[u]&&URL.revokeObjectURL(n.value[u]);const f=URL.createObjectURL(d);n.value[u]=f}async function r(c){if(!c){console.warn("initCacheSingle called with null/undefined id");return}const d=String(c);if(n.value[d])return;const u=await nt(d);u&&(await scheduler.yield(),o(d,u),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:d,blob:u}})))}function s(c){const{id:d,blob:u}=c.detail;d&&u&&o(d,u)}function a(){typeof window>"u"||t||(window.addEventListener("image-cached",s),t=!0)}function i(){typeof window>"u"||!t||(window.removeEventListener("image-cached",s),t=!1)}function l(){Object.values(n.value).forEach(URL.revokeObjectURL),n.value={}}return typeof window<"u"&&a(),{cache:n,initCacheSingle:r,updateCacheFromBlob:o,cleanup:l,setupEventListener:a,removeEventListener:i}}),we=q.defineStore("themeLib",()=>{const n=dt(),{initCacheSingle:t}=n,o=e.ref({id:"",created_at:null,logo:null,primary_color:null,accent_color:null,accent_light_color:null,accent_dark_color:null,bg_button_color:null,inactive_button_color:null,cards_color:null,text_color:null,nonworking_bg_color:null,splash_image_url:null,splash_video:null,splash_duration:0,splash_type:null,fallback_image:null,adult_disclaimer_text:null,adult_disclaimer_image:null,kiosk_banner:null,kiosk_preloader:null,organization:"",gradientStyle:null,kiosk_inactivity_timeout:null,kiosk_show_loyalty_card_button:null,kiosk_show_loyalty_phone_input_button:null,cart_loyalty_button:{cart_loyalty_button_sticker:null,cart_loyalty_button_text:null},show_order_comment:null,show_nutrition_in_cart:null,apply_custom_size_picker_fonts:null,size_picker_unselected_font_size:null,size_picker_selected_font_size:null}),r=async a=>{if(!a)return;o.value={...a};const i=await nt("banner"),l=await nt("preloader"),c=await nt("defaultImage");i||s(a.kiosk_banner,"banner"),l||s(a.kiosk_preloader,"preloader"),c||s(a.fallback_image,"defaultImage"),document.documentElement.style.setProperty("--primaryColor",a.primary_color),document.documentElement.style.setProperty("--accentColor",a.accent_color),document.documentElement.style.setProperty("--accentLightColor",a.accent_light_color),document.documentElement.style.setProperty("--accentDarkColor",a.accent_dark_color),document.documentElement.style.setProperty("--bgButtonColor",a.bg_button_color),document.documentElement.style.setProperty("--inactiveButtonColor",a.inactive_button_color),document.documentElement.style.setProperty("--cardsColor",a.cards_color),document.documentElement.style.setProperty("--textColor",a.text_color),document.documentElement.style.setProperty("--nonworkingBgColor",a.nonworking_bg_color),a.apply_custom_size_picker_fonts&&a.size_picker_unselected_font_size&&a.size_picker_unselected_font_size>0&&document.documentElement.style.setProperty("--sizePickerUnselectedFontSize",`${a.size_picker_unselected_font_size}rem`),a.apply_custom_size_picker_fonts&&a.size_picker_selected_font_size&&a.size_picker_selected_font_size>0&&document.documentElement.style.setProperty("--sizePickerSelectedFontSize",`${a.size_picker_selected_font_size}rem`);const d=o.value.primary_color||"#F2F7FF",u=K(d).setAlpha(.7).toRgbString(),f=`linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`,y=`-webkit-linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`;return o.value.gradientStyle={background:f,backgroundColor:y},o.value},s=async(a,i)=>{if(a){const l=await fetch(a);if(!l.ok)throw new Error("Network error");const c=await l.blob();tn(i,c),t(i)}};return{itemThemes:o,updateColor:r}}),ut=n=>{if(!n)return 0;if((n.price===0||n.price===null)&&n.sizes&&n.sizes.length>0){const t=n.sizes.find(o=>o.is_default===!0);return t?t.price:n.sizes.length>1&&n.sizes[1].price||n.sizes[0].price}return n.price};class ft extends Error{}ft.prototype.name="InvalidTokenError";function as(n){return decodeURIComponent(atob(n).replace(/(.)/g,(t,o)=>{let r=o.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function is(n){let t=n.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return as(t)}catch{return atob(t)}}function jn(n,t){if(typeof n!="string")throw new ft("Invalid token specified: must be a string");t||(t={});const o=t.header===!0?0:1,r=n.split(".")[o];if(typeof r!="string")throw new ft(`Invalid token specified: missing part #${o+1}`);let s;try{s=is(r)}catch(a){throw new ft(`Invalid token specified: invalid base64 for part #${o+1} (${a.message})`)}try{return JSON.parse(s)}catch(a){throw new ft(`Invalid token specified: invalid json for part #${o+1} (${a.message})`)}}const ls=(n,t)=>{if(typeof window<"u"){const o=localStorage.getItem(n);return o?JSON.parse(o):t}return t},cs=(n,t)=>{if(typeof window<"u"){const o=localStorage.getItem(n);if(o)try{return jn(JSON.parse(o))}catch(r){return console.error("Failed to decode JWT:",r),t}}return t},qn=(n,t,o="normal")=>{const r=e.ref(o==="jwt"?cs(n,t):ls(n,t));return e.watchEffect(()=>{r.value===null||r.value===void 0?localStorage.removeItem(n):o!=="jwt"&&localStorage.setItem(n,JSON.stringify(r.value))}),r},ot=n=>{n.forEach(t=>{try{localStorage.removeItem(t)}catch(o){console.error(`Ошибка при удалении ключа "${t}":`,o)}})};class ds{constructor(t,o={}){X(this,"url");X(this,"options");X(this,"ws");X(this,"reconnectInterval");X(this,"listeners");X(this,"isConnected");X(this,"heartbeat");X(this,"pingTimeout");X(this,"pingResponseTimeout");X(this,"signal");X(this,"_shouldReconnect",!0);this.url=t,this.options=o,this.ws=null,this.reconnectInterval=5e3,this.pingResponseTimeout=5e3,this.listeners=new Map,this.isConnected=e.ref(!1)}connect(){var o,r;if(this.ws&&this.ws.readyState===WebSocket.OPEN){console.warn("WebSocket already open");return}if(!this._shouldReconnect){console.warn("Reconnection disabled");return}const t=`${this.url}`;this.ws=new WebSocket(t),(o=this.options.signal)!=null&&o.aborted&&this.ws.close(),(r=this.options.signal)==null||r.addEventListener("abort",()=>this.close()),this.ws.onopen=()=>{console.warn("WebSocket connected"),this.isConnected.value=!0,this.emit("open"),this.heartbeat=setInterval(()=>this.sendPing(),3e5)},this.ws.onmessage=s=>{try{const a=JSON.parse(s.data);this.emit("message",a),a!=null&&a.type&&a.type!=="ping"&&clearTimeout(this.pingTimeout)}catch(a){console.error("Error parsing WebSocket message:",a)}},this.ws.onerror=s=>{console.error("WebSocket error:",s),this.emit("error",s),this.close(!0)},this.ws.onclose=()=>{this.isConnected.value=!1,console.warn("WebSocket closed"),this.emit("close"),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this._shouldReconnect&&(console.log(`Reconnecting in ${this.reconnectInterval}ms...`),setTimeout(()=>this.connect(),this.reconnectInterval))}}sendPing(){var t;this.isConnected.value&&((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify({type:"ping"})),this.pingTimeout=setTimeout(()=>{console.warn("No pong received, reconnecting..."),this.close(!0),this.connect()},this.pingResponseTimeout)):console.warn("WebSocket not connected, cannot send ping")}send(t){var o;this.isConnected.value&&((o=this.ws)==null?void 0:o.readyState)===WebSocket.OPEN?this.ws.send(JSON.stringify(t)):console.warn("WebSocket not connected")}close(t=!1){this.ws&&(this._shouldReconnect=!t,this.ws.close(),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this.ws=null,this.listeners.clear())}on(t,o){this.listeners.has(t)||this.listeners.set(t,[]),this.listeners.get(t).push(o)}off(t,o){const r=this.listeners.get(t);r&&this.listeners.set(t,r.filter(s=>s!==o))}emit(t,o=null){const r=this.listeners.get(t);r&&r.forEach(s=>s(o))}getConnectionStatus(){return this.isConnected}}let Nt=new Map;function xt(n,t={}){var r;if(Nt.has(n)){const s=Nt.get(n);if(s.isConnected.value&&((r=s.ws)==null?void 0:r.readyState)===WebSocket.OPEN)return s;s.close(!0),Nt.delete(n)}const o=new ds(n,t);return Nt.set(n,o),o}const fe=q.defineStore("mainLib",()=>{const n=e.ref(),t=e.ref(!1),o=e.ref(localStorage.getItem("kiosk_timeout")),r=e.ref(0),s=e.ref(!1),a=e.ref(sessionStorage.getItem("is_adult")==="true"),i=e.ref([]),l=e.ref([]),c=e.ref(),d=e.ref(""),u=e.ref(0),f=e.ref(!1),y=e.ref(!1),_=e.ref(!0),m=e.ref(localStorage.getItem("apiKey")===null),b=e.ref(!1),B=e.ref({textNotification:""}),E=e.ref([]);let h=null;const g=k=>{const x=`wss://${c.value.area}/ws/device/${k}/`;h=xt(x);function V(){console.log("WebSocket connection opened")}function L(W){if(W.error)b.value=!0,B.value.textNotification=W.error,h==null||h.close(!0);else{if(!(W!=null&&W.params))return;typeof W.params.components.shift.is_ok!==null?_.value=W.params.components.shift.is_ok:_.value=!0}}function G(W){console.error("WebSocket error:",W),h.close(!0)}h.on("open",V),h.on("message",L),h.on("error",G),h.connect()},P=k=>{r.value=k,localStorage.setItem("kiosk_timeout",k)},O=k=>{t.value=k},F=e.ref(null),D=e.computed(()=>i.value.reduce((k,x)=>{let V=0,L=0;return x.group_modifiers&&(V=x.group_modifiers.reduce((G,W)=>W.modifiers?G+W.modifiers.reduce((Z,se)=>Z+se.old_price*se.amount,0):0,0)*x.amount),x.modifiers&&(L=x.modifiers.reduce((G,W)=>G+W.old_price*W.amount,0)*x.amount),k+x.old_price*x.amount+V+L},0)),R=e.computed({get:()=>i.value.length===0?0:F.value&&F.value!==0?F.value:i.value.reduce((k,x)=>{const V=ut(x)*x.amount;let L=0,G=0;return x.group_modifiers&&(L=x.group_modifiers.reduce((W,Z)=>Z.modifiers?W+Z.modifiers.reduce((se,ce)=>se+ce.price*ce.amount,0):0,0)*x.amount),x.modifiers&&(G=x.modifiers.reduce((W,Z)=>W+Z.price*Z.amount,0)*x.amount),k+V+L+G},0),set(k){F.value=k}}),S=k=>{u.value=k,localStorage.removeItem("bonus"),qn("bonus",u.value)},p=k=>{ot(k)},w=k=>{k={...k,idSystem:crypto.randomUUID()};const x=$(k);i.value.push(x),N()},N=()=>{try{if(!i.value||i.value.length===0){localStorage.removeItem("cart");return}localStorage.setItem("cart",JSON.stringify(e.toRaw(i.value)))}catch(k){console.error("Failed to update cart in localStorage:",k)}},$=k=>e.reactive({...k,amount:k.amount??1,price:k.old_price,new_price:null,total_new_price:null,discounts:[],modifiers:(k.modifiers||[]).map(x=>e.reactive({...x,price:x.old_price,new_price:null,total_new_price:null})),group_modifiers:(k.group_modifiers||[]).map(x=>e.reactive({...x,modifiers:(x.modifiers||[]).map(V=>e.reactive({...V,price:V.old_price,new_price:null,total_new_price:null}))}))}),A=k=>{const x=i.value.find(V=>V.idSystem===k);x&&(x.amount+=1),N()},C=k=>{const x=i.value.find(V=>V.idSystem===k);x&&(x.amount>=1&&(x.amount-=1),N())},T=()=>{try{const k=localStorage.getItem("cart");if(k){const x=JSON.parse(k);i.value.splice(0,i.value.length,...x.map($)),F.value=null}}catch(k){console.error("Failed to load cart from localStorage:",k)}};return T(),{cartProducts_lib:i,activeScrolling_lib:l,config_lib:c,totalPrice_lib:R,initialCartPrice_lib:D,is_notification_lib:b,notificationData_lib:B,xApiKey_lib:d,countBonus:u,toggleDrum:t,is_showApiKey:m,openApiKey:f,kiosk_timeout:o,kiosk_FirstTimeout:r,is_OpenLoyal:y,profile:n,is_18_above_content:s,is18Allowed:a,healthState:_,displayCards:E,removeFromLocalStorage:p,setKioskTimeout:P,setBonus:S,setStateDrum:O,addToCart:w,plusAmount:A,minusAmount:C,loadCart:T,deleteItemFromCart:k=>{if(k){const x=i.value.findIndex(V=>V.idSystem===k);if(x===-1)return;i.value.splice(x,1),N(),F.value=null}else i.value=[],N()},updateCartInLocalStorage:N,makeProductFullyReactive:$,checkHeartbeatApp:g}}),Ge=q.defineStore("cartLib",()=>{const n=Q.useRouter(),t=Q.useRoute(),o=we(),r=fe(),{config_lib:s,countBonus:a,totalPrice_lib:i,initialCartPrice_lib:l,is18Allowed:c}=q.storeToRefs(r),{itemThemes:d}=q.storeToRefs(o),u=e.ref(!1),f=e.ref(""),y=e.ref(null),_=e.ref("wait"),m=e.ref(0),b=e.ref(null),B=e.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry"]),E=e.ref("Оплатить"),h=e.ref(null),g=e.ref(!1),P=e.ref(null),O=e.ref(0),F=e.ref(!1),D=e.ref({textNotification:""});let R=null;const S=V=>{F.value=!0,D.value.textNotification=V},p=async(V,L,G=!1)=>{if(!V)return console.warn("makeInitPaymentLinkRequest","orderId is empry");try{const Z=await ze.create().initPaymentLink(V,L);x(null,L),G?(R==null||R.close(!0),k(),x("profile",L)):L||window.location.replace(Z.url)}catch(W){P.value=null,r.loadCart(),W.response.data.user_friendly_message?(S(W.response.data.user_friendly_message),R==null||R.close(!0),L&&B.value.includes(W.response.status)?x("retryPage",L):G?(k(),x("",L)):(a.value=0,L||n.push(`/${t.params.orgId}/errorPayment`))):G?k():L||(a.value=0,n.push(`/${t.params.orgId}/errorPayment`))}},w=(V,L,G=!1,W)=>{R&&(R.off("open",se),R.off("message",ce),R.off("error",M),R.close(!0));const Z=`wss://${s.value.area}/ws/order/${V}/`;R=xt(Z,{signal:W});function se(){console.log("WebSocket connection opened")}function ce(J){if(J!=null&&J.params)if(h.value=J,J.error)S(J.error),P.value=null,R==null||R.close(!0);else if(J.params.status==="sent"){if(s.value.has_rms_discount)return J.params.new_discounts&&(m.value=Number(J.params.new_total_cost)-l.value,i.value=Number(J.params.new_total_cost),S("К заказу были добавлены скидки")),g.value=!1;p(V,L,G)}else J.params.status==="payment_initiation_retry"||J.params.status==="fiscalized"?(P.value=2,ze.create().orderPay(V).then(Y=>{b.value=Y.data.order_number}).catch(Y=>{Y.response.data.user_friendly_message&&(S(Y.response.data.user_friendly_message),R.close(!0),L?B.value.includes(Y.response.status)&&(x("retryPage",L),P.value=null):(a.value=0,n.push(`/${t.params.orgId}/errorPayment`),P.value=null))}).finally(()=>{g.value=!1})):J.params.status==="paid"?(P.value=3,R.close(!0),localStorage.removeItem("cart")):B.value.includes(J.params.status)&&(L?(x("retryPage",L),P.value=null):G?(k(),S("Ошибка создания заказа. Пожалуйста попробуйте еще раз")):(a.value=0,n.push(`/${t.params.orgId}/errorPayment`),P.value=null))}function M(J){console.error("WebSocket error:",J),R.close(!0),g.value=!1,P.value=null}R.on("open",se),R.on("message",ce),R.on("error",M),R.connect()},N=e.computed(()=>!!y.value),$=V=>{_.value=V},A=V=>y.value=V,C=()=>{d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?u.value=!0:!d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?r.is_OpenLoyal=!0:u.value=!0,_.value="wait",f.value=""},T=()=>{u.value=!1,_.value="wait",f.value=""},I=()=>{y.value=null,f.value="",_.value="wait",T()},k=()=>{a.value=0,g.value=!1,P.value=null},x=(V=null,L=!1)=>{r.cartProducts_lib=[],ot(["cart"]),L&&(ot(["authTokensAccess","authTokensRefresh","user"]),r.profile=null,sessionStorage.removeItem("is_adult"),c.value=!1),V&&n.push(`/${t.params.orgId}/${V}`)};return{statusWSCreate:h,isButtonDisabled:g,orderCompleted_lib:P,extraDiscount:m,orderNumber:b,is_notification_lib:F,notificationData_lib:D,textPaymentBtn_lib:E,count:O,guestInfo:y,error:f,isDrawerOpen:u,currentState:_,isAuthorized:N,orderSocket:w,deleteCart:x,setGuestInfo:A,setState:$,openDrawer:C,closeDrawer:T,clearCard:I,makeInitPaymentLinkRequest:p,showNotification:S}}),me=q.defineStore("cardLib",()=>{const n=()=>({openCard:null,currentModifier:null,groupModifiers:[],groupModifiersSelected:[],groupCurrentOpen:null,isModifiedAmount:!1,selectedSize:{},productSizes:[],addedProducts:[],plusButtonsRefs:[],modalCount:1,isSectionModifier:!1,isAnimationFly:!0,textErrorRequaired:""}),t=e.ref(n()),o=()=>t.value=n(),r=e.ref(!1),s=e.ref(!1),a=e.ref(!1),i=e.ref(),l=e.ref([]),c=e.ref({id:null,visible:!1}),d=e.ref(!0),u=e.computed(()=>{const S=t.value.groupModifiersSelected.findIndex(p=>p.group===t.value.groupCurrentOpen.id);return f(S)}),f=S=>S===-1?0:(t.value.groupModifiersSelected[S].modifiers||[]).reduce((w,N)=>w+(N.amount||0),0),y=e.computed(()=>{var p;const S=(p=t.value.openCard)==null?void 0:p.group_modifiers.findIndex(w=>w.id===t.value.groupCurrentOpen.id);return S===-1||!t.value.openCard?0:t.value.openCard.modifiers.length>0&&S===0?t.value.openCard.modifiers.reduce((w,N)=>w+N.max_amount,0):t.value.groupModifiers[S].max_amount}),_=e.computed(()=>{var p;const S=(t.value.addedProducts??[]).reduce((w,N)=>w+N.price,0);if(t.value.openCard){const w=t.value.openCard,N=ut(w)||0,$=w.amount||1;return(t.value.groupModifiersSelected.reduce((C,T)=>(T.modifiers.forEach(I=>{var k,x;I.sizes&&(I.price=((x=(k=I.sizes)==null?void 0:k.find(V=>V.id===t.value.selectedSize.id))==null?void 0:x.price)??I.price),C+=I.price*I.amount}),C),0)+N)*$+S}return(p=t.value.addedProducts)!=null&&p.length?S:0}),m=e.computed(()=>{const S=t.value.groupModifiers,p=t.value.groupModifiersSelected;for(let w=0;w<S.length;w++){const N=S[w],$=p[w];if(N.min_amount>0&&f(w)<N.min_amount)return t.value.textErrorRequaired=`В группе "${N.name}" должно содержаться не меньше ${N.min_amount} модификатора(ов)`,{haveRequaire:!0,group:N};for(const A of N.group_modifiers)if(A.min_amount>0){const C=$.modifiers.find(T=>T.id===A.id);if(!C||C.amount<A.min_amount)return t.value.textErrorRequaired=`В группе "${N.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:N}}}return{haveRequaire:!1,group:S[0]}}),b=()=>{t.value.groupModifiers.forEach((S,p)=>{t.value.groupCurrentOpen={...S,index:p},S.group_modifiers.forEach(w=>{w.default_amount>0&&(w.amount=w.default_amount,D(w,!0))})})},B=S=>{t.value.addedProducts.push(S)},E=S=>{t.value.openCard=S},h=S=>{l.value=[...S]},g=(S,p)=>{var N,$;const w=S.id!==((N=t.value.groupCurrentOpen)==null?void 0:N.id);t.value.groupCurrentOpen={...S,index:p},w?t.value.isSectionModifier=!0:t.value.isSectionModifier=!t.value.isSectionModifier,document.body.style.overflow=t.value.isSectionModifier?"hidden":"",($=t.value.plusButtonsRefs[p])==null||$.scrollIntoView({behavior:"smooth",block:"start"})},P=()=>{t.value.modalCount>t.value.currentModifier.min_amount&&t.value.modalCount>=2&&(t.value.modalCount-=1)},O=()=>{t.value.groupCurrentOpen&&t.value.modalCount+u.value<y.value&&(t.value.currentModifier.max_amount===0||t.value.currentModifier.max_amount>t.value.modalCount)&&(t.value.modalCount+=1)},F=(S,p)=>{var N;const w=(N=t.value.groupCurrentOpen)==null?void 0:N.id.toUpperCase();if(!S&&!t.value.isModifiedAmount&&p.max_amount!==1){if(w==="Добавки2000"&&p.max_amount>1)return!0;if(Math.abs(y.value-u.value)>1&&w!=="Добавки2000")return!0}return!1},D=(S,p=!1)=>{t.value.modalCount=1,t.value.currentModifier=S;const w=t.value.groupModifiersSelected.findIndex(N=>N.group===t.value.groupCurrentOpen.id);R(w,S,p)},R=(S,p,w)=>{let N=t.value.groupModifiersSelected;if(p.sizes.length>0&&p.sizes.find($=>{var A;return $.id===((A=t.value.selectedSize)==null?void 0:A.id)}),S===-1)F(w,p)?t.value.isModifiedAmount=!0:N[t.value.groupCurrentOpen.index]={group:t.value.groupCurrentOpen.id,modifier_count:0,modifiers:[{...p,amount:(p==null?void 0:p.amount)??1}]};else{const $=t.value.groupModifiers[S].group_modifiers.findIndex(C=>C.id===p.id);if(N[S].modifiers.findIndex(C=>C.id===p.id)===-1){if(y.value===1)N[S].modifiers=[];else if(u.value>=y.value)return;F(w,p)?t.value.isModifiedAmount=!0:(N[S].modifiers.push({...p,amount:(p==null?void 0:p.amount)??1}),N[S].modifier_count=N[S].modifiers.reduce((C,T)=>C+=T.amount,0),t.value.isAnimationFly=!0)}else N[S].modifiers=N[S].modifiers.filter(C=>C.id!==p.id),N[S].modifier_count=N[S].modifiers.reduce((C,T)=>C+=T.amount,0),t.value.groupModifiers[S].group_modifiers[$].amount=1,t.value.groupModifiers[S].group_modifiers[$].default_amount=0,t.value.isAnimationFly=!1}t.value.groupModifiersSelected=N};return{stateCard:t,totalPrice_libCard:_,recountGroupTotalAmount:u,groupTotalAmount:y,isOpenWindow:r,isUpSale:s,checkedRequiredBtn:m,dataUpSale:i,productCards:l,isAddToCard:a,openProduct:c,is_startPage:d,setProduct:h,summModifierAmount:f,setAddedProducts:B,setCurrentCard:E,minusAmount:P,plusAmount:O,toggleNotRequire:g,modifierSelect:D,defaultAmountModifiers:b,reset:o}});function Wn(n,t){return function(){return n.apply(t,arguments)}}const{toString:us}=Object.prototype,{getPrototypeOf:on}=Object,{iterator:vt,toStringTag:Gn}=Symbol,Tt=(n=>t=>{const o=us.call(t);return n[o]||(n[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ve=n=>(n=n.toLowerCase(),t=>Tt(t)===n),$t=n=>t=>typeof t===n,{isArray:rt}=Array,st=$t("undefined");function pt(n){return n!==null&&!st(n)&&n.constructor!==null&&!st(n.constructor)&&ke(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Kn=Ve("ArrayBuffer");function fs(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Kn(n.buffer),t}const ps=$t("string"),ke=$t("function"),Jn=$t("number"),mt=n=>n!==null&&typeof n=="object",ms=n=>n===!0||n===!1,At=n=>{if(Tt(n)!=="object")return!1;const t=on(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Gn in n)&&!(vt in n)},hs=n=>{if(!mt(n)||pt(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},gs=Ve("Date"),_s=Ve("File"),ys=Ve("Blob"),bs=Ve("FileList"),ws=n=>mt(n)&&ke(n.pipe),ks=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||ke(n.append)&&((t=Tt(n))==="formdata"||t==="object"&&ke(n.toString)&&n.toString()==="[object FormData]"))},Cs=Ve("URLSearchParams"),[Ss,Es,Bs,Ns]=["ReadableStream","Request","Response","Headers"].map(Ve),xs=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ht(n,t,{allOwnKeys:o=!1}={}){if(n===null||typeof n>"u")return;let r,s;if(typeof n!="object"&&(n=[n]),rt(n))for(r=0,s=n.length;r<s;r++)t.call(null,n[r],r,n);else{if(pt(n))return;const a=o?Object.getOwnPropertyNames(n):Object.keys(n),i=a.length;let l;for(r=0;r<i;r++)l=a[r],t.call(null,n[l],l,n)}}function Xn(n,t){if(pt(n))return null;t=t.toLowerCase();const o=Object.keys(n);let r=o.length,s;for(;r-- >0;)if(s=o[r],t===s.toLowerCase())return s;return null}const Ke=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Yn=n=>!st(n)&&n!==Ke;function rn(){const{caseless:n,skipUndefined:t}=Yn(this)&&this||{},o={},r=(s,a)=>{const i=n&&Xn(o,a)||a;At(o[i])&&At(s)?o[i]=rn(o[i],s):At(s)?o[i]=rn({},s):rt(s)?o[i]=s.slice():(!t||!st(s))&&(o[i]=s)};for(let s=0,a=arguments.length;s<a;s++)arguments[s]&&ht(arguments[s],r);return o}const vs=(n,t,o,{allOwnKeys:r}={})=>(ht(t,(s,a)=>{o&&ke(s)?n[a]=Wn(s,o):n[a]=s},{allOwnKeys:r}),n),Ts=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),$s=(n,t,o,r)=>{n.prototype=Object.create(t.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),o&&Object.assign(n.prototype,o)},As=(n,t,o,r)=>{let s,a,i;const l={};if(t=t||{},n==null)return t;do{for(s=Object.getOwnPropertyNames(n),a=s.length;a-- >0;)i=s[a],(!r||r(i,n,t))&&!l[i]&&(t[i]=n[i],l[i]=!0);n=o!==!1&&on(n)}while(n&&(!o||o(n,t))&&n!==Object.prototype);return t},Ms=(n,t,o)=>{n=String(n),(o===void 0||o>n.length)&&(o=n.length),o-=t.length;const r=n.indexOf(t,o);return r!==-1&&r===o},Ps=n=>{if(!n)return null;if(rt(n))return n;let t=n.length;if(!Jn(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=n[t];return o},Is=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&on(Uint8Array)),Vs=(n,t)=>{const r=(n&&n[vt]).call(n);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(n,a[0],a[1])}},Rs=(n,t)=>{let o;const r=[];for(;(o=n.exec(t))!==null;)r.push(o);return r},Ds=Ve("HTMLFormElement"),Os=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,r,s){return r.toUpperCase()+s}),Zn=(({hasOwnProperty:n})=>(t,o)=>n.call(t,o))(Object.prototype),Ls=Ve("RegExp"),Qn=(n,t)=>{const o=Object.getOwnPropertyDescriptors(n),r={};ht(o,(s,a)=>{let i;(i=t(s,a,n))!==!1&&(r[a]=i||s)}),Object.defineProperties(n,r)},Fs=n=>{Qn(n,(t,o)=>{if(ke(n)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const r=n[o];if(ke(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},zs=(n,t)=>{const o={},r=s=>{s.forEach(a=>{o[a]=!0})};return rt(n)?r(n):r(String(n).split(t)),o},Us=()=>{},Hs=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function js(n){return!!(n&&ke(n.append)&&n[Gn]==="FormData"&&n[vt])}const qs=n=>{const t=new Array(10),o=(r,s)=>{if(mt(r)){if(t.indexOf(r)>=0)return;if(pt(r))return r;if(!("toJSON"in r)){t[s]=r;const a=rt(r)?[]:{};return ht(r,(i,l)=>{const c=o(i,s+1);!st(c)&&(a[l]=c)}),t[s]=void 0,a}}return r};return o(n,0)},Ws=Ve("AsyncFunction"),Gs=n=>n&&(mt(n)||ke(n))&&ke(n.then)&&ke(n.catch),eo=((n,t)=>n?setImmediate:t?((o,r)=>(Ke.addEventListener("message",({source:s,data:a})=>{s===Ke&&a===o&&r.length&&r.shift()()},!1),s=>{r.push(s),Ke.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",ke(Ke.postMessage)),Ks=typeof queueMicrotask<"u"?queueMicrotask.bind(Ke):typeof process<"u"&&process.nextTick||eo,v={isArray:rt,isArrayBuffer:Kn,isBuffer:pt,isFormData:ks,isArrayBufferView:fs,isString:ps,isNumber:Jn,isBoolean:ms,isObject:mt,isPlainObject:At,isEmptyObject:hs,isReadableStream:Ss,isRequest:Es,isResponse:Bs,isHeaders:Ns,isUndefined:st,isDate:gs,isFile:_s,isBlob:ys,isRegExp:Ls,isFunction:ke,isStream:ws,isURLSearchParams:Cs,isTypedArray:Is,isFileList:bs,forEach:ht,merge:rn,extend:vs,trim:xs,stripBOM:Ts,inherits:$s,toFlatObject:As,kindOf:Tt,kindOfTest:Ve,endsWith:Ms,toArray:Ps,forEachEntry:Vs,matchAll:Rs,isHTMLForm:Ds,hasOwnProperty:Zn,hasOwnProp:Zn,reduceDescriptors:Qn,freezeMethods:Fs,toObjectSet:zs,toCamelCase:Os,noop:Us,toFiniteNumber:Hs,findKey:Xn,global:Ke,isContextDefined:Yn,isSpecCompliantForm:js,toJSONObject:qs,isAsyncFn:Ws,isThenable:Gs,setImmediate:eo,asap:Ks,isIterable:n=>n!=null&&ke(n[vt])};function ne(n,t,o,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),o&&(this.config=o),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}v.inherits(ne,Error,{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:v.toJSONObject(this.config),code:this.code,status:this.status}}});const to=ne.prototype,no={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{no[n]={value:n}}),Object.defineProperties(ne,no),Object.defineProperty(to,"isAxiosError",{value:!0}),ne.from=(n,t,o,r,s,a)=>{const i=Object.create(to);v.toFlatObject(n,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=n&&n.message?n.message:"Error",c=t==null&&n?n.code:t;return ne.call(i,l,c,o,r,s),n&&i.cause==null&&Object.defineProperty(i,"cause",{value:n,configurable:!0}),i.name=n&&n.name||"Error",a&&Object.assign(i,a),i};const Js=null;function sn(n){return v.isPlainObject(n)||v.isArray(n)}function oo(n){return v.endsWith(n,"[]")?n.slice(0,-2):n}function ro(n,t,o){return n?n.concat(t).map(function(s,a){return s=oo(s),!o&&a?"["+s+"]":s}).join(o?".":""):t}function Xs(n){return v.isArray(n)&&!n.some(sn)}const Ys=v.toFlatObject(v,{},null,function(t){return/^is[A-Z]/.test(t)});function Mt(n,t,o){if(!v.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,o=v.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,B){return!v.isUndefined(B[b])});const r=o.metaTokens,s=o.visitor||u,a=o.dots,i=o.indexes,c=(o.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(t);if(!v.isFunction(s))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(v.isDate(m))return m.toISOString();if(v.isBoolean(m))return m.toString();if(!c&&v.isBlob(m))throw new ne("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(m)||v.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,b,B){let E=m;if(m&&!B&&typeof m=="object"){if(v.endsWith(b,"{}"))b=r?b:b.slice(0,-2),m=JSON.stringify(m);else if(v.isArray(m)&&Xs(m)||(v.isFileList(m)||v.endsWith(b,"[]"))&&(E=v.toArray(m)))return b=oo(b),E.forEach(function(g,P){!(v.isUndefined(g)||g===null)&&t.append(i===!0?ro([b],P,a):i===null?b:b+"[]",d(g))}),!1}return sn(m)?!0:(t.append(ro(B,b,a),d(m)),!1)}const f=[],y=Object.assign(Ys,{defaultVisitor:u,convertValue:d,isVisitable:sn});function _(m,b){if(!v.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+b.join("."));f.push(m),v.forEach(m,function(E,h){(!(v.isUndefined(E)||E===null)&&s.call(t,E,v.isString(h)?h.trim():h,b,y))===!0&&_(E,b?b.concat(h):[h])}),f.pop()}}if(!v.isObject(n))throw new TypeError("data must be an object");return _(n),t}function so(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function an(n,t){this._pairs=[],n&&Mt(n,this,t)}const ao=an.prototype;ao.append=function(t,o){this._pairs.push([t,o])},ao.toString=function(t){const o=t?function(r){return t.call(this,r,so)}:so;return this._pairs.map(function(s){return o(s[0])+"="+o(s[1])},"").join("&")};function Zs(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function io(n,t,o){if(!t)return n;const r=o&&o.encode||Zs;v.isFunction(o)&&(o={serialize:o});const s=o&&o.serialize;let a;if(s?a=s(t,o):a=v.isURLSearchParams(t)?t.toString():new an(t,o).toString(r),a){const i=n.indexOf("#");i!==-1&&(n=n.slice(0,i)),n+=(n.indexOf("?")===-1?"?":"&")+a}return n}class lo{constructor(){this.handlers=[]}use(t,o,r){return this.handlers.push({fulfilled:t,rejected:o,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){v.forEach(this.handlers,function(r){r!==null&&t(r)})}}const co={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qs={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:an,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ln=typeof window<"u"&&typeof document<"u",cn=typeof navigator=="object"&&navigator||void 0,ea=ln&&(!cn||["ReactNative","NativeScript","NS"].indexOf(cn.product)<0),ta=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",na=ln&&window.location.href||"http://localhost",ye={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ln,hasStandardBrowserEnv:ea,hasStandardBrowserWebWorkerEnv:ta,navigator:cn,origin:na},Symbol.toStringTag,{value:"Module"})),...Qs};function oa(n,t){return Mt(n,new ye.classes.URLSearchParams,{visitor:function(o,r,s,a){return ye.isNode&&v.isBuffer(o)?(this.append(r,o.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function ra(n){return v.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function sa(n){const t={},o=Object.keys(n);let r;const s=o.length;let a;for(r=0;r<s;r++)a=o[r],t[a]=n[a];return t}function uo(n){function t(o,r,s,a){let i=o[a++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),c=a>=o.length;return i=!i&&v.isArray(s)?s.length:i,c?(v.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!l):((!s[i]||!v.isObject(s[i]))&&(s[i]=[]),t(o,r,s[i],a)&&v.isArray(s[i])&&(s[i]=sa(s[i])),!l)}if(v.isFormData(n)&&v.isFunction(n.entries)){const o={};return v.forEachEntry(n,(r,s)=>{t(ra(r),s,o,0)}),o}return null}function aa(n,t,o){if(v.isString(n))try{return(t||JSON.parse)(n),v.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(n)}const gt={transitional:co,adapter:["xhr","http","fetch"],transformRequest:[function(t,o){const r=o.getContentType()||"",s=r.indexOf("application/json")>-1,a=v.isObject(t);if(a&&v.isHTMLForm(t)&&(t=new FormData(t)),v.isFormData(t))return s?JSON.stringify(uo(t)):t;if(v.isArrayBuffer(t)||v.isBuffer(t)||v.isStream(t)||v.isFile(t)||v.isBlob(t)||v.isReadableStream(t))return t;if(v.isArrayBufferView(t))return t.buffer;if(v.isURLSearchParams(t))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return oa(t,this.formSerializer).toString();if((l=v.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Mt(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||s?(o.setContentType("application/json",!1),aa(t)):t}],transformResponse:[function(t){const o=this.transitional||gt.transitional,r=o&&o.forcedJSONParsing,s=this.responseType==="json";if(v.isResponse(t)||v.isReadableStream(t))return t;if(t&&v.isString(t)&&(r&&!this.responseType||s)){const i=!(o&&o.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?ne.from(l,ne.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],n=>{gt.headers[n]={}});const ia=v.toObjectSet(["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"]),la=n=>{const t={};let o,r,s;return n&&n.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),o=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!o||t[o]&&ia[o])&&(o==="set-cookie"?t[o]?t[o].push(r):t[o]=[r]:t[o]=t[o]?t[o]+", "+r:r)}),t},fo=Symbol("internals");function _t(n){return n&&String(n).trim().toLowerCase()}function Pt(n){return n===!1||n==null?n:v.isArray(n)?n.map(Pt):String(n)}function ca(n){const t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(n);)t[r[1]]=r[2];return t}const da=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function dn(n,t,o,r,s){if(v.isFunction(r))return r.call(this,t,o);if(s&&(t=o),!!v.isString(t)){if(v.isString(r))return t.indexOf(r)!==-1;if(v.isRegExp(r))return r.test(t)}}function ua(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,o,r)=>o.toUpperCase()+r)}function fa(n,t){const o=v.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+o,{value:function(s,a,i){return this[r].call(this,t,s,a,i)},configurable:!0})})}let Ce=class{constructor(t){t&&this.set(t)}set(t,o,r){const s=this;function a(l,c,d){const u=_t(c);if(!u)throw new Error("header name must be a non-empty string");const f=v.findKey(s,u);(!f||s[f]===void 0||d===!0||d===void 0&&s[f]!==!1)&&(s[f||c]=Pt(l))}const i=(l,c)=>v.forEach(l,(d,u)=>a(d,u,c));if(v.isPlainObject(t)||t instanceof this.constructor)i(t,o);else if(v.isString(t)&&(t=t.trim())&&!da(t))i(la(t),o);else if(v.isObject(t)&&v.isIterable(t)){let l={},c,d;for(const u of t){if(!v.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?v.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(l,o)}else t!=null&&a(o,t,r);return this}get(t,o){if(t=_t(t),t){const r=v.findKey(this,t);if(r){const s=this[r];if(!o)return s;if(o===!0)return ca(s);if(v.isFunction(o))return o.call(this,s,r);if(v.isRegExp(o))return o.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,o){if(t=_t(t),t){const r=v.findKey(this,t);return!!(r&&this[r]!==void 0&&(!o||dn(this,this[r],r,o)))}return!1}delete(t,o){const r=this;let s=!1;function a(i){if(i=_t(i),i){const l=v.findKey(r,i);l&&(!o||dn(r,r[l],l,o))&&(delete r[l],s=!0)}}return v.isArray(t)?t.forEach(a):a(t),s}clear(t){const o=Object.keys(this);let r=o.length,s=!1;for(;r--;){const a=o[r];(!t||dn(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const o=this,r={};return v.forEach(this,(s,a)=>{const i=v.findKey(r,a);if(i){o[i]=Pt(s),delete o[a];return}const l=t?ua(a):String(a).trim();l!==a&&delete o[a],o[l]=Pt(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const o=Object.create(null);return v.forEach(this,(r,s)=>{r!=null&&r!==!1&&(o[s]=t&&v.isArray(r)?r.join(", "):r)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,o])=>t+": "+o).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...o){const r=new this(t);return o.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[fo]=this[fo]={accessors:{}}).accessors,s=this.prototype;function a(i){const l=_t(i);r[l]||(fa(s,i),r[l]=!0)}return v.isArray(t)?t.forEach(a):a(t),this}};Ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),v.reduceDescriptors(Ce.prototype,({value:n},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(r){this[o]=r}}}),v.freezeMethods(Ce);function un(n,t){const o=this||gt,r=t||o,s=Ce.from(r.headers);let a=r.data;return v.forEach(n,function(l){a=l.call(o,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function po(n){return!!(n&&n.__CANCEL__)}function at(n,t,o){ne.call(this,n??"canceled",ne.ERR_CANCELED,t,o),this.name="CanceledError"}v.inherits(at,ne,{__CANCEL__:!0});function mo(n,t,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?n(o):t(new ne("Request failed with status code "+o.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function pa(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function ma(n,t){n=n||10;const o=new Array(n),r=new Array(n);let s=0,a=0,i;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=r[a];i||(i=d),o[s]=c,r[s]=d;let f=a,y=0;for(;f!==s;)y+=o[f++],f=f%n;if(s=(s+1)%n,s===a&&(a=(a+1)%n),d-i<t)return;const _=u&&d-u;return _?Math.round(y*1e3/_):void 0}}function ha(n,t){let o=0,r=1e3/t,s,a;const i=(d,u=Date.now())=>{o=u,s=null,a&&(clearTimeout(a),a=null),n(...d)};return[(...d)=>{const u=Date.now(),f=u-o;f>=r?i(d,u):(s=d,a||(a=setTimeout(()=>{a=null,i(s)},r-f)))},()=>s&&i(s)]}const It=(n,t,o=3)=>{let r=0;const s=ma(50,250);return ha(a=>{const i=a.loaded,l=a.lengthComputable?a.total:void 0,c=i-r,d=s(c),u=i<=l;r=i;const f={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};n(f)},o)},ho=(n,t)=>{const o=n!=null;return[r=>t[0]({lengthComputable:o,total:n,loaded:r}),t[1]]},go=n=>(...t)=>v.asap(()=>n(...t)),ga=ye.hasStandardBrowserEnv?((n,t)=>o=>(o=new URL(o,ye.origin),n.protocol===o.protocol&&n.host===o.host&&(t||n.port===o.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,_a=ye.hasStandardBrowserEnv?{write(n,t,o,r,s,a,i){if(typeof document>"u")return;const l=[`${n}=${encodeURIComponent(t)}`];v.isNumber(o)&&l.push(`expires=${new Date(o).toUTCString()}`),v.isString(r)&&l.push(`path=${r}`),v.isString(s)&&l.push(`domain=${s}`),a===!0&&l.push("secure"),v.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(n){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ya(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function ba(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function _o(n,t,o){let r=!ya(t);return n&&(r||o==!1)?ba(n,t):t}const yo=n=>n instanceof Ce?{...n}:n;function Je(n,t){t=t||{};const o={};function r(d,u,f,y){return v.isPlainObject(d)&&v.isPlainObject(u)?v.merge.call({caseless:y},d,u):v.isPlainObject(u)?v.merge({},u):v.isArray(u)?u.slice():u}function s(d,u,f,y){if(v.isUndefined(u)){if(!v.isUndefined(d))return r(void 0,d,f,y)}else return r(d,u,f,y)}function a(d,u){if(!v.isUndefined(u))return r(void 0,u)}function i(d,u){if(v.isUndefined(u)){if(!v.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function l(d,u,f){if(f in t)return r(d,u);if(f in n)return r(void 0,d)}const c={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,u,f)=>s(yo(d),yo(u),f,!0)};return v.forEach(Object.keys({...n,...t}),function(u){const f=c[u]||s,y=f(n[u],t[u],u);v.isUndefined(y)&&f!==l||(o[u]=y)}),o}const bo=n=>{const t=Je({},n);let{data:o,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:i,auth:l}=t;if(t.headers=i=Ce.from(i),t.url=io(_o(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),v.isFormData(o)){if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(v.isFunction(o.getHeaders)){const c=o.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,f])=>{d.includes(u.toLowerCase())&&i.set(u,f)})}}if(ye.hasStandardBrowserEnv&&(r&&v.isFunction(r)&&(r=r(t)),r||r!==!1&&ga(t.url))){const c=s&&a&&_a.read(a);c&&i.set(s,c)}return t},wa=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(o,r){const s=bo(n);let a=s.data;const i=Ce.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=s,u,f,y,_,m;function b(){_&&_(),m&&m(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let B=new XMLHttpRequest;B.open(s.method.toUpperCase(),s.url,!0),B.timeout=s.timeout;function E(){if(!B)return;const g=Ce.from("getAllResponseHeaders"in B&&B.getAllResponseHeaders()),O={data:!l||l==="text"||l==="json"?B.responseText:B.response,status:B.status,statusText:B.statusText,headers:g,config:n,request:B};mo(function(D){o(D),b()},function(D){r(D),b()},O),B=null}"onloadend"in B?B.onloadend=E:B.onreadystatechange=function(){!B||B.readyState!==4||B.status===0&&!(B.responseURL&&B.responseURL.indexOf("file:")===0)||setTimeout(E)},B.onabort=function(){B&&(r(new ne("Request aborted",ne.ECONNABORTED,n,B)),B=null)},B.onerror=function(P){const O=P&&P.message?P.message:"Network Error",F=new ne(O,ne.ERR_NETWORK,n,B);F.event=P||null,r(F),B=null},B.ontimeout=function(){let P=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||co;s.timeoutErrorMessage&&(P=s.timeoutErrorMessage),r(new ne(P,O.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,n,B)),B=null},a===void 0&&i.setContentType(null),"setRequestHeader"in B&&v.forEach(i.toJSON(),function(P,O){B.setRequestHeader(O,P)}),v.isUndefined(s.withCredentials)||(B.withCredentials=!!s.withCredentials),l&&l!=="json"&&(B.responseType=s.responseType),d&&([y,m]=It(d,!0),B.addEventListener("progress",y)),c&&B.upload&&([f,_]=It(c),B.upload.addEventListener("progress",f),B.upload.addEventListener("loadend",_)),(s.cancelToken||s.signal)&&(u=g=>{B&&(r(!g||g.type?new at(null,n,B):g),B.abort(),B=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const h=pa(s.url);if(h&&ye.protocols.indexOf(h)===-1){r(new ne("Unsupported protocol "+h+":",ne.ERR_BAD_REQUEST,n));return}B.send(a||null)})},ka=(n,t)=>{const{length:o}=n=n?n.filter(Boolean):[];if(t||o){let r=new AbortController,s;const a=function(d){if(!s){s=!0,l();const u=d instanceof Error?d:this.reason;r.abort(u instanceof ne?u:new at(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,a(new ne(`timeout ${t} of ms exceeded`,ne.ETIMEDOUT))},t);const l=()=>{n&&(i&&clearTimeout(i),i=null,n.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),n=null)};n.forEach(d=>d.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>v.asap(l),c}},Ca=function*(n,t){let o=n.byteLength;if(o<t){yield n;return}let r=0,s;for(;r<o;)s=r+t,yield n.slice(r,s),r=s},Sa=async function*(n,t){for await(const o of Ea(n))yield*Ca(o,t)},Ea=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:o,value:r}=await t.read();if(o)break;yield r}}finally{await t.cancel()}},wo=(n,t,o,r)=>{const s=Sa(n,t);let a=0,i,l=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await s.next();if(d){l(),c.close();return}let f=u.byteLength;if(o){let y=a+=f;o(y)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},ko=64*1024,{isFunction:Vt}=v,Ba=(({Request:n,Response:t})=>({Request:n,Response:t}))(v.global),{ReadableStream:Co,TextEncoder:So}=v.global,Eo=(n,...t)=>{try{return!!n(...t)}catch{return!1}},Na=n=>{n=v.merge.call({skipUndefined:!0},Ba,n);const{fetch:t,Request:o,Response:r}=n,s=t?Vt(t):typeof fetch=="function",a=Vt(o),i=Vt(r);if(!s)return!1;const l=s&&Vt(Co),c=s&&(typeof So=="function"?(m=>b=>m.encode(b))(new So):async m=>new Uint8Array(await new o(m).arrayBuffer())),d=a&&l&&Eo(()=>{let m=!1;const b=new o(ye.origin,{body:new Co,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!b}),u=i&&l&&Eo(()=>v.isReadableStream(new r("").body)),f={stream:u&&(m=>m.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(b,B)=>{let E=b&&b[m];if(E)return E.call(b);throw new ne(`Response type '${m}' is not supported`,ne.ERR_NOT_SUPPORT,B)})});const y=async m=>{if(m==null)return 0;if(v.isBlob(m))return m.size;if(v.isSpecCompliantForm(m))return(await new o(ye.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(v.isArrayBufferView(m)||v.isArrayBuffer(m))return m.byteLength;if(v.isURLSearchParams(m)&&(m=m+""),v.isString(m))return(await c(m)).byteLength},_=async(m,b)=>{const B=v.toFiniteNumber(m.getContentLength());return B??y(b)};return async m=>{let{url:b,method:B,data:E,signal:h,cancelToken:g,timeout:P,onDownloadProgress:O,onUploadProgress:F,responseType:D,headers:R,withCredentials:S="same-origin",fetchOptions:p}=bo(m),w=t||fetch;D=D?(D+"").toLowerCase():"text";let N=ka([h,g&&g.toAbortSignal()],P),$=null;const A=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let C;try{if(F&&d&&B!=="get"&&B!=="head"&&(C=await _(R,E))!==0){let L=new o(b,{method:"POST",body:E,duplex:"half"}),G;if(v.isFormData(E)&&(G=L.headers.get("content-type"))&&R.setContentType(G),L.body){const[W,Z]=ho(C,It(go(F)));E=wo(L.body,ko,W,Z)}}v.isString(S)||(S=S?"include":"omit");const T=a&&"credentials"in o.prototype,I={...p,signal:N,method:B.toUpperCase(),headers:R.normalize().toJSON(),body:E,duplex:"half",credentials:T?S:void 0};$=a&&new o(b,I);let k=await(a?w($,p):w(b,I));const x=u&&(D==="stream"||D==="response");if(u&&(O||x&&A)){const L={};["status","statusText","headers"].forEach(se=>{L[se]=k[se]});const G=v.toFiniteNumber(k.headers.get("content-length")),[W,Z]=O&&ho(G,It(go(O),!0))||[];k=new r(wo(k.body,ko,W,()=>{Z&&Z(),A&&A()}),L)}D=D||"text";let V=await f[v.findKey(f,D)||"text"](k,m);return!x&&A&&A(),await new Promise((L,G)=>{mo(L,G,{data:V,headers:Ce.from(k.headers),status:k.status,statusText:k.statusText,config:m,request:$})})}catch(T){throw A&&A(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new ne("Network Error",ne.ERR_NETWORK,m,$),{cause:T.cause||T}):ne.from(T,T&&T.code,m,$)}}},xa=new Map,Bo=n=>{let t=n&&n.env||{};const{fetch:o,Request:r,Response:s}=t,a=[r,s,o];let i=a.length,l=i,c,d,u=xa;for(;l--;)c=a[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Na(t)),u=d;return d};Bo();const fn={http:Js,xhr:wa,fetch:{get:Bo}};v.forEach(fn,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const No=n=>`- ${n}`,va=n=>v.isFunction(n)||n===null||n===!1;function Ta(n,t){n=v.isArray(n)?n:[n];const{length:o}=n;let r,s;const a={};for(let i=0;i<o;i++){r=n[i];let l;if(s=r,!va(r)&&(s=fn[(l=String(r)).toLowerCase()],s===void 0))throw new ne(`Unknown adapter '${l}'`);if(s&&(v.isFunction(s)||(s=s.get(t))))break;a[l||"#"+i]=s}if(!s){const i=Object.entries(a).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=o?i.length>1?`since :
4
+ `+i.map(No).join(`
5
+ `):" "+No(i[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const xo={getAdapter:Ta,adapters:fn};function pn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new at(null,n)}function vo(n){return pn(n),n.headers=Ce.from(n.headers),n.data=un.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),xo.getAdapter(n.adapter||gt.adapter,n)(n).then(function(r){return pn(n),r.data=un.call(n,n.transformResponse,r),r.headers=Ce.from(r.headers),r},function(r){return po(r)||(pn(n),r&&r.response&&(r.response.data=un.call(n,n.transformResponse,r.response),r.response.headers=Ce.from(r.response.headers))),Promise.reject(r)})}const To="1.13.2",Rt={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{Rt[n]=function(r){return typeof r===n||"a"+(t<1?"n ":" ")+n}});const $o={};Rt.transitional=function(t,o,r){function s(a,i){return"[Axios v"+To+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,l)=>{if(t===!1)throw new ne(s(i," has been removed"+(o?" in "+o:"")),ne.ERR_DEPRECATED);return o&&!$o[i]&&($o[i]=!0,console.warn(s(i," has been deprecated since v"+o+" and will be removed in the near future"))),t?t(a,i,l):!0}},Rt.spelling=function(t){return(o,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function $a(n,t,o){if(typeof n!="object")throw new ne("options must be an object",ne.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let s=r.length;for(;s-- >0;){const a=r[s],i=t[a];if(i){const l=n[a],c=l===void 0||i(l,a,n);if(c!==!0)throw new ne("option "+a+" must be "+c,ne.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new ne("Unknown option "+a,ne.ERR_BAD_OPTION)}}const Dt={assertOptions:$a,validators:Rt},Oe=Dt.validators;let Xe=class{constructor(t){this.defaults=t||{},this.interceptors={request:new lo,response:new lo}}async request(t,o){try{return await this._request(t,o)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+a):r.stack=a}catch{}}throw r}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=Je(this.defaults,o);const{transitional:r,paramsSerializer:s,headers:a}=o;r!==void 0&&Dt.assertOptions(r,{silentJSONParsing:Oe.transitional(Oe.boolean),forcedJSONParsing:Oe.transitional(Oe.boolean),clarifyTimeoutError:Oe.transitional(Oe.boolean)},!1),s!=null&&(v.isFunction(s)?o.paramsSerializer={serialize:s}:Dt.assertOptions(s,{encode:Oe.function,serialize:Oe.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Dt.assertOptions(o,{baseUrl:Oe.spelling("baseURL"),withXsrfToken:Oe.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=a&&v.merge(a.common,a[o.method]);a&&v.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),o.headers=Ce.concat(i,a);const l=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(o)===!1||(c=c&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let u,f=0,y;if(!c){const m=[vo.bind(this),void 0];for(m.unshift(...l),m.push(...d),y=m.length,u=Promise.resolve(o);f<y;)u=u.then(m[f++],m[f++]);return u}y=l.length;let _=o;for(;f<y;){const m=l[f++],b=l[f++];try{_=m(_)}catch(B){b.call(this,B);break}}try{u=vo.call(this,_)}catch(m){return Promise.reject(m)}for(f=0,y=d.length;f<y;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=Je(this.defaults,t);const o=_o(t.baseURL,t.url,t.allowAbsoluteUrls);return io(o,t.params,t.paramsSerializer)}};v.forEach(["delete","get","head","options"],function(t){Xe.prototype[t]=function(o,r){return this.request(Je(r||{},{method:t,url:o,data:(r||{}).data}))}}),v.forEach(["post","put","patch"],function(t){function o(r){return function(a,i,l){return this.request(Je(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Xe.prototype[t]=o(),Xe.prototype[t+"Form"]=o(!0)});let Aa=class gr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(a){o=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const i=new Promise(l=>{r.subscribe(l),a=l}).then(s);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,l){r.reason||(r.reason=new at(a,i,l),o(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const t=new AbortController,o=r=>{t.abort(r)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new gr(function(s){t=s}),cancel:t}}};function Ma(n){return function(o){return n.apply(null,o)}}function Pa(n){return v.isObject(n)&&n.isAxiosError===!0}const mn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(mn).forEach(([n,t])=>{mn[t]=n});function Ao(n){const t=new Xe(n),o=Wn(Xe.prototype.request,t);return v.extend(o,Xe.prototype,t,{allOwnKeys:!0}),v.extend(o,t,null,{allOwnKeys:!0}),o.create=function(s){return Ao(Je(n,s))},o}const le=Ao(gt);le.Axios=Xe,le.CanceledError=at,le.CancelToken=Aa,le.isCancel=po,le.VERSION=To,le.toFormData=Mt,le.AxiosError=ne,le.Cancel=le.CanceledError,le.all=function(t){return Promise.all(t)},le.spread=Ma,le.isAxiosError=Pa,le.mergeConfig=Je,le.AxiosHeaders=Ce,le.formToJSON=n=>uo(v.isHTMLForm(n)?new FormData(n):n),le.getAdapter=xo.getAdapter,le.HttpStatusCode=mn,le.default=le;const{Axios:Cf,AxiosError:Sf,CanceledError:Ef,isCancel:Bf,CancelToken:Nf,VERSION:xf,all:vf,Cancel:Tf,isAxiosError:$f,spread:Af,toFormData:Mf,AxiosHeaders:Pf,HttpStatusCode:If,formToJSON:Vf,getAdapter:Rf,mergeConfig:Df}=le;var Ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Va(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mo={exports:{}};(function(n,t){(function(o,r){n.exports=r()})(Ia,function(){var o=1e3,r=6e4,s=36e5,a="millisecond",i="second",l="minute",c="hour",d="day",u="week",f="month",y="quarter",_="year",m="date",b="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|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,h={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("_"),ordinal:function(A){var C=["th","st","nd","rd"],T=A%100;return"["+A+(C[(T-20)%10]||C[T]||C[0])+"]"}},g=function(A,C,T){var I=String(A);return!I||I.length>=C?A:""+Array(C+1-I.length).join(T)+A},P={s:g,z:function(A){var C=-A.utcOffset(),T=Math.abs(C),I=Math.floor(T/60),k=T%60;return(C<=0?"+":"-")+g(I,2,"0")+":"+g(k,2,"0")},m:function A(C,T){if(C.date()<T.date())return-A(T,C);var I=12*(T.year()-C.year())+(T.month()-C.month()),k=C.clone().add(I,f),x=T-k<0,V=C.clone().add(I+(x?-1:1),f);return+(-(I+(T-k)/(x?k-V:V-k))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:f,y:_,w:u,d,D:m,h:c,m:l,s:i,ms:a,Q:y}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},O="en",F={};F[O]=h;var D="$isDayjsObject",R=function(A){return A instanceof N||!(!A||!A[D])},S=function A(C,T,I){var k;if(!C)return O;if(typeof C=="string"){var x=C.toLowerCase();F[x]&&(k=x),T&&(F[x]=T,k=x);var V=C.split("-");if(!k&&V.length>1)return A(V[0])}else{var L=C.name;F[L]=C,k=L}return!I&&k&&(O=k),k||!I&&O},p=function(A,C){if(R(A))return A.clone();var T=typeof C=="object"?C:{};return T.date=A,T.args=arguments,new N(T)},w=P;w.l=S,w.i=R,w.w=function(A,C){return p(A,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var N=function(){function A(T){this.$L=S(T.locale,null,!0),this.parse(T),this.$x=this.$x||T.x||{},this[D]=!0}var C=A.prototype;return C.parse=function(T){this.$d=function(I){var k=I.date,x=I.utc;if(k===null)return new Date(NaN);if(w.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var V=k.match(B);if(V){var L=V[2]-1||0,G=(V[7]||"0").substring(0,3);return x?new Date(Date.UTC(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,G)):new Date(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,G)}}return new Date(k)}(T),this.init()},C.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},C.$utils=function(){return w},C.isValid=function(){return this.$d.toString()!==b},C.isSame=function(T,I){var k=p(T);return this.startOf(I)<=k&&k<=this.endOf(I)},C.isAfter=function(T,I){return p(T)<this.startOf(I)},C.isBefore=function(T,I){return this.endOf(I)<p(T)},C.$g=function(T,I,k){return w.u(T)?this[I]:this.set(k,T)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(T,I){var k=this,x=!!w.u(I)||I,V=w.p(T),L=function(ee,Y){var U=w.w(k.$u?Date.UTC(k.$y,Y,ee):new Date(k.$y,Y,ee),k);return x?U:U.endOf(d)},G=function(ee,Y){return w.w(k.toDate()[ee].apply(k.toDate("s"),(x?[0,0,0,0]:[23,59,59,999]).slice(Y)),k)},W=this.$W,Z=this.$M,se=this.$D,ce="set"+(this.$u?"UTC":"");switch(V){case _:return x?L(1,0):L(31,11);case f:return x?L(1,Z):L(0,Z+1);case u:var M=this.$locale().weekStart||0,J=(W<M?W+7:W)-M;return L(x?se-J:se+(6-J),Z);case d:case m:return G(ce+"Hours",0);case c:return G(ce+"Minutes",1);case l:return G(ce+"Seconds",2);case i:return G(ce+"Milliseconds",3);default:return this.clone()}},C.endOf=function(T){return this.startOf(T,!1)},C.$set=function(T,I){var k,x=w.p(T),V="set"+(this.$u?"UTC":""),L=(k={},k[d]=V+"Date",k[m]=V+"Date",k[f]=V+"Month",k[_]=V+"FullYear",k[c]=V+"Hours",k[l]=V+"Minutes",k[i]=V+"Seconds",k[a]=V+"Milliseconds",k)[x],G=x===d?this.$D+(I-this.$W):I;if(x===f||x===_){var W=this.clone().set(m,1);W.$d[L](G),W.init(),this.$d=W.set(m,Math.min(this.$D,W.daysInMonth())).$d}else L&&this.$d[L](G);return this.init(),this},C.set=function(T,I){return this.clone().$set(T,I)},C.get=function(T){return this[w.p(T)]()},C.add=function(T,I){var k,x=this;T=Number(T);var V=w.p(I),L=function(Z){var se=p(x);return w.w(se.date(se.date()+Math.round(Z*T)),x)};if(V===f)return this.set(f,this.$M+T);if(V===_)return this.set(_,this.$y+T);if(V===d)return L(1);if(V===u)return L(7);var G=(k={},k[l]=r,k[c]=s,k[i]=o,k)[V]||1,W=this.$d.getTime()+T*G;return w.w(W,this)},C.subtract=function(T,I){return this.add(-1*T,I)},C.format=function(T){var I=this,k=this.$locale();if(!this.isValid())return k.invalidDate||b;var x=T||"YYYY-MM-DDTHH:mm:ssZ",V=w.z(this),L=this.$H,G=this.$m,W=this.$M,Z=k.weekdays,se=k.months,ce=k.meridiem,M=function(Y,U,te,j){return Y&&(Y[U]||Y(I,x))||te[U].slice(0,j)},J=function(Y){return w.s(L%12||12,Y,"0")},ee=ce||function(Y,U,te){var j=Y<12?"AM":"PM";return te?j.toLowerCase():j};return x.replace(E,function(Y,U){return U||function(te){switch(te){case"YY":return String(I.$y).slice(-2);case"YYYY":return w.s(I.$y,4,"0");case"M":return W+1;case"MM":return w.s(W+1,2,"0");case"MMM":return M(k.monthsShort,W,se,3);case"MMMM":return M(se,W);case"D":return I.$D;case"DD":return w.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return M(k.weekdaysMin,I.$W,Z,2);case"ddd":return M(k.weekdaysShort,I.$W,Z,3);case"dddd":return Z[I.$W];case"H":return String(L);case"HH":return w.s(L,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return ee(L,G,!0);case"A":return ee(L,G,!1);case"m":return String(G);case"mm":return w.s(G,2,"0");case"s":return String(I.$s);case"ss":return w.s(I.$s,2,"0");case"SSS":return w.s(I.$ms,3,"0");case"Z":return V}return null}(Y)||V.replace(":","")})},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(T,I,k){var x,V=this,L=w.p(I),G=p(T),W=(G.utcOffset()-this.utcOffset())*r,Z=this-G,se=function(){return w.m(V,G)};switch(L){case _:x=se()/12;break;case f:x=se();break;case y:x=se()/3;break;case u:x=(Z-W)/6048e5;break;case d:x=(Z-W)/864e5;break;case c:x=Z/s;break;case l:x=Z/r;break;case i:x=Z/o;break;default:x=Z}return k?x:w.a(x)},C.daysInMonth=function(){return this.endOf(f).$D},C.$locale=function(){return F[this.$L]},C.locale=function(T,I){if(!T)return this.$L;var k=this.clone(),x=S(T,I,!0);return x&&(k.$L=x),k},C.clone=function(){return w.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},A}(),$=N.prototype;return p.prototype=$,[["$ms",a],["$s",i],["$m",l],["$H",c],["$W",d],["$M",f],["$y",_],["$D",m]].forEach(function(A){$[A[1]]=function(C){return this.$g(C,A[0],A[1])}}),p.extend=function(A,C){return A.$i||(A(C,N,p),A.$i=!0),p},p.locale=S,p.isDayjs=R,p.unix=function(A){return p(1e3*A)},p.en=F[O],p.Ls=F,p.p={},p})})(Mo);var Ra=Mo.exports;const Po=Va(Ra),Da=n=>{const t=Q.useRouter(),o=Q.useRoute(),r=`${n.domain}/api/`,s=le.create({baseURL:r}),a=le.create({baseURL:r}),i=le.create({baseURL:r}),l=le.create({baseURL:r}),c=le.create({baseURL:r}),d=le.create({baseURL:r}),u=le.create({baseURL:r}),f=g=>{try{const P=JSON.parse(localStorage.getItem("authTokensAccess")||"");P.length>0&&(g.headers.Authorization=`Bearer ${P}`)}catch{console.warn("accessToken is undefined [useAxios]")}return g},y=g=>{const P=localStorage.getItem("apiKey"),O=(P==null?void 0:P.replace(/^.(.*).$/,"$1"))||"";return g.headers={"Content-Type":"application/json","x-api-key":O},g},_=async g=>{if(!n.user)return g;const P=n.user.exp??0;if(!(Po.unix(P).diff(Po())<3e3))return g;const F=qn("authTokensRefresh",null,"string");try{const D=await le.post(`${r}user/token/refresh/`,{refresh:F.value});if(!D.data.access)return h(),g;localStorage.setItem("authTokensAccess",JSON.stringify(D.data.access)),B(D.data),E(jn(D.data.access)),g.headers={...g.headers,Authorization:`Bearer ${D.data.access}`}}catch(D){console.error("Failed to refresh token:",D),h()}return g},m=g=>{g.interceptors.request.use(P=>_(f(P)),P=>Promise.reject(P))};m(i),m(c),m(u);const b=g=>{g.interceptors.request.use(P=>y(P))};b(d),b(a),b(u);const B=(g,P=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(g.access)),P&&localStorage.setItem("authTokensRefresh",JSON.stringify(g.refresh))},E=g=>{n.user=g,localStorage.setItem("user",JSON.stringify(g))},h=()=>{n.user=null,ot(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),t.push(`/${o.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:i,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:u,axiosInstancePost:l,axiosInstanceGet:s,axiosInstanceGetApiKey:a,axiosInstancePostApiKey:d}},re=class re{constructor(){X(this,"axiosInstanceGet");X(this,"axiosInstancePost");X(this,"axiosInstanceAuthenticationGet");X(this,"axiosInstanceAuthenticationPost");X(this,"axiosInstanceGetApiKey");X(this,"axiosInstancePostApiKey");X(this,"axiosInstanceAuthenticationPostApiKey");X(this,"currentUpsaleController",null);X(this,"controller",new AbortController);this.axiosInstanceGet=re._axiosGet,this.axiosInstancePost=re._axiosPost,this.axiosInstanceGetApiKey=re._axiosPostApiKey,this.axiosInstancePostApiKey=re._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=re._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=re._axiosAuthGet,this.axiosInstanceAuthenticationPost=re._axiosAuthPost}static create(t){return t&&!re._config&&re._initialize(t),re._config||console.warn("InitConnection не инициализирован"),new re}static _initialize(t,o=null){const r=fe(),s=me(),{config_lib:a}=q.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l}=q.storeToRefs(s);re._config=t,re._cardStore=s,re._stateCard=i,re._recountGroupTotalAmount=l,a.value=t;const c=Da(t);re._axiosPostApiKey=c.axiosInstanceGetApiKey,re._axiosPostApiKey=c.axiosInstancePostApiKey,re._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,re._axiosGet=c.axiosInstanceGet,re._axiosPost=c.axiosInstancePost,re._axiosAuthGet=c.axiosInstanceAuthenticationGet,re._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return re._config}get cardStore(){return re._cardStore}get stateCard(){return re._stateCard}get recountGroupTotalAmount(){return re._recountGroupTotalAmount}async updateTheme(){var a,i;const t=JSON.parse(localStorage.getItem("themeConfig"))??null,o=we();if(t!==null){o.updateColor(t);return}const r=fe(),s=await((i=this.axiosInstanceGet)==null?void 0:i.get(`org/organizations/${(a=this.config)==null?void 0:a.orgId}/design/`));r.setStateDrum(s==null?void 0:s.data.hide_barban),r.setKioskTimeout(s==null?void 0:s.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(s.data)),o.updateColor(s.data)}async getGroupByID(t){var o,r;try{const s=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/group/${t}`));return s==null?void 0:s.data}catch(s){throw console.error("Ошибка в request.ts[getGroupByID]",s),s}}async loadGroupProducts(t){var o,r;try{const s=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/products/?group=${t}`)),a=(s==null?void 0:s.data)||[];for(const i of a)i&&await Ir(i);return await this.cacheImagesInBackground(a),a}catch(s){return console.error("Ошибка загрузки группы:",s),[]}}async getGroup(){var t,o;try{const r=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(t=this.config)==null?void 0:t.pointId}/groups/`));return r==null?void 0:r.data}catch(r){return console.error("Error fetching products:",r),[]}}async fetchAndCacheAllPages(){var t,o;try{const r=((t=this.config)==null?void 0:t.pointId)||"",s=await en(r);if(s)return s.data;const a=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${r}/group/`)),i=(a==null?void 0:a.data)||[],l=[];for(const c of i){c.products=c.products||[],await lt(c.id,c),l.push(c);const d=await this.loadGroupProducts(c.id);c.products=d}return await this.cacheImagesInBackground(i),await lt(r,i),l}catch(r){return console.error("fetchAndCacheAllPages error:",r),[]}}cacheImagesInBackground(t){t.forEach(o=>{var r;o.video_link&&this.loadAndCacheMedia(o.video_link,o.id+"_video"),o.image_link&&this.loadAndCacheMedia(o.image_link,o.id+"_image"),(r=o.products)==null||r.forEach(s=>{s.video_link&&this.loadAndCacheMedia(s.video_link,s.id+"_video"),s.image_link&&this.loadAndCacheMedia(s.image_link,s.id+"_image")})})}async loadAndCacheMedia(t,o){const r=await nt(o);if(r){this.dispatchImageCachedEvent(o,r);return}try{const s=await fetch(t);if(!s.ok)throw new Error("Network error");const a=await s.blob();if(a.size===0)throw new Error("Empty blob");await tn(o,a),this.dispatchImageCachedEvent(o,a)}catch(s){console.warn(`[ImageCache] Failed for ${o}:`,s)}}dispatchImageCachedEvent(t,o){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:t,blob:o}}))}async getProduct(t=null){var o,r;if(!t)return[];try{const s=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/products/${t}`));return s==null?void 0:s.data}catch(s){return console.error("Error fetching cardProducts:",s),[]}}async getSingleProduct(t){var s;const o=fe(),{config_lib:r}=q.storeToRefs(o);try{let a=await Vn(t);if(a)this._fullCardProduct(a);else{const i=await((s=this.axiosInstanceGet)==null?void 0:s.get(`${r.value.pointId}/products/${t}`));(i==null?void 0:i.status)===200&&this._fullCardProduct(i.data)}}catch(a){throw console.log("store card[getFetchProducts]:",a),a}}_fullCardProduct(t){const o=me();o.stateCard.openCard={...t,amount:1},o.stateCard.groupModifiers=t.group_modifiers,t.modifiers.length>0&&o.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:t.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:t.modifiers.reduce((r,s)=>r+=s.min_amount,0),name:"Добавки",required:!1}),o.stateCard.groupModifiersSelected=new Array(o.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),o.stateCard.productSizes=t.sizes,o.defaultAmountModifiers(),t.show_recommendations&&this.productUpsale(t.id)}async getTheme(){try{this.updateTheme()}catch(t){return console.error("Error fetching products:",t),[]}}async authorizeByCard(t){var o,r;try{const s=await((r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.domain}/api/user/validate-card/`,{card_number:t}));return localStorage.setItem("authTokensAccess",JSON.stringify(s==null?void 0:s.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(s==null?void 0:s.data.refresh)),s==null?void 0:s.data}catch(s){throw console.error("Ошибка авторизации:",s),s}}async getLoyalSmsCode(t){var o,r;try{const s=await((r=this.axiosInstancePostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.domain}/api/device/auth/request-otp/`,{phone:t}));return s==null?void 0:s.data}catch(s){throw console.error("Ошибка получения sms-code:",s),s}}async sendSmsCodeForAuth(t,o){var r,s;try{const a=await((s=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:s.post(`${(r=this.config)==null?void 0:r.domain}/api/device/auth/`,{code:t,phone:o}));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка отправки sms-code:",a),a}}async callStaff(t,o){var r,s,a,i;try{const l=await((a=this.axiosInstancePost)==null?void 0:a.post(`${(r=this.config)==null?void 0:r.domain}/api/org_unit/${(s=this.config)==null?void 0:s.pointId}/table/${t}/call-staff/`,{reason:o}));return(i=l==null?void 0:l.data)==null?void 0:i.response_text}catch(l){throw console.error("Ошибка[callWaiter]",l),l}}async createOrder(t,o,r=!0,s,a=!1,i=!1,l){var m,b,B;const c=Ge(),d=a?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,u=r?d:this.axiosInstanceAuthenticationPost,f=r?"/device/order/create":"/order/create",y=r?(m=this.config)==null?void 0:m.pointId:(b=this.config)==null?void 0:b.pointId,_=await(u==null?void 0:u.post(`${(B=this.config)==null?void 0:B.domain}/api/org_unit/${y}${f}`,{items:t,table:o||null,comment:s},{signal:l}));return(_==null?void 0:_.status)===201&&c.orderSocket(_==null?void 0:_.data.id,r,i,l),_}async initPaymentLink(t,o=!0){const r=o?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,s=fe(),a=o?"TERMINAL":"YOOKASSA",i=await(r==null?void 0:r.post("payment/init",{by_bonuses:s.countBonus,order:t,provider_type:a}));return i==null?void 0:i.data}async orderPay(t){var o;return(o=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:o.post(`order/${t}/pay/`,{order_id:t})}async getProfile(){var o,r;const t=await((r=this.axiosInstanceAuthenticationGet)==null?void 0:r.get(`user/current?organization=${(o=this.config)==null?void 0:o.orgId}`));if((t==null?void 0:t.status)===200){const s=fe();return s.profile=t.data,s.is18Allowed=sessionStorage.getItem("is_adult")==="true",t.data}else return t}async calculateDiscount(t,o=!0,r=!1,s){var d,u;const a=r?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,i=o?a:this.axiosInstanceAuthenticationPost,l=o?(d=this.config)==null?void 0:d.pointId:(u=this.config)==null?void 0:u.pointId,c=await(i==null?void 0:i.post(`/org_unit/${l}/cart/calculate-discount/`,t,{signal:s}));return(c==null?void 0:c.status)===200?c.data:c}async maxPayByBonuses(t,o=!0,r=!1,s){const a=r?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,i=o?a:this.axiosInstanceAuthenticationPost,l=await(i==null?void 0:i.post("/cart/max-pay-by-bonuses/",{total_cart_price:t},{signal:s}));return l==null?void 0:l.data}async getDeviceInfo(){var o;const t=await((o=this.axiosInstanceGetApiKey)==null?void 0:o.get("/device/current/"));return(t==null?void 0:t.status)===200?t.data:t}async productUpsale(t){var a,i,l;const o=me(),{dataUpSale:r}=q.storeToRefs(o);(a=this.currentUpsaleController)==null||a.abort();const s=new AbortController;this.currentUpsaleController=s;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(i=this.config)==null?void 0:i.pointId}/products/${t}/recommendation/`,{signal:s.signal}));s.signal.aborted||(r.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.log("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===s&&(this.currentUpsaleController=null)}}};X(re,"_config",null),X(re,"_axiosGet"),X(re,"_axiosGetApiKey"),X(re,"_axiosPostApiKey"),X(re,"_axiosAuthPostApiKey"),X(re,"_axiosPost"),X(re,"_axiosAuthGet"),X(re,"_axiosAuthPost"),X(re,"_cardStore",null),X(re,"_stateCard",null),X(re,"_recountGroupTotalAmount",null);let ze=re;const Oa=e.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(n,{expose:t}){const o=n,r=fe(),s=e.ref(null),a=async l=>{if(!s.value||!l)return;let c=window;o.container&&(c=typeof o.container=="string"?document.querySelector(o.container)||window:o.container);const d={behavior:o.behavior};if(o.axis==="x"){const u=c===window?window.innerWidth:c.clientWidth,f=l.offsetWidth;let y=l.offsetLeft;if(c!==window){const _=c.getBoundingClientRect();y=l.getBoundingClientRect().left-_.left+c.scrollLeft}y-=(u-f)/2,d.left=Math.max(0,y)}else{const u=c===window?window.innerHeight:c.clientHeight,f=l.offsetHeight;let y=l.offsetTop;if(c!==window){const _=c.getBoundingClientRect();y=l.getBoundingClientRect().top-_.top+c.scrollTop}y-=(u-f)/2,d.top=Math.max(0,y)}try{c===window?window.scrollTo(d):c.scrollTo(d)}catch(u){console.error("Scroll error:",u)}};e.onMounted(async()=>{if(o.autoScroll){let l=null;if(await e.nextTick(),r.activeScrolling_lib){const c=r.activeScrolling_lib.findIndex(d=>d.id===o.idActive);o.idActive?(l=document.getElementById(`scrolling${o.idActive}`),l&&c!==-1&&(r.activeScrolling_lib[c]=l)):r.activeScrolling_lib[c]&&(l=r.activeScrolling_lib[c]),a(l)}}});const i=async l=>{o.clearContainer&&(r.activeScrolling_lib=[]);const c=l.currentTarget;await e.nextTick(),r.activeScrolling_lib.includes(c)||r.activeScrolling_lib.push(c),a(c)};return t({scrollToElement:a}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:s,class:"scroll-to-wrapper"},[e.renderSlot(l.$slots,"default",{handleTargetClick:i},void 0,!0)],512))}}),ae=(n,t)=>{const o=n.__vccOpts||n;for(const[r,s]of t)o[r]=s;return o},hn=ae(Oa,[["__scopeId","data-v-b510c3f1"]]),La={},Fa={id:"custom_svg_lib",width:"26.000000",height:"26.000000",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function za(n,t){return e.openBlock(),e.createElementBlock("svg",Fa,[...t[0]||(t[0]=[e.createElementVNode("defs",null,null,-1),e.createElementVNode("path",{id:"custom_svg_color",d:"M11.83 26L11.83 14.15L0 14.15L0 11.84L11.83 11.84L11.83 0L14.15 0L14.15 11.84L26 11.84L26 14.15L14.15 14.15L14.15 26L11.83 26Z",fill:"#FF6D2E","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const gn=ae(La,[["render",za]]),Ua=["id","onClick"],Ha={class:"modified_plus_btn"},ja=["src"],qa={key:2,class:"wrapper_modifier_item"},Wa={key:0,class:"modifier_item_n_wrapper"},Ga=["src"],Ka={key:1,class:"modifier_plus_item"},Ja=["src"],Xa=["src"],Io=ae(e.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(n){const t=me(),o=we(),{stateCard:r}=q.storeToRefs(t),{itemThemes:s}=q.storeToRefs(o),a=e.ref([]),i=e.ref([]),l=e.ref(null),c=e.ref(null),d=f=>{f instanceof HTMLElement&&!a.value.includes(f)&&a.value.push(f)},u=f=>{c.value=f};return e.onMounted(async()=>{await e.nextTick(),r.value.plusButtonsRefs=a.value}),e.watchEffect(()=>{i.value=r.value.groupModifiersSelected,document.body.style.overflow=""}),e.onBeforeUnmount(()=>{a.value=[],r.value.plusButtonsRefs=[]}),(f,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({card_modified_wrapper_many:e.unref(r).groupModifiers.length>=5})},[e.unref(r).groupModifiersSelected?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["card_modified_wrapper",[e.unref(r).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l},[e.createVNode(hn,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:e.withCtx(({handleTargetClick:_})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).groupModifiers,(m,b)=>{var B,E;return e.openBlock(),e.createElementBlock("div",{class:"button_modified",key:m.id,ref_for:!0,ref:d,id:"scrolling"+m.id,"data-clickable":"true",onClick:h=>{n.toggleNotRequire&&n.toggleNotRequire(m,b),u(m.id),_(h)}},[e.createElementVNode("div",Ha,[i.value[b].modifiers.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{modified_plus_btn_active:m.id===((B=e.unref(r).groupCurrentOpen)==null?void 0:B.id)&&n.isSectionModifier},"modified_plus_active"])},[e.createVNode(gn,{"aria-label":`Открыть группу модификаторов ${m.name}`},null,8,["aria-label"])],2)):i.value[b].modifiers.length===1?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:m.id===((E=e.unref(r).groupCurrentOpen)==null?void 0:E.id)&&n.isSectionModifier}])},[e.createElementVNode("img",{src:i.value[b].modifiers[0].image_link||e.unref(s).fallback_image||"",alt:"Модификатор"},null,8,ja)],2)):(e.openBlock(),e.createElementBlock("div",qa,[i.value[b].modifiers.length>2?(e.openBlock(),e.createElementBlock("div",Wa,[i.value[b].modifiers.length===3?(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:i.value[b].modifiers[2].image_link||e.unref(s).fallback_image||""},null,8,Ga)):(e.openBlock(),e.createElementBlock("p",Ka," + "+e.toDisplayString(i.value[b].modifiers.length-2),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[i.value[b].modifiers.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value[b].modifiers[0].image_link||e.unref(s).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,Ja)):e.createCommentVNode("",!0),i.value[b].modifiers.length>1?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.value[b].modifiers[1].image_link||e.unref(s).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,Xa)):e.createCommentVNode("",!0)])]))]),e.createElementVNode("p",null,e.toDisplayString(m.name),1)],8,Ua)}),128))]),_:1},8,["container","idActive"])],2)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-589e71ca"]]),Ya={},Za={id:"custom_svg_lib",width:"21.847656",height:"21.846924",viewBox:"0 0 21.8477 21.8469",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Qa(n,t){return e.openBlock(),e.createElementBlock("svg",Za,[...t[0]||(t[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),e.createElementVNode("path",{id:"Vector",d:"M12.38 15.9L12.89 15.39C12.96 15.33 13 15.25 13 15.16C13 15.08 12.96 15 12.89 14.93L8.84 11L12.89 7.06C12.96 6.99 13 6.91 13 6.83C13 6.74 12.96 6.66 12.89 6.6L12.38 6.1C12.31 6.03 12.23 6 12.14 6C12.05 6 11.97 6.03 11.9 6.1L7.1 10.76C7.03 10.83 7 10.91 7 11C7 11.08 7.03 11.16 7.1 11.23L11.9 15.9C11.97 15.96 12.05 16 12.14 16C12.23 16 12.31 15.96 12.38 15.9Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const _n=ae(Ya,[["render",Qa]]),ei={class:"wrapper_modifiers"},ti={class:"wrapper_nutritional_value"},ni={class:"nutritional_scheme"},oi={key:0,class:"nutritional_parameters"},ri={key:1,class:"nutritional_parameters"},si={key:2,class:"nutritional_parameters"},ai={key:3,class:"nutritional_parameters"},ii={ref:"modifierBody",class:"modifier_shadow"},li={class:"wrapper_modifiers_title"},ci={class:"wrapper_text_count_modifiers"},di=["id","aria-label","onClick","onKeydown"],ui={key:0,class:"counter_modifier"},fi={class:"hide_image_corners"},pi=["src","alt"],mi={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},hi=["src"],gi={class:"modifier_title"},_i=ae(e.defineComponent({__name:"SectionModifiers",emits:["close"],setup(n,{emit:t}){const o=t,r=we(),s=me(),{itemThemes:a}=q.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l,groupTotalAmount:c}=q.storeToRefs(s),d=e.ref(null),u=ve.useTemplateRefsList(),f=y=>{if(!y)return;const _=i.value.groupModifiers.findIndex(h=>h.id===i.value.groupCurrentOpen.id),m=i.value.plusButtonsRefs[_]||i.value.plusButtonsRefs[0];if(!m)return;const b=y.getBoundingClientRect(),B=m.getBoundingClientRect(),E=y.cloneNode(!0);E.classList.add("flyer"),Object.assign(E.style,{width:`${b.width}px`,height:`${b.height}px`,left:`${b.left}px`,top:`${b.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(E),d.value=E,requestAnimationFrame(()=>{const h=B.left+B.width/3-(b.left+b.width/2),g=B.top+B.height/4-(b.top+b.height/2),P=B.width/b.width*.2;E.style.transform=`translate(${h}px, ${g}px) scale(${P})`,E.style.opacity="0.4",E.style.transition="transform 0.5s ease, opacity 0.5s ease"}),E.addEventListener("transitionend",()=>{E.remove(),d.value=null,m.classList.add("bump"),setTimeout(()=>m.classList.remove("bump"),300)},{once:!0})};return e.watch(()=>i.value.isAnimationFly,y=>{y===!0&&i.value.currentModifier&&(f(u.value.find(_=>_.id===i.value.currentModifier.id)),i.value.isAnimationFly=!1)}),(y,_)=>{var m,b,B,E,h,g,P,O,F,D,R,S;return e.openBlock(),e.createElementBlock("div",ei,[e.createElementVNode("div",ti,[e.createElementVNode("div",{class:e.normalizeClass(["card_header_inner_back",[(m=e.unref(i).openCard)!=null&&m.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:_[0]||(_[0]=p=>o("close"))},[e.createVNode(_n,{class:"arrow_bottom"})],2),e.createElementVNode("div",ni,[(b=e.unref(i).openCard)!=null&&b.energy_amount?(e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("b",null,e.toDisplayString((B=e.unref(i).openCard)==null?void 0:B.energy_amount),1),_[1]||(_[1]=e.createElementVNode("p",null,"Килокалории",-1))])):e.createCommentVNode("",!0),(E=e.unref(i).openCard)!=null&&E.proteins_amount?(e.openBlock(),e.createElementBlock("div",ri,[e.createElementVNode("b",null,e.toDisplayString((h=e.unref(i).openCard)==null?void 0:h.proteins_amount),1),_[2]||(_[2]=e.createElementVNode("p",null,"Белки",-1))])):e.createCommentVNode("",!0),(g=e.unref(i).openCard)!=null&&g.fat_amount?(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("b",null,e.toDisplayString((P=e.unref(i).openCard)==null?void 0:P.fat_amount),1),_[3]||(_[3]=e.createElementVNode("p",null,"Жиры",-1))])):e.createCommentVNode("",!0),(O=e.unref(i).openCard)!=null&&O.carbohydrates_amount?(e.openBlock(),e.createElementBlock("div",ai,[e.createElementVNode("b",null,e.toDisplayString((F=e.unref(i).openCard)==null?void 0:F.carbohydrates_amount),1),_[4]||(_[4]=e.createElementVNode("p",null,"Углеводы",-1))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",ii,[e.createElementVNode("p",li,e.toDisplayString((D=e.unref(i).groupCurrentOpen)==null?void 0:D.name),1),e.createElementVNode("p",ci,"Выбрано "+e.toDisplayString(e.unref(l))+" из "+e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",{class:e.normalizeClass((R=e.unref(i).groupModifiers.find(p=>{var w;return p.id===((w=e.unref(i).groupCurrentOpen)==null?void 0:w.id)}))!=null&&R.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((S=e.unref(i).groupCurrentOpen)==null?void 0:S.group_modifiers)||[],p=>{var w,N,$;return e.openBlock(),e.createElementBlock("div",{key:p.id,ref_for:!0,ref:e.unref(u).set,id:p.id,class:e.normalizeClass(["modifier_card",{hidden_modifier_card:p.default_amount===0&&((w=e.unref(i).groupCurrentOpen)==null?void 0:w.id)==="Добавки2000"&&p.min_amount===0&&p.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${p.name}`,onClick:A=>e.unref(s).modifierSelect(p),onKeydown:e.withKeys(A=>e.unref(s).modifierSelect(p),["enter"])},[e.createElementVNode("div",{class:e.normalizeClass([{modifier_card_active:e.unref(i).groupModifiersSelected.some(A=>{var C;return A.group===((C=e.unref(i).groupCurrentOpen)==null?void 0:C.id)&&A.modifiers.some(T=>T.id===p.id)})},"wrapper_image_corners"])},[p.amount>1?(e.openBlock(),e.createElementBlock("div",ui,e.toDisplayString(p.amount),1)):e.createCommentVNode("",!0),e.createElementVNode("div",fi,[p.video_link?(e.openBlock(),e.createElementBlock("video",mi,[e.createElementVNode("source",{src:p.video_link||"",type:"video/webm"},null,8,hi)])):(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_image",src:p.image_link||e.unref(a).fallback_image||"",alt:p.name},null,8,pi)),e.createElementVNode("div",{class:e.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:p.min_amount>0||p.required}])},[e.createElementVNode("h3",gi,e.toDisplayString(p.name),1),e.createElementVNode("p",null,"+"+e.toDisplayString((($=(N=p.sizes)==null?void 0:N.find(A=>A.id===e.unref(i).selectedSize.id))==null?void 0:$.price)||p.price||0)+"₽",1)],2)])],2)],42,di)}),128))],2)],512)])}}}),[["__scopeId","data-v-22d945f1"]]),yi={key:0,class:"card_size_place"},bi=["onClick","onKeydown","aria-label"],wi={key:1,class:"card_size static"},ki=["onClick","onKeydown","aria-label"],yn=3,Ci=ae(e.defineComponent({__name:"SizeModifier",setup(n){const t=me(),{stateCard:o}=q.storeToRefs(t),r=e.ref(null),s=e.ref(50),a=e.ref(),i=e.ref(0),l=e.ref(0),c=e.ref(null),d=e.computed(()=>{var g;if(o.value.productSizes.length<=3)return o.value.productSizes[a.value.index]||o.value.productSizes[0];const E=i.value+1,h=((g=f.value[E])==null?void 0:g.originalIndex)??1;return o.value.productSizes[h]}),u=()=>{c.value&&o.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/yn)},f=e.computed(()=>{if(o.value.productSizes.length<=3)return o.value.productSizes;const E=o.value.productSizes;return[...E.map((h,g)=>({...h,originalIndex:g})),...E.map((h,g)=>({...h,originalIndex:g})),...E.map((h,g)=>({...h,originalIndex:g}))]}),y=(E,h)=>{if(a.value={id:E.id,title:E.name,index:h,is_default:E.is_default},E.price!==null&&o.value.openCard&&(o.value.openCard={...o.value.openCard,price:E.price}),o.value.selectedSize=E,o.value.productSizes.length>3){u();const g=i.value+1;h<g?_():h>g&&m()}else{const g=o.value.productSizes.length,P=(h+.5)*(100/g);s.value=P}},_=()=>{var E;if(!(o.value.productSizes.length<=3)){if(i.value--,i.value<o.value.productSizes.length-yn+1){i.value+=o.value.productSizes.length;const h=(E=c.value)==null?void 0:E.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}b()}},m=()=>{var E;if(!(o.value.productSizes.length<=3)){if(i.value++,i.value>=o.value.productSizes.length*2){i.value-=o.value.productSizes.length;const h=(E=c.value)==null?void 0:E.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}b()}},b=()=>{var P;if(o.value.productSizes.length<=3)return;const E=i.value+1,h=((P=f.value[E])==null?void 0:P.originalIndex)??0,g=o.value.productSizes[h];a.value={id:g.id,title:g.name,index:h,is_default:g.is_default}};e.watch(()=>[o.value.productSizes,c.value],([E=[],h])=>{if(Array.isArray(E)&&E.length>0&&h!==null){let g=E.findIndex(P=>P.is_default===!0);E.length<3&&r.value&&parseInt(r.value.style.minWidth)<767&&(r.value.style.width="100px"),g>-1?(i.value=g,y(E[g],g),l.value=120/yn):E.length===2||E.length===1?(y(E[0],0),s.value=(0+.5)*(100/2)):(y(E[1],1),s.value=(1+.5)*(100/3))}}),e.watch(()=>{var E;return[(E=o.value.selectedSize)==null?void 0:E.id,o.value.groupModifiersSelected]},([E,h])=>{if(!E||!Array.isArray(h))return;const g=h.map(P=>({...P,modifiers:P.modifiers.map(O=>{if(!O.sizes||O.sizes.length===0)return O;const F=O.sizes.find(D=>D.id===E);return F?{...O,size:F,price:F.price??O.price}:O})}));JSON.stringify(g)!==JSON.stringify(o.value.groupModifiersSelected)&&(o.value.groupModifiersSelected=g)},{deep:!0});const B={mounted:u};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",u)}),(E,h)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:r},[e.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[e.unref(o).productSizes.length>1&&a.value?(e.openBlock(),e.createElementBlock("div",yi,[e.unref(o).productSizes.length>3?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"card_size",style:e.normalizeStyle({transform:`translateX(-${i.value*l.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(g,P)=>(e.openBlock(),e.createElementBlock("li",{key:`${g.id}-${P}`,onClick:O=>y(g,P),onKeydown:e.withKeys(O=>y(g,P),["enter"]),class:e.normalizeClass({active:a.value.id===g.id&&a.value.index===g.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${g.name}`},e.toDisplayString(g.alt_name?g.alt_name:g.name),43,bi))),128))],4)):(e.openBlock(),e.createElementBlock("ul",wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).productSizes,(g,P)=>(e.openBlock(),e.createElementBlock("li",{key:`${g.id}-${P}`,onClick:O=>y(g,P),onKeydown:e.withKeys(O=>y(g,P),["enter"]),class:e.normalizeClass({active:a.value.id===g.id&&a.value.index===P}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${g.name}`},e.toDisplayString(g.alt_name?g.alt_name:g.name),43,ki))),128))])),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:2,class:"size_active",style:e.normalizeStyle(e.unref(o).productSizes.length<=3?{left:`${s.value}%`}:{})},[e.createElementVNode("p",null,e.toDisplayString(d.value.alt_name?d.value.alt_name:d.value.name),1)],4)),[[B]]):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],512)),[[e.vShow,e.unref(o).productSizes.length>1&&a.value]])}}),[["__scopeId","data-v-bc00f0e8"]]),Si="data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.3063%2019.7525C8.12104%2019.7525%208.78152%2019.1097%208.78152%2018.3167C8.78152%2017.5236%208.12104%2016.8808%207.3063%2016.8808C6.49156%2016.8808%205.83108%2017.5236%205.83108%2018.3167C5.83108%2019.1097%206.49156%2019.7525%207.3063%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M7.3063%2019.2525C7.83733%2019.2525%208.26782%2018.8335%208.26782%2018.3167C8.26782%2017.7998%207.83733%2017.3808%207.3063%2017.3808C6.77526%2017.3808%206.34478%2017.7998%206.34478%2018.3167C6.34478%2018.8335%206.77526%2019.2525%207.3063%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M14.4716%2019.7525C15.2864%2019.7525%2015.9469%2019.1097%2015.9469%2018.3167C15.9469%2017.5236%2015.2864%2016.8808%2014.4716%2016.8808C13.6569%2016.8808%2012.9964%2017.5236%2012.9964%2018.3167C12.9964%2019.1097%2013.6569%2019.7525%2014.4716%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M14.4716%2019.2525C15.0027%2019.2525%2015.4332%2018.8335%2015.4332%2018.3167C15.4332%2017.7998%2015.0027%2017.3808%2014.4716%2017.3808C13.9406%2017.3808%2013.5101%2017.7998%2013.5101%2018.3167C13.5101%2018.8335%2013.9406%2019.2525%2014.4716%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M0.770536%203.75L4.56158%206.21L6.66771%2015.23H15.1025L17.2086%208.26'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.19507%2011.95H12.2669H15.945'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.1908%200.830648V7.34648L8.26615%204.49981C8.03242%204.27231%207.64886%204.27231%207.41513%204.49981C7.35957%204.55378%207.3155%204.61788%207.28542%204.68845C7.25535%204.75902%207.23987%204.83467%207.23987%204.91106C7.23987%204.98746%207.25535%205.06311%207.28542%205.13368C7.3155%205.20425%207.35957%205.26835%207.41513%205.32231L11.3646%209.16648C11.5983%209.39398%2011.9759%209.39398%2012.2096%209.16648L16.159%205.32231C16.2145%205.26831%2016.2585%205.20419%2016.2885%205.13363C16.3186%205.06307%2016.334%204.98744%2016.334%204.91106C16.334%204.83469%2016.3186%204.75906%2016.2885%204.6885C16.2585%204.61794%2016.2145%204.55382%2016.159%204.49981C16.1035%204.44581%2016.0377%204.40297%2015.9652%204.37374C15.8927%204.34451%2015.815%204.32947%2015.7365%204.32947C15.658%204.32947%2015.5803%204.34451%2015.5078%204.37374C15.4353%204.40297%2015.3695%204.44581%2015.314%204.49981L12.3894%207.34648V0.830648C12.3894%200.509814%2012.1197%200.247314%2011.7901%200.247314C11.4604%200.247314%2011.1908%200.509814%2011.1908%200.830648Z'%20fill='%23F2F7FF'/%3e%3c/svg%3e",Ei={class:"counter_container"},Bi={class:"card_size_place_wrapper",ref:"sliderWrapper"},Ni={class:"cart_amount_counter"},xi={class:"button_circle_number"},vi=ae(e.defineComponent({__name:"NumberModifier",setup(n){const t=me(),{stateCard:o}=q.storeToRefs(t),r=()=>{var a,i;(a=o.value.openCard)!=null&&a.amount&&((i=o.value.openCard)==null?void 0:i.amount)>1&&(o.value.openCard.amount-=1)},s=()=>{var a;(a=o.value.openCard)!=null&&a.amount&&(o.value.openCard.amount+=1)};return(a,i)=>{var l,c;return e.openBlock(),e.createElementBlock("div",Ei,[e.createElementVNode("div",Bi,[e.createElementVNode("div",Ni,[e.createElementVNode("p",{class:e.normalizeClass(["cart_circle_minus",[((l=e.unref(o).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:e.withModifiers(r,["stop","prevent"])},[...i[0]||(i[0]=[e.createElementVNode("span",null,null,-1)])],2),e.createElementVNode("p",xi,e.toDisplayString((c=e.unref(o).openCard)==null?void 0:c.amount),1),e.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:e.withModifiers(s,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-c3d45434"]]);function Vo(n,t=800){const o=e.ref(n),r=e.ref(n);let s=null,a=null,i=n;const l=c=>{a||(a=c);const d=c-a,u=Math.min(d/t,1),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;o.value=Math.round(i+(r.value-i)*f),u<1?s=requestAnimationFrame(l):(o.value=r.value,s=null)};return e.watch(r,()=>{s&&cancelAnimationFrame(s),i=o.value,a=null,s=requestAnimationFrame(l)},{immediate:!0}),e.onUnmounted(()=>{s&&cancelAnimationFrame(s)}),{displayNumber:o,targetNumber:r,update:c=>{r.value=c}}}const Re=e.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(n){const t=n,{displayNumber:o,update:r}=Vo(t.price||0,t.duration||800);return e.watchEffect(()=>{r(t.price)}),(s,a)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(e.unref(o).toFixed(n.fixedFloat)),1))}}),Ti=["disabled","id"],Ye=e.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(n){const t=n,o=()=>{t.onClick()};return(r,s)=>(e.openBlock(),e.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:n.disabled,onClick:o,id:n.disabled?"buttonDefaultDisabled":""},e.toDisplayString(n.textButtonDefault),9,Ti))}});let bn=1;var $i=class{constructor(){X(this,"subscribers");X(this,"toasts");X(this,"dismissedToasts");X(this,"subscribe",n=>(this.subscribers.push(n),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}));X(this,"publish",n=>{this.subscribers.forEach(t=>t(n))});X(this,"addToast",n=>{this.publish(n),this.toasts=[...this.toasts,n]});X(this,"create",n=>{var i;const{message:t,...o}=n,r=typeof n.id=="number"||n.id&&((i=n.id)==null?void 0:i.length)>0?n.id:bn++,s=this.toasts.find(l=>l.id===r),a=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),s?this.toasts=this.toasts.map(l=>l.id===r?(this.publish({...l,...n,id:r,title:t}),{...l,...n,id:r,dismissible:a,title:t}):l):this.addToast({title:t,...o,dismissible:a,id:r}),r});X(this,"dismiss",n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:n,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(o=>o({id:t.id,dismiss:!0}))}),n));X(this,"message",(n,t)=>this.create({...t,message:n,type:"default"}));X(this,"error",(n,t)=>this.create({...t,type:"error",message:n}));X(this,"success",(n,t)=>this.create({...t,type:"success",message:n}));X(this,"info",(n,t)=>this.create({...t,type:"info",message:n}));X(this,"warning",(n,t)=>this.create({...t,type:"warning",message:n}));X(this,"loading",(n,t)=>this.create({...t,type:"loading",message:n}));X(this,"promise",(n,t)=>{if(!t)return;let o;t.loading!==void 0&&(o=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const r=Promise.resolve(n instanceof Function?n():n);let s=o!==void 0,a;const i=r.then(async c=>{if(a=["resolve",c],e.isVNode(c))s=!1,this.create({id:o,type:"default",message:c});else if(Mi(c)&&!c.ok){s=!1;const u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description,_=typeof u=="object"&&!e.isVNode(u)?u:{message:u||"",id:o||""};this.create({id:o,type:"error",description:f,..._})}else if(c instanceof Error){s=!1;const u=typeof t.error=="function"?await t.error(c):t.error,f=typeof t.description=="function"?await t.description(c):t.description,_=typeof u=="object"&&!e.isVNode(u)?u:{message:u||"",id:o||""};this.create({id:o,type:"error",description:f,..._})}else if(t.success!==void 0){s=!1;const u=typeof t.success=="function"?await t.success(c):t.success,f=typeof t.description=="function"?await t.description(c):t.description,_=typeof u=="object"&&!e.isVNode(u)?u:{message:u||"",id:o||""};this.create({id:o,type:"success",description:f,..._})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){s=!1;const d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description,y=typeof d=="object"&&!e.isVNode(d)?d:{message:d||"",id:o||""};this.create({id:o,type:"error",description:u,...y})}}).finally(()=>{var c;s&&(this.dismiss(o),o=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>i.then(()=>a[0]==="reject"?d(a[1]):c(a[1])).catch(d));return typeof o!="string"&&typeof o!="number"?{unwrap:l}:Object.assign(o,{unwrap:l})});X(this,"custom",(n,t)=>{const o=(t==null?void 0:t.id)||bn++,r=this.toasts.find(a=>a.id===o),s=(t==null?void 0:t.dismissible)===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),r?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,component:n,dismissible:s,id:o,...t}),{...a,component:n,dismissible:s,id:o,...t}):a):this.addToast({component:n,dismissible:s,id:o,...t}),o});X(this,"getActiveToasts",()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)));this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}};const Se=new $i;function Ai(n,t){const o=(t==null?void 0:t.id)||bn++;return Se.create({message:n,id:o,type:"default",...t}),o}const Mi=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",Pi=Ai,Ii=()=>Se.toasts,Vi=()=>Se.getActiveToasts(),Ri=Object.assign(Pi,{success:Se.success,info:Se.info,warning:Se.warning,error:Se.error,custom:Se.custom,message:Se.message,promise:Se.promise,dismiss:Se.dismiss,loading:Se.loading},{getHistory:Ii,getToasts:Vi});function Ot(n){return n.label!==void 0}const Di=3,Ro="24px",Do="16px",Oo=4e3,Oi=356,Li=14,Fi=45,Lo=200;function zi(){const n=e.ref(!1);return e.watchEffect(()=>{const t=()=>{n.value=document.hidden};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)}),{isDocumentHidden:n}}function He(...n){return n.filter(Boolean).join(" ")}function Ui(n){const[t,o]=n.split("-"),r=[];return t&&r.push(t),o&&r.push(o),r}function Hi(n,t){const o={};return[n,t].forEach((r,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?Do:Ro;function c(d){["top","right","bottom","left"].forEach(u=>{o[`${i}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?o[`${i}-${d}`]=l:o[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),o}const ji=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],qi=["aria-label","data-disabled","data-close-button-position"];var Wi=e.defineComponent({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(n,{emit:t}){const o=n,r=t,s=e.ref(null),a=e.ref(null),i=e.ref(!1),l=e.ref(!1),c=e.ref(!1),d=e.ref(!1),u=e.ref(!1),f=e.ref(0),y=e.ref(0),_=e.ref(o.toast.duration||o.duration||Oo),m=e.ref(null),b=e.ref(null),B=e.computed(()=>o.index===0),E=e.computed(()=>o.index+1<=o.visibleToasts),h=e.computed(()=>o.toast.type),g=e.computed(()=>o.toast.dismissible!==!1),P=e.computed(()=>o.toast.class||""),O=e.computed(()=>o.descriptionClass||""),F=e.computed(()=>{const M=o.toast.position||o.position,ee=o.heights.filter(Y=>Y.position===M).findIndex(Y=>Y.toastId===o.toast.id);return ee>=0?ee:0}),D=e.computed(()=>{const M=o.toast.position||o.position;return o.heights.filter(ee=>ee.position===M).reduce((ee,Y,U)=>U>=F.value?ee:ee+Y.height,0)}),R=e.computed(()=>F.value*o.gap+D.value||0),S=e.computed(()=>o.toast.closeButton??o.closeButton),p=e.computed(()=>o.toast.duration||o.duration||Oo),w=e.ref(0),N=e.ref(0),$=e.ref(null),A=e.computed(()=>o.position.split("-")),C=e.computed(()=>A.value[0]),T=e.computed(()=>A.value[1]),I=e.computed(()=>typeof o.toast.title!="string"),k=e.computed(()=>typeof o.toast.description!="string"),{isDocumentHidden:x}=zi(),V=e.computed(()=>h.value&&h.value==="loading");e.onMounted(()=>{i.value=!0,_.value=p.value}),e.watchEffect(async()=>{if(!i.value||!b.value)return;await e.nextTick();const M=b.value,J=M.style.height;M.style.height="auto";const ee=M.getBoundingClientRect().height;M.style.height=J,y.value=ee,r("update:height",{toastId:o.toast.id,height:ee,position:o.toast.position||o.position})});function L(){l.value=!0,f.value=R.value,setTimeout(()=>{r("removeToast",o.toast)},Lo)}function G(){var M,J;if(V.value||!g.value)return{};L(),(J=(M=o.toast).onDismiss)==null||J.call(M,o.toast)}function W(M){M.button!==2&&(V.value||!g.value||(m.value=new Date,f.value=R.value,M.target.setPointerCapture(M.pointerId),M.target.tagName!=="BUTTON"&&(c.value=!0,$.value={x:M.clientX,y:M.clientY})))}function Z(){var te,j,z,oe,pe,Ne,de;if(d.value||!g.value)return;$.value=null;const M=Number(((te=b.value)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),J=Number(((j=b.value)==null?void 0:j.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ee=new Date().getTime()-(((z=m.value)==null?void 0:z.getTime())||0),Y=s.value==="x"?M:J,U=Math.abs(Y)/ee;if(Math.abs(Y)>=Fi||U>.11){f.value=R.value,(pe=(oe=o.toast).onDismiss)==null||pe.call(oe,o.toast),s.value==="x"?a.value=M>0?"right":"left":a.value=J>0?"down":"up",L(),d.value=!0;return}else(Ne=b.value)==null||Ne.style.setProperty("--swipe-amount-x","0px"),(de=b.value)==null||de.style.setProperty("--swipe-amount-y","0px");u.value=!1,c.value=!1,s.value=null}function se(M){var z,oe,pe,Ne;if(!$.value||!g.value||(((oe=(z=window==null?void 0:window.getSelection())==null?void 0:z.toString())==null?void 0:oe.length)??!1))return;const ee=M.clientY-$.value.y,Y=M.clientX-$.value.x,U=o.swipeDirections??Ui(o.position);!s.value&&(Math.abs(Y)>1||Math.abs(ee)>1)&&(s.value=Math.abs(Y)>Math.abs(ee)?"x":"y");let te={x:0,y:0};const j=de=>1/(1.5+Math.abs(de)/20);if(s.value==="y"){if(U.includes("top")||U.includes("bottom"))if(U.includes("top")&&ee<0||U.includes("bottom")&&ee>0)te.y=ee;else{const de=ee*j(ee);te.y=Math.abs(de)<Math.abs(ee)?de:ee}}else if(s.value==="x"&&(U.includes("left")||U.includes("right")))if(U.includes("left")&&Y<0||U.includes("right")&&Y>0)te.x=Y;else{const de=Y*j(Y);te.x=Math.abs(de)<Math.abs(Y)?de:Y}(Math.abs(te.x)>0||Math.abs(te.y)>0)&&(u.value=!0),(pe=b.value)==null||pe.style.setProperty("--swipe-amount-x",`${te.x}px`),(Ne=b.value)==null||Ne.style.setProperty("--swipe-amount-y",`${te.y}px`)}e.onMounted(()=>{if(i.value=!0,!b.value)return;const M=b.value.getBoundingClientRect().height;y.value=M;const J=[{toastId:o.toast.id,height:M,position:o.toast.position},...o.heights];r("update:heights",J)}),e.onBeforeUnmount(()=>{b.value&&r("removeToast",o.toast)}),e.watchEffect(M=>{if(o.toast.promise&&h.value==="loading"||o.toast.duration===1/0||o.toast.type==="loading")return;let J;const ee=()=>{if(N.value<w.value){const U=new Date().getTime()-w.value;_.value=_.value-U}N.value=new Date().getTime()},Y=()=>{_.value!==1/0&&(w.value=new Date().getTime(),J=setTimeout(()=>{var U,te;(te=(U=o.toast).onAutoClose)==null||te.call(U,o.toast),L()},_.value))};o.expanded||o.interacting||x.value?ee():Y(),M(()=>{clearTimeout(J)})}),e.watch(()=>o.toast.delete,M=>{var J,ee;M!==void 0&&M&&(L(),(ee=(J=o.toast).onDismiss)==null||ee.call(J,o.toast))},{deep:!0});function ce(){c.value=!1,s.value=null,$.value=null}return(M,J)=>{var ee,Y,U,te,j,z,oe,pe,Ne,de,ie,Ae,be,he,ge,xe,qe,Ht,jt,ar,ir,lr,cr,dr,ur,fr,pr;return e.openBlock(),e.createElementBlock("li",{tabindex:"0",ref_key:"toastRef",ref:b,class:e.normalizeClass(e.unref(He)(o.class,P.value,(ee=M.classes)==null?void 0:ee.toast,(Y=M.toast.classes)==null?void 0:Y.toast,(U=M.classes)==null?void 0:U[h.value],(j=(te=M.toast)==null?void 0:te.classes)==null?void 0:j[h.value])),"data-sonner-toast":"","data-rich-colors":M.toast.richColors??M.defaultRichColors,"data-styled":!(M.toast.component||(z=M.toast)!=null&&z.unstyled||M.unstyled),"data-mounted":i.value,"data-promise":!!M.toast.promise,"data-swiped":u.value,"data-removed":l.value,"data-visible":E.value,"data-y-position":C.value,"data-x-position":T.value,"data-index":M.index,"data-front":B.value,"data-swiping":c.value,"data-dismissible":g.value,"data-type":h.value,"data-invert":M.toast.invert||M.invert,"data-swipe-out":d.value,"data-swipe-direction":a.value,"data-expanded":!!(M.expanded||M.expandByDefault&&i.value),"data-testid":M.toast.testId,style:e.normalizeStyle({"--index":M.index,"--toasts-before":M.index,"--z-index":M.toasts.length-M.index,"--offset":`${l.value?f.value:R.value}px`,"--initial-height":M.expandByDefault?"auto":`${y.value}px`,...M.style,...o.toast.style}),onDragend:ce,onPointerdown:W,onPointerup:Z,onPointermove:se},[S.value&&!M.toast.component&&h.value!=="loading"?(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":M.closeButtonAriaLabel||"Close toast","data-disabled":V.value,"data-close-button":"true","data-close-button-position":M.closeButtonPosition,class:e.normalizeClass(e.unref(He)((oe=M.classes)==null?void 0:oe.closeButton,(Ne=(pe=M.toast)==null?void 0:pe.classes)==null?void 0:Ne.closeButton)),onClick:G},[(de=M.icons)!=null&&de.close?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((ie=M.icons)==null?void 0:ie.close),{key:0})):e.renderSlot(M.$slots,"close-icon",{key:1})],10,qi)):e.createCommentVNode("v-if",!0),M.toast.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(M.toast.component),e.mergeProps({key:1},M.toast.componentProps,{onCloseToast:G,isPaused:M.$props.expanded||M.$props.interacting||e.unref(x)}),null,16,["isPaused"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[h.value!=="default"||M.toast.icon||M.toast.promise?(e.openBlock(),e.createElementBlock("div",{key:0,"data-icon":"",class:e.normalizeClass(e.unref(He)((Ae=M.classes)==null?void 0:Ae.icon,(he=(be=M.toast)==null?void 0:be.classes)==null?void 0:he.icon))},[M.toast.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(M.toast.icon),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h.value==="loading"?e.renderSlot(M.$slots,"loading-icon",{key:0}):h.value==="success"?e.renderSlot(M.$slots,"success-icon",{key:1}):h.value==="error"?e.renderSlot(M.$slots,"error-icon",{key:2}):h.value==="warning"?e.renderSlot(M.$slots,"warning-icon",{key:3}):h.value==="info"?e.renderSlot(M.$slots,"info-icon",{key:4}):e.createCommentVNode("v-if",!0)],64))],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{"data-content":"",class:e.normalizeClass(e.unref(He)((ge=M.classes)==null?void 0:ge.content,(qe=(xe=M.toast)==null?void 0:xe.classes)==null?void 0:qe.content))},[e.createElementVNode("div",{"data-title":"",class:e.normalizeClass(e.unref(He)((Ht=M.classes)==null?void 0:Ht.title,(jt=M.toast.classes)==null?void 0:jt.title))},[I.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(M.toast.title),e.normalizeProps(e.mergeProps({key:0},M.toast.componentProps)),null,16)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(M.toast.title),1)],64))],2),M.toast.description?(e.openBlock(),e.createElementBlock("div",{key:0,"data-description":"",class:e.normalizeClass(e.unref(He)(M.descriptionClass,O.value,(ar=M.classes)==null?void 0:ar.description,(ir=M.toast.classes)==null?void 0:ir.description))},[k.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(M.toast.description),e.normalizeProps(e.mergeProps({key:0},M.toast.componentProps)),null,16)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(M.toast.description),1)],64))],2)):e.createCommentVNode("v-if",!0)],2),M.toast.cancel?(e.openBlock(),e.createElementBlock("button",{key:1,style:e.normalizeStyle(M.toast.cancelButtonStyle||M.cancelButtonStyle),class:e.normalizeClass(e.unref(He)((lr=M.classes)==null?void 0:lr.cancelButton,(cr=M.toast.classes)==null?void 0:cr.cancelButton)),"data-button":"","data-cancel":"",onClick:J[0]||(J[0]=qt=>{var kt,Ct;e.unref(Ot)(M.toast.cancel)&&g.value&&((Ct=(kt=M.toast.cancel).onClick)==null||Ct.call(kt,qt),L())})},e.toDisplayString(e.unref(Ot)(M.toast.cancel)?(dr=M.toast.cancel)==null?void 0:dr.label:M.toast.cancel),7)):e.createCommentVNode("v-if",!0),M.toast.action?(e.openBlock(),e.createElementBlock("button",{key:2,style:e.normalizeStyle(M.toast.actionButtonStyle||M.actionButtonStyle),class:e.normalizeClass(e.unref(He)((ur=M.classes)==null?void 0:ur.actionButton,(fr=M.toast.classes)==null?void 0:fr.actionButton)),"data-button":"","data-action":"",onClick:J[1]||(J[1]=qt=>{var kt,Ct;e.unref(Ot)(M.toast.action)&&((Ct=(kt=M.toast.action).onClick)==null||Ct.call(kt,qt),!qt.defaultPrevented&&L())})},e.toDisplayString(e.unref(Ot)(M.toast.action)?(pr=M.toast.action)==null?void 0:pr.label:M.toast.action),7)):e.createCommentVNode("v-if",!0)],64))],46,ji)}}}),Gi=Wi,yt=(n,t)=>{const o=n.__vccOpts||n;for(const[r,s]of t)o[r]=s;return o};const Ki={},Ji={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function Xi(n,t){return e.openBlock(),e.createElementBlock("svg",Ji,t[0]||(t[0]=[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var Yi=yt(Ki,[["render",Xi]]);const Zi=["data-visible"],Qi={class:"sonner-spinner"};var el=e.defineComponent({__name:"Loader",props:{visible:{type:Boolean}},setup(n){const t=Array(12).fill(0);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"sonner-loading-wrapper","data-visible":o.visible},[e.createElementVNode("div",Qi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t),s=>(e.openBlock(),e.createElementBlock("div",{key:`spinner-bar-${s}`,class:"sonner-loading-bar"}))),128))])],8,Zi))}}),tl=el;const nl={},ol={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function rl(n,t){return e.openBlock(),e.createElementBlock("svg",ol,t[0]||(t[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var sl=yt(nl,[["render",rl]]);const al={},il={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function ll(n,t){return e.openBlock(),e.createElementBlock("svg",il,t[0]||(t[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var cl=yt(al,[["render",ll]]);const dl={},ul={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function fl(n,t){return e.openBlock(),e.createElementBlock("svg",ul,t[0]||(t[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var pl=yt(dl,[["render",fl]]);const ml={},hl={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function gl(n,t){return e.openBlock(),e.createElementBlock("svg",hl,t[0]||(t[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var _l=yt(ml,[["render",gl]]);const yl=["aria-label"],bl=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],wl=typeof window<"u"&&typeof document<"u";function kl(){if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}var Cl=e.defineComponent({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:Li},visibleToasts:{default:Di},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:Ro},mobileOffset:{default:Do},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(n){const t=n,o=e.useAttrs(),r=e.ref([]),s=e.computed(()=>t.id?r.value.filter(p=>p.toasterId===t.id):r.value.filter(p=>!p.toasterId));function a(p,w){return s.value.filter(N=>!N.position&&w===0||N.position===p)}const i=e.computed(()=>{const p=s.value.filter(w=>w.position).map(w=>w.position);return p.length>0?Array.from(new Set([t.position].concat(p))):[t.position]}),l=e.computed(()=>{const p={};return i.value.forEach(w=>{p[w]=r.value.filter(N=>N.position===w)}),p}),c=e.ref([]),d=e.ref({}),u=e.ref(!1);e.watchEffect(()=>{i.value.forEach(p=>{p in d.value||(d.value[p]=!1)})});const f=e.ref(t.theme!=="system"?t.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),y=e.ref(null),_=e.ref(null),m=e.ref(!1),b=t.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function B(p){var w;(w=r.value.find(N=>N.id===p.id))!=null&&w.delete||Se.dismiss(p.id),r.value=r.value.filter(({id:N})=>N!==p.id),setTimeout(()=>{r.value.find(N=>N.id===p.id)||(c.value=c.value.filter(N=>N.toastId!==p.id))},Lo+50)}function E(p){var w,N;m.value&&!((N=(w=p.currentTarget)==null?void 0:w.contains)!=null&&N.call(w,p.relatedTarget))&&(m.value=!1,_.value&&(_.value.focus({preventScroll:!0}),_.value=null))}function h(p){p.target instanceof HTMLElement&&p.target.dataset.dismissible==="false"||m.value||(m.value=!0,_.value=p.relatedTarget)}function g(p){p.target&&p.target instanceof HTMLElement&&p.target.dataset.dismissible==="false"||(u.value=!0)}e.watchEffect(p=>{const w=Se.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{r.value=r.value.map($=>$.id===N.id?{...$,delete:!0}:$)});return}e.nextTick(()=>{const $=r.value.findIndex(A=>A.id===N.id);$!==-1?r.value=[...r.value.slice(0,$),{...r.value[$],...N},...r.value.slice($+1)]:r.value=[N,...r.value]})});p(w)}),e.watchEffect(p=>{if(typeof window>"u")return;if(t.theme!=="system"){f.value=t.theme;return}const w=window.matchMedia("(prefers-color-scheme: dark)"),N=A=>{f.value=A?"dark":"light"};N(w.matches);const $=A=>{N(A.matches)};try{w.addEventListener("change",$)}catch{w.addListener($)}p(()=>{try{w.removeEventListener("change",$)}catch{w.removeListener($)}})}),e.watchEffect(()=>{y.value&&_.value&&(_.value.focus({preventScroll:!0}),_.value=null,m.value=!1)}),e.watchEffect(()=>{r.value.length<=1&&Object.keys(d.value).forEach(p=>{d.value[p]=!1})}),e.watchEffect(p=>{function w(N){const $=t.hotkey.every(T=>N[T]||N.code===T),A=Array.isArray(y.value)?y.value[0]:y.value;$&&(i.value.forEach(T=>{d.value[T]=!0}),A==null||A.focus());const C=document.activeElement===y.value||(A==null?void 0:A.contains(document.activeElement));N.code==="Escape"&&C&&i.value.forEach(T=>{d.value[T]=!1})}wl&&(document.addEventListener("keydown",w),p(()=>{document.removeEventListener("keydown",w)}))});function P(p){const w=p.currentTarget,N=w.getAttribute("data-y-position")+"-"+w.getAttribute("data-x-position");d.value[N]=!0}function O(p){if(!u.value){const w=p.currentTarget,N=w.getAttribute("data-y-position")+"-"+w.getAttribute("data-x-position");d.value[N]=!1}}function F(){Object.keys(d.value).forEach(p=>{d.value[p]=!1})}function D(){u.value=!1}function R(p){c.value=p}function S(p){const w=c.value.findIndex(N=>N.toastId===p.toastId);if(w!==-1)c.value[w]=p;else{const N=c.value.findIndex($=>$.position===p.position);N!==-1?c.value.splice(N,0,p):c.value.unshift(p)}}return(p,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createCommentVNode(" Remove item from normal navigation flow, only available via hotkey "),e.createElementVNode("section",{"aria-label":`${p.containerAriaLabel} ${e.unref(b)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(N,$)=>{var A;return e.openBlock(),e.createElementBlock("ol",e.mergeProps({key:N,ref_for:!0,ref_key:"listRef",ref:y,"data-sonner-toaster":"","data-sonner-theme":f.value,class:t.class,dir:p.dir==="auto"?kl():p.dir,tabIndex:-1,"data-theme":p.theme,"data-rich-colors":p.richColors,"data-y-position":N.split("-")[0],"data-x-position":N.split("-")[1],style:{"--front-toast-height":`${((A=c.value[0])==null?void 0:A.height)||0}px`,"--width":`${e.unref(Oi)}px`,"--gap":`${p.gap}px`,...p.style,...e.unref(o).style,...e.unref(Hi)(p.offset,p.mobileOffset)}},{ref_for:!0},p.$attrs,{onBlur:E,onFocus:h,onMouseenter:P,onMousemove:P,onMouseleave:O,onDragend:F,onPointerdown:g,onPointerup:D}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a(N,$),(C,T)=>{var I,k,x,V,L,G,W,Z,se,ce,M;return e.openBlock(),e.createBlock(Gi,{key:C.id,heights:c.value,icons:p.icons,index:T,toast:C,defaultRichColors:p.richColors,duration:((I=p.toastOptions)==null?void 0:I.duration)??p.duration,class:e.normalizeClass(((k=p.toastOptions)==null?void 0:k.class)??""),descriptionClass:(x=p.toastOptions)==null?void 0:x.descriptionClass,invert:p.invert,visibleToasts:p.visibleToasts,closeButton:((V=p.toastOptions)==null?void 0:V.closeButton)??p.closeButton,interacting:u.value,position:N,closeButtonPosition:((L=p.toastOptions)==null?void 0:L.closeButtonPosition)??p.closeButtonPosition,style:e.normalizeStyle((G=p.toastOptions)==null?void 0:G.style),unstyled:(W=p.toastOptions)==null?void 0:W.unstyled,classes:(Z=p.toastOptions)==null?void 0:Z.classes,cancelButtonStyle:(se=p.toastOptions)==null?void 0:se.cancelButtonStyle,actionButtonStyle:(ce=p.toastOptions)==null?void 0:ce.actionButtonStyle,"close-button-aria-label":(M=p.toastOptions)==null?void 0:M.closeButtonAriaLabel,toasts:l.value[N],expandByDefault:p.expand,gap:p.gap,expanded:d.value[N]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":R,"onUpdate:height":S,onRemoveToast:B},{"close-icon":e.withCtx(()=>[e.renderSlot(p.$slots,"close-icon",{},()=>[e.createVNode(Yi)])]),"loading-icon":e.withCtx(()=>[e.renderSlot(p.$slots,"loading-icon",{},()=>[e.createVNode(tl,{visible:C.type==="loading"},null,8,["visible"])])]),"success-icon":e.withCtx(()=>[e.renderSlot(p.$slots,"success-icon",{},()=>[e.createVNode(sl)])]),"error-icon":e.withCtx(()=>[e.renderSlot(p.$slots,"error-icon",{},()=>[e.createVNode(_l)])]),"warning-icon":e.withCtx(()=>[e.renderSlot(p.$slots,"warning-icon",{},()=>[e.createVNode(pl)])]),"info-icon":e.withCtx(()=>[e.renderSlot(p.$slots,"info-icon",{},()=>[e.createVNode(cl)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"])}),128))],16,bl)}),128))],8,yl)],2112))}}),Fo=Cl;const Sl={class:"notification_18plus_image"},El=["src"],Bl={class:"notification_18plus_text"},Nl={class:"notification_18plus_accept"},wn=e.defineComponent({__name:"NotificationWindow",props:e.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean},is_qr:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(n){const t=n,o=we(),r=fe(),{is18Allowed:s,notificationData_lib:a}=q.storeToRefs(r),{itemThemes:i}=q.storeToRefs(o),l=e.computed(()=>t.backgroundColor||"rgba(50, 50, 50, 0.9)"),c=e.useModel(n,"visible"),d=()=>{a.value.fastAdd&&(r.addToCart(a.value.fastAdd),a.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),s.value=!0,c.value=!1};return e.onMounted(()=>{}),(u,f)=>{const y=e.resolveComponent("InfoIcon");return e.openBlock(),e.createElementBlock(e.Fragment,null,[n.type?(e.openBlock(),e.createBlock(e.unref(Fo),{key:0,toastOptions:{style:{background:l.value}},position:"top-center",closeButton:""},{default:e.withCtx(()=>[e.createElementVNode("div",Sl,[e.createElementVNode("img",{src:e.unref(i).adult_disclaimer_image||e.unref(i).fallback_image,alt:"Дисклеймер"},null,8,El)]),e.createElementVNode("div",Bl,e.toDisplayString(e.unref(i).adult_disclaimer_text),1),e.createElementVNode("div",Nl,[f[1]||(f[1]=e.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой.",-1)),e.createVNode(Ye,{textButtonDefault:"Мне есть 18",onClick:d,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])]),_:1},8,["toastOptions"])):(e.openBlock(),e.createBlock(e.unref(Fo),{key:1,toastOptions:{style:{background:l.value}},position:"top-center",duration:2e3},{"info-icon":e.withCtx(()=>[e.createVNode(y)]),_:1},8,["toastOptions"])),e.createElementVNode("button",{onClick:f[0]||(f[0]=()=>e.unref(Ri)("My first toast"))},"Render a toast")],64)}}}),xl={class:"button_price button_price_modifiers"},vl=["src"],Tl={class:"button_text_container"},$l={class:"button_text_price"},Al=ae(e.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(n){const t=Q.useRouter(),o=Q.useRoute(),r=me(),s=fe(),a=we(),i=e.ref([]),l=e.ref([]),c=n,{stateCard:d,totalPrice_libCard:u,isOpenWindow:f,isAddToCard:y}=q.storeToRefs(r),{itemThemes:_}=q.storeToRefs(a),m=e.ref(!0),b=e.ref(!1),B=()=>{var h,g,P,O,F,D;if(m.value){r.setCurrentCard(d.value.openCard),b.value=!0;const R=d.value.groupModifiers.findIndex(S=>r.checkedRequiredBtn.group.id===S.id);r.checkedRequiredBtn.haveRequaire&&r.toggleNotRequire(r.checkedRequiredBtn.group,R);return}const E=d.value.groupModifiersSelected||[];if(i.value=[],l.value=[],Array.isArray(E)&&E.length>0&&E.forEach(R=>{const S=R.group,p=R.modifiers||[];S==="Добавки2000"?i.value=p.map(w=>{var N;return{...w,old_price:w.price,size:Array.isArray(w.size)?w.size.map($=>$.id).filter(Boolean):(N=w.size)!=null&&N.id?w.size.id:void 0}}):p.length>0&&l.value.push({group:S,modifiers:p.map(w=>{var N;return{...w,old_price:w.price,size:Array.isArray(w.size)?w.size.map($=>$.id).filter(Boolean):(N=w.size)!=null&&N.id?w.size.id:void 0}})})}),document.body.style.overflow="",d.value.openCard){const R={id:d.value.openCard.id,is_fake:d.value.openCard.is_fake||!1,amount:d.value.openCard.amount,name:d.value.openCard.name,image_link:d.value.openCard.image_link,price:d.value.openCard.price,old_price:d.value.openCard.price,size:((h=d.value.selectedSize)==null?void 0:h.id)??((P=(g=d.value.openCard.sizes)==null?void 0:g.find(S=>S.is_default))==null?void 0:P.id),sizes:((O=d.value.selectedSize)==null?void 0:O.id)??((D=(F=d.value.openCard.sizes)==null?void 0:F.find(S=>S.is_default))==null?void 0:D.id),modifiers:i.value,groups:d.value.openCard.groups,group_modifiers:l.value,energy_amount:d.value.openCard.energy_amount??0,proteins_amount:d.value.openCard.proteins_amount??0,fat_amount:d.value.openCard.fat_amount??0,carbohydrates_amount:d.value.openCard.carbohydrates_amount??0};c.closeProduct&&c.closeProduct(),s.addToCart(R),y.value=!0}f.value=!1,t.push(`/${o.params.orgId}/`)};return e.watch(()=>d.value.productSizes,E=>{!E||E.length===0||!d.value.selectedSize||(d.value.selectedSize={...d.value.selectedSize})},{immediate:!0}),e.watchEffect(()=>{r.checkedRequiredBtn.haveRequaire?m.value=!0:m.value=!1}),e.onMounted(()=>{y.value=!1}),(E,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(wn,{visible:b.value,textNotificationDefault:e.unref(d).textErrorRequaired,backgroundColor:e.unref(_).accent_color?e.unref(_).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":h[0]||(h[0]=g=>b.value=g)},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:h[3]||(h[3]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[4]||(h[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",xl,[e.createVNode(vi),e.createElementVNode("div",{class:e.normalizeClass(["card_product_button_buy",{buy_active:!m.value}]),"data-clickable":"true",onClick:B,onTouchstart:h[1]||(h[1]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[2]||(h[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{src:e.unref(Si),class:"card_product_button_icon"},null,8,vl),e.createElementVNode("div",Tl,[e.createElementVNode("p",$l,[e.createVNode(Re,{price:+e.unref(u),fixedFloat:2},null,8,["price"]),h[5]||(h[5]=e.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-dbbf98fb"]]),Ml={class:"modified_amount"},Pl={class:"hide_image_corners"},Il=["src"],Vl={class:"wrapper_modifier_title"},Rl={class:"amount_title"},Dl={class:"wrapper_amount_counter"},Ol={class:"amount_count"},Ll={class:"amount_wrapper"},Fl={class:"add_counter_amount"},zl=ae(e.defineComponent({__name:"ModalAmount",setup(n){const t=me(),o=we(),{itemThemes:r}=q.storeToRefs(o),{stateCard:s}=q.storeToRefs(t),a=e.computed(()=>{var c,d,u;return((u=(d=(c=s.value.currentModifier)==null?void 0:c.sizes)==null?void 0:d.find(f=>f.id===s.value.selectedSize.id))==null?void 0:u.price)??ut(s.value.currentModifier)}),i=()=>{s.value.currentModifier&&(s.value.currentModifier.amount=s.value.modalCount),t.modifierSelect(s.value.currentModifier),s.value.isModifiedAmount=!1},l=()=>{s.value.modalCount=1,s.value.currentModifier.amount=1};return(c,d)=>{var u,f;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ml,[e.createElementVNode("div",Pl,[e.createElementVNode("img",{class:"modifier_image",src:((u=e.unref(s).currentModifier)==null?void 0:u.image_link)||e.unref(r).fallback_image||""},null,8,Il),e.createElementVNode("div",Vl,[e.createElementVNode("p",Rl,e.toDisplayString((f=e.unref(s).currentModifier)==null?void 0:f.name),1),e.createElementVNode("p",null,"+ "+e.toDisplayString(a.value)+"₽",1)])])]),e.createElementVNode("div",Dl,[e.createElementVNode("div",{class:"amount_mines",onClick:d[0]||(d[0]=e.withModifiers((...y)=>e.unref(t).minusAmount&&e.unref(t).minusAmount(...y),["stop"]))},[...d[1]||(d[1]=[e.createElementVNode("div",null,null,-1)])]),e.createElementVNode("p",Ol,e.toDisplayString(e.unref(s).modalCount),1),e.createElementVNode("div",Ll,[e.createVNode(gn,{onClick:e.withModifiers(e.unref(t).plusAmount,["stop"])},null,8,["onClick"])])]),e.createElementVNode("p",{class:"clear_count",onClick:e.withModifiers(l,["stop"])},"Убрать все"),e.createElementVNode("div",Fl,[e.createVNode(Ye,{textButtonDefault:"Добавить",onClick:i,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-6b4f039c"]]),Ul=(n,t,o)=>Math.max(t,Math.min(n,o)),Hl=(n,t)=>Math.pow(n,t*5),zo=(n,t,o)=>t===0||Math.abs(t)===1/0?Hl(n,o):n*t*o/(t+o*n),Lt=(n,t)=>t*parseFloat(n)/100,kn=(n,t,o,r=.15)=>r===0?Ul(n,t,o):n<t?-zo(t-n,o-t,r)+t:n>o?+zo(n-o,o-t,r)+o:n,$e=(n,{min:t,max:o})=>t!==void 0&&n<t?t:o!==void 0&&n>o?o:n;function jl(n,t,o){const r=e.ref(0),s=e.computed(()=>n.value.map(c=>typeof c=="string"?Lt(c,o.value):c)),a=e.computed(()=>Math.min(...s.value)),i=e.computed(()=>Math.max(...s.value)),l=e.computed(()=>{const c=s.value.reduce((d,u)=>Math.abs(u-t.value)<Math.abs(d-t.value)?u:d);return s.value.indexOf(c)});return{currentSnapPointIndex:r,flattenedSnapPoints:s,minSnapPoint:a,maxSnapPoint:i,closestSnapPointIndex:l}}const Uo=ae(e.defineComponent({__name:"BottomSheet",props:{duration:{default:250},snapPoints:{},initialSnapPoint:{},blocking:{type:Boolean,default:!0},canSwipeClose:{type:Boolean,default:!0},swipeCloseThreshold:{},canBackdropClose:{type:Boolean,default:!0},expandOnContentDrag:{type:Boolean,default:!0},modelValue:{type:Boolean},teleportTo:{default:"body"},teleportDefer:{type:Boolean,default:!1},headerClass:{},contentClass:{},footerClass:{}},emits:["opened","opening-started","closed","closing-started","ready","dragging-up","dragging-down","snapped","instinctHeight","update:modelValue"],setup(n,{expose:t,emit:o}){const r=n,s=o,a=ve.useVModel(r,"modelValue",s,{passive:!0});e.watch(a,U=>{U&&x()}),e.onMounted(()=>{a.value&&x()});const i=e.ref(),l=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),f=e.ref(r.expandOnContentDrag),{height:y}=ve.useWindowSize(),{height:_}=ve.useElementBounding(i),{height:m}=ve.useElementBounding(l),{height:b}=ve.useElementBounding(u),{height:B}=ve.useElementBounding(c),E=e.computed({get(){return $e(Math.ceil(b.value+m.value+B.value),{max:y.value})},set(U){[m.value,b.value,B.value]=U}}),h=e.ref(0),g=e.ref(0),P=_e.useMotionValue(0),O=_e.useMotionValue(0),{snapPoints:F}=e.toRefs(r),D=e.computed(()=>F.value??[E.value]),{flattenedSnapPoints:R,currentSnapPointIndex:S,closestSnapPointIndex:p,minSnapPoint:w,maxSnapPoint:N}=jl(D,h,y);let $;function A(U){f.value=!0,C(U)}function C(U){f.value&&U.preventDefault()}const T=U=>{U.key==="Escape"&&L()},I=()=>{r.canBackdropClose&&L()};let k=!1;const x=async()=>{if(k)return;a.value=!0,k=!0,s("opening-started"),await e.nextTick();const U=i.value.$el;_.value=U.getBoundingClientRect().height;const te=U.querySelector("[data-vsbs-content]"),j=U.querySelector("[data-vsbs-header]"),z=U.querySelector("[data-vsbs-footer]");if(E.value=[j.getBoundingClientRect().height,te.getBoundingClientRect().height,z.getBoundingClientRect().height],await e.nextTick(),S.value=R.value.findIndex(oe=>oe===w.value),r.initialSnapPoint){const oe=r.initialSnapPoint;if(oe<0||oe>=D.value.length)return console.warn("Index out of bounds");h.value=typeof D.value[oe]=="number"?$e(D.value[oe],{max:y.value}):Lt(D.value[oe],y.value)}else h.value=$e(w.value,{max:y.value});g.value=h.value,P.jump(h.value),O.jump(h.value),requestAnimationFrame(()=>{$=_e.animate(P,h.value,{duration:r.duration/1e3,ease:"easeInOut"}),$=_e.animate(O,0,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>{r.blocking&&s("opened")}})}),window.addEventListener("keydown",T),k=!1};let V=!1;const L=()=>{V||(a.value=!1,V=!0,s("closing-started"),window.removeEventListener("keydown",T),setTimeout(()=>{s("closed"),V=!1},r.duration))},G=U=>{if(D.value){if(U<0||U>=D.value.length){console.warn("Index out of bounds");return}S.value=U,h.value=typeof D.value[U]=="number"?$e(D.value[U],{max:y.value}):Lt(D.value[U],y.value),$=_e.animate(P,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>s("snapped",D.value.indexOf(D.value[U]))})}};function W(U){U>0?s("dragging-down"):U<0&&s("dragging-up")}const Z=()=>{h.value=_.value,g.value=O.get(),P.jump(h.value),O.jump(g.value)},se=async(U,te)=>{await e.nextTick(),i.value&&(g.value<=0&&(h.value-=te.delta.y),h.value<=w.value&&(h.value=w.value,g.value+=te.delta.y,O.set(r.canSwipeClose?$e(g.value,{min:0}):$e(kn(g.value,-_.value,0,.5),{min:0}))),P.set($e(kn(h.value,0,N.value,.25),{min:0,max:y.value})),W(te.delta.y))},ce=()=>{if(r.canSwipeClose){let U=h.value/2;r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="number"&&(U=r.swipeCloseThreshold),r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="string"&&r.swipeCloseThreshold.includes("%")&&(U=h.value*(Number(r.swipeCloseThreshold.replace("%",""))/100)),Math.abs(g.value)>U&&(g.value=h.value)}else g.value=0;$=_e.animate(O,g.value,{duration:r.duration/1e3,ease:"easeInOut"}),g.value===h.value&&(g.value=0,L()),S.value=p.value,h.value=typeof D.value[p.value]=="number"?$e(D.value[p.value],{max:y.value}):Lt(D.value[p.value],y.value),$=_e.animate(P,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>s("snapped",D.value.indexOf(D.value[p.value]))}),$=_e.animate(O,0,{duration:r.duration/1e3,ease:"easeInOut"})},M=(U,te)=>{if(h.value=_.value,g.value=O.get(),$&&$.stop(),!d.value)return;const j=d.value.scrollTop===0,z=te.delta.y>0,oe=R.value.length===1,pe=.5>Math.abs(h.value-N.value);if(oe){if(!r.expandOnContentDrag)return f.value=!1;O.get()===0&&j&&z&&(f.value=!0),O.get()===0&&j&&!z&&(f.value=!1)}else{if(!r.expandOnContentDrag)return f.value=!1;f.value=!0,pe&&(z&&j&&(f.value=!0),!z&&j&&(f.value=!1),j||(f.value=!1))}},J=async(U,te)=>{if(await e.nextTick(),!r.expandOnContentDrag)return f.value=!1;if(!i.value)return;g.value===0&&f.value&&r.expandOnContentDrag&&(h.value-=te.delta.y),h.value<=w.value&&(h.value=w.value,f.value&&r.expandOnContentDrag&&(g.value+=te.delta.y),g.value=$e(g.value,{min:0,max:w.value}),O.set(r.canSwipeClose?$e(g.value,{min:0}):$e(kn(g.value,-_.value,0,.5),{min:0}))),h.value>N.value&&(h.value=N.value),h.value=$e(h.value,{max:y.value}),!(R.value.length===1)&&h.value===N.value&&(f.value=!1),P.set(h.value),W(te.delta.y)},ee=()=>{if(!d.value)return;const U=d.value.scrollTop===0;f.value=U},Y=ve.useDebounceFn(U=>G(U),r.duration);return e.watch(D,(U,te)=>{if(a.value===!1||!U||!te)return;const j=U[S.value],z=te[S.value];typeof j!="string"&&typeof z!="string"&&(h.value=$e(j,{max:y.value}),j!==z&&($=_e.animate(P,h.value,{duration:r.duration/1e3,ease:"easeInOut"})))}),e.watch(y,()=>Y(S.value)),e.watch(E,U=>s("instinctHeight",U)),t({open:x,close:L,snapToPoint:G}),(U,te)=>(e.openBlock(),e.createBlock(e.Teleport,{to:n.teleportTo,defer:n.teleportDefer},[e.createElementVNode("div",e.mergeProps(U.$attrs,{"data-vsbs-container":""}),[e.createVNode(e.unref(_e.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(a)&&n.blocking?(e.openBlock(),e.createBlock(e.unref(_e.Motion),{key:0,ref:"backdrop","data-vsbs-backdrop":"",onClick:te[0]||(te[0]=j=>I()),transition:{ease:"easeInOut",duration:n.duration/1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},null,8,["transition"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(_e.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(a)?(e.openBlock(),e.createBlock(e.unref(_e.Motion),{key:0,ref_key:"sheet",ref:i,exit:{y:"100%",height:e.unref(_),opacity:0},initial:!1,style:e.normalizeStyle({y:e.unref(O),z:1,height:e.unref(P)}),"data-vsbs-shadow":!n.blocking,"data-vsbs-sheet-show":e.unref(a),"aria-modal":"true","data-vsbs-sheet":"",tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(_e.Motion),{ref_key:"sheetHeader",ref:l,"data-vsbs-header":"",onPanStart:Z,onPan:se,onPanEnd:ce,onTouchmove:A,class:e.normalizeClass(n.headerClass)},{default:e.withCtx(()=>[e.renderSlot(U.$slots,"header",{},void 0,!0)]),_:3},8,["class"]),e.createElementVNode("div",{ref_key:"sheetScroll",ref:d,"data-vsbs-scroll":"",onScrollend:ee},[e.createVNode(e.unref(_e.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:M,onPan:J,onPanEnd:ce,onTouchmove:C},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"sheetContent",ref:u,"data-vsbs-content":"",class:e.normalizeClass(n.contentClass)},[e.renderSlot(U.$slots,"default",{},void 0,!0)],2)]),_:3},512)],544),e.createVNode(e.unref(_e.Motion),{ref_key:"sheetFooter",ref:c,"data-vsbs-footer":"",onPanStart:Z,onPan:se,onPanEnd:ce,onTouchmove:A,class:e.normalizeClass(n.footerClass)},{default:e.withCtx(()=>[e.renderSlot(U.$slots,"footer",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["exit","style","data-vsbs-shadow","data-vsbs-sheet-show"])):e.createCommentVNode("",!0)]),_:3})],16)],8,["to","defer"]))}}),[["__scopeId","data-v-8bf4388d"]]);function Ze(n,t=null){const o=dt();o.initCacheSingle("defaultImage");const r=e.computed(()=>o.cache.defaultImage||null),s=e.shallowRef(!1),a=e.computed(()=>{var d;return((d=e.toValue(n))==null?void 0:d.toString())||null}),i=ve.computedAsync(async()=>{const d=a.value;return d?(await o.initCacheSingle(d),o.cache[d]||null):null},null,{evaluating:s}),l=e.computed(()=>s.value&&a.value!==null);return{mediaUrl:e.computed(()=>i.value||e.toValue(t)||r.value||null),isLoading:l}}const ql={class:"card_product_wrapper"},Wl={class:"card_product_modifiers_sheet_body"},Gl={class:"card__pictures"},Kl=["src"],Jl=["src"],Xl={class:"card_header_wrapper"},Yl={key:0,class:"card_fire_kkal_wrapper"},Zl={class:"card_content"},Ql={class:"wrapper_size"},ec={key:0,class:"description"},tc={key:1},nc=ae(e.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(n){const t=we(),o=me(),{stateCard:r,isOpenWindow:s}=q.storeToRefs(o),{itemThemes:a}=q.storeToRefs(t),i=Q.useRouter(),l=Q.useRoute(),c=n,{mediaUrl:d}=Ze(()=>{var y,_;return(y=r.value.openCard)!=null&&y.video_link?`${r.value.openCard.id}_video`:(_=r.value.openCard)!=null&&_.image_link?`${r.value.openCard.id}_image`:null},()=>{var y,_;return((y=r.value.openCard)==null?void 0:y.video_link)||((_=r.value.openCard)==null?void 0:_.image_link)||null}),u=()=>{c.configPage.qr_menu?i.push(`/${l.params.orgId}`):c.configPage.closeProduct()},f=()=>{r.value.isModifiedAmount=!1};return e.watch(()=>c.configPage.data,o.setCurrentCard),e.watchEffect(()=>{s.value||(s.value=c.configPage.is_closeProduct)}),e.onBeforeUnmount(()=>o.reset()),(y,_)=>{var m,b,B,E,h,g;return e.openBlock(),e.createElementBlock("div",ql,[e.createVNode(e.unref(Uo),{modelValue:e.unref(r).isSectionModifier,"onUpdate:modelValue":_[1]||(_[1]=P=>e.unref(r).isSectionModifier=P),class:"card_product_modifiers_sheet"},{default:e.withCtx(()=>[e.createElementVNode("div",Wl,[e.createVNode(_i,{onClose:_[0]||(_[0]=P=>e.unref(r).isSectionModifier=!1)}),e.createVNode(Io,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(r).isModifiedAmount?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:e.withModifiers(f,["stop"])},[e.createVNode(zl)])):e.createCommentVNode("",!0)])),e.createElementVNode("div",Gl,[(m=e.unref(r).openCard)!=null&&m.video_link&&e.unref(d)?(e.openBlock(),e.createElementBlock("video",{key:e.unref(d),loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,Kl)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"card__pictures_images",src:e.unref(d)||"",alt:"Product image"},null,8,Jl)),e.createElementVNode("div",Xl,[e.createVNode(_n,{class:"card_header_back",onClick:u,"aria-label":"Вернуться назад"}),(b=e.unref(r).openCard)!=null&&b.energy_amount?(e.openBlock(),e.createElementBlock("div",Yl,[_[3]||(_[3]=e.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),e.createElementVNode("p",null,[e.createElementVNode("b",null,e.toDisplayString((B=e.unref(r).openCard)==null?void 0:B.energy_amount),1),_[2]||(_[2]=e.createTextVNode(" Ккал ",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("h4",null,e.toDisplayString((E=e.unref(r).openCard)==null?void 0:E.name),1),e.createElementVNode("div",{class:"card__pictures__gradient",style:e.normalizeStyle(e.unref(a).gradientStyle)},null,4)]),e.createElementVNode("div",Zl,[e.createElementVNode("div",Ql,[e.createVNode(Ci)]),(h=e.unref(r).openCard)!=null&&h.description?(e.openBlock(),e.createElementBlock("p",ec,e.toDisplayString((g=e.unref(r).openCard)==null?void 0:g.description),1)):e.createCommentVNode("",!0),e.unref(r).groupModifiers.length?(e.openBlock(),e.createElementBlock("div",tc,[_[4]||(_[4]=e.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),e.createVNode(Io,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):e.createCommentVNode("",!0),e.createVNode(Al,{qr_menu:n.configPage.qr_menu,closeProduct:n.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-732bba57"]]),oc={key:0,class:"popupWindowDefault_overlay"},Ho=ae(e.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(n,{emit:t}){const o=n,r=t,s=()=>{r("update:visible",!1)};return e.watch(()=>o.visible,async a=>{a&&await e.nextTick(),o.isVisible=a}),(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:i[0]||(i[0]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"background_black",onClick:s})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:i[1]||(i[1]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",oc,[e.renderSlot(a.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),rc={},sc={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ac(n,t){return e.openBlock(),e.createElementBlock("svg",sc,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M18 18L12 12M12 12L6 6M12 12L18 6M12 12L6 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const ic=ae(rc,[["render",ac]]),Cn=q.defineStore("modals",()=>{const n=new Map,t=(s,a)=>{const i=r(s).value;i.visible=!0,i.context=a},o=s=>{const a=r(s).value;a.visible=!1},r=s=>(n.has(s)||n.set(s,e.ref({visible:!1})),n.get(s));return{state:r,open:t,close:o}}),lc=["src"],cc={class:"cart_box_content_wrapper"},dc={class:"cart_box_content_info"},uc={class:"cart_amount"},fc={class:"cart_amount_count"},pc={class:"cart_box_info_more"},mc={key:1,class:"cart_modifier_info"},hc={class:"cart_modifier_content"},gc={class:"wrapper_price_count_cart"},_c={class:"count_cart_box"},yc={class:"wrapper_modifiers_discount"},jo=ae(e.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(n,{emit:t}){const o=n,r=fe(),s=we(),a=Cn(),{itemThemes:i}=q.storeToRefs(s),l=e.ref(0),c=e.ref(0),d=e.ref(!1),u=e.ref(!1),f=e.ref(!1),{displayNumber:y,update:_}=Vo(0,800),m=e.computed(()=>{var w,N;const S=((w=o.cardItem)==null?void 0:w.modifiers)??[],p=(((N=o.cardItem)==null?void 0:N.group_modifiers)??[]).flatMap($=>$.modifiers??[]);return[...S,...p]}),{mediaUrl:b}=Ze(()=>{var S;return((S=o.cardItem)==null?void 0:S.id)+"_image"},()=>{var S;return(S=o.cardItem)==null?void 0:S.image_link}),B=e.computed(()=>{var S,p;return((S=o.cardItem)==null?void 0:S.total_new_price)||ut(o.cardItem)*((p=o.cardItem)==null?void 0:p.amount)}),E=()=>a.open("cart-delete-confirm",o.cardItem),h=()=>{f.value=!f.value},g=()=>{r.plusAmount(o.cardItem.idSystem)},P=()=>{o.cardItem.amount>1?r.minusAmount(o.cardItem.idSystem):E()},O=S=>{l.value=S.touches[0].clientX,d.value=!0},F=S=>{d.value&&(c.value=S.touches[0].clientX-l.value,c.value>0&&(c.value=0))},D=()=>{d.value=!1,c.value<-115&&E(),c.value=0};e.onMounted(()=>{o.index===0&&(u.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,u.value=!1},700)},0))});const R=e.computed(()=>{const S=o.index===0&&u.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:S,transition:d.value?"none":"transform 0.7s, opacity 0.7s"}});return e.watch(B,_,{immediate:!0}),(S,p)=>{var w,N,$,A;return e.openBlock(),e.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:O,onTouchmove:F,onTouchend:D,style:e.normalizeStyle(R.value)},[p[2]||(p[2]=e.createElementVNode("div",{class:"wrapper_cart_delete"},[e.createElementVNode("div",{class:"cart_delete"})],-1)),e.createElementVNode("img",{src:e.unref(b)||"",class:"cart_box_image"},null,8,lc),e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[e.createElementVNode("p",null,e.toDisplayString((w=n.cardItem)==null?void 0:w.name),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((N=o.cardItem)==null?void 0:N.discounts)||[],(C,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"discount_banner"},[e.createElementVNode("p",null,e.toDisplayString(C.name),1),e.createElementVNode("p",null,e.toDisplayString(C.discount)+"₽",1)]))),128)),e.createElementVNode("div",uc,[e.createElementVNode("button",{onClick:P},"-"),e.createElementVNode("p",fc,e.toDisplayString(o.cardItem.amount),1),e.createElementVNode("button",{onClick:g},"+")])]),e.createElementVNode("div",pc,[e.createElementVNode("div",{class:"cart_box_remove_item",onClick:E},[e.createVNode(ic)]),($=o.cardItem)!=null&&$.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(A=o.cardItem)==null?void 0:A.new_price})},e.toDisplayString((o.cardItem.new_price*o.cardItem.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString(e.unref(y).toFixed(2)+"₽"),1)])]),!f.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:e.withModifiers(h,["stop"])},[...p[0]||(p[0]=[e.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),e.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,C=>{var T;return e.openBlock(),e.createElementBlock("div",{class:"cart_modifier_item",key:C.id},[e.createElementVNode("div",hc,[e.createVNode(gn,{id:"plus_orange"}),e.createElementVNode("p",null,e.toDisplayString(C.name),1)]),e.createElementVNode("div",gc,[e.createElementVNode("p",_c,e.toDisplayString(`x${C.amount}`),1),e.createElementVNode("div",yc,[C!=null&&C.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(T=C==null?void 0:C.new_price)==null?void 0:T.toFixed(2)})},e.toDisplayString((C.new_price*C.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString((C.total_new_price||C.price*C.amount).toFixed(2)+"₽"),1)])])])}),128)),e.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:e.withModifiers(h,["stop"])},[...p[1]||(p[1]=[e.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),e.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):e.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-e48a9689"]]),bc={},wc={class:"nfc_x",viewBox:"0 0 48 48"};function kc(n,t){return e.openBlock(),e.createElementBlock("svg",wc,[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),e.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const Cc=ae(bc,[["render",kc]]),Sc={},Ec={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function Bc(n,t){return e.openBlock(),e.createElementBlock("svg",Ec,[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const Nc=ae(Sc,[["render",Bc]]),xc={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},vc=e.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(n){return(t,o)=>n.styleRetry?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",xc,[...o[0]||(o[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),Tc={class:"sheet_header"},$c={class:"sheet_title",id:"sheetTitle"},Ac={class:"sheet_body"},Mc={class:"sheet_card"},Pc={class:"nfc_title"},Ic={class:"lead"},Vc={class:"wrapper_input_accept"},Rc={key:0,class:"card_phone_auth_wrapper"},Dc={class:"sr_only","aria-live":"polite"},qo=e.defineComponent({__name:"CardReader",setup(n){const t=fe(),o=we(),{is_OpenLoyal:r}=q.storeToRefs(t),{itemThemes:s}=q.storeToRefs(o),a=Ge(),i=e.ref(),l=e.ref(),c=e.ref(null),d=e.ref(""),u={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},f=e.computed({get:()=>d.value,set:I=>{d.value=I.replace(/\s/g,"")}}),y=e.computed(()=>a.currentState),_=e.computed(()=>a.isDrawerOpen),m=e.computed(()=>{var I;return((I=u[y.value])==null?void 0:I.text)||""}),b=e.computed(()=>{var I;(I=u[y.value])!=null&&I.title}),B=e.computed(()=>y.value==="success"?"Добро пожаловать!":s.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),E=e.computed(()=>({ok:y.value==="success",warn:y.value==="not_found"})),h=e.computed(()=>{const I=[];return y.value==="wait"&&I.push("pulse","show-x"),y.value==="not_found"&&I.push("pulse","show-x"),y.value==="success"&&I.push("pulse","show-ok"),I}),g=e.computed(()=>y.value==="not_found"),P=e.computed(()=>y.value==="success"),O=e.computed(()=>y.value==="not_found"),F=e.computed(()=>["not_found"].includes(y.value)),D=e.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[y.value]||""),R=()=>{a.closeDrawer(),r.value=!0},S=async I=>{var k,x;a.error="",c.value=null;try{const V=new ze;await V.authorizeByCard(I.trim()),await V.getProfile(),t.loadCart(),a.setState("success"),a.isDrawerOpen=!1,a.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(V){a.error=((x=(k=V.response)==null?void 0:k.data)==null?void 0:x.user_friendly_message)||"Ошибка",a.setState("not_found"),c.value=f.value,f.value=""}},p=()=>{var I;a.setState("wait"),a.error="",f.value="",c.value=null,(I=i.value)==null||I.focus()},w=()=>{a.closeDrawer(),c.value=null,f.value=""},N=()=>{var I,k;a.setState("wait"),(k=(I=f.value)==null?void 0:I.trim())!=null&&k.length&&S(f.value.trim())},$=I=>{I.stopPropagation(),document.activeElement!==l.value&&A()},A=()=>{e.nextTick(()=>{l.value&&(l.value.focus(),d.value&&l.value.select())})},C=I=>{const k=document.activeElement===l.value;if(!_.value||k)return;const x=I.key.toLowerCase();if(x==="backspace")return f.value=f.value.slice(0,-1);if(x==="escape")return w();if(x==="r"&&O.value)return p();if(x==="c"&&y.value==="success")return w();if(x==="enter")return N();f.value+=x},T={mounted(I){I==null||I.focus()}};return e.onMounted(()=>{document==null||document.addEventListener("keydown",C)}),e.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",C)}),e.watchEffect(()=>{_.value&&(a.error="")}),(I,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"backdrop show",onClick:w,"aria-hidden":"true"})):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["sheet show",{sheet_retry:O.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:$},[e.createElementVNode("header",Tc,[e.createElementVNode("div",$c,e.toDisplayString(m.value),1),O.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sheet_status",E.value])},e.toDisplayString(c.value),3)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"sheet_close",onClick:w,"aria-label":"Закрыть"}," Закрыть ")]),e.createElementVNode("div",Ac,[e.createElementVNode("div",Mc,[e.createElementVNode("div",{class:e.normalizeClass(["nfc",h.value])},[e.createVNode(vc,{styleRetry:F.value},null,8,["styleRetry"]),g.value?(e.openBlock(),e.createBlock(Cc,{key:0})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"overlay check",style:e.normalizeStyle({display:P.value?"grid":"none"}),"aria-hidden":"true"},[e.createVNode(Nc)],4)],2),e.createElementVNode("h2",Pc,e.toDisplayString(b.value),1),e.createElementVNode("p",Ic,e.toDisplayString(B.value),1),e.createElementVNode("div",Vc,[e.withDirectives(e.createElementVNode("input",{ref_key:"cardInputManualRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=x=>f.value=x),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:e.withKeys(N,["enter"])},null,544),[[e.vModelText,f.value],[T]]),O.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:p},"Повторить")):(e.openBlock(),e.createElementBlock("button",{key:1,class:"btn btn_ghost",onClick:k[1]||(k[1]=x=>O.value?w:N())},"Отправить"))]),y.value==="wait"&&e.unref(s).kiosk_show_loyalty_phone_input_button?(e.openBlock(),e.createElementBlock("div",Rc,[e.createElementVNode("button",{class:"card_phone_auth_button",onClick:R},"Войти по номеру телефона")])):e.createCommentVNode("",!0)])]),e.createElementVNode("input",{ref_key:"cardInputRef",ref:i,type:"text",class:"sr_only","aria-live":"polite"},null,512),e.createElementVNode("div",Dc,e.toDisplayString(D.value),1)],2)):e.createCommentVNode("",!0)],64))}}),Oc={class:"start_page"},Lc=["src"],Fc={class:"wrap"},zc={class:"wrap_box"},Uc={class:"title_fiscal_order"},Hc={class:"wrapper_accept"},jc={ref:"barRef",class:"bar_complete","aria-hidden":"true"},qc=ae(e.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(n){const t=fe(),o=Ge(),r=me(),s=we(),{cartProducts_lib:a}=q.storeToRefs(t),{orderNumber:i,orderCompleted_lib:l}=q.storeToRefs(o),{is_startPage:c}=q.storeToRefs(r),{mediaUrl:d}=Ze(()=>s.itemThemes.kiosk_preloader?"preloader":null),u=Q.useRouter(),f=Q.useRoute();let y=null;e.onMounted(()=>{y=setTimeout(()=>{c.value=!0,u.replace(`/${f.params.orgId}`)},1e4)});const _=()=>{ot(["cart","authTokensAccess","authTokensRefresh"]),a.value=[],l.value=null,o.clearCard(),t.profile=null,u.replace(`/${f.params.orgId}`)};return e.onUnmounted(()=>{y&&clearInterval(y)}),(m,b)=>(e.openBlock(),e.createElementBlock("div",Oc,[(e.openBlock(),e.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:e.unref(d)},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,Lc)])),b[4]||(b[4]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",Fc,[e.createElementVNode("div",zc,[b[1]||(b[1]=e.createElementVNode("div",{class:"icon","aria-hidden":"true"},[e.createElementVNode("svg",{viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),b[2]||(b[2]=e.createElementVNode("h1",null," Заказ успешно оплачен ",-1)),e.createElementVNode("p",Uc,"№ "+e.toDisplayString(e.unref(i)),1),b[3]||(b[3]=e.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),e.createElementVNode("div",Hc,[e.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:_},[b[0]||(b[0]=e.createElementVNode("span",{class:"label"},"Новый заказ",-1)),e.createElementVNode("span",jc,null,512)])])])])]))}}),[["__scopeId","data-v-c07b734f"]]),Wc={};function Gc(n,t){return t[0]||(t[0]=e.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-3e03a6dc><i data-v-3e03a6dc></i></div><h1 class="title_fiscal" data-v-3e03a6dc>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-3e03a6dc>Не забудьте <b data-v-3e03a6dc>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-3e03a6dc><div class="printer" data-v-3e03a6dc><div class="led" data-v-3e03a6dc></div><div class="slot" data-v-3e03a6dc></div><div class="receipt" data-v-3e03a6dc><div class="tear" data-v-3e03a6dc></div><div class="line accent" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div></div></div></div>',4))}const Kc=ae(Wc,[["render",Gc],["__scopeId","data-v-3e03a6dc"]]),Jc={},Xc={class:"center"};function Yc(n,t){return e.openBlock(),e.createElementBlock("div",Xc,[...t[0]||(t[0]=[e.createStaticVNode('<div class="stack" data-v-f0859fd1><h1 class="title_fiscal" data-v-f0859fd1>Приложите карту для оплаты</h1><p class="reminder" data-v-f0859fd1>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f0859fd1><div class="waves" data-v-f0859fd1><span data-v-f0859fd1></span><span data-v-f0859fd1></span><span data-v-f0859fd1></span></div><div class="nfc" data-v-f0859fd1><svg viewBox="0 0 24 24" data-v-f0859fd1><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f0859fd1></path><path d="M10 6c4 4 4 8 0 12" data-v-f0859fd1></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f0859fd1></path></svg></div><div class="card" data-v-f0859fd1><div class="logo" data-v-f0859fd1>inno.</div><div class="chip" data-v-f0859fd1></div><div class="digits" data-v-f0859fd1>4815 1623 4200 0900</div><div class="holder" data-v-f0859fd1>Гость</div></div></div></div>',1)])])}const Zc=ae(Jc,[["render",Yc],["__scopeId","data-v-f0859fd1"]]),Qc={key:0,class:"wrapper_qr"},ed={key:1,class:"wrapper_qr"},td={key:2,class:"wrapper_qr"},nd=ae(e.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(n){const t=Ge(),o=we(),{orderNumber:r,orderCompleted_lib:s}=q.storeToRefs(t),{mediaUrl:a}=Ze(()=>o.itemThemes.kiosk_preloader?"preloader":null);return(i,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s)&&e.unref(s)===1?(e.openBlock(),e.createElementBlock("section",Qc,[e.createVNode(Kc)])):e.unref(s)&&e.unref(s)===2?(e.openBlock(),e.createElementBlock("section",ed,[e.createVNode(Zc)])):e.createCommentVNode("",!0),e.unref(s)&&e.unref(s)===3?(e.openBlock(),e.createElementBlock("section",td,[e.createVNode(qc,{orderNumber:e.unref(r),mediaUrl:e.unref(a)},null,8,["orderNumber","mediaUrl"])])):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-a3446a00"]]),od={},rd={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function sd(n,t){return e.openBlock(),e.createElementBlock("svg",rd,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M19 20H20M16 20H14V17M17 17H20V14H19M14 14H16M4 16.9997C4 16.0679 4 15.6019 4.15224 15.2344C4.35523 14.7443 4.74432 14.3552 5.23438 14.1522C5.60192 14 6.06786 14 6.99974 14C7.93163 14 8.39808 14 8.76562 14.1522C9.25568 14.3552 9.64467 14.7443 9.84766 15.2344C9.9999 15.6019 9.9999 16.0681 9.9999 17C9.9999 17.9319 9.9999 18.3978 9.84766 18.7654C9.64467 19.2554 9.25568 19.6447 8.76562 19.8477C8.39808 19.9999 7.93162 19.9999 6.99974 19.9999C6.06786 19.9999 5.60192 19.9999 5.23438 19.8477C4.74432 19.6447 4.35523 19.2557 4.15224 18.7656C4 18.3981 4 17.9316 4 16.9997ZM14 6.99974C14 6.06786 14 5.60192 14.1522 5.23438C14.3552 4.74432 14.7443 4.35523 15.2344 4.15224C15.6019 4 16.0679 4 16.9997 4C17.9316 4 18.3981 4 18.7656 4.15224C19.2557 4.35523 19.6447 4.74432 19.8477 5.23438C19.9999 5.60192 19.9999 6.06812 19.9999 7C19.9999 7.93188 19.9999 8.39783 19.8477 8.76537C19.6447 9.25542 19.2557 9.64467 18.7656 9.84766C18.3981 9.9999 17.9316 9.9999 16.9997 9.9999C16.0679 9.9999 15.6019 9.9999 15.2344 9.84766C14.7443 9.64467 14.3552 9.25568 14.1522 8.76562C14 8.39808 14 7.93163 14 6.99974ZM4 6.99974C4 6.06786 4 5.60192 4.15224 5.23438C4.35523 4.74432 4.74432 4.35523 5.23438 4.15224C5.60192 4 6.06786 4 6.99974 4C7.93163 4 8.39808 4 8.76562 4.15224C9.25568 4.35523 9.64467 4.74432 9.84766 5.23438C9.9999 5.60192 9.9999 6.06812 9.9999 7C9.9999 7.93188 9.9999 8.39783 9.84766 8.76537C9.64467 9.25542 9.25568 9.64467 8.76562 9.84766C8.39808 9.9999 7.93162 9.9999 6.99974 9.9999C6.06786 9.9999 5.60192 9.9999 5.23438 9.84766C4.74432 9.64467 4.35523 9.25568 4.15224 8.76562C4 8.39808 4 7.93163 4 6.99974Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const ad=ae(od,[["render",sd]]),Wo=n=>{const t=Cn(),o=l=>t.open(n,l),r=()=>t.close(n),s=t.state(n),a=e.computed({get:()=>s.value.visible,set:l=>l&&o()||r()}),i=e.computed(()=>s.value.context);return{visible:a,context:i,open:o,close:r}},id={class:"cart_deletion_modal_content"},ld={class:"cart_deletion_modal_title"},cd={class:"cart_deletion_modal_footer"},dd=ae(e.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(n,{emit:t}){const o=t,{visible:r,context:s,close:a}=Wo("cart-delete-confirm"),i=()=>{o("confirm",s.value.idSystem),a()};return(l,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=e.withModifiers((...d)=>e.unref(a)&&e.unref(a)(...d),["self"]))},[e.createElementVNode("div",id,[e.createElementVNode("div",ld,"Удалить "+e.toDisplayString(e.unref(s).name)+"?",1),c[2]||(c[2]=e.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),e.createElementVNode("div",cd,[e.createElementVNode("button",{class:"primary",onClick:i}," Удалить "),e.createElementVNode("button",{onClick:c[0]||(c[0]=(...d)=>e.unref(a)&&e.unref(a)(...d))},"Отмена")])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),ud={class:"cart_wrapper"},fd={class:"cart_header_content"},pd={class:"cart_kso_loyal_wrapper"},md={key:0},hd={class:"cart_header_wrapper"},gd=["src"],_d={class:"cart_header_info"},yd={class:"cart_header_info"},bd={class:"cart_header_info"},wd={class:"cart_header_info"},kd={key:0},Cd={key:0,class:"wrapper_comment"},Sd={class:"wrapper_limit_in_area"},Ed={class:"limit_comment"},Bd={class:"cart_cards"},Nd={class:"cart_footer_wrapper"},xd={key:0,class:"footer_title"},vd=["disabled","max"],Td={key:1,class:"footer_sales"},$d=["max"],Ad={class:"list_price"},Md={key:0},Pd={key:1},Id={key:2},Vd={class:"accept_field"},Rd={class:"accept_field"},Dd={key:3},Od={class:"accept_field"},Ld={class:"accept_field"},Fd={class:"accept_field"},zd={class:"wrapper_footer_cart_btn"},Ud=e.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(n){const t=ze.create();let o;const r=fe(),s=Ge(),a=we(),i=me(),l=n,{totalPrice_lib:c,countBonus:d,config_lib:u,cartProducts_lib:f,profile:y}=q.storeToRefs(r),{itemThemes:_}=q.storeToRefs(a),{textPaymentBtn_lib:m,isButtonDisabled:b,orderCompleted_lib:B,orderNumber:E,extraDiscount:h,is_notification_lib:g,notificationData_lib:P}=q.storeToRefs(s),{isAddToCard:O}=q.storeToRefs(i),F=Q.useRouter(),D=Q.useRoute(),R=e.useTemplateRef("stickerLoyality"),S=e.ref(!1),p=e.ref(!1),w=e.ref(""),N=e.ref(!1),$=e.ref(0),A=e.ref(!1),C=e.ref(0),T=e.ref(),{width:I}=ve.useElementSize(R,{width:0,height:0},{box:"border-box"}),k=e.computed(()=>{const j={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return f.value.reduce((z,oe)=>(z.energy_amount+=(oe.energy_amount||0)*(oe.amount||0),z.proteins_amount+=(oe.proteins_amount||0)*(oe.amount||0),z.fat_amount+=(oe.fat_amount||0)*(oe.amount||0),z.carbohydrates_amount+=(oe.carbohydrates_amount||0)*(oe.amount||0),z),j)}),x=ve.computedAsync(async j=>{var pe;const z=new AbortController;if(j(()=>z.abort()),!S.value||!((pe=y.value)!=null&&pe.balance))return 0;const oe=await t.maxPayByBonuses(c.value,l.configPage.kiosk_menu,!!l.configPage.userData||!!y.value,z.signal);return oe!=null&&oe.by_bonuses?y.value.balance>oe.by_bonuses?oe.by_bonuses:y.value.balance:0},0,{shallow:!0}),V=()=>F.push(`/${D.params.orgId}/`),L=j=>{["a","A","+","-",".",","].includes(j.key)&&j.preventDefault()},G=j=>{r.deleteItemFromCart(j)},W=()=>{N.value=!N.value,w.value.length},Z=()=>{let j=Math.floor(d.value)||0;j>x.value&&(j=x.value),j!==d.value&&r.setBonus(j)};e.watchEffect(()=>{Z(),r.setBonus(c.value===0?0:Math.floor(d.value))});const se=()=>f.value.map(j=>({id:j.id,front_item_id:j.idSystem,is_fake:!!j.is_fake,removals:j.removals??null,amount:j.amount,size:j.size,modifiers:j.modifiers??[],group_modifiers:j.group_modifiers??[]})),ce=async()=>{b.value=!0;try{return await t.createOrder(se(),l.configPage.tableDataId,l.configPage.kiosk_menu,w.value,!!l.configPage.userData||!!y.value,l.configPage.is_tableservice,o==null?void 0:o.signal)}catch(j){throw le.isCancel(j)||(l.configPage.kiosk_menu?(j.status===403&&(localStorage.removeItem("apiKey"),r.is_showApiKey=!0,F.push(`/${D.params.orgId}/retryPage`)),s.deleteCart("retryPage",l.configPage.kiosk_menu)):l.configPage.is_tableservice?s.showNotification(j.response.data.user_friendly_message):F.push(`/${D.params.orgId}/errorPayment`),b.value=!1),j}},M=()=>{if(!y.value&&l.configPage.qr_menu){F.push(`/${D.params.orgId}/register`);return}O.value=!1,B.value=1,o=null,u.value.has_rms_discount?s.makeInitPaymentLinkRequest(T.value,l.configPage.kiosk_menu,l.configPage.is_tableservice).then(()=>T.value=null):ce()},J=async()=>{var oe,pe,Ne;h.value=0,b.value=!0;const j={items:[...se()],combos:[]},z=ze.create();o=new AbortController;try{A.value=!0;const de=await z.calculateDiscount(j,l.configPage.kiosk_menu,!!l.configPage.userData||!!y.value,o.signal);if(!f.value)return;if(f.value.forEach(ie=>{const Ae=de.items.find(be=>be.front_item_id===ie.idSystem);if(Ae&&(ie.group_modifiers.forEach(be=>{const he=Ae.group_modifiers.find(ge=>ge.group===be.group);he&&be.modifiers.forEach(ge=>{const xe=he.modifiers.find(qe=>qe.id===ge.id);if(xe&&Number(ge.price)!==Number(xe==null?void 0:xe.new_price)){const qe=(xe.discounts||[]).reduce((Ht,jt)=>Ht+=+jt.discount,0);$.value+=qe,ge.new_price=ge.price,ge.price=Number(xe==null?void 0:xe.new_price),ge.total_new_price=Number(xe.total_new_price)}})}),ie.modifiers.forEach(be=>{const he=Ae.modifiers.find(ge=>ge.id===be.id);if(he&&Number(be.price)!==Number(he==null?void 0:he.new_price)){const ge=(he.discounts||[]).reduce((xe,qe)=>xe+=+qe.discount,0);$.value+=ge,be.new_price=be.price,be.price=Number(he==null?void 0:he.new_price),be.total_new_price=Number(he.total_new_price)}}),ie.price!==Number(Ae.new_price))){const be=(Ae.discounts||[]).reduce((he,ge)=>he+=+ge.discount,0);$.value=$.value+be,ie.new_price=ie.price,ie.price=Ae.new_price,ie.discounts=Ae.discounts,ie.total_new_price=Number(Ae.total_new_price)}}),f.value=[...f.value],$.value!==0&&(c.value=de.total_cart_price),u.value.has_rms_discount){const ie=await ce();T.value=(oe=ie.data)==null?void 0:oe.id}else b.value=!1;p.value=!1}catch(de){le.isCancel(de)||(console.log("Ошибка скидок [CartPage calculateDiscount]",de),s.showNotification(((Ne=(pe=de==null?void 0:de.response)==null?void 0:pe.data)==null?void 0:Ne.user_friendly_message)||"Скидки временно недоступны"),Y()),A.value=!1,b.value=!1}},ee=()=>{var j;(j=y.value)!=null&&j.balance?y.value.balance>=1&&(S.value=!S.value):s.showNotification("У Вас пока нет бонусов")},Y=()=>{var j,z;u.value.has_rms_discount&&(l.configPage.kiosk_menu||l.configPage.qr_menu&&y.value)?(T.value=null,p.value=!0):((j=u.value)==null?void 0:j.loyalty)==="IIKO"&&(u.value.has_loyalty_default_user||y.value)&&l.configPage.kiosk_menu||((z=u.value)==null?void 0:z.loyalty)==="IIKO"&&l.configPage.qr_menu&&y.value?p.value=!0:p.value=!1};e.onMounted(async()=>{m.value=l.textPaymentBtn,r.loadCart(),B.value=null,c.value=null,h.value=0,f.value.splice(0,f.value.length,...f.value.map(r.makeProductFullyReactive))}),e.onUnmounted(()=>{T.value=null,B.value=null,c.value=null,h.value=0,f.value.splice(0,f.value.length,...f.value.map(r.makeProductFullyReactive))});const U=e.computed(()=>A.value||f.value.length===0||c.value===0?!0:["АВТОРИЗОВАТЬСЯ ДЛЯ ЗАКАЗА"].includes(m.value.toUpperCase())||["ОПЛАТИТЬ","СОЗДАТЬ ЗАКАЗ"].includes(m.value.toUpperCase())&&!u.value.has_rms_discount?!1:(B.value=null,b.value)),te=e.computed(()=>{var j;return((j=f.value)==null?void 0:j.reduce((z,oe)=>z+oe.amount,0))||0});return e.watch([te,y],()=>{o==null||o.abort(),b.value=!1}),e.watch([()=>r.cartProducts_lib,y,te],j=>{if(C.value>0){C.value--;return}j&&!A.value&&(Y(),f.value.splice(0,f.value.length,...f.value.map(r.makeProductFullyReactive)),$.value=0,c.value=null,h.value=0,C.value=1),A.value=!1},{deep:!0}),(j,z)=>{var oe,pe,Ne,de;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ud,[e.createVNode(dd,{onConfirm:G}),e.createVNode(Ho,{visible:e.unref(s).isDrawerOpen,"onUpdate:visible":z[0]||(z[0]=ie=>e.unref(s).isDrawerOpen=ie)},{default:e.withCtx(()=>[e.createVNode(qo)]),_:1},8,["visible"]),e.createElementVNode("header",fd,[e.createElementVNode("div",pd,[e.createElementVNode("div",{class:e.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:l.configPage.kiosk_menu}]),onClick:V},[e.createVNode(_n,{class:"cart_header_back_button"}),l.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("span",md,"Назад")):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",hd,[(e.unref(_).kiosk_show_loyalty_card_button||e.unref(_).kiosk_show_loyalty_phone_input_button)&&!l.config_qr?(e.openBlock(),e.createElementBlock("button",{key:0,class:"buttonDefaultWrapper button_payment_cart button_payment_cart_loyal",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(I)/2+10)}px`,paddingRight:(oe=e.unref(_).cart_loyalty_button)!=null&&oe.cart_loyalty_button_sticker?0:""}),onClick:z[1]||(z[1]=(...ie)=>e.unref(s).openDrawer&&e.unref(s).openDrawer(...ie))},[e.createElementVNode("p",{class:"cart_loyal_program",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(I)/2)}px`})},e.toDisplayString(((pe=e.unref(_).cart_loyalty_button)==null?void 0:pe.cart_loyalty_button_text)||"Программа лояльности"),5),(Ne=e.unref(_).cart_loyalty_button)!=null&&Ne.cart_loyalty_button_sticker?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"stickerLoyality",ref:R,class:"cart_loyal_program_icon",style:e.normalizeStyle({"--sticker-mask":`url(${e.unref(_).cart_loyalty_button.cart_loyalty_button_sticker})`})},[e.createElementVNode("img",{src:e.unref(_).cart_loyalty_button.cart_loyalty_button_sticker},null,8,gd)],4)):(e.openBlock(),e.createBlock(ad,{key:1,class:"cart_loyal_qr"}))],4)):e.createCommentVNode("",!0),e.unref(_).show_nutrition_in_cart?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cart_header",style:e.normalizeStyle({paddingTop:l.config_qr?0:"10px"})},[e.createElementVNode("div",_d,[e.createElementVNode("p",null,[e.createVNode(Re,{price:k.value.energy_amount,duration:800},null,8,["price"]),z[6]||(z[6]=e.createTextVNode(" г",-1))]),z[7]||(z[7]=e.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),e.createElementVNode("div",yd,[e.createElementVNode("p",null,[e.createVNode(Re,{price:k.value.proteins_amount,duration:900},null,8,["price"]),z[8]||(z[8]=e.createTextVNode(" г",-1))]),z[9]||(z[9]=e.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),e.createElementVNode("div",bd,[e.createElementVNode("p",null,[e.createVNode(Re,{price:k.value.fat_amount,duration:1e3},null,8,["price"]),z[10]||(z[10]=e.createTextVNode(" г",-1))]),z[11]||(z[11]=e.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),e.createElementVNode("div",wd,[e.createElementVNode("p",null,[e.createVNode(Re,{price:k.value.carbohydrates_amount,duration:1100},null,8,["price"]),z[12]||(z[12]=e.createTextVNode(" г",-1))]),z[13]||(z[13]=e.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):e.createCommentVNode("",!0)])]),n.config_qr&&e.unref(_).show_order_comment?(e.openBlock(),e.createElementBlock("div",kd,[N.value?(e.openBlock(),e.createElementBlock("div",Cd,[e.createElementVNode("div",Sd,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:"Ваш комментарий к заказу...",name:"comment",maxlength:"50","onUpdate:modelValue":z[2]||(z[2]=ie=>w.value=ie)},null,512),[[e.vModelText,w.value]]),e.createElementVNode("p",Ed,e.toDisplayString(w.value.length+" / 50"),1)]),e.createVNode(Ye,{textButtonDefault:"Сохранить",onClick:W,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),!N.value&&e.unref(f).length>0?(e.openBlock(),e.createBlock(Ye,{key:1,textButtonDefault:w.value.length>0?"Редактировать":"Комментарий к заказу",onClick:()=>N.value=!N.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),ie=>(e.openBlock(),e.createBlock(jo,{key:ie.idSystem,cardItem:ie,onDelete:Ae=>G(ie.idSystem)},null,8,["cardItem","onDelete"]))),128))]),e.createElementVNode("div",Nd,[S.value?(e.openBlock(),e.createElementBlock("p",xd,[z[14]||(z[14]=e.createTextVNode(" Списать ",-1)),e.withDirectives(e.createElementVNode("input",{type:"number",placeholder:"0",style:e.normalizeStyle({maxWidth:`${e.unref(d).toString().length||1}em`}),disabled:e.unref(y)===null||((de=e.unref(y))==null?void 0:de.balance)===0,"onUpdate:modelValue":z[3]||(z[3]=ie=>e.isRef(d)?d.value=ie:null),onInput:Z,min:"0",max:e.unref(x),onKeypress:L},null,44,vd),[[e.vModelText,e.unref(d),void 0,{number:!0}]]),z[15]||(z[15]=e.createTextVNode(" бонусов ",-1))])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("p",Td,"У вас есть "+e.toDisplayString(e.unref(y)?e.unref(y).balance:0)+" B",1)):e.createCommentVNode("",!0),S.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"range",class:"footer_range","onUpdate:modelValue":z[4]||(z[4]=ie=>e.isRef(d)?d.value=ie:null),min:0,max:e.unref(x)},null,8,$d)),[[e.vModelText,e.unref(d),void 0,{number:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("ul",Ad,[S.value?(e.openBlock(),e.createElementBlock("li",Md,[z[17]||(z[17]=e.createElementVNode("p",null,"Сумма заказа:",-1)),e.createElementVNode("p",null,[e.createVNode(Re,{price:e.unref(c),fixedFloat:2},null,8,["price"]),z[16]||(z[16]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("li",Pd,[z[19]||(z[19]=e.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),e.createElementVNode("p",null,[e.createVNode(Re,{price:e.unref(d),fixedFloat:2},null,8,["price"]),z[18]||(z[18]=e.createTextVNode(" Б",-1))])])):e.createCommentVNode("",!0),e.unref(h)!==0?(e.openBlock(),e.createElementBlock("li",Id,[e.createElementVNode("p",Vd,e.toDisplayString(e.unref(h)>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",Rd,[e.createVNode(Re,{price:Math.abs(e.unref(h)),fixedFloat:2},null,8,["price"]),z[20]||(z[20]=e.createTextVNode(" ₽",-1))])])):$.value!==0?(e.openBlock(),e.createElementBlock("li",Dd,[e.createElementVNode("p",Od,e.toDisplayString($.value>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",Ld,[e.createVNode(Re,{price:Math.abs($.value),fixedFloat:2},null,8,["price"]),z[21]||(z[21]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),e.createElementVNode("li",null,[z[23]||(z[23]=e.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),e.createElementVNode("p",Fd,[e.createVNode(Re,{price:e.unref(c)-e.unref(d),fixedFloat:2},null,8,["price"]),z[22]||(z[22]=e.createTextVNode(" ₽",-1))])])]),e.createElementVNode("div",zd,[e.unref(y)?(e.openBlock(),e.createBlock(Ye,{key:0,textButtonDefault:"Бонусы",onClick:ee,class:"button_bonus_cart"})):e.createCommentVNode("",!0),e.createVNode(Ye,{textButtonDefault:p.value?"Рассчитать скидки":e.unref(m),onClick:p.value?J:M,class:"button_payment_cart",disabled:U.value},null,8,["textButtonDefault","onClick","disabled"])])])]),n.configPage.kiosk_menu?(e.openBlock(),e.createBlock(nd,{key:0,orderNumber:e.unref(E),pageNumber:1},null,8,["orderNumber"])):e.createCommentVNode("",!0),e.createVNode(wn,{visible:e.unref(g),"onUpdate:visible":z[5]||(z[5]=ie=>e.isRef(g)?g.value=ie:null),textNotificationDefault:e.unref(P).textNotification,backgroundColor:e.unref(_).accent_color?e.unref(_).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"])],64)}}}),Hd={},jd={viewBox:"0 0 24 24"};function qd(n,t){return e.openBlock(),e.createElementBlock("svg",jd,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Wd=ae(Hd,[["render",qd]]),Gd={class:"retry_screen"},Kd={class:"retry_all_in_screen"},Jd={class:"retry_content"},Xd={class:"retry_icon_wrap"},Yd={class:"retry_icon_circle"},Zd={class:"retry_error_x"},Qd=e.defineComponent({__name:"RetryPage",setup(n){const t=Ge(),o=Q.useRouter(),r=Q.useRoute(),s=fe(),a=()=>{t.notificationData_lib.textNotification="",t.is_notification_lib=!1,s.openApiKey=!0,o.replace(`/${r.params.orgId}/`)};return(i,l)=>(e.openBlock(),e.createElementBlock("section",Gd,[e.createElementVNode("div",Kd,[e.createElementVNode("main",Jd,[e.createElementVNode("div",Xd,[e.createElementVNode("div",Yd,[l[0]||(l[0]=e.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),e.createElementVNode("div",Zd,[e.createVNode(Wd)])])]),l[1]||(l[1]=e.createElementVNode("div",{class:"retry_oops"},"OOPS",-1)),l[2]||(l[2]=e.createElementVNode("h1",{class:"retry_title"},"Что-то пошло не так",-1)),l[3]||(l[3]=e.createElementVNode("div",{class:"retry_hint"},[e.createElementVNode("p",null,"Похоже, произошёл технический сбой."),e.createElementVNode("p",null,"Мы уже знаем о проблеме и сейчас разбираемся."),e.createElementVNode("p",null,"Приносим извинения за доставленные неудобства."),e.createElementVNode("p",null,"Попробуйте начать новый заказ.")],-1))]),e.createElementVNode("div",{class:"retry_footer"},[e.createElementVNode("button",{onClick:a,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=e.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),eu={class:"wrapper_loader"},tu=e.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",eu,[e.createElementVNode("div",{class:"loader",style:e.normalizeStyle({width:n.size})},null,4)]))}}),nu=ae(e.defineComponent({__name:"AnimationLoader",props:{id:{}},setup(n){const t=e.ref(!0);return e.watch(()=>t.value,()=>{t.value=!1,setTimeout(()=>{t.value=!0},0)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"opacity-animation",key:n.id},[e.renderSlot(o.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-c6b97942"]]),ou={key:0},ru={class:"card__main__wrapper"},su={key:0,class:"folder_content_top"},au={key:0,class:"loader_card_main"},iu={key:1,class:"card__main_content"},lu=["src","alt"],cu={class:"card_title_price_wrapper"},du={class:"title"},uu={key:0,class:"price"},fu={key:1,class:"card_button_add_wrapper"},Go=ae(e.defineComponent({__name:"CardMain",props:{data:{},activeTags:{},is_group:{type:Boolean},parent:{},isLoading:{type:Boolean},selectGroupChild:{type:Function},takeCurrentCard:{type:Function}},setup(n){const t=we(),o=fe(),r=me(),{itemThemes:s}=q.storeToRefs(t),{is_18_above_content:a,is18Allowed:i,notificationData_lib:l}=q.storeToRefs(o),c=n,d=(_,m)=>{var E,h,g;const b={id:_.id,is_fake:_.is_fake||!1,amount:_.amount||1,name:_.name,image_link:_.image_link,price:_.price,old_price:_.price,size:void 0,sizes:[],modifiers:[],groups:_.groups,group_modifiers:[],energy_amount:_.energy_amount??0,proteins_amount:_.proteins_amount??0,fat_amount:_.fat_amount??0,carbohydrates_amount:_.carbohydrates_amount??0},B=!((E=_.modifiers)!=null&&E.length)&&!((h=_.group_modifiers)!=null&&h.length)&&!((g=_.sizes)!=null&&g.length);if(r.isUpSale=!1,_.adult&&!i.value){a.value=!0,B&&(l.value.fastAdd=b);return}if(B){o.addToCart(b);return}if(_.amount||(_.amount=1),c.is_group&&c.selectGroupChild){c.selectGroupChild({..._,parent:c.parent,child:m.child_groups});return}c.takeCurrentCard&&c.takeCurrentCard(m.id)},u=_=>{if(c.is_group&&c.selectGroupChild){_={..._,parent:c.parent,child:_.child_groups},c.selectGroupChild(_);return}if(_.adult&&!i.value){a.value=!0;return}c.takeCurrentCard&&c.takeCurrentCard(_.id)},f=e.computed(()=>c.activeTags.every(_=>c.data.tags.includes(_))),{mediaUrl:y}=Ze(()=>c.data.id+"_image",()=>c.data.image_link);return(_,m)=>{var b;return((b=c.activeTags)==null?void 0:b.length)===0||f.value||c.is_group?(e.openBlock(),e.createElementBlock("div",ou,[e.createVNode(nu,{id:c.data.id},{opacityLoader:e.withCtx(()=>[e.createElementVNode("div",ru,[n.is_group?(e.openBlock(),e.createElementBlock("div",su)):e.createCommentVNode("",!0),e.createElementVNode("div",{onClick:m[0]||(m[0]=B=>u(c.data)),class:e.normalizeClass(["card__main",{card__main_folder:n.is_group}])},[n.isLoading?(e.openBlock(),e.createElementBlock("div",au,[e.createVNode(tu)])):(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("img",{src:e.unref(y)||"",class:e.normalizeClass(["img",{card_blur_image:c.data.adult&&!e.unref(i)}]),loading:"lazy",alt:n.data.name},null,10,lu),e.createElementVNode("div",cu,[e.createElementVNode("p",du,e.toDisplayString(n.data.name),1),n.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",uu,e.toDisplayString(e.unref(ut)(n.data))+" ₽",1))])]))],2),n.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("div",{onClick:m[1]||(m[1]=B=>d(n.data,c.data)),class:"add_button"},[...m[2]||(m[2]=[e.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1},8,["id"])])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-06431027"]]),pu=["id","onClick"],mu=ae(e.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(n){const t=e.ref(null);return(o,r)=>n.menuGroup.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:t},[e.createVNode(hn,{axis:"x",behavior:"smooth",container:t.value,autoScroll:!0,idActive:n.idActiveGroup,clearContainer:!0},{default:e.withCtx(({handleTargetClick:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.menuGroup,(a,i)=>(e.openBlock(),e.createElementBlock("li",{key:a.id,id:"scrolling"+a.id,onClick:l=>{n.activeTakeGroup&&n.activeTakeGroup(a.id,i),s(l)},style:e.normalizeStyle(n.idActiveGroup==a.id?{fontFamily:"Bounded"}:{})},e.toDisplayString(a.name),13,pu))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),hu=["id","onClick"],gu=ae(e.defineComponent({__name:"TagsMain",props:{menuTags:{default:()=>[]},groupIndex:{default:null},isSolo:{type:Boolean,default:!1},currentActiveTag:{},activeTakeTags:{type:Function,default:void 0},activeTakeTagsSolo:{type:Function,default:void 0}},setup(n){const t=n,o=e.ref(null),r=e.computed(()=>{if(t.isSolo&&!t.groupIndex)return Array.isArray(t.currentActiveTag)?t.currentActiveTag:[];if(t.groupIndex!==null&&t.groupIndex!==void 0){const s=t.currentActiveTag[t.groupIndex];return Array.isArray(s)?s:[]}return[]});return(s,a)=>n.menuTags.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:o},[e.createVNode(hn,{axis:"x",behavior:"smooth",container:o.value,autoScroll:!0,idActive:r.value?r.value[n.currentActiveTag.length-1]:null,clearContainer:!1},{default:e.withCtx(({handleTargetClick:i})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.menuTags,(l,c)=>(e.openBlock(),e.createElementBlock("li",{key:c,id:`scrolling${l}`,onClick:d=>{n.activeTakeTags&&(n.groupIndex||n.groupIndex===0)?n.activeTakeTags(l,n.groupIndex):n.activeTakeTagsSolo&&n.activeTakeTagsSolo(l),i(d)},class:e.normalizeClass({main__filter_active:(r.value??[]).includes(l)})},e.toDisplayString(l),11,hu))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-818940a4"]]),_u=["data-id"],yu=["src"],bu=["src"],wu=ae(e.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(n){const t=n,{mediaUrl:o}=Ze(()=>{var r,s;return(r=t.group)!=null&&r.video_link?`${t.group.id}_video`:(s=t.group)!=null&&s.image_link?`${t.group.id}_image`:null});return(r,s)=>n.group?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["drum_item",{active:t.active}]),"data-id":n.group.id},[n.group.video_link?(e.openBlock(),e.createElementBlock("video",{key:e.unref(o),loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},[e.createElementVNode("source",{src:e.unref(o)||"",type:"video/webm"},null,8,yu)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"drum_img",src:e.unref(o)||""},null,8,bu)),e.createElementVNode("p",null,e.toDisplayString(n.group.name),1)],10,_u)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-b948bda1"]]),ku={},Cu={width:"9.998535",height:"10.000000",viewBox:"0 0 9.99854 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Su(n,t){return e.openBlock(),e.createElementBlock("svg",Cu,[...t[0]||(t[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("path",{id:"Форма 5",d:"M4.23 10L5.76 10L5.76 5.74L9.99 5.74L9.99 4.25L5.76 4.25L5.76 0L4.23 0L4.23 4.25L0 4.25L0 5.74L4.23 5.74L4.23 10Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const Eu=ae(ku,[["render",Su]]),Bu={class:"recommendation_wrapper"},Nu={class:"recommendation_header"},xu={class:"recommendation_info"},vu=ae(e.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(n){const t=me(),{isUpSale:o,dataUpSale:r}=q.storeToRefs(t),s=()=>{o.value=!1};return e.onUnmounted(()=>{r.value=null}),(a,i)=>(e.openBlock(),e.createElementBlock("div",Bu,[e.createElementVNode("div",Nu,[i[0]||(i[0]=e.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),e.createElementVNode("div",{class:"header_close",onClick:s},[e.createVNode(Eu,{class:"close_icon"})])]),e.createElementVNode("div",xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),l=>(e.openBlock(),e.createBlock(Go,{data:l,key:l.id,parent:l.id,is_group:!1,is_product:!0,class:"card",activeTags:[],isLoading:!1,closeCurrentCard:n.closeCurrentCard,takeCurrentCard:()=>n.openCurrentCard(l.id,!0)},null,8,["data","parent","closeCurrentCard","takeCurrentCard"]))),128))])]))}}),[["__scopeId","data-v-d545ec45"]]),Tu=e.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(n){const t=n;return e.watch(()=>t.data,o=>{document.body.style.overflow=o?"hidden":""}),()=>{}}}),$u={class:"wrapper_modal"},Au={class:"card_modal"},Mu=ae(e.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(n){const t=n,o=me(),{isUpSale:r}=q.storeToRefs(o),s=()=>{r.value=!1};return(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Tu,{data:t.visible},null,8,["data"]),e.createElementVNode("div",{class:"black_modal",onClick:s}),e.createElementVNode("div",$u,[e.createElementVNode("div",Au,[e.renderSlot(a.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]),Sn=q.defineStore("modulesLib",()=>{const n=e.ref(!1),t=e.ref({textNotification:""});return{is_notification_lib:n,notificationData_lib:t}}),Ft=Symbol("clickOutside"),Pu={mounted(n,t){n[Ft]=o=>{n.contains(o.target)||t.value(o)},document.addEventListener("click",n[Ft])},unmounted(n){n[Ft]&&document.removeEventListener("click",n[Ft])}};class Iu{constructor(t){X(this,"value");X(this,"next");this.value=t}}class Vu{constructor(){Wt(this,Be);Wt(this,je);Wt(this,et);this.clear()}enqueue(t){const o=new Iu(t);Me(this,Be)?(Me(this,je).next=o,Le(this,je,o)):(Le(this,Be,o),Le(this,je,o)),xn(this,et)._++}dequeue(){const t=Me(this,Be);if(t)return Le(this,Be,Me(this,Be).next),xn(this,et)._--,Me(this,Be)||Le(this,je,void 0),t.value}peek(){if(Me(this,Be))return Me(this,Be).value}clear(){Le(this,Be,void 0),Le(this,je,void 0),Le(this,et,0)}get size(){return Me(this,et)}*[Symbol.iterator](){let t=Me(this,Be);for(;t;)yield t.value,t=t.next}*drain(){for(;Me(this,Be);)yield this.dequeue()}}Be=new WeakMap,je=new WeakMap,et=new WeakMap;function Ru(n){Ko(n);const t=new Vu;let o=0;const r=()=>{o<n&&t.size>0&&(o++,t.dequeue()())},s=()=>{o--,r()},a=async(c,d,u)=>{const f=(async()=>c(...u))();d(f);try{await f}catch{}s()},i=(c,d,u)=>{new Promise(f=>{t.enqueue(f)}).then(a.bind(void 0,c,d,u)),o<n&&r()},l=(c,...d)=>new Promise(u=>{i(c,u,d)});return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>n,set(c){Ko(c),n=c,queueMicrotask(()=>{for(;o<n&&t.size>0;)r()})}},map:{async value(c,d){const u=Array.from(c,(f,y)=>this(d,f,y));return Promise.all(u)}}}),l}function Ko(n){if(!((Number.isInteger(n)||n===Number.POSITIVE_INFINITY)&&n>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let Ee=null;const Jo=Ru(5),Du=async(n,t)=>{Ee&&zu();const o=fe(),r=Sn(),s=me(),{displayCards:a}=q.storeToRefs(o),{is_notification_lib:i,notificationData_lib:l}=q.storeToRefs(r),{stateCard:c,openProduct:d}=q.storeToRefs(s),u=ze.create();await Ou(n),Ee=xt(`wss://${t}/ws/org-unit/${n}/`),Ee.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",n,")")),Ee.on("error",f=>console.warn("WebSocket ошибка:",f)),Ee.on("close",()=>console.warn("Realtime WebSocket закрыт")),Ee.on("message",async f=>{if(f.type)return;l.value.textNotification="Мы обновили меню";const y=f.params||f,_=y.active_groups||[],m=y.updated_groups||[],b=y.updated_product_groups||[],B=await We(),E=new Set(_.map(S=>S)),h=new Map(a.value.map(S=>[S.id,S])),g=[],P=B.transaction("groups","readwrite");let F=await P.objectStore("groups").openCursor();for(;F;){const S=F.key;!E.has(S)&&S!==n&&(g.push(S),await F.delete(),h.delete(S)),F=await F.continue()}await P.done,a.value=Array.from(h.values()),g.length>0&&await Lu(E);const D=[...m.map(S=>Jo(async()=>{const[p,w]=await Promise.all([u.getGroupByID(S),u.loadGroupProducts(S)]);p.products=w,h.set(S,p),await lt(S,p),await Yo(p,w,!0)})),...b.map(S=>Jo(async()=>{const[p,w]=await Promise.all([u.getGroupByID(S),u.loadGroupProducts(S)]);p.products=w,h.set(S,p),await lt(S,p),await Yo(p,w,!0),await Fu(w,S)}))];await Promise.all(D),a.value=Array.from(h.values()),await Pr(n,a),i.value=!0;const R=c.value.openCard;if(R!=null&&R.id){const S=new Set(R.groups??[]),p=new Set;let w=!1;for(const $ of h.values()){const A=$==null?void 0:$.products;if(!Array.isArray(A))continue;const C=A.find(T=>(T==null?void 0:T.id)===R.id);if((C==null?void 0:C.adult)===!0){d.value={id:null,visible:!1},s.reset();return}C&&($==null?void 0:$.id)!=null&&(p.add($.id),(m.includes($.id)||b.includes($.id))&&(w=!0))}if(p.size===0){d.value={id:null,visible:!1},s.reset();return}(!(S.size===p.size&&[...S].every($=>p.has($)))||w)&&await u.getSingleProduct(R==null?void 0:R.id)}}),Ee.connect()},Ou=async n=>{try{const t=fe(),o=await en(n);o!=null&&o.data&&(t.displayCards=o.data)}catch(t){console.error("Ошибка загрузки кэша групп:",t)}},Xo=async n=>{const t=fe(),o=Sn(),r=me(),{stateCard:s,openProduct:a}=q.storeToRefs(r),{cartProducts_lib:i}=q.storeToRefs(t),l=i.value,c=[],d=[],u=s.value.openCard;for(const f of l)n(f)?(c.push(f),(f.id===(u==null?void 0:u.id)||u!=null&&u.adult)&&(a.value={id:null,visible:!1})):d.push(f);if(c.length>0){const f=c.map(y=>y.name).slice(0,3).join(", ");o.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${f}${c.length>3?` и ещё ${c.length-3}`:""}`,i.value=d,t.updateCartInLocalStorage()}},Lu=async n=>{await Xo(t=>{var o;return(o=t.groups)!=null&&o.length?!t.groups.some(r=>n.has(r)):!0})},Fu=async(n,t)=>{const o=fe(),r=new Set(n.filter(s=>!s.adult||o.is18Allowed).map(s=>s.id));await Xo(s=>{var a;return(a=s.groups)!=null&&a.includes(t)?!r.has(s.id):!1})},Yo=async(n,t,o=!0)=>{if(n.video_link&&zt(n.video_link,`${n.id}_video`,o),n.image_link&&zt(n.image_link,`${n.id}_image`,o),t!=null&&t.length)for(const r of t)r.video_link&&zt(r.video_link,`${r.id}_video`,o),r.image_link&&zt(r.image_link,`${r.id}_image`,o)},zt=async(n,t,o=!1)=>{try{const r=dt();if(!o){const i=await nt(t);if(i){r.updateCacheFromBlob(t,i),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:t,blob:i}}));return}}const s=await fetch(n);if(!s.ok)throw new Error("Network error");const a=await s.blob();if(a.size===0)throw new Error("Empty blob");await tn(t,a),r.updateCacheFromBlob(t,a),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:t,blob:a}}))}catch(r){console.warn(`[MediaCache] Failed for ${t}:`,r)}},zu=()=>{Ee&&(Ee.off("open"),Ee.off("message"),Ee.off("error"),Ee.off("close"),Ee.close(!0),Ee=null)},Uu={class:"button_price_bg"},Hu={class:"wrapper_container_price_bg"},ju={class:"button_price"},qu={key:0,class:"image_product_container"},Wu=["src"],Gu=e.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(n){const t=fe(),o=dt(),{totalPrice_lib:r,cartProducts_lib:s}=q.storeToRefs(t);o.initCacheSingle("defaultImage");const a=e.computed(()=>o.cache.defaultImage||""),i=c=>{const d=`${c}_image`;return o.initCacheSingle(d),o.cache[d]||a.value},l=e.computed(()=>{var c;return(c=s.value)!=null&&c.length,s.value.slice(0,3).map(d=>({id:d.id,url:i(d.id)}))});return(c,d)=>(e.openBlock(),e.createElementBlock("div",Uu,[e.createElementVNode("div",Hu,[e.createElementVNode("div",ju,[e.unref(r)>0&&l.value.length>0?(e.openBlock(),e.createElementBlock("div",qu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"filter_image_product"},[e.createElementVNode("img",{src:u.url,class:"img_product"},null,8,Wu)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"button_default_main",onClick:d[0]||(d[0]=u=>c.$emit("goToCart"))},[d[2]||(d[2]=e.createElementVNode("div",{class:"icont_cart"},null,-1)),e.createElementVNode("p",null,[e.createVNode(Re,{price:e.unref(r),fixedFloat:2},null,8,["price"]),d[1]||(d[1]=e.createTextVNode(" ₽",-1))])])])])]))}}),bt=null,{min:Qe,max:De,abs:Zo,floor:Ku}=Math,Qo=(n,t,o)=>Qe(o,De(t,n)),er=n=>[...n].sort((t,o)=>t-o),Ju=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)},En=()=>{let n;return[new Promise(t=>{n=t}),n]},tr=n=>{let t;return()=>(n&&(t=n(),n=void 0),t)},wt=(n,t,o)=>{const r=o?"unshift":"push";for(let s=0;s<t;s++)n[r](-1);return n},nr=(n,t)=>{const o=n.t[t];return o===-1?n.o:o},Xu=(n,t,o)=>{const r=n.t[t]===-1;return n.t[t]=o,n.i=Qe(t,n.i),r},Ut=(n,t)=>{if(!n.l)return 0;if(n.i>=t)return n.u[t];n.i<0&&(n.u[0]=0,n.i=0);let o=n.i,r=n.u[o];for(;o<t;)r+=nr(n,o),n.u[++o]=r;return n.i=t,r},it=(n,t,o=0,r=n.l-1)=>{let s=o;for(;o<=r;){const a=Ku((o+r)/2);Ut(n,a)<=t?(s=a,o=a+1):r=a-1}return Qo(s,0,n.l-1)},or=(n,t,o)=>{const r=t-n.l;return n.i=o?-1:Qe(t-1,n.i),n.l=t,r>0?(wt(n.u,r),wt(n.t,r,o),n.o*r):(n.u.splice(r),(o?n.t.splice(0,-r):n.t.splice(r)).reduce((s,a)=>s-(a===-1?n.o:a),0))},Yu=n=>n.documentElement,Zu=n=>n.ownerDocument,Qu=n=>n.defaultView,rr=tr(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),ef=tr(()=>"scrollBehavior"in Yu(document).style),tf=(n,t=40,o=0,r,s=!1)=>{let a=!!o,i=1,l=0,c=0,d=0,u=0,f=0,y=0,_=0,m=0,b=bt,B=[0,a?De(o-1,0):-1],E=0,h=!1;const g=(($,A,C)=>({o:A,t:C?wt(C.slice(0,Qe($,C.length)),De(0,$-C.length)):wt([],$),l:$,i:-1,u:wt([],$+1)}))(n,r?r[1]:t,r&&r[0]),P=new Set,O=()=>d-c,F=()=>O()+f+u,D=($,A)=>((C,T,I,k)=>{if(k=Qe(k,C.l-1),Ut(C,k)<=T){const x=it(C,I,k);return[it(C,T,k,x),x]}{const x=it(C,T,void 0,k);return[x,it(C,I,x)]}})(g,$,A,B[0]),R=()=>Ut(g,g.l),S=($,A)=>{const C=Ut(g,$)-f;return A?R()-C-p($):C},p=$=>nr(g,$),w=($,A=-1)=>g.t[$]===A,N=$=>{$&&(rr()&&_!==0||b&&m===1?f+=$:u+=$)};return{p:()=>{P.clear()},h:()=>i,m:()=>($=>[$.t.slice(),$.o])(g),v:($=200)=>{if(!h||a)return B;let A,C;if(y)[A,C]=B;else{let T=De(0,F()),I=T+l;s||($=De(0,$),_!==1&&(T-=$),_!==2&&(I+=$)),[A,C]=B=D(De(0,T),De(0,I)),b&&(A=Qe(A,b[0]),C=De(C,b[1]))}return[De(A,0),Qe(C,g.l-1)]},S:$=>it(g,$-c),I:w,O:S,k:p,j:()=>g.l,N:()=>d,B:()=>_!==0,T:()=>l,q:()=>c,M:R,P:()=>(y=u,u=0,[y,m===2]),R:($,A)=>{const C=[$,A];return P.add(C),()=>{P.delete(C)}},A:($,A)=>{let C,T,I=0;switch($){case 1:{if(A===d&&m===0)break;const k=y;y=0;const x=A-d,V=Zo(x);k&&V<Zo(k)+1||m!==0||(_=x<0?2:1),a&&(a=!1),d=A,I=4;const L=O();L>=-l&&L<=R()&&(I+=1,T=V>l);break}case 2:I=8,_!==0&&(C=!0,I+=1),_=0,m=0,b=bt;break;case 3:{const k=A.filter(([x,V])=>!w(x,V));if(!k.length)break;N(k.reduce((x,[V,L])=>((m===2||(b&&m===1?V<b[0]:S(V+(_===0&&m===0?1:0))<O()))&&(x+=L-p(V)),x),0));for(const[x,V]of k){const L=p(x),G=Xu(g,x,V);s&&(E+=G?V:V-L)}s&&l&&E>l&&(N(((x,V)=>{let L=0;const G=[];x.t.forEach((J,ee)=>{J!==-1&&(G.push(J),ee<V&&L++)}),x.i=-1;const W=er(G),Z=W.length,se=Z/2|0,ce=Z%2==0?(W[se-1]+W[se])/2:W[se],M=x.o;return((x.o=ce)-M)*De(V-L,0)})(g,it(g,F()))),s=!1),I=3,T=!0;break}case 4:l!==A&&(l||(h=T=!0),l=A,I=3);break;case 5:A[1]?(N(or(g,A[0],!0)),m=2,I=1):(or(g,A[0]),I=1);break;case 6:c=A;break;case 7:m=1;break;case 8:b=D(A,A+l),I=1}I&&(i=1+(2147483647&i),C&&f&&(u+=f,f=0),P.forEach(([k,x])=>{I&k&&x(T)}))}}},Bn=setTimeout,Nn=(n,t)=>t?-n:n,nf=(n,t,o,r,s,a)=>{const i=Date.now;let l=0,c=!1,d=!1,u=!1,f=!1;const y=(()=>{let E;const h=()=>{E!=bt&&clearTimeout(E)},g=()=>{h(),E=Bn(()=>{E=bt,(()=>{if(c||d)return c=!1,void y();u=!1,n.A(2)})()},150)};return g.C=h,g})(),_=()=>{l=i(),u&&(f=!0),n.A(1,r()),y()},m=E=>{if(c||!n.B()||E.ctrlKey)return;const h=i()-l;150>h&&50<h&&(o?E.deltaX:E.deltaY)&&(c=!0)},b=()=>{d=!0,u=f=!1},B=()=>{d=!1,rr()&&(u=!0)};return t.addEventListener("scroll",_),t.addEventListener("wheel",m,{passive:!0}),t.addEventListener("touchstart",b,{passive:!0}),t.addEventListener("touchend",B,{passive:!0}),{H:()=>{t.removeEventListener("scroll",_),t.removeEventListener("wheel",m),t.removeEventListener("touchstart",b),t.removeEventListener("touchend",B),y.C()},V:()=>{const[E,h]=n.P();E&&(s(E,h,f),f=!1,h&&n.T()>n.M()&&n.A(1,r()))}}},of=(n,t,o)=>{let r;return[async(s,a)=>{if(!await t())return;r&&r();const i=()=>{const[l,c]=En();return r=()=>{c(!1)},n.T()&&Bn(r,150),[l,n.R(2,()=>{c(!0)})]};if(a&&ef())n.A(8,s()),Ju(async()=>{for(;;){let l=!0;for(let[u,f]=n.v();u<=f;u++)if(n.I(u)){l=!1;break}if(l)break;const[c,d]=i();try{if(!await c)return}finally{d()}}n.A(7),o(s(),a)});else for(;;){const[l,c]=i();try{if(n.A(7),o(s()),!await l)return}finally{c()}}},()=>{r&&r()}]},rf=n=>{let t;return{F(o){(t||(t=new(Qu(Zu(o))).ResizeObserver(n))).observe(o)},J(o){t.unobserve(o)},H(){t&&t.disconnect()}}},sf=e.defineComponent({props:{L:{type:Object,required:!0},W:{type:Object,required:!0},X:{type:Object,required:!0},Y:{type:Function,required:!0},D:{type:Number,required:!0},U:{type:Boolean},G:{type:Boolean},K:{type:Boolean},Z:{type:String,required:!0},ee:Object},setup(n){const t=e.ref(),o=e.computed(()=>n.L.value&&n.W.O(n.D,n.K)),r=e.computed(()=>n.L.value&&n.W.I(n.D));return e.watch(()=>t.value&&n.D,(s,a,i)=>{i(n.Y(t.value,n.D))},{flush:"post"}),()=>{var s;const{X:a,U:i,G:l,Z:c}=n,d=r.value,{style:u,...f}=(s=n.ee)!==null&&s!==void 0?s:{},y={contain:"layout style",position:d&&l?void 0:"absolute",[i?"height":"width"]:"100%",[i?"top":"left"]:"0px",[i?"left":"top"]:o.value+"px",visibility:!d||l?void 0:"hidden",...u};return i&&(y.display="inline-flex"),e.createVNode(c,e.mergeProps({ref:t,style:y},f),typeof(_=a)=="function"||Object.prototype.toString.call(_)==="[object Object]"&&!e.isVNode(_)?a:{default:()=>[a],_:2},16,["style"]);var _}}}),af=(n,t)=>{const o=n.key;return o??"_"+t},lf=(n,t)=>n[0]===t[0]&&n[1]===t[1],sr=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,startMargin:{type:Number,default:0},ssrCount:Number,scrollRef:Object,as:{type:String,default:"div"},item:{type:String,default:"div"},itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(n,{emit:t,expose:o,slots:r}){let s=!!n.ssrCount;const a=n.horizontal,i=e.ref(),l=tf(n.data.length,n.itemSize,n.ssrCount,n.cache,!n.itemSize),c=((m,b)=>{let B;const E=b?"width":"height",h=new WeakMap,g=rf(P=>{const O=[];for(const{target:F,contentRect:D}of P)if(F.offsetParent)if(F===B)m.A(4,D[E]);else{const R=h.get(F);R!=bt&&O.push([R,D[E]])}O.length&&m.A(3,O)});return{te(P){g.F(B=P)},re:(P,O)=>(h.set(P,O),g.F(P),()=>{h.delete(P),g.J(P)}),p:g.H}})(l,a),d=((m,b)=>{let B,E,h=En(),g=!1;const P=b?"scrollLeft":"scrollTop",O=b?"overflowX":"overflowY",[F,D]=of(m,()=>h[0],(R,S)=>{R=Nn(R,g),S?B.scrollTo({[b?"left":"top"]:R,behavior:"smooth"}):B[P]=R});return{oe(R){B=R,b&&(g=getComputedStyle(R).direction==="rtl"),E=nf(m,R,b,()=>Nn(R[P],g),(S,p,w)=>{if(w){const N=R.style,$=N[O];N[O]="hidden",Bn(()=>{N[O]=$})}R[P]=Nn(m.N()+S,g),p&&D()}),h[1](!0)},p(){E&&E.H(),h[1](!1),h=En()},ne:()=>g,se(R){F(()=>R)},ie(R){R+=m.N(),F(()=>R)},le(R,{align:S,smooth:p,offset:w=0}={}){if(R=Qo(R,0,m.j()-1),S==="nearest"){const N=m.O(R),$=m.N();if(N<$)S="start";else{if(!(N+m.k(R)>$+m.T()))return;S="end"}}F(()=>w+m.q()+m.O(R)+(S==="end"?m.k(R)-m.T():S==="center"?(m.k(R)-m.T())/2:0),p)},ce:()=>{E&&E.V()}}})(l,a),u=e.ref(l.h());l.R(1,()=>{u.value=l.h()}),l.R(4,()=>{t("scroll",l.N())}),l.R(8,()=>{t("scrollEnd")});const f=e.computed(m=>{u.value;const b=l.v(n.bufferSize);return m&&lf(m,b)?m:b}),y=e.computed(()=>u.value&&l.B()),_=e.computed(()=>u.value&&l.M());return e.onMounted(()=>{s=!1;const m=requestAnimationFrame(()=>{const b=B=>{c.te(B),d.oe(B)};n.scrollRef?b(n.scrollRef):b(i.value.parentElement)});e.onUnmounted(()=>{cancelAnimationFrame(m)})}),e.onUnmounted(()=>{l.p(),c.p(),d.p()}),e.watch(()=>n.data.length,m=>{l.A(5,[m,n.shift])}),e.watch(()=>n.startMargin,m=>{l.A(6,m)},{immediate:!0}),e.watch([u],()=>{d.ce()},{flush:"post"}),o({get cache(){return l.m()},get scrollOffset(){return l.N()},get scrollSize(){return(m=>De(m.M(),m.T()))(l)},get viewportSize(){return l.T()},findItemIndex:l.S,getItemOffset:l.O,getItemSize:l.k,scrollToIndex:d.le,scrollTo:d.se,scrollBy:d.ie}),()=>{const m=n.as,b=n.item,B=_.value,E=d.ne(),h=!a&&E?"unshift":"push",g=[],P=F=>{var D;const R=r.default({item:n.data[F],index:F})[0];return e.createVNode(sf,{key:af(R,F),L:u,W:l,Y:c.re,D:F,X:R,U:a,K:E,G:s,Z:b,ee:(D=n.itemProps)===null||D===void 0?void 0:D.call(n,{item:n.data[F],index:F})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(n.keepMounted){const F=new Set(n.keepMounted);for(let[D,R]=f.value;D<=R;D++)F.add(D);er([...F]).forEach(D=>{g[h](P(D))})}else for(let[F,D]=f.value;F<=D;F++)g[h](P(F));return e.createVNode(m,{ref:i,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:a?B+"px":"100%",height:a?"100%":B+"px",pointerEvents:y.value?"none":void 0}},typeof(O=g)=="function"||Object.prototype.toString.call(O)==="[object Object]"&&!e.isVNode(O)?g:{default:()=>[g],_:2},8,["style"]);var O}}}),cf=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,ssrCount:Number,itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(n,{emit:t,expose:o,slots:r}){const s=n.horizontal,a=c=>{t("scroll",c)},i=()=>{t("scrollEnd")},l=e.ref();return o({get cache(){return l.value.cache},get scrollOffset(){return l.value.scrollOffset},get scrollSize(){return l.value.scrollSize},get viewportSize(){return l.value.viewportSize},findItemIndex:(...c)=>l.value.findItemIndex(...c),getItemOffset:(...c)=>l.value.getItemOffset(...c),getItemSize:(...c)=>l.value.getItemSize(...c),scrollToIndex:(...c)=>l.value.scrollToIndex(...c),scrollTo:(...c)=>l.value.scrollTo(...c),scrollBy:(...c)=>l.value.scrollBy(...c)}),()=>{return e.createVNode("div",{style:{display:s?"inline-block":"block",[s?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%"}},[e.createVNode(sr,{ref:l,data:n.data,bufferSize:n.bufferSize,itemSize:n.itemSize,itemProps:n.itemProps,shift:n.shift,ssrCount:n.ssrCount,horizontal:s,keepMounted:n.keepMounted,cache:n.cache,onScroll:a,onScrollEnd:i},(c=r,typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!e.isVNode(c)?r:{default:()=>[r],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var c}}}),df=(n,t=10)=>new Promise(o=>{let r=0,s=0,a=0;const i=()=>{const l=n.scrollSize;l===a&&l>0?r++:(r=0)&&(a=l),s++,r>=2||s>=t?o():requestAnimationFrame(i)};requestAnimationFrame(i)});function uf(n,t){const o=(t==null?void 0:t.align)??"start";let r=!1;const s=e.ref(null),a=e.ref(!1),i=e.ref("measure"),l=e.computed(()=>e.toValue(n).length),c=e.computed(()=>i.value==="measure"?1:5),d=e.computed(()=>Array.from({length:l.value*c.value},(B,E)=>E)),u=async()=>{if(s.value&&(i.value="measure",r=!1,a.value=!1,await e.nextTick(),i.value==="measure")){if(await df(s.value),a.value=s.value.scrollSize>s.value.viewportSize,!a.value){r=!1;return}r=!0,i.value="loop",await e.nextTick(),s.value.scrollToIndex(l.value*3,{align:o})}},f=B=>i.value==="measure"?B:l.value===0?0:B%l.value,y=(B,E)=>{s.value&&s.value.scrollToIndex(B,E)},_=(B,E)=>!r||i.value!=="loop"?E:E+Math.round((B-E)/l.value)*l.value,m=B=>{if(!r||i.value!=="loop"||!s.value)return;const E=l.value-1,h=l.value*4;if(B<E)return y(l.value*3-1,{align:"start"});if(B>=h)return y(l.value*3,{align:"start"})},b=()=>{if(!s.value||!r)return;const B=s.value.findItemIndex(s.value.scrollOffset);m(B)};return e.onMounted(u),e.onUnmounted(()=>s.value=null),e.watch(l,()=>e.nextTick(u)),{listRef:s,items:d,hasScroll:a,realIndex:f,findNearestIndex:_,scrollToIndex:y,init:u,onScroll:b}}const ff={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},pf=n=>{var o;const t=Object.assign({},ff,n);if(t.pinch&&(document.addEventListener("touchstart",r=>r.touches.length>1&&r.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",r=>r.preventDefault(),{passive:!1})),t.doubleTap){let r=0;document.addEventListener("touchend",s=>{const a=Date.now();a-r<=250&&s.preventDefault(),r=a},{passive:!1})}t.wheel&&document.addEventListener("wheel",r=>(r.ctrlKey||r.metaKey)&&r.preventDefault(),{passive:!1}),(o=t.buttons)!=null&&o.length&&document.addEventListener("keydown",r=>(r.ctrlKey||r.metaKey)&&t.buttons.includes(r.key)&&r.preventDefault())};Object.defineProperty(H,"useRoute",{enumerable:!0,get:()=>Q.useRoute}),Object.defineProperty(H,"useRouter",{enumerable:!0,get:()=>Q.useRouter}),H.BasketButton=Gu,H.BottomSheet=Uo,H.ButtonDefault=Ye,H.CardMain=Go,H.CardProductPage=nc,H.CardReader=qo,H.CartBox=jo,H.CartPage=Ud,H.DrumItem=wu,H.GroupMain=mu,H.InitConnection=ze,H.ModalWindows=Mu,H.NotificationWindow=wn,H.PopupWindowDefault=Ho,H.Recommendation=vu,H.RetryPage=Qd,H.TagsMain=gu,H.VList=cf,H.Virtualizer=sr,H.clearAllProductDB=Vr,H.clearLocalStorage=ot,H.getCachedGroup=en,H.getCachedProduct=Vn,H.getWebSocketInstance=xt,H.initPinia=_r,H.initRouter=br,H.preventZoom=pf,H.updateIndexedDB=Du,H.useCachedMedia=Ze,H.useCardLibStore=me,H.useCartLibStore=Ge,H.useImageCacheStore=dt,H.useMainLibStore=fe,H.useModal=Wo,H.useModalStore=Cn,H.useModulesLibStore=Sn,H.useThemeStore=we,H.useVirtuaLoop=uf,H.vClickOutside=Pu,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});