1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4c823bbd-c2c7-4f33-a4bd-4f8b08628838",e._sentryDebugIdIdentifier="sentry-dbid-4c823bbd-c2c7-4f33-a4bd-4f8b08628838")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[509],{22297:function(e,n,t){"use strict";var r=t(85893);t(67294);var a=t(93967),o=t.n(a),l=t(81076),s=t.n(l);n.Z=e=>{let{children:n,className:t}=e;return(0,r.jsx)("main",{className:o()(s().root,t),children:n})}},69463:function(e,n,t){"use strict";t.d(n,{OK:function(){return _},mQ:function(){return m},x4:function(){return h}});var r=t(85893),a=t(67294),o=t(93967),l=t.n(o),s=t(97718),c=t(54502),i=t.n(c);let d=a.createContext({}),u=()=>a.useContext(d),m=e=>{let{value:n,onChange:t,children:o,...l}=e,s=a.Children.toArray(o);return(0,r.jsx)(d.Provider,{value:{value:n,onChange:t},children:(0,r.jsx)("div",{...l,className:i().tabs,children:a.Children.map(s,(e,n)=>a.cloneElement(e,{index:n}))})})},_=e=>{let{label:n,index:t}=e,a=u();if(null==a.value||null==a.onChange)throw Error("<Tab>: This component has to be wrapped with <Tabs>");let{onChange:o,value:c}=a;return(0,r.jsx)("button",{className:l()(i().tab,{[i().activeTab]:t===c}),onClick:()=>null!=t&&o(t),children:(0,r.jsx)(s.Z,{children:n})})},h=e=>{let{children:n,value:t,index:a}=e;return a===t?(0,r.jsx)(r.Fragment,{children:n}):null};n.ZP=m},44528:function(e,n,t){"use strict";var r=t(85893),a=t(67294),o=t(93967),l=t.n(o),s=t(31191),c=t.n(s);n.Z=(0,a.memo)(e=>{let{delay:n=400,children:t,content:o,direction:s="top",className:i,active:d=!1,...u}=e,[m,_]=(0,a.useState)(d),h=(0,a.useRef)(null),p=(0,a.useCallback)(()=>{null!=h.current&&clearTimeout(h.current)},[]);(0,a.useEffect)(()=>{null!=d&&_(d)},[d]),(0,a.useEffect)(()=>()=>p(),[p]);let x=(0,a.useCallback)(()=>{p(),_(!0)},[p,_]),j=(0,a.useCallback)(()=>{h.current=setTimeout(()=>_(!1),n)},[_,n]);return(0,r.jsxs)("div",{className:c().root,onMouseEnter:x,onMouseLeave:j,children:[t,m&&(0,r.jsx)("div",{"aria-label":"Hj\xe4lptext",role:"tooltip",className:l()(c().tip,c()[s],i),...u,children:o})]})})},74453:function(e,n,t){"use strict";var r,a,o,l,s,c,i,d;t.d(n,{C$:function(){return o},kY:function(){return l},m6:function(){return a},wk:function(){return r}}),(s=r||(r={})).PROJECT="PROJECT",s.NONE="NONE",(c=a||(a={})).CREATE_OFFER="CREATE_OFFER",c.OFFER_FROM_STORE="OFFER_FROM_STORE",c.ORDER_FROM_STORE="ORDER_FROM_STORE",(i=o||(o={})).INSTANT="INSTANT",i.CHOOSE="CHOOSE",(d=l||(l={})).OTHER="OTHER",d.CUSTOMER_ADDRESS="CUSTOMER_ADDRESS",d.PICKUP="PICKUP"},68372:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return C}});var r,a,o=t(85893),l=t(67294),s=t(79655),c=t(12599),i=t(55678),d=t(43285),u=t(75197),m=t(51648),_=t(69463),h=t(97718),p=t(347),x=t(44836),j=t(95012),f=t(76137),b=t(31134),v=t(4512),g=t(61039),Z=t(60587),E=t(97852);(r=a||(a={})).ORDER="order",r.DOCUMENTS="documents";var C=(0,f.F7)(e=>{let{data:n}=e,[t,r]=(0,l.useState)(),f="Order #".concat(n.number),C=n.customer_project,{store:D}=(0,p.o)(),[T,O]=(0,s.lr)(),N=(0,l.useCallback)(async()=>{try{let{data:e}=await (0,d.Ec)({external_id:D.external_id,order_id:n.id,page_size:200}),t=n.confirm_document_uri,a={...n,attachments:e.results,confirmDocument:t?{confirm_document_uri:t}:void 0};a.attachments.length>0&&r(a)}catch(n){console.error(n);let e=x.v_;i.Am.error((0,o.jsx)(h.Z,{children:e}))}},[D.external_id,n]),{isEndCustomer:R}=(0,g.Iw)();(0,l.useEffect)(()=>{R||N()},[N,R]);let w=(0,l.useMemo)(()=>[{name:a.ORDER,node:x.D8,component:(0,o.jsx)(Z.Z,{project:C,fullOrder:n},1)},...t?[{name:a.DOCUMENTS,node:x.x0,component:(0,o.jsx)(E.Z,{order:t},2)}]:[]].filter(e=>{let{name:n}=e;return!R||n!==a.ORDER}),[R,C,t,n]),k=T.get("tab"),y=(0,l.useMemo)(()=>w.findIndex(e=>{let{name:n}=e;return n===k}),[w,k]),S=y>-1?y:0,I=(0,l.useCallback)(e=>{O({tab:w[e].name})},[w,O]);return(0,o.jsxs)(v.Z,{breadcrumbsProps:{alterCurrentRoute:e=>({...e,name:f})},children:[(0,o.jsx)(m.Z,{children:(0,o.jsx)(b.Z,{actions:C?(0,o.jsx)(s.rU,{to:(0,c.Gn)(j.$.PROJECT,{id:C.id}),children:(0,o.jsx)(h.Z,{underline:!0,children:l.cloneElement(x.mj,{id:C.name?"".concat(C.number," - ").concat(C.name):C.number})})}):void 0,heading:f})}),(0,o.jsx)(u.Z,{padding:"top-extra",component:"section",children:(0,o.jsx)(m.Z,{children:(0,o.jsx)(_.ZP,{value:S,onChange:I,children:w.map((e,n)=>(0,o.jsx)(_.OK,{label:e.node},n))})})}),(0,o.jsx)(u.Z,{padding:"bottom-only",component:"section",children:(0,o.jsx)(m.Z,{children:w.map((e,n)=>{let{component:t,name:r}=e;return(0,o.jsx)(_.x4,{value:S,index:n,children:t},r)})})})]})},async e=>{let{storeCtx:n,params:t}=e;try{let{store:e}=n,{data:r}=await (0,d.co)(e.external_id,t.id);return Object.values(r).length?{data:r}:{notFound:!0}}catch(e){return{notFound:!0}}})},93861:function(e,n,t){"use strict";var r,a;t.d(n,{Z:function(){return r}}
1),(a=r||(r={})).QUOTES="quotes",a.ORDERS="orders",a.IMAGES="images",a.DOCUMENTS="documents",a.INVOICES="invoices",a.CUSTOMER="customer",a.CONTACTS="contacts",a.ADDRESSES="addresses"},29235:function(e,n,t){"use strict";var r=t(85893),a=t(67294),o=t(70076);n.Z=(0,a.memo)(e=>{let{actions:n}=e;return(0,r.jsx)("ul",{"aria-label":"\xc5tg\xe4rder",children:n.map((e,n)=>{let{label:t,onClick:a,icon:l,disabled:s,...c}=e;return(0,r.jsx)("li",{children:(0,r.jsx)(o.Z,{disabled:s,"aria-disabled":s,color:"transparent",variant:"text",icon:l,iconPlacement:"before",onClick:e=>{e.stopPropagation(),null==a||a(e)},...c,children:t})},n)})})})},86237:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var r,a=t(85893),o=t(67294),l=t(82383),s=t(64536);function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}let i=(0,o.memo)(e=>o.createElement("svg",c({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=o.createElement("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z",fill:"currentColor"}))));var d=t(17394),u=t.n(d),m=e=>{let{content:n}=e;return(0,a.jsx)(s.Z,{content:(0,a.jsx)(l.Z,{className:u().paper,children:n}),children:e=>{let{toggle:n}=e;return(0,a.jsx)("button",{onClick:n,className:u().button,children:(0,a.jsx)(i,{})})}})}},91678:function(e,n,t){"use strict";t.d(n,{AU:function(){return p},K8:function(){return j},QT:function(){return h},Ux:function(){return f},WP:function(){return x},ZV:function(){return v},hP:function(){return b}});var r=t(85893),a=t(67294),o=t(93967),l=t.n(o),s=t(82383),c=t(82905),i=t(97718),d=t(26021),u=t(16861),m=t.n(u);let _=(0,a.forwardRef)(function(e,n){let{children:t,className:o,onClick:c,...i}=e,d=(0,a.useCallback)(e=>{" "===e.key&&c&&c()},[c]);return(0,r.jsx)(s.Z,{component:"article",...i,ref:n,onKeyDown:d,onClick:c,tabIndex:0,className:l()(m().paper,o),children:t})}),h=(0,a.memo)(_),p=(0,a.memo)(e=>{let{className:n,value:t,...a}=e;return(0,r.jsx)("li",{className:l()(n),...a,children:(0,r.jsx)(i.Z,{children:null!=t?t:"â"})})}),x=(0,a.memo)(e=>{let{className:n,title:t,value:a,valueClassName:o,...s}=e;return(0,r.jsxs)("li",{className:l()(m().row,n),...s,children:[(0,r.jsx)(i.Z,{className:m().grey,children:t}),(0,r.jsx)(i.Z,{className:l()(m().value,o),children:null!=a?a:"â"})]})}),j=(0,a.memo)(e=>{let{children:n,className:t="",extraPaddingTop:a,noBorderBottom:o=!1,row:s,fullWidth:c=!1,...i}=e;return(0,r.jsx)("section",{...i,className:l()(t,m().block,o?m().noBorderBottom:"",{[m().fullBlockWidth]:c}),children:(0,r.jsx)("ul",{className:l()(m().blockInner,{[m().row]:s,[m().extraPaddingTop]:a}),children:n})})}),f=(0,a.memo)(e=>{let{vatExcluded:n,vatIncluded:t,discount:a}=e;return(0,r.jsxs)("article",{"aria-label":"Summering",className:m().totals,children:[a&&(0,r.jsxs)("section",{className:m().row,children:[(0,r.jsx)(i.Z,{children:"Rabatt"}),(0,r.jsx)(i.Z,{bold:!0,children:(0,d.IU)(a)})]}),(0,r.jsxs)("section",{className:m().row,children:[(0,r.jsx)(i.Z,{children:"Ex. moms"}),(0,r.jsx)(i.Z,{bold:!0,children:(0,d.IU)(n)})]}),t&&(0,r.jsxs)("section",{className:m().row,children:[(0,r.jsx)(i.Z,{children:"Inkl. moms"}),(0,r.jsx)(i.Z,{bold:!0,children:(0,d.IU)(t)})]})]})}),b=(0,a.memo)(e=>{let{title:n,subtitle:t,widget:a=null}=e;return(0,r.jsxs)("header",{className:m().header,children:[(0,r.jsxs)("section",{children:[(0,r.jsx)(i.Z,{block:!0,children:n}),t&&(0,r.jsx)(i.Z,{block:!0,className:m().grey,children:t})]}),a]})}),v=(0,a.memo)(()=>(0,r.jsx)("article",{className:m().spinner,children:(0,r.jsx)(c.Z,{size:24})}))},12276:function(e,n,t){"use strict";t.d(n,{r:function(){return m}});var r=t(85893),a=t(67294),o=t(44528),l=t(97718),s=t(44836),c=t(39671),i=t(73783),d=t(51312),u=t.n(d);let m=e=>{let{invalidDocs:n=!1}=e;return(0,r.jsxs)("section",{className:u().caption,children:[(0,r.jsx)(l.Z,{variant:"overline",children:s.ud}),(0,r.jsx)(l.Z,{variant:"overline",children:n?s.O:s.Qh})]})},_=e=>
1[e.display_name,e.product_name].filter(Boolean).join(", ");n.Z=(0,a.memo)(e=>{var n;let{attachment:t}=e;return(0,r.jsxs)("a",{target:"_blank",href:null!==(n=t.url)&&void 0!==n?n:void 0,className:u().attachment,rel:"noreferrer","aria-disabled":null==t.url,children:[(0,r.jsxs)(l.Z,{className:u().typeDescription,children:[_(t),(0,r.jsx)("span",{className:u().parenthesis,children:"PDF"})]}),(0,r.jsxs)("span",{className:u().date,children:[null==t.deleted_at?(0,r.jsx)(l.Z,{children:(0,c.cK)(new Date(t.created_at))}):(0,r.jsx)(l.Z,{children:(0,c.cK)(new Date(t.deleted_at))}),null==t.url&&(0,r.jsx)(o.Z,{className:u().missingTooltip,delay:0,direction:"left",content:"Dokument inte tillg\xe4ngligt f\xf6r tillf\xe4llet",children:(0,r.jsx)(i.Z,{className:u().toolTipIcon})})]})]})})},31134:function(e,n,t){"use strict";var r=t(85893);t(67294);var a=t(93967),o=t.n(a),l=t(75197),s=t(97718),c=t(85150),i=t.n(c);n.Z=e=>{let{heading:n,actions:t,lower:a,border:c=!0}=e;return(0,r.jsxs)(l.Z,{padding:"less",component:"header",className:o()(i().root,c&&i().hasBorder),children:[(0,r.jsxs)("section",{className:i().row,children:[n&&(0,r.jsx)(s.Z,{variant:"superheading",children:n}),t&&(0,r.jsx)("section",{className:i().actions,children:t})]}),a&&(0,r.jsx)("section",{children:a})]})}},4512:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(85893);t(67294);var a=t(75197),o=t(51648),l=t(22297),s=t(89250),c=t(12599),i=t(79655),d=t(35293),u=t(76137),m=t(61039),_=e=>{let{alterCurrentRoute:n,omitRoutes:t,...a}=e,{routes:o,flattenedRoutes:l}=(0,m.Iw)(),_=(0,s.TH)(),h=(0,s.UO)(),p=Object.entries(h),x=o.map(e=>(0,u.M6)(e)),j=(0,u.tO)(x).filter(e=>{let{path:n}=e;return(0,c.LX)(n,_.pathname)}).find(e=>{var n;let[,t=""]=null!==(n=e.path.match(/:([a-z,A-Z]+)/))&&void 0!==n?n:[];return p.length?null!=h[t]:!t});j&&n&&(j=n(j));let f=j?[...j.breadcrumbs,j]:[],b=(null==t?void 0:t.length)?f.filter(e=>!(null==t?void 0:t.includes(e.path))):f;return(0,r.jsx)(d.Z,{...a,children:b.map((e,n)=>l.some(n=>n.path===e.path)?(0,r.jsx)(i.rU,{to:(0,c.Gn)(e.path,h),children:e.name},n):null)})},h=t(60280),p=t.n(h),x=e=>{let{children:n,breadcrumbsProps:t={}}=e;return(0,r.jsxs)(l.Z,{className:p().root,children:[(0,r.jsx)(o.Z,{component:"section",children:(0,r.jsx)(a.Z,{padding:"less",children:(0,r.jsx)(_,{...t,desktopOnly:!1})})}),n]})}},97852:function(e,n,t){"use strict";t.d(n,{Z:function(){return D}});var r=t(85893),a=t(67294),o=t(89250),l=t(55678),s=t(93967),c=t.n(s),i=t(43285),d=t(15160),u=t(75197),m=t(97718),_=t(84707),h=t(53259),p=t.n(h),x=e=>{let{heading:n,initExpand:t=!1,className:o,children:l}=e,[s,i]=(0,a.useState)(t);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:()=>i(!s),className:c()(p().toggleHeading,o),children:[(0,r.jsx)(m.Z,{bold:!0,children:n}),(0,r.jsx)(_.Z,{className:c()(p().chevron,{[p().rotateChevron]:s})})]}),s&&l]})},j=t(347),f=t(44836),b=t(90987),v=t(2155),g=t(91678),Z=t(12276),E=t(750),C=t.n(E),D=(0,a.memo)(e=>{var n;let{order:t}=e,s=(0,a.useMemo)(()=>t.attachments.some(e=>null!=e.url),[t.attachments]),{store:_}=(0,j.o)(),h=(0,a.useMemo)(()=>[...t.attachments],[t.attachments]),p=(0,o.TH)().pathname.includes("ordrar"),E=(0,a.useMemo)(()=>h.reduceRight((e,n,t)=>(null!=n.deleted_at&&(h.splice(t,1),e.unshift(n)),e),[]),[h]),D=!!E.length,T=(0,a.useCallback)(async()=>{try{await (0,i.lG)({external_id:_.external_id,order_id:t.id}),l.Am.success((0,r.jsx)(m.Z,{children:"Export av orderns dokument har p\xe5b\xf6rjats. N\xe4r den \xe4r f\xe4rdig f\xe5r du en l\xe4nk till din e-postadress."}))}catch(e){l.Am.error((0,r.jsx)(m.Z,{children:"Ett fel intr\xe4ffade vid export av orderns dokument."}))}},[t.id,_.external_id]),O=null===(n=t.confirmDocument)||void 0===n?void 0:n.confirm_document_uri,N=(0,a.useMemo)(()=>O?(0,r.jsx)("button",{className:C().button,type:"button",onClick:async e=>{e.stopPropagation();try{let e=await (0,i.F0)(O,{consumeResponse:!1}),n=(0,d.By)(e,"ordererk\xe4nnande.pdf"),t=await e.blob();(0,b.Z)(t,n)}catch(n){console.error(n);let e=f.z;l.Am.error((0,r.jsx)(m.Z,{children:e}))}},children:(0,r.jsx)("span",{className:C().attachment,children:(0,r.jsx)("span",{children:f.BR})})}):null,[O]),R=(0,r.jsxs)("button",{className:C().download,onClick:T,children:[(0,r.jsx)(v.Z,{}),(0,r.jsx)(m.Z,{children:"Ladda ned dokument"})]});return(0,r.jsx)(g.QT,{className:c()(C().paper),children:(0,r.jsxs)(x,{heading:(0,a.cloneElement)(f.MO,{orderID:t.number}),...p?{initExpand:!0}:{},children:[h.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Z.r,{}),N,h.map((e,n)=>(0,r.jsx)(Z.Z,{attachment:e},n))]}):(0,r.jsx)(u.Z,{padding:"less",children:(0,r.jsx)(m.Z,{variant:"p",children:f.yd})}),D&&(0,r.jsxs)(x,{heading:(0,a.cloneElement)(f.tD,{orderID:t.number}),className:C().invalidDocumentsToggle,children:[(0,r.jsx)(Z.r,{invalidDocs:!0}),E.map((e,n)=>(0,r.jsx)(Z.Z,{attachment:e},n))]}),s&&R]})})})},81076:function(e){e.exports={root:"Content_root__zWkMT"}},53259:function(e){e.exports={toggleHeading:"Select_toggleHeading__HBDWN",chevron:"Select_chevron__OreEa",rotateChevron:"Select_rotateChevron__cMmTQ"}},54502:function(e){e.exports={tabs:"Tabs_tabs__tVXxO",tab:"Tabs_tab__HeYbT",activeTab:"Tabs_activeTab__NVaYW"}},31191:function(e){e.exports={root:"Tooltip_root__LF3Aw",tip:"Tooltip_tip__SJEri",top:"Tooltip_top__BrmCG",right:"Tooltip_right__gEabb",bottom:"Tooltip_bottom__hwixB",left:"Tooltip_left__O2U2F"}}
1,17394:function(e){e.exports={paper:"StyledPopover_paper__QFolU",button:"StyledPopover_button__q2N0q"}},16861:function(e){e.exports={paper:"DataCard_paper__rRvFC",noBorderBottom:"DataCard_noBorderBottom__DHJps",block:"DataCard_block__d_R1N",fullBlockWidth:"DataCard_fullBlockWidth__VUi6C",blockInner:"DataCard_blockInner__p0q7y",row:"DataCard_row__sHzRH",extraPaddingTop:"DataCard_extraPaddingTop__dE8oq",totals:"DataCard_totals__Qv_3H",grey:"DataCard_grey__sm7k4",header:"DataCard_header__Z4sdF",spinner:"DataCard_spinner__MoUaa",value:"DataCard_value__EP_V1"}},51312:function(e){e.exports={attachment:"DocumentRow_attachment__B__Il",typeDescription:"DocumentRow_typeDescription__IPfBz",date:"DocumentRow_date___m6Cs",parenthesis:"DocumentRow_parenthesis__wnn6G",caption:"DocumentRow_caption__0nVuU",missingTooltip:"DocumentRow_missingTooltip__PclHT",toolTipIcon:"DocumentRow_toolTipIcon__C_l0I"}},85150:function(e){e.exports={root:"Header_root__E2EgY",row:"Header_row__ZqhGC",hasBorder:"Header_hasBorder__VEGbv",heading:"Header_heading__xl3w4",actions:"Header_actions__2bcOs"}},60280:function(e){e.exports={root:"Layout_root__2Ecup"}},750:function(e){e.exports={paper:"OrderDocuments_paper__eVEUW",invalidDocumentsToggle:"OrderDocuments_invalidDocumentsToggle__tlWMk",download:"OrderDocuments_download__lrjph"}}}]); 2//# sourceMappingURL=509.654e33ae663fc98b.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.