1"use strict";(globalThis.webpackChunkksb_website_node_app=globalThis.webpackChunkksb_website_node_app||[]).push([[7469],{34414(e,t,s){s.d(t,{J:()=>l});var a=s(22155),n=s(90465),r=s(92244),i=s(22492);const l=()=>{let e=(0,r.j)(),t=(0,n.Zp)();return{onClick:(0,a.useCallback)(s=>{let a=new URL(s?.currentTarget?.href),n=a?.pathname,r=a?.search,l=`${n}${r}`;l&&(s.preventDefault(),e((0,i.K6)(t,l)))},[e,t])}}},44183(e,t,s){s.d(t,{E:()=>g});var a=s(22155),n=s(1367),r=s(60217),i=s(81230),l=s(66198);function o(e,t){const s=new Set(t);return e.filter(e=>!s.has(e))}var c=class extends i.Q{#e;#t;#s;#a;#n;#r;#i;#l;#o=[];constructor(e,t,s){super(),this.#e=e,this.#a=s,this.#s=[],this.#n=[],this.#t=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#n.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#s=e,this.#a=t,n.jG.batch(()=>{const e=this.#n,t=this.#u(this.#s);this.#o=t,t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));const s=t.map(e=>e.observer),a=s.map(e=>e.getCurrentResult()),n=e.length!==s.length,r=s.some((t,s)=>t!==e[s]),i=n||r,c=!!i||a.some((e,t)=>{const s=this.#t[t];return!s||!(0,l.f8)(e,s)});(i||c)&&(i&&(this.#n=s),this.#t=a,this.hasListeners()&&(i&&(o(e,s).forEach(e=>{e.destroy()}),o(s,e).forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})),this.#d()))})}getCurrentResult(){return this.#t}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[a,e=>
1this.#m(e??a,t),()=>this.#h(a,s)]}#h(e,t){return t.map((s,a)=>{const n=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#m(e,t){return t?(this.#r&&this.#t===this.#l&&t===this.#i||(this.#i=t,this.#l=this.#t,this.#r=(0,l.BH)(this.#r,t(e))),this.#r):e}#u(e){const t=new Map;this.#n.forEach(e=>{const s=e.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(e):t.set(s,[e])});const s=[];return e.forEach(e=>{const a=this.#e.defaultQueryOptions(e),n=t.get(a.queryHash)?.shift(),i=n??new r.$(this.#e,a);s.push({defaultedQueryOptions:a,observer:i})}),s}#c(e,t){const s=this.#n.indexOf(e);-1!==s&&(this.#t=function(e,t,s){const a=e.slice(0);return a[t]=s,a}(this.#t,s,t),this.#d())}#d(){if(this.hasListeners()){const e=this.#r,t=this.#h(this.#t,this.#o);e!==this.#m(t,this.#a?.combine)&&n.jG.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},u=s(46844),d=s(55494),m=s(29537),h=s(84649),p=s(58328);function g({queries:e,...t},s){const i=(0,u.jE)(s),o=(0,d.w)(),g=(0,m.h)(),b=a.useMemo(()=>e.map(e=>{const t=i.defaultQueryOptions(e);return t._optimisticResults=o?"isRestoring":"optimistic",t}),[e,i,o]);b.forEach(e=>{(0,p.jv)(e),(0,h.LJ)(e,g)}),(0,h.wZ)(g);const[f]=a.useState(()=>new c(i,b,t)),[x,j,D]=f.getOptimisticResult(b,t.combine),y=!o&&!1!==t.subscribed;a.useSyncExternalStore(a.useCallback(e=>y?f.subscribe(n.jG.batchCalls(e)):l.lQ,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),a.useEffect(()=>{f.setQueries(b,t)},[b,t,f]);const I=x.some((e,t)=>(0,p.EU)(b[t],e))?x.flatMap((e,t)=>{const s=b[t];if(s){const t=new r.$(i,s);if((0,p.EU)(s,e))return(0,p.iL)(s,t,g);(0,p.nE)(e,o)&&(0,p.iL)(s,t,g)}return[]}):[];if(I.length>0)throw Promise.all(I);const M=x.find((e,t)=>{const s=b[t];return s&&(0,h.$1)({result:e,errorResetBoundary:g,throwOnError:s.throwOnError,query:i.getQueryCache().get(s.queryHash),suspense:s.suspense})});if(M?.error)throw M.error;return j(D())}},60636(e,t,s){s.d(t,{M:()=>x});var a=s(65723),n=s(22155),r=s(32922),i=s(82867),l=s(58361),o=s(59754),c=s.n(o),u=s(15841),d=s(4650),m=s(82812),h=s(53109),p=s(31909),g=s(83648),b=s(24171);const f=({getFormattedAttachmentName:e,inspectionReport:t})=>{let s=(0,i.A)(),{attachmentDisplayName:r="",attachmentId:o="",attachmentName:f,date:x="",equipmentId:j="",fleetId:D=""}=t,y=c().resolve("fleetManagerApi"),I={attachmentId:o,equipmentId:j,inspectionReportId:o},{isPending:M,mutate:R}=(0,u.n)({mutationFn:()=>y.attachmentDownload(D,I).then(e=>(0,p.i)(e)),mutationKey:g.Q.downloadInspectionReport(D,j,o),onError:()=>{(0,m.Ni)(s.formatMessage(d.D.documentDownloadError))}}),v=(0,n.useCallback)(e=>{e.preventDefault(),R()},[R]);return o&&f?(0,a.jsx)(l.ListLinkItem,{additionalContent:(0,h.Yq)(s,x),href:"#",iconName:"download_default",iconPos:"left",isDisabled:M,isDownload:!0,label:(0,a.jsx)(b.C,{shouldOpenInNewTab:!0,children:e({attachmentDisplayName:r,attachmentName:f})}),onClick:v,target:l.LinkTarget.blank},t.attachmentId):null},x=({inspectionReports:e,useTempAttachmentNameFormatting:t})=>{let s=({attachmentDisplayName:e="",attachmentName:s=""})=>e||(t?(e=>{let t=e.split("_"),s=e.split("#");return t.length>1?t[t.length-1].split(".").slice(0,-1).join(""):s.length>1?s[s.length-1].split(".").slice(0,-1).join(""):e})(s):s);return(0,a.jsx)(a.Fragment,{children:e&&e.length&&(0,a.jsx)(r.List,{type:"download",children:e.map(e=>{let{attachmentId:t=""}=e;return(0,a.jsx)(f,{getFormattedAttachmentName:s,inspectionReport:e},t)})})})}},97469(e,t,s){s.r(t),s.d(t,{FleetManagerFleets:()=>ne});var a=s(65723),n=s(22155),r=s(19765),i=s(82867),l=s(55378),o=s(3416),c=s(97027),u=s(70566),d=s(26294),m=s(90465),h=s(58361),p=s(43558),g=s(30713),b=s(96297),f=s(59754),x=s.n(f),j=s(42254),D=s(75442),y=s(69285),I=s(91644),M=s(83648),R=s(60636),v=s(4650);const k=({fleetId:e})=>{let t=(0,i.A)(),s=x().resolve("fleetManagerApi"),[r,l]=(0,n.useState)(0),{data:{inspectionReports:o,pagination:c}={},error:u,isPending:m,isSuccess:h}=(0,b.I)({enabled:!!e,queryFn:()=>s.getFleetInspectionReports(e,{page:{currentPage:r,pageSize:10,sort:"dateDesc"}}),queryKey:M.Q.fleetInspectionReports(e,r)});return u?(0,a.jsx)(I.K,{}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(D.Headline,{numRank:2,children:t.formatMessage(v.D.attachedDocumentsHeadline)}),m&&(0,a.jsx)(d.Stack,{itemAlignment:d.StackItemAlignment.center,children:(0,a.jsx)(y.InlineLoader,{})}),h&&!o?(0,a.jsx)("span",{className:"text-sm font-bold",children:t.formatMessage(v.D.noAttachedDocumentsAvailable)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(R.M,{inspectionReports:o}),c?(0,a.jsx)(j.Pagination,{currentPageIndex:r,lastPageIndex:c.totalPages??1,onPageChange:e=>l(e),pageSize:10,totalItems:c.totalResults??0}):null]})]})};
1var C=s(53109);const S=({fleetId:e})=>{let t,s=(0,i.A)(),n=x().resolve("fleetManagerApi"),{data:r,error:l,isPending:o}=(0,b.I)({enabled:!!e,queryFn:()=>n.getFleetMasterData(e),queryKey:M.Q.masterData(e),staleTime:6e4});if(l)return(0,a.jsx)(I.K,{});let c=r?.address&&(t=r.address,Array.from(new Map([["country",s.formatMessage(v.D.masterDataCountryLabel)],["state",s.formatMessage(v.D.masterDataStateLabel)],["city",s.formatMessage(v.D.masterDataCityLabel)],["postalCode",s.formatMessage(v.D.masterDataPostalCodeLabel)],["street",s.formatMessage(v.D.masterDataStreetLabel)],["streetNumber",s.formatMessage(v.D.masterDataStreetNumberLabel)],["building",s.formatMessage(v.D.masterDataBuildingLabel)],["floor",s.formatMessage(v.D.masterDataFloorLabel)],["longitude",s.formatMessage(v.D.masterDataLongitudeLabel)],["latitude",s.formatMessage(v.D.masterDataLatitudeLabel)]]),([e,s])=>({label:s,value:t[e]??"â"})));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Headline,{numRank:2,children:s.formatMessage(v.D.masterDataTitle)}),o&&(0,a.jsx)(d.Stack,{itemAlignment:d.StackItemAlignment.center,children:(0,a.jsx)(y.InlineLoader,{})}),!r||(0,C.RI)(r)&&(0,a.jsx)("span",{className:"text-sm font-bold",children:s.formatMessage(v.D.noMasterDataAvailable)}),c&&c.length&&(0,a.jsx)(h.DescriptionList,{type:"multiline",children:c?.map(({label:e,value:t})=>(0,a.jsx)(h.DescriptionListLabelValueItem,{label:e,value:t},`${e}-${t}`))})]})},w=()=>{let e=(0,p.i5)(),t=(0,g.y)("myKSBMyEquipmentHub"),{search:s}=(0,m.zy)(),r=decodeURIComponent(new URLSearchParams(s).get("siteId")??"");return(0,n.useEffect)(()=>{r||e((0,p.aW)(t))},[r,e,t]),(0,a.jsxs)(h.Row,{children:[(0,a.jsx)(h.Col,{md:6,children:(0,a.jsx)(k,{fleetId:r})}),(0,a.jsx)(h.Col,{md:{offset:2,size:4},children:(0,a.jsx)(S,{fleetId:r})})]})};var q=s(72546),T=s(1360),L=s(14567),P=s(34414);const E=()=>{let{href:e,label:t,title:s}=(0,L.bd)(),{isLoading:n,label:r,title:i}=(0,L._e)(),{onClick:l}=(0,P.J)();return(0,a.jsx)(T.a,{children:n?null:(0,a.jsx)(q.Breadcrumb,{items:[{href:e,label:t,title:s},{isActive:!0,label:r,title:i}],onClick:l})})};var A=s(80868),F=s(44183),N=s(81322),O=s(523),H=s(32073),Q=s(83610),z=s(86399),B=s(28545),K=s(39439),_=s(92244),U=s(7006),$=s(19385),J=s(46717),G=s(49525),W=s(32693),Z=s(94058);const V=({equipment:e,fleetId:t})=>{let{equipmentId:s="",imageId:n="id",imageName:r="",name:i="",serialNumber:l="",status:o,type:c=""}=e,{pumpLink:u}=(0,J.b)({equipmentId:s,fleetId:t,serialNumber:l});return(0,a.jsxs)(N.TR,{children:[(0,a.jsx)(N.TD,{children:"link"===u.kind?(0,a.jsx)(U.Link,{size:$.ButtonSize.small,...u.linkProps,children:i}):i}),(0,a.jsx)(N.TD,{children:(0,a.jsx)(Z.e,{equipmentId:s,fleetId:t,imageId:n,imageName:r,children:c})}),(0,a.jsx)(N.TD,{children:"link"===u.kind?(0,a.jsx)(U.Link,{size:$.ButtonSize.small,...u.linkProps,children:l}):l}),(0,a.jsx)(N.TD,{children:(0,a.jsx)(W.u,{status:o})}),(0,a.jsx)(N.TD,{children:(0,a.jsxs)(h.Stack,{itemDirection:d.StackItemDirection.alwaysInRow,children:[(0,a.jsx)(G.K,{equipment:e}),"link"===u.kind&&(0,a.jsx)(U.Link,{buttonOption:$.ButtonOption.secondary,isLabelHidden:!0,prefixIconName:"arrow_right",size:$.ButtonSize.small,title:i,...u.linkProps})]})})]})},Y=({fleetEquipmentData:e,fleetId:t})=>e?(0,a.jsx)(a.Fragment,{children:e.map(e=>(0,a.jsx)(V,{equipment:e,fleetId:t},e.equipmentId))}):null;let X=x().resolve("fleetManagerApi");const ee=()=>{let e=(0,i.A)(),t=(0,_.G)(K.Mx),s=(0,p.i5)(),r=(0,g.y)("myKSBMyEquipmentHub"),[l,o]=(0,n.useState)(0),{search:c}=(0,m.zy)(),u=decodeURIComponent(new URLSearchParams(c).get(H.O.SITE_ID)??""),[{data:d,error:h,isPending:b},{data:f}]=(0,F.E)({queries:[{enabled:!!u,queryFn:()=>X.getFleetEquipment(u,{page:{currentPage:l,pageSize:10}}),queryKey:M.Q.pumps(u,l)},{enabled:!!u,queryFn:()=>X.getFleetMasterData(u),queryKey:M.Q.masterData(u),staleTime:6e4}]});if((0,n.useEffect)(()=>{u||t||s((0,p.aW)(r))},[u,s,r,t]),h)return(0,a.jsx)(I.K,{});let x=b||!d;return(0,a.jsxs)(a.Fragment,{children:[f?.name?(0,a.jsx)(D.Headline,{children:f.name}):null,(0,a.jsxs)(N.Table,{verticalCellAlignment:O.q.Top,children:[(0,a.jsxs)("colgroup",{children:[(0,a.jsx)(N.Col,{width:"30%"}),(0,a.jsx)(N.Col,{width:"30%"}),(0,a.jsx)(N.Col,{width:"20%"}),(0,a.jsx)(N.Col,{width:"10%"}),(0,a.jsx)(N.Col,{width:"10%"})]}),(0,a.jsx)(N.THead,{children:(0,a.jsxs)(N.TR,{children:[(0,a.jsx)(N.TH,{children:e.formatMessage(v.D.fleetDetailsPumpsTableHeaderPumpIdentification)}),(0,a.jsx)(N.TH,{children:e.formatMessage(v.D.fleetDetailsPumpsTableHeaderType)}),(0,a.jsx)(N.TH,{children:e.formatMessage(v.D.fleetDetailsPumpsTableHeaderSerialNumber)}),(0,a.jsxs)(N.TH,{children:[e.formatMessage(v.D.fleetDetailsPumpsTableHeaderStatus),(0,a.jsx)(B.n,{})]}),(0,a.jsx)(N.TH,{children:e.formatMessage(v.D.fleetDetailsPumpsTableHeaderActions)})]})}),(0,a.jsx)(N.TBody,{children:(0,a.jsxs)(a.Fragment,{children:[x?(0,a.jsx)(Q.O,{colSpan:5}):(0,a.jsx)(Y,{fleetEquipmentData:d?.equipments,fleetId:u}),d&&!d?.equipments&&(0,a.jsx)(z.p,{colSpan:5,message:e.formatMessage(v.D.noPumpsAvailable)})]})})]}),(0,a.jsx)(j.Pagination,{currentPageIndex:l,lastPageIndex:d?.pagination?.totalPages??1,onPageChange:e=>o(e),pageSize:10,totalItems:d?.pagination?.totalResults??0})]})};var te,se=((te=se||{})[te.Pumps=0]="Pumps",te[te.InspectionReportsAndMasterData=1]="InspectionReportsAndMasterData",te);const ae=()=>{let e=(0,i.A)(),t=[{content:(0,a.jsx)(ee,{}),id:0,label:e.formatMessage(v.D.fleetDetailsTabMenuTab1)},{content:(0,a.jsx)(w,{}),id:1,label:e.formatMessage(v.D.fleetDetailsTabMenuTab2)}];return(0,a.jsxs)(d.Stack,{gap:2.5,children:[(0,a.jsxs)(d.Stack,{contentJustify:d.StackContentJustify.spaceBetween,itemDirection:d.StackItemDirection.row,children:[(0,a.jsx)(E,{}),(0,a.jsx)(A.b,{})]}),(0,a.jsx)(l.a,{children:({isItemActive:e,toggleItem:s})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.AM,{layout:o.aQ.Small,children:t.map(t=>(0,a.jsx)(c.z,{index:t.id,isActive:e(t.id),onClick:()=>s(t.id),children:t.label},`navigation-${t.id}`))}),(0,a.jsx)(u.N,{children:t.map(t=>e(t.id)&&t.content)})]})})]})},ne=()=>(0,a.jsx)(r.j,{children:(0,a.jsx)(ae,{})})}}]);
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.