1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4627],{8598:function(e,t,r){r.r(t),r.d(t,{default:function(){return j}});var n=r(85893),l=r(85236),s=r(25675),a=r.n(s),c=r(11163),o=r(67294),i=r(56064),d=r(68356),u=r(92775),x=r(73914),p=r(39602),f=r(57685);function m(e){var t=e.color,r=e.diameter,l=e.percentage,s=e.borderWidth,a=e.contentBackgroundColor,c=e.className,i=e.contentClassName,d=e.children,u=(0,o.useRef)(null),x=(0,o.useRef)(null),p=(0,o.useRef)(null),f=(0,o.useRef)(null),m=(0,o.useRef)(null),h=(0,o.useRef)(null),v=(0,o.useRef)(null);return(0,o.useEffect)((function(){s&&(m.current.style.height=r-s+"px",m.current.style.width=r-s+"px"),a&&(m.current.style.backgroundColor=a),u.current.style.clip="rect(0px, ".concat(r,"px, ").concat(r,"px, ").concat(r/2,"px)"),x.current.style.clip="rect(0px, ".concat(r/2,"px, ").concat(r,"px, 0px)"),p.current.style.clip="rect(0px, ".concat(r/2,"px, ").concat(r,"px, 0px)"),f.current.style.clip="rect(0px, ".concat(r,"px, ").concat(r,"px, ").concat(r/2,"px)"),x.current.style.backgroundColor="".concat(t),f.current.style.backgroundColor="".concat(t)}),[t,r,s,a]),(0,o.useEffect)((function(){if(!l)return x.current.style.transform="rotate(0deg)",void(f.current.style.transform="rotate(0deg)");var e=1;l<400&&(e=l/400),x.current.style.transform="rotate(".concat(e<.5?2*e*180:180,"deg)"),f.current.style.transform="rotate(".concat(e>.5?2*e*180+180:0,"deg)"),h.current.style.transform="rotate(".concat(2*-e*180,"deg)"),v.current.style.transform="rotate(".concat(2*e*180,"deg)")}),[l]),(0,n.jsxs)("div",{className:"container flex items-center justify-center ".concat(null!==c&&void 0!==c?c:""),children:[(0,n.jsx)("div",{className:"circular relative p-0 m-0",style:{height:r,width:r},children:(0,n.jsxs)("div",{className:"circle",children:[(0,n.jsx)("div",{className:"bar absolute rounded-full w-full h-full right",ref:u,children:(0,n.jsx)("div",{className:"progress rounded-full absolute w-full h-full",ref:x})}),(0,n.jsx)("div",{className:"bar absolute rounded-full w-full h-full left",ref:p,children:(0,n.jsx)("div",{className:"progress rounded-full absolute w-full h-full",ref:f})})]})}),(0,n.jsx)("div",{className:"absolute z-20",style:{height:r,width:r},ref:v,children:(0,n.jsx)("div",{className:"relative w-full h-full text-center",children:(0,n.jsx)("i",{className:"absolute not-italic ml-[-20px] mt-[-13px] font-bold border-[4px] border-[#000000] rounded-[17px] pt-[6px] px-[12px] pb-[1px] bg-white font-[25px]",ref:h,children:l})})}),(0,n.jsx)("div",{className:"content z-10 absolute flex items-center justify-center rounded-full ".concat(null!==i&&void 0!==i?i:""),ref:m,children:d})]})}var h=r(71911),v=r(98352),g=r(6655);function b(e){var t=e.name,r=e.products,l=(0,c.useRouter)().push;r.map((function(e,t){var r;e.catalog_image&&e.catalog_image.length>0&&e.catalog_image.map((function(e){"main"==e.role&&(r=e.url)})),e.image=r}));var s=function(e){var t=parseFloat(e.toString()).toFixed(2).slice(-2),r=parseInt(e.toString());return(0,n.jsxs)("div",{className:"w-2/5 font-bold flex flex-row items-center mx-2 border-l-[2px] border-l-[#000000]",children:[(0,n.jsx)("div",{className:"text-[12px] pt-2 px-1",children:"S/"}),(0,n.jsx)("div",{className:"text-[35px]",children:r}),(0,n.jsxs)("div",{className:"text-[12px] pb-5 px-1",children:[".",t]})]})};return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"w-full text-center font-bold text-[25px] py-[15px]",children:["Promos exclusivas de ",t]}),(0,n.jsx)("div",{id:"swiper-sliders-container",className:(0,g.AK)("w-full"),children:(0,n.jsx)(v.tq,{id:"swiper-slider03",className:"mySwiper",slidesPerView:1.15,spaceBetween:10,navigation:!0,modules:[h.W_,h.tl,h.s5],breakpoints:{768:{slidesPerView:1.5,spaceBetween:20},1024:{slidesPerView:3,spaceBetween:20},1280:{slidesPerView:3,spaceBetween:20}},scrollbar:!1,children:r.map((function(e,t){return(0,n.jsx)(v.o5,{className:"",children:(0,n.jsx)("div",{className:"w-full h-[210px]",children:(0,n.jsxs)("div",{className:(0,g.AK)("flex flex-row rounded-[15px] overflow-hidden h-full relative",1==e.status?"":" after:absolute after:bg-white after:opacity-50 after:w-full after:h-full"),children:[(0,n.jsx)("div",{className:"w-1/2 relative",children:(0,n.jsx)("div",{className:"absolute w-full h-full transition-all duration-500 ease-in-out transform bg-center bg-cover hover:scale-110 bg-[#dddddd]",children:e&&e.image&&(0,n.jsx)(a(),{src:e.image,alt:e.name,className:"object-cover",layout:"fill",priority:!1,loading:"lazy",sizes:"(max-width: 640px) 66vw, (max-width: 1024px) 33vw, (max-width: 1280px) 25vw, 20vw"})})}),(0,n.jsx)("div",{className:"w-1/2 bg-[#FAE546]",children:(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("div",{className:"text-[17px] font-bold text-center py-4 px-2 pt-6 line-clamp-2",children:e.name}),(0,n.jsxs)("div",{className:"flex flex-row min-h-[66px] items-center",children:[(0,n.jsx)("div",{className:"w-3/5 text-right font-200 text-[11px] py-2 px-1",children:(0,n.jsx)("p",{className:"line-clamp-3",children:e.description})}),s(e.price)]}),(0,n.jsx)("div",{className:"text-center pb-[15px] pt-[15px]",children:(0,n.jsx)("button",{className:"bg-[#008C36] font-bold text-[#FED925] text-[16px] py-[5px] px-[25px] rounded-[8px]",onClick:function(){return t=e.slug,void(e.status&&l("/menu/loyalty/".concat(t)));var t},children:"COMPRAR"})})]})})]})})},t)}))})})]})}
1var j=(0,i.$j)((function(e){var t,r;return{user:e.auth.user,isUserLogged:e.auth.isUserLogged,token:e.auth.token,loyaltyFrontUrl:(null===(t=e.initServices.settings.general)||void 0===t||null===(r=t.loyalty_program)||void 0===r?void 0:r.front_url)||null}}),(function(e){return{setUser:(0,d.DE)(p.av,e)}}))((function(e){var t=e.isUserLogged,r=e.user,s=e.token,i=e.settings,d=(0,x.sN)({user_token:s}),p=(d.loading,d.loyalty),h=(0,c.useRouter)().push;return(0,n.jsx)(f.Z,{option_name:"loyalty",options:i.options,color_scheme:i.color_scheme,Benefit:function(){return(0,n.jsxs)("div",{className:"w-full pb-[35px] pt-[15px]",children:[p&&p.promos.length>0&&(0,n.jsx)(b,{name:p.level_name,products:p.promos}),p&&""!=p.next_level_name&&p.next_promos.length>0&&(0,n.jsx)(b,{name:p.next_level_name,products:p.next_promos})]})},children:(0,n.jsx)("form",{className:"generalContainerRokys my-6",children:t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"hidden justify-between mb-2 sm:mb-3",children:(0,n.jsxs)("button",{onClick:function(){return h("/")},className:"items-center rounded-full flex",children:[(0,n.jsx)("span",{className:"sr-only",children:"Back to Home"}),(0,n.jsx)(l.Z,{className:"h-7 w-7 sm:h-8 sm:w-8 mr-1","aria-hidden":"true"}),(0,n.jsx)("span",{className:"text-sm",children:"Regresar"})]})}),(0,n.jsxs)("div",{className:"w-full max-w-[750px] m-[auto] flex flex-col",children:[(0,n.jsxs)("div",{className:"w-full py-2 text-[18px]",children:["\xa1Hola, ",(0,n.jsx)("span",{className:"font-bold",children:null===r||void 0===r?void 0:r.name}),"!"]}),(0,n.jsx)("div",{className:"w-full py-2 text-[17px]",children:"Desde est\xe1 secci\xf3n puedes conocer el nivel de lealtad que tienes en Roky\xb4s as\xed como editar tus datos personales."}),(0,n.jsx)("div",{className:"w-full py-2 text-[17px]",children:"Tu nivel ahora es."}),(0,n.jsxs)("div",{className:"bg-[#fae546] flex flex-col items-center min-h-[300px] relative md:flex-row py-10 px-10 rounded-[12px] before:rounded-[12px] before:absolute before:bg-[url(/img/rokys/loyalty/bg-loyalty.png)] before:bg-cover before:bg-center before:top-0 before:left-0 before:w-full before:h-full gap-6",children:[p&&(0,n.jsx)("div",{className:"rounded-full w-[300px] h-[300px] flex flex-col items-center bg-white relative ",children:(0,n.jsx)(m,{color:"#008C36",diameter:300,percentage:parseInt(null===p||void 0===p?void 0:p.actual_points),borderWidth:25,contentBackgroundColor:"white",className:"bg-[#c2f1c8] rounded-full",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"relative w-[75px] h-[124px] m-auto",children:(0,n.jsx)(a(),{src:"/img/rokys/loyalty/icon-default.png",alt:"level 1",className:"object-contain h-[124px] w-[75px]",layout:"fill"})}),(0,n.jsx)("div",{className:"text-[19px] pt-[6px] pb-[15px] text-center",children:null===p||void 0===p?void 0:p.level_name}),p&&p.next_required>0&&(0,n.jsxs)("div",{className:"text-[17px] leading-[18px] px-[10px] pt-[5px] pb-[3px] bg-black rounded-[19px] text-white font-bold",children:[p.next_required," PUNTOS"]})]})})}),(0,n.jsxs)("div",{className:"px-2 z-10",children:[p&&p.rewards&&0!=p.rewards.length&&(0,n.jsxs)(o.Fragment,{children:[(0,n.jsx)("h6",{className:"py-2 font-bold text-[17px]",children:"Mis Beneficios:"}),(0,n.jsx)("ul",{className:"py-2",children:p.rewards.map((function(e){return(0,n.jsx)(o.Fragment,{children:(0,n.jsxs)("li",{className:"bg-white rounded-[17px] pt-[12px] pr-[31px] pb-[9px] pl-[27px] mb-2",children:[(0,n.jsx)("p",{children:e.name}),""!=e.note&&(0,n.jsxs)("p",{className:"text-[12px]",children:["- ",e.note]})]})},e.reward_id)}))})]}),p&&(null===p||void 0===p?void 0:p.missing_points)>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h6",{className:"py-2 font-bold text-[17px]",children:"Siguiente nivel:"}),(0,n.jsxs)("p",{children:["Te faltan ",(0,n.jsx)("span",{className:"font-bold",children:null===p||void 0===p?void 0:p.missing_points})," puntos para ser"," ",(0,n.jsx)("span",{className:"font-bold text-[#008C36]",children:null===p||void 0===p?void 0:p.next_level_name})]})]})]})]})]})]}):(0,n.jsx)(u.Z,{type:"loyalty"})})})}))},72235:function(e,t,r){r.d(t,{Jc:function(){return i},S6:function(){return f},YV:function(){return o}
1,co:function(){return x},cu:function(){return u},pB:function(){return p},uD:function(){return d}});var n=r(6280),l=r.n(n),s=r(32103);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){a(e,t,r[t])}))}return e}var o=function(e,t,r){var n={method:"post",url:"/order/create",data:{data:(0,s.VI)(JSON.stringify(c({},e,{recaptcha_token:r})))}};return t&&(n.headers={Authorization:t?"Bearer ".concat(t):"","Content-Type":"application/json"}),l()(n)},i=function(e){var t={method:"get",url:"/order/audit/".concat(e)};return l()(t)},d=function(e,t,r){var n={method:"post",maxBodyLength:1/0,url:"/order/customer/check-document",headers:{"Content-Type":"application/json"},data:JSON.stringify({type:e,document:t,recaptcha_token:r})};return l()(n)},u=function(e,t,r){var n={method:"get",url:"/order/list",headers:{Authorization:"Bearer ".concat(r)}};l()(n).then((function(r){r.data.status||t(r.data.data),e(r.data.data)})).catch((function(e){t(e.response.data)}))},x=function(e,t,r,n){var s={method:"get",url:"/order/".concat(n),headers:{Authorization:"Bearer ".concat(r)}};l()(s).then((function(r){r.data.status||t(r.data.data),e(r.data.data)})).catch((function(e){t(e.response.data)}))},p=function(e){var t={method:"get",url:"/order/search/".concat(e)};return l()(t)},f=function(e){var t={method:"get",url:"/order/search/".concat(e,"/tracking-history")};return l()(t)}},85236:function(e,t,r){var n=r(67294);const l=n.forwardRef((function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{fillRule:"evenodd",d:"M9.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L7.414 9H15a1 1 0 110 2H7.414l2.293 2.293a1 1 0 010 1.414z",clipRule:"evenodd"}))}));t.Z=l}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.