(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1083],{97087:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/min-profil",function(){return t(92478)}])},58122:function(e,n,t){"use strict";t.d(n,{H:function(){return o}});var r=t(85893),i=t(65779),s=t(2962),a=t(11163),l=t(97046),o=function(e){var n=e.title,t=e.description,o=e.imageUrl,d=e.appendSuffix,p=(0,a.useRouter)().asPath;return(0,r.jsx)(s.PB,{title:"".concat(n).concat(void 0===d||d?l.I.site.meta.title.suffix:""),description:t,openGraph:{description:t,images:o?[{url:o}]:[]},canonical:(0,i.J)(p),additionalLinkTags:u,additionalMetaTags:c})},u=[{rel:"apple-touch-icon",sizes:"180x180",href:"/apple-touch-icon.png"},{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"},{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon-16x16.png"},{rel:"manifest",href:"/site.webmanifest"},{rel:"mask-icon",href:"/safari-pinned-tab.svg",color:"#ffffff"}],c=[{name:"apple-mobile-web-app-title",content:"Elitefoto"},{name:"application-name",content:"Elitefoto"},{name:"msapplication-TileColor",content:"#ffffff"},{name:"theme-color",content:"#ffffff"}]},3458:function(e,n,t){"use strict";t.d(n,{Z:function(){return p}});var r=t(85893),i=t(22338),s=t(33301),a=t(84051),l=t(97831),o=function(e){switch(e._type){case"menuItem":return c(e);case"menuGroup":return u(e)}},u=function(e){var n=e._key,t=e.items;return{_key:n,title:e.title,children:null==t?void 0:t.map(function(e){switch(e._type){case"menuItem":return c(e);case"menuGroup":return u(e)}}).filter(l.T)}},c=function(e){var n=e._key,t=e.title,r=e.page;switch(r._type){case"category":return{_key:n,title:t||r.title,url:"/kategorier/".concat(null==r?void 0:r.slug)};case"genericPageGroup":return{_key:n,title:t||r.title,url:"/".concat(r.path)};case"genericPage":return{_key:n,title:t||r.title,url:"/".concat(r.pageGroup.path,"/").concat(null==r?void 0:r.slug)}}};t(67294);var d=t(99803),p=function(e){var n,t=e.children,l=e.header,u=e.footerData,c=e.showSideMenu,p=e.menuData,m=e.preview,f=(n=(0,a.$)("// groq\n*[_type == 'menu'][0] {\n  sections[] {\n    ...,\n    _type == 'menuItem' => {\n      ...,\n      page-> {_type,path,pageGroup-> {path},title,'slug':slug.current}\n    },\n    _type == 'menuGroup' => {\n      ...,\n      items[] {\n        _type == 'menuItem' => {\n          ...,\n          page-> {_type,path,pageGroup-> {path},title,'slug':slug.current}\n        },\n        _type == 'menuGroup' => {\n          title,\n          ...,\n          items[] {\n            _type == 'menuItem' => {\n              ...,\n              page-> {_type,path,pageGroup-> {path},title,'slug':slug.current}\n            },\n            _type == 'menuGroup' => {\n              title,\n              ...,\n              items[] {\n                _type == 'menuItem' => {\n                  ...,\n                  page-> {_type,path,pageGroup-> {path},title,'slug':slug.current}\n                },\n                _type == 'menuGroup' => {\n                  title,\n                  ...,\n                  items[] {\n                    _type == 'menuItem' => {\n                      ...,\n                      page-> {_type,path,pageGroup-> {path},title,'slug':slug.current}\n                    },\n                    _type == 'menuGroup' => {\n                      title,\n                      ...,\n                      items[] {\n                        _type == 'menuItem' => {\n                          ...,\n                          page-> {_type,path,pageGroup-> {path},title,'slug':slug.current}\n                        },\n                      }\n                    },\n                  }\n                },\n              }\n            },\n          }\n        },\n      }\n    },\n  }\n}\n",{initialData:{sections:[]},enabled:m}).data).sections?n.sections.map(o):[],h=m&&f.length>0?f:p;return(0,r.jsx)(d.Z,{footerData:u,children:(0,r.jsxs)(i.W,{display:c?{base:"flex",lg:"grid"}:{base:"flex"},flexDirection:"column",gridTemplateColumns:c?"minmax(15rem,auto) 1fr":"1fr",gridTemplateRows:l?"repeat(2, auto)":"1fr",gridTemplateAreas:l?'"header header" "sidemenu content"':'"sidemenu content"',gridColumnGap:8,"data-content":"main",as:"main",children:[(0,r.jsx)(s.v2,{menuData:h,showSideMenu:c}),l,t]})})}},84051:function(e,n,t){"use strict";t.d(n,{$:function(){return s}});var r=t(41561),i=t(10446),s=(0,r.KF)(i.h)},65779:function(e,n,t){"use strict";t.d(n,{J:function(){return i}});var r=t(99048).w.vercelUrl.replace(/^(?:https?:\/\/)?/,"https://").replace(/\/?$/,"/"),i=function(e){return"".concat(r).concat(new URL(r+e.substring(1)).pathname.substring(1))}},92478:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return ew},default:function(){return eS}});var r=t(91309),i=t(85893),s=t(27239),a=t(81136),l=t(48783),o=t(71293),u=t(14225),c=t(57747),d=t(22757),p=t(58122),m=t(20967),f=t(55227),h=t(16554),g=t(77030),b=t(33179),x=t(56534),v=t(25432),[y,j]=(0,f.k)({name:"StatStylesContext",errorMessage:"useStatStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Stat />\" "}),_=(0,h.G)(function(e,n){let t=(0,g.jC)("Stat",e),r={position:"relative",flex:"1 1 0%",...t.container},{className:s,children:a,...l}=(0,b.Lr)(e);return(0,i.jsx)(y,{value:t,children:(0,i.jsx)(x.m.div,{ref:n,...l,className:(0,v.cx)("chakra-stat",s),__css:r,children:(0,i.jsx)("dl",{children:a})})})});_.displayName="Stat";var I=(0,h.G)(function(e,n){let t=j();return(0,i.jsx)(x.m.dt,{ref:n,...e,className:(0,v.cx)("chakra-stat__label",e.className),__css:t.label})});I.displayName="StatLabel";var C=(0,h.G)(function(e,n){let t=j();return(0,i.jsx)(x.m.dd,{ref:n,...e,className:(0,v.cx)("chakra-stat__number",e.className),__css:{...t.number,fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums"}})});C.displayName="StatNumber";var k={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},w=t(61735),S=t(66919),D=t(76766),P=t(85075),E=t(57134),O=t(81103),T=t(67294),N=e=>{var n;return(null==(n=e.current)?void 0:n.ownerDocument)||document},R=e=>{var n,t;return(null==(t=null==(n=e.current)?void 0:n.ownerDocument)?void 0:t.defaultView)||window},G="chakra-ui:close-tooltip",L=t(1702),z=t(48940),F=t(62578),q=t(21190),U=(0,x.m)(F.E.div),W=(0,h.G)((e,n)=>{var t,r;let s;let a=(0,g.mq)("Tooltip",e),l=(0,b.Lr)(e),o=(0,z.F)(),{children:u,label:c,shouldWrapChildren:d,"aria-label":p,hasArrow:m,bg:f,portalProps:h,background:y,backgroundColor:j,bgColor:_,motionProps:I,...C}=l,F=null!=(r=null!=(t=null!=y?y:j)?t:f)?r:_;if(F){a.bg=F;let e=(0,b.K1)(o,"colors",F);a[D.Dq.arrowBg.var]=e}let W=function(e={}){let{openDelay:n=0,closeDelay:t=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:s,closeOnPointerDown:a=i,closeOnEsc:l=!0,onOpen:o,onClose:u,placement:c,id:d,isOpen:p,defaultIsOpen:m,arrowSize:f=10,arrowShadowColor:h,arrowPadding:g,modifiers:b,isDisabled:x,gutter:y,offset:j,direction:_,...I}=e,{isOpen:C,onOpen:k,onClose:L}=(0,P.q)({isOpen:p,defaultIsOpen:m,onOpen:o,onClose:u}),{referenceRef:z,getPopperProps:F,getArrowInnerProps:q,getArrowProps:U}=(0,S.D)({enabled:C,placement:c,arrowPadding:g,modifiers:b,gutter:y,offset:j,direction:_}),W=(0,T.useId)(),A=`tooltip-${null!=d?d:W}`,J=(0,T.useRef)(null),M=(0,T.useRef)(),X=(0,T.useCallback)(()=>{M.current&&(clearTimeout(M.current),M.current=void 0)},[]),Z=(0,T.useRef)(),H=(0,T.useCallback)(()=>{Z.current&&(clearTimeout(Z.current),Z.current=void 0)},[]),$=(0,T.useCallback)(()=>{H(),L()},[L,H]),B=((0,T.useEffect)(()=>{let e=N(J);return e.addEventListener(G,$),()=>e.removeEventListener(G,$)},[$,J]),()=>{let e=N(J),n=R(J);e.dispatchEvent(new n.CustomEvent(G))}),K=(0,T.useCallback)(()=>{if(!x&&!M.current){C&&B();let e=R(J);M.current=e.setTimeout(k,n)}},[B,x,C,k,n]),V=(0,T.useCallback)(()=>{X();let e=R(J);Z.current=e.setTimeout($,t)},[t,$,X]),Q=(0,T.useCallback)(()=>{C&&r&&V()},[r,V,C]),Y=(0,T.useCallback)(()=>{C&&a&&V()},[a,V,C]),ee=(0,T.useCallback)(e=>{C&&"Escape"===e.key&&V()},[C,V]);(0,E.O)(()=>N(J),"keydown",l?ee:void 0),(0,E.O)(()=>{if(!s)return null;let e=J.current;if(!e)return null;let n=function e(n){return["html","body","#document"].includes(n.localName)?n.ownerDocument.body:(0,w.Re)(n)&&function(e){let n=e.ownerDocument.defaultView||window,{overflow:t,overflowX:r,overflowY:i}=n.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(t+i+r)}(n)?n:e("html"===n.localName?n:n.assignedSlot||n.parentElement||n.ownerDocument.documentElement)}(e);return"body"===n.localName?R(J):n},"scroll",()=>{C&&s&&$()},{passive:!0,capture:!0}),(0,T.useEffect)(()=>{x&&(X(),C&&L())},[x,C,L,X]),(0,T.useEffect)(()=>()=>{X(),H()},[X,H]),(0,E.O)(()=>J.current,"pointerleave",V);let en=(0,T.useCallback)((e={},n=null)=>{let t={...e,ref:(0,O.lq)(J,n,z),onPointerEnter:(0,v.v0)(e.onPointerEnter,e=>{"touch"!==e.pointerType&&K()}),onClick:(0,v.v0)(e.onClick,Q),onPointerDown:(0,v.v0)(e.onPointerDown,Y),onFocus:(0,v.v0)(e.onFocus,K),onBlur:(0,v.v0)(e.onBlur,V),"aria-describedby":C?A:void 0};return t},[K,V,Y,C,A,Q,z]),et=(0,T.useCallback)((e={},n=null)=>F({...e,style:{...e.style,[D.Dq.arrowSize.var]:f?`${f}px`:void 0,[D.Dq.arrowShadowColor.var]:h}},n),[F,f,h]),er=(0,T.useCallback)((e={},n=null)=>{let t={...e.style,position:"relative",transformOrigin:D.Dq.transformOrigin.varRef};return{ref:n,...I,...e,id:A,role:"tooltip",style:t}},[I,A]);return{isOpen:C,show:K,hide:V,getTriggerProps:en,getTooltipProps:er,getTooltipPositionerProps:et,getArrowProps:U,getArrowInnerProps:q}}({...C,direction:o.direction}),A="string"==typeof u||d;if(A)s=(0,i.jsx)(x.m.span,{display:"inline-block",tabIndex:0,...W.getTriggerProps(),children:u});else{let e=T.Children.only(u);s=(0,T.cloneElement)(e,W.getTriggerProps(e.props,e.ref))}let J=!!p,M=W.getTooltipProps({},n),X=J?function(e,n=[]){let t=Object.assign({},e);for(let e of n)e in t&&delete t[e];return t}(M,["role","id"]):M,Z=function(e,n){let t={};for(let r of n)r in e&&(t[r]=e[r]);return t}(M,["role","id"]);return c?(0,i.jsxs)(i.Fragment,{children:[s,(0,i.jsx)(q.M,{children:W.isOpen&&(0,i.jsx)(L.h,{...h,children:(0,i.jsx)(x.m.div,{...W.getTooltipPositionerProps(),__css:{zIndex:a.zIndex,pointerEvents:"none"},children:(0,i.jsxs)(U,{variants:k,initial:"exit",animate:"enter",exit:"exit",...I,...X,__css:a,children:[c,J&&(0,i.jsx)(x.m.span,{srOnly:!0,...Z,children:p}),m&&(0,i.jsx)(x.m.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:(0,i.jsx)(x.m.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:a.bg}})})]})})})})]}):(0,i.jsx)(i.Fragment,{children:u})});W.displayName="Tooltip";var A=t(89993),J=t(35503),M=t(35559),X={main:"main"},Z=t(97046),H=t(49737),$=t(11010),B=t(70655),K=t(7963),V=t(55512),Q=t(83589),Y=t(64859),ee=t(66205),en=t(54346),et=t(14253),er=t(34292),ei=t(33299),es=t(24658);function ea(){return(ea=(0,$._)(function(e){return(0,B.Jh)(this,function(n){return[2,es.ZP.post("/api/auth/changeEmail",{json:e})]})})).apply(this,arguments)}function el(){return(el=(0,$._)(function(){return(0,B.Jh)(this,function(e){return[2,es.ZP.delete("/api/auth/deleteAccount")]})})).apply(this,arguments)}var eo={changeEmailAddress:function(e){return ea.apply(this,arguments)},deleteAccount:function(){return el.apply(this,arguments)}};function eu(e){var n=e.onClose,t=e.isOpen,s=(0,r._)((0,T.useState)(!1),2),a=s[0],u=s[1],c=(0,K.p)(),p=(0,T.useRef)(null);function m(){return(m=(0,$._)(function(e){return(0,B.Jh)(this,function(t){switch(t.label){case 0:return t.trys.push([0,5,6,7]),u(!0),e.preventDefault(),[4,eo.deleteAccount()];case 1:if(200!==t.sent().status)return[3,3];return[4,(0,ei.signOut)({callbackUrl:"/"})];case 2:return t.sent(),n(),[3,4];case 3:n(),c({title:Z.I.pages.shared.errorToast.title,description:Z.I.pages.shared.errorToast.description,status:"error",duration:9e3,isClosable:!0}),t.label=4;case 4:return[3,7];case 5:return t.sent(),n(),c({title:Z.I.pages.shared.errorToast.title,description:Z.I.pages.shared.errorToast.description,status:"error",duration:9e3,isClosable:!0}),[3,7];case 6:return u(!1),[7];case 7:return[2]}})})).apply(this,arguments)}return(0,i.jsx)(V.a,{variant:"responsive",isOpen:t,leastDestructiveRef:p,onClose:n,children:(0,i.jsx)(Q.Z,{backdropFilter:"blur(10px)",children:(0,i.jsxs)(V._,{mx:"2",children:[(0,i.jsxs)(Y.x,{fontSize:"lg",fontWeight:"bold",children:[(0,i.jsx)(d.X,{fontWeight:"semibold",children:Z.I.pages.myProfile.deleteUser}),(0,i.jsx)(ee.o,{size:"lg"})]}),(0,i.jsx)(en.f,{children:(0,i.jsxs)(l.g,{spacing:"2",alignItems:"flex-start",children:[(0,i.jsx)(o.x,{children:Z.I.pages.myProfile.deleteUserDialogInfo}),(0,i.jsx)(o.x,{children:Z.I.pages.myProfile.deleteUserDialogConfirmation})]})}),(0,i.jsx)(et.m,{children:(0,i.jsxs)(er.U,{children:[(0,i.jsx)(H.k,{ref:p,onClick:n,variant:"outline",borderRadius:"md",borderColor:"inherit",fontWeight:"500",isDisabled:a,children:Z.I.common.shared.cancel}),(0,i.jsxs)(H.K,{borderRadius:"md",colorScheme:"primary",isLoading:a,onClick:function(e){!function(e){m.apply(this,arguments)}(e)},fontWeight:"500",children:[Z.I.common.shared.delete,a?"isLoading":null]})]})})]})})})}var ec=t(35541),ed=t(14581),ep=t(85970),em=t(5418),ef=t(33090);function eh(e){var n,t=e.isOpen,s=e.onClose,a=(0,ei.useSession)().data,o=(0,T.useRef)(null),u=(0,K.p)(),c=(0,r._)((0,T.useState)(!1),2),p=c[0],m=c[1];function f(){return(f=(0,$._)(function(e){var n,t,r;return(0,B.Jh)(this,function(i){switch(i.label){case 0:e.preventDefault(),n=e.currentTarget,t=new FormData(n).get("email"),i.label=1;case 1:if(i.trys.push([1,5,6,7]),!t)return[3,3];return m(!0),[4,eo.changeEmailAddress(t)];case 2:if(200===(r=i.sent()).status)n.reset(),s(),u({title:Z.I.pages.myProfile.editEmail,description:Z.I.pages.myProfile.editEmailToast.description,status:"info",duration:9e3,isClosable:!0});else throw Error("".concat(r.status," ").concat(r.statusText));return[3,4];case 3:throw Error("Invalid email");case 4:return[3,7];case 5:return i.sent(),m(!1),u({title:Z.I.pages.shared.errorToast.title,description:Z.I.pages.shared.errorToast.description,status:"error",duration:9e3,isClosable:!0}),[3,7];case 6:return m(!1),s(),[7];case 7:return[2]}})})).apply(this,arguments)}return a?(0,i.jsxs)(ec.u_,{variant:"responsive",isOpen:t,onClose:s,initialFocusRef:o,children:[(0,i.jsx)(Q.Z,{backdropFilter:"blur(10px)"}),(0,i.jsxs)(ed.h,{mx:"2",children:[(0,i.jsxs)(Y.x,{alignContent:"center",children:[(0,i.jsx)(d.X,{fontWeight:"semibold",children:Z.I.pages.myProfile.editContactInfo}),(0,i.jsx)(ee.o,{size:"lg",alignContent:"center"})]}),(0,i.jsx)(en.f,{py:5,children:(0,i.jsx)(l.g,{spacing:6,children:(0,i.jsxs)(ep.NI,{as:"form",onSubmit:function(e){return f.apply(this,arguments)},children:[(0,i.jsx)(em.l,{htmlFor:"email",children:Z.I.pages.myProfile.eMail}),(0,i.jsx)(ef.I,{ref:o,type:"email",id:"email",name:"email",defaultValue:null!==(n=null==a?void 0:a.user.email)&&void 0!==n?n:void 0,required:!0}),(0,i.jsx)(ep.Q6,{children:Z.I.pages.myProfile.enterNewEmail}),(0,i.jsxs)(er.U,{mt:9,justifyContent:"end",spacing:3,children:[(0,i.jsx)(H.k,{type:"button",isDisabled:p,onClick:s,borderRadius:"md",children:Z.I.common.shared.cancel}),(0,i.jsx)(H.K,{isLoading:p,type:"submit",borderRadius:"md",children:Z.I.common.shared.save})]})]})})})]})]}):null}var eg=t(44954),eb=t(85945),ex=t(48228),ev=t(58692),ey=t(88051);function ej(e){var n,t,s=e.isOpen,a=e.onClose,o=(0,ei.useSession)().data;null==o||null===(n=o.user)||void 0===n||n.email;var u=(0,T.useRef)(null),p=(0,K.p)(),m=(0,eb.NL)(),f=(0,M.Dp)(X.main,!!(null==o?void 0:null===(t=o.user)||void 0===t?void 0:t.email)),h=f.data,g=f.isLoading;f.isRefetching;var b=(0,r._)((0,T.useState)(null==h?void 0:h.isSubscribed),2),x=b[0],v=b[1];(0,T.useEffect)(function(){h&&v(null==h?void 0:h.isSubscribed)},[h]);var y=(0,ex.D)({mutationFn:function(e){if("subscribe"===e)return ev.e.subscribeEmailToList(X.main);if("unsubscribe"===e)return ev.e.unsubscribeEmailFromList(X.main);throw Error("Unsupported action")},retry:!1,onSuccess:function(e){m.setQueryData([(0,ey.ex)(X.main)],e),a();var n=e.isSubscribed?Z.I.pages.myProfile.subscriptions.toast.subscribed:Z.I.pages.myProfile.subscriptions.toast.unsubscribed;p({title:n.title,description:n.description,status:"success",duration:9e3,isClosable:!0})},onError:function(){a(),p({title:Z.I.pages.shared.errorToast.title,description:Z.I.pages.shared.errorToast.description,status:"error",duration:9e3,isClosable:!0})}});return o?(0,i.jsxs)(ec.u_,{variant:"responsive",isOpen:s,onClose:a,initialFocusRef:u,children:[(0,i.jsx)(Q.Z,{backdropFilter:"blur(10px)"}),(0,i.jsxs)(ed.h,{mx:"2",children:[(0,i.jsxs)(Y.x,{alignContent:"center",children:[(0,i.jsx)(d.X,{fontWeight:"semibold",children:Z.I.pages.myProfile.subscriptions.modal.heading}),(0,i.jsx)(ee.o,{size:"lg",alignContent:"center"})]}),(0,i.jsx)(en.f,{py:5,children:(0,i.jsxs)(l.g,{spacing:6,as:"form",onSubmit:function(e){e.preventDefault();var n=e.currentTarget,t=null!==new FormData(n).get("subscribe");null!=h&&h.isSubscribed&&t||!h||y.isLoading||y.mutate(t?"subscribe":"unsubscribe")},children:[(0,i.jsxs)(ep.NI,{flexDirection:"row-reverse",display:"flex",alignItems:"start",justifyContent:"start",gap:"2",children:[(0,i.jsx)(c.xu,{children:(0,i.jsx)(em.l,{htmlFor:"subscribe",userSelect:"none",fontWeight:"inherit",children:Z.I.pages.myProfile.subscriptions.modal.label})}),(0,i.jsx)(eg.X,{defaultChecked:null==h?void 0:h.isSubscribed,checked:x,onChange:function(e){return v(e.currentTarget.checked)},id:"subscribe",name:"subscribe",mt:"1",colorScheme:"orange"})]}),(0,i.jsxs)(er.U,{mt:9,alignItems:"end",w:"full",justifyContent:"end",spacing:3,children:[(0,i.jsx)(H.k,{type:"button",isDisabled:g,onClick:a,borderRadius:"md",children:Z.I.common.shared.cancel}),(0,i.jsx)(H.K,{isLoading:y.isLoading,type:"submit",borderRadius:"md",isDisabled:x===(null==h?void 0:h.isSubscribed),children:Z.I.common.shared.save})]})]})})]})]}):null}function e_(e){return(0,i.jsx)(W,{label:e.label,rounded:"md",children:(0,i.jsx)(A.h,{"aria-label":e.label,icon:(0,i.jsx)(J.dY,{w:{base:3,md:4},h:{base:3,md:4}}),background:"gray.25",color:"black",_hover:{bg:"gray.50"},_active:{bg:"gray.50"},minW:{base:8,md:10},h:{base:8,md:10},aspectRatio:"1",lineHeight:1,p:0,onClick:e.onClick})})}var eI=function(e){var n,t,r=e.session,s=(0,m.q)(),a=(0,m.q)(),u=(0,m.q)(),c=(0,M.Dp)(X.main,{enabled:!!(null==r?void 0:null===(n=r.user)||void 0===n?void 0:n.email),suspense:!0}),p=c.data;return c.isLoading,c.isRefetching,(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eh,{isOpen:s.isOpen,onOpen:s.onOpen,onClose:s.onClose}),(0,i.jsx)(eu,{isOpen:u.isOpen,onOpen:u.onOpen,onClose:u.onClose}),(0,i.jsx)(ej,{isOpen:a.isOpen,onOpen:a.onOpen,onClose:a.onClose}),(0,i.jsxs)(l.g,{spacing:4,alignItems:"start",children:[(0,i.jsxs)(_,{role:"group",_groupHover:{bg:"gray.50"},children:[(0,i.jsx)(I,{fontSize:{base:"small",md:"medium"},children:Z.I.pages.myProfile.eMail}),(0,i.jsxs)(C,{fontSize:{base:"large",md:"2xl"},children:[r.user.email," ",(0,i.jsx)(e_,{label:Z.I.pages.myProfile.editEmail,onClick:s.onOpen})]})]}),(0,i.jsxs)(_,{children:[(0,i.jsx)(I,{fontSize:{base:"small",md:"medium"},children:"Telefonnummer"}),(0,i.jsx)(C,{fontSize:{base:"large",md:"2xl"},children:null!==(t=r.user.mobile)&&void 0!==t?t:"-"})]}),(0,i.jsxs)(_,{children:[(0,i.jsx)(I,{fontSize:{base:"small",md:"medium"},children:"Nyhetsbrev"}),(0,i.jsxs)(C,{fontSize:{base:"large",md:"2xl"},children:[(null==p?void 0:p.isSubscribed)?"Ja":"Nei"," ",(0,i.jsx)(e_,{label:Z.I.pages.myProfile.subscriptions.editButton,onClick:a.onOpen})]})]})]}),(0,i.jsxs)(l.g,{mt:"24",spacing:4,alignItems:"center",mx:"auto",children:[(0,i.jsx)(d.X,{children:Z.I.pages.myProfile.deleteUserHeading}),(0,i.jsx)(o.x,{children:Z.I.pages.myProfile.deleteUserDialogInfo}),(0,i.jsx)(H.k,{onClick:u.onOpen,children:Z.I.pages.myProfile.deleteData})]})]})},eC=t(3458),ek=t(11163),ew=!0;function eS(e){var n=e.footerData,t=e.menuData;e.stores;var m=(0,ei.useSession)(),f=m.data,h=m.status;(0,ek.useRouter)();var g=(0,r._)((0,T.useState)("orders"),2);g[0],g[1],(0,T.useEffect)(function(){(null==f?void 0:f.error)==="RefreshAccessTokenError"&&(0,ei.signIn)("azure-ad-b2c",{callbackUrl:window.location.href})},[f,h]);var b=null;return b="loading"===h?(0,i.jsx)(s.M,{minH:"xs",mx:"auto",children:(0,i.jsx)(a.$,{})}):"authenticated"===h?(0,i.jsx)(eI,{session:f}):(0,i.jsxs)(l.g,{alignItems:"center",id:"main",children:[(0,i.jsx)(o.x,{children:Z.I.pages.myProfile.logInToEnterThePage}),(0,i.jsx)(u.z,{onClick:function(){(0,ei.signIn)("azure-ad-b2c")},colorScheme:"tertiary",color:"black",borderRadius:"md",children:(0,i.jsx)(c.xu,{as:"span",children:Z.I.pages.myProfile.logIn})})]}),(0,i.jsxs)(eC.Z,{menuData:t,footerData:n,children:[(0,i.jsx)(p.H,{title:Z.I.common.header.myPage}),(0,i.jsxs)(l.g,{spacing:12,alignItems:"start",id:"main",w:"full",mx:"auto",maxW:"xl",pt:{base:8,md:16},children:[(0,i.jsx)(d.X,{size:{base:"2xl",lg:"3xl"},textAlign:"center",mx:"auto",children:Z.I.pages.myProfile.myDetails}),b]})]})}},5418:function(e,n,t){"use strict";t.d(n,{l:function(){return c}});var r=t(85970),i=t(16554),s=t(77030),a=t(33179),l=t(56534),o=t(25432),u=t(85893),c=(0,i.G)(function(e,n){var t;let i=(0,s.mq)("FormLabel",e),c=(0,a.Lr)(e),{className:p,children:m,requiredIndicator:f=(0,u.jsx)(d,{}),optionalIndicator:h=null,...g}=c,b=(0,r.NJ)(),x=null!=(t=null==b?void 0:b.getLabelProps(g,n))?t:{ref:n,...g};return(0,u.jsxs)(l.m.label,{...x,className:(0,o.cx)("chakra-form__label",c.className),__css:{display:"block",textAlign:"start",...i},children:[m,(null==b?void 0:b.isRequired)?f:h]})});c.displayName="FormLabel";var d=(0,i.G)(function(e,n){let t=(0,r.NJ)(),i=(0,r.e)();if(!(null==t?void 0:t.isRequired))return null;let s=(0,o.cx)("chakra-form__required-indicator",e.className);return(0,u.jsx)(l.m.span,{...null==t?void 0:t.getRequiredIndicatorProps(e,n),__css:i.requiredIndicator,className:s})});d.displayName="RequiredIndicator"},27239:function(e,n,t){"use strict";t.d(n,{M:function(){return a},u:function(){return o}});var r=t(56534),i=t(16554),s=t(85893),a=(0,r.m)("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});a.displayName="Center";var l={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}},o=(0,i.G)(function(e,n){let{axis:t="both",...i}=e;return(0,s.jsx)(r.m.div,{ref:n,__css:l[t],...i,position:"absolute"})})}},function(e){e.O(0,[8478,4038,2962,4954,8076,9803,9774,2888,179],function(){return e(e.s=97087)}),_N_E=e.O()}]);