1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="25901659-eff1-4b79-80f9-cb0599d152d3",e._sentryDebugIdIdentifier="sentry-dbid-25901659-eff1-4b79-80f9-cb0599d152d3")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"4c5d49290a4faf3eb4f91fa2360861920d8b3436"},(self.webpackChunkmeasur_website=self.webpackChunkmeasur_website||[]).push([[887],{1900:function(e,t,a){a.d(t,{i:function(){return o}});var n=a(21988),r=a(96540),l=a(79142);let i;const o=()=>{const{getAccessTokenSilently:e}=(0,n.WB)(),{0:t,1:a}=(0,r.useState)();return void 0===i&&(i=(0,l.rM)(e)),i.then((e=>{"expert"===(null==e?void 0:e.role)!==t&&a("expert"===(null==e?void 0:e.role))})),{expertAccess:t}}},18341:function(e,t,a){a.d(t,{A:function(){return u}});var n=a(62061),r=a(46942),l=a.n(r),i=a(50180),o=a(2642);function s(e){return+(0,o.a)(e)<Date.now()}var c=a(96540),d=a(45725),m=a(43528);var u=({order:{createdAt:e,ownerName:t,price:a,completedAt:r,estimatedCompletion:o,currency:u,status:p},className:E,...g})=>{const{i18n:f}=(0,n.uB)();return c.createElement("div",Object.assign({className:l()("flex flex-col flex-wrap gap-x-10 gap-y-3 whitespace-nowrap md:flex-row",E)},g),c.createElement("span",null,c.createElement(n.x6,{id:"common.createdAt"})," ",c.createElement("time",{dateTime:e},(0,i.GP)(new Date(e),(0,d.eW)(f.locale)))),c.createElement("span",null,c.createElement(n.x6,{id:"portal.owner"}),": ",t),"completed"===p?c.createElement("span",null,c.createElement("strong",null,(0,d.UN)(a,f.locale,u))," ","(",c.createElement(n.x6,{id:"pricing.noVat"}),")"):null,c.createElement("div",{className:"space-x-5"},c.createElement(m.A,{status:p}),"completed"===p&&r?c.createElement("time",{dateTime:r},c.createElement(n.x6,{id:"portal.completedAt"}),"Â ",(0,i.GP)(new Date(r),(0,d.eW)(f.locale))):o?c.createElement("time",{dateTime:o},c.createElement(n.x6,{id:"portal.estimatedCompletion"}),":"," ",s(new Date(o))?c.createElement(n.x6,{id:"portal.soon"}):(0,i.GP)(new Date(o),(0,d.eW)(f.locale))):null))}},21426:function(e,t,a){a.d(t,{A:function(){return l}});var n=a(96540),r=a(14348);class l extends r.A{render(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M13.3333 2.5H0.833336V13.3333H13.3333V2.5Z",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M13.3333 6.66666H16.6667L19.1667 9.16666V13.3333H13.3333V6.66666Z",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M4.58333 17.5C5.73393 17.5 6.66667 16.5673 6.66667 15.4167C6.66667 14.2661 5.73393 13.3333 4.58333 13.3333C3.43274 13.3333 2.5 14.2661 2.5 15.4167C2.5 16.5673 3.43274 17.5 4.58333 17.5Z",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M15.4167 17.5C16.5673 17.5 17.5 16.5673 17.5 15.4167C17.5 14.2661 16.5673 13.3333 15.4167 13.3333C14.2661 13.3333 13.3333 14.2661 13.3333 15.4167C13.3333 16.5673 14.2661 17.5 15.4167 17.5Z",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}))}}},26488:function(e,t,a){var n=a(62061),r=a(96540),l=a(15696),i=a(9575),o=a(48557),s=a(55370);t.A=({samples:e,sampleFields:t})=>{const{i18n:a}=(0,n.uB)();return r.createElement("div",{className:"w-full overflow-auto"},r.createElement("table",{className:"text-base"},r.createElement("thead",null,r.createElement("tr",{className:"text-left"},r.createElement("th",{className:"p-2"},"#"),r.createElement("th",{className:"p-2"},r.createElement(n.x6,{id:"portal.order.sampleTable.heading.name"})),r.createElement("th",{className:"p-2"},r.createElement(n.x6,{id:"portal.order.sampleTable.heading.details"})),r.createElement("th",{className:"p-2"},r.createElement(n.x6,{id:"portal.order.sampleTable.heading.note"})),r.createElement("th",{className:"p-2"},r.createElement(n.x6,{id:"portal.order.sampleTable.heading.tests"})))),r.createElement("tbody",{className:"sample-row"},0===e.length?r.createElement("tr",null,r.createElement("td",{className:"center py-3 text-primary-dark",colSpan:7},r.createElement(n.x6,{id:"portal.order.sampleTable.noSamplesAdded"}))):null,e.map(((e,c)=>r.createElement("tr",{key:`sample-${c}`,className:"border-t border-gray-300"},r.createElement("td",{className:"p-2"},c+1),r.createElement("td",{className:"p-2"},e.name||"-"),r.createElement("td",{className:"p-2"},r.createElement(s.I,{customFieldValues:e.sampleFields,customFields:t,locale:a.locale})),r.createElement("td",{className:"p-2"},e.note.split(/(?:\r?\n)+/).map(((e,t)=>r.createElement(r.Fragment,{key:t},t>0&&r.createElement("br",null),e)))||"-"),r.createElement("td",{className:"p-2"},r.createElement("div",{className:"flex flex-col gap-2"},0===e.products.length?r.createElement("div",{className:"w-fit roun
1ded-lg bg-orange-200 px-2 py-0.5"},r.createElement(n.x6,{id:"portal.order.sampleTable.noTestsSelected"})):e.products.map((e=>r.createElement("div",{key:e.id},r.createElement("p",null,e.name||"-"," ",r.createElement(o.l,{price:e.price,currency:e.currency,basis:e.basis,orderQuantity:e.quantity,volumeDiscounts:e.volumeDiscounts})),e.includedTests&&r.createElement(i.sD,{renderText:(0,l.S5)(l.UE,l.Mi),isCompact:!0},JSON.stringify(e.includedTests)))))))))))))}},34753:function(e,t,a){var n=a(62061),r=a(64810),l=a(25983);t.A=e=>{var t;const{i18n:a}=(0,n.uB)(),{employees:i,teamMembers:o,teamMemberPageLinks:s}=(0,r.useStaticQuery)("2269285845");return null!==(t=i.nodes.map((e=>(0,l.Vv)(o.nodes,e.employeeData,s.nodes,a.locale))).find((t=>(null==t?void 0:t.email)===e)))&&void 0!==t?t:null}},42826:function(e,t,a){a.d(t,{A:function(){return l}});var n=a(96540),r=a(14348);class l extends r.A{render(){return n.createElement("svg",Object.assign({width:"20",height:"20",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},this.props),n.createElement("path",{d:"M15 10.8333V15.8333C15 16.2754 14.8244 16.6993 14.5118 17.0118C14.1993 17.3244 13.7754 17.5 13.3333 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V6.66667C2.5 6.22464 2.67559 5.80072 2.98816 5.48816C3.30072 5.17559 3.72464 5 4.16667 5H9.16667",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M12.5 2.5H17.5V7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M8.33334 11.6667L17.5 2.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}))}}},43528:function(e,t,a){var n=a(62061),r=a(96540);const l={analysisInProgress:{id:"portal.orderStatus.analysisInProgress"},completed:{id:"portal.orderStatus.completed"},draft:{id:"portal.orderStatus.draft"},offerProvided:{id:"portal.orderStatus.offerProvided"},samplesReceived:{id:"portal.orderStatus.samplesReceived"},submitted:{id:"portal.orderStatus.submitted"},waitingForReview:{id:"portal.orderStatus.waitingForReview"},waitingForSamples:{id:"portal.orderStatus.waitingForSamples"}};t.A=({status:e})=>{const{i18n:t}=(0,n.uB)();return r.createElement("span",{className:`orderStatus orderStatus--${e}`},t._(l[e]))}},46663:function(e,t,a){a.d(t,{A:function(){return l}});var n=a(96540),r=a(14348);class l extends r.A{render(){return n.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},this.props),n.createElement("path",{d:"M17.5 12.5V15.8333C17.5 16.2754 17.3244 16.6993 17.0118 17.0118C16.6993 17.3244 16.2754 17.5 15.8333 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V12.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M5.83334 8.33333L10 12.5L14.1667 8.33333",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M10 12.5V2.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}))}}},47521:function(e,t,a){a.d(t,{D:function(){return u}});var n=a(21988),r=a(62061),l=a(64251),i=a(96540),o=a(79142),s=a(81366),c=a(34033),d=a(46663),m=a(42299);const u=({disabled:e,orderSubmissionId:t,dealId:a,onError:u,...p})=>{const{i18n:E}=(0,r.uB)(),{getAccessTokenSilently:g}=(0,n.WB)(),{0:f,1:v}=(0,i.useState)(s.XB.NONE);return i.createElement(c.A,Object.assign({},p,{onClick:async()=>{if(f!==s.XB.LOADING){v(s.XB.LOADING);try{void 0!==t?await(0,o.B_)(t,E.locale,g):await(0,o.B1)(a,E.locale,g),v(s.XB.NONE)}catch(e){l.Cp(e,(e=>(e.setExtra("data",{dealId:a,orderSubmissionId:t}),e))),v(s.XB.ERROR),u&&u(i.createElement(r.x6,{id:"portal.order.downloadCoverSheet.error",components:{link:i.createElement("a",{href:"mailto:[email protected]"})}}))}}}}),f===s.XB.LOADING?i.createElement(m.A,null):i.createElement(d.A,null),i.createElement(r.x6,{id:"portal.order.downloadCoverSheet.label"}))}},62514:function(e,t,a){var n=a(96540);t.A=e=>n.createElement("svg",Object.assign({width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n.createElement("path",{d:"M10 17.1665H17.5",stroke:"#0013C1",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M13.75 3.41669C14.0815 3.08517 14.5312 2.89893 15 2.89893C15.2321 2.89893 15.462 2.94465 15.6765 3.03349C15.891 3.12233 16.0858 3.25254 16.25 3.41669C16.4142 3.58084 16.5444 3.77572 16.6332 3.9902C16.722 4.20467 16.7678 4.43455 16.7678 4.66669C16.7678 4.89884 16.722 5.12871 16.6332 5.34319C16.5444 5.55766 16.4142 5.75254 16.25 5.91669L5.83333 16.3334L2.5 17.1667L3.33333 13.8334L13.75 3.41669Z",stroke:"#0013C1",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}))},73359:function(e,t,a){var n=a(21988),r=a(62061),l=a(63064),i=a(21154),o=a(64810),s=a(96540),c=a(1900),d=a(79142),m=a(77722),u=a(34033);t.A=({orderId:e})=>{const{i18n:t}=(0,r.uB)(),{getAccessTokenSilently:a}=(0,n.WB)(),p=(0,l.jE)(),{expertAccess:E}=(0,c.i)(),{mutate:g,isLoading:f}=(0,i.n)((()=>(0,d.c0)(a,e,t.locale)),{onSuccess:e=>{p.invalidateQueries([d.i$]),(0,o.navigate)((0,m.nb)(m.xM.samplesAndTests,t.locale,e.id))}});return s.createElement(u.A,{onClick:()=>g(),disabled:E,isLoading:f},s.createElement(r.x6,{id:"portal.order.orderAgain"}))}},73875:function(e,t,a){a.r(t),a.d(t,{default:function(){return se}});var n=a(94394),r=a.n(n),l=a(21988),i=a(62061),o=a(63064),s=a(21154),c=a(64810),d=a(96540),m=a(95402),u=a(38127),p=a(18155),E=a(62514),g=a(95286),f=a(56466),v=a(5993),h=a(30379),x=a(79142),b=a(95227);var A=({order:e})=>{var t,a;const{i18n:n}=(0,i.uB)(),{getAccessTokenSilently:r}=(0,l.WB)(),c=(0,o.jE)(),{0:m,1:u}=(0,d.useState)(!1),{0:p,1:f}=(0,d.useState)(null),v=null!==(t=null===(a=e.sampleBatches[0])||void 0===a?void 0:a.additionalInformation)&&void 0!==t?t:"",{mutateAsync:h}=(0,s.n)((t=>(0,x.lz)(e.id,{additionalInformation:t},r)),{onError:()=>{f(d.createElement(i.x6,{id:"portal.order.edit.saveError"}))},onSuccess:t=>{c.setQueryData([x.vA,String(e.id)],t),c.invalidateQueries([x.vA,String(e.id)]),f(null),u(!1)}});return m?d.createElement("div",null,d.createElement(g.e,{isEditing:!0,initialValue:v,onSetEditing:u,inputProps:{"aria-label":n._({id:"portal.orderSubmission.additionalInformation.heading"}),as:"textarea",rows:4},onSubmit:async e=>{f(null),await h(e)}}),p?d.createElement(b.M,{type:"error",className:"mt-2 max-w-2xl"},p):null):d.createElement("p",{className:"flex flex-col items-start gap-4 whitespace-pre-line md:flex-row md:items-center"},v,d.createElement(g.M,{onSetEditing:u,editButtonProps:{children:d.createElement(d.Fragment,null,d.createElement(E.A,{className:"inline align-text-bottom"}),d.createElement("span",null,v?d.createElement(i.x6,{id:"common.edit"}):d.createElement(i.x6,{id:"portal.order.edit.addAdditionalInformation"})))}}))};const S="order:",N="offer:",w="locked:",y=e=>`${S}${e}`,k=e=>`${w}${e}`,C=e=>e.startsWith(S)?{id:e.slice(6),source:"order"}:{id:e.slice(6),source:"offer"},L=e=>null===e.originalOfferProductId,I={content:[],type:"doc"},F=(e,t)=>{var a;return{basis:e.basis,currency:t.currency,customColumnHeader:"",customColumnValue:I,description:e.description,discountPercent:null,id:y(e.id),includedTests:e.includedTests,offerId:null!==(a=e.originalOfferId)&&void 0!==a?a:"",price:e.price,productName:e.name,quantity:e.quantity,sampleRequirements:"",turnaroundWeeks:{max:0,min:null},volumeDiscounts:[]}},P=({basisFilter:e,offerProducts:t,order:a,lockNullOrigin:n=!1})=>{const r=a.products.filter((t=>!t.isServiceFee&&e(t.basis))),l=new Set(r.map((e=>e.originalOfferProductId)).filter((e=>null!==e))),i=r.filter(L),o=r.filter((e=>!L(e))).map((e=>
1F(e,a))),s=n?i.map((e=>({...F(e,a),id:k(e.id),isLocked:!0}))):[];return{nullOriginLines:i,selectableProducts:[...o,...s,...t.filter((e=>!l.has(e.id))).map((e=>{return{...e,id:(t=e.id,`${N}${t}`)};var t}))]}},B=e=>({samples:e.samples.map((({name:e,note:t,offerProducts:a,sampleFields:n})=>({name:e,note:t,products:a.filter((e=>!(e=>e.startsWith(w))(e))).map(C),sampleFields:n})))});var O=a(34033),T=a(25417),_=a(48557),D=a(6264);const M=e=>e.products.filter((e=>!e.isServiceFee&&(0,x.YQ)(e.basis)&&null!==e.originalOfferProductId)).map((e=>y(e.id)));var W=({order:e})=>{var t,a;const{i18n:n}=(0,i.uB)(),{getAccessTokenSilently:r}=(0,l.WB)(),c=(0,o.jE)(),{0:m,1:p}=(0,d.useState)(!1),{0:f,1:v}=(0,d.useState)(null),{0:h,1:A}=(0,d.useState)((()=>M(e))),S=e.products.filter((({basis:e,isServiceFee:t})=>!t&&(0,x.YQ)(e))),{data:N=[]}=(0,x.pF)({organizationId:null!==(t=null===(a=e.organization)||void 0===a?void 0:a.id)&&void 0!==t?t:null}),{selectableProducts:w,nullOriginLines:y}=(0,d.useMemo)((()=>{var t;return P({basisFilter:x.YQ,offerProducts:(0,T.M)({offers:N,organizationId:null===(t=e.organization)||void 0===t?void 0:t.id}).additionalServices,order:e})}),[N,e]),{mutate:k,isLoading:L}=(0,s.n)((t=>(0,x.lz)(e.id,{additionalServices:t},r)),{onError:()=>{v(d.createElement(i.x6,{id:"portal.order.edit.saveError"}))},onSuccess:t=>{c.setQueryData([x.vA,String(e.id)],t),c.invalidateQueries([x.dq]),v(null),p(!1)}}),I=()=>{A(M(e)),v(null),p(!1)};if(0===S.length&&0===w.length)return null;const F=d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.additionalServices.heading"})),B=y.length?d.createElement("ul",{className:"list-disc pl-4"},y.map((t=>d.createElement("li",{key:t.id},t.name,", ",d.createElement(_.l,{basis:t.basis,price:t.price,currency:e.currency}))))):null;return m?d.createElement("div",{className:"space-y-4"},F,B,d.createElement(D.A,{products:w,value:h,onChange:e=>A(e),dropdownProps:{placeholder:n._({id:"portal.orderSubmission.additionalServices.add"}),searchPlaceholder:n._({id:"portal.orderSubmission.additionalServices.search"})}}),f?d.createElement(b.M,{type:"error",className:"max-w-2xl"},f):null,d.createElement("div",{className:"flex flex-wrap gap-2"},d.createElement(O.A,{type:"button",isLoading:L,onClick:()=>k(h.map(C))},d.createElement(i.x6,{id:"common.save"})),d.createElement(O.A,{variant:"outline",disabled:L,onClick:I},d.createElement(i.x6,{id:"common.cancel"})))):d.createElement("div",null,F,d.createElement("div",{className:"space-y-2"},S.length?d.createElement("ul",{className:"list-disc pl-4"},S.map((t=>d.createElement("li",{key:t.id},t.name,", ",d.createElement(_.l,{basis:t.basis,price:t.price,currency:e.currency}))))):null,d.createElement(g.M,{onSetEditing:p,editButtonProps:{children:d.createElement(d.Fragment,null,d.createElement(E.A,{className:"inline align-text-bottom"}),d.createElement("span",null,S.length?d.createElement(i.x6,{id:"common.edit"}):d.createElement(i.x6,{id:"portal.order.edit.addAdditionalServices"})))}})))},j=a(18341),R=a(49785),$=a(38970),V=a.n($),z=a(26488);var Q=({order:e,samples:t})=>{const a=V()(e.products,"id");return d.createElement(z.A,{sampleFields:e.sampleFields,samples:t.map((({products:t,...n})=>({...n,products:t.map((t=>{const n=a[t];return n?{...n,currency:e.currency}:void 0})).filter((e=>Boolean(e)))})))})},H=a(62205);var G=({order:e})=>{var t,a;const{getAccessTokenSilently:n}=(0,l.WB)(),r=(0,o.jE)(),{0:c,1:m}=(0,d.useState)(!1),{0:u,1:p}=(0,d.useState)(null),g=(0,d.useMemo)((()=>(e=>{var t,a;const n=new Set(e.products.filter((e=>!L(e))).map((e=>e.id))),r=new Set(e.products.filter((e=>L(e)&&(0,x.W9)(e.basis))).map((e=>e.id)));return{samples:null!==(t=null===(a=e.sampleBatches[0])||void 0===a?void 0:a.samples.map((e=>({isChecked:!1,isExpanded:!1,name:e.name,note:e.note,offerProducts:e.products.flatMap((e=>n.has(e)?[y(e)]:r.has(e)?[k(e)]:[])),sampleFields:e.sampleFields}))))&&void 0!==t?t:[]}})(e)),[e]),f=(0,R.mN)({defaultValues:g});(0,d.useEffect)((()=>{f.reset(g)}),[f,g]);const{data:v=[]}=(0,x.pF)({organizationId:null!==(t=null===(a=e.organization)||void 0===a?void 0:a.id)&&void 0!==t?t:null}),h=(0,d.useMemo)((()=>{var t;return P({basisFilter:x.W9,lockNullOrigin:!0,offerProducts:(0,T.M)({offers:v,organizationId:null===(t=e.organization)||void 0===t?void 0:t.id}).perSampleProducts,order:e}).selectableProducts}),[v,e]),{mutate:A,isLoading:S}=(0,s.n)((t=>(0,x.lz)(e.id,t,n)),{onError:()=>{p(d.createElement(i.x6,{id:"portal.order.edit.saveError"}))},onSuccess:t=>{r.setQueryData([x.vA,String(e.id)],t),r.invalidateQueries([x.dq]),m(!1),p(null)}}),N=f.handleSubmit((e=>A(B(e))),(e=>{var t,a;null===(t=e.samples)||void 0===t||null===(a=t.forEach)||void 0===a||a.call(t,((e,t)=>
1f.setValue(`samples.${t}.isExpanded`,!0)))}));var w,C;return c?d.createElement("form",{className:"space-y-8",onSubmit:e=>{N(e)}},d.createElement(R.Op,f,d.createElement(H.A,{products:h,sampleFields:e.sampleFields})),u?d.createElement(b.M,{type:"error",className:"max-w-2xl"},u):null,d.createElement("div",{className:"flex flex-wrap gap-2"},d.createElement(O.A,{type:"submit",isLoading:S},d.createElement(i.x6,{id:"common.save"})),d.createElement(O.A,{variant:"outline",disabled:S,onClick:()=>{f.reset(g),p(null),m(!1)}},d.createElement(i.x6,{id:"common.cancel"})))):d.createElement("div",{className:"space-y-2"},d.createElement(Q,{order:e,samples:null!==(w=null===(C=e.sampleBatches[0])||void 0===C?void 0:C.samples)&&void 0!==w?w:[]}),d.createElement("div",null,d.createElement(O.A,{variant:"link",onClick:()=>m(!0)},d.createElement(E.A,{className:"inline align-text-bottom"}),d.createElement(i.x6,{id:"portal.order.edit.editSamples"}))))},q=a(82816),U=a(1866),X=a(42826),Y=a(21426),Z=a(47521);var K=({dealId:e,orderSubmissionId:t})=>{const{i18n:a}=(0,i.uB)(),[n,r]=d.useState();return d.createElement("div",{className:"space-y-2 rounded-xl bg-secondary-light2 px-6 py-4"},d.createElement("div",{className:"font-primary text-lg font-semibold"},d.createElement(i.x6,{id:"portal.order.shippingBanner.heading"})),d.createElement("div",{className:"space-y-1 text-base"},d.createElement("p",null,d.createElement(i.x6,{id:"portal.order.shippingBanner.description"}))),d.createElement("div",{className:"align-center flex flex-col items-stretch gap-4 py-1.5 md:flex-row md:items-center"},void 0!==t?d.createElement(Z.D,{onError:r,orderSubmissionId:t,size:"lg"}):d.createElement(Z.D,{onError:r,dealId:e,size:"lg"}),d.createElement(O.A,{target:"_blank",as:c.Link,variant:"outline",size:"lg",href:(0,q.$h)(a.locale,U.c.SHIPPING_INSTRUCTIONS)},d.createElement(Y.A,null),d.createElement(i.x6,{id:"portal.order.viewShippingInstructions"}),d.createElement(X.A,{width:"16",height:"16"}))),n&&d.createElement("p",{className:"mt-1 text-sm text-error"},n))},J=a(73359),ee=a(1900),te=a(86571),ae=a(42189);const ne=({order:{id:e,name:t},onEdit:a})=>{const{i18n:n}=(0,i.uB)(),{0:r,1:l}=(0,d.useState)(!1),{expertAccess:o}=(0,ee.i)();return d.createElement("div",{className:"my-6 flex items-center gap-4"},d.createElement(u.A,{isLeftAligned:!0,as:"h1",className:"m-0! flex gap-4 overflow-hidden text-nowrap"},d.createElement("span",{className:"text-nowrap"},"ID ",e),r?null:d.createElement(d.Fragment,null,d.createElement("span",{className:"overflow-hidden text-ellipsis"},t),o?null:d.createElement(g.M,{editButtonProps:{children:d.createElement(d.Fragment,null,d.createElement(E.A,{className:"inline align-text-bottom"}),d.createElement("span",{className:"font-normal"},t?d.createElement(i.x6,{id:"portal.order.rename"}):d.createElement(i.x6,{id:"portal.order.setName"}))),className:"text-base font-base w-auto flex-none"},onSetEditing:l}))),r?d.createElement(g.e,{className:"inline-flex w-auto",isEditing:r,onSetEditing:l,initialValue:t,inputProps:{"aria-label":n._({id:"portal.order.namePlaceholder"}),as:"input","data-test-id":"order-name-field",placeholder:n._({id:"portal.order.namePlaceholder"})},onSubmit:e=>a(e).then((()=>l(!1)))}):null)},re=({order:{reference:e},onEdit:t})=>{const{i18n:a}=(0,i.uB)(),{0:n,1:r}=(0,d.useState)(!1);return n?d.createElement(g.e,{isEditing:n,onSetEditing:r,initialValue:e,inputProps:{"aria-label":a._({id:"portal.order.referencePlaceholder"}),as:"input","data-test-id":"order-reference-field",placeholder:a._({id:"portal.order.referencePlaceholder"})},onSubmit:e=>t(e).then((()=>r(!1)))}):d.createElement("p",{className:"flex items-center"},e,d.createElement(g.M,{editButtonProps:{children:d.createElement(d.Fragment,null,d.createElement(E.A,{className:"inline align-text-bottom"}),d.createElement("span",null,e?d.createElement(i.x6,{id:"common.edit"}):d.createElement(i.x6,{id:"portal.order.setReference"}))),className:"ml-2"},onSetEditing:r}))},le=({order:{note:e},onEdit:t})=>{const{i18n:a}=(0,i.uB)(),{0:n,1:r}=(0,d.useState)(!1);return d.createElement("div",null,n?d.createElement(g.e,{isEditing:!0,initialValue:e,onSetEditing:r,inputProps:{"aria-label":a._({id:"portal.order.notes.placeholder"}),as:"textarea","data-test-id":"order-note-field",placeholder:a._({id:"portal.order.notes.placeholder"}),rows:4,tooltip:d.createElement("span",{className:"flex items-center gap-2 rounded-lg bg-primary-light px-2 py-1"},d.createElement(p.A,{className:"text-secondary-dark",strokeWidth:"3",width:"24",height:"24"}),d.createElement("p",null,d.createElement(i.x6,{id:"portal.order.notes.visibilityDisclaimer",components:{b:d.createElement("b",null)}})))},onSubmit:e=>t(e).then((()=>r(!1)))}):d.createElement("p",{className:"flex flex-col items-start gap-4 whitespace-pre-line md:flex-row md:items-center"},e,d.createElement(g.M,{onSetEditing:r,editButtonProps:{children:d.createElement(d.Fragment,null,d.createElement(E.A,{className:"inline align-text-bottom"}),d.createElement("span",null,e?d.createElement(i.x6,{id:"portal.order.notes.edit"}):d.createElement(i.x6,{id:"portal.order.notes.set"})))}}),e?null:d.createElement("span",{className:"text--subtle text-sm"},d.createElement(i.x6,{id:"portal.order.notes.tooltip"}))))},ie=({additionalReportingEmails:e,contactInformation:t})=>t||e.length?d.createElement("div",{className:"space-y-2"},d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.contactInformation.heading"})),t?d.createElement(d.Fragment,null,d.createElement(u.A,{variant:"subheading",className:"text-base",as:"h3",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.contactInformation.mainContact"})),d.createElement("div",null,d.createElement("div",null,t.contactName),d.createElement("div",null,d.createElement("a",{href:`mailto:${t.email}`},t.email)),d.createElement("div",null,t.phone))):null,e.length?d.createElement(d.Fragment,null,d.createElement(u.A,{variant:"subheading",className:"text-base",as:"h3",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.orderSubmission.contactDetails.additionalReportingEmails"})),d.createElement("ul",null,e.map((e=>d.createElement("li",{key:e},d.createElement("a",{href:`mailto:${e}`},e)))))):null):null,oe=({order:e})=>{const{expertAccess:t}=(0,ee.i)(),{expertEmail:a,files:n,sampleBatches:p}=e,{getAccessTokenSilently:E}=(0,l.WB)(),{i18n:g}=(0,i.uB)(),{data:f=[]}
1=(0,x.Gi)(),v=(0,o.jE)(),{mutateAsync:b}=(0,s.n)((t=>(te.SO.orderFieldChanged(Object.keys(t)),(0,x.lz)(e.id,t,E))),{onSuccess:()=>{v.invalidateQueries([x.vA])}}),{data:S}=(0,x.pF)({orderId:e.id}),N=!t&&"waitingForSamples"===e.status&&p.length<=1,{"customer-provided":w=[],report:y=[],...k}=r()(n,"fileType"),C=Object.values(k).flat(),L=e.products.filter((({basis:e,isServiceFee:t})=>!t&&(0,x.YQ)(e))),I=p.length>1;return d.createElement(d.Fragment,null,d.createElement(d.Fragment,null,d.createElement(ne,{order:e,onEdit:e=>b({name:e})}),S&&(0,x.Kz)({offers:S,order:e})?d.createElement(J.A,{orderId:e.id}):null),d.createElement(j.A,{order:e}),"waitingForSamples"===e.status?e.orderSubmissionId?d.createElement(K,{orderSubmissionId:e.orderSubmissionId}):d.createElement(K,{dealId:e.id}):null,d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.results.heading"})),d.createElement(h.$c,{onFetchFile:e=>(0,x.d5)(e,E),files:y,noFiles:"completed"===e.status?d.createElement(h.vZ,null):d.createElement(i.x6,{id:"portal.order.results.noResults"})})),C.length?d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.otherFiles.heading"})),d.createElement(h.$c,{onFetchFile:e=>(0,x.d5)(e,E),files:C})):null,d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.notes.heading"})),t?d.createElement("p",null,e.note):d.createElement(le,{order:e,onEdit:e=>b({note:e})})),d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.expert"})),d.createElement(m.A,{email:a,showContactInfo:!0})),N?d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.samplesAndTests.heading"})),d.createElement(G,{order:e}),d.createElement("div",{className:"mt-6"},d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.additionalInformation.heading"})),d.createElement(A,{order:e}))):p.map((t=>d.createElement("div",{key:t.number},d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.samplesAndTests.heading"}),I&&d.createElement(d.Fragment,null," ","(",d.createElement(i.x6,{id:"portal.order.sampleTable.batch"})," ",t.number,")")),d.createElement("p",{className:"my-4 text-sm"},d.createElement(i.x6,{id:"portal.order.sampleTable.contactToMakeChanges"})),d.createElement(Q,{order:e,samples:t.samples}),t.additionalInformation?d.createElement("div",{className:"mt-6"},d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.additionalInformation.heading"})),d.createElement("p",{className:"whitespace-pre-line"},t.additionalInformation)):null))),N?d.createElement(W,{order:e}):L.length?d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.additionalServices.heading"})),d.createElement("ul",{className:"list-disc pl-4"},L.map((t=>d.createElement("li",{key:t.id},t.name,", ",d.createElement(_.l,{basis:t.basis,price:t.price,currency:e.currency})))))):null,null!=S&&S.length?d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.offers.heading"})),d.createElement("ul",null,S.map((e=>{const t=f.find((({id:t})=>t===e.organizationId));return d.createElement("li",{key:e.offerId},d.createElement(c.Link,{to:(0,q.$h)(g.locale,U.c.PORTAL_OFFERS_ID).replace("[id]",e.offerId)}
1,e.title||"Framework offer"," - ",null==t?void 0:t.name))})))):null,d.createElement("div",null,d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.customerProvidedFiles.heading"})),d.createElement(h.$c,{onFetchFile:e=>(0,x.d5)(e,E),files:w})),d.createElement("div",{className:"space-y-4 md:flex md:flex-wrap md:gap-55"},d.createElement(ie,{additionalReportingEmails:e.additionalReportingEmails,contactInformation:e.contactInformation}),d.createElement("div",{className:"space-y-2"},d.createElement(u.A,{variant:"heading",as:"h2",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.billingInformation.heading"})),d.createElement(u.A,{variant:"subheading",className:"text-base",as:"h3",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.billingInformation.referenceNumber"})),t?d.createElement("p",null,e.reference):d.createElement(re,{order:e,onEdit:e=>b({reference:e})}))))};var se=(0,l.O8)((0,ae.Y)((({params:e})=>{var t;const{i18n:a}=(0,i.uB)(),{data:n,isLoading:r}=(0,x.SC)(e.id,{enabled:Boolean(e.id)}),l=(0,q.Gm)(U.c.PORTAL_ORDERS_ID).map((t=>({...t,slug:t.slug.replace("[id]",String(e.id))})));return d.createElement(v.A,{contentGroup:te.O9.ordersPage,localisedSlugs:l,siteUrl:(0,q.$h)(a.locale,U.c.PORTAL_ORDERS_ID).replace("[id]",String(e.id)),breadcrumbParts:n?[{internalLink:(0,q.$h)(a.locale,U.c.PORTAL),text:a._({id:"metadata.portal.title"})},{internalLink:location.pathname,text:`ID ${n.id} ${null!==(t=n.name)&&void 0!==t?t:""}`.trim()}]:[]},d.createElement(d.Fragment,null,d.createElement("div",{className:"gutter gutter--center space-y-10 pb-15 text-base"},n?d.createElement(oe,{order:n}):r?d.createElement("div",{className:"my-6 animate-pulse space-y-10"},d.createElement("div",{className:"h-32 bg-gray-200"}),d.createElement("div",{className:"h-50 bg-gray-200"}),d.createElement("div",{className:"space-y-4 md:flex md:flex-wrap md:gap-55"},d.createElement("div",{className:"h-32 w-80 bg-gray-200"}),d.createElement("div",{className:"h-32 w-80 bg-gray-200"}))):d.createElement(d.Fragment,null,d.createElement(u.A,{as:"h1",isLeftAligned:!0},d.createElement(i.x6,{id:"portal.order.notFound"})),d.createElement(c.Link,{to:(0,q.$h)(a.locale,U.c.PORTAL)},d.createElement(i.x6,{id:"portal.offersAndOrders"}))))),d.createElement(f.A,{noIndex:!0,title:`${a._({id:"metadata.portalOrdersId.title"})} ${null==n?void 0:n.id}`}))})))},95286:function(e,t,a){a.d(t,{M:function(){return c},e:function(){return d}});var n=a(62061),r=a(46942),l=a.n(r),i=a(96540),o=a(34033);const s=e=>{if("input"===e.as){const{as:t,...a}=e;return i.createElement(t,Object.assign({size:"string"==typeof a.value?Math.max(20,a.value.length):void 0},a))}const{as:t,tooltip:a,...n}=e;return i.createElement("div",{className:"flex flex-col gap-1"},i.createElement(t,n),a)},c=({editButtonProps:e,onSetEditing:t})=>i.createElement(o.A,Object.assign({},e,{variant:"link",className:l()("whitespace-nowrap",e.className),onClick:a=>{var n;null===(n=e.onClick)||void 0===n||n.call(e,a),t(!0)}})),d=({className:e,initialValue:t="",inputProps:a,onSetEditing:r,onSubmit:c})=>{const{0:d,1:m}=(0,i.useState)(t),{0:u,1:p}=(0,i.useState)(!1);return i.createElement("form",{className:l()("flex flex-wrap items-center gap-2",{"max-w-200 flex-col items-stretch":"textarea"===a.as},e),onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),m(t),r(!1))},onSubmit:e=>{e.preventDefault(),p(!0),c(d).finally((()=>p(!1)))}},i.createElement(s,Object.assign({autoFocus:!0,value:d},a,{onChange:e=>m(e.currentTarget.value),disabled:u,className:l()("max-w-full flex-1","inputField","inputField--small",a.className)})),i.createElement("div",{className:"space-x-2"},i.createElement(o.A,{className:"h-8! min-w-auto! px-4! py-0! shadow-none!",isLoading:u,type:"submit"},i.createElement(n.x6,{id:"common.save"})),i.createElement(o.A,{variant:"outline",className:"min-w-auto! px-4! py-0! shadow-none!",disabled:u,onClick:()=>{m(t),r(!1)}},i.createElement(n.x6,{id:"common.cancel"}))))}},95402:function(e,t,a){var n=a(62061),r=a(46942),l=a.n(r),i=a(96540),o=a(34753),s=a(96656),c=a(69206),d=a(26309);t.A=({email:e,showContactInfo:t=!1,linkToProfile:a=!0})=>{const r=(0,o.A)(null!=e?e:""),{i18n:m}=(0,n.uB)(),u=null!=r&&r.isActive&&e?e:"[email protected]";return i.createElement("div",{className:l()("expertContactCard",{"expertContactCard--inactive":!(null!=r&&r.isActive)})},i.createElement(c.e,{className:"expertContactCard__img",variant:"rounded",member:r}),i.createElement("div",{className:"expertContactCard__contactDetails"},r?i.createElement("span",{className:"expertContactCard__name"},a&&r.profileUrl?i.createElement("a",{href:r.profileUrl}
1,r.name.full):r.name.full,!r.isActive&&` (${m._({id:"common.inactiveEmployee"})})`):null,t&&i.createElement("div",{className:"expertContactCard__contactLinks"},i.createElement(d.D,{email:u,location:"expertContactCard"},u),(null==r?void 0:r.isActive)&&r.customerFacingPhone&&i.createElement("a",{href:`tel:${(0,s.KE)(r.customerFacingPhone)}`},r.customerFacingPhone))))}}}]); 2//# sourceMappingURL=component---src-pages-portal-orders-[id]-tsx-ccee3bd10ac772bf226d.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.