PageSourceSearch

https://app.techpilot.com/static/js/async/3473.66210b9d.js

js techpilot.com collected 2026-10-10 01:16:37 UTC 130,389 bytes, 6 lines download raw bytes

1/*! For license information please see 3473.66210b9d.js.LICENSE.txt */
2!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e.SENTRY_RELEASE={id:"fa16cf85316a84bfe6b4ccacba59db3bf3b93b0e"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="067e95f5-10a9-4ccf-86ee-a69be31cacbd",e._sentryDebugIdIdentifier="sentry-dbid-067e95f5-10a9-4ccf-86ee-a69be31cacbd")}catch(e){}}();"use strict";(self.webpackChunkclient=self.webpackChunkclient||[]).push([["3473"],{22514(e,t,a){a.d(t,{A:()=>n});let n=(0,a(29239).A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},89498(e,t,a){a.d(t,{A:()=>n});let n=(0,a(29239).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},96741(e,t,a){a.d(t,{A:()=>n});let n=(0,a(29239).A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},53596(e,t,a){a.d(t,{A:()=>n});let n=(0,a(29239).A)("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]])},93011(e,t,a){a.d(t,{A:()=>n});let n=(0,a(29239).A)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},76055(e,t,a){a.d(t,{S:()=>f});var n=a(36736),s=a(36604),r=a(30629),l=a(16400),i=a(42372),o=a(31525),d=a(18007),c=a(40707);function u(e){let{name:t,department:a,isCurrentAssignee:s}=e,{t:l}=(0,r.Bd)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.eu,{className:"size-10 shrink-0",children:(0,n.jsx)(d.q5,{className:"bg-muted text-muted-foreground",children:(0,n.jsx)(o.A,{className:"size-5"})})}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,n.jsx)("span",{className:"truncate text-sm",children:t}),a&&(0,n.jsx)("span",{className:"truncate text-muted-foreground text-xs",children:a})]}),s&&(0,n.jsx)(c.E,{variant:"outline",className:"ml-auto shrink-0 bg-card text-muted-foreground",children:l("Current editor")})]})}var m=a(83904),p=a(10762),x=a(16777),h=a(83681);function f(e){let{assignees:t,isLoading:a,value:o,onChange:d}=e,{t:c}=(0,r.Bd)(),[f,g]=(0,s.useState)(!1),v=t.find(e=>String(e.usrID)===o),j=c("Select editor");return(0,n.jsxs)(h.AM,{open:f,onOpenChange:g,children:[(0,n.jsx)(h.Wv,{asChild:!0,children:(0,n.jsxs)(m.Z,{type:"button",variant:"outline",role:"combobox","aria-expanded":f,disabled:a,className:(0,p.cn)("h-9 w-full min-w-0 justify-between bg-card text-base font-normal hover:bg-card hover:text-foreground md:text-sm",!v&&"text-muted-foreground"),children:[(0,n.jsx)("span",{className:"truncate",children:v?v.name??`#${v.usrID}`:j}),(0,n.jsx)(l.A,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),(0,n.jsx)(h.hl,{className:"w-(--radix-popover-trigger-width) p-0",align:"start",children:(0,n.jsxs)(x.uB,{children:[(0,n.jsx)(x.G7,{placeholder:j}),(0,n.jsxs)(x.oI,{onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[(0,n.jsx)(x.xL,{children:c("No results")}),(0,n.jsx)(x.L$,{children:t.map(e=>(0,n.jsxs)(x.h_,{value:e.name??String(e.usrID),disabled:e.currentAssignee,onSelect:()=>{d(String(e.usrID)),g(!1)},className:(0,p.cn)("gap-gutter",e.currentAssignee&&"bg-secondary data-[disabled=true]:opacity-100"),children:[(0,n.jsx)(u,{name:e.name??`#${e.usrID}`,department:e.department,isCurrentAssignee:e.currentAssignee}),String(e.usrID)===o&&(0,n.jsx)(i.A,{className:"ml-auto size-4 shrink-0"})]},e.usrID))})]})]})})]})}},5418(e,t,a){a.d(t,{U:()=>l});var n=a(36736),s=a(86107),r=a(10762);let l=e=>{let{children:t,column:a,className:l}=e,i=a.getCanSort(),o=a.getIsSorted(),d="flex items-center gap-2 font-semibold text-sm";return i?(0,n.jsxs)("button",{type:"button",onClick:()=>a.toggleSorting(),className:(0,r.cn)(d,"m-0 p-0 transition-all hover:underline cursor-pointer",l),children:[t,(0,n.jsx)(s.A,{className:(0,r.cn)("h-4 w-4 shrink-0 transition-transform duration-200","desc"===o&&"rotate-180",!o&&"invisible")})]}):(0,n.jsx)("div",{className:(0,r.cn)(d,l),children:t})}},43820(e,t,a){a.d(t,{E:()=>o});var n=a(36736),s=a(87876),r=a(74966),l=a(37245);function i(){return(0,n.jsx)(s.T,{children:(0,n.jsxs)("div",{className:"space-y-3 px-1",children:[(0,n.jsx)(l.E,{className:"h-4 w-56"}),(0,n.jsx)(l.E,{className:"h-4 w-full"}),(0,n.jsx)(l.E,{className:"h-4 w-3/4"}),(0,n.jsx)(l.E,{className:"mt-6 h-32 w-full"})]})})}function o(e){let{skeleton:t,...a}=e;return(0,n.jsx)(r.X,{...a,skeleton:t??(0,n.jsx)(i,{}),renderWrapper:e=>(0,n.jsx)(s.T,{className:"mx-auto w-full max-w-4xl px-6",children:e})})}},96725(e,t,a){a.d(t,{Z:()=>x});var n=a(36736),s=a(36604),r=a(30629),l=a(31579),i=a(38720),o=a(3948),d=a(10124),c=a(83904),u=a(75835),m=a(17738),p=a(83681);let x=e=>{let{value:t,onChange:a,placeholder:x,disabled:h,minDate:f}=e,{t:g}=(0,r.Bd)(),{formatShortDate:v}
2=(0,u.i)(),[j,y]=(0,s.useState)(!1),b=(e=>{if(e)try{return(0,i.H)(e)}catch{return}})(t);return(0,n.jsxs)(p.AM,{open:j,onOpenChange:y,children:[(0,n.jsx)(p.Wv,{asChild:!0,children:(0,n.jsxs)(c.Z,{variant:"outline",disabled:h,className:"h-auto w-full justify-start font-normal text-sm",children:[(0,n.jsx)(d.A,{className:"h-4 w-4"}),b?v(b):x??g("Select date")]})}),(0,n.jsx)(p.hl,{className:"w-auto p-0",align:"start",children:(0,n.jsx)(m.V,{mode:"single",selected:b,disabled:{before:f??(0,o.R)()},onSelect:e=>{e&&(a((0,l.GP)(e,"yyyy-MM-dd")),y(!1))}})})]})}},74497(e,t,a){a.d(t,{Bz:()=>x,Vp:()=>f,En:()=>g,xB:()=>p,VH:()=>h,P0:()=>v});var n=a(36736),s=a(10762),r=a(36604),l=a(54699),i=a(148);a(22271);let o=(0,l.F)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function d(e){let{className:t,orientation:a="vertical",...r}=e;return(0,n.jsx)("div",{role:"group","data-slot":"field","data-orientation":a,className:(0,s.cn)(o({orientation:a}),t),...r})}function c(e){let{className:t,...a}=e;return(0,n.jsx)(i.J,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",t),...a})}function u(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"field-label",className:(0,s.cn)("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",t),...a})}function m(e){let{className:t,...a}=e;return(0,n.jsx)("p",{"data-slot":"field-description",className:(0,s.cn)("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",t),...a})}function p(e){let{className:t,...a}=e;return(0,n.jsx)(d,{className:(0,s.cn)(t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(c,{className:(0,s.cn)("font-semibold has-data-[state=unchecked]:border-input has-data-[state=checked]:bg-tertiary/5 has-data-[state=checked]:border-tertiary dark:has-data-[state=checked]:bg-tertiary-foreground/10",t),...a})}function h(e){let{className:t,...a}=e;return(0,n.jsx)(m,{className:(0,s.cn)("text-foreground",t),...a})}function f(e){let{className:t,...a}=e;return(0,n.jsx)(u,{className:(0,s.cn)("font-semibold",t),...a})}let g=function(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"field-content",className:(0,s.cn)("group/field-content flex flex-1 flex-col gap-1.5 leading-snug",t),...a})},v=function(e){let{className:t,children:a,errors:l,...i}=e,o=(0,r.useMemo)(()=>{if(a)return a;if(!(null==l?void 0:l.length))return null;let e=[...new Map(l.map(e=>[null==e?void 0:e.message,e])).values()];if((null==e?void 0:e.length)==1){var t;return null==(t=e[0])?void 0:t.message}return(0,n.jsx)("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:e.map((e,t)=>(null==e?void 0:e.message)&&(0,n.jsx)("li",{children:e.message},t))})},[a,l]);return o?(0,n.jsx)("div",{role:"alert","data-slot":"field-error",className:(0,s.cn)("text-destructive text-sm font-normal",t),...i,children:o}):null}},89924(e,t,a){a.d(t,{d:()=>o});var n=a(36736),s=a(54699),r=a(10762),l=a(148);let i=(0,s.F)("",{variants:{weight:{semibold:"font-semibold",normal:"font-normal"}},defaultVariants:{weight:"semibold"}});function o(e){let{className:t,weight:a,...s}=e;return(0,n.jsx)(l.J,{className:(0,r.cn)(i({weight:a}),t),...s})}},83390(e,t,a){a.d(t,{i:()=>c,v:()=>d});var n=a(36736),s=a(10762);a(36604);var r=a(21237),l=a(22514);function i(e){let{className:t,...a}=e;return(0,n.jsx)(r.bL,{"data-slot":"radio-group",className:(0,s.cn)("grid gap-3",t),...a})}function o(e){let{className:t,...a}=e;return(0,n.jsx)(r.q7,{"data-slot":"radio-group-item",className:(0,s.cn)("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,n.jsx)(r.C1,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:(0,n.jsx)(l.A,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function d(e){return(0,n.jsx)(i,{...e})}function c(e){let{className:t,...a}=e;return(0,n.jsx)(o,{className:(0,s.cn)("data-[state=checked]:border-tertiary","[&_svg]:fill-tertiary text-tertiary","focus-visible:ring-1 focus-visible:ring-ring",t),...a})}},12469(e,t,a){a.d(t,{c:()=>o});var n=a(33868),s=a(72171),r=a(28773);let l=["/v2/fair-connections"],i=["buyer-supplier-search"];function o(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=(0,n.jE)(),d=(0,r.Ux)(),c=(0,r.l0)(),u=d.isPending||c.isPending,m=a.invalidationKeys??l;return{toggle:async()=>
2{if(u)return;await Promise.all([o.cancelQueries({queryKey:s.N}),o.cancelQueries({queryKey:i})]);let a=[...o.getQueriesData({queryKey:s.N}),...o.getQueriesData({queryKey:i})];for(let[n,s]of a){let a=function(e,t,a){if(!e||"object"!=typeof e||!Array.isArray(e.data))return e;let n=!1,s=e.data.map(e=>e&&"object"==typeof e&&e.companyID===t?(n=!0,{...e,inDirectory:a}):e);return n?{...e,data:s}:e}(function(e,t,a){if(!Array.isArray(e))return e;let n=!1,s=e.map(e=>{var s;return e&&"object"==typeof e?(null==(s=e.supplier)?void 0:s.companyId)!==t?e:(n=!0,{...e,supplier:{...e.supplier,favorite:a}}):e});return n?s:e}(s,e,!t),e,!t);a!==s&&o.setQueryData(n,a)}try{t?await c.mutateAsync({params:{companyID:e}}):await d.mutateAsync({data:{companyID:e}})}catch(e){for(let[e,t]of a)o.setQueryData(e,t);throw e}await o.invalidateQueries({predicate:e=>Array.isArray(e.queryKey)&&m.includes(e.queryKey[0])}),await o.invalidateQueries({queryKey:s.N})},isPending:u}}},10314(e,t,a){a.d(t,{bt:()=>l,ch:()=>o,ty:()=>r,vv:()=>s});var n=a(53888);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{locale:a="de-DE",currency:n="EUR",minimumFractionDigits:s,maximumFractionDigits:r}=t;try{return new Intl.NumberFormat(a,{style:"currency",currency:n,...void 0!==s&&{minimumFractionDigits:s},...void 0!==r&&{maximumFractionDigits:r}}).format(e)}catch{return String(e)}}function r(e,t){return`${(0,n.Z)(e,{minimumFractionDigits:2,maximumFractionDigits:2})} ${t}`}function l(e,t){return`${(0,n.Z)(e,{minimumFractionDigits:2,maximumFractionDigits:5})} ${t}`}let i={EUR:"€",USD:"$",GBP:"\xa3",CHF:"CHF"};function o(e){return e?i[e]??e:"€"}},17738(e,t,a){a.d(t,{V:()=>m});var n=a(36736),s=a(36604),r=a(98113),l=a(13448),i=a(16400),o=a(98835),d=a(38085),c=a(10762),u=a(37712);function m(e){let{className:t,classNames:a,showOutsideDays:s=!0,captionLayout:m="label",buttonVariant:x="ghost",formatters:h,components:f,...g}=e,v=(0,o.a)();return(0,n.jsx)(d.h,{showOutsideDays:s,className:(0,c.cn)("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:m,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...h},classNames:{root:(0,c.cn)("w-fit",v.root),months:(0,c.cn)("flex gap-4 flex-col md:flex-row relative",v.months),month:(0,c.cn)("flex flex-col w-full gap-4",v.month),nav:(0,c.cn)("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",v.nav),button_previous:(0,c.cn)((0,u.r)({variant:x}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_previous),button_next:(0,c.cn)((0,u.r)({variant:x}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_next),month_caption:(0,c.cn)("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",v.month_caption),dropdowns:(0,c.cn)("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",v.dropdowns),dropdown_root:(0,c.cn)("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",v.dropdown_root),dropdown:(0,c.cn)("absolute bg-popover inset-0 opacity-0",v.dropdown),caption_label:(0,c.cn)("select-none font-medium","label"===m?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",v.caption_label),table:"w-full border-collapse",weekdays:(0,c.cn)("flex",v.weekdays),weekday:(0,c.cn)("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",v.weekday),week:(0,c.cn)("flex w-full mt-2",v.week),week_number_header:(0,c.cn)("select-none w-(--cell-size)",v.week_number_header),week_number:(0,c.cn)("text-[0.8rem] select-none text-muted-foreground",v.week_number),day:(0,c.cn)("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",g.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md":"[&:first-child[data-selected=true]_button]:rounded-l-md",v.day),range_start:(0,c.cn)("rounded-l-md bg-accent",v.range_start),range_middle:(0,
2c.cn)("rounded-none",v.range_middle),range_end:(0,c.cn)("rounded-r-md bg-accent",v.range_end),today:(0,c.cn)("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",v.today),outside:(0,c.cn)("text-muted-foreground aria-selected:text-muted-foreground",v.outside),disabled:(0,c.cn)("text-muted-foreground opacity-50",v.disabled),hidden:(0,c.cn)("invisible",v.hidden),...a},components:{Root:e=>{let{className:t,rootRef:a,...s}=e;return(0,n.jsx)("div",{"data-slot":"calendar",ref:a,className:(0,c.cn)(t),...s})},Chevron:e=>{let{className:t,orientation:a,...s}=e;return"left"===a?(0,n.jsx)(r.A,{className:(0,c.cn)("size-4",t),...s}):"right"===a?(0,n.jsx)(l.A,{className:(0,c.cn)("size-4",t),...s}):(0,n.jsx)(i.A,{className:(0,c.cn)("size-4",t),...s})},DayButton:p,WeekNumber:e=>{let{children:t,...a}=e;return(0,n.jsx)("td",{...a,children:(0,n.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:t})})},...f},...g})}function p(e){let{className:t,day:a,modifiers:r,...l}=e,i=(0,o.a)(),d=s.useRef(null);return s.useEffect(()=>{var e;r.focused&&(null==(e=d.current)||e.focus())},[r.focused]),(0,n.jsx)(u.$,{ref:d,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:(0,c.cn)("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",i.day,t),...l})}},1406(e,t,a){a.d(t,{II:()=>p,at:()=>u});var n=a(36736),s=a(36604),r=a(4645),l=a(32311),i=a(19045),o=a(10762);let d={light:"",dark:".dark"},c=s.createContext(null);function u(e){let{id:t,className:a,children:l,config:i,...d}=e,u=s.useId(),p=`chart-${t||u.replace(/:/g,"")}`;return(0,n.jsx)(c.Provider,{value:{config:i},children:(0,n.jsxs)("div",{"data-slot":"chart","data-chart":p,className:(0,o.cn)("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",a),...d,children:[(0,n.jsx)(m,{id:p,config:i}),(0,n.jsx)(r.u,{children:l})]})})}let m=e=>{let{id:t,config:a}=e,s=Object.entries(a).filter(e=>{let[,t]=e;return t.theme||t.color});return s.length?(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:Object.entries(d).map(e=>{let[a,n]=e;return`
3            ${n} [data-chart=${t}] {
4            ${s.map(e=>{var t;let[n,s]=e,r=(null==(t=s.theme)?void 0:t[a])||s.color;return r?`  --color-${n}: ${r};`:null}).join("\n")}
5            }
6            `}).join("\n")}}):null},p=l.m;i.s},35438(e,t,a){a.d(t,{S:()=>i});var n=a(36736),s=a(30629),r=a(75858),l=a(83904);function i(e){let{open:t,onClose:a,companyLabel:i,onConfirm:o,isPending:d,hasNda:c=!1}=e,{t:u}=(0,s.Bd)(),m=u(c?"The company {{company}} will be removed from your favorites. The granted NDA approval will be revoked as well.":"The company {{company}} will be removed from your favorites.",{company:i});return(0,n.jsx)(r.di,{open:t,onOpenChange:e=>!e&&a(),children:(0,n.jsxs)(r.AK,{children:[(0,n.jsxs)(r.eS,{children:[(0,n.jsx)(r.JU,{children:u("Remove favorite")}),(0,n.jsx)(r.DZ,{children:m})]}),(0,n.jsxs)(r._T,{children:[(0,n.jsx)(r.X6,{disabled:d,children:u("Cancel")}),(0,n.jsx)(l.Z,{onClick:o,disabled:d,children:d?`${u("Yes, remove")}…`:u("Yes, remove")})]})]})})}},72171(e,t,a){a.d(t,{N:()=>i,u:()=>o});var n=a(36604),s=a(56834),r=a(23821);let l=[],i=["quote-overview-details"];function o(e){let t=(0,s.I)({queryKey:[...i,e],queryFn:async()=>0===e.length?[]:(await (0,r.iW)({quoteIds:e})).data??[],enabled:e.length>0});return{quotes:(0,n.useMemo)(()=>t.data??l,[t.data]),isLoading:t.isLoading,error:t.error,refetch:t.refetch}}},46756(e,t,a){a.d(t,{O:()=>c});
6var n=a(36736),s=a(94836),r=a(47077),l=a(10762);let i={AWARD:(0,s.t)("RFQ awarded"),NEGOTIATION:(0,s.t)("RFQ in negotiation"),NO_AWARD_NO_QUOTE:(0,s.t)("No negotiable offer"),NO_AWARD_CANCEL:(0,s.t)("Project stopped"),NO_AWARD_RESTART:(0,s.t)("Will be restarted"),NO_AWARD_INFO:(0,s.t)("Request for Information")},o={AWARD:"text-success",NEGOTIATION:"text-primary",NO_AWARD_NO_QUOTE:"text-muted-foreground",NO_AWARD_CANCEL:"text-muted-foreground",NO_AWARD_RESTART:"text-muted-foreground",NO_AWARD_INFO:"text-muted-foreground"},d={AWARD:"success",NEGOTIATION:"primary",NO_AWARD_NO_QUOTE:"neutral",NO_AWARD_CANCEL:"neutral",NO_AWARD_RESTART:"neutral",NO_AWARD_INFO:"neutral"};function c(e){let{result:t,className:a,variant:s="text"}=e;if(!t)return null;let c=i[t]??t;if("badge"===s)return(0,n.jsx)(r.W,{tone:d[t]??"neutral",className:a,children:c});let u=o[t]??"text-muted-foreground";return(0,n.jsx)("span",{className:(0,l.cn)("text-xs font-semibold",u,a),children:c})}},54214(e,t,a){a.d(t,{A:()=>d});var n=a(36736),s=a(94836),r=a(47077),l=a(10762);let i={Active:(0,s.t)("Active"),InWork:(0,s.t)("Prepared"),ToBeVerified:(0,s.t)("In Review"),Ended:(0,s.t)("Ended"),Archived:(0,s.t)("Archived"),Deleted:(0,s.t)("Deleted")},o={Active:"success",InWork:"neutral",ToBeVerified:"neutral",Ended:"danger",Archived:"neutral",Deleted:"destructive"};function d(e){let{status:t,endDate:a,className:s}=e,d="Active"===t&&a&&new Date(a)<new Date?"warning":o[t],c=i[t]??t;return(0,n.jsx)(r.W,{tone:d,className:(0,l.cn)(s),children:c})}},95433(e,t,a){function n(e){return"AWARD"===e}function s(e){return"NEGOTIATION"===e}a.d(t,{H4:()=>s,Pw:()=>n})},64903(e,t,a){a.d(t,{A:()=>o});var n=a(59118),s=a(30350),r=a(37808),l=a(66075),i=a(4311);function o(){let e=(0,n.k)({select:e=>e.location.pathname}),{data:{data:t}={}}=(0,i.Nv)(),a=e.startsWith("/buyer")?"buyer":e.startsWith("/supplier")?"supplier":null,o=!!(null==t?void 0:t.buyerStatus),d=!!(null==t?void 0:t.supplierStatus),{data:{data:c}={}}=(0,l.F9)({query:{enabled:o&&d}}),u=void 0!==t,m=e=>"buyer"===e?o:d,p=sessionStorage.getItem(s.m);return a&&(!u||m(a))?(p!==a&&sessionStorage.setItem(s.m,a),a):p&&(!u||m(p))?p:(0,r.Ez)(t,!!(null==c?void 0:c.isPremiumSupplier))??"supplier"}},31437(e,t,a){a.d(t,{u:()=>r});var n=a(36604),s=a(64213);function r(){let{data:{data:e=[]}={}}=(0,s._1m)(),t=(0,n.useMemo)(()=>{let t=new Map;for(let a of e)t.set(a.id,a.label);return t},[e]);return e=>e?t.get(e)??e:null}},53183(e,t,a){a.d(t,{Zf:()=>r,fX:()=>l});var n=a(56834),s=a(59252);let r=()=>["/v2/tasks/buyer/open"];function l(e,t){let a=(e=>{let{query:t,axios:a}=e??{};return{queryKey:(null==t?void 0:t.queryKey)??r(),queryFn:e=>{let t,{signal:n}=e;return t={signal:n,...a},s.A.get("/v2/tasks/buyer/open",t)},...t}})(e),l=(0,n.I)(a,t);return l.queryKey=a.queryKey,l}},55813(e,t,a){a.d(t,{m:()=>n});let n={visible:"VISIBLE","not-payed":"NOT_PAYED","not-invited":"NOT_INVITED"}},16662(e,t,a){a.d(t,{z:()=>n});let n={active:"Active","in-work":"InWork","to-be-verified":"ToBeVerified",ended:"Ended",archived:"Archived",deleted:"Deleted"}},1480(e,t,a){a.r(t),a.d(t,{component:()=>nf});var n=a(36736),s=a(36604),r=a(30629),l=a(17860),i=a(58381),o=a(73331),d=a(87876),c=a(43820),u=a(48259),m=a(13496),p=a(83904);function x(e){let{onCloseRfqClick:t}=e,{t:a}=(0,r.Bd)();return(0,n.jsxs)(m.lA,{variant:"info",action:(0,n.jsx)(p.Z,{variant:"outline",size:"sm",onClick:t,children:a("Close RFQ")}),children:[(0,n.jsx)(m.TH,{children:a("Next step:")}),(0,n.jsx)(m.h6,{children:a("Close the RFQ and provide feedback so you and the suppliers see the outcome of the request process.")})]})}var h=a(3612),f=a(24780);function g(e){return[null==e?void 0:e.firstname,null==e?void 0:e.lastname].filter(Boolean).join(" ")||"—"}let v=["Active","Ended","Archived"];var j=a(46756),y=a(54214),b=a(8899),N=a(10663);function w(e){let{rfq:t,actions:a}=e,{t:s}=(0,r.Bd)(),l=function(e){switch(e){case"Archived":return{label:"Archived",path:"/buyer/rfqs/archived"};case"Ended":return{label:"Ended",path:"/buyer/rfqs/ended"};case"InWork":case"ToBeVerified":return{label:"Prepared",path:"/buyer/rfqs/prepared"};case"Active":return{label:"Active",path:"/buyer/rfqs/inprogress"};default:return{label:"All Requests",path:"/buyer/rfqs/all"}}}(t.status),i=t.quoteCount>0&&v.includes(t.status)?void 0:[{label:s("Assignee"),value:g(t.owner)},{label:s("Start"),value:(0,f.Yq)(t.startDate)},{label:s("End"),value:(0,f.Yq)(t.endDate)},{label:s("Status"),value:(0,n.jsx)(y.A,{status:t.status,endDate:t.endD
6ate})},...t.result?[{label:s("Result"),value:(0,n.jsx)(j.O,{result:t.result,variant:"badge"})}]:[]];return(0,n.jsx)(h.k,{sticky:!0,stackTitleOnMobile:!0,backProps:{to:l.path},title:t.label??`RFQ ${t.rfqId}`,actions:a,meta:i,metaLabel:(0,n.jsxs)("span",{className:"flex items-center gap-gutter",children:[(0,n.jsx)("span",{children:s("RFQ {{id}}",{id:t.rfqId})}),t.internalCode&&(0,n.jsx)("span",{className:"text-muted-foreground",children:t.internalCode})]}),tags:(0,n.jsx)(b.R,{seriesDemand:t.demandType===N.O.series,ndaRequired:t.ndaRequired,reason:t.reason}),className:"shadow-md print:hidden"})}var q=a(9850),C=a(38108),k=a(36565),I=a(8310),A=a(29239);let S=(0,A.A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var D=a(93011),R=a(67993);let _=(0,A.A)("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);var E=a(89498),F=a(78875);function B(e){let{rfq:t,invitedSuppliersCount:a=0,revisionsCount:l=0,lastRevisionDate:i,onExportClick:o,onPrintClick:d,onOpenChangeDeadline:c,onOpenDuplicateRfq:u,onOpenEditResult:m,onOpenMessageToAll:x,onOpenAssignRfq:h,onOpenInvitedSuppliers:g,onOpenRevisions:v,onOpenViewRfq:j}=e,y=(null==t?void 0:t.status)==="Active",b=(null==t?void 0:t.status)==="Archived"&&(null==t?void 0:t.result)!=="AWARD",{t:N}=(0,r.Bd)(),w=l>0,A=((null==t?void 0:t.quoteCount)??0)>0,B=[{id:"mobileActions",items:[A&&(0,n.jsxs)(F._2,{className:"md:hidden",onClick:o,children:[(0,n.jsx)(q.A,{className:"size-4"}),N("Export")]},"export"),A&&(0,n.jsxs)(F._2,{className:"md:hidden",onClick:d,children:[(0,n.jsx)(C.A,{className:"size-4"}),N("Print")]},"print")].filter(Boolean)},{id:"primary",items:[(0,n.jsxs)(F._2,{onClick:j,children:[(0,n.jsx)(k.A,{className:"size-4"}),N("View RFQ")]},"view"),y&&(0,n.jsxs)(F._2,{onClick:c,children:[(0,n.jsx)(I.A,{className:"size-4"}),N("Change duration")]},"duration"),(0,n.jsxs)(F._2,{onClick:u,children:[(0,n.jsx)(S,{className:"size-4"}),N("Duplicate RFQ")]},"duplicate"),b&&(0,n.jsxs)(F._2,{onClick:m,children:[(0,n.jsx)(D.A,{className:"size-4"}),N("Edit result")]},"edit"),y&&(0,n.jsxs)(F._2,{onClick:x,children:[(0,n.jsx)(R.A,{className:"size-4"}),N("Message to all")]},"message")].filter(Boolean)},{id:"reassign",items:[y&&(0,n.jsxs)(F._2,{onClick:h,children:[(0,n.jsx)(_,{className:"size-4"}),N("Reassign RFQs")]},"reassign")].filter(Boolean)},{id:"suppliers",items:[a>0&&(0,n.jsxs)(F._2,{onClick:g,children:[(0,n.jsx)(E.A,{className:"size-4"}),N("Requested suppliers")]},"suppliers")].filter(Boolean)},{id:"revisions",items:w?[(0,n.jsx)(F.lp,{className:"text-xs text-muted-foreground",children:N("Messages sent to all")},"revisions-label"),(0,n.jsxs)(F._2,{className:"flex-col items-start gap-0.5",onClick:v,children:[(0,n.jsx)("span",{children:N("message_sent_to_all",{count:l})}),i&&(0,n.jsxs)("span",{className:"text-xs font-normal text-muted-foreground",children:[N("Last on")," ",(0,f.Yq)(i)]})]},"revisions")]:[]}].filter(e=>e.items.length>0);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[A&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.Z,{variant:"secondary",size:"sm",className:"hidden md:inline-flex",onClick:o,children:N("Export")}),(0,n.jsx)(p.Z,{variant:"secondary",size:"sm",className:"hidden md:inline-flex",onClick:d,children:N("Print")})]}),(0,n.jsxs)(F.rI,{children:[(0,n.jsx)(F.ty,{asChild:!0,children:(0,n.jsx)(p.Z,{variant:"outline",size:"icon-sm","aria-label":N("Menu"),children:"⋯"})}),(0,n.jsx)(F.SQ,{align:"end",className:"p-element",children:B.map((e,t)=>(0,n.jsxs)(s.Fragment,{children:[t>0&&(0,n.jsx)(F.mB,{}),e.items]},e.id))})]})]})}var z=a(33868),L=a(95362),Q=a(76055),T=a(89924),P=a(93534),O=a(64968);function M(e){let{label:t,rfqId:a,internalCode:s}=e,{t:l}=(0,r.Bd)();return(0,n.jsxs)("div",{className:"mt-gutter flex flex-col gap-element p-card bg-background rounded-lg",children:[(0,n.jsx)("span",{className:"font-bold text-muted-foreground",children:t}),(0,n.jsxs)("span",{className:"text-muted-foreground font-normal",children:[l("RFQ No.")," ",a,s?` \xb7 ${l("Internal no.")} ${s}`:""]})]})}var K=a(56834),W=a(16855),Z=a(89845);let $="quote-overview-rfq",V=e=>[$,e];function U(e){let t=(0,K.I)({queryKey:V(e),queryFn:async()=>
6{if(!e)return null;let t=(await (0,Z.V1)({id:e})).data;if(!t)return null;let a=(await (0,W.Be)({rfqId:t.rfqId})).data??[];return{...t,quoteCount:a.length,quoteIds:a}},enabled:!!e});return{rfq:t.data??void 0,isLoading:t.isLoading,error:t.error,refetch:t.refetch}}var Y=a(62820),H=a(59252);function G(e){var t,a;let l,i,{open:o,onOpenChange:d,rfqId:c,rfqSecondaryId:u,rfqLabel:m,rfqInternalCode:p}=e,{t:x}=(0,r.Bd)(),h=(0,z.jE)(),[f,g]=(0,s.useState)([]),[v,j]=(0,s.useState)(""),[y,b]=(0,s.useState)(""),N=()=>{j(""),b(""),g([]),d(!1)},{mutate:w,isPending:q}=(l=(e=>{let t=["postV1BuyerRfqAssignees"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let t,{data:a}=e??{};return t=new FormData,void 0!==a.rfqID&&t.append("rfqID",a.rfqID.toString()),H.A.post("/v1/buyer/rfq/assignees",t,n)},...a}})({mutation:{onSuccess:e=>{let t=e.data??[];g(Array.isArray(t)?t:[])},onError:()=>{g([])}}}),(0,Y.n)(l,t)),C=(0,s.useCallback)(()=>{c>0&&w({data:{rfqID:c}})},[w,c]),k=(i=(e=>{let t=["postV1BuyerRfqAssign"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let t,{data:a}=e??{};return t=new FormData,void 0!==a.receiver&&t.append("receiver",a.receiver.toString()),void 0!==a.rfqIDs&&t.append("rfqIDs",a.rfqIDs),void 0!==a.comment&&t.append("comment",a.comment),H.A.post("/v1/buyer/rfq/assign",t,n)},...a}})({mutation:(0,O.h)({successMsg:x("RFQ transferred"),errorMsg:x("Failed to transfer RFQ"),onSuccess:()=>{h.invalidateQueries({queryKey:V(u)}),N()}})}),(0,Y.n)(i,a));return(0,s.useEffect)(()=>{o&&C()},[o,C]),(0,n.jsxs)(L.n,{open:o,onClose:N,title:x("Transfer RFQ"),description:x("Assign the RFQ to another processor."),submitLabel:x("Transfer"),submitLoadingLabel:x("Transferring…"),onSubmit:()=>{""!==v&&k.mutate({data:{receiver:Number(v),rfqIDs:String(c),comment:y.trim()||void 0}})},submitDisabled:""===v||q,isPending:k.isPending,children:[(0,n.jsx)(M,{label:m,rfqId:c,internalCode:p}),(0,n.jsxs)("div",{className:"grid gap-element",children:[(0,n.jsx)(T.d,{children:x("Transfer to")}),(0,n.jsx)(Q.S,{assignees:f,isLoading:q,value:""===v?"":String(v),onChange:e=>j(""===e?"":Number(e))})]}),(0,n.jsxs)("div",{className:"grid gap-element",children:[(0,n.jsx)(T.d,{htmlFor:"assign-comment",children:x("Comment (optional)")}),(0,n.jsx)(P.P,{id:"assign-comment",value:y,onChange:e=>b(e.target.value),rows:2,placeholder:x("Message to the new processor…")})]})]})}var X=a(59649),J=a(38720),ee=a(62495),et=a(94447),ea=a(89398),en=a(96725);function es(e){var t,a,l;let i,{open:o,onOpenChange:d,rfqId:c,rfqSecondaryId:u,rfqLabel:m,rfqInternalCode:p,rfqEndDate:x}=e,{t:h}=(0,r.Bd)(),f=(0,z.jE)(),[g,v]=(0,s.useState)(""),[j,y]=(0,s.useState)("");(0,s.useEffect)(()=>{o&&(v(x??""),y(""))},[o,x]);let b=()=>{d(!1)},N=(i=(e=>{let t=["putV1BuyerRfqChangeDeadline"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let{data:t}=e??{};return H.A.put("/v1/buyer/rfq/change-deadline",t,n)},...a}})({mutation:(0,O.h)({successMsg:h("Deadline updated"),errorMsg:h("Failed to update deadline"),onSuccess:()=>{f.invalidateQueries({queryKey:V(u)}),b()}})}),(0,Y.n)(i,t)),w=!!g&&(a=(0,J.H)(g),+(0,X.a)(a)<Date.now()||(l=(0,J.H)(g),(0,ea.r)((0,ee.w)(l,l),(0,et.A)(l))));return(0,n.jsx)(L.n,{open:o,onClose:b,title:h("Change duration"),description:(0,n.jsx)(M,{label:m,rfqId:c,internalCode:p}),submitLabel:h("Change duration"),submitLoadingLabel:h("Saving…"),onSubmit:()=>{g&&!w&&N.mutate({data:{id:c,date:new Date(g).toISOString(),comment:j||void 0}})},submitDisabled:!g||w,isPending:N.isPending,maxWidth:"sm:max-w-lg",children:(0,n.jsxs)("div",{className:"flex flex-col gap-section",children:[(0,n.jsx)("p",{children:h("All suppliers are automatically notified about the change. You may include an individual message.")}),(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsx)(T.d,{children:h("New submission date")}),(0,n.jsx)(en.Z,{value:g,onChange:v,placeholder:h("Select date")}),w&&(0,n.jsx)("p",{className:"text-sm text-destructive",children:h("The current end date has already passed. Please select a new date.")})]}),(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsx)(T.d,{htmlFor:"change-deadline-comment",children:h("Message (optional)")}),(0,n.jsx)(P.P,{id:"change-deadline-comment",value:j,onChange:e=>y(e.target.value),rows:3,maxLength:2e3,placeholder:h("Message to suppliers…")})]})]})})}var er=a(83192);
6function el(){let[e,t]=(0,s.useState)(null),[a,n]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null),i=a?null!==r:null!==e;return{selectedSupplierId:e,selectTableSupplier:e=>{t(e),n(!1),l(null)},isExternalAwardMode:a,enableExternalAwardMode:()=>{n(!0),t(null),l(null)},externalAward:r,setExternalAward:l,canSubmit:i,buildPayload:t=>a?null===r?null:"company"===r.kind?{id:t,supplierId:r.supplierId}:{id:t,externalSupplierName:r.name}:null===e?null:{id:t,supplierId:e},reset:()=>{t(null),n(!1),l(null)}}}function ei(){let[e,t]=(0,s.useState)([]),[a,n]=(0,s.useState)([]),[r,l]=(0,s.useState)([]),i=e.length+a.length+r.length,o=i>0;return{quotedSupplierIds:e,toggleQuotedSupplier:e=>{t(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},invitedSupplierIds:a,toggleInvitedSupplier:e=>{n(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},extraPartners:r,addExtraPartner:e=>{l(t=>t.some(t=>"company"===e.kind?"company"===t.kind&&t.supplierId===e.supplierId:"custom"===t.kind&&t.name===e.name)?t:[...t,e])},removeExtraPartner:e=>{l(t=>t.filter(t=>t!==e))},selectedCount:i,canSubmit:o,buildPayload:t=>{if(!o)return null;let n=[...new Set([...a,...r.filter(e=>"company"===e.kind).map(e=>e.supplierId)])].filter(t=>!e.includes(t));return{id:t,quotedSupplierIds:e,nonQuotingSupplierIds:n,externalSupplierNames:r.filter(e=>"custom"===e.kind).map(e=>e.name)}},reset:()=>{t([]),n([]),l([])}}}let eo=["NO_AWARD_INFO","NO_AWARD_CANCEL","NO_AWARD_RESTART","NO_AWARD_NO_QUOTE"],ed="NO_AWARD_INFO";var ec=a(72171),eu=a(50622),em=a(56941);function ep(e,t){e.invalidateQueries({queryKey:V(t)}),e.invalidateQueries({queryKey:ec.N}),e.invalidateQueries({queryKey:(0,em.Zh)()}),e.invalidateQueries({queryKey:eu.l}),e.invalidateQueries({queryKey:["/v2/rfq/counts-by-status"]})}let ex=(e,t)=>{let a=(e=>{let t=["postV1BuyerRfqCloseAward"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let{data:t}=e??{};return H.A.post("/v1/buyer/rfq/close/award",t,n)},...a}})(e);return(0,Y.n)(a,t)},eh=(e,t)=>{let a=(e=>{let t=["postV2BuyerRfqCloseNegotiation"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let{data:t}=e??{};return H.A.post("/v2/buyer/rfq/close/negotiation",t,n)},...a}})(e);return(0,Y.n)(a,t)},ef=(e,t)=>{let a=(e=>{let t=["postV1BuyerRfqCloseNoAward"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let{data:t}=e??{};return H.A.post("/v1/buyer/rfq/close/no-award",t,n)},...a}})(e);return(0,Y.n)(a,t)};var eg=a(45728),ev=a(12180),ej=a(83390),ey=a(37245),eb=a(75210),eN=a(86107),ew=a(10762);function eq(e){let{sortKey:t,activeSortKey:a,sortDirection:s,onToggle:r,className:l,alignRight:i,children:o}=e,d=t===a;return(0,n.jsx)(eb.nd,{className:l,children:(0,n.jsxs)("button",{type:"button",onClick:()=>{r(t)},className:(0,ew.cn)("flex w-full cursor-pointer items-center gap-1 font-semibold text-sm hover:underline",i&&"justify-end"),children:[(0,n.jsx)("span",{className:"truncate",children:o}),(0,n.jsx)(eN.A,{className:(0,ew.cn)("size-4 shrink-0 transition-transform duration-200",d&&"desc"===s&&"rotate-180",!d&&"invisible")})]})})}function eC(e){let{quotes:t,isLoading:a,mode:l,selectedSupplierIds:i,onSelect:o}=e,{t:d}=(0,r.Bd)(),{sortKey:c,sortDirection:u,sortedQuotes:m,toggleSort:p}
6=function(e){let[t,a]=(0,s.useState)("price"),[n,r]=(0,s.useState)("asc"),l=(0,s.useMemo)(()=>{let a="asc"===n?1:-1;return[...e].sort((e,n)=>(function(e,t,a){if("price"===a)return e.quote.totalprice-t.quote.totalprice;let n="supplier"===a?e.supplier.label:e.supplier.country??"",s="supplier"===a?t.supplier.label:t.supplier.country??"";return n.localeCompare(s)})(e,n,t)*a)},[e,t,n]);return{sortKey:t,sortDirection:n,sortedQuotes:l,toggleSort:e=>{e===t?r(e=>"asc"===e?"desc":"asc"):(a(e),r("asc"))}}}(t);if(a)return(0,n.jsxs)("div",{className:"space-y-2 py-5",children:[(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"})]});if(0===t.length)return(0,n.jsx)("p",{className:"text-muted-foreground py-6 text-sm",children:d("No quotes available.")});let x=i.length>0?String(i[0]):void 0,h=(0,n.jsxs)(eb.XI,{className:"table-fixed",children:[(0,n.jsx)(eb.A0,{className:"bg-table-header",children:(0,n.jsxs)(eb.Hj,{className:"hover:bg-transparent",children:[(0,n.jsx)(eb.nd,{className:"w-10"}),(0,n.jsx)(eq,{sortKey:"supplier",activeSortKey:c,sortDirection:u,onToggle:p,className:"w-1/2",children:d("Supplier")}),(0,n.jsx)(eq,{sortKey:"country",activeSortKey:c,sortDirection:u,onToggle:p,className:"w-1/4",children:d("Country")}),(0,n.jsx)(eq,{sortKey:"price",activeSortKey:c,sortDirection:u,onToggle:p,alignRight:!0,children:d("Quoted price")})]})}),(0,n.jsx)(eb.BF,{children:m.map(e=>{let t=i.includes(e.supplier.companyId);return(0,n.jsxs)(eb.Hj,{"data-state":t?"selected":void 0,className:"h-12 cursor-pointer hover:bg-ghost-hover data-[state=selected]:bg-ghost-hover",onClick:()=>{o(e.supplier.companyId)},children:[(0,n.jsx)(eb.nA,{children:(0,n.jsx)("span",{className:"flex items-center justify-center",children:"single"===l?(0,n.jsx)(ej.i,{value:String(e.supplier.companyId),id:`select-supplier-${e.supplier.companyId}`}):(0,n.jsx)(ev.C,{checked:t,onCheckedChange:()=>{o(e.supplier.companyId)},onClick:e=>{e.stopPropagation()},"aria-label":e.supplier.label})})}),(0,n.jsx)(eb.nA,{className:"truncate font-semibold",title:e.supplier.label,children:e.supplier.label}),(0,n.jsx)(eb.nA,{className:"truncate",title:e.supplier.country??void 0,children:(0,n.jsxs)("span",{className:"flex items-center gap-2",children:[(0,n.jsx)(eg.Y,{countryCode:e.supplier.countryCode}),(0,n.jsx)("span",{className:"truncate",children:e.supplier.country??"—"})]})}),(0,n.jsx)(eb.nA,{className:"text-right tabular-nums",children:(0,f.h_)(e.quote.totalprice)})]},e.quote.quoteId)})})]});return(0,n.jsx)("div",{className:"relative max-h-64 overflow-y-auto rounded-lg border shadow-sm",children:"single"===l?(0,n.jsx)(ej.v,{className:"contents",value:x,onValueChange:e=>{o(Number(e))},children:h}):h})}var ek=a(39708),eI=a(16777),eA=a(92490),eS=a(21005);let eD={companyId:0,technologyIds:[],materialIds:[],certificateIds:[],noOfEmployeesIds:[],industryIds:[],countryCodes:[]};function eR(e){let{onSelectCompany:t,onSelectCustomName:a}=e,{t:l}=(0,r.Bd)(),[i,o]=(0,s.useState)(""),{results:d,searchedTerm:c,isSearching:u,hasSearched:m}
6=function(e){let[t,a]=(0,s.useState)(e);(0,eA.A)(()=>a(e),300,[e]);let n=t.trim(),r=n.length>=3,{data:l,isFetching:i}=(0,K.I)({queryKey:["supplier-byname",n],queryFn:async()=>(await (0,eS.Uv)({filter:{searchText:n,...eD}})).data.data??[],enabled:r,staleTime:6e4,gcTime:3e5});return{results:l??[],searchedTerm:n,isSearching:r&&i,hasSearched:r&&!i}}(i),p=i.trim().length<3;return(0,n.jsx)("div",{className:"rounded-md border",children:(0,n.jsxs)(eI.uB,{shouldFilter:!1,children:[(0,n.jsx)(eI.G7,{value:i,onValueChange:o,placeholder:l("Search supplier by name")}),(0,n.jsxs)(eI.oI,{children:[p&&(0,n.jsx)("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:l("Type at least 3 characters")}),u&&(0,n.jsx)("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:l("Searching...")}),m&&(0,n.jsxs)(n.Fragment,{children:[d.map(e=>(0,n.jsx)(eI.h_,{value:String(e.companyID),className:"min-w-0",onSelect:()=>{var a,n;return a=e.companyID,n=e.label,void(o(""),t({supplierId:a,label:n}))},children:(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[e.countryCode&&(0,n.jsx)(eg.Y,{countryCode:e.countryCode,className:"size-3.5 shrink-0"}),(0,n.jsx)("span",{className:"truncate",title:e.label,children:e.label})]})},e.companyID)),0===d.length&&(0,n.jsx)("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:l('"{{searchTerm}}" could not be found',{searchTerm:c})}),(0,n.jsx)(eI.h_,{value:"__custom__",className:"min-w-0",onSelect:()=>{o(""),a(c)},children:(0,n.jsx)("span",{className:"truncate",children:l("Use “{{name}}”",{name:c})})})]})]})]})})}function e_(e){let{isActive:t,onActivate:a,selection:s,onSelectionChange:l}=e,{t:i}=(0,r.Bd)();return(0,n.jsxs)("div",{className:"border-t pt-8",children:[(0,n.jsx)(ej.v,{value:t?"external":"",onValueChange:a,className:"pb-8",children:(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(ej.i,{value:"external",id:"award-external-supplier"}),(0,n.jsx)(T.d,{htmlFor:"award-external-supplier",className:"cursor-pointer font-normal",children:i("No supplier from this RFQ")})]})}),t&&(null!==s?(0,n.jsxs)("div",{className:"flex items-center justify-between rounded-md border px-card py-2",children:[(0,n.jsx)("span",{className:"min-w-0 truncate text-sm",title:"company"===s.kind?s.label:s.name,children:"company"===s.kind?s.label:s.name}),(0,n.jsxs)(p.Z,{className:"shrink-0",variant:"ghost",size:"sm",onClick:()=>{l(null)},children:[(0,n.jsx)(ek.A,{className:"size-4"}),i("Change")]})]}):(0,n.jsx)(eR,{onSelectCompany:e=>{let{supplierId:t,label:a}=e;l({kind:"company",supplierId:t,label:a})},onSelectCustomName:e=>{l({kind:"custom",name:e})}}))]})}function eE(e){let{quotes:t,isLoading:a,award:s,onBack:l,onSubmit:i,isSubmitting:o,submitLabel:d}=e,{t:c}=(0,r.Bd)(),u=s.isExternalAwardMode?null:s.selectedSupplierId;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"mt-section mb-section",children:(0,n.jsx)(eC,{quotes:t,isLoading:a,mode:"single",selectedSupplierIds:null!==u?[u]:[],onSelect:s.selectTableSupplier})}),(0,n.jsx)(e_,{isActive:s.isExternalAwardMode,onActivate:s.enableExternalAwardMode,selection:s.externalAward,onSelectionChange:s.setExternalAward}),(0,n.jsxs)(er.cs,{className:"mt-section",children:[(0,n.jsx)(p.Z,{variant:"ghost",onClick:l,children:c("Back")}),(0,n.jsx)(p.Z,{onClick:i,disabled:!s.canSubmit||o,children:o?c("Saving…"):d})]})]})}var eF=a(74497);function eB(e){let{value:t,onValueChange:a,idPrefix:l="no-award"}=e,{t:i}=(0,r.Bd)(),o=(0,s.useMemo)(()=>({NO_AWARD_INFO:i("Only Request for Information"),NO_AWARD_CANCEL:i("Project stopped"),NO_AWARD_RESTART:i("RFQ will be restarted"),NO_AWARD_NO_QUOTE:i("No competitive quotes received")}),[i]);return(0,n.jsx)(ej.v,{value:t,onValueChange:a,className:"flex flex-col gap-3 py-2",children:eo.map(e=>(0,n.jsx)(eF.Bz,{className:"cursor-pointer",children:(0,n.jsxs)(eF.xB,{orientation:"horizontal",children:[(0,n.jsx)(ej.i,{value:e,id:`${l}-${e}`}),(0,n.jsx)("span",{className:"text-sm font-semibold",children:o[e]})]})},e))})}function ez(e){let{noAwardReason:t,onReasonChange:a,onBack:s,onSubmit:l,isSubmitting:i,submitLabel:o}=e,{t:d}=(0,r.Bd)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eB,{value:t,onValueChange:a,idPrefix:"close-rfq"}),(0,n.jsxs)(er.cs,{className:"mt-section",children:[(0,n.jsx)(p.Z,{variant:"ghost",onClick:s,children:d("Back")}),(0,n.jsx)(p.Z,{onClick:l,disabled:i,children:i?d("Saving…"):o})]})]})}function eL(e){let{quotesCount:t,onAward:a,onNegotiation:l,onNoAward:i,onCancel:o}=e,{t:d}
6=(0,r.Bd)(),[c,u]=(0,s.useState)(t>0?"award":"no-award");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"pt-2",children:(0,n.jsxs)(ej.v,{value:c,onValueChange:e=>u(e),className:"flex flex-col gap-3",children:[(0,n.jsx)(eF.Bz,{className:"cursor-pointer",children:(0,n.jsxs)(eF.xB,{orientation:"horizontal",children:[(0,n.jsx)(ej.i,{value:"award"}),(0,n.jsx)("span",{className:"text-sm font-semibold",children:d("Award")})]})}),(0,n.jsx)(eF.Bz,{className:"cursor-pointer",children:(0,n.jsxs)(eF.xB,{orientation:"horizontal",children:[(0,n.jsx)(ej.i,{value:"negotiation"}),(0,n.jsx)("span",{className:"text-sm font-semibold",children:d("Negotiation")})]})}),(0,n.jsx)(eF.Bz,{className:"cursor-pointer",children:(0,n.jsxs)(eF.xB,{orientation:"horizontal",children:[(0,n.jsx)(ej.i,{value:"no-award"}),(0,n.jsx)("span",{className:"text-sm font-semibold",children:d("No Award")})]})})]})}),(0,n.jsxs)(er.cs,{className:"mt-section",children:[(0,n.jsx)(p.Z,{variant:"ghost",onClick:o,children:d("Cancel")}),(0,n.jsx)(p.Z,{onClick:function(){"award"===c?a():"negotiation"===c?l():i()},children:d("Next")})]})]})}var eQ=a(148);function eT(e){return"company"===e.kind?e.label:e.name}function eP(e){let{partners:t,onAdd:a,onRemove:s}=e,{t:l}=(0,r.Bd)();return(0,n.jsxs)("div",{className:"flex flex-col gap-element",children:[(0,n.jsx)(eR,{onSelectCompany:e=>{let{supplierId:t,label:n}=e;a({kind:"company",supplierId:t,label:n})},onSelectCustomName:e=>{a({kind:"custom",name:e})}}),t.length>0&&(0,n.jsx)("ul",{className:"flex flex-col gap-tight",children:t.map(e=>(0,n.jsxs)("li",{className:"flex items-center justify-between rounded-md border px-card py-1",children:[(0,n.jsx)("span",{className:"min-w-0 truncate text-sm font-semibold",title:eT(e),children:eT(e)}),(0,n.jsx)(p.Z,{className:"shrink-0",variant:"ghost",size:"icon-sm","aria-label":l("Remove"),onClick:()=>{s(e)},children:(0,n.jsx)(ek.A,{className:"size-4"})})]},"company"===e.kind?`company-${e.supplierId}`:`custom-${e.name}`))})]})}var eO=a(97604);function eM(e){let{suppliers:t,isLoading:a,selectedSupplierIds:s,onToggle:l}=e,{t:i}=(0,r.Bd)();return(0,n.jsx)(eO.q,{isLoading:a,isEmpty:0===t.length,skeleton:(0,n.jsx)(eO.l,{lines:2,className:"flex flex-col gap-2"}),emptyMessage:i("All invited suppliers submitted a quote."),children:(0,n.jsx)("div",{className:"relative max-h-48 overflow-y-auto rounded-lg border shadow-sm",children:t.map(e=>{let t=s.includes(e.companyId);return(0,n.jsxs)(T.d,{htmlFor:`negotiation-invited-${e.companyId}`,className:"flex w-full cursor-pointer items-center gap-gutter px-card py-2 font-normal hover:bg-ghost-hover data-[state=selected]:bg-ghost-hover","data-state":t?"selected":void 0,children:[(0,n.jsx)(ev.C,{className:"shrink-0",id:`negotiation-invited-${e.companyId}`,checked:t,onCheckedChange:()=>{l(e.companyId)}}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",title:e.label??void 0,children:e.label}),(0,n.jsx)("span",{className:"shrink-0 text-sm text-muted-foreground",children:e.country??"—"})]},e.companyId)})})})}function eK(e){let{quotes:t,quotesLoading:a,nonQuotingSuppliers:s,invitedLoading:l,negotiation:i,onBack:o,onSubmit:d,isSubmitting:c,submitLabel:u}=e,{t:m}=(0,r.Bd)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mt-section mb-section flex flex-col gap-section",children:[t.length>0&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)(eQ.J,{className:"font-semibold",children:[m("Suppliers that submitted a quote"),":"]}),(0,n.jsx)(eC,{quotes:t,isLoading:a,mode:"multi",selectedSupplierIds:i.quotedSupplierIds,onSelect:i.toggleQuotedSupplier})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)(eQ.J,{className:"font-semibold",children:[m("Invited suppliers without a quote"),":"]}),(0,n.jsx)(eM,{suppliers:s,isLoading:l,selectedSupplierIds:i.invitedSupplierIds,onToggle:i.toggleInvitedSupplier})]}),(0,n.jsxs)("div",{className:"space-y-2 border-t pt-section",children:[(0,n.jsxs)(eQ.J,{className:"font-semibold",children:[m("No supplier from this RFQ"),":"]}),(0,n.jsx)(eP,{partners:i.extraPartners,onAdd:i.addExtraPartner,onRemove:i.removeExtraPartner})]})]}),(0,n.jsxs)(er.cs,{className:"mt-section",children:[(0,n.jsx)(p.Z,{variant:"ghost",onClick:o,children:m("Back")}),(0,n.jsx)(p.Z,{onClick:d,disabled:!i.canSubmit||c,children:c?m("Saving…"):u})]})]})}function eW(e,t){let a=new Set(t.map(e=>e.supplier.companyId));return e.filter(e=>!a.has(e.companyId))}function eZ(e,t,a){let n=((e,t)=>{let{query:a,axios:n}=t??{};return{queryKey:(null==a?void 0:a.queryKey)??["/v1/matching/invited",...e?[e]:[]],queryFn:t=>{let a,{signal:s}=t;return a={signal:s,...n},H.A.get("/v1/matching/invited",{responseType:"text",...a,params:{...e,...null==a?void 0:a.params}})},...a}})(e,t),s=(0,K.I)(n,a);return s.queryKey=n.queryKey,s}function e$(e){let{open:t,onOpenChange:a,rfq:l,rfqSecondaryId:i}=e,{t:o}=(0,r.Bd)(),{quotes:d,isLoading:c}=(0,ec.u)(l.quoteIds),{data:{data:u=[]}={},isLoading:m}=eZ({rfqId:l.rfqId},{query:{enabled:t&&l.rfqId>0}}),{step:p,setStep:x,award:h,negotiation:f,noAwardReason:g,setNoAwardReason:v,handleBack:j,handleClose:y,submitAward:b,submitNoAward:N,submitNegotiation:w,isSubmitting:q}=function(e){let{rfqId:t,rfqSecondaryId:a,onDone:n}=e,{t:l}
6=(0,r.Bd)(),i=(0,z.jE)(),o=el(),d=ei(),[c,u]=(0,s.useState)("status"),[m,p]=(0,s.useState)(ed),x=()=>{u("status"),o.reset(),d.reset(),p(ed)},h=()=>{ep(i,a),n(),x()},f=ex({mutation:(0,O.h)({successMsg:l("RFQ closed with award"),errorMsg:l("Failed to close RFQ"),onSuccess:h})}),g=ef({mutation:(0,O.h)({successMsg:l("RFQ closed without award"),errorMsg:l("Failed to close RFQ"),onSuccess:h})}),v=eh({mutation:(0,O.h)({successMsg:l("RFQ closed for negotiation"),errorMsg:l("Failed to close RFQ"),onSuccess:h})});return{step:c,setStep:u,award:o,negotiation:d,noAwardReason:m,setNoAwardReason:p,handleBack:()=>{u("status"),o.reset(),d.reset()},handleClose:()=>{n(),x()},submitAward:()=>{let e=o.buildPayload(t);null!==e&&f.mutate({data:e})},submitNoAward:()=>{g.mutate({data:{id:t,reason:m}})},submitNegotiation:()=>{let e=d.buildPayload(t);null!==e&&v.mutate({data:e})},isSubmitting:f.isPending||g.isPending||v.isPending}}({rfqId:l.rfqId,rfqSecondaryId:i,onDone:()=>a(!1)});return(0,n.jsx)(er.tM,{open:t,onOpenChange:e=>{e||y()},children:(0,n.jsxs)(er.IA,{className:"sm:max-w-2xl",children:[(0,n.jsxs)(er.c5,{children:[(0,n.jsx)(er.DH,{children:o("Close request RFQ {{rfqId}}",{rfqId:l.rfqId})}),(0,n.jsx)(er.p2,{children:function(e,t){switch(e){case"status":return t("Select the status of your purchasing process?");case"award":return t("Select the supplier to receive the award.");case"negotiation":return t("Select suppliers for further negotiation.");case"no-award":return t("Why couldn't you award the request?");default:return""}}(p,o)})]}),"status"===p&&(0,n.jsx)(eL,{quotesCount:d.length,onAward:()=>x("award"),onNegotiation:()=>x("negotiation"),onNoAward:()=>x("no-award"),onCancel:y}),"award"===p&&(0,n.jsx)(eE,{quotes:d,isLoading:c,award:h,onBack:j,onSubmit:b,isSubmitting:q,submitLabel:o("Close RFQ",{context:"submit"})}),"negotiation"===p&&(0,n.jsx)(eK,{quotes:d,quotesLoading:c,nonQuotingSuppliers:eW(u,d),invitedLoading:m,negotiation:f,onBack:j,onSubmit:w,isSubmitting:q,submitLabel:o("Close RFQ",{context:"submit"})}),"no-award"===p&&(0,n.jsx)(ez,{noAwardReason:g,onReasonChange:v,onBack:j,onSubmit:N,isSubmitting:q,submitLabel:o("Close RFQ",{context:"submit"})})]})})}var eV=a(75858);function eU(e){let{open:t,onOpenChange:a,rfqId:s}=e,{t:l}=(0,r.Bd)(),o=(0,i.Z)(),d=(0,Z.VV)({mutation:(0,O.h)({successMsg:l("RFQ duplicated"),errorMsg:l("Failed to duplicate RFQ")})});return(0,n.jsx)(eV.di,{open:t,onOpenChange:e=>!e&&a(!1),children:(0,n.jsxs)(eV.AK,{children:[(0,n.jsxs)(eV.eS,{children:[(0,n.jsx)(eV.JU,{children:l("Duplicate RFQ")}),(0,n.jsx)(eV.DZ,{children:l("Create a copy of this RFQ. You will be redirected to the new RFQ.")})]}),(0,n.jsxs)(eV._T,{children:[(0,n.jsx)(eV.X6,{disabled:d.isPending,children:l("Cancel")}),(0,n.jsx)(p.Z,{onClick:()=>{d.mutate({data:{id:s}},{onSuccess:e=>{var t;a(!1);let n=null==(t=e.data)?void 0:t.secondaryId;null!=n&&o({to:"/buyer/create-rfq/$rfqId",params:{rfqId:n}})}})},disabled:d.isPending,children:l(d.isPending?"Duplicating…":"Duplicate")})]})]})})}function eY(e){let{quotesCount:t,onAward:a,onNegotiation:s,onNoAward:l,onCancel:i}=e,{t:o}=(0,r.Bd)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 py-2",children:[(0,n.jsx)(p.Z,{variant:"outline",className:"justify-start",onClick:a,disabled:0===t,children:o("Grant award (Award)")}),(0,n.jsx)(p.Z,{variant:"outline",className:"justify-start",onClick:s,children:o("In negotiation")}),(0,n.jsx)(p.Z,{variant:"outline",className:"justify-start",onClick:l,children:o("No Award")})]}),(0,n.jsx)(er.cs,{children:(0,n.jsx)(p.Z,{variant:"ghost",onClick:i,children:o("Cancel")})})]})}function eH(e){let{open:t,onOpenChange:a,rfq:l,rfqSecondaryId:i}=e,{t:o}=(0,r.Bd)(),{quotes:d,isLoading:c}=(0,ec.u)(l.quoteIds),{data:{data:u=[]}={},isLoading:m}=eZ({rfqId:l.rfqId},{query:{enabled:t&&l.rfqId>0}}),{step:p,setStep:x,award:h,negotiation:f,noAwardReason:g,setNoAwardReason:v,handleBack:j,handleClose:y,submitAward:b,submitNoAward:N,submitNegotiation:w,isSubmitting:q}=function(e){let{rfqId:t,rfqSecondaryId:a,onDone:n}=e,{t:l}
6=(0,r.Bd)(),i=(0,z.jE)(),o=el(),d=ei(),[c,u]=(0,s.useState)("choice"),[m,p]=(0,s.useState)(ed),x=()=>{u("choice"),o.reset(),d.reset(),p(ed)},h={successMsg:l("Result updated"),errorMsg:l("Failed to update result"),onSuccess:()=>{ep(i,a),n(),x()}},f=ex({mutation:(0,O.h)(h)}),g=ef({mutation:(0,O.h)(h)}),v=eh({mutation:(0,O.h)(h)});return{step:c,setStep:u,award:o,negotiation:d,noAwardReason:m,setNoAwardReason:p,handleBack:()=>{u("choice"),o.reset(),d.reset()},handleClose:()=>{n(),x()},submitAward:()=>{let e=o.buildPayload(t);null!==e&&f.mutate({data:e})},submitNoAward:()=>{g.mutate({data:{id:t,reason:m}})},submitNegotiation:()=>{let e=d.buildPayload(t);null!==e&&v.mutate({data:e})},isSubmitting:f.isPending||g.isPending||v.isPending}}({rfqId:l.rfqId,rfqSecondaryId:i,onDone:()=>a(!1)});return(0,n.jsx)(er.tM,{open:t,onOpenChange:e=>{e||y()},children:(0,n.jsxs)(er.IA,{className:"sm:max-w-2xl",children:[(0,n.jsxs)(er.c5,{children:[(0,n.jsx)(er.DH,{children:o("Edit result")}),(0,n.jsx)(er.p2,{children:function(e,t){switch(e){case"choice":return t("Change the result of the closed RFQ: Award, negotiation or No Award.");case"award":return t("Select the supplier to receive the award.");case"negotiation":return t("Select suppliers for further negotiation.");case"no-award":return t("Why couldn't you award the request?");default:return""}}(p,o)})]}),"choice"===p&&(0,n.jsx)(eY,{quotesCount:d.length,onAward:()=>x("award"),onNegotiation:()=>x("negotiation"),onNoAward:()=>x("no-award"),onCancel:y}),"award"===p&&(0,n.jsx)(eE,{quotes:d,isLoading:c,award:h,onBack:j,onSubmit:b,isSubmitting:q,submitLabel:o("Save")}),"negotiation"===p&&(0,n.jsx)(eK,{quotes:d,quotesLoading:c,nonQuotingSuppliers:eW(u,d),invitedLoading:m,negotiation:f,onBack:j,onSubmit:w,isSubmitting:q,submitLabel:o("Save")}),"no-award"===p&&(0,n.jsx)(ez,{noAwardReason:g,onReasonChange:v,onBack:j,onSubmit:N,isSubmitting:q,submitLabel:o("Save")})]})})}var eG=a(36340);function eX(e){let{quotes:t,positionsTotal:a,isLoading:s,selectedCompanyIds:l,onToggleAll:i,onToggleRow:o}=e,{t:d}=(0,r.Bd)(),c=t.length>0&&l.size===t.length;return s?(0,n.jsxs)("div",{className:"space-y-2 py-2",children:[(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"})]}):0===t.length?(0,n.jsx)("p",{className:"text-muted-foreground py-4 text-sm",children:d("No quotes available to export.")}):(0,n.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-md border shadow-sm",children:(0,n.jsxs)(eb.XI,{children:[(0,n.jsx)(eb.A0,{className:"bg-table-header",children:(0,n.jsxs)(eb.Hj,{className:"h-11 hover:bg-table-header",children:[(0,n.jsx)(eb.nd,{className:"h-11 w-10",children:(0,n.jsx)(ev.C,{checked:c,onCheckedChange:e=>i(!!e),"aria-label":d("Select all")})}),(0,n.jsx)(eb.nd,{className:"h-11",children:d("Company name")}),(0,n.jsx)(eb.nd,{className:"h-11 text-right",children:d("Positions")}),(0,n.jsx)(eb.nd,{className:"h-11 text-right",children:d("Total price")})]})}),(0,n.jsx)(eb.BF,{children:t.map(e=>{let t=l.has(e.supplier.companyId);return(0,n.jsxs)(eb.Hj,{"data-state":t?"selected":void 0,className:"h-11 cursor-pointer",onClick:()=>o(e.supplier.companyId),children:[(0,n.jsx)(eb.nA,{className:"w-10",children:(0,n.jsx)(ev.C,{checked:t,onCheckedChange:()=>o(e.supplier.companyId),onClick:e=>e.stopPropagation(),"aria-label":e.supplier.label??void 0})}),(0,n.jsx)(eb.nA,{className:"font-semibold",children:e.supplier.label}),(0,n.jsxs)(eb.nA,{className:"text-right tabular-nums",children:[e.quote.positions.length,a>0?`/${a}`:""]}),(0,n.jsx)(eb.nA,{className:"text-right tabular-nums",children:(0,f.h_)(e.quote.totalprice)})]},e.quote.quoteId)})})]})})}var eJ=a(52926),e0=a(60795),e1=a(44075);function e2(e){let{text:t}=e;return(0,n.jsx)(e1.Bc,{delayDuration:200,children:(0,n.jsxs)(e1.m_,{children:[(0,n.jsx)(e1.k$,{asChild:!0,children:(0,n.jsx)(p.Z,{variant:"ghost",size:"icon","aria-label":t,className:"size-auto p-0 text-muted-foreground hover:bg-transparent hover:text-foreground",children:(0,n.jsx)(eJ.A,{className:"size-3.5"})})}),(0,n.jsx)(e0.P,{className:"max-w-xs",children:t})]})})}var e3=a(31524),e4=a(35022),e6=a(25341);function e8(e){let t=(0,K.I)({queryKey:["quote-overview-rfq-positions",e],queryFn:async()=>{let t=await (0,Z.j4)({id:e});return(0,e6.PA)(t.data??[])},enabled:e>0});return{positions:t.data??[],isLoading:t.isLoading,error:t.error,refetch:t.refetch}}function e5(e){let{open:t,onOpenChange:a,rfq:l}=e,{t:i}=(0,r.Bd)(),o=(null==l?void 0:l.rfqId)??0,d=(0,s.useMemo)(()=>(null==l?void 0:l.quoteIds)??[],[null==l?void 0:l.quoteIds]),{quotes:c,isLoading:u}=(0,ec.u)(d),{positions:m,isLoading:p}=e8(o),x=(null==l?void 0:l.quoteCount)??0,h=Math.max(0,30-x),[f,g]=(0,s.use
6State)(0),[v,j]=(0,s.useState)(new Set),{exportQuotes:y,isExporting:b}=function(){let{t:e}=(0,r.Bd)(),{download:t,isDownloading:a}=(0,e4.B)();return{exportQuotes:function(a,n){let{secondaryId:s,companyIds:r,blankColumnsCount:l}=a;t({fetchBlob:async()=>{let e,t;return(await (e={secondaryId:s,companyIds:r,blankColumnsCount:l},t={responseType:"blob"},H.A.post("/v1/buyer/quote/exporttoexcel",e,t))).data},filename:`quotes-${s}.xlsx`,errorMsg:e("Excel export failed")},{onSuccess:()=>{var t;e3.oR.success(e("Excel export successful")),null==n||null==(t=n.onSuccess)||t.call(n)}})},isExporting:a}}();(0,s.useEffect)(()=>{t&&j(new Set(c.map(e=>e.supplier.companyId)))},[t,c]);let N=Array.from({length:h+1},(e,t)=>({value:String(t),label:String(t)}));return(0,n.jsxs)(L.n,{open:t,onClose:()=>a(!1),title:i("Export quotes"),description:i("Export the quote comparison as an Excel file. Select which quotes should be included."),maxWidth:"sm:max-w-2xl",submitLabel:i("Export"),isPending:b,onSubmit:()=>{l&&y({secondaryId:l.secondaryId,companyIds:Array.from(v),blankColumnsCount:f},{onSuccess:()=>a(!1)})},submitDisabled:0===x||0===v.size,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm mb-0!",children:[(0,n.jsx)("span",{children:i("You can compare a maximum of {{max}} quotes side by side.",{max:30})}),(0,n.jsx)(e2,{text:i('You can compare a maximum of 30 quotes. Further notes can be found in the "Information" worksheet of your Excel export.')})]}),(0,n.jsx)(eX,{quotes:c,positionsTotal:m.length,isLoading:u||p,selectedCompanyIds:v,onToggleAll:e=>{e?j(new Set(c.map(e=>e.supplier.companyId))):j(new Set)},onToggleRow:e=>{j(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})}}),h>0&&(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(T.d,{children:i("Additional empty columns")}),(0,n.jsx)(e2,{text:i("Optional empty columns appended to the Excel export so you can fill in additional notes per quote later.")})]}),(0,n.jsxs)(eG.Tz,{value:String(f),onValueChange:e=>g(Number(e)),children:[(0,n.jsx)(eG.pX,{children:(0,n.jsx)(eG.cm,{})}),(0,n.jsx)(eG.cO,{children:N.map(e=>(0,n.jsx)(eG.mJ,{value:e.value,children:e.label},e.value))})]})]})]})}var e7=a(54953),e9=a(68503),te=a(5418);function tt(e){let{open:t,onOpenChange:a,rfqId:l,rfqLabel:i,rfqInternalCode:o}=e,{t:d}=(0,r.Bd)(),{data:{data:c=[]}={},isLoading:u}=eZ({rfqId:l},{query:{enabled:t&&l>0}}),[m,p]=(0,s.useState)([]),x=(0,s.useMemo)(()=>[{accessorKey:"label",header:e=>{let{column:t}=e;return(0,n.jsx)(te.U,{column:t,children:d("Company name")})}},{accessorKey:"postalCode",header:e=>{let{column:t}=e;return(0,n.jsx)(te.U,{column:t,children:d("Postal code")})}},{accessorKey:"country",header:e=>{let{column:t}=e;return(0,n.jsx)(te.U,{column:t,children:d("Country")})}},{accessorKey:"status",header:e=>{let{column:t}=e;return(0,n.jsx)(te.U,{column:t,children:d("Status")})}}],[d]),h=(0,e7.N4)({data:c,columns:x,state:{sorting:m},onSortingChange:p,getCoreRowModel:(0,e9.HT)(),getSortedRowModel:(0,e9.h5)()}),f=()=>a(!1);return(0,n.jsx)(L.n,{open:t,onClose:f,title:d("Requested suppliers"),description:i?(0,n.jsx)(M,{label:i,rfqId:l,internalCode:o}):null,maxWidth:"sm:max-w-5xl",submitLabel:d("Close"),onSubmit:f,hideCancel:!0,children:u?(0,n.jsxs)("div",{className:"space-y-2 py-4",children:[(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"})]}):0===c.length?(0,n.jsx)("p",{className:"text-muted-foreground py-4 text-sm",children:d("No suppliers have been requested for this RFQ.")}):(0,n.jsx)("div",{className:"max-h-80 overflow-y-auto border rounded-lg shadow-sm",children:(0,n.jsxs)(eb.XI,{children:[(0,n.jsx)(eb.A0,{children:h.getHeaderGroups().map(e=>(0,n.jsx)(eb.Hj,{className:"bg-table-header",children:e.headers.map(e=>(0,n.jsx)(eb.nd,{children:(0,e7.Kv)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,n.jsx)(eb.BF,{children:h.getRowModel().rows.map(e=>{let t=e.original;return(0,n.jsxs)(eb.Hj,{className:"border-0 hover:bg-transparent",children:[(0,n.jsx)(eb.nA,{className:"py-3 font-semibold",children:t.label??"—"}),(0,n.jsx)(eb.nA,{className:"py-3 text-muted-foreground tabular-nums",children:t.postalCode??"—"}),(0,n.jsx)(eb.nA,{className:"py-3 text-muted-foreground",children:t.country??"—"}),(0,n.jsx)(eb.nA,{className:"py-3",children:t.status??"—"})]},t.profileLink??t.label)})})]})})})}var ta=a(73306),tn=a(12905);let ts=e=>["/v1/buyer/rfq/revisions",...e?[e]:[]];function tr(e,t,a){let n=((e,t)=>{let{query:a,axios:n}=t??{};return{queryKey:(null==a?void 0:a.queryKey)??ts(e),queryFn:t=>{let a,{signal:s}=t;return a={signal:s,...n},H.A.get("/v1/buyer/rfq/revisions",{responseType:"text",...a,params:{...e,...null==a?void 0:a.params}})},...a}})(e,t),s=(0,K.I)(n,a);return s.queryKey=n.queryKey,s}var tl=a(47101),ti=a(11064);function to(e){var t;let a,{open:l,onOpenChange:i,rfqId:o,rfqSecondaryId:d,rfqLabel:c,rfqInternalCode:u}=e,{t:m}
6=(0,r.Bd)(),p=(0,z.jE)(),[x,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(void 0),v=()=>{h(""),g(void 0),i(!1)},{mutateAsync:j,isPending:y}=(0,tn.w8)({mutation:(0,O.h)({errorMsg:m("Failed to upload attachment")})}),b=(a=(e=>{let t=["postV1BuyerRfqRevision"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let{data:t}=e??{};return H.A.post("/v1/buyer/rfq/revision",t,n)},...a}})({mutation:(0,O.h)({successMsg:m("Message sent"),errorMsg:m("Failed to send message"),onSuccess:()=>{p.invalidateQueries({queryKey:V(d)}),p.invalidateQueries({queryKey:ts({id:o})}),v()}})}),(0,Y.n)(a,t)),N=b.isPending||y,w=async()=>{let e,t=x.trim();if(t){if(f)try{let{data:t}=await j({data:{attachment:f,type:tl.w["message-document"]}});e=t.attachmentID}catch{return}b.mutate({data:{id:0,rfqId:o,message:t,attachmentId:e,revisionType:ti.J.default}})}};return(0,n.jsxs)(L.n,{open:l,onClose:v,title:m("Message to all"),description:(0,n.jsx)(M,{label:c,rfqId:o,internalCode:u}),maxWidth:"sm:max-w-lg",submitLabel:m("Send message"),submitLoadingLabel:m("Sending…"),onSubmit:w,submitDisabled:!x.trim(),isPending:N,children:[(0,n.jsx)("p",{className:"text-sm",children:m('With "Message to all" you inform every supplier that received this RFQ. The message is also shown as additional information in the RFQ.')}),(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsx)(T.d,{htmlFor:"message-to-all-message",children:m("Your message")}),(0,n.jsx)(P.P,{id:"message-to-all-message",value:x,onChange:e=>h(e.target.value),rows:5,maxLength:2e3,placeholder:m("Text to all suppliers…"),required:!0})]}),(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsx)(T.d,{children:m("Attachment (optional)")}),(0,n.jsx)(ta.s,{value:f,onChange:g,accept:".pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.csv,.txt,.zip,.jpg,.jpeg,.png,.gif,.bmp,.tif,.tiff,.webp,.step,.stp,.stpz,.dwg,.dxf,.prt,.asm,.par,.psm,.x_t,.x_b,.jt",hint:m("Office documents, images, ZIP archives, and 3D/CAD drawings — up to 25 MB"),disabled:N})]})]})}var td=a(76560),tc=a(75835),tu=a(86680);function tm(e){let{open:t,onOpenChange:a,rfqId:s}=e,{t:l}=(0,r.Bd)(),{formatDateTime:i,formatDate:o}=(0,tc.i)(),{trigger:d,isDownloading:c}=(0,tu.H)(),{data:{data:u=[]}={},isLoading:m}=tr({id:s},{query:{enabled:t&&s>0}}),p=()=>a(!1);return(0,n.jsx)(L.n,{open:t,onClose:p,title:l("Sent messages to all"),description:l("History of messages sent to all suppliers."),maxWidth:"max-w-lg lg:max-w-2xl",submitLabel:l("Close"),onSubmit:p,hideCancel:!0,children:m?(0,n.jsxs)("div",{className:"space-y-2 py-4",children:[(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"}),(0,n.jsx)(ey.E,{className:"h-10 w-full"})]}):0===u.length?(0,n.jsx)("p",{className:"text-muted-foreground py-4 text-sm",children:l("No messages sent yet.")}):(0,n.jsx)("div",{className:"max-h-96 space-y-8 overflow-y-auto rounded-lg border p-card",children:u.map(e=>{var t;return(0,n.jsxs)("div",{className:"space-y-element",children:[(0,n.jsxs)("p",{className:"text-muted-foreground text-xs font-semibold",children:[e.name??"—"," \xb7 ",e.date?i(e.date):"—"]}),e.revisionType===ti.J["end-date"]&&e.endDate&&(0,n.jsx)("p",{className:"text-card-value font-semibold",children:l("Offer deadline changed to {{date}}",{date:o(e.endDate)})}),e.message&&(0,n.jsx)("p",{className:"text-card-value whitespace-pre-wrap",children:e.message}),(null==(t=e.attachment)?void 0:t.url)&&(0,n.jsxs)("button",{type:"button",onClick:()=>{var t,a;return d(null==(t=e.attachment)?void 0:t.url,null==(a=e.attachment)?void 0:a.label)},disabled:c,className:"group flex items-center gap-element rounded-md px-card py-element text-sm text-foreground hover:bg-muted disabled:opacity-50",children:[(0,n.jsx)(td.A,{className:"size-4 shrink-0"}),(0,n.jsx)("span",{className:"group-hover:underline",children:e.attachment.label??l("Attachment")})]})]},e.id)})})})}var tp=a(45700),tx=a(64903),th=a(69851),tf=a(68301),tg=a(58508);function tv(e){let{positions:t,quotes:a,currency:s,unit:l,isLoading:i,isAttachmentsLocked:o=!1,showQuoteColumn:d=!0,showDeliveryColumn:c=!0,isSeriesDemand:u=!0,variant:m="grid"}=e,{t:p}=(0,r.Bd)();return(0,n.jsxs)("div",{className:"flex flex-col gap-card print:break-before-page",children:[(0,n.jsx)(th.D,{variant:"section",as:"h2",children:p("Positions")}),(0,n.jsx)(eO.q,{isLoading:i,isEmpty:0===t.length,skeleton:(0,n.jsx)("div",{className:"flex flex-col gap-card",children:["a","b","c"].map(e=>(0,n.jsx)(tf.E,{className:"h-64 w-full"},e))}
6),emptyMessage:p("No positions found"),children:(0,n.jsx)("div",{className:"flex flex-col gap-card",children:t.map(e=>(0,n.jsx)(tg._,{position:e,quotes:a,currency:s,unit:l,lazyLoadGlb:t.length>=4,isAttachmentsLocked:o,showQuoteColumn:d,showDeliveryColumn:c,isSeriesDemand:u,variant:m},e.positionId))})})]})}var tj=a(18359),ty=a(97940),tb=a(61457),tN=a(55813),tw=a(49264);function tq(e){return{positionId:e.id,technologies:e.technologies,posNumber:e.posNumber,materialId:e.materialId,materialDescription:e.materialDescription??null,label:e.label??null,quantities:e.quantities,serialQuantity:e.serialQuantity,deliveryDate:e.deliveryDate??null,dimensions:e.dimensions,description:e.description??null,internalCode:e.internalCode??null,seriesDurationYears:e.seriesDurationYears,attachments:e.attachments}}let tC=(e,t)=>H.A.post("/v1/rfq/documents",void 0,{responseType:"text",...t,params:{...e,...null==t?void 0:t.params}}),tk=(e,t)=>H.A.post("/v1/rfq/ndas",void 0,{responseType:"text",...t,params:{...e,...null==t?void 0:t.params}}),tI=[];function tA(e,t,a,n){return(0,K.I)({queryKey:[e,t],queryFn:async()=>(await a({rfqId:t})).data??tI,enabled:t>0&&n})}function tS(e){let{onDuplicate:t}=e,{t:a}=(0,r.Bd)();return(0,n.jsxs)("div",{className:"flex items-center justify-end gap-element print:hidden",children:[(0,n.jsxs)(p.Z,{variant:"secondary",onClick:t,children:[(0,n.jsx)(S,{className:"size-4"}),a("Duplicate RFQ")]}),(0,n.jsxs)(p.Z,{variant:"secondary",onClick:()=>window.print(),children:[(0,n.jsx)(C.A,{className:"size-4"}),a("Print")]})]})}function tD(e){let{open:t,onOpenChange:a,secondaryId:l,onDuplicate:i}=e,{t:o}=(0,r.Bd)(),{data:d,isLoading:c}=function(e){var t,a;let{rfq:n,isLoading:r}=U(e),l=(null==n?void 0:n.rfqId)??0,{positions:i,isLoading:o}=e8(l),{termsDocuments:d,ndaDocuments:c,isLoading:u}=function(e){let{hasTerms:t=!0,hasNdas:a=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=tA("quote-overview-rfq-terms-documents",e,tC,t),s=tA("quote-overview-rfq-nda-documents",e,tk,a);return{termsDocuments:n.data??tI,ndaDocuments:s.data??tI,isLoading:n.isLoading||s.isLoading}}(l,{hasTerms:((null==n||null==(t=n.termsDocumentIds)?void 0:t.length)??0)>0,hasNdas:((null==n||null==(a=n.ndaDocumentIds)?void 0:a.length)??0)>0});return{data:(0,s.useMemo)(()=>(function(e){let{buyerRfq:t,positions:a,termsDocuments:n=[],ndaDocuments:s=[]}=e;if(t){var r;return{rfq:{rfqId:t.rfqId,status:t.status,label:t.label,ndaRequired:t.ndaRequired,ndaDocuments:s.length>0?s:null,unit:t.unit??null,priceQuantity:t.priceQuantity,currency:t.currency,separateToolCost:t.separateToolCost,demandType:t.demandType,paymentCondition:t.paymentCondition,incoterm:t.incoterm??null,deliveryCondition:t.deliveryCondition,duration:t.duration,reason:t.reason??null,reasonComment:t.reasonComment,endDate:t.endD
6ate??"",termsDocuments:n.length>0?n:null,previewImageUrl:t.previewImageUrl,listData:null,platformScope:t.platformScope},positions:(0,e6.PA)(a).map(tq),metadata:(r=t.quoteCount,{interactionStatus:null,quotingAllowed:!1,accessRestricted:!1,anonymizedAccess:!1,ndaStatus:ty.x.granted,contactVisibilityStatus:tb.k.granted,rfqQuoteCount:r,bookmarked:!1,direct:!1,seriesDemand:!1,downloadAttachmentsUrl:null,state:tN.m.visible,isProcessorCurrentUser:!1,view:tw.Z["quote-creation-available"]}),contactData:{buyerId:0,companyId:0,userDeleted:!1,companyDeleted:!1,companyName:null,street:null,zip:null,city:null,country:null,firstname:null,lastname:null,gender:null,membership:null,totalRfqCount:0,blocked:!1,ndaEnabled:!1,phone:null,profileUrl:null,companyLogoUrl:null,companyImageUrl:null,favorite:!1,companyState:"Active",secondaryCompanyId:""}}}})({buyerRfq:n,positions:i,termsDocuments:d,ndaDocuments:c}),[n,i,d,c]),rfqId:l,isLoading:r||l>0&&(o||u)}}(l),{rfq:u}=U(l),m="buyer"===(0,tx.A)(),p=null==d?void 0:d.rfq,x=(null==d?void 0:d.positions)??[],h=(null==p?void 0:p.currency)??"€",f=(null==p?void 0:p.label)??o("RFQ Details");return(0,n.jsx)(tp.B,{open:t,onClose:()=>a(!1),size:"max",title:f,description:(null==p?void 0:p.rfqId)!=null&&(0,n.jsxs)("span",{className:"flex flex-row flex-wrap items-center gap-card",children:[(0,n.jsx)("span",{children:o("RFQ {{id}}",{id:p.rfqId})}),(null==u?void 0:u.internalCode)&&(0,n.jsx)("span",{className:"text-muted-foreground",children:u.internalCode}),(0,n.jsx)(b.R,{seriesDemand:p.demandType===N.O.series,ndaRequired:p.ndaRequired,reason:p.reason})]}),headerClassName:"relative z-10 bg-card shadow-md",headerActions:(0,n.jsx)(tS,{onDuplicate:i}),printSource:"rfq-drawer",children:(0,n.jsxs)("div",{className:"flex flex-col gap-10 pb-card [--rfq-detail-header-height:0px]",children:[(0,n.jsx)(tj.Z,{data:d,isLoading:c,showTags:!1}),(0,n.jsx)(tv,{positions:x,quotes:[],currency:h,isLoading:c,showQuoteColumn:!1,showDeliveryColumn:!1,unit:null==p?void 0:p.unit,isSeriesDemand:(null==p?void 0:p.demandType)===N.O.series,variant:m?"order-details":"grid"})]})})}function tR(e){let{rfq:t,rfqSecondaryId:a,invitedSuppliersCount:l,revisionsCount:i,lastRevisionDate:o,isDetailRoute:d,onDetailOpenChange:c,closeRfqOpen:u,onCloseRfqOpenChange:m}=e,{t:x}=(0,r.Bd)(),[h,f]=(0,s.useState)(!1),[g,v]=(0,s.useState)(!1),[j,y]=(0,s.useState)(!1),[b,N]=(0,s.useState)(!1),[q,C]=(0,s.useState)(!1),[k,I]=(0,s.useState)(!1),[A,S]=(0,s.useState)(!1),[D,R]=(0,s.useState)(!1),_="Active"===t.status||"Ended"===t.status;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w,{rfq:t,actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(B,{rfq:t,invitedSuppliersCount:l,revisionsCount:i,lastRevisionDate:o,onExportClick:()=>f(!0),onPrintClick:()=>window.print(),onOpenCloseRfq:()=>m(!0),onOpenChangeDeadline:()=>v(!0),onOpenDuplicateRfq:()=>y(!0),onOpenEditResult:()=>N(!0),onOpenMessageToAll:()=>C(!0),onOpenAssignRfq:()=>I(!0),onOpenInvitedSuppliers:()=>S(!0),onOpenRevisions:()=>R(!0),onOpenViewRfq:()=>c(!0)}),_&&(0,n.jsx)(p.Z,{variant:"default",size:"sm",onClick:()=>m(!0),children:x("Close RFQ")})]})}),(0,n.jsx)(e5,{open:h,onOpenChange:f,rfq:t}),(0,n.jsx)(es,{open:g,onOpenChange:v,rfqId:t.rfqId,rfqSecondaryId:a,rfqLabel:t.label,rfqInternalCode:t.internalCode,rfqEndDate:t.endD
6ate}),(0,n.jsx)(tt,{open:A,onOpenChange:S,rfqId:t.rfqId,rfqLabel:t.label,rfqInternalCode:t.internalCode}),(0,n.jsx)(e$,{open:u,onOpenChange:m,rfq:t,rfqSecondaryId:a}),(0,n.jsx)(eU,{open:j,onOpenChange:y,rfqId:t.rfqId}),(0,n.jsx)(eH,{open:b,onOpenChange:N,rfq:t,rfqSecondaryId:a}),(0,n.jsx)(to,{open:q,onOpenChange:C,rfqId:t.rfqId,rfqSecondaryId:a,rfqLabel:t.label,rfqInternalCode:t.internalCode}),(0,n.jsx)(G,{open:k,onOpenChange:I,rfqId:t.rfqId,rfqSecondaryId:a,rfqLabel:t.label,rfqInternalCode:t.internalCode}),(0,n.jsx)(tm,{open:D,onOpenChange:R,rfqId:t.rfqId}),(0,n.jsx)(tD,{open:d,onOpenChange:c,secondaryId:a,onDuplicate:()=>{c(!1),y(!0)}})]})}function t_(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.k,{sticky:!0,isLoading:!0,stackTitleOnMobile:!0,backProps:{to:"/buyer/rfqs/all"},title:"",className:"print:hidden",actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ey.E,{className:"h-8 w-20 rounded-sm"}),(0,n.jsx)(ey.E,{className:"h-8 w-20 rounded-sm"}),(0,n.jsx)(ey.E,{className:"h-8 w-9 rounded-sm"})]}),metaLabel:(0,n.jsx)(ey.E,{className:"h-4 w-16"}),tags:(0,n.jsxs)("div",{className:"flex gap-1.5",children:[(0,n.jsx)(ey.E,{className:"h-5 w-16 rounded-full"}),(0,n.jsx)(ey.E,{className:"h-5 w-16 rounded-full"})]})}),(0,n.jsxs)(d.T,{children:[(0,n.jsxs)("div",{className:"mb-6 flex w-full flex-col items-stretch gap-4 sm:flex-row sm:flex-wrap xl:flex-nowrap",children:[(0,n.jsx)(ey.E,{className:"aspect-square rounded sm:h-compare-card sm:w-auto sm:shrink-0"}),(0,n.jsx)(ey.E,{className:"h-compare-card w-full rounded-lg sm:w-compare-meta sm:shrink-0"}),(0,n.jsx)(ey.E,{className:"h-compare-card min-w-compare-chart flex-1 rounded-lg"}),(0,n.jsxs)("div",{className:"hidden h-compare-card min-w-compare-actions shrink-0 flex-col gap-2 2xl:flex",children:[(0,n.jsx)(ey.E,{className:"min-h-0 flex-1 rounded-lg"}),(0,n.jsx)(ey.E,{className:"min-h-0 flex-1 rounded-lg"})]}),(0,n.jsx)(ey.E,{className:"h-compare-card min-w-compare-chart flex-1 rounded-lg"})]}),(0,n.jsxs)("div",{className:"w-full rounded-lg bg-card p-4",children:[(0,n.jsx)(ey.E,{className:"mb-3 h-10 w-full"}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)(ey.E,{className:"h-8 w-full"}),(0,n.jsx)(ey.E,{className:"h-8 w-full"}),(0,n.jsx)(ey.E,{className:"h-8 w-full"}),(0,n.jsx)(ey.E,{className:"h-8 w-full"}),(0,n.jsx)(ey.E,{className:"h-8 w-full"})]})]})]})]})}var tE=a(1625),tF=a(6954);function tB(e){let{title:t,value:a,description:s,icon:r,className:l,valueClassName:i,iconClassName:o,isLoading:d}=e;return d?(0,n.jsxs)(tF.Zp,{className:(0,ew.cn)("gap-2 rounded-xl",l),children:[(0,n.jsx)(tF.aR,{className:"grid-rows-none gap-y-0 text-muted-foreground",children:(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)(ey.E,{className:"h-4 w-32 mb-1"}),(0,n.jsx)(ey.E,{className:"size-4 rounded-md"})]})}),(0,n.jsx)(tF.Wu,{className:"flex flex-col gap-1",children:(0,n.jsx)("div",{className:"flex items-baseline gap-2",children:(0,n.jsx)(ey.E,{className:"h-9 w-24"})})})]}):(0,n.jsxs)(tF.Zp,{className:(0,ew.cn)("gap-0 rounded-xl",l),children:[(0,n.jsxs)(tF.Wu,{className:"flex flex-1 flex-col items-center justify-center gap-1",children:[(0,n.jsx)("p",{className:(0,ew.cn)("font-bold text-2xl leading-normal",i),children:a??"-"}),s&&(0,n.jsx)("span",{className:"font-bold text-foreground text-lg leading-normal",children:s})]}),(0,n.jsxs)(tF.aR,{className:"grid-rows-none gap-y-0 text-muted-foreground",children:[(0,n.jsx)(tF.ZB,{className:"text-center text-sm leading-normal font-normal",children:t??"-"}),r&&(0,n.jsx)(tF.X9,{className:(0,ew.cn)("[&_svg]:size-4",o),children:r})]})]})}var tz=a(29449),tL=a(80703),tQ=a(66884),tT=a(11483),tP=a(31138),tO=a(1406);function tM(e,t,a){var n;let s,r,l=[...e].sort((e,t)=>e.quote.totalprice-t.quote.totalprice).map((e,n)=>{var s,r;return{index:n+1,price:e.quote.totalprice,name:(null==(s=e.supplier)?void 0:s.label)??t("Quote {{index}}",{index:n+1}),isComplete:null==a||((null==(r=e.quote.positions)?void 0:r.length)??0)>=a}}).filter(e=>e.price>=0),i=l.map(e=>e.price),o=i.length?Math.max(...i):1e5,d=1===l.length,c=(n=o||1e4,s=10**Math.floor(Math.log10(n)),(r=n/s)<=1?.2*s:r<=2?.5*s:s),u=Math.ceil(o/c)*c;return{chartData:l,isSingleQuote:d,singleQuoteTicks:d?[0,o/2,o,1.5*o,2*o]:void 0,xDomain:[0,l.length+1],y
6Domain:d?[0,2*o]:[0,Math.max(u>o?u:u+c,1)]}}function tK(e){let{cx:t,cy:a,fill:s,payload:r}=e,l=(null==r?void 0:r.isComplete)===!1?"var(--muted-foreground)":s;return(0,n.jsx)("circle",{cx:t,cy:a,r:5,fill:l,stroke:"none",className:"chart-point"})}function tW(e){var t;let{active:a,payload:s}=e,r=null==s?void 0:s.find(e=>"price"===e.dataKey);return a&&r?(0,n.jsxs)("div",{className:"bg-tertiary text-tertiary-foreground rounded-md p-gutter shadow-xl",children:[(0,n.jsx)("div",{className:"text-sm font-bold tabular-nums",children:(0,f.h_)(Number(r.value))}),(0,n.jsx)("div",{className:"text-xs",children:null==(t=r.payload)?void 0:t.name})]}):null}function tZ(e){let{quotes:t,totalPositions:a}=e,{t:s}=(0,r.Bd)(),{chartData:l,singleQuoteTicks:i,xDomain:o,yDomain:d}=tM(t,s,a);return 0===l.length?null:(0,n.jsx)(tO.at,{config:{price:{label:s("Price"),color:"var(--primary)"}},className:"h-full w-full",children:(0,n.jsxs)(tz.t,{margin:{top:28,right:16,bottom:2,left:0},children:[(0,n.jsx)(tL.d,{stroke:"var(--border)",strokeWidth:1}),(0,n.jsx)(tQ.W,{dataKey:"index",type:"number",tick:!1,domain:o}),(0,n.jsx)(tT.h,{type:"number",dataKey:"price",domain:d,ticks:i,tickFormatter:e=>(0,f.h_)(e),tick:{fontSize:14},width:88}),(0,n.jsx)(tO.II,{cursor:{strokeDasharray:"3 3"},content:tW}),(0,n.jsx)(tP.Xl,{data:l,dataKey:"price",fill:"var(--color-price)",fillOpacity:1,name:s("Price"),shape:(0,n.jsx)(tK,{})})]})})}var t$=a(11332),tV=a(47077),tU=a(22271);function tY(e){let{rfq:t,isAwarded:a,className:s}=e,{t:l}=(0,r.Bd)(),i=g(t.owner);return(0,n.jsx)("div",{className:(0,ew.cn)("flex h-compare-card min-w-compare-meta flex-1 @compare-banner:flex-none @compare-banner:shrink-0 flex-col justify-start rounded-xl bg-card p-section shadow-card",s),children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-x-card gap-y-element",children:[(0,n.jsx)(t$.O,{label:l("Assignee"),value:(0,n.jsx)("span",{className:"block truncate",title:i,children:i}),underline:!1,className:"col-span-2 pt-0 mt-0",noLabelMargin:!0}),(0,n.jsx)(tU.w,{className:"col-span-2"}),(0,n.jsx)(t$.O,{label:l("Start"),value:(0,f.Yq)(t.startDate),underline:!1,className:"mt-0"}),(0,n.jsx)(t$.O,{label:l("End"),value:(0,f.Yq)(t.endDate),underline:!1,className:"mt-0"}),(0,n.jsx)(tU.w,{className:"col-span-2"}),(0,n.jsx)(t$.O,{label:l("Status"),value:(0,n.jsx)(y.A,{status:t.status,endDate:t.endD
6ate}),underline:!1,noLabelMargin:!0,className:"pb-0 mt-0"}),(0,n.jsx)(t$.O,{label:l("Result"),value:a?(0,n.jsx)(tV.W,{tone:"success",className:"font-bold",children:l("RFQ awarded")}):t.result?(0,n.jsx)(j.O,{result:t.result,variant:"badge"}):(0,n.jsx)("span",{className:"font-normal text-muted-foreground",children:"—"}),underline:!1,noLabelMargin:!0,className:"pb-0 mt-0"})]})})}var tH=a(95433);let tG="Accepted";function tX(e){let t=e.map(e=>e.quote.totalprice).filter(e=>e>=0);return 0===t.length?{minPrice:null,maxPrice:null}:{minPrice:Math.min(...t),maxPrice:Math.max(...t)}}let tJ="min-h-0 min-w-0 flex-1 px-3 py-3 shadow-card [&_[data-slot=card-header]]:px-0 2xl:px-6";function t0(e){var t,a;let{rfq:s,quotes:l,isLoadingQuotes:i,totalPositions:o}=e,{t:d}=(0,r.Bd)(),{minPrice:c,maxPrice:u}=tX(l),m=null!=c&&null!=u,p=(t=s.result,a=l,(0,tH.Pw)(t)||a.some(e=>e.metadata.interactionStatus===tG));return(0,n.jsxs)("div",{className:"@container mt-section mb-10 flex w-full flex-col items-stretch gap-info-gap sm:flex-row sm:flex-wrap 2xl:flex-nowrap print:hidden",children:[(0,n.jsx)("div",{className:"aspect-square overflow-hidden rounded-xl shadow-card sm:h-compare-card sm:w-auto sm:shrink-0",children:(0,n.jsx)(tE._,{src:s.previewImageUrl,imgClassName:"h-full w-full object-cover",size:"lg"})}),(0,n.jsx)(tY,{rfq:s,isAwarded:p}),(0,n.jsxs)("div",{className:"flex h-compare-card w-full flex-col gap-info-gap sm:w-compare-price sm:shrink-0 2xl:w-compare-group 2xl:flex-row",children:[(0,n.jsx)(tB,{title:d("Price range of complete quotes"),value:m?(0,f.h_)(c):"—",valueClassName:m?"text-success text-2xl leading-tight 2xl:text-4xl 2xl:leading-tight":void 0,description:m?`bis ${(0,f.h_)(u)}`:void 0,isLoading:i,className:(0,ew.cn)(tJ,"2xl:py-6")}),(0,n.jsxs)("div",{className:"hidden shrink-0 gap-info-gap xl:flex 2xl:h-compare-card 2xl:min-w-compare-actions 2xl:flex-col",children:[(0,n.jsx)(tB,{title:d("Viewed"),value:s.viewedCount,valueClassName:"text-2xl 2xl:text-4xl",className:tJ}),(0,n.jsx)(tB,{title:d("Quotes"),value:s.quoteCount,valueClassName:"text-2xl 2xl:text-4xl",className:tJ})]})]}),i?(0,n.jsx)(ey.E,{className:"h-compare-card min-w-compare-chart flex-1 shadow-card"}):l.length>0&&(0,n.jsx)("div",{className:"h-compare-card min-w-compare-chart flex-1 overflow-hidden shadow-card rounded-xl bg-card",children:(0,n.jsx)(tZ,{quotes:l,totalPositions:o})})]})}var t1=a(11748),t2=a(40707),t3=a(57068),t4=a(42372),t6=a(91123),t8=a(95958);function t5(e){let{open:t,onClose:a,companyLabel:s,onConfirm:l,isPending:i}=e,{t:o}=(0,r.Bd)();return(0,n.jsx)(eV.di,{open:t,onOpenChange:e=>!e&&a(),children:(0,n.jsxs)(eV.AK,{children:[(0,n.jsxs)(eV.eS,{children:[(0,n.jsx)(eV.JU,{children:o("Block supplier")}),(0,n.jsx)(eV.DZ,{children:o("The company {{company}} will be added to your block list and will no longer have access to your RFQs.",{company:s})})]}),(0,n.jsxs)(eV._T,{children:[(0,n.jsx)(eV.X6,{disabled:i,children:o("Cancel")}),(0,n.jsx)(p.Z,{onClick:l,disabled:i,children:i?`${o("Yes")}…`:o("Yes")})]})]})})}var t7=a(35438);function t9(e){let{open:t,onClose:a,companyLabel:s,onConfirm:l,isPending:i}=e,{t:o}=(0,r.Bd)();return(0,n.jsx)(eV.di,{open:t,onOpenChange:e=>!e&&a(),children:(0,n.jsxs)(eV.AK,{children:[(0,n.jsxs)(eV.eS,{children:[(0,n.jsx)(eV.JU,{children:o("Revoke NDA access")}),(0,n.jsx)(eV.DZ,{children:o("The NDA approval for company {{company}} will be revoked.",{company:s})})]}),(0,n.jsxs)(eV._T,{children:[(0,n.jsx)(eV.X6,{disabled:i,children:o("Cancel")}),(0,n.jsx)(p.Z,{onClick:l,disabled:i,children:o("Yes")})]})]})})}var ae=a(77407),at=a(57853);function aa(e){let{menuItems:t,onSelectItem:a}=e,{t:s}=(0,r.Bd)();return(0,n.jsx)("div",{className:"flex items-center justify-center px-gutter print:hidden",children:(0,n.jsxs)(F.rI,{children:[(0,n.jsx)(F.ty,{asChild:!0,children:(0,n.jsx)(p.Z,{variant:"ghost",size:"icon-sm",className:"sm:size-9","aria-label":s("More options"),children:(0,n.jsx)(at.A,{className:"size-4"})})}),(0,n.jsx)(F.SQ,{align:"end",children:t.map(e=>(0,n.jsx)(F._2,{onSelect:()=>a(e),children:s(e.labelKey)},e.id))})]})})}var an=a(12469),as=a(18997),ar=a(28773),al=a(51343);function ai(e){let{label:t,value:a}=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:t}),(0,n.jsx)("p",{className:"font-semibold",children:a??"—"})]})}function ao(e){let{supplier:t}=e,{t:a}
6=(0,r.Bd)(),[l,i]=(0,s.useState)(null),{handleFavoriteToggle:o,isFavoritePending:d,menuItems:c,runDirect:u,confirmFavoriteRemove:m,confirmNdaRevoke:p,confirmBlock:x,removeFavoritePending:h,ndaUpdatePending:f,blockPending:g}=function(e,t){var a;let n,{t:s}=(0,r.Bd)(),l=(0,z.jE)(),{toggle:i,isPending:o}=(0,an.c)(e.companyId,e.favorite),{data:{data:d}={}}=(0,as.Ek)(),c=(d??[]).some(t=>t.blockedCompanyId===e.companyId),u=(0,ar.Ux)({mutation:(0,O.h)({successMsg:s("Added to favorites"),errorMsg:s("Failed to update favorite")})}),m=(0,ar.l0)({mutation:(0,O.h)({successMsg:s("Removed from favorites"),errorMsg:s("Failed to update favorite")})}),p=(0,ar.Kh)({mutation:(0,O.h)({successMsg:s("NDA approval updated"),errorMsg:s("Failed to update NDA approval")})}),x=(0,as.VM)({mutation:(0,O.h)({successMsg:s("Supplier blocked"),errorMsg:s("Failed to update block list")})}),h=(0,as._v)({mutation:(0,O.h)({successMsg:s("Supplier unblocked"),errorMsg:s("Failed to update block list")})}),f=()=>l.invalidateQueries({queryKey:ec.N}),g=()=>l.invalidateQueries({queryKey:(0,as.bc)()});return{handleFavoriteToggle:i,isFavoritePending:o,menuItems:(n=[{id:"favorite",labelKey:(a={favorite:e.favorite,generalNdaApproval:e.generalNdaApproval,isBlocked:c}).favorite?"Remove from favorites":"Add to favorites",requiresConfirm:a.favorite}],a.favorite&&a.generalNdaApproval&&n.push({id:"nda",labelKey:"Revoke NDA access",requiresConfirm:!0}),n.push({id:"block",labelKey:a.isBlocked?"Unblock supplier":"Block supplier",requiresConfirm:!a.isBlocked}),n),runDirect:async t=>{"favorite"===t?await u.mutateAsync({data:{companyID:e.companyId}}):"block"===t&&(await h.mutateAsync({data:{blockedCompanyId:e.companyId,blockedCompanyRole:al.g.supplier}}),await g()),await f()},confirmFavoriteRemove:async()=>{try{await m.mutateAsync({params:{companyID:e.companyId}}),await f(),t()}catch{}},confirmNdaRevoke:async()=>{try{await p.mutateAsync({data:{CompanyID:e.companyId,Accepted:!1}}),await f(),t()}catch{}},confirmBlock:async()=>{try{await x.mutateAsync({data:{blockedCompanyId:e.companyId,blockedCompanyRole:al.g.supplier}}),await g(),await f(),t()}catch{}},removeFavoritePending:m.isPending,ndaUpdatePending:p.isPending,blockPending:x.isPending}}(t,()=>i(null)),v=[t.authorFirstname,t.authorLastname].filter(Boolean).join(" ")||"—",j=[t.postalCode,t.city].filter(Boolean).join(" ")||t.country||"—",y=t.profilePercentage<50,b="Locked"===t.companyState,N=[{id:"stats",wrapperClassName:"flex-[2]",content:(0,n.jsxs)("div",{className:"flex h-full flex-col justify-center gap-element",children:[(0,n.jsx)(ai,{label:a("Employees"),value:t.noOfEmployees}),(0,n.jsx)(ai,{label:a("Turnover"),value:t.annualTurnover}),(0,n.jsx)(ai,{label:a("Founding year"),value:t.foundationYear})]})},{id:"contact",wrapperClassName:"flex-[4]",content:(0,n.jsxs)("div",{className:"flex h-full flex-col justify-center gap-element",children:[(0,n.jsx)(ai,{label:a("Contact person"),value:v}),(0,n.jsx)(ai,{label:a("Phone"),value:t.phone})]})}];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t8.N,{className:"mb-element mt-section",identity:{name:t.label,coverImage:t.coverImageUrl,logo:t.companyLogoUrl,countryCode:t.countryCode,location:j},profileTo:"/supplier/profiles/$companyId",profileParams:{companyId:t.secondaryCompanyId},favorite:{isFavorite:!!t.favorite,onToggle:()=>{t.favorite?i("favorite"):o().catch(()=>{})},isPending:d},identityExtras:t.generalNdaApproval||y||b?(0,n.jsxs)("div",{className:"mt-auto flex flex-wrap gap-1",children:[t.generalNdaApproval&&(0,n.jsxs)(t2.E,{className:(0,ae.cn)(t1.uQ,"rounded-lg font-bold"),children:[(0,n.jsx)(t4.A,{}),a("NDA")]}),y&&(0,n.jsxs)(t2.E,{variant:"destructive",className:"rounded-lg font-bold",children:[(0,n.jsx)(ek.A,{}),a("No matching")]}),b&&(0,n.jsx)(t6.U,{variant:"warning",children:a("Suspended")})]}):null,columns:N,actions:(0,n.jsx)(aa,{menuItems:c,onSelectItem:e=>{e.requiresConfirm?i(e.id):u(e.id).catch(()=>{})}})}),(0,n.jsx)(t7.S,{open:"favorite"===l,onClose:()=>i(null),companyLabel:t.label,hasNda:t.generalNdaApproval,onConfirm:m,isPending:h}),(0,n.jsx)(t9,{open:"nda"===l,onClose:()=>i(null),companyLabel:t.label,onConfirm:p,isPending:f}),(0,n.jsx)(t5,{open:"block"===l,onClose:()=>i(null),companyLabel:t.label,onConfirm:x,isPending:g})]})}var ad=a(18625),ac=a(94983),au=a(66607),am=a(72860),ap=a(18810),ax=a(27367),ah=a(4311),af=a(39188);function ag(e){let{quote:t,positions:a,separateToolCost:l,unit:i,onAwardClick:o,onRejectClick:d}=e,{t:c}
6=(0,r.Bd)(),[u,m]=(0,s.useState)("angebot"),x=t.quote,h=t.metadata.interactionStatus,f=h===tG||"Rejected"===h,{data:{data:g}={}}=(0,ah.Nv)(),{data:v}=(0,au.G)({rfqId:x.rfqId,counterpartCompanyId:t.supplier.companyId}),j=(null==v?void 0:v.publicId)??null,{data:y,isLoading:b}=(0,ac.L)(j),{send:N,isPending:w}=(0,am.c)(),{startAndSend:q,isPending:C}=(0,ap.F)(),k=async(e,a)=>{j?await N({publicId:j,body:e,files:a}):await q({context:af.v.rfq,rfqId:x.rfqId,supplierCompanyId:t.supplier.companyId,body:e,files:a})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ao,{supplier:t.supplier}),(0,n.jsxs)(t3.z2,{value:u,onValueChange:m,className:"mt-2 flex flex-col",children:[(0,n.jsxs)(t3.J7,{className:"sticky -top-7 z-20 bg-background",children:[(0,n.jsx)(t3.BS,{value:"angebot",children:c("Quote")}),(0,n.jsx)(t3.BS,{value:"nachrichten",children:c("Messages")})]}),(0,n.jsxs)(t3.__,{value:"angebot",forceMount:!0,"data-print-panel":!0,className:"flex flex-col gap-3 px-element data-[state=inactive]:hidden",children:[(0,n.jsxs)("div",{className:"flex justify-end gap-3 print:hidden py-5",children:[(0,n.jsx)(p.Z,{variant:"outline",onClick:()=>window.print(),children:c("Print")}),!f&&d&&(0,n.jsx)(p.Z,{variant:"outline",onClick:()=>{d(t)},children:c("Reject quote")}),!f&&o&&(0,n.jsx)(p.Z,{onClick:()=>{o(t)},children:c("Accept quote")})]}),(0,n.jsx)(ax.G,{quote:t,positions:a,separateToolCost:l,unit:i})]}),(0,n.jsx)(t3.__,{value:"nachrichten",className:"mt-3 flex flex-col",children:(0,n.jsx)(ad.X,{variant:"flat",conversationId:j,opening:null===x.rfqId||void 0===x.rfqId?null:{rfqId:x.rfqId,counterpartCompanyId:t.supplier.companyId},participants:(null==y?void 0:y.participants)??[],isActive:"nachrichten"===u,messages:(null==y?void 0:y.messages)??[],isLoading:b,currentUserUid:(null==g?void 0:g.userID)??0,currentUserCompanyId:(null==g?void 0:g.companyID)??null,emptyTitle:c("No messages yet"),emptyDescription:c("Write a message to the supplier about this RFQ."),onSend:k,isSending:w||C})})]})]})}function av(e){var t,a;let{quote:s,positions:l,rfqSecondaryId:i,rfqNdaRequired:o,separateToolCost:d,unit:c,onClose:u,onAwardClick:m,onRejectClick:p}=e,{t:x}=(0,r.Bd)(),h=null!=s,f=(null==s||null==(t=s.supplier)?void 0:t.label)??x("Quote"),g=(null==s||null==(a=s.quote)?void 0:a.rfqId)??i,v=null!=g?(0,n.jsxs)("span",{className:"flex items-center gap-2",children:[(0,n.jsxs)("span",{children:["RFQ ",g]}),o&&(0,n.jsx)(t2.E,{variant:"outline",className:(0,ew.cn)(t1.uQ,"rounded-lg font-bold"),children:x("NDA")})]}):void 0;return(0,n.jsx)(tp.B,{open:h,onClose:u,title:x("Quote from {{supplierName}}",{supplierName:f}),description:v,size:"2xl",printSource:"quote-drawer",children:s&&(0,n.jsx)("div",{className:"flex flex-col print:block print:h-auto",children:(0,n.jsx)(ag,{quote:s,positions:l,separateToolCost:d,unit:c,onAwardClick:m,onRejectClick:p})})})}var aj=a(17280),ay=a(75756),ab=a(69215),aN=a(86046),aw=a(85803);function aq(e){let{supplier:t}=e,{toggle:a,isPending:r}=(0,an.c)(t.companyId,t.favorite,{invalidationKeys:[$,ec.N["0"]]}),[l,i]=(0,s.useState)(!1),o=async()=>{try{await a(),i(!1)}catch{}};return(0,n.jsxs)("div",{className:"flex items-center justify-center gap-1 [&_svg]:size-6",children:[(0,n.jsx)(aw.d,{isFavorite:t.favorite,onToggle:()=>{t.favorite?i(!0):a().catch(()=>{})},isPending:r,className:"text-foreground"}),t.generalNdaApproval?(0,n.jsx)(aN.b,{companyId:t.companyId}):null,(0,n.jsx)(t7.S,{open:l,onClose:()=>i(!1),companyLabel:t.label,hasNda:t.generalNdaApproval,onConfirm:o,isPending:r})]})}function aC(e,t,a){var n,s,r;let{quote:l,supplier:i}=e;switch(t){case"totalprice":return(0,f.h_)(l.totalprice);case"positions-count":return`${(null==(n=l.positions)?void 0:n.length)??0}`;case"country":return i.country??i.countryCode??"";case"annualTurnover":return i.annualTurnover??"";case"noOfEmployees":return i.noOfEmployees??"";case"foundationYear":return i.foundationYear??"";case"certificates":return(null==(s=i.certificates)?void 0:s.length)?i.certificates.join(", "):"";case"relationship":default:return"";case"deliveryCondition":return l.deliveryCondition??"";case"paymentCondition":return l.paymentCondition??"";case"description":let o;return(o=null==(r=l.description)?void 0:r.trim())||"";case"attachment":return l.attachment?a("Attachment"):""}}var ak=a(20028),aI=a(53051);function aA(e){let{icon:t}=e,a="check"===t.variant?(0,n.jsx)(t4.A,{className:"size-6"}):"cross"===t.variant?(0,n.jsx)(ek.A,{className:"size-6"}):(0,n.jsx)(aj.A,{className:"size-6"});return(0,n.jsxs)(e1.m_,{children:[(0,n.jsx)(e1.k$,{asChild:!0,children:(0,n.jsx)("span",{className:"inline-flex justify-center text-foreground",children:a})}),(0,n.jsx)(e0.P,{className:"max-w-tooltip-text whitespace-normal",children:t.tooltip})]})}function aS(e){var t,a,s;let{quote:l,rfq:i,rowKey:o,isLoading:d,onOpenQuote:c,totalPositions:u}=e,{t:m}=(0,r.Bd)(),{getDeliveryConditionsDisplay:x}=(0,ak.S)(),h=(0,aI.C)();if(d)return(0,n.jsx)(ey.E,{className:"mx-auto h-4 w-3/4"});if(!l)return null;if("certificates"===o&&(null==(t=l.supplier.certificates)?void 0:t.length))return(0,n.jsx)("div",{className:"flex flex-col gap-0.5 text-sm",children:l.supplier.certificates.map(e=>(0,n.jsx)("span",{className:"break-words",children:e},e))});if("totalprice"===o&&c)return(0,n.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,n.jsx)("span",{className:"font-bold text-lg",children:aC(l,o,m)}),(0,n.jsx)(p.Z,{variant:"link",size:"sm",onClick:()=>c(l),className:"h-auto p-0 text-xs",children:m("Details")})]});if("positions-count"===o&&null!=u)return(0,n.jsx)("span",{className:"block text-center",children:`${(null==(a=l.quote.positions)?void 0:a.length)??0}/${u}`});if("attachment"===o&&l.quote.attachment){let{url:e,label:t}=l.quote.attachment;return(0,n.jsxs)(e1.m_,{children:[(0,n.jsx)(e1.k$,{asChild:!0,children:(0,n.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center",children:(0,n.jsx)(ay.A,{className:"size-6 text-foreground"})})}),(0,n.jsx)(e0.P,{children:t})]})}if("deliveryCondition"===o){let e=x(l.quote.incoterm,l.quote.deliveryCondition),t=function(e,t,a){let{quote:n}=e,s=a??n.deliveryCondition??n.incoterm??"";if(!n.incoterm&&!n.deliveryCondition)return null;let r="OTH"===t.incoterm;return!r&&n.incoterm&&n.incoterm===t.incoterm||r&&t.deliveryCondition&&n.deliveryCondition===t.deliveryCondition?{variant:"check",tooltip:s}:{variant:"cross",tooltip:s}}(l,i,e);return t?(0,n.jsx)(aA,{icon:t}):null}if("paymentCondition"===o){let e=function(e,t){let{quote:a}=e;return t.paymentCondition?t.paymentCondition===a.paymentCondition||null==a.paymentCondition?{variant:"check",tooltip:t.paymentCondition}:{variant:"cross",tooltip:a.paymentCondition}:a.paymentCondition?{variant:"message",tooltip:a.paymentCondition}:null}(l,i);return e?(0,n.jsx)(aA,{icon:e}):null}if("description"===o){let e=null==(s=l.quote.description)?void 0:s.trim();return e?(0,n.jsx)(aA,{icon:{variant:"message",tooltip:e}}):null}if("relationship"===o)return(0,n.jsx)(aq,{supplier:l.supplier});if("country"===o){let{countryCode:e}=l.supplier,t=(0,n.jsx)(eg.Y,{countryCode:e,className:"h-5! w-7!"});return(0,n.jsx)("div",{className:"flex justify-center",children:e?(0,n.jsxs)(e1.m_,{children:[(0,n.jsx)(e1.k$,{asChild:!0,children:(0,n.jsx)("span",{className:"inline-flex",children:t})}),(0,n.jsx)(e0.P,{children:(0,ab.qQ)(e.toUpperCase(),h)})]}):t})}return aC(l,o,m)}var aD=a(73302),aR=a(75604);function a_(e){let{name:t,secondaryCompanyId:a,className:s}=e;return a?(0,n.jsx)(aD.N_,{to:"/supplier/profiles/$companyId",params:{companyId:a},target:"_blank",rel:"noreferrer",className:(0,ew.cn)("block min-w-0 max-w-full hover:underline",s),children:(0,n.jsx)(aR.J,{text:t})}):(0,n.jsx)(aR.J,{text:t,className:(0,ew.cn)("max-w-full",s)})}var aE=a(94084),aF=a(16662);function aB(e){let{metadata:t,rfqStatus:a}=e,{t:s}=(0,r.Bd)(),l=function(e,t){let{interactionStatus:a,viewedByBuyer:n}=e;return"None"!==a?a:t===aF.z.archived||n?null:"New"}(t,a);if(!l)return null;let i=function(e,t){switch(e){case"Accepted":return{label:t("Quote accepted"),icon:(0,n.jsx)(t4.A,{className:"size-4"}),variant:"success",className:"hover:bg-success-dark"};case"Rejected":return{label:t("Quote rejected"),icon:(0,n.jsx)(ek.A,{className:"size-4"}),variant:"destructive",className:"hover:bg-destructive-dark"};case"InNegotiation":return{label:t("In negotiation"),icon:(0,n.jsx)(aE.A,{className:"size-4"}),variant:"default",className:"hover:bg-primary"};case"New":return{label:t("New"),icon:null,variant:"default",className:"hover:bg-primary"};default:return null}}
6(l,s);return i?(0,n.jsxs)(e1.m_,{children:[(0,n.jsx)(e1.k$,{asChild:!0,children:(0,n.jsxs)(t6.U,{variant:i.variant,className:(0,ew.cn)("justify-center [&>svg]:size-4",i.className),children:[i.icon,"New"===l&&i.label]})}),(0,n.jsx)(e0.P,{children:i.label})]}):null}let az={background:"linear-gradient(to bottom, var(--background) 12px, var(--muted) 12px)"},aL={width:"var(--radius-xl)",height:"var(--radius-xl)"};function aQ(e){let{side:t}=e;return(0,n.jsx)("div",{className:`pointer-events-none absolute top-3 z-10 ${"left"===t?"left-0":"right-0"}`,style:{...aL,background:`radial-gradient(circle at ${"left"===t?"bottom right":"bottom left"}, transparent var(--radius-xl), var(--background) var(--radius-xl))`}})}let aT="after:absolute after:top-3 after:right-0 after:bottom-0 after:w-px after:bg-background after:content-['']";function aP(e){var t,a;let{quote:s,quoteId:l,isLoading:i}=e,{t:o}=(0,r.Bd)();return i?(0,n.jsx)(ey.E,{className:"mx-auto h-4 w-24"}):(0,n.jsx)(a_,{name:(null==s||null==(t=s.supplier)?void 0:t.label)??o("Quote {{id}}",{id:l}),secondaryCompanyId:null==s||null==(a=s.supplier)?void 0:a.secondaryCompanyId,className:"font-semibold text-sm text-foreground"})}function aO(e){let{rfq:t,quotesByQuoteId:a,isLoading:s,printMode:r}=e,{quoteIds:l}=t;return(0,n.jsx)(eb.A0,{children:(0,n.jsxs)(eb.Hj,{className:"h-quote-header-row bg-table-header hover:bg-table-header",children:[r?(0,n.jsx)(eb.nd,{className:"relative p-0",style:az,children:(0,n.jsx)(aQ,{side:"left"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eb.nd,{className:`sm:sticky sm:left-0 z-20 p-0 ${aT}`,style:az,children:(0,n.jsx)(aQ,{side:"left"})}),(0,n.jsx)(eb.nd,{className:"sm:sticky sm:left-quote-section-label z-20 p-0",style:az})]}),(0,n.jsx)(eb.nd,{className:"quote-sticky-edge sm:sticky sm:left-quote-frozen-width z-20 bg-background p-0"}),l.length>0?l.map((e,r)=>{let i=a.get(e),o=null==i?void 0:i.metadata,d=r===l.length-1;return(0,n.jsxs)(eb.nd,{className:`relative text-center align-top p-0 ${aT}`,style:az,children:[d?(0,n.jsx)(aQ,{side:"right"}):null,o?(0,n.jsx)("div",{className:"-translate-x-1/2 -translate-y-1/2 absolute top-3 left-1/2 z-10 rounded-lg",children:(0,n.jsx)(aB,{metadata:o,rfqStatus:t.status})}):null,(0,n.jsx)("div",{className:"absolute inset-x-0 top-3 bottom-0 flex items-center justify-center px-2",children:(0,n.jsx)(aP,{quote:i,quoteId:e,isLoading:s})})]},e)}):(0,n.jsx)(eb.nd,{className:"border-r text-center text-muted-foreground",style:{width:160},children:"—"})]})})}let aM={overflowWrap:"anywhere",wordBreak:"break-word",whiteSpace:"normal"},aK='w-full rounded-xl bg-card shadow-card relative after:pointer-events-none after:absolute after:-bottom-1.5 after:left-quote-frozen-width after:h-2 after:w-3 after:bg-background after:content-[""] print:after:hidden',aW="overflow-clip rounded-xl",aZ="w-full table-fixed border-separate border-spacing-0 bg-card [&_td]:border-b [&_td]:border-border [&_.quote-sticky-edge]:border-b-0";function a$(e){let{rfq:t,quotes:a,totalPositions:l,isLoadingQuotes:i,onOpenQuote:o,printMode:d}=e,{t:c}=(0,r.Bd)(),{quoteIds:u}=t,m=(0,s.useMemo)(()=>new Map(a.map(e=>[e.quote.quoteId,e])),[a]);function p(){return d?(0,n.jsxs)("colgroup",{children:[(0,n.jsx)("col",{style:{width:240}}),(0,n.jsx)("col",{style:{width:12}}),u.map(e=>(0,n.jsx)("col",{},e))]}):(0,n.jsxs)("colgroup",{children:[(0,n.jsx)("col",{style:{width:208}}),(0,n.jsx)("col",{style:{width:180}}),(0,n.jsx)("col",{style:{width:12}}),u.map(e=>(0,n.jsx)("col",{},e))]})}function x(e,a){return a.map((s,r)=>{let{label:c,rowKey:p}=s,x="totalprice"===p?"bg-quote-row-dark":"positions-count"===p?"bg-quote-row-light":void 0,h="totalprice"===p||"positions-count"===p;return(0,n.jsxs)(eb.Hj,{className:h?"h-quote-total-row":"h-12",children:[0!==r||d?null:(0,n.jsx)(eb.nA,{rowSpan:a.length,className:"sm:sticky sm:left-0 z-20 border-r bg-card pt-4 pl-6 text-left align-top font-semibold text-sm text-foreground",style:aM,children:e}),(0,n.jsx)(eb.nA,{className:(0,ew.cn)("sm:sticky sm:left-quote-section-label z-20 whitespace-normal pr-3 text-right text-sm text-foreground wrap-break-word","totalprice"===p||"positions-count"===p?"bg-quote-row-light":"bg-card"),children:c}),0===r?(0,n.jsx)(eb.nA,{rowSpan:a.length,className:"quote-sticky-edge sm:sticky sm:left-quote-frozen-width z-20 border-b-0 bg-background p-0"}):null,u.length>0?u.map(e=>(0,n.jsx)(eb.nA,{className:(0,ew.cn)("border-r text-center text-sm last:border-r-0",x),style:aM,children:(0,n.jsx)(aS,{quote:m.get(e),rfq:t,rowKey:p,isLoading:i??!1,onOpenQuote:o,totalPositions:l})},e)):(0,n.jsx)(eb.nA,{className:"border-r"})]},`${e}-${p}`)})}let[h,...f]=[{section:c("Quotes"),rows:[{label:c("Total price (largest order quantity)"),rowKey:"totalprice"},{label:c("Offered positions"),rowKey:"positions-count"}]}
6,{section:c("Company details"),rows:[{label:c("Country"),rowKey:"country"},{label:c("Revenue"),rowKey:"annualTurnover"},{label:c("Employees"),rowKey:"noOfEmployees"},{label:c("Founded"),rowKey:"foundationYear"},{label:c("Certificates"),rowKey:"certificates"},{label:c("Supplier relationship"),rowKey:"relationship"}]},{section:c("Purchase conditions"),rows:[{label:c("Delivery conditions"),rowKey:"deliveryCondition"},{label:c("Payment conditions"),rowKey:"paymentCondition"},{label:c("Remarks"),rowKey:"description"},{label:c("Attachment"),rowKey:"attachment"}]}],g=400+160*u.length,v=d?void 0:{minWidth:g};return(0,n.jsxs)("div",{className:"flex w-full flex-col",children:[(0,n.jsx)("div",{className:aK,style:v,children:(0,n.jsx)("div",{className:aW,children:(0,n.jsxs)(eb.XI,{className:aZ,children:[p(),(0,n.jsx)(aO,{rfq:t,quotesByQuoteId:m,isLoading:i,printMode:d}),h?(0,n.jsx)(eb.BF,{children:x(h.section,h.rows)}):null]})})}),f.map(e=>{let{section:t,rows:a}=e;return(0,n.jsx)("div",{className:(0,ew.cn)(aK,"mt-3"),style:v,children:(0,n.jsx)("div",{className:aW,children:(0,n.jsxs)(eb.XI,{className:aZ,children:[p(),(0,n.jsx)(eb.BF,{children:x(t,a)})]})})},t)})]})}function aV(e,t,a){var n,s;let r=null==(n=e.quote.positions)?void 0:n.find(e=>e.positionId===t),l=null==r||null==(s=r.costs)?void 0:s.find(e=>e.scaleId===a);return(null==l?void 0:l.unitCosts)??null}let aU={maxWidth:160,overflowWrap:"anywhere",wordBreak:"break-word",whiteSpace:"normal"};function aY(e){let{position:t,quoteIds:a,quotes:l,quotesByQuoteId:i,isFirst:o,separateToolCost:d}=e,{t:c}=(0,r.Bd)(),u=t.quantities??[],m=t.serialQuantity>0?t.serialQuantity:null,p=u.length+(d?3:2);return(0,n.jsxs)(s.Fragment,{children:[o?null:(0,n.jsx)(eb.Hj,{"aria-hidden":!0,className:"h-3",children:(0,n.jsx)(eb.nA,{colSpan:4+a.length,className:"row-spacer bg-background p-0"})}),u.map((e,s)=>{var r,o;let d,u=(r=t.id,o=e.scaleId,(d=l.map(e=>aV(e,r,o)).filter(e=>null!=e&&e>0)).length?Math.min(...d):null);return(0,n.jsxs)(eb.Hj,{className:"h-12",children:[0===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eb.nA,{rowSpan:p,className:"sm:sticky sm:left-0 z-10 bg-card py-3 text-right align-top",children:t.posNumber}),(0,n.jsx)(eb.nA,{rowSpan:p,className:"sm:sticky z-10 border-r-0 bg-card py-3 align-top",style:{...aU,left:48},children:(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("div",{className:"font-semibold",children:t.label}),t.internalCode?(0,n.jsxs)("div",{className:"text-muted-foreground text-xs",children:[c("Material/part/ID no.")," ",t.internalCode]}):null,null!=m?(0,n.jsxs)("div",{className:"text-muted-foreground text-xs",children:[c("Annual demand"),": ",(0,f.VZ)(m)]}):null,t.seriesDurationYears>0?(0,n.jsxs)("div",{className:"text-muted-foreground text-xs",children:[c("Duration"),": ",t.seriesDurationYears," ",1===t.seriesDurationYears?c("Year"):c("Years")]}):null]})})]}):null,(0,n.jsx)(eb.nA,{className:"sm:sticky z-10 border-r-0 border-l bg-card py-3 text-right align-top",style:{left:208},children:(0,f.VZ)(e.quantity)}),0===s?(0,n.jsx)(eb.nA,{rowSpan:p,className:"quote-sticky-edge quote-gap sm:sticky z-10 bg-background p-0",style:{left:388}}):null,a.map(a=>{let s=i.get(a),r=s?aV(s,t.id,e.scaleId):null,l=null!=r&&null!=u&&r<=u;return(0,n.jsx)(eb.nA,{className:"py-3 text-center align-top",style:{backgroundColor:l?"var(--quote-cell-lowest)":void 0},children:null!=r?(0,f.jx)(r):""},a)})]},e.scaleId)}),(0,n.jsxs)(eb.Hj,{className:"h-12",children:[(0,n.jsx)(eb.nA,{className:"sm:sticky z-10 border-r-0 border-l bg-card py-3 text-right align-top",style:{left:208},children:c("Target price")}),a.map(e=>(0,n.jsx)(eb.nA,{className:"py-3 text-center align-top",children:t.targetPrice?(0,f.jx)(t.targetPrice):"—"},e))]}),d&&(0,n.jsxs)(eb.Hj,{className:"h-12",children:[(0,n.jsx)(eb.nA,{className:"sm:sticky z-10 border-r-0 border-l bg-card py-3 text-right align-top text-wrap",style:{...aU,left:208},children:c("Additional one-time costs")}),a.map(e=>{var a,s,r,l;let o,d,c=i.get(e);return(0,n.jsx)(eb.nA,{className:"py-3 text-center align-top",children:c?(a=t.id,(l=(null==(d=null==(o=null==(s=c.quote.positions)?void 0:s.find(e=>e.positionId===a))||null==(r=o.costs)?void 0:r.map(e=>e.fixedCosts).filter(e=>null!=e))?void 0:d.length)?{min:Math.min(...d),max:Math.max(...d)}:null)&&(0!==l.min||0!==l.max))?l.min===l.max?(0,f.jx)(l.min):`${(0,f.jx)(l.min)} – ${(0,f.jx)(l.max)}`:"—":""},e)})]}),(0,n.jsxs)(eb.Hj,{className:"h-12",children:[(0,n.jsx)(eb.nA,{className:"sm:sticky z-10 border-r-0 border-l bg-card py-3 text-right al
6ign-top",style:{left:208},children:c("Delivery date")}),a.map(e=>{let a,s=i.get(e);return(0,n.jsx)(eb.nA,{className:"py-3 text-center align-top",children:(0,n.jsx)("span",{className:"line-clamp-3 whitespace-normal wrap-anywhere",children:s?"single"===(a=function(e,t){var a,n;let s=null==(a=e.quote.positions)?void 0:a.find(e=>e.positionId===t.id);if(!(null==s||null==(n=s.costs)?void 0:n.length))return{mode:"none"};let r=(t.quantities??[]).map(e=>{let t=s.costs.find(t=>t.scaleId===e.scaleId);return(null==t?void 0:t.deliveryDate)?{quantity:e.quantity,date:t.deliveryDate}:null}).filter(e=>null!=e);if(!r.length)return{mode:"none"};let l=Array.from(new Set(r.map(e=>e.date)));return 1===l.length?{mode:"single",date:l[0]}:{mode:"varies",entries:r}}(s,t)).mode?a.date:"none"===a.mode?c("By agreement"):(0,n.jsxs)(e1.m_,{children:[(0,n.jsx)(e1.k$,{asChild:!0,children:(0,n.jsx)("span",{className:"cursor-help",children:c("Depends on order quantity")})}),(0,n.jsx)(e0.P,{children:(0,n.jsx)("div",{className:"flex flex-col gap-0.5",children:a.entries.map(e=>(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsx)("span",{children:(0,f.VZ)(e.quantity)}),(0,n.jsx)("span",{children:e.date})]},e.quantity))})})]}):""})},e)})]})]})}var aH=a(68436);let aG={overflowWrap:"anywhere",wordBreak:"break-word",whiteSpace:"normal"};function aX(e){let{quoteIds:t,quotesByQuoteId:a,unit:s}=e,{t:l}=(0,r.Bd)();return(0,n.jsx)(eb.A0,{children:(0,n.jsxs)(eb.Hj,{className:"bg-table-header hover:bg-table-header",children:[(0,n.jsx)(eb.nd,{className:"sm:sticky sm:left-0 z-20 bg-table-header py-3 text-sm text-foreground",children:l("Pos.")}),(0,n.jsx)(eb.nd,{className:"sm:sticky z-20 border-r-0 bg-table-header wrap-break-word py-3 text-sm text-foreground text-wrap",style:{left:48},children:l("Part designation")}),(0,n.jsx)(eb.nd,{className:"sm:sticky z-20 border-r-0 border-l bg-table-header wrap-break-word py-3 text-right text-sm text-foreground text-wrap",style:{left:208,...aG},children:(0,n.jsxs)("div",{className:"flex flex-col items-end gap-0",children:[(0,n.jsx)("span",{children:l("Order quantity")}),(0,n.jsx)("span",{className:"text-muted-foreground font-normal text-xs",children:(0,aH.v9)(s,l)})]})}),(0,n.jsx)(eb.nd,{className:"quote-sticky-edge quote-gap sm:sticky z-20 bg-background p-0",style:{left:388}}),t.map(e=>{var t;let s=null==(t=a.get(e))?void 0:t.supplier;return(0,n.jsx)(eb.nd,{className:"py-3 text-center text-sm text-foreground",children:(0,n.jsx)(a_,{name:(null==s?void 0:s.label)??String(e),secondaryCompanyId:null==s?void 0:s.secondaryCompanyId,className:"text-foreground"})},e)})]})})}let aJ='w-full rounded-xl bg-card shadow-card relative after:pointer-events-none after:absolute after:-bottom-1.5 after:left-quote-frozen-width after:h-2 after:w-3 after:bg-background after:content-[""] print:after:hidden',a0="overflow-clip rounded-xl",a1="w-full table-fixed border-separate border-spacing-0 bg-card [&_td]:border-r [&_td]:last:border-r-0 [&_td]:border-b [&_td]:border-border [&_th]:border-r [&_th]:border-border [&_th]:last:border-r-0 [&_.quote-sticky-edge]:border-r-0 [&_.quote-gap]:border-b-0 [&_.row-spacer]:border-0";function a2(e){let{rfq:t,positions:a,quotes:s,quotesByQuoteId:r,isLoadingPositions:l,printMode:i}=e,{quoteIds:o}=t;if(0===a.length&&!l)return null;let d=i?30:48,c=i?140:160,u=i?70:180;function m(){return(0,n.jsxs)("colgroup",{children:[(0,n.jsx)("col",{style:{width:d}}),(0,n.jsx)("col",{style:{width:c}}),(0,n.jsx)("col",{style:{width:u}}),(0,n.jsx)("col",{style:{width:12}}),o.map(e=>(0,n.jsx)("col",{},e))]})}let p=400+160*o.length,x=i?void 0:{minWidth:p};return(0,n.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,n.jsx)("div",{className:aJ,style:x,children:(0,n.jsx)("div",{className:a0,children:(0,n.jsxs)(eb.XI,{className:a1,children:[m(),(0,n.jsx)(aX,{quoteIds:o,quotesByQuoteId:r,unit:t.unit})]})})}),(0,n.jsx)("div",{className:aJ,style:x,children:(0,n.jsx)("div",{className:a0,children:(0,n.jsxs)(eb.XI,{className:a1,children:[m(),(0,n.jsx)(eb.BF,{children:l?Array.from({length:3}).map((e,t)=>
6(0,n.jsx)(eb.Hj,{children:(0,n.jsx)(eb.nA,{colSpan:4+o.length,className:"p-3",children:(0,n.jsx)(ey.E,{className:"h-5 w-full"})})},`skeleton-${String(t)}`)):a.map((e,a)=>(0,n.jsx)(aY,{position:e,quoteIds:o,quotes:s,quotesByQuoteId:r,isFirst:0===a,separateToolCost:t.separateToolCost},e.id))})]})})})]})}function a3(e){let{label:t,value:a,className:s}=e;return(0,n.jsxs)("span",{className:(0,ew.cn)("text-sm text-muted-foreground",s),children:[(0,n.jsxs)("strong",{className:"text-foreground",children:[t,":"]})," ",a??"—"]})}function a4(e){let{cx:t,cy:a,payload:s}=e,r=(null==s?void 0:s.isComplete)===!1?"var(--muted-foreground)":"var(--primary)";return(0,n.jsx)("circle",{cx:t,cy:a,r:5,fill:r,stroke:"none"})}function a6(e){let{quotes:t,totalPositions:a}=e,{t:s}=(0,r.Bd)(),{chartData:l,singleQuoteTicks:i,xDomain:o,yDomain:d}=tM(t,s,a);return(0,n.jsxs)(tz.t,{width:540,height:220,margin:{top:16,right:16,bottom:8,left:0},children:[(0,n.jsx)(tL.d,{stroke:"var(--border)",strokeWidth:1}),(0,n.jsx)(tQ.W,{dataKey:"index",type:"number",tick:!1,domain:o}),(0,n.jsx)(tT.h,{type:"number",dataKey:"price",domain:d,ticks:i,tickFormatter:e=>(0,f.h_)(e),tick:{fontSize:8},width:88}),(0,n.jsx)(tP.Xl,{data:l,dataKey:"price",shape:(0,n.jsx)(a4,{})})]})}function a8(e){let{rfq:t,quotes:a,totalPositions:l}=e,{t:i}=(0,r.Bd)(),{minPrice:o,maxPrice:d}=tX(a),c=null!=o&&null!=d,u=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=()=>{var e;let t=null==(e=u.current)?void 0:e.querySelector("svg");t&&t.setAttribute("viewBox","0 0 540 220")},t=()=>{var e;let t=null==(e=u.current)?void 0:e.querySelector("svg");t&&t.removeAttribute("viewBox")};return window.addEventListener("beforeprint",e),window.addEventListener("afterprint",t),()=>{window.removeEventListener("beforeprint",e),window.removeEventListener("afterprint",t)}},[]),(0,n.jsxs)("div",{className:"pointer-events-none fixed -left-full w-full overflow-hidden break-after-page print:static print:left-auto print:overflow-visible",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-section",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold",children:t.label??`RFQ ${t.rfqId}`}
6),(0,n.jsx)(y.A,{status:t.status,endDate:t.endDate})]}),(0,n.jsxs)("div",{className:"mt-element flex gap-section border-b pb-card text-sm text-muted-foreground",children:[(0,n.jsx)(a3,{label:i("Assignee"),value:g(t.owner)}),(0,n.jsx)(a3,{label:i("Start"),value:(0,f.Yq)(t.startDate)}),(0,n.jsx)(a3,{label:i("End"),value:(0,f.Yq)(t.endDate)})]}),(0,n.jsxs)("div",{className:"mt-section flex shrink-0 flex-nowrap items-stretch gap-card",children:[(0,n.jsx)("div",{className:"h-print-card w-56 shrink-0 overflow-hidden rounded border",children:(0,n.jsx)(tE._,{src:t.previewImageUrl,imgClassName:"h-full w-full object-cover",size:"lg"})}),(0,n.jsx)(tB,{title:i("Price range of complete quotes"),value:c?(0,f.h_)(o):"—",valueClassName:c?"text-techpilot-green":void 0,description:c?`bis ${(0,f.h_)(d)}`:void 0,className:"h-print-card min-w-print-card shrink-0"}),(0,n.jsxs)("div",{className:"flex h-print-card min-w-28 shrink-0 flex-col gap-element",children:[(0,n.jsx)(tB,{title:i("Viewed"),value:t.viewedCount,className:"min-h-0 flex-1 py-3"}),(0,n.jsx)(tB,{title:i("Quotes"),value:t.quoteCount,className:"min-h-0 flex-1 py-3"})]})]}),a.length>0&&(0,n.jsx)("div",{ref:u,className:"print-chart-wrapper mt-page w-full overflow-hidden rounded-lg border bg-card pr-6 print:overflow-visible",children:(0,n.jsx)(a6,{quotes:a,totalPositions:l})})]})}function a5(e){let{rfq:t,quotes:a,positions:s}=e,r=function(e,t){let a=new Map(t.map(e=>[e.quote.quoteId,e])),n=[];for(let t=0;t<e.quoteIds.length;t+=5){let s=e.quoteIds.slice(t,t+5),r=s.map(e=>a.get(e)).filter(e=>null!=e);n.push({rfq:{...e,quoteIds:s},quotes:r,quotesByQuoteId:new Map(r.map(e=>[e.quote.quoteId,e]))})}return n}(t,a);return 0===r.length?null:(0,n.jsx)("div",{className:"quote-compare-print hidden print:block",children:r.map(e=>(0,n.jsxs)("div",{className:"break-after-page last:break-after-auto",children:[(0,n.jsx)(a$,{rfq:e.rfq,quotes:e.quotes,totalPositions:s.length,printMode:!0}),(0,n.jsx)("div",{className:"break-before-page",children:(0,n.jsx)(a2,{rfq:e.rfq,positions:s,quotes:e.quotes,quotesByQuoteId:e.quotesByQuoteId,printMode:!0})})]},e.rfq.quoteIds.join("-")))})}function a7(e){var t,a;let{open:s,onOpenChange:l,quote:i,rfqId:o,rfqSecondaryId:d,rfqLabel:c,rfqStatus:u,onSuccess:m}=e,{t:x}=(0,r.Bd)(),h=(0,z.jE)(),f=ex({mutation:(0,O.h)({successMsg:x("Quote accepted"),errorMsg:x("Failed to accept quote"),onSuccess:()=>{ep(h,d),l(!1),null==m||m()}})}),g=(null==i||null==(t=i.supplier)?void 0:t.label)??x("Supplier"),v=null==i||null==(a=i.supplier)?void 0:a.companyId,j=x(u===aF.z.archived?"The offer from {{supplierName}} will be marked as accepted. The supplier will not receive a notification.":"You are accepting the offer from {{supplierName}}. The RFQ will be closed and the supplier will be notified to discu
6ss the order details.",{supplierName:g});return(0,n.jsx)(eV.di,{open:s,onOpenChange:e=>!e&&l(!1),children:(0,n.jsxs)(eV.AK,{children:[(0,n.jsxs)(eV.eS,{children:[(0,n.jsx)(eV.JU,{children:x("Accept quote")}),(0,n.jsxs)(eV.DZ,{children:[c&&(0,n.jsxs)("span",{className:"block text-xs text-muted-foreground",children:[x("RFQ {{id}}",{id:o})," / ",c]}),(0,n.jsx)("span",{className:"block",children:j})]})]}),(0,n.jsxs)(eV._T,{children:[(0,n.jsx)(eV.X6,{disabled:f.isPending,children:x("Cancel")}),(0,n.jsx)(p.Z,{onClick:()=>{null!=v&&f.mutate({data:{id:o,supplierId:v}})},disabled:f.isPending||null==v,children:x(f.isPending?"Applying…":"Accept quote")})]})]})})}function a9(e){var t,a;let l,{open:i,onOpenChange:o,quote:d,rfqId:c,rfqSecondaryId:u,rfqLabel:m,onSuccess:p}=e,{t:x}=(0,r.Bd)(),h=(0,z.jE)(),[f,g]=(0,s.useState)(""),v=()=>{g(""),o(!1)},j=(l=(e=>{let t=["putV1BuyerQuoteReject"],{mutation:a,axios:n}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},axios:void 0};return{mutationFn:e=>{let{data:t}=e??{};return H.A.put("/v1/buyer/quote/reject",t,n)},...a}})({mutation:(0,O.h)({successMsg:x("Quote rejected"),errorMsg:x("Failed to reject quote"),onSuccess:()=>{ep(h,u),v(),null==p||p()}})}),(0,Y.n)(l,a)),y=(null==d||null==(t=d.supplier)?void 0:t.label)??x("Supplier"),b=null==d?void 0:d.quote.quoteId;return(0,n.jsx)(L.n,{open:i,onClose:v,title:x("Reject quote"),description:(0,n.jsxs)(n.Fragment,{children:[m&&null!=c&&(0,n.jsxs)("span",{className:"block text-xs text-muted-foreground",children:[x("RFQ {{id}}",{id:c})," / ",m]}),(0,n.jsx)("span",{className:"block",children:x("You are rejecting the offer from {{supplierName}}.",{supplierName:y})})]}),submitLabel:x("Reject quote"),submitLoadingLabel:x("Rejecting…"),onSubmit:()=>{null!=b&&j.mutate({data:{id:b,message:f||void 0}})},submitDisabled:null==b,isPending:j.isPending,children:(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsx)(T.d,{htmlFor:"reject-message",children:x("Message (optional)")}),(0,n.jsx)(P.P,{id:"reject-message",value:f,onChange:e=>g(e.target.value),rows:4,maxLength:2e3,placeholder:x("Message to the supplier…")})]})})}var ne=a(53183);function nt(e){var t,a;let r,{rfq:l,nextStep:i}=e,[o,d]=(0,s.useState)(null),[c,u]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!1),[x,h]=(0,s.use
6State)(null),{quotes:f,isLoading:g}=(0,ec.u)(l.quoteIds),{markQuoteViewed:v}=(t=l.quoteIds,a=f.length>0,r=(0,z.jE)(),(0,s.useEffect)(()=>{a&&r.invalidateQueries({queryKey:(0,ne.Zf)()})},[a,r]),{markQuoteViewed:(0,s.useCallback)(e=>{r.setQueryData([...ec.N,t],t=>(null==t?void 0:t.map(t=>t.quote.quoteId===e?{...t,metadata:{...t.metadata,viewedByBuyer:!0}}:t))??t)},[r,t])}),j=null!=o?f.find(e=>e.quote.quoteId===o)??null:null,{positions:y,isLoading:b}=e8(l.rfqId),N=new Map(f.map(e=>[e.quote.quoteId,e])),w=(0,s.useRef)(null),q=l.status!==aF.z.archived&&l.status!==aF.z.deleted;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a8,{rfq:l,quotes:f,totalPositions:y.length}),(0,n.jsx)(t0,{rfq:l,quotes:f,isLoadingQuotes:g,totalPositions:y.length}),i&&(0,n.jsx)("div",{className:"my-3",children:i}),(0,n.jsx)(a5,{rfq:l,quotes:f,positions:y}),(0,n.jsxs)("div",{ref:w,onScroll:()=>{let e=w.current;e&&(e.dataset.quoteScrolled=e.scrollLeft>0?"true":"false")},"data-quote-scrolled":"false",className:"min-w-0 overflow-x-auto overflow-y-hidden print:hidden **:data-[slot=table-container]:w-full **:data-[slot=table-container]:overflow-visible ",children:[(0,n.jsx)(a$,{rfq:l,quotes:f,totalPositions:y.length,isLoadingQuotes:g,onOpenQuote:e=>{let{quote:t}=e;d(t.quoteId),v(t.quoteId)}}),(0,n.jsx)("div",{className:"mt-3",children:(0,n.jsx)(a2,{rfq:l,positions:y,quotes:f,quotesByQuoteId:N,isLoadingPositions:b})})]}),(0,n.jsx)(av,{quote:j,positions:y,rfqSecondaryId:l.secondaryId,rfqNdaRequired:l.ndaRequired,separateToolCost:l.separateToolCost,unit:l.unit,onClose:()=>d(null),onAwardClick:q?e=>{h(e),u(!0)}:void 0,onRejectClick:q?e=>{h(e),p(!0)}:void 0}),(0,n.jsx)(a7,{open:c,onOpenChange:u,quote:x,rfqId:l.rfqId,rfqSecondaryId:l.secondaryId,rfqLabel:l.label,rfqStatus:l.status,onSuccess:()=>{d(null)}}),(0,n.jsx)(a9,{open:m,onOpenChange:p,quote:x,rfqId:l.rfqId,rfqSecondaryId:l.secondaryId,rfqLabel:l.label,onSuccess:()=>{d(null)}})]})}var na=a(92865),nn=a(24337),ns=a(19371);function nr(e){let{title:t,description:a,actionLabel:s,onAction:r}=e;return(0,n.jsxs)("div",{className:"flex w-empty-option-card flex-col gap-element rounded-lg border border-border bg-card p-section text-left shadow-sm",children:[(0,n.jsx)("h3",{className:"text-lg font-bold text-foreground text-center leading-snug",children:t}),(0,n.jsx)("p",{className:"flex-1 text-sm text-center",children:a}),(0,n.jsx)(p.Z,{type:"button",onClick:r,className:"mt-gutter",children:s})]})}var nl=a(65173);function ni(e){let{rfqId:t}=e,{t:a}=(0,r.Bd)(),[l,i]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nn.v,{isFiltered:!1,icon:(0,n.jsx)(na.A,{}),emptyTitle:a("Too bad, no quotes on your RFQ"),emptyDescription:a("You have the following options:"),contentClassName:"max-w-2xl",actions:(0,n.jsxs)("div",{className:"flex w-full flex-col items-center gap-empty-cta pt-section",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center gap-gutter sm:flex-row sm:items-stretch",children:[(0,n.jsx)(nr,{title:a("Duplicate RFQ"),description:a("Try again and start your RFQ anew."),actionLabel:a("Start over"),onAction:()=>i(!0)}),(0,n.jsx)(nr,{title:a("Use the Techpilot Sourcing Service"),description:a("Our sourcing experts solve your tough cases!"),actionLabel:a("Learn more"),onAction:()=>d(!0)})]}),(0,n.jsxs)("div",{className:"text-center text-base font-semibold text-foreground",children:[(0,n.jsx)("p",{children:a("If you have questions, call us:")}),(0,n.jsx)("a",{href:nl.Cw,className:"text-primary hover:underline",children:nl.Q5})]})]})}),(0,n.jsx)(eU,{open:l,onOpenChange:i,rfqId:t}),(0,n.jsx)(ns.P,{open:o,onOpenChange:d,rfqId:t})]})}var no=a(22237);function nd(e){return(0,no.m)(new Date(e),new Date)+1}function nc(e){let{endDate:t,viewedCount:a}=e,{t:s}=(0,r.Bd)(),l=nd(t);return(0,n.jsx)(nn.v,{isFiltered:!1,icon:(0,n.jsx)(I.A,{}),emptyTitle:1===l?s("Your RFQ expires today"):l>1?s("Your request is still running {{daysLeft}} days",{daysLeft:l}):s("Your RFQ has expired and still {{daysLeft}} days open for quotes",{daysLeft:l+30}),emptyDescription:0===a?s("Unfortunately, no quotes have been received yet."):s("Unfortunately, no quotes have been received yet, but the RFQ has been seen already {{viewedCount}} times.",{viewedCount:a})})}var nu=a(96741);function nm(){let{t:e}=(0,r.Bd)();return(0,n.jsx)(nn.v,{isFiltered:!1,icon:(0,n.jsx)(nu.A,{}
6),emptyTitle:e("Pending verification"),emptyDescription:e("This RFQ is pending verification. Verification view will follow in a later slice.")})}function np(e){let{rfq:t,nextStep:a}=e,{t:s}=(0,r.Bd)();return"ToBeVerified"===t.status?(0,n.jsx)(nm,{}):0===t.quoteCount&&"Active"===t.status&&t.endDate&&!(nd(t.endDate)+30<=0)?(0,n.jsxs)(n.Fragment,{children:[a,(0,n.jsx)(nc,{endDate:t.endDate,viewedCount:t.viewedCount})]}):0===t.quoteCount?(0,n.jsxs)(n.Fragment,{children:[a,(0,n.jsx)(ni,{rfqId:t.rfqId})]}):("Active"===t.status||"Ended"===t.status||"Archived"===t.status)&&t.quoteCount>0?(0,n.jsx)(nt,{rfq:t,nextStep:a}):(0,n.jsx)("div",{className:"rounded-lg border border-muted bg-muted/30 p-6 text-center",children:(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:s('Status "{{status}}" — view not yet implemented.',{status:t.status})})})}var nx=a(3417),nh=a(61877);let nf=function(){let{t:e}=(0,r.Bd)(),t=(0,l.g)({strict:!1}).rfqId??"",{rfq:a,isLoading:m,error:p}=U(t),h=(0,i.Z)(),f=!!(0,o._f)()({to:"/buyer/rfqs/$rfqId/detail"}),[g,v]=(0,s.useState)(!1);(0,nx.uR)();let{data:{data:j=[]}={}}=eZ({rfqId:(null==a?void 0:a.rfqId)??0},{query:{enabled:!!(null==a?void 0:a.rfqId)}}),{data:{data:y=[]}={}}=tr({id:(null==a?void 0:a.rfqId)??0},{query:{enabled:!!(null==a?void 0:a.rfqId)}}),b=j.length,N=y.length,w=y.length?y.reduce((e,t)=>!e||t.date&&t.date>e?t.date??e:e,""):void 0;return(0,u.E)(p)?(0,n.jsx)(nh.j,{}):t?(0,n.jsx)(c.E,{isLoading:m,error:p,isEmpty:!a,skeleton:(0,n.jsx)(t_,{}),children:a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tR,{rfq:a,rfqSecondaryId:t,invitedSuppliersCount:b,revisionsCount:N,lastRevisionDate:w,isDetailRoute:f,onDetailOpenChange:e=>{e?h({to:"/buyer/rfqs/$rfqId/detail",params:{rfqId:t},replace:!0}):h({to:"/buyer/rfqs/$rfqId",params:{rfqId:t},replace:!0})},closeRfqOpen:g,onCloseRfqOpenChange:v}),(0,n.jsx)(d.T,{className:"print:px-0 print:py-0",children:(0,n.jsx)(np,{rfq:a,nextStep:"Ended"===a.status?(0,n.jsx)(x,{onCloseRfqClick:()=>v(!0)}):null})})]}):null}):(0,n.jsx)(d.T,{children:(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:e("No RFQ ID specified.")})})}},21237(e,t,a){a.d(t,{C1:()=>T,bL:()=>L,q7:()=>Q});var n=a(36604),s=a(90668),r=a(71024),l=a(72836),i=a(84863),o=a(63347),d=a(20781),c=a(42219),u=a(63129),m=a(1761),p=a(20390),x=a(36736),h="Radio",[f,g]=(0,l.A)(h),[v,j]=f(h),y=n.forwardRef((e,t)=>{let{__scopeRadio:a,name:l,checked:o=!1,required:d,disabled:c,value:u="on",onCheck:m,form:p,...h}=e,[f,g]=n.useState(null),j=(0,r.s)(t,e=>g(e)),y=n.useRef(!1),b=!f||p||!!f.closest("form");return(0,x.jsxs)(v,{scope:a,checked:o,disabled:c,children:[(0,x.jsx)(i.sG.button,{type:"button",role:"radio","aria-checked":o,"data-state":q(o),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:j,onClick:(0,s.mK)(e.onClick,e=>{o||m?.(),b&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),b&&(0,x.jsx)(w,{control:f,bubbles:!y.current,name:l,value:u,checked:o,required:d,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});y.displayName=h;var b="RadioIndicator",N=n.forwardRef((e,t)=>{let{__scopeRadio:a,forceMount:n,...s}=e,r=j(b,a);return(0,x.jsx)(p.C,{present:n||r.checked,children:(0,x.jsx)(i.sG.span,{"data-state":q(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:t})})});N.displayName=b;var w=n.forwardRef(({__scopeRadio:e,control:t,checked:a,bubbles:s=!0,...l},o)=>{let d=n.useRef(null),c=(0,r.s)(d,o),p=(0,m.Z)(a),h=(0,u.X)(t);return n.useEffect(()=>{let e=d.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(p!==a&&t){let n=new Event("click",{bubbles:s});t.call(e,a),e.dispatchEvent(n)}},[p,a,s]),(0,x.jsx)(i.sG.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...l,tabIndex:-1,ref:c,style:{...l.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function q(e){return e?"checked":"unchecked"}w.displayName="RadioBubbleInput";var C=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],k="RadioGroup",[I,A]=(0,l.A)(k,[o.RG,g]),S=(0,o.RG)(),D=g(),[R,_]=I(k),E=n.forwardRef((e,t)=>{let{__scopeRadioGroup:a,name:n,defaultValue:s,value:r,required:l=!1,disabled:u=!1,orientation:m,dir:p,loop:h=!0,onValueChange:f,...g}=e,v=S(a),j=(0,c.jH)(p),[y,b]=(0,d.i)({prop:r,defaultProp:s??null,onChange:f,caller:k});return(0,x.jsx)(R,{scope:a,name:n,required:l,disabled:u,value:y,onValueChange:b,children:(0,x.jsx)(o.bL,{asChild:!0,...v,orientation:m,dir:j,loop:h,children:(0,x.jsx)(i.sG.div,{role:"radiogroup","aria-required":l,"aria-orientation":m,"data-disabled":u?"":void 0,dir:j,...g,ref:t})})})});E.displayName=k;var F="RadioGroupItem",B=n.forwardRef((e,t)=>
6{let{__scopeRadioGroup:a,disabled:l,...i}=e,d=_(F,a),c=d.disabled||l,u=S(a),m=D(a),p=n.useRef(null),h=(0,r.s)(t,p),f=d.value===i.value,g=n.useRef(!1);return n.useEffect(()=>{let e=e=>{C.includes(e.key)&&(g.current=!0)},t=()=>g.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,x.jsx)(o.q7,{asChild:!0,...u,focusable:!c,active:f,children:(0,x.jsx)(y,{disabled:c,required:d.required,checked:f,...m,...i,name:d.name,ref:h,onCheck:()=>d.onValueChange(i.value),onKeyDown:(0,s.mK)(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:(0,s.mK)(i.onFocus,()=>{g.current&&p.current?.click()})})})});B.displayName=F;var z=n.forwardRef((e,t)=>{let{__scopeRadioGroup:a,...n}=e,s=D(a);return(0,x.jsx)(N,{...s,...n,ref:t})});z.displayName="RadioGroupIndicator";var L=E,Q=B,T=z},59118(e,t,a){a.d(t,{k:()=>o});var n=a(22759),s=a(72272),r=a(36604),l=a(94582),i=a(12886);function o(e){let t=(0,n.r)({warn:e?.router===void 0}),a=e?.router||t;if(i.S??a.isServer){let t=a.stores.__store.state;return e?.select?e.select(t):t}let o=(0,r.useRef)(void 0);return(0,l.P)(a.stores.__store,t=>{if(e?.select){if(e.structuralSharing??a.options.defaultStructuralSharing){let a=(0,s.BH)(o.current,e.
6select(t));return o.current=a,a}return e.select(t)}return t})}}}]);

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.