PageSourceSearch

https://www.fjordnorway.com/_next/static/chunks/8972-df262cdccf7bd479.js

js fjordnorway.com collected 2026-09-24 18:37:44 UTC 16,167 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8972],{17961:(e,t,a)=>{a.d(t,{A:()=>k});var l=a(74848),r=a(76636),s=a(8142),n=a.n(s),i=a(96540),o=a(3342),d=a(98787),c=a(39913),u=a(18042),p=a(28657),m=a(30465),h=a(83612);let x=e=>{let{plannedPlaceId:t,productId:a,plan:l}=e,r=[];return t&&(!t||"string"==typeof t)&&a&&(!a||"string"==typeof a)&&l&&(0,h.uG)(l)&&l&&(0,h.uG)(l)&&l.map(e=>(e._id===t&&e.products&&(0,h.uG)(e.products)&&e.products.map(e=>(e.activityx&&(0,h.oj)(e.activityx)&&a===e.activityx.id&&r.push(e._id),e.servicex&&(0,h.oj)(e.servicex)&&a===e.servicex.id&&r.push(e._id),null)),null)),r};var v=a(49802),y=a(618),f=a(13687);let g=e=>{let{before:t,after:a,productId:l,plan:r}=e,s=[];return t&&(0,h.uG)(t)&&a&&(0,h.uG)(a)&&t.map((e,t)=>(e.selected!==a[t].selected&&(!0===a[t].selected&&s.push({operation:"add",assetId:l,plannedPlaceId:a[t].id}),!1===a[t].selected&&s.push({operation:"remove",plannedAssetId:x({plannedPlaceId:a[t].id,productId:l,plan:r})?.[0]})),null)),(0,y.A)(s,"operation","asc")};function j(e){let{productId:t,choices:a,handleCancel:r,handleConfirmChoice:s,textButtonCancel:n,textButtonConfirmChoice:o,textHeading:x,textDescription:y,mode:j}=e,{myPlan:b}=(0,i.useContext)(p.C7),N=(0,m.A)(),[I,w]=(0,i.useState)(!0),C=!1;"edit"===j&&a&&(0,h.uG)(a)&&(C=!0);let k=[];C&&(k=a.map(e=>({id:e.plannedPlaceId,selected:e.plannedPlacePresenceStatus})));let[A,P]=(0,i.useState)(k),G=g({before:k,after:A,productId:t,plan:b.plan}),R=()=>{s(G),P([]),w(!1)},E=()=>{r(),w(!1)},S=e=>{P(A.map(t=>t.id===e?{...t,selected:!t.selected}:t))};return(0,l.jsx)(c.e.Root,{show:I,as:i.Fragment,children:(0,l.jsxs)(u.lG,{as:"div",className:"relative z-30",onClose:w,children:[(0,l.jsx)(c.e.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity"})}),(0,l.jsx)("div",{className:"fixed inset-0 z-10 overflow-y-auto",id:"modal",children:(0,l.jsx)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:(0,l.jsx)(c.e.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,l.jsxs)(u.lG.Panel,{className:"relative w-full transform overflow-hidden bg-white p-6 text-left shadow-xl transition-all sm:my-8 sm:max-w-xl sm:p-10 sm:pt-16",children:[(0,l.jsx)("div",{className:"absolute top-6 right-6 hidden sm:block",children:(0,l.jsxs)("button",{type:"button",className:"bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:()=>E(),children:[(0,l.jsx)("span",{className:"sr-only",children:(0,v.vV)("Close",N)}),(0,l.jsx)(f.A,{icon:"X","aria-hidden":"true"})]})}),(0,l.jsx)("div",{className:"sm:flex sm:items-start",children:(0,l.jsx)("div",{children:C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.lG.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:x}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("p",{className:"text-sm text-gray-500",children:y}),(0,l.jsx)(function(e){let{className:t}=e,r=[];return a.map((e,t)=>(r.push((0,l.jsx)("div",{children:(0,l.jsxs)("div",{className:"flex h-5 items-center",children:[(0,l.jsx)("input",{id:e.plannedPlaceId,name:e.plannedPlaceId,type:"checkbox",checked:A?.[t]?.selected,onChange:()=>S(e.plannedPlaceId),className:"h-5 w-5",style:{accentColor:"black"}}),(0,l.jsxs)("label",{htmlFor:e.plannedPlaceId,className:"ml-3 font-medium",children:[(0,v.pF)("Trip {number} to",N,{number:t+1})," ",e.plannedPlaceTitle," ",(0,l.jsxs)("span",{className:"text-grey-aa font-normal",children:["(",e.plannedPlaceNrProducts,")"]})]})]})},e.plannedPlaceId)),null)),(0,l.jsx)("div",{className:t,children:(0,l.jsx)("div",{className:"pt-6 sm:pt-5",children:(0,l.jsx)("div",{role:"group",children:(0,l.jsx)("div",{className:"mt-4 sm:col-span-2 sm:mt-0",children:(0,l.jsx)("div",{className:"mb-4 max-w-lg space-y-5",children:r})})})})})},{choices:a,className:"mt-2"})]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.lG.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:x}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)("p",{className:"text-sm text-gray-500",children:y})})]})})}),(0,l.jsx)("form",{className:"space-y-8 divide-y divide-gray-200",children:(0,l.jsx)("div",{className:"pt-5",children:(0,l.jsxs)("div",{className:"flex justify-end",children:[(0,l.jsx)(d.A,{handleClick:()=>E(),className:"mr-4",children:n}),(0,l.jsx)(d.A,{handleClick:()=>R(),variant:"green",children:o})]})})})]})})})})]})})}var b=a(59021);let N=e=>{let{plan:t,plannedPlacesWithPresenceStatus:a,language:l}=e,r=[];return t&&(0,h.uG)(t)&&a&&(0,h.uG)(a)&&t&&(0,h.uG)(t)&&a&&(0,h.uG)(a)&&t.map(e=>(a.map(t=>(e._id===t.id&&r.push({plannedPlaceId:e._id,plannedPlaceTitle:(0,v.sC)({language:l,translationObj:e.place?.locTitle}),plannedPlaceNrProducts:e.products?.length,plannedPlacePresenceStatus:t.present}),null)),null)),r},I=e=>{let{id:t,plan:a,type:l}=e,r=[];return t&&(!t||"string"==typeof t)&&a&&(0,h.uG)(a)&&a&&(0,h.uG)(a)&&a.map(e=>("place"===l||"attraction"===l?t===e.place?.id&&r.push(e._id):e.products&&(0,h.uG)(e.products)&&e.products.map(a=>(a.activityx&&(0,h.oj)(a.activityx)&&t===a.activityx.id&&r.push(e._id),a.servicex&&(0,h.oj)(a.servicex)&&t===a.servicex.id&&r.push(e._id),null)),null)),r},w=e=>{let{id:t,plan:a}=e,l=[];return t&&(!t||"string"==typeof t)&&a&&(0,h.uG)(a)&&a&&(0,h.uG)(a)&&a.map(e=>(e.products&&(0,h.uG)(e.products)&&e.products.map(e=>(e.activityx&&(0,h.oj)(e.activityx)&&t===e.activityx.id&&l.push(e._id),e.servicex&&(0,h.oj)(e.servicex)&&t===e.servicex.id&&l.push(e._id),null)),null)),l};var C=a(4102);function k(e){let{iconStyling:t,id:a,item:s,placeId:c,productIsSelected:u,size:x,type:y,regionId:f,positionAbsolute:g="small"===x}=e,k=(0,m.A)(),{myPlan:A,setMyPlan:P}=(0,i.useContext)(p.C7),[G,R]=(0,i.useState)(!1),[E,S]=(0,i.useState)(!1),[_,M]=(0,i.useState)(!1),[T,V]=(0,i.useState)({}),[F,$]=(0,i.useState)([]),[z,D]=(0,i.useState)([]),[O,L]=(0,i.useState)([]),[B,Z]=(0,i.useState)([]),[H,K]=(0,i.useState)([]),{setPlannerSaveStatus:Q}=(0,i.useContext)(p.C7);if(s&&(0,h.oj)(s)||a&&"string"==typeof a&&y&&"string"==typeof y){var X;let e=a||s?.id,p=y?.toLowerCase()||s?.type?.toLowerCase()||s?.typename?.toLowerCase(),m="place"===p||"attraction"===p?e:c||s?.place?.id;(0,i.useEffect)(()=>{m&&"string"==typeof m&&(!E||E&&(0,h.VP)(E))&&S(I({id:m,plan:A?.plan,type:"place"}))},[A]),(0,i.useEffect)(()=>
1{if(m&&"string"==typeof m&&(!E||E&&(0,h.uG)(E))){let e=I({id:m,plan:A?.plan,type:"place"});n()(E,e)||S(e)}},[A?.plan]);let Y=t=>{s&&(0,h.oj)(s)?t&&(0,C._o)({trackingType:t,item:{id:e,type:p,isFullItem:!1}}):e&&"string"==typeof e&&y&&"string"==typeof y&&t&&(0,C._o)({trackingType:t,item:{id:e,type:p,isFullItem:!1}})},q=!1,J=!1,U=[],W=[],ee=[];if("place"===p||"attraction"===p?U=I({id:e,plan:A?.plan,type:p}):(W=I({id:e,plan:A?.plan}),ee=w({id:e,plan:A?.plan})),q=(0,h.uG)(U),J=(0,h.uG)(ee),E.length>=2&&Array.isArray(W)){let t=(()=>{let e=[];return E.map(t=>(W.includes(t)?e.push({id:t,present:!0}):e.push({id:t,present:!1}),null)),e})(),a=N({plan:A?.plan,plannedPlacesWithPresenceStatus:t,language:k});_&&a&&T&&(0,h.RI)(T)&&V({productId:e,plannedProductId:"lol",choices:a,handleCancel:()=>{V({}),M(!1),R(!1)},handleConfirmChoice:e=>{$(e),V({}),M(!1),R(!1)},textButtonCancel:(0,v.vV)("Cancel",k),textButtonConfirmChoice:(0,v.vV)("Confirm",k),textHeading:(0,v.vV)("Modal heading",k),textDescription:`${(0,v.vV)("Modal description 1-2",k)} ${a?.[0]?.plannedPlaceTitle} ${(0,v.vV)("Modal description 2-2",k)}`,mode:"edit"})}(0,i.useEffect)(()=>{(()=>{if(F&&(0,h.uG)(F)){let e=[],t=[];F.map(a=>("remove"===a.operation&&t.push((0,b.M)({endpoint:"/remove",body:{myPlan:A,plannedAssetId:a.plannedAssetId,isStrict:!0}})),"add"===a.operation&&e.push((0,b.M)({endpoint:"/add",body:{myPlan:A,assetId:a.assetId,assetType:p,language:k,plannedPlaceId:a.plannedPlaceId}})),null)),D(e),Z(t)}})()},[F]),(0,i.useEffect)(()=>{(async()=>{z&&(0,h.uG)(z)&&(L(await Promise.all(z)),D([]))})()},[z]),(0,i.useEffect)(()=>{(async()=>{if(B&&(0,h.uG)(B)&&z&&(0,h.VP)(z)){let e=F.filter(e=>"remove"===e.operation).map(e=>(0,b.M)({endpoint:"/remove",body:{myPlan:A,plannedAssetId:e.plannedAssetId,isStrict:!0}})),t=(await Promise.all(e)).filter(e=>e?.data&&Array.isArray(e.data));t.length>0&&K(t[t.length-1].data)}})()},[B,z,A?.plan,F]),(0,i.useEffect)(()=>{(async()=>{if(O&&(0,h.uG)(O)){let e=(0,r.IM)(O.map(e=>e.data));P({...A,plan:e}),Y(),M(!1),V({}),R(!1)}})()},[O]),(0,i.useEffect)(()=>{H&&(0,h.uG)(H)&&(n()(H,A.plan)||P({...A,plan:H}))},[H]);let et=async()=>{if(E?.length===0||E?.length===1&&E?.[0]!==W?.[0]||"place"===p||"attraction"===p){R(!0);let t=await (0,b.M)({endpoint:"/add",body:{language:k,myPlan:A,assetId:e,assetType:p}});if(t.error||!t.data)R(!1),t.error?console.error("ERROR: 'api/itinerary/add' failed!",t.error):t.data||console.error("ERROR: 'api/itinerary/add' failed, without an error!");else{if(t.data.error)console.error("ERROR: 'api/itinerary/add' returned an error!",t.data);else{let e={...A,plan:t.data};P(e),Y("add_to_cart"),e._id&&!(await (0,b.M)({endpoint:"/save-extended",body:{ixinerary:{...e,title:e.title||(0,v.vV)("My plan",k)}}})).error&&Q("saved")}R(!1),M(!1),V({})}}else if(E?.length===1&&E?.[0]===W?.[0]){R(!0);let e=await (0,b.M)({endpoint:"/remove",body:{myPlan:A,plannedAssetId:ee?.[0],isStrict:!0}});if(e.error||!e.data)R(!1),e.error?console.error("ERROR: 'api/itinerary/remove' failed!",e.error):e.data||console.error("ERROR: 'api/itinerary/remove' failed, without an error!");else{if(e.data.error)console.error("ERROR: 'api/itinerary/remove' returned an error!",e.data);else{let t={...A,plan:e.data};P(t),Y("remove_from_cart"),(await (0,b.M)({endpoint:"/save-extended",body:{ixinerary:t}})).error||Q("saved")}R(!1),M(!1),V({})}}else M(!0)},ea=`Add to my plan${"place"===p&&q?" again":""}`,el="Remove from my plan";return(0,l.jsxs)(l.Fragment,{children:[T&&(0,h.oj)(T)?(0,l.jsx)(j,{...T}):null,(0,l.jsx)(d.A,{className:`${"tiny"===x?"":"hover:bg-white"} ${g?"absolute right-2 bottom-2 z-50":""}`,handleClick:et,hideLabel:"small"===x||"tiny"===x,iconStyling:t,icon:G?"Spinner":J?"Trash":"Plus",size:"small"===x||"tiny"===x?"sm":"md",title:J?(0,v.vV)(el,k):(0,v.vV)(ea,k),variant:(X=J,"tiny"!==x&&X||"tiny"===x&&!u?"grey":"tiny"===x&&u?"blueDarkTiny":"green"),regionId:f,disabled:G,children:(0,l.jsx)(o.A,{txt:J?el:ea})})]})}return null}},99901:(e,t,a)=>{a.d(t,{A:()=>j});var l=a(74848),r=a(46942),s=a.n(r),n=a(98989),i=a(29113),o=a(96540),d=a(16653),c=a(28550),u=a(49802),p=a(79953),m=a(62270),h=a(48335),x=a(52295);function v(e){let{src:t,alt:a,loading:r,width:n,height:i}=e,{effectType:d}=(0,h.P)(),[c,u]=(0,o.useState)(!1),p=(0,o.useRef)(null);if(void 0===a&&console.error(`Image should have alt text.
2Image source: "${t}"`),!(0,m.Et)(n)||!(0,m.Et)(i))throw Error("Image should have specified width and height (Number).");let v=(0,o.useMemo)(()=>(0,x.ZD)({src:t,cloudinaryId:e.cloudinaryId,width:n,height:i,dprValue:1,isPlaceholder:!0}),[n,i,t,e.cloudinaryId]),y=(0,o.useMemo)(()=>(0,x.ZD)({src:t,cloudinaryId:e.cloudinaryId,width:n,height:i,dprValue:2,isPlaceholder:!1}),[n,i,t,e.cloudinaryId]);return(0,o.useEffect)(()=>{let e=p.current;e&&e.complete&&u(!0)},[y]),(0,l.jsx)("img",{ref:p,width:Math.round(n),height:Math.round(i),src:c?y:v,alt:a||"",loading:r||"lazy",onLoad:()=>u(!0),className:s()("bg-grey/50",e.className,{"transform-gpu bg-clip-border transition-all":!!d,"group-hover:duration-10000 scale-100 duration-300 ease-out group-hover:scale-125":"zoomSlow"===d,"duration-100 ease-in-out group-hover:scale-105 group-hover:shadow":"zoomQuick"===d,"blur-lg":!c,"blur-none":c}),onError:()=>console.error("Error:",{src:t,optimizedSrc:y})})}var y=a(13687),f=a(92150);let g={enter:e=>{let{direction:t,width:a}=e;return{x:t*a}},center:{x:0},exit:e=>{let{direction:t,width:a}=e;return{x:-(t*a)}}};function j(e){let{imageArray:t,language:a,regionId:r,fjordNorwayArticle:m,textColor:h}=e,[j,{width:b}]=(0,d.A)(),[N,I]=(0,o.useState)(0),[w,C]=(0,o.useState)(1),k=t.sort((e,t)=>
2e.mainImage&&!t.mainImage?-1:!e.mainImage&&t.mainImage?1:0).filter(e=>e.url),A=e=>{e>N?C(1):C(-1),I(e)},{context:P,description:G}=k[N],R=G?`${G}`:"",E=G&&P?.custom?.credit?" | ":"",S=P?.custom?.credit?`\xa9 ${P?.custom?.credit}`:"";return(0,l.jsxs)("div",{children:[k.length>1&&(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsxs)("button",{onClick:()=>{let e=N-1;C(-1),I(e<0?k.length-1:e)},"aria-label":(0,u.vV)("Previous image",a),className:s()("group","block","absolute top-1/2 left-0","z-20","-translate-y-3/4","p-2"),children:[(0,l.jsx)(y.A,{icon:"ChevronLeft",strokeColor:"blueDark",className:"absolute top-1/2 left-1/2 -translate-x-2 -translate-y-1/2"}),(0,l.jsx)(y.A,{icon:"Dodecagon",strokeColor:"transparent",className:"group-hover:fill-green fill-white"})]}),(0,l.jsxs)("button",{onClick:()=>{let e=N+1;C(1),I(e>=k.length?0:e)},"aria-label":(0,u.vV)("Next image",a),className:s()("group","block","absolute top-1/2","right-0","z-20","-translate-y-3/4","p-2"),children:[(0,l.jsx)(y.A,{icon:"ChevronRight",strokeColor:"blueDark",className:"absolute top-1/2 left-1/2 -translate-x-1 -translate-y-1/2"}),(0,l.jsx)(y.A,{icon:"Dodecagon",strokeColor:"transparent",className:"group-hover:fill-green fill-white"})]})]}),k.length>=1&&(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsxs)("div",{ref:j,className:"relative flex h-[300px] w-full overflow-hidden bg-gray-700 md:h-[650px] xl:h-[500px]",children:[(0,l.jsx)(n.N,{custom:{direction:w,width:b},children:(0,l.jsx)(i.P.div,{variants:g,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},custom:{direction:w,width:b},className:"absolute h-[300px] w-full md:h-[650px] xl:h-[500px]",children:(0,l.jsx)(v,{className:"h-full w-full object-cover",...(0,x.vt)(750,1.5),src:k[N]?.url,cloudinaryId:k[N]?.cloudinaryId,alt:k[N]?.context?.custom?.alt||k[N]?.description||""})},N)}),r===c.Ei.stavanger&&!m&&(0,l.jsx)(f.A,{position:"left-bottom",size:"h-1/3",color:"text-eonYellow-0.4"})]})}),(0,l.jsx)("div",{className:"text-end",children:(0,l.jsx)("span",{className:`r-text-xs -0 text-end z-20  px-2 ${h||"text-black"}`,children:R+E+S})}),k.length>1&&(0,l.jsx)("div",{className:"relative touch-pan-y",children:(0,l.jsx)("div",{className:"mt-2 overflow-hidden overflow-x-auto whitespace-nowrap",children:(0,l.jsx)("div",{className:"transition-all",style:{transition:"all 300ms ease-out 0s",transform:`translate3d(${-60*N}px, 0px, 0px)`},children:k.map((e,t)=>(0,l.jsx)("button",{className:`hover:border-blue-dark border-3 relative h-16 w-24 border border-transparent ${t===N&&"border-blue-dark"}`,onClick:()=>A(t),children:(0,l.jsx)(p.A,{className:"h-full w-full",...(0,x.vt)(75,1.5),src:e?.url,cloudinaryId:e?.cloudinaryId,alt:k[N]?.context?.custom?.alt||k[N]?.description||""})},e.url))})})})]})}},11702:(e,t,a)=>{a.d(t,{A:()=>c});var l=a(74848),r=a(46942),s=a.n(r),n=a(5556),i=a.n(n);a(96540);var o=a(13687);let d=e=>{let{children:t,className:a="",color:r="black",icon:n,id:i}=e;return(0,l.jsxs)("span",{className:s()("flex items-center","mr-4 mb-4 md:mr-8","transform-gpu","blueDark"===r&&"text-blue-dark stroke-blue-dark",a),children:[(0,l.jsx)(o.A,{icon:n,className:s()("mr-2")}),(0,l.jsx)("span",{id:i,children:t})]})};d.propTypes={children:i().node,color:i().string,className:i().string,icon:i().string};let c=d},8090:(e,t,a)=>{a.d(t,{A:()=>i});var l=a(74848),r=a(93548),s=a(46942),n=a.n(s);a(96540);let i=e=>{let{blocks:t,className:a="",serializers:s}=e;return t&&Array.isArray(t)&&0!==t.length?(0,l.jsx)("div",{className:n()("body-text",a),children:(0,l.jsx)(r.RK,{value:t,components:s})}):null}},618:(e,t,a)=>{a.d(t,{A:()=>l});let l=(e,t,a)=>e.sort((e,l)=>{let r=e[t],s=l[t];return"asc"===a?r<s?-1:r>s?1:0:"desc"===a?r>s?-1:r<s?1:0:null})}}]);

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.