PageSourceSearch

https://spar.dk/_next/static/chunks/9242-79d80c636919ef2d1260.js

js spar.dk collected 2026-09-26 02:24:31 UTC 14,320 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9242],{44749:function(e,n,t){"use strict";t.d(n,{Z:function(){return h}});var r=t(87757),i=t.n(r),o=t(92137),a=t(28481),c=t(11163),s=t(9669).default,l=t(67294),u=l.useEffect,d=l.useState,f=t(35061).default,p=t(44928).default;function h(){var e=d([]),n=(0,a.Z)(e,2),t=n[0],r=n[1],l=f(t),h=(0,a.Z)(l,2),m=h[0],v=h[1],g=p(),x=(0,a.Z)(g,1)[0],b=d(!1),w=(0,a.Z)(b,2),_=w[0],y=w[1],k=function(){var e=(0,o.Z)(i().mark((function e(n,t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,v(n,t,y);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();u((function(){C()}),[x]);var C=function(){var e=(0,o.Z)(i().mark((function e(){var n,t,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.get("/user/get",{withCredentials:!0}).catch((function(e){if(401===e.response.status)return s.post("/user/logout").catch((function(e){return console.log(e)})),void c.default.push("/login")}));case 4:if("fail"!==(null===(a=e.sent)||void 0===a?void 0:a.status)){e.next=9;break}return e.next=8,s.post("/user/logout").catch((function(e){return console.log(e)}));case 8:c.default.push("/");case 9:r(null===(n=a.data)||void 0===n||null===(t=n.data)||void 0===t||null===(o=t.customer)||void 0===o?void 0:o.favoriterecipes);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return{isLoginShow:_,closeLogin:function(){return y(!1)},openLogin:function(){return y(!0)},addOrRemoveFavRecipe:k,isAddedToFavorites:function(e){var n=!1;return m&&m.length&&(n=m.includes(e)),n},showFavButton:!!v}}},35061:function(e,n,t){"use strict";t.r(n);var r=t(87757),i=t.n(r),o=t(85061),a=t(92137),c=t(28481),s=t(67294),l=t(9669),u=t.n(l),d=t(17714),f=t(44928),p=t(26838),h=t(17718),m=t(34421),v={headers:{"x-auth-token":!0}};n.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=(0,d.v9)((function(e){return{location:e.location}})),t=n.location,r=(0,h.Z)("favorites"),l=(0,c.Z)(r,2),g=(l[0],l[1]),x=(0,f.default)(),b=(0,c.Z)(x,1),w=b[0],_=(0,p.Z)(),y=(0,c.Z)(_,1),k=y[0],C=(0,s.use
1State)([]),Z=C[0],j=C[1],N=function(){var e=(0,a.Z)(i().mark((function e(){var n,r,a,c,s,l,d,f,p,h=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=h.length>0&&void 0!==h[0]?h[0]:0,s=h.length>1&&void 0!==h[1]?h[1]:"add",l=h.length>2?h[2]:void 0,w){e.next=8;break}if(!l){e.next=7;break}return l(!0),e.abrupt("return",!1);case 7:return e.abrupt("return",!1);case 8:if(d=null,"add"!==s){e.next=15;break}return e.next=12,u().patch("".concat(t.origin,"/dagrofa/Favorites/").concat(c),{},v).catch((function(e){return e}));case 12:d=e.sent,e.next=18;break;case 15:return e.next=17,u().delete("".concat(t.origin,"/dagrofa/Favorites/").concat(c),v).catch((function(e){return e}));case 17:d=e.sent;case 18:if(d&&null!==(n=d)&&void 0!==n&&n.data&&null!==(r=d)&&void 0!==r&&null!==(a=r.data)&&void 0!==a&&a.isValidResponse){e.next=20;break}return e.abrupt("return",!1);case 20:if(f=(0,o.Z)(Z),"add"!==s){e.next=27;break}if(f.includes(c)){e.next=26;break}return f.push(c),j(f),e.abrupt("return",!0);case 26:return e.abrupt("return",!0);case 27:return p=f.filter((function(e){return e!==c})),j(p),e.abrupt("return",!0);case 30:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,s.useEffect)((function(){e&&e.length&&(j(e),(0,m.qK)(e))}),[e]),g&&"minkobmand"!==k&&"letkob"!==k?[Z,N]:[[],null]}},17718:function(e,n,t){"use strict";var r=t(67294),i=t(17714);n.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=(0,r.useState)(!1),t=n[0],o=n[1],a=(0,i.v9)((function(e){var n,t;return{domainConfig:null===e||void 0===e||null===(n=e.domain)||void 0===n||null===(t=n.config)||void 0===t?void 0:t.configuration_page}})),c=a.domainConfig;return(0,r.useEffect)((function(){e&&c&&Object.keys(c).map((function(n){n.includes(e)&&o(!!c[n])}))}),[]),[c,t]}},19242:function(e,n,t){"use strict";var r=t(32465),i=t(85893),o=t(87757),a=t.n(o),c=t(92137),s=t(28481),l=t(67294),u=t(29163),d=t(59658),f=t(77837),p=t(99838),h=t(31974),m=t(26838),v=t(9669),g=t.n(v),x=t(33489),b=t(44749),w=t(19649),_=t(41017);function y(){var e=(0,r.Z)(["\n    display: none;\n  "]);return y=function(){return e},e}function k(){var e=(0,r.Z)(["\n    overflow: visible;\n    overflow-x: scroll;\n  "]);return k=function(){return e},e}function C(){var e=(0,r.Z)(["\n      font-size: 32px;\n      margin-top: 0;\n    "]);return C=function(){return e},e}function Z(){var e=(0,r.Z)(["\n    padding: 32px 20px;\n  "]);return Z=function(){return e},e}function j(){var e=(0,r.Z)(["\n    margin-left: -23px;\n    margin-right: -23px;\n  "]);return j=function(){return e},e}function N(){var e=(0,r.Z)(["\n      font-size: 24px;\n      line-height:34px;\n      margin-top: 0;\n    "]);return N=function(){return e},e}function S(){var e=(0,r.Z)(["\n    padding: 32px 20px;\n    margin-left: -20px;\n    margin-right: -20px;\n  "]);return S=function(){return e},e}var F=f.Z.get("modal","login");n.Z=function(e){var n=e.categoryids,t=void 0===n?[]:n,r=(0,l.useState)([]),o=r[0],u=r[1],p=(0,b.Z)(),v=p.isLoginShow,y=p.closeLogin,k=p.addOrRemoveFavRecipe,C=p.isAddedToFavorites,Z=p.showFavButton,j=(0,m.Z)(),N=(0,s.Z)(j,1)[0],S=(0,m.Z)("spar"),E=(0,s.Z)(S,2),K=(E[0],E[1]),V=K?f.Z.get("layout","recipe-layout-spar"):f.Z.get("layout","recipe-layout"),X=function(){var e=(0,c.Z)(a().mark((function e(){var n,r,i,o,c,s,l;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="?categoryids=".concat(t.join(","),"&pageSize=21"),i=JSON.parse(JSON.stringify(location.pathname)),o=i.replace("/".concat("opskrift","/"),""),e.next=5,g().get("".concat(location.origin,"/dagrofa/Search/SearchRecipes").concat(r,"&brand=").concat(N)).catch((function(e){return e}));case 5:c=e.sent,s=c.data.responseData,l=null===s||void 0===s||null===(n=s.products)||void 0===n?void 0:n.filter((function(e){return e.source.urlSegment!==o})).slice(0,20),u(l);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){X()}),[]);var G=(0,l.useRef)(null),H=(0,l.useRef)(null),Q=(0,h.Z)(),U=Q.screen,Y=Q.isMobile,$=(0,l.useState)(0),ee=$[0],ne=$[1],te=(0,l.useState)(0),re=te[0],ie=te[1],oe=(0,l.useState)(290),ae=oe[0],ce=oe[1],se=(0,l.useState)(1),le=se[0],ue=se[1],de=(0,l.useCallback)((function(){null!==o&&void 0!==o&&o.length&&ie(Math.max(re-1,0))}),[re,ee,o]),fe=(0,l.useCallback)((function(){null!==o&&void 0!==o&&o.length&&ie(Math.min(ee-1,re+1))}),[re,ee,o]);
1(0,l.useEffect)((function(){null!==o&&void 0!==o&&o.length&&H.current&&G.current&&setTimeout((function(){if("sm"===U||"xs"===U)return ce(320),void ue(1);var e="xl"===U?4:3,n=G.current.clientWidth/e;ce(n),ue(Math.floor(G.current.clientWidth/n))}),150)}),[H,G,o]),(0,l.useEffect)((function(){if(null!==o&&void 0!==o&&o.length){var e=H.current.childElementCount;ne(Math.ceil(e/le))}}),[le,ae,o]),(0,d.Z)((function(){var e=ae*re*le;H.current.style.transform="translateX(-".concat(e,"px)")}),[re,ae]);for(var pe=[],he=0;ee>he;he++)pe.push(he);var me=K?O:D,ve=K?J:B,ge=K?M:L;return null!==o&&void 0!==o&&o.length?(0,i.jsxs)(me,{children:[(0,i.jsx)("h3",{children:"Relaterede opskrifter"}),(0,i.jsx)(I,{ref:G,children:(0,i.jsxs)(q,{ref:H,children:[(0,i.jsx)(F,{active:v,onClose:y}),o&&o.map((function(e){var n=e.source?e.source:e,t=n.preparationTime,r=n.pictures,o=n.shortName,a=n.urlSegment,c=n.id,s="";if(r&&r.length&&r[0].url){var l=(0,_.Z)(r[0].url);s=Y?l.tile_mobile_small_290x240:l.tile_desktop_small_290x300}var u=s&&{src:s,height:Y?"240px":"300px"},d={mealTypeName:(0,w.Z)(n),timeNeeded:(0,x.formatTimeNeeded)(null===t||void 0===t?void 0:t.total)};return(0,i.jsx)(T,{width:ae,children:(0,i.jsx)(V,{className:"tile tile-small",image:u,title:o,meal:d,uri:"/opskrift/".concat(a),recipeId:c,isDomainSpar:K,handleAddRemoveRecipe:!!Z&&k,addedToFavorites:C(c)})},c)}))]})}),(0,i.jsxs)(R,{className:"controls",children:[(0,i.jsx)("div",{className:"buttons",children:re>0&&(0,i.jsxs)(P,{onClick:de,isDomainSpar:K,children:[(0,i.jsx)(ge,{children:(0,i.jsx)(A,{})}),(0,i.jsx)("span",{children:"Forrige"})]})}),(0,i.jsx)(z,{className:"dots",children:pe.map((function(e){return(0,i.jsx)(ve,{active:e===re,className:e===re&&"active",onClick:function(){return function(e){ie(e)}(e)}},"dot-".concat(e))}))}),(0,i.jsx)("div",{className:"buttons",children:re+1<ee&&(0,i.jsxs)(W,{onClick:fe,isDomainSpar:K,children:[(0,i.jsx)("span",{children:"N\xe6ste"}),(0,i.jsx)(ge,{children:(0,i.jsx)(A,{})})]})})]})]}):null};var O=u.default.div.withConfig({displayName:"Carousel__WrapSpar",componentId:"sc-1insdq-0"})(["background-color:#f13e3e;padding:32px 80px;display:flex;flex-direction:column;margin-left:-20px;margin-right:-20px;"," h3{font-size:34px;line-height:38px;letter-spacing:1px;color:#fff;margin-left:20px;","}"],p.iD.md.max(S()),p.iD.sm.max(N())),D=u.default.div.withConfig({displayName:"Carousel__Wrap",componentId:"sc-1insdq-1"})(["background-color:#123b4f;padding:32px 80px;display:flex;flex-direction:column;margin-left:-20px;margin-right:-20px;"," "," h3{font-size:40px;line-height:45px;letter-spacing:1px;color:#ffffff;margin-left:20px;","}"],p.iD.sm.max(j()),p.iD.md.max(Z()),p.iD.sm.max(C())),I=u.default.div.withConfig({displayName:"Carousel",componentId:"sc-1insdq-2"})(["overflow:hidden;",""],p.iD.sm.max(k())),q=u.default.div.withConfig({displayName:"Carousel__Container",componentId:"sc-1insdq-3"})(["display:flex;flex-wrap:nowrap;transition:all 0.3s;> div{padding:0px 20px;}"]),R=u.default.div.withConfig({displayName:"Carousel__Controls",componentId:"sc-1insdq-4"})(["display:flex;justify-content:space-between;flex-wrap:wrap;padding:0px 20px;padding-top:40px;"," > div{flex:1 1 30%;}"],p.iD.sm.max(y())),E=u.default.div.withConfig({displayName:"Carousel__Control",componentId:"sc-1insdq-5"})(["display:flex;align-items:center;cursor:pointer;span{font-weight:500;font-size:12px;line-height:9px;text-transform:uppercase;color:#ffffff;","}"],(function(e){return e.isDomainSpar&&"\n      font-family: Wigrum-Bold, sans-serif;\n      font-weight: 700;\n\n  "})),P=(0,u.default)(E).withConfig({displayName:"Carousel__Left",componentId:"sc-1insdq-6"})(["div{margin-right:8px;}svg{transform:rotate(90deg);}"]),W=(0,u.default)(E).withConfig({displayName:"Carousel__Right",componentId:"sc-1insdq-7"})(["float:right;div{margin-left:8px;}svg{transform:rotate(270deg);}"]),T=u.default.div.withConfig({displayName:"Carousel__ItemWrap",componentId:"sc-1insdq-8"})(["flex:0 0 ","px;align-self:stretch;> div{height:100%;display:flex;}img{width:290px;height:240px;object-fit:cover;}"],(function(e){return e.width}
1)),z=u.default.div.withConfig({displayName:"Carousel__Dots",componentId:"sc-1insdq-9"})(["display:flex;justify-content:center;"]),L=u.default.div.withConfig({displayName:"Carousel__IconWrapper",componentId:"sc-1insdq-10"})(["display:flex;justify-content:center;align-items:center;width:24px;height:24px;border-radius:3px;background-color:#cc092f;"]),M=u.default.div.withConfig({displayName:"Carousel__IconWrapperSpar",componentId:"sc-1insdq-11"})(["display:flex;justify-content:center;align-items:center;width:24px;height:24px;border-radius:3px;background-color:#59193c;"]),A=(0,u.default)(f.Z.get("icon","chevron-down")).withConfig({displayName:"Carousel__Chevron",componentId:"sc-1insdq-12"})(["path{fill:#fff;}"]),B=u.default.div.withConfig({displayName:"Carousel__Dot",componentId:"sc-1insdq-13"})(["width:16px;height:16px;border-radius:30px;background-color:",";transition:all 0.3s;margin:0 4px;cursor:pointer;"],(function(e){return e.active?"#CC092F":"#FFFFFF"})),J=u.default.div.withConfig({displayName:"Carousel__DotSpar",componentId:"sc-1insdq-14"})(["width:16px;height:16px;border-radius:30px;background-color:",";transition:all 0.3s;margin:0 4px;
1cursor:pointer;"],(function(e){return e.active?"#59193c":"#FFFFFF"}))},19649:function(e,n,t){"use strict";function r(e){var n,t,r,i,o,a=null!==e&&void 0!==e&&null!==(n=e.metaData)&&void 0!==n&&n.propertyCategories?null===e||void 0===e||null===(r=e.metaData)||void 0===r?void 0:r.propertyCategories:null===e||void 0===e||null===(t=e.metadata)||void 0===t?void 0:t.propertyCategories,c=null===a||void 0===a?void 0:a.find((function(e){return"M\xe5ltid"===e.name}));return null!==c&&void 0!==c&&null!==(i=c.properties[0])&&void 0!==i&&i.name?null===c||void 0===c||null===(o=c.properties[0])||void 0===o?void 0:o.name:"Ikke angivet"}t.d(n,{Z:function(){return r}})},41017:function(e,n,t){"use strict";var r=t(28481),i=t(96156);function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}var a="preset={preset}",c={desktop_small_960x439:"w=960&h=439&anchor=middlecenter&mode=crop&scale=both&ak=8567bf50&hm=73811dac",desktop_large_1920x878:"w=1920&h=878&anchor=middlecenter&mode=crop&scale=both&ak=8567bf50&hm=fad5c0e0",mobile_small_439x302:"w=439&h=302&anchor=middlecenter&mode=crop&scale=both&ak=8567bf50&hm=2ea1d283",mobile_large_878x604:"w=878&h=604&anchor=middlecenter&mode=crop&scale=both&ak=8567bf50&hm=e6511560",tile_desktop_small_290x300:"w=290&h=300&anchor=middlecenter&mode=crop&ak=8567bf50&hm=719057c6",tile_desktop_large_580x600:"w=580&h=600&anchor=middlecenter&mode=crop&ak=8567bf50&hm=708aeb0e",tile_mobile_small_290x240:"w=290&h=240&anchor=middlecenter&mode=crop&ak=8567bf50&hm=d3e64308",tile_mobile_large_580x480:"w=580&h=480&anchor=middlecenter&mode=crop&ak=8567bf50&hm=b1e0ec96"};n.Z=function(e){e.includes(a)&&(e=e.replace(a,""));for(var n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({},c),t=0,s=Object.entries(c);t<s.length;t++){var l=(0,r.Z)(s[t],2),u=l[0],d=l[1];n[u]=e+d}return n}}}]);

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.