"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9841],{76225:(e,t,a)=>{a.d(t,{O:()=>i});var l=a(81905),s=a(65103);let i=()=>{let{isBlueErpIntegrationEnabled:e,userErpType:t,isB2BUser:a,isDarmstadtUser:i}=(0,l.iZ)();if(e&&!i){if(!a)return"erp_type:all";if(a&&t===s.zI.Blue)return"erp_type:blue"}}},79841:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ee});var l=a(37876),s=a(14232),i=a(77328),o=a.n(i),r=a(89996),n=a(30888),d=a(56951),c=a(81905),u=a(35152),v=a(99607),h=a(56049),g=a(16191),p=a(77546),m=a(77742),f=a(18608),S=a(71538),x=a(77018),y=a(63724),R=a(38554),j=a(6995),A=a(21834),P=a(5612),N=a(85278);let T=(0,f.makeStyles)()(e=>({container:{fontWeight:e.typography.fontWeightBold,marginTop:e.spacing(4)},heading:{fontSize:e.typography.pxToRem(12),[e.breakpoints.up("md")]:{fontSize:e.typography.pxToRem(16)}},link:{color:e.palette.primary.main,fontSize:e.typography.pxToRem(14),lineHeight:1.5,[e.breakpoints.up("md")]:{fontSize:e.typography.pxToRem(16)}}})),k=e=>{let{terms:t,focus:a}=e,{formatMessage:s}=(0,m.A)(),{classes:i}=T(),o=t?t.slice(0,3):[];return(null==o?void 0:o.length)?(0,l.jsxs)("div",{className:i.container,children:[(0,l.jsx)("div",{className:i.heading,children:"".concat(s(A.default.DID_YOU_MEAN))}),o.map(e=>(0,l.jsx)("div",{children:(0,l.jsx)(P.N,{href:"".concat(r.wO.searchResults(null==e?void 0:e.term)).concat((0,d.$c)({term:null==e?void 0:e.term,focus:a})),passHref:!0,children:(0,l.jsx)(R.A,{color:"secondary",className:i.link,children:(0,l.jsx)(N.A,{value:null==e?void 0:e.term})})})},null==e?void 0:e.term))]}):null};var _=a(14008),b=a(29927),M=a(41126),C=a(16534),F=a(76113),W=a(30566),O=a(78851),E=a(26849),L=a(78044),G=a(8733);let w=(0,f.makeStyles)()(e=>({notFindingText:{fontWeight:e.typography.fontWeightBold}})),B=()=>{let{classes:e}=w();return(0,l.jsx)(L.A,{alertMessage:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.A,{className:e.notFindingText,children:(0,l.jsx)(G.A,{id:"AI_ASSISTANT_NOT_FINDING_WHAT_YOU_ARE_LOOKING_FOR",defaultMessage:"Not finding what you are looking for?"})}),(0,l.jsx)(x.A,{children:(0,l.jsx)(G.A,{id:"LET_PRODUCT_ASSISTANT_HELP",defaultMessage:"Let the Product Assistant help you discover the right solution."})})]}),gaSection:"no search results"})};var D=a(9819);let I=(0,f.makeStyles)()(e=>({verticalSpacing:{marginBottom:e.spacing(6),[e.breakpoints.up("xs")]:{marginLeft:e.spacing(6)}},noMatchesMessage:{fontSize:e.typography.pxToRem(16),fontWeight:e.typography.fontWeightMedium,[e.breakpoints.up("md")]:{fontSize:e.typography.pxToRem(18),fontWeight:e.typography.fontWeightBold}},sectionWrapper:{overflow:"hidden",margin:e.spacing(4,0),[e.breakpoints.up("xs")]:{marginLeft:-20,marginRight:-20,marginTop:10}},linkWrapper:{margin:e.spacing(2,0,2,2),[e.breakpoints.up("xs")]:{marginLeft:30,marginTop:20}},sectionDivider:{marginBottom:20},divider:{[e.breakpoints.up("md")]:{display:"none"},[e.breakpoints.up("xs")]:{marginRight:-20,marginLeft:-20}}})),Y=e=>{let{link:t,linkText:a,title:s,type:i,isGene:o,children:r}=e,{classes:n}=I();return(0,l.jsxs)("div",{className:n.sectionWrapper,"data-testid":"search-no-results-".concat(i,"-quick-link"),children:[(0,l.jsx)(S.A,{className:n.sectionDivider}),(0,l.jsx)(x.A,{variant:"h2",className:n.verticalSpacing,children:s}),(0,l.jsx)(y.A,{container:!o,children:r}),(0,l.jsx)(S.A,{className:n.divider}),t&&a&&(0,l.jsx)(y.A,{container:!0,spacing:4,children:(0,l.jsx)("div",{className:n.linkWrapper,children:(0,l.jsx)(P.N,{href:t,passHref:!0,children:(0,l.jsx)(R.A,{children:a})})})})]})},z=e=>{var t,a,i,o,r,d;let{geneData:c,dymTerms:v,isRedirect:g}=e,[p]=(0,n.useSearchQuery)(),{formatMessage:f}=(0,m.A)(),{classes:R}=I(),A=(0,W.A)(),P=(0,D.k)(),N=(0,j.A)(A.breakpoints.up(O.Rp.MD),{defaultMatches:!0}),T=(0,j.A)(A.breakpoints.up(O.Rp.LG),{defaultMatches:!0});(0,s.useEffect)(()=>{(null==v?void 0:v.length)&&!g&&(0,u.sendSearchDidYouMeanEvent)(p.term||"",v,p.focus,p.type,"".concat(p.page))},[v]);let{classes:L}=(0,E.A)(),G=!!(null==c?void 0:null===(a=c.getGeneSearchResults)||void 0===a?void 0:null===(t=a.metadata)||void 0===t?void 0:t.itemCount)&&(null==c?void 0:null===(o=c.getGeneSearchResults)||void 0===o?void 0:null===(i=o.metadata)||void 0===i?void 0:i.itemCount)!==0,w=null==c?void 0:null===(d=c.getGeneSearchResults)||void 0===d?void 0:null===(r=d.items)||void 0===r?void 0:r.slice(0,1),z=!G;return(0,l.jsx)(h.A,{loading:!1,showFacets:!1,showAvailableForSale:!0,children:(0,l.jsxs)(y.A,{className:L.gridWrapper,children:[(0,l.jsxs)("div",{className:L.columnWrapper,children:[(0,l.jsxs)("div",{className:L.firstColumn,children:[z&&p.term&&"facet-search"!==p.term?(0,l.jsx)(x.A,{component:"div",className:R.noMatchesMessage,children:"".concat(f(_.A.SORRY_NO_MATCHES_FOUND_FOR),' "').concat(p.term,'"')}):z&&(!p.term||"facet-search"===p.term)&&(0,l.jsx)(x.A,{component:"div",className:R.noMatchesMessage,children:"".concat(f(_.A.SORRY_NO_MATCHES_FOUND_FOR),' "').concat(p.term,'"')}),(null==v?void 0:v.length)?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{children:(0,l.jsx)(k,{terms:v,focus:p.focus})})}):null,(0,l.jsx)(M.A,{}),P&&(0,l.jsx)(B,{}),G&&w&&(0,l.jsx)(Y,{title:f({id:"GENES",defaultMessage:"Genes"}),type:"gene",isGene:!0,children:w.map((e,t)=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(S.A,{className:R.divider}),(0,l.jsx)(b.A,{gene:e},"".concat(e.name,"-").concat(t))]}))}),N&&(0,l.jsx)(C.A,{})]}),T&&(0,l.jsx)(F.A,{})]}),!T&&(0,l.jsx)(F.A,{})]})})};var U=a(65103),H=a(41031),q=a(29376),K=a(72499),Q=a(48259),Z=a(6121),V=a(48753),J=a(76225),$=a(10746);let X=(0,f.makeStyles)({name:"ProductSearchResults",uniqId:"PrdSrch01"})((e,t,a)=>({noResultsMsg:{fontSize:e.typography.pxToRem(16),fontWeight:e.typography.fontWeightBold,marginTop:e.spacing(6)},results:{"&> *":{borderBottom:"solid 1px ".concat(e.palette.grey[400]),["&:has(+ .".concat(a.noBorder,")")]:{border:"none"}},[e.breakpoints.up("md")]:{"& > *:first-of-type":{borderTop:"solid 1px ".concat(e.palette.grey[600])},"&> *":{borderColor:e.palette.grey[600]},"& > *:last-of-type":{marginBottom:0}}},noBorder:{border:"none"},notFindingText:{fontWeight:e.typography.fontWeightBold}})),ee=()=>{var e,t,a,i,m,f,S,x,y,R,j,A,P,N,T,k,_,M,C,F;let W,O,E,L=(0,r.rd)(),{classes:G}=X(),{getSitePreference:w}=(0,c.iZ)(),I=(0,J.O)(),[Y,ee,et]=(0,n.useSearchQuery)(),ea=(0,$.S)()?"network-only":"cache-first",el=(0,D.k)(),{data:es,loading:ei,error:eo}=(0,H.le)({fetchPolicy:ea,variables:{searchTerm:(0,V._)(L)&&0!==ee.length?null:Y.term,page:Y.page,group:U.RL.Substance,selectedFacets:ee,sort:Y.sort,type:Y.type?Y.type.toUpperCase():void 0,region:Y.region,filter:I}}),er=w(c.VD.IsRedirectToProductDetail);null===Q.Lr||void 0===Q.Lr||Q.Lr.setItem("searchedfor",null==Y?void 0:Y.term),null===Q.Lr||void 0===Q.Lr||Q.Lr.setItem("searchQuery",JSON.stringify(Y));let en=1===Y.page,ed=!1,{data:ec,loading:eu}=(0,q.Rj)({variables:{searchTerm:Y.term,page:Y.page,selectedFacets:ee,type:U.e0.Gene},skip:!en}),[ev,eh]=(0,s.useState)(9);(0,s.useEffect)(()=>{var e,t;let a=null==es?void 0:null===(t=es.getProductSearchResults)||void 0===t?void 0:null===(e=t.metadata)||void 0===e?void 0:e.redirect;a&&(a.startsWith("http")?window.location.href=a:L.replace(a))},[es,L]);let eg=!(null==es?void 0:null===(t=es.getProductSearchResults)||void 0===t?void 0:null===(e=t.metadata)||void 0===e?void 0:e.itemCount)&&!(null==es?void 0:null===(i=es.getProductSearchResults)||void 0===i?void 0:null===(a=i.metadata)||void 0===a?void 0:a.setsCount),ep=(null==es?void 0:null===(f=es.getProductSearchResults)||void 0===f?void 0:null===(m=f.metadata)||void 0===m?void 0:m.itemCount)===0||(null==es?void 0:null===(x=es.getProductSearchResults)||void 0===x?void 0:null===(S=x.metadata)||void 0===S?void 0:S.setsCount)===0;if((0,s.useEffect)(()=>{var e;let t=null==es?void 0:es.getProductSearchResults.didYouMeanTerms;if(eg&&(null==t?void 0:t.length)&&!L.query.dym&&(0,d.AZ)(L,Y.term,Y.focus,t),er&&(null==es?void 0:null===(e=es.getProductSearchResults)||void 0===e?void 0:e.metadata.itemCount)===1&&"Substance"===es.getProductSearchResults.items[0].__typename&&L){let e=es.getProductSearchResults.items[0].products[0],t="".concat(r.aR.index(e.brand.key,e.productKey).as);L.replace(t)}},[eg,L,Y.term,es,ec]),(0,s.useEffect)(()=>{if(!ei&&es&&(!eg||!ep)){var e,t,a,l,s;(0,u.setPageLoadComplete)(!0);let i=null==es?void 0:null===(t=es.getProductSearchResults)||void 0===t?void 0:null===(e=t.metadata)||void 0===e?void 0:e.redirect,o=(null==es?void 0:null===(l=es.getProductSearchResults)||void 0===l?void 0:null===(a=l.metadata)||void 0===a?void 0:a.setsCount)||"";i||(null==Y?void 0:null===(s=Y.term)||void 0===s?void 0:s.includes("*"))||(0,u.sendViewSearchResultsEvent)({qFocus:Y.focus||"",qPage:"".concat(Y.page),qType:Y.type||"",searchResultStatus:"standard",searchTerm:Y.term||"",didYouMeanTerms:void 0,searchResultsCount:o})}},[ei,es]),(0,s.useEffect)(()=>{var e,t,a;let l=(null==es?void 0:null===(e=es.getProductSearchResults)||void 0===e?void 0:e.didYouMeanTerms)||[],s=(null==ec?void 0:null===(a=ec.getGeneSearchResults)||void 0===a?void 0:null===(t=a.metadata)||void 0===t?void 0:t.itemCount)===0;!ei&&!eu&&s&&!l.length&&(eg||ep)&&(0,u.sendSearchDidYouMeanEvent)(Y.term||"",[],Y.focus,Y.type,"".concat(Y.page))},[es,ec,ei,eu,Y.term]),en&&(null==es?void 0:es.getProductSearchResults)&&(null==ec?void 0:ec.getGeneSearchResults)&&(null==ec?void 0:ec.getGeneSearchResults.items[0])!==void 0){let e=(E=[...null==es?void 0:es.getProductSearchResults.items]).length>=10?ev:E.length;ed=!0,E.splice(e,0,ec.getGeneSearchResults.items[0])}if((eo||!es||!es.getProductSearchResults)&&!ei)return(0,l.jsx)(h.A,{loading:ei,children:(0,l.jsx)(v.A,{})});if(es&&(null===(R=es.getProductSearchResults)||void 0===R?void 0:null===(y=R.metadata)||void 0===y?void 0:y.setsCount)&&(null===(A=es.getProductSearchResults)||void 0===A?void 0:null===(j=A.metadata)||void 0===j?void 0:j.setsCount)>0||es&&(null===(N=es.getProductSearchResults)||void 0===N?void 0:null===(P=N.metadata)||void 0===P?void 0:P.itemCount)&&(null===(k=es.getProductSearchResults)||void 0===k?void 0:null===(T=k.metadata)||void 0===T?void 0:T.itemCount)>0||ei){let e=0;return(0,l.jsx)(h.A,{showFacets:!0,showAvailableForSale:!0,showSortBar:!0,loading:ei,facets:null==es?void 0:null===(_=es.getProductSearchResults)||void 0===_?void 0:_.facets,metadata:null==es?void 0:null===(M=es.getProductSearchResults)||void 0===M?void 0:M.metadata,id:"products-srp-grid","data-testid":"products-srp-grid",children:ei?(0,l.jsx)(p.A,{}):(null==es?void 0:es.getProductSearchResults)&&({metadata:W}=es.getProductSearchResults,O=ed?E:es.getProductSearchResults.items,(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:G.results,children:(0,l.jsx)(Z.A,{searchKey:Y.term||"",variant:"dark",calculateGenePosition:e=>{e&&eh(8)},children:O.map((t,a)=>{var i,r,n;let d=t&&t.variants,c={...t,products:null!==(n=null==t?void 0:null===(i=t.products)||void 0===i?void 0:i.map(t=>(e++,{...t,position:e})))&&void 0!==n?n:[]};return(0,l.jsxs)(s.Fragment,{children:[0===a&&(0,l.jsx)(o(),{children:(0,l.jsx)("link",{rel:"preload",href:null==t?void 0:null===(r=t.images[0])||void 0===r?void 0:r.mediumUrl,as:"image"})},t.id),el&&d?(0,l.jsx)("div",{className:G.noBorder,children:(0,l.jsx)(B,{})}):d?(0,l.jsx)(b.A,{gene:t,inProductSRP:!0},a):(0,l.jsx)(g.A,{substance:c,substancePosition:a+1},a)]},a)})},Y.term||"")}),(0,l.jsx)(K.A,{currentPage:Y.page,numPages:W.numPages,handleUpdatePage:et.handlePageChange})]}))})}return eg||ed?(0,l.jsx)(z,{dymTerms:null==es?void 0:es.getProductSearchResults.didYouMeanTerms,geneData:ec,isRedirect:null==es?void 0:null===(F=es.getProductSearchResults)||void 0===F?void 0:null===(C=F.metadata)||void 0===C?void 0:C.redirect}):null}}}]); //# sourceMappingURL=./9841.18ae896204c2f382.js.map