import{r as l,o as i,c as a,a as t,n as h,k as v,v as C,f as r,e as _,h as p,d as y,_ as b,O as d,P as g}from"./index.js";import{_ as f,a as k,b as w,c as T}from"./back.js";const E={class:"iface-vertical-centered"},R={class:"shop-content"},x={class:"shop-top"},S=t("img",{src:w},null,-1),P=[S],D=t("div",{class:"title1"},"Магазин одежды",-1),G={class:"params"},q=t("img",{src:T},null,-1),A=[q],L={class:"search__box-input"},N={key:0,class:"search__box-input__placeholder"},V=t("img",{src:f},null,-1),B=t("img",{src:k},null,-1);function H(s,o,U,F,e,c){const m=l("MainPage"),u=l("cart");return i(),a("div",E,[t("div",{class:"shop",style:y({transform:"scale("+e.scale*1.25+")"})},[t("div",R,[t("div",x,[t("div",{class:"close",onClick:o[0]||(o[0]=n=>c.closeWindow())},P),D,t("div",G,[t("div",{class:h(["search",{aviable:e.query.trim()}])},[t("div",{class:"search-button",onClick:o[1]||(o[1]=n=>c.search(e.query))},A),t("div",L,[v(t("input",{type:"text","onUpdate:modelValue":o[2]||(o[2]=n=>e.query=n)},null,512),[[C,e.query]]),e.query===""?(i(),a("span",N,"Введите название товара, либо категории...")):r("",!0)])],2),e.page=="main"?(i(),a("button",{key:0,class:"cart",onClick:o[3]||(o[3]=n=>e.page="cart")},[V,_("Корзина")])):r("",!0),e.page=="cart"?(i(),a("button",{key:1,class:"back",onClick:o[4]||(o[4]=n=>e.page="main")},[B,_("Вернуться")])):r("",!0)])]),e.page=="main"&&e.aviableData?(i(),p(m,{openGoods:e.goods,openTrends:e.trends,openCategories:e.categories,openSearching:e.query.trim(),key:e.goods,onAddToCart:c.addToCart},null,8,["openGoods","openTrends","openCategories","openSearching","onAddToCart"])):r("",!0),e.page=="cart"?(i(),p(u,{key:1,openGoods:e.goods},null,8,["openGoods"])):r("",!0)])],4)])}const I=d(()=>g(()=>import("./MainPage.js"),["./MainPage.js","./14.js","./index.js","./index.css","./check2.js"],import.meta.url)),M=d(()=>g(()=>import("./Cart.js"),["./Cart.js","./14.js","./index.js","./index.css","./remove.js","./Cart.css"],import.meta.url)),O=1920,W=1080,z={name:"example",props:["openParams"],components:{MainPage:I,Cart:M},data(){return{params:{},page:"main",trends:[0,1,2,3],categories:["Торс"],query:"",aviableData:!0,scale:1,sourceGoods:[],goods:[{image:"1.png",category:0,price:123800123,title:"Шапка Reebok0",inCart:!1},{image:"1.png",category:0,price:12350,title:"Шапка Reebok0",inCart:!1},{image:"1.png",category:0,price:45200,title:"Шапка Reebok0",inCart:!1},{image:"1.png",category:1,price:5e3,title:"Шапка Reebok1",inCart:!1},{image:"1.png",category:1,price:123800123,title:"Шапка Reebok1",inCart:!1},{image:"1.png",category:3,price:12350,title:"Шапка Reebok3",inCart:!1},{image:"1.png",category:3,price:45200,title:"Шапка Reebok3",inCart:!1},{image:"1.png",category:1,price:5e3,title:"Шапка Reebok1",inCart:!1}]}},created(){this.openParams&&(this.params=this.openParams),this.sourceGoods=this.goods,this.calculateScale(),window.addEventListener("resize",this.calculateScale)},methods:{addToCart(s){this.goods[s].inCart=!0},search(s){this.goods=this.sourceGoods.filter(o=>o.title.toLowerCase().indexOf(s.toLowerCase())>-1),console.log(this.goods)},closeWindow(){this.$emit("close-window")},calculateScale(){const s=window.screen.width,o=window.screen.height;this.scale=(s+o)/(O+W)},_formatNumber(s){return s.toString().replace(/\B(?=(\d{3})+(?!\d))/g,".")}}},K=b(z,[["render",H]]);export{K as default};
