PageSourceSearch

https://static.naf.no/static/blocks-TrialMembership-cardCarousel-CardCarouselBlock.ab49323804a2362f.js

js naf.no collected 2026-10-02 03:16:08 UTC 5,563 bytes, 41 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[848],{37029(e,t,a){a.r(t),a.d(t,{CardCarouselBlock:()=>_});var i=a(11684),r=a(12888),s=a(96757),n=a(82729),d=a(84204),o=a(84824),l=a(23727);let c=({index:e,carouselCards:t})=>{let a=t[e],r=e+1,s=`(${r}/${t.length})`,n=Math.min(Math.max(r/t.length*100,0),100);return(0,i.jsxs)("div",{children:[(0,i.jsx)(o.EY,{variant:o.J3.SubHeader,tag:"span",children:a.hintText?`${a.hintText} ${s}`:s}),(0,i.jsx)(x,{children:(0,i.jsx)(g,{width:n})})]})},x=(0,s.A)("div",{target:"emx5wy40"})("margin-top:",d.YK.space16,";width:100%;height:",d.YK.space12,";background-color:",l.Tj.secondary["50"],";border-radius:",d.r8.l,";display:flex;align-items:center;"),g=(0,s.A)("div",{target:"emx5wy41"})("width:",e=>e.width,"%;height:",d.YK.space8,";background-color:",l.Tj.secondary["300"],";border-radius:",d.r8.l,";margin:0 2px 0 2px;transition:width 0.5s cubic-bezier(0,0,0.3,1.03);");var p=a(48009),m=a(39855),h=a(20494),u=a(46480),b=a(83241),f=a(47966),j=a(69712),v=a(16007),A=a(61932);let w=(0,s.A)("div",{target:"e19qo1di0"})("height:100%;box-sizing:border-box;padding:",d.YK.space48,";border:1px solid ",({theme:e})=>e.border?e.border.default:A.ef.border.default,";border-radius:",d.r8.m,";display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:auto ",d.YK.space48,";gap:",d.YK.space16," ",d.YK.space48,";",({$hasImage:e})=>e?(0,n.AH)`
2          grid-template-areas:
3            'textContent image'
4            'navButtons image';
5        `:(0,n.AH)`
6          grid-template-areas:
7            'textContent textContent'
8            'navButtons.';
9        `,";@media (max-width:",d.fi.m,"){gap:",d.YK.space12," 0;padding:",d.YK.space16,";grid-template-columns:auto;",({$hasImage:e})=>e?(0,n.AH)`
10            grid-template-rows: repeat(2, auto) ${d.YK.space64};
11            grid-template-areas:
12              'image'
13              'textContent'
14              'navButtons';
15          `:(0,n.AH)`
16            grid-template-rows: auto ${d.YK.space64};
17            grid-template-areas:
18              'textContent'
19              'navButtons';
20          `,"}"),y=(0,s.A)("div",{target:"e19qo1di1"})("*:first-child{margin-top:0;}*:last-child{margin-bottom:0;}"),K=(0,s.A)("div",{target:"e19qo1di2"})("display:flex;flex-direction:column;grid-area:textContent;gap:",d.YK.space8,";@media (max-width:",d.fi.m,"){h2{margin:0;}}"),Y=(0,s.A)("div",{target:"e19qo1di3"})("grid-area:navButtons;display:flex;flex-direction:row;justify-content:flex-start;align-items:flex-end;gap:",d.YK.space12,";.back{.buttonIcon{margin-right:",d.YK.space16,";}}.next{.buttonIcon{margin-left:",d.YK.space16,";}}@media (max-width:",d.fi.m,"){.back{.buttonIcon{margin-right:0;}.buttonText{display:none;}}}"),C=(0,s.A)("div",{target:"e19qo1di4"})("display:flex;grid-area:image;@media (max-width:",d.fi.m,"){justify-content:center;align-items:center;}"),H=(0,s.A)("div",{target:"e19qo1di5"})("width:100%;padding-top:",9/16*100,"%;position:relative;@media (max-width:",d.fi.m,"){width:70%;padding-top:",9/16*70,"%;}img{object-fit:contain;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:",d.r8.s,";}"),$=({card:e,index:t,listLength:a,handlePrevious:r,handleNext:s})=>{let{body:n,image:d,label:l,title:c}=e,x=l?(0,b.g)(l.colorVariant||v.n.outline):void 0;return(0,i.jsxs)(w,{$hasImage:!!d,children:[(0,i.jsxs)(K,{children:[l&&(0,i.jsx)("div",{children:(0,i.jsx)(p.v,{color:x?.color,shade:x?.shade,text:l.title})}),(0,i.jsx)(o.EY,{variant:o.J3.Header2,children:c}),n&&(0,i.jsx)(y,{children:(0,i.jsx)(f.A,{value:n})})]}),d&&(0,i.jsx)(C,{children:(0,i.jsx)(H,{children:(0,i.jsx)(j.A,{imageId:d.publicId,altText:d.altText||d.caption||""})})}),(0,i.jsxs)(Y,{children:[(0,i.jsxs)(m.$n,{className:"back",onClick:r,variant:"outlined",disabled:0===t,children:[(0,i.jsx)(h.v,{size:16,className:"buttonIcon"}),(0,i.jsx)("span",{className:"buttonText",children:"Forrige"})]}),(0,i.jsxs)(m.$n,{className:"next",onClick:s,disabled:t===a-1,children:[(0,i.jsx)("span",{className:"buttonText",children:"Neste"}),(0,i.jsx)(u.j,{size:16,className:"buttonIcon"})]})]})]})},_=({block:e})=>{let{carouselCards:t}=e,a=t.length>0,[s,n]=(0,r.useState)(0);if(!a)return null;let d=()=>{0!==s&&n(s-1)},o=()=>{s!==t.length&&n(s+1)};return(0,i.jsxs)("div",{children:[(0,i.jsx)(c,{index:s,carouselCards:t}),(0,i.jsx)(N,{children:t.map((e,a)=>(0,i.jsx)(k,{$isCurrent:a===s,style:{transform:`translateX(calc(-${100*s}% - ${s*q}vw))`},children:(0,i.jsx)($,{card:e,index:a,listLength:t.length,handlePrevious:d,handleNext:o})},e.key))})]})},q=50,N=(0,s.A)("div",{target:"e1i6wquq0"})("margin-top:",d.YK.space12,";display:flex;flex-direction:row;align-items:stretch;gap:",q,"vw;"),k=(0,s.A)("div",{target:"e1i6wquq1"})("flex:0 0 100%;box-sizing:border-box;",({$isCurrent:e})=>e?(0,n.AH)`
21          opacity: 1;
22          transition:
23            transform 0.5s ease,
24            opacity 0.1s ease-out;
25        `:(0,n.AH)`
26          opacity: 0;
27          transition:
28            transform 0.5s ease,
29            opacity 0.1s cubic-bezier(0.78, 0, 0.22, 1);
30        `,"  @media (max-width:",d.fi.m,"){",({$isCurrent:e})=>e?(0,n.AH)`
31            opacity: 1;
32            transition:
33              transform 0.35s ease,
34              opacity 0.35s ease-out;
35          `:(0,n.AH)`
36            opacity: 0;
37            transition:
38              transform 0.35s ease,
39              opacity 0.1s cubic-bezier(0.78, 0, 0.22, 1);
40          `,"}")}}]);
41//# sourceMappingURL=blocks-TrialMembership-cardCarousel-CardCarouselBlock.ab49323804a2362f.js.map

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.