(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8372],{79458:function(n,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sucursales",function(){return r(27553)}])},45846:function(n,e,r){"use strict";r.d(e,{Z:function(){return m}});var t=r(26042),i=r(69396),o=r(99534),c=r(7297),a=r(85893);r(67294);var s=r(45697),u=r.n(s),d=r(57833),l=r(95477);function h(){var n=(0,c.Z)(["\n display: inline-block;\n grid-column-start: span 3;\n margin-left: auto;\n margin-right: auto;\n text-align: center;\n width: ",";\n height: ",";\n\n .container {\n display: flex;\n height: inherit;\n width: inherit;\n justify-content: center;\n align-items: center;\n }\n\n .progress {\n color: ",";\n margin-top: ",";\n margin-bottom: ",";\n }\n"]);return h=function(){return n},n}var f=function(n){return/^\d+$/.test(n)?"".concat(n,"px"):n},g=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0px",e="string"!=typeof n?n.toString():n,r=Math.floor(parseInt(e.replace(/\D+/g,""),10)/2),t=e.replace(/[0-9]/g,"");return"".concat(r).concat(t&&t.length?t:"px")},p=d.ZP.span.withConfig({componentId:"sc-c8839295-0"})(h(),function(n){var e=n.width;return e?f(e):"100%"},function(n){var e=n.height;return e?f(e):"100%"},function(n){return n.color?n.color:"#0000003b"},function(n){var e=n.height,r=n.size;return e?"calc(".concat(e/2,"px - ").concat(g(r),")"):"calc(50% - ".concat(g(r),")")},function(n){var e=n.height,r=n.size;return e?"calc(".concat(e/2,"px - ").concat(g(r),")"):"calc(50% - ".concat(g(r),")")});function m(n){var e=n.color,r=n.size,c=(0,o.Z)(n,["color","size"]);return(0,a.jsx)(p,(0,i.Z)((0,t.Z)({color:e,size:r},c),{children:(0,a.jsx)("div",{className:"container",children:(0,a.jsx)(l.Z,{className:"progress",size:r})})}))}m.defaultProps={size:"30px"},m.propTypes={size:u().oneOfType([u().string,u().number])}},80380:function(n,e,r){"use strict";r.d(e,{C:function(){return t.Z},n:function(){return B}});var t=r(49303),i=r(85893),o=r(67294),c=r(45697),a=r(7297),s=r(61266),u=r(57833),d=r(70589);function l(){var n=(0,a.Z)(["\n grid-gap: 1rem;\n grid-template-columns: 1fr 1fr;\n "]);return l=function(){return n},n}function h(){var n=(0,a.Z)(["\n display: grid;\n\n ","\n\n"]);return h=function(){return n},n}function f(){var n=(0,a.Z)(["\n padding: 1em 0 0 0;\n"]);return f=function(){return n},n}function g(){var n=(0,a.Z)(["\n font-size: 1.2em;\n font-weight: 600;\n"]);return g=function(){return n},n}function p(){var n=(0,a.Z)(["\n display: block;\n border: 1px solid #dadada;\n width: 100%;\n box-sizing: border-box;\n border-top: 0;\n background: 0;\n padding: 1em;\n margin: 0;\n cursor: pointer;\n font-weight: 400;\n font-size: 14px;\n line-height: 1.29;\n letter-spacing: -0.1px;\n color: #006afd;\n\n"]);return p=function(){return n},n}function m(){var n=(0,a.Z)(["\n overflow: hidden;\n border: 1px solid #dadada;\n margin-bottom: 0;\n box-sizing: border-box;\n"]);return m=function(){return n},n}function x(){var n=(0,a.Z)(["\n display: none;\n "]);return x=function(){return n},n}function b(){var n=(0,a.Z)(["\n display: contents;\n ","\n"]);return b=function(){return n},n}function v(){var n=(0,a.Z)(["\n display: contents;\n "]);return v=function(){return n},n}function Z(){var n=(0,a.Z)(["\n display: none;\n ","\n"]);return Z=function(){return n},n}var j=u.ZP.article.withConfig({componentId:"sc-48551775-0"})(h(),d.BC.greaterThan("sm")(l())),w=u.ZP.section.withConfig({componentId:"sc-48551775-1"})(f()),C=u.ZP.h2.withConfig({componentId:"sc-48551775-2"})(g()),P=u.ZP.button.withConfig({componentId:"sc-48551775-3"})(p()),y=(0,u.ZP)(s.Z).withConfig({componentId:"sc-48551775-4"})(m()),k=u.ZP.div.withConfig({componentId:"sc-48551775-5"})(b(),d.BC.greaterThan("sm")(x())),I=u.ZP.div.withConfig({componentId:"sc-48551775-6"})(Z(),d.BC.greaterThan("sm")(v()));function _(n){var e=n.branches,r=n.location,t=n.collapseWindow,c=(0,o.useState)(!0),a=c[0],s=c[1],u=(0,o.useCallback)(function(){return s(function(n){return!n})},[]),d=(0,o.useMemo)(function(){return e.slice(0,t)},[e,t]),l=(0,o.useMemo)(function(){return e.slice(t)},[e,t]),h=(0,o.useRef)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{branches:d,location:r}),!!l.length&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{branches:l,location:r,style:{borderTop:0,margin:0,transition:"1s",maxHeight:a?0:"".concat(h.current.scrollHeight,"px")},listRef:h}),(0,i.jsxs)(P,{type:"button",onClick:u,children:["Ver"," ",a?"m\xe1s":"menos"]},a?"m\xe1s":"menos")]})]})}function B(n){var e=n.locations,r=e.filter(function(n){return n.id%2}),t=e.filter(function(n){return!(n.id%2)});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k,{children:(0,i.jsx)(j,{children:(0,i.jsx)("div",{children:e.map(function(n){return!!n.branches.length&&(0,i.jsxs)(w,{children:[(0,i.jsxs)(C,{children:["Sucursales en"," ",n.name]}),(0,i.jsx)(_,{branches:n.branches,location:n})]})})})})}),(0,i.jsx)(I,{children:(0,i.jsxs)(j,{children:[(0,i.jsx)("div",{children:r.map(function(n){return!!n.branches.length&&(0,i.jsxs)(w,{children:[(0,i.jsxs)(C,{children:["Sucursales en"," ",n.name]}),(0,i.jsx)(_,{branches:n.branches,location:n})]})})}),(0,i.jsx)("div",{children:t.map(function(n){return!!n.branches.length&&(0,i.jsxs)(w,{children:[(0,i.jsxs)(C,{children:["Sucursales en"," ",n.name]}),(0,i.jsx)(_,{branches:n.branches,location:n})]})})})]})})]})}_.propTypes={location:(0,c.shape)({id:c.number,name:c.string}).isRequired,branches:(0,c.arrayOf)((0,c.shape)({id:c.number,name:c.string})).isRequired,collapseWindow:c.number},_.defaultProps={collapseWindow:5},B.propTypes={locations:(0,c.arrayOf)((0,c.shape)({id:c.number,name:c.string,branches:(0,c.arrayOf)((0,c.shape)({id:c.number,name:c.string})).isRequired})).isRequired},B.defaultProps={}},27553:function(n,e,r){"use strict";r.r(e),r.d(e,{__N_SSP:function(){return _},default:function(){return B}});var t=r(7297),i=r(85893),o=r(67294),c=r(45697),a=r(57833),s=r(2962),u=r(8858),d=r(80380),l=r(41664),h=r.n(l),f=r(78521);function g(){var n=(0,t.Z)(["\n padding: 1rem;\n margin: auto;\n max-width: 1280px;\n box-sizing: content-box;\n"]);return g=function(){return n},n}function p(){var n=(0,t.Z)(["\n display: block;\n font-size: 2em;\n margin-block-start: 0.67em;\n margin-block-end: 0.67em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n font-weight: 600;\n"]);return p=function(){return n},n}function m(){var n=(0,t.Z)(["\n display: block;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n"]);return m=function(){return n},n}function x(){var n=(0,t.Z)(["\n color: #006afd;\n"]);return x=function(){return n},n}function b(){var n=(0,t.Z)(["\n border: none;\n width: 100%;\n height: 1px;\n background-color: #dddddd;\n"]);return b=function(){return n},n}var v=a.ZP.div.withConfig({componentId:"sc-6eb058e6-0"})(g()),Z=a.ZP.h1.withConfig({componentId:"sc-6eb058e6-1"})(p()),j=a.ZP.p.withConfig({componentId:"sc-6eb058e6-2"})(m()),w=a.ZP.a.withConfig({componentId:"sc-6eb058e6-3"})(x()),C=a.ZP.hr.withConfig({componentId:"sc-6eb058e6-4"})(b()),P=r(11752),y=r.n(P);function k(){var n=(0,t.Z)(["\n height: 535px;\n"]);return k=function(){return n},n}var I=(0,a.ZP)(d.C).withConfig({componentId:"sc-4da9155b-0"})(k()),_=!0;function B(n){var e,r,t,c,a,d,l,g,p,m,x,b,P,k,_,B,z=(t=void 0===(r=(e={locations:n.locations,branches:n.branches}).locations)?[]:r,a=void 0===(c=e.branches)?[]:c,d=e.selectedBranch,l=e.selectedLocation,p=(g=(0,o.useState)(void 0===d?null:d))[0],m=g[1],b=(x=(0,o.useState)(void 0===l?null:l))[0],P=x[1],k=(0,o.useCallback)(function(n){m(function(e){var r=(e&&e.id)===(n&&n.id)?null:n;if(r&&r.address&&r.address.location){var i=t.find(function(n){return n.id===r.address.location});i&&P(i)}return r})},[t]),_=(0,o.useCallback)(function(n){m(null),P(n)},[]),{branches:(0,o.useMemo)(function(){return a.filter(function(n){var e=n.address.location;return!b||e===b})},[a,b]),selectedBranch:p,locations:t,selectedLocation:b,onBranchChange:k,onLocationChange:_}),S=z.loadingBranches,T=z.branches,E=z.selectedBranch,L=z.loadingLocations,O=z.locations,N=z.selectedLocation,R=z.error,F=z.onBranchChange,M=z.onLocationChange,q=y()().publicRuntimeConfig.isPreheaderEnabled,H=(0,f.Z)(f.R.useInteractiveMapOnBranchesPage);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.PB,{title:"Sucursales de Fr\xe1vega",description:"Encontr\xe1 las direcciones y horarios de atenci\xf3n de las sucursales de Fr\xe1vega en todo el Pa\xeds."}),(0,i.jsx)(u.h4,{isPreheaderEnabled:q}),(0,i.jsxs)(v,{children:[(0,i.jsx)(Z,{children:"Buscador de Sucursales"}),(0,i.jsx)(j,{children:"Encontr\xe1 las direcciones, horarios de atenci\xf3n de todas nuestras sucursales."}),(0,i.jsx)(h(),{passHref:!0,href:"/sucursales/listado",children:(0,i.jsx)(w,{children:"Ver listado de sucursales"})}),(0,i.jsx)(C,{}),(0,i.jsx)(I,{loadingBranches:S,branches:T,selectedBranch:E,onBranchChange:F,loadingLocations:L,locations:O,selectedLocation:N,onLocationChange:M,error:R,useInteractiveMap:H})]}),(0,i.jsx)(u.$_,{})]})}B.propTypes={locations:(0,c.arrayOf)((0,c.shape)({id:c.number,name:c.string})),branches:(0,c.arrayOf)((0,c.shape)({id:c.number,name:c.string}))},B.defaultProps={locations:void 0,branches:void 0}}},function(n){n.O(0,[8361,5477,4890,9303,9774,2888,179],function(){return n(n.s=79458)}),_N_E=n.O()}]);