1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1604],{41723:function(e,l,n){n.r(l);var o=n(85893),i=n(62099),a=n(28349),t=n.n(a),d=n(22556),u=n(39332),s=n(89755),v=n.n(s),c=n(67294),r=n(69998),m=n(5817),h=n(18402),p=n(65313);let f=e=>{var l,n,i,a,s;let f=null==e?void 0:null===(l=e.fields)||void 0===l?void 0:l.finalTopic,g=null==e?void 0:null===(n=e.fields)||void 0===n?void 0:n.HideSummaryInResults,_=null==e?void 0:null===(i=e.fields)||void 0===i?void 0:i.HideSubHeadHrefinResults,S=(null==e?void 0:null===(a=e.fields)||void 0===a?void 0:a.ContentSummary)?"&content=summary":"",T=null==e?void 0:null===(s=e.fields)||void 0===s?void 0:s.language,w=(0,u.useSearchParams)(),N=Object.fromEntries(w.entries()),b=null==w?void 0:w.get("media"),{t:x}=(0,d.QT)(),[y,L]=(0,c.useState)(b||""),[A,C]=(0,c.useState)(!1),I=r.defaultLanguages.includes(null==T?void 0:T.toLocaleLowerCase())?"":"/"+(null==T?void 0:T.toLocaleLowerCase()),{mediaObj:j}=(0,c.useContext)(m.ZP);(0,c.useEffect)(()=>{N&&(L(b||""),C(!0))},[N]);let E=(e,l,n)=>{let i=null==e?void 0:e.length;return(0,o.jsx)(o.Fragment,{children:e?e.map((e,a)=>{var d,u;return(0,o.jsx)("li",{className:t().link,children:(0,o.jsx)("a",{href:I+(0,h.sc)(l+"?query="+n+"&media="+y+S+"#"+(null===(d=null==e?void 0:null===(u=e.Title)||void 0===u?void 0:u.replaceAll(" ","-"))||void 0===d?void 0:d.toLowerCase()),N),children:(0,o.jsxs)("div",{children:[(null==e?void 0:e.Title)&&(null==e?void 0:e.Title)!==""?(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:null==e?void 0:e.Title}}):null,(0,o.jsx)("span",{children:i-1>a&&"|"})]})})},"list_"+a)}):""})},R=null==f?void 0:f.length;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:(null==j?void 0:j.isMedia)?t().results:t().resultsNone,children:null!=f&&(f.length?R+" ":"0 ")+x("Results")}),null!==f&&(null==f?void 0:f.length)>0?Array.isArray(f)&&f.map((e,l)=>{var n,i;return(null==e?void 0:e.contenttype_s)==="Topic"?(0,o.jsxs)("div",{className:"".concat(t().MedicalTopics," ").concat((null==j?void 0:j.isMedia)&&t().mediaNotNone),children:[(0,o.jsx)("h1",{className:t().tag,children:x("MedicalTopic")}),(0,o.jsxs)("div",{className:t().searchResultsMain,children:[(0,o.jsx)("a",{href:I+(0,h.sc)((null==e?void 0:e.relativeurlcomputed_s)+"?query="+(null==e?void 0:e.queryString)+"&media="+y+S,N),children:(null==e?void 0:e.title_t)&&(null==e?void 0:e.title_t)!==""?(0,o.jsx)("span",{className:"".concat(t().title," ").concat((null==j?void 0:j.isClientTheme)&&"clientFontColor"),dangerouslySetInnerHTML:{__html:null==e?void 0:e.title_t}}):null}),(null==e?void 0:e.synonymscomputed_sm)&&(null==e?void 0:e.synonymscomputed_sm)!==""&&!g&&(0,o.jsx)("p",{className:t().synonym,dangerouslySetInnerHTML:{__html:null==e?void 0:e.synonymscomputed_sm}}),!g&&(null==e?void 0:e.summary_t)&&(null==e?void 0:e.summary_t)!==""&&(0,o.jsx)("p",{className:t().shortinfo,dangerouslySetInnerHTML:{__html:null==e?void 0:e.summary_t}}),!_&&(0,o.jsx)("ul",{className:t().list,children:E(null==e?void 0:e.leftMenuNavigation,null==e?void 0:e.relativeurlcomputed_s,(null==e?void 0:e.queryString)?null==e?void 0:e.queryString:"")}),(null==e?void 0:e.quickfactsswitchlink_t)&&(null==e?void 0:e.quickfactsswitchlink_t)!==null&&(0,o.jsxs)("div",{className:t().quickfactsbox,children:[(0,o.jsx)("i",{className:(null==e?void 0:e.mmeditioncomputed_s)==="Veterinary"?t().petowner:t().rabbit}),(0,o.jsx)("a",{href:I+(0,h.sc)((null==e?void 0:e.quickfactsswitchlinkcomputed_s)+"?query="+(null==e?void 0:e.queryString)+"&media="+y+S,N),children:(0,o.jsxs)("span",{className:"".concat(t().qflabel," ").concat((null==j?void 0:j.isClientTheme)&&"clientFontColor"),children:[x("QuickFactsLabel"),(0,o.jsx)("span",{className:t().justBasics,children:x("SearchResult_JustTheBasicsOnThisTopic")})]})})]})]})]},"medicalTopic_"+l):(null==e?void 0:e.contenttype_s)===r.SearchStaxTemplateName.LABTEST?(0,o.jsxs)("div",{className:"".concat(t().MedicalTopics," ").concat((null==j?void 0:j.isMedia)&&t().mediaNotNone),children:[(0,o.jsx)("h1",{className:t().tag,children:null===(n=x("LabTest"))||void 0===n?void 0:n.toUpperCase()}),(0,o.jsxs)("div",{className:"".concat(t().searchResultsMain," ").concat(t().searchResultsLabTest),children:[(0,o.jsx)("a",{href:I+(0,h.sc)((null==e?void 0:e.relativeurlcomputed_s)+"?query="+(null==e?void 0:e.queryString)+"&media="+y+S,N),children:(null==e?void 0:e.titlecomputed_t)&&(null==e?void 0:e.titlecomputed_t)!==""&&(0,o.jsx)("span",{className:t().title,dangerouslySetInnerHTML:{__html:null==e?void 0:e.titlecomputed_t}})}),(0,o.jsx)("span",{className:t().labTestImage,children:(0,o.jsx)(v(),{src:(0,p.CreateImageUrlPrefix)(null!==(i=null==e?void 0:e.thumbnailurlcomputed_s)&&void 0!==i?i:""),height:40,width:40})})]})]},"labTest_"+l):(0,o.jsxs)("div",{className:"".concat(t().quickfacts," ").concat((null==j?void 0:j.isMedia)&&t().mediaNotNone),style:{display:"block"},children:[(0,o.jsx)("div",{className:t().type,children:(0,o.jsx)("h1",{children:(null==e?void 0:e.contenttype_s)==="PetHealth"?x("QuickFactsLabel"):x("MedicalTopic")})}),(0,o.jsxs)("div",{className:"".concat(t().content," ").concat((null==j?void 0:j.isMedia)&&t().mediaNotNonequickFacts),children:[(0,o.jsxs)("div",{className:t().left,children:[(0,o.jsx)("i",{className:(null==e?void 0:e.contenttype_s)==="PetHealth"?t().petowner:t().rabbit}),(0,o.jsx)("p",{className:"".concat((null==j?void 0:j.isClientTheme)&&"clientFontColor"),children:x("QuickFactsLabel")})]}),(0,o.jsxs)("div",{className:t().right,children:[(null==e?void 0:e.title_t)&&(null==e?void 0:e.title_t)!==""&&(0,o.jsx)("a",{className:"".concat(t().title," ").concat((null==j?void 0:j.isClientTheme)&&"clientFontColor"),href:I+(0,h.sc)((null==e?void 0:e.relativeurlcomputed_s)+"?query="+(null==e?void 0:e.queryString)+"&media="+y+S,N),dangerouslySetInnerHTML:{__html:null==e?void 0:e.title_t}}),!g&&(null==e?void 0:e.summary_t)&&(null==e?void 0:e.summary_t)!==""&&(0,o.jsx)("p",{className:t().shortinfo,dangerouslySetInnerHTML:{__html:null==e?void 0:e.summary_t}})]})]})]})}):A&&(0,o.jsx)("div",{children:x("NoResults")})]})};l.default=(0,i.C)()(f)},77621:function(e,l,n){n.r(l),n.d(l,{Default:function(){return t}});var o=n(85893);n(67294);var i=n(46421);l.default={title:"Components/SearchAutoComplete",component:i.SearchAutoComplete};let a=e=>(0,o.jsx)(i.SearchAutoComplete,{...e}),t=a.bind({});t.args={}},46421:function(e,l,n){n.r(l),n.d(l,{SearchAutoComplete:function(){return S}});var o=n(85893),i=n(69998),a=n(28070),t=n.n(a),d=n(5817),u=n(67294),s=n(14631),v=n.n(s),c=n(89755),r=n.n(c),m=n(35005),h=n(22556),p=n(35187),f=n(29577),g=n(85768),_=n(65313);let S=e=>{let{theme:l,language:n,mediaObj:a}=(0,u.useContext)(d.ZP),[s,c]=(0,u.useState)(""),{t:S}=(0,h.QT)(),[T,w]=(0,u.useState)([]),N=l===i.Theme.LIGHT?g.Z.src:f.Z.src,b=async l=>{let n=(0,p.GetMonographListParams)(l);await (0,p.GetSelectData)(n).then(l=>{var n,o;e.setData(null==l?void 0:null===(n=l.data)||void 0===n?void 0:null===(o=n.response)||void 0===o?void 0:o.docs)}).catch(e=>{console.log(e)})};(0,u.useEffect)(()=>{(null==e?void 0:e.letterspineSelected)===!0&&(c(""),w([]),null==e||e.getInputLength(""))},[null==e?void 0:e.letterspineSelected]),(0,u.useEffect)(()=>{""===s.trim()&&w([])},[s]);let x=(e,l)=>{l=null==l?void 0:l.toLocaleLowerCase();let n=[];return null==e||e.map(e=>{var o,i,a,t,d,u,s;let v=(null==e?void 0:e._name)?null==e?void 0:e._name:"";if(null===(o=null===(i=e.monographbrandnamecomputed_t)||void 0===i?void 0:i.toLocaleLowerCase())||void 0===o?void 0:o.includes(l)){if(null===(d=e.monographbrandnamecomputed_t)||void 0===d?void 0:d.includes("|")){let o=null===(u=null===(s=e.monographbrandnamecomputed_t)||void 0===s?void 0:s.toLocaleLowerCase())||void 0===u?void 0:u.split("|");null==o||o.map(e=>{if(null==e?void 0:e.includes(l)){var o;null==n||n.push({label:(null===(o=e[0])||void 0===o?void 0:o.toUpperCase())+(null==e?void 0:e.slice(1))})}})}else e.monographbrandnamecomputed_t.toLocaleLowerCase().includes(l)&&n.push({label:e.monographbrandnamecomputed_t})}((null==v?void 0:v.toLocaleLowerCase().includes(l))||(null===(a=e.monographtitlecomputed_t)||void 0===a?void 0:a.toLocaleLowerCase().includes(l)))&&n.push({label:e.monographtitlecomputed_t}),(null===(t=e.monographalttitle_t)||void 0===t?void 0:t.toLocaleLowerCase().includes(l))&&n.push({label:e.monographalttitle_t})}),n},y=async e=>{let l=(0,p.GetMonographSearchParams)(e,n);await (0,p.GetSelectData)(l).then(l=>{var n,o;let i=x(null==l?void 0:null===(n=l.data)||void 0===n?void 0:null===(o=n.response)||void 0===o?void 0:o.docs,e);return w(i),i}).catch(e=>(console.log(e),null))},L=async l=>{let o=(0,p.GetMonographSearchParams)(l,n);await (0,p.GetSelectData)(o).then(n=>{var o,i,a;let t=[],d=[];null==n||null===(o=n.data)||void 0===o||null===(i=o.response)||void 0===i||null===(a=i.docs)||void 0===a||a.map(e=>{if(!(null==d?void 0:d.includes(null==e?void 0:e.monographbrandnamecomputed_t))){var n,o,i,a,u,s,v,c;(null===(n=null==e?void 0:null===(o=e.monographbrandnamecomputed_t)||void 0===o?void 0:o.toLocaleLowerCase().replaceAll("-"," "))||void 0===n?void 0:n.includes(l.toLocaleLowerCase().replaceAll("-"," ")))?(t.push(e),d.push(e.monographtitlecomputed_t)):(null===(i=null==e?void 0:null===(a=e._name)||void 0===a?void 0:a.toLocaleLowerCase())||void 0===i?void 0:i.includes(l.toLocaleLowerCase()))||(null==e?void 0:null===(u=e.monographtitlecomputed_t)||void 0===u?void 0:u.toLocaleLowerCase().includes(l.toLocaleLowerCase()))?(t.push(e),d.push(e.monographtitlecomputed_t)):((null===(s=null==e?void 0:null===(v=e.monographalttitle_t)||void 0===v?void 0:v.toLocaleLowerCase())||void 0===s?void 0:s.includes(l.toLocaleLowerCase()))||(null==e?void 0:null===(c=e.monographalttitle_t)||void 0===c?void 0:c.toLocaleLowerCase().includes(l.toLocaleLowerCase())))&&(t.push(e),d.push(e.monographalttitle_t))}}),t.sort((e,l)=>{let n=e.monographtitlecomputed_t.toLowerCase(),o=l.monographtitlecomputed_t.toLowerCase();return n<o?-1:n>o?1:0}),e.setData(t)}).catch(e=>(console.log(e),null))},A=e=>{c(e),w([]),j(e)},C=()=>{j(s)},I=l=>{var n;l.target.value.length<=2&&w([]),c(l.target.value),null==e||e.getInputLength(null==l?void 0:null===(n=l.target)||void 0===n?void 0:n.value),l.target.value.length>2&&y(l.target.value),0===l.target.value.length&&e.getMonographList("A")},j=async e=>{1===e.length?b(e):e.length>1&&L(e)},E=e=>{"enter"===e.key.toLowerCase()&&j(s)},R=[...T].sort((e,l)=>e.label.localeCompare(l.label));return(0,o.jsx)("div",{"data-testid":"searchAutoCompleteContainer",className:"".concat(t().searchMonogra
1phInputContainer,"\n ").concat(l===i.Theme.DARK?t().themeDark:t().themeLight),children:(0,o.jsxs)("div",{className:t().searchMonographInput,children:[(0,o.jsx)("label",{className:(null==a?void 0:a.isClientTheme)?t().clientFontColor:"",htmlFor:"monograph-autocomplete",children:S("Search Information Text")}),(0,o.jsxs)("div",{className:t().monographInputArea,children:[(0,o.jsx)(v(),{inputProps:{placeholder:"Search",onKeyDown:e=>E(e),id:"search-autocomplete"},getItemValue:e=>null==e?void 0:e.label,items:R,renderItem:(e,l)=>(0,o.jsx)("div",{className:"".concat(t().dropDownItem," ").concat(l&&(null==a?void 0:a.isClientTheme)&&"clientbackgroundColor"," ").concat(l?t().dropDownItemHighlight:t().dropDownItemHighlightLight),onMouseEnter:e=>{e.currentTarget.classList.add("clientbackgroundColor")},onMouseLeave:e=>{e.currentTarget.classList.remove("clientbackgroundColor")},children:null==e?void 0:e.label}),autoHighlight:!1,value:s,onChange:e=>I(e),onSelect:e=>{A(e)},onClick:()=>{c(""),w([])}}),(0,o.jsx)(m.Z,{variant:"light","aria-label":"Search Drug",onClick:C,className:t().searchMonographButton,children:(0,o.jsx)(r(),{src:N,width:21,height:21,loader:e=>(0,_.customImageLoader)(e),alt:S("Search Information Text")})})]})]})})};l.default=S},34702:function(e,l,n){n.r(l),n.d(l,{Default:function(){return t}});var o=n(85893);n(67294);var i=n(92225);l.default={title:"Components/SearchResults",component:i.SearchResults};let a=e=>(0,o.jsx)(i.SearchResults,{...e}),t=a.bind({});t.args={params:{name:"SearchResults"},rendering:{uid:"{00000000-0000-0000-0000-000000000000}",componentName:"SearchResults"},fields:{ContentType:[{displayName:"MMTopic",fields:{Key:{value:"MMTopic"},Value:{value:"Medical Topics"},HideEditionSwitcher:{value:!1}}}]}}},92225:function(e,l,n){n.r(l),n.d(l,{SearchResults:function(){return ea},getStaticProps:function(){return et}});var o=n(85893),i=n(32862),a=n(65683),t=n(67294),d=n(39332),u=n(5152),s=n.n(u),v=n(71464),c=n.n(v),r=n(5817),m=n(89755),h=n.n(m),p=n(80423),f=n(35005),g=n(35187),_=n(22556),S=n(69998),T=n(10627),w=n(4187),N=n(60269),b=n(81970),x=n(85768),y=n(29577),L=n(38897),A=n(43959),C=n(19794),I=n(72444),j=n(44928),E=n(78286),R=n(71254),M=n(32867),P=n(17450),D=n(65313),U=n(43960),q=n(66321),O=n(34561),B=n(12984);let F=s()(()=>n.e(932).then(n.bind(n,30932)).then(e=>e.default),{loadableGenerated:{webpack:()=>[30932]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),k=s()(()=>n.e(6216).then(n.bind(n,86216)).then(e=>e.default),{loadableGenerated:{webpack:()=>[86216]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),G=s()(()=>Promise.resolve().then(n.bind(n,49e3)).then(e=>e.default),{loadableGenerated:{webpack:()=>[49e3]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),H=s()(()=>Promise.all([n.e(259),n.e(5753)]).then(n.bind(n,15010)).then(e=>e.default),{loadableGenerated:{webpack:()=>[15010]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),V=s()(()=>n.e(6228).then(n.bind(n,76228)).then(e=>e.default),{loadableGenerated:{webpack:()=>[76228]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),Q=s()(()=>n.e(2244).then(n.bind(n,72244)).then(e=>e.default),{loadableGenerated:{webpack:()=>[72244]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),K=s()(()=>n.e(5282).then(n.bind(n,35282)).then(e=>e.default),{loadableGenerated:{webpack:()=>[35282]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),Y=s()(()=>n.e(6280).then(n.bind(n,16280)).then(e=>e.default),{loadableGenerated:{webpack:()=>[16280]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),Z=s()(()=>n.e(9291).then(n.bind(n,99291)).then(e=>e.default),{loadableGenerated:{webpack:()=>[99291]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),J=s()(()=>Promise.resolve().then(n.bind(n,59880)).then(e=>e.default),{loadableGenerated:{webpack:()=>[59880]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),z=s()(()=>n.e(2613).then(n.bind(n,42613)).then(e=>e.default),{loadableGenerated:{webpack:()=>[42613]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),W=s()(()=>n.e(1845).then(n.bind(n,1845)).then(e=>e.default),{loadableGenerated:{webpack:()=>[1845]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),$=s()(()=>n.e(5927).then(n.bind(n,25927)).then(e=>e.default),{loadableGenerated:{webpack:()=>[25927]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),X=s()(()=>n.e(434).then(n.bind(n,70434)).then(e=>e.default),{loadableGenerated:{webpack:()=>[70434]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),ee=s()(()=>n.e(7196).then(n.bind(n,37196)).then(e=>e.default),{loadableGenerated:{webpack:()=>[37196]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),el=s()(()=>Promise.all([n.e(2978),n.e(1843),n.e(1768),n.e(1325),n.e(6366),n.e(2731),n.e(907),n.e(259),n.e(5911),n.e(4813),n.e(2855),n.e(4974),n.e(4171)]).then(n.bind(n,34123)).then(e=>e.default),{loadableGenerated:{webpack:()=>[34123]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),en=s()(()=>
1n.e(3346).then(n.bind(n,63346)).then(e=>e.default),{loadableGenerated:{webpack:()=>[63346]},loading:()=>(0,o.jsx)(o.Fragment,{}),ssr:!1}),eo={},ei={facet_counts:{facet_fields:{_templatename:[]}},response:{docs:[],numFound:0},metadata:{facets:[]}},ea=e=>{var l,n,u,s,v,m,ea,et,ed,eu,es,ev,ec,er,em,eh,ep,ef,eg,e_,eS,eT,ew,eN,eb,ex,ey,eL,eA,eC,eI,ej,eE,eR,eM,eP,eD,eU,eq,eO,eB,eF,ek,eG,eH,eV,eQ,eK,eY,eZ,eJ,ez,eW,e$,eX,e0,e1,e2,e3,e9,e4,e6,e5,e8,e7,le,ll,ln,lo,li,la,lt,ld,lu,ls,lv,lc,lr,lm,lh,lp,lf,lg,l_,lS,lT,lw,lN,lb,lx,ly,lL,lA,lC,lI,lj,lE,lR,lM,lP,lD,lU,lq,lO,lB,lF,lk,lG,lH,lV,lQ,lK,lY,lZ,lJ,lz,lW,l$,lX,l0,l1,l2,l3;let{t:l9}=(0,_.QT)(),{edition:l4,language:l6,theme:l5,searchRefineToggle:l8,setSearchRefineToggle:l7,showLoader:ne,setShowLoader:nl,media:nn,setForceShowLoader:no,mediaObj:ni,searchResultAIData:na}=(0,t.useContext)(r.ZP),{sitecoreContext:nt}=(0,i.z)(),nd=null==nt?void 0:null===(l=nt.route)||void 0===l?void 0:null===(n=l.fields)||void 0===n?void 0:null===(u=n.MMEdition)||void 0===u?void 0:u.value,nu=null==nt?void 0:null===(s=nt.language)||void 0===s?void 0:s.toLocaleLowerCase(),ns=(0,d.useRouter)(),nv=(0,d.usePathname)(),nc=(0,d.useSearchParams)(),[nr,nm]=(0,t.useState)(null),[nh,np]=(0,t.useState)(null),[nf,ng]=(0,t.useState)(null),[n_,nS]=(0,t.useState)(null),[nT,nw]=(0,t.useState)(!1),[nN,nb]=(0,t.useState)(0),[nx,ny]=(0,t.useState)(!1),[nL,nA]=(0,t.useState)(!1),[nC,nI]=(0,t.useState)(ei),[nj,nE]=(0,t.useState)("All"),[nR,nM]=(0,t.useState)(!1),[nP,nD]=(0,t.useState)(!0),[nU,nq]=(0,t.useState)([]),[nO,nB]=(0,t.useState)(null),[nF,nk]=(0,t.useState)(0),[nG,nH]=(0,t.useState)([]),[nV,nQ]=(0,t.useState)([]),[nK,nY]=(0,t.useState)(null),[nZ,nJ]=(0,t.useState)([]),[nz,nW]=(0,t.useState)([]),[n$,nX]=(0,t.useState)([]),[n0,n1]=(0,t.useState)([]),[n2,n3]=(0,t.useState)(null),[n9,n4]=(0,t.useState)(!1),[n6,n5]=(0,t.useState)([]),[n8,n7]=(0,t.useState)([]),[oe,ol]=(0,t.useState)(!1),[on,oo]=(0,t.useState)(!1),[oi,oa]=(0,t.useState)(""),[ot,od]=(0,t.useState)([]),[ou,os]=(0,t.useState)(!0),[ov,oc]=(0,t.useState)(!1),[or,om]=(0,t.useState)(!1),[oh,op]=(0,t.useState)(null),[of,og]=(0,t.useState)(!1),o_=e=>{var l;let n=null===(l=null==e?void 0:e.trim())||void 0===l?void 0:l.toLowerCase();return n===S.SearchTabName.VIDEO_TAB.toLowerCase()||n===S.Media.Video.toLowerCase()},oS=(0,t.useRef)(null),oT=null==nt?void 0:null===(v=nt.route)||void 0===v?void 0:null===(m=v.placeholders)||void 0===m?void 0:null===(ea=m["jss-header"])||void 0===ea?void 0:ea.find(e=>"Header"===e.componentName),ow=null==oT?void 0:null===(et=oT.placeholders)||void 0===et?void 0:null===(ed=et.search)||void 0===ed?void 0:ed.find(e=>"Search"===e.componentName),oN=null==ow?void 0:null===(eu=ow.fields)||void 0===eu?void 0:null===(es=eu.AISearchEnabled)||void 0===es?void 0:es.value,ob=(0,t.useRef)(null),ox=null!=oN&&oN,oy=async function(e,l){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;try{var i,a,t,d,u,s,v,c,r,m,h,p,f,g,_,T,w,N,b,x,y,L,A,C,I,j,E,R,M,D,U;let q;nj!==S.SearchTabName.ALL_TAB&&on&&oP(S.SearchTabName.ALL_TAB,1,!0,ou);let O=await (0,P.getAnswersAndSearchData)(e,l,"answer",(0,P.getlocation)(),nu,l?"":null===(i=n6[0])||void 0===i?void 0:i.query,null==na?void 0:null===(a=na.Preamble)||void 0===a?void 0:a.value,null!==(b=null==na?void 0:null===(t=na.IgnoreAdversarialQuery)||void 0===t?void 0:t.boolValue)&&void 0!==b&&b,null!==(x=null==na?void 0:null===(d=na.ModelVersion)||void 0===d?void 0:d.value)&&void 0!==x?x:"",sessionStorage.getItem(S.SESSIONID),null!==(y=null==na?void 0:null===(u=na.Vertex_Engine)||void 0===u?void 0:u.value)&&void 0!==y?y:"",null!==(L=null==na?void 0:null===(s=na.Vertex_DatasetId)||void 0===s?void 0:s.value)&&void 0!==L?L:"",null!==(A=null==na?void 0:null===(v=na.Vertex_TableId)||void 0===v?void 0:v.value)&&void 0!==A?A:"",null!==(C=null==na?void 0:null===(c=na.ResponseTimeoutThreshold)||void 0===c?void 0:c.value)&&void 0!==C?C:""),B=parseInt(null!==(I=null==na?void 0:null===(r=na.RetryCount)||void 0===r?void 0:r.value)&&void 0!==I?I:"3");if(O&&!O.ok){if(n<B-1&&((null==O?void 0:O.status)===S.maxRetryCount.RETRY_STATUS||(null==O?void 0:O.status)===S.maxRetryCount.TIMEOUT_STATUS)){let i=o+500*Math.random();await new Promise(e=>
1setTimeout(e,i)),await oy(e,l,n+1,o*=2);return}n7(null),og(!0),on&&n5([...n6,{answer:{name:"error",state:"FAILED",answerText:"".concat(l9("SomethingWentWrong")),citations:[],references:[],steps:[],queryUnderstandingInfo:{queryClassificationInfo:[]}},query:null!=e?e:""}]);return}let F=null==O?void 0:null===(m=O.data)||void 0===m?void 0:null===(h=m.result)||void 0===h?void 0:h.answer,k=[];if(l){let l=null!==(D=null==O?void 0:null===(j=O.data)||void 0===j?void 0:null===(E=j.result)||void 0===E?void 0:null===(R=E.session)||void 0===R?void 0:R.name)&&void 0!==D?D:"";q=null===(M=l.match(/\/sessions\/([^/]+)/))||void 0===M?void 0:M[1],sessionStorage.setItem(S.SESSIONID,null!=q?q:""),n5([{answer:F,query:e}]),k=[{answer:F,query:e}]}else n5([...n6,{answer:F,query:e}]),k=[...n6,{answer:F,query:e}],ob.current&&(ob.current.value="",ob.current.placeholder=l9("enterFollowupQue")),q=sessionStorage.getItem(S.SESSIONID);let G=(null===(p=null===(f=null==F?void 0:F.steps[0])||void 0===f?void 0:f.actions[0])||void 0===p?void 0:null===(g=p.observation)||void 0===g?void 0:null===(_=g.searchResults)||void 0===_?void 0:_.length)?[...null!==(U=null===(T=null===(w=null==F?void 0:F.steps[0])||void 0===w?void 0:w.actions[0])||void 0===T?void 0:null===(N=T.observation)||void 0===N?void 0:N.searchResults)&&void 0!==U?U:[]]:null;n7(G),ol(!1);let H={answers:k,searchResults:G,sessionId:q},V=nc.get("query");sessionStorage.setItem("ai_result_".concat(nu,"_").concat(l4,"_").concat(on?V:e),JSON.stringify(H))}catch(e){console.error(e)}finally{ol(!1)}},oL=async(e,l)=>{var n,o,i,a;let t=null===(n=null==ow?void 0:null===(o=ow.fields)||void 0===o?void 0:o.SearchUrl)||void 0===n?void 0:null===(i=n.value)||void 0===i?void 0:i.href;if(ob.current&&ob.current.blur(),nc.get("query")===e)return;nj===S.SearchTabName.ALL_TAB||l||n7([]);let d="",u="";if(l)oy(null!=e?e:"",!l,0),(0,T.s8)(null!=e?e:""),ol(!0);else{let l=new URLSearchParams(null==window?void 0:null===(a=window.location)||void 0===a?void 0:a.search),n=l?l.get("media"):null;d=encodeURIComponent(null!=e?e:""),u="".concat(t,"?query=").concat(d).concat(n?"&media=".concat(n):""),window.location.href=u}};(null==nZ?void 0:nZ.length)==0&&(eo=null==nC?void 0:null===(lY=nC.facet_counts)||void 0===lY?void 0:lY.facet_fields),(0,t.useEffect)(()=>{var e,l;if(null==window?void 0:null===(e=window.location)||void 0===e?void 0:e.search){let e=new URLSearchParams(null==window?void 0:null===(l=window.location)||void 0===l?void 0:l.search),n=e?e.get("query"):null;!nx&&n&&no(!0)}return()=>no(!1)},[]),(0,t.useEffect)(()=>{var e,l,n,o,i,a;let t=null!==(l=null==nC?void 0:null===(e=nC.response)||void 0===e?void 0:e.docs)&&void 0!==l?l:[];if(n_&&((null==t?void 0:t.length)>0&&nj!==S.SearchTabName.IMAGE_TAB||(null==t?void 0:t.length)===0&&nj===S.SearchTabName.ALL_TAB&&nx)){let e=(null==t?void 0:t.length)>0?null==t?void 0:t.map((e,l)=>({cDocId:"".concat(null==e?void 0:e.relativeurlcomputed_s,"?query=").concat(n_),cDocTitle:null!==(i=null!==(o=null==e?void 0:e.titlecomputed_t)&&void 0!==o?o:null==e?void 0:e.monographtitlecomputed_t)&&void 0!==i?i:"",position:l+1})):[];(0,A.g)(n_,e,null==t?void 0:t.length,null!==(a=null==nC?void 0:null===(n=nC.response)||void 0===n?void 0:n.numFound)&&void 0!==a?a:0,l6,null!=nO?nO:1)}},[n_,nC,nO,l6]),(0,t.useEffect)(()=>{null==window||window.addEventListener("resize",()=>{oA()}),oA()},[nj]),(0,t.useEffect)(()=>{if(!oh)return;let e=(0,I.zD)(oh);nE(e),oD(e),op(null)},[oh]);let oA=()=>{var l,n,o;if(nj&&(null==e?void 0:null===(l=e.fields)||void 0===l?void 0:l.ContentType)){let l=e=>{let l=(null!=e?e:"").toLowerCase().replace(/\s|-/g,"");return"casestudy"===l||"casestudies"===l||"externalpage"===l?S.SearchTabName.CASESTUDY_TAB:null!=e?e:""},i=[{Key:"All",Value:l9("All"),display:!0,count:0}],a=new Set;null==e||null===(n=e.fields)||void 0===n||null===(o=n.ContentType)||void 0===o||o.map(e=>{var n,o,t,d,u,s,v,c,r,m,h;let p=null==e?void 0:null===(n=e.fields)||void 0===n?void 0:null===(o=n.Key)||void 0===o?void 0:null===(t=o.value)||void 0===t?void 0:t.toLowerCase(),f=p===S.SearchTabName.VIDEO||p===S.Media.Video.toLowerCase();f?0===a.size&&(a.add(p),i.push({Key:null==e?void 0:null===(d=e.fields)||void 0===d?void 0:null===(u=d.Key)||void 0===u?void 0:u.value,Value:null==e?void 0:null===(s=e.fields)||void 0===s?void 0:null===(v=s.Value)||void 0===v?void 0:v.value,display:!1,count:0})):i.push({Key:l(null==e?void 0:null===(c=e.fields)||void 0===c?void 0:null===(r=c.Key)||void 0===r?void 0:r.value),Value:null==e?void 0:null===(m=e.fields)||void 0===m?void 0:null===(h=m.Value)||void 0===h?void 0:h.value,display:!1,count:0})}),nH(i)}};(0,t.useEffect)(()=>{oO(nO||0),oU(nj)},[nO]),(0,t.useEffect)(()=>{0!=nF&&(nO||0<nF)?nD(!0):nD(!1),oO(nO||0)},[nF]);let oC=e=>{if(!n9&&e){let e=(0,I.zD)(n2);oP(e,nO,!0),n4(!0)}};(0,t.useEffect)(()=>
1{if((null===n8||(null==n8?void 0:n8.length)>0)&&nx&&!on){var e,l,n,o,i;(0,T.p_)(!!n8&&(null==n8?void 0:n8.length)>0,(null==nC?void 0:null===(e=nC.response)||void 0===e?void 0:null===(l=e.docs)||void 0===l?void 0:l.length)>0,(null==n6?void 0:n6.length)>0&&(null===(n=n6[0])||void 0===n?void 0:null===(o=n.answer)||void 0===o?void 0:null===(i=o.citations)||void 0===i?void 0:i.length)>0)}},[n8,nx]),(0,t.useEffect)(()=>{var e,l,n,o,i,a,t,d,u,s,v,c,r,m,h,p,f,g,_,T,w,N,b,x,y,L,A,C,I,j,E,R,M,P,D,U,q,O,B,F,k,G,H,V,Q,K,Y,Z,J,z,W,$,X,ee,el,en,eo,ei,ea,et,ed,eu,es,ev,ec,er,em,eh,ep,ef,eg;let e_;if((null==nC?void 0:null===(e=nC.response)||void 0===e?void 0:null===(l=e.docs)||void 0===l?void 0:l.length)>0){let e=null==nC?void 0:null===(n=nC.response)||void 0===n?void 0:null===(o=n.docs)||void 0===o?void 0:o.filter(e=>(null==e?void 0:e._templatename)==="MMTopic");null===nK&&nY(e[0])}if(nj===S.SearchTabName.ALL_TAB){if(l4===S.Edition.VETERINARY){if(null==nC?void 0:null===(u=nC.facet_counts)||void 0===u?void 0:null===(s=u.facet_fields)||void 0===s?void 0:null===(v=s.contenttype_s)||void 0===v?void 0:v.includes("PetHealth")){let e=null==nC?void 0:null===(w=nC.facet_counts)||void 0===w?void 0:null===(N=w.facet_fields)||void 0===N?void 0:null===(b=N.contenttype_s)||void 0===b?void 0:b.indexOf("PetHealth");e>-1&&(null==nC||null===(x=nC.facet_counts)||void 0===x||null===(y=x.facet_fields)||void 0===y||null===(L=y._templatename)||void 0===L||L.unshift(null==nC?void 0:null===(A=nC.facet_counts)||void 0===A?void 0:null===(C=A.facet_fields)||void 0===C?void 0:C.contenttype_s[e+1]),null==nC||null===(I=nC.facet_counts)||void 0===I||null===(j=I.facet_fields)||void 0===j||null===(E=j._templatename)||void 0===E||E.unshift(null==nC?void 0:null===(R=nC.facet_counts)||void 0===R?void 0:null===(M=R.facet_fields)||void 0===M?void 0:M.contenttype_s[e]))}if(null==nC?void 0:null===(c=nC.facet_counts)||void 0===c?void 0:null===(r=c.facet_fields)||void 0===r?void 0:null===(m=r.contenttype_s)||void 0===m?void 0:m.includes("Topic")){let e=null==nC?void 0:null===(P=nC.facet_counts)||void 0===P?void 0:null===(D=P.facet_fields)||void 0===D?void 0:null===(U=D.contenttype_s)||void 0===U?void 0:U.indexOf("Topic");e>-1&&(null==nC||null===(q=nC.facet_counts)||void 0===q||null===(O=q.facet_fields)||void 0===O||null===(B=O._templatename)||void 0===B||B.unshift(null==nC?void 0:null===(F=nC.facet_counts)||void 0===F?void 0:null===(k=F.facet_fields)||void 0===k?void 0:k.contenttype_s[e+1]),null==nC||null===(G=nC.facet_counts)||void 0===G||null===(H=G.facet_fields)||void 0===H||null===(V=H._templatename)||void 0===V||V.unshift(null==nC?void 0:null===(Q=nC.facet_counts)||void 0===Q?void 0:null===(K=Q.facet_fields)||void 0===K?void 0:K.contenttype_s[e]))}if(null==nC?void 0:null===(h=nC.facet_counts)||void 0===h?void 0:null===(p=h.facet_fields)||void 0===p?void 0:null===(f=p._templatename)||void 0===f?void 0:f.includes("MMTopic")){let e=null==nC?void 0:null===(Y=nC.facet_counts)||void 0===Y?void 0:null===(Z=Y.facet_fields)||void 0===Z?void 0:null===(J=Z._templatename)||void 0===J?void 0:J.indexOf("MMTopic");e>-1&&(null==nC||null===(z=nC.facet_counts)||void 0===z||null===(W=z.facet_fields)||void 0===W||null===($=W._templatename)||void 0===$||$.splice(e,2))}if(null==nC?void 0:null===(g=nC.facet_counts)||void 0===g?void 0:null===(_=g.facet_fields)||void 0===_?void 0:null===(T=_._templatename)||void 0===T?void 0:T.includes("mmtopic")){let e=null==nC?void 0:null===(X=nC.facet_counts)||void 0===X?void 0:null===(ee=X.facet_fields)||void 0===ee?void 0:null===(el=ee._templatename)||void 0===el?void 0:el.indexOf("mmtopic");e>-1&&(null==nC||null===(en=nC.facet_counts)||void 0===en||null===(eo=en.facet_fields)||void 0===eo||null===(ei=eo._templatename)||void 0===ei||ei.splice(e,2))}}let e=(null==nC?void 0:null===(i=nC.facet_counts)||void 0===i?void 0:null===(a=i.facet_fields)||void 0===a?void 0:a._templatename)?null!==(ea=null==nC?void 0:null===(t=nC.facet_counts)||void 0===t?void 0:null===(d=t.facet_fields)||void 0===d?void 0:d._templatename)&&void 0!==ea?ea:[]:[""];if(ox){((null==n8?void 0:n8.length)||null===n8)&&n2&&oC((null==nC?void 0:null===(et=nC.metadata)||void 0===et?void 0:null===(ed=et.facets)||void 0===ed?void 0:ed.length)>0);let l=null==e?void 0:e.indexOf("mmtopic");-1!==l?(nQ(e),os(!0)):(nQ(["mmtopic",(null==n8?void 0:n8.length)||"0",...e]),os(!1))}else n2&&oC((null==nC?void 0:null===(eu=nC.metadata)||void 0===eu?void 0:null===(es=eu.facets)||void 0===es?void 0:es.length)>0),nQ(e);nx&&nZ.length>
10&&or&&(om(!1),oP(l4===S.Edition.VETERINARY?S.SearchTabName.VET_TOPIC:S.SearchTabName.TOPIC))}if(o_(nj))e_=Math.ceil((null==nC?void 0:null===(ev=nC.response)||void 0===ev?void 0:ev.numFound)/40);else if(nj===S.SearchTabName.IMAGE_TAB){let e=nV?null==nV?void 0:nV.indexOf(S.SearchTabName.IMAGE):-1,l=nV?null==nV?void 0:nV.indexOf(S.SearchTabName.JPEG):-1;e_=Math.ceil((nV&&(null==nV?void 0:nV.length)>0&&e>=0?Number(nV[e+1])+(l>=0?Number(nV[l+1]):0):0)/36)}else e_=Math.ceil((null==nC?void 0:null===(ec=nC.response)||void 0===ec?void 0:ec.numFound)/10);nk(e_),nj.toLowerCase()===S.SearchTabName.ALL_ITEMS&&(null==nC?void 0:null===(er=nC.facet_counts)||void 0===er?void 0:null===(em=er.facet_fields)||void 0===em?void 0:em.semanticscomputed_sm)&&0===n0.length&&n1((null==nC?void 0:null===(eh=nC.facet_counts)||void 0===eh?void 0:null===(ep=eh.facet_fields)||void 0===ep?void 0:ep.semanticscomputed_sm)?null==nC?void 0:null===(ef=nC.facet_counts)||void 0===ef?void 0:null===(eg=ef.facet_fields)||void 0===eg?void 0:eg.semanticscomputed_sm:[])},[nC,n8,ox]),(0,t.useEffect)(()=>{var e,l,n;let o=(null==nv?void 0:nv.includes("page"))?nv.split("page=")[1]:"",i=parseInt(o?o.toString():"1");if(oq(i),null==window?void 0:null===(e=window.location)||void 0===e?void 0:e.search){let e=new URLSearchParams(null==window?void 0:null===(l=window.location)||void 0===l?void 0:l.search),n=e?e.get("query"):null;n&&nl(!0);let o=e?e.get("icd9"):null,i=e?e.get("icd10"):null,a=e?e.get("page"):1,t=a?parseInt(a.toString()):1,d=e?e.get("type"):null,u=(0,g.GetSearchKeywordQuery)(n,l9);nm(n?u:null),nS(n||null),n||nw(!0),n3(d),nB(t),t&&1!==t?nj==S.SearchTabName.IMAGE_TAB?nb((t-1)*36):o_(nj)?nb((t-1)*40):nb((t-1)*10):nb(0),np(o),ng(i),oE(nj)}else nw(!0);let a=[];if(void 0!==window&&l4===S.Edition.VETERINARY){let e=null==window?void 0:null===(n=window.localStorage)||void 0===n?void 0:n.getItem("vetFilterForQuery");""!=e&&null!=e&&void 0!=e&&(a=JSON.parse(e?null==e?void 0:e.toLowerCase():""))}if(a.length>0){let e="";a.map(l=>{e+=l+"+"}),(0,T.od)(e)}nX(a)},[]),(0,t.useEffect)(()=>{var e,l;if(null==window?void 0:null===(e=window.location)||void 0===e?void 0:e.search){if(ox&&na){let e=new URLSearchParams(null==window?void 0:null===(l=window.location)||void 0===l?void 0:l.search),n=e?e.get("query"):null;ol(!0),n5([]),n7([]),oa(n||null),ob.current&&(ob.current.value=null!=n?n:""),oI(n)}else n7(null)}else oa(null),ob.current&&(ob.current.value="",ob.current.placeholder=l9("AIsearch"))},[ox,null==na?void 0:null===(ev=na.Vertex_Engine)||void 0===ev?void 0:ev.value]),(0,t.useEffect)(()=>{oE(nj)},[nZ]),(0,t.useEffect)(()=>{ov&&oP(S.SearchTabName.TOPIC)},[ov]),(0,t.useEffect)(()=>(window.addEventListener("popstate",oj),()=>{window.removeEventListener("popstate",oj)}),[]);let oI=e=>{if(e){let o=sessionStorage.getItem("ai_result_".concat(nu,"_").concat(l4,"_").concat(e));if(o){var l,n;let e=JSON.parse(o);sessionStorage.setItem(S.SESSIONID,null!==(n=null==e?void 0:e.sessionId)&&void 0!==n?n:""),n5(null==e?void 0:e.answers),n7(null==e?void 0:e.searchResults),(null==e?void 0:null===(l=e.answers)||void 0===l?void 0:l.length)>1?(oo(!0),ob.current&&(ob.current.value="",ob.current.placeholder=l9("enterFollowupQue"))):oo(!1),ol(!1)}else oy(e||"",!0,0)}},oj=e=>{var l;e.preventDefault();let n=new URLSearchParams(null==window?void 0:null===(l=window.location)||void 0===l?void 0:l.search),o=n?n.get("page"):1,i=n?n.get("type"):"all",a=o?parseInt(o.toString()):1;1===a?nb(0):nj===S.SearchTabName.IMAGE_TAB?nb((a-1)*36):o_(nj)?nb((a-1)*40):nb((a-1)*10),oq(a),nB(a),op(null!=i?i:"all")},oE=async(e,l,n)=>{if(nr){var o,i,a,t,d,u,s,v,c,r,m,h,p,f,g,_,w,N;nl(!0);let b=e===S.SearchTabName.CONTENT_AUDIO?S.SearchTabName.AUDIO:e,x="",y="",L="",A="";if(null!==nh){y="?query="+n_+"&icd9="+nh,x="Icd9Search",L=nh;let e=L.split(";"),l=e.map(e=>'"'+e+'"'),n=l.join(" "),o=await oR(n,b,x).then(e=>e);(null==o?void 0:null===(d=o.response)||void 0===d?void 0:null===(u=d.docs)||void 0===u?void 0:u.length)>0?(nI({...o}),oc(!0),ny(!0),no(!1),nl(!1)):await oR(L=nr,b,x="SearchResult").then(e=>{nI({...e}),ny(!0),no(!1),nl(!1)}),A=(null==window?void 0:null===(s=window.location)||void 0===s?void 0:s.pathname)+y+"&page="+nO}else if(null!==nf){y="?query="+n_+"&icd10="+nf,x="Icd10Search",L=nf;let e=L.split(";"),l=e.map(e=>'"'+e+'"'),n=l.join(" "),o=await oR(n,b,x).then(e=>e);(null==o?void 0:null===(v=o.response)||void 0===v?void 0:null===(c=v.docs)||void 0===c?void 0:c.length)>0?(nI({...o}),ny(!0),no(!1),nl(!1)):await oR(L=nr,b,x="SearchResult").then(e=>{nI({...e}),ny(!0),no(!1),nl(!1)}),A=(null==window?void 0:null===(r=window.location)||void 0===r?void 0:r.pathname)+y+"&page="+nO}else{x="SearchResult",y="?query="+n_,L=(L=nr).replaceAll(";"," ");let e=e=>{var l,o,i,a;let t=null!==(i=null==e?void 0:null===(l=e.facet_counts)||void 0===l?void 0:null===(o=l.facet_fields)||void 0===o?void 0:o.contenttype_s)&&void 0!==i?i:[];if(n2){let e=null==t?void 0:t.findIndex(e=>e===(0,I.cm)(n2)),l=-1!==e&&null!==(a=t[e+1])&&void 0!==a?a:null;if(l&&l>0)return Boolean(n)}return!0};await oR(L,b,x).then(l=>{let n=e(l);nI({...l}),ny(!0),no(!1),n||n9?nl(!1):nl(!0)}),A=(null==window?void 0:null===(m=window.location)||void 0===m?void 0:m.pathname)+y+(n2?"&type=".concat(n2):"")+"&page="+(l||nO)}if((null==nc?void 0:nc.get("media"))!==null&&"string"==typeof(null==nc?void 0:nc.get("media"))&&(A=A+"&media="+(null==nc?void 0:nc.get("media"))),(null==nc?void 0:nc.get("client"))!==null&&"string"==typeof(null==nc?void 0:nc.get("client"))&&(A=A+"&client="+(null==nc?void 0:nc.get("client"))),(null==nc?void 0:nc.get("langselector"))!==null&&"string"==typeof(null==nc?void 0:nc.get("langselector"))&&(A=A+"&langselector="+(null==nc?void 0:nc.get("langselector"))),(null==window?void 0:null===(o=window.location)||void 0===o?void 0:null===(i=o.search)||void 0===i?void 0:i.includes("media"))&&
1!(null==A?void 0:A.includes("media"))){let e=new URLSearchParams(null==window?void 0:null===(h=window.location)||void 0===h?void 0:h.search);A+=(null==e?void 0:e.get("media"))?"&media="+(null==e?void 0:e.get("media")):""}let C=(0,I.Ec)(e);if(null==window?void 0:null===(a=window.location)||void 0===a?void 0:null===(t=a.search)||void 0===t?void 0:t.includes("type")){let e=new URLSearchParams(null==A?void 0:A.split("?")[1]),l=e.get("query");e.delete("type"),e.delete("query"),A=A.split("?")[0]+"?"+"query=".concat(l)+"&".concat(decodeURIComponent(e.toString()))+"&type=".concat(C)}else A+="&type=".concat(C);let j=(()=>{let e=new URLSearchParams(window.location.search);e.delete("media"),e.delete("client");let l=e.toString().replace(/\+/g," ");return l})();if(nL&&(null==window?void 0:null===(p=window.location)||void 0===p?void 0:p.pathname)+decodeURIComponent(j?"?"+j:"")!==A){ns.push(A);let e=new URL(window.location.href);e=new URL(A,e.origin),(0,T.p_)(!!n8&&(null==n8?void 0:n8.length)>0,(null==nC?void 0:null===(f=nC.response)||void 0===f?void 0:null===(g=f.docs)||void 0===g?void 0:g.length)>0,(null==n6?void 0:n6.length)>0&&(null===(_=n6[0])||void 0===_?void 0:null===(w=_.answer)||void 0===w?void 0:null===(N=w.citations)||void 0===N?void 0:N.length)>0,null==e?void 0:e.href)}nA(!0),ne||window.scrollTo(0,0)}},oR=async(e,l,n)=>{let o="";if((null==l?void 0:l.toLowerCase())!==S.SearchTabName.ALL_ITEMS)o=(null==l?void 0:l.toLowerCase())==="topic"||(null==l?void 0:l.toLowerCase())==="pethealth"?(0,g.getSearchResultsTemplateParam)(l4,e,l6,'"MMTopic"',nN,nZ,n$,n,l):(0,g.getSearchResultsTemplateParam)(l4,e,l6,l,nN,nZ,n$,n,"");else{var i,a;let l=(0,g.getSearchResultsParam)(l4,e,l6,nN,nZ,n$,n,!0),t=await oM(l);od(null!==(a=null==t?void 0:null===(i=t.response)||void 0===i?void 0:i.docs)&&void 0!==a?a:[]),o=(0,g.getSearchResultsParam)(l4,e,l6,nN,nZ,n$,n)}let t=await oM(o).then(e=>e);return t},oM=async e=>{let l=await fetch("".concat((0,w.Q)(),"/api/search/search?").concat(e)),n=await (null==l?void 0:l.json());return(null==n?void 0:n.status)===200?null==n?void 0:n.data:void 0},oP=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;nB(l),oD(e,l,n,o),oO(nF?1:0)},oD=(e,l,n,o)=>{var i,a,t,d,u,s,v,c,r,m,h,p,f,g;if(nb(0),nM(!1),oq(null!=l?l:1),nD(!0),"All"!==nj||"All"!==e){if(nE(e),ox){let l=(null==nC?void 0:null===(i=nC.response)||void 0===i?void 0:null===(a=i.docs)||void 0===a?void 0:a.length)===0&&n8&&(null==n8?void 0:n8.length)>0&&!o;if(l&&e===S.SearchTabName.TOPIC){let l=(0,I.Ec)(e),n=(0,I.f$)(l,"?query="+n_);ns.push(n);let o=new URL(window.location.href);o=new URL(n,o.origin),window.location.href!==o.href&&(0,T.p_)(!!n8&&(null==n8?void 0:n8.length)>0,(null==nC?void 0:null===(t=nC.response)||void 0===t?void 0:null===(d=t.docs)||void 0===d?void 0:d.length)>0,(null==n6?void 0:n6.length)>0&&(null===(u=n6[0])||void 0===u?void 0:null===(s=u.answer)||void 0===s?void 0:null===(v=s.citations)||void 0===v?void 0:v.length)>0,null==o?void 0:o.href);return}}if(e===S.SearchTabName.TOP_IMAGES){let e=window.location.href;if(null==window?void 0:null===(c=window.location)||void 0===c?void 0:null===(r=c.search)||void 0===r?void 0:r.includes("type")){let l=new URLSearchParams(null==e?void 0:e.split("?")[1]),n=l.get("query");l.delete("type"),l.delete("query"),e=e.split("?")[0]+"?"+"query=".concat(n)+"&".concat(decodeURIComponent(l.toString()))+"&type=all"}else e+="&type=all";ns.push(e);let l=new URL(window.location.href);l=new URL(e,l.origin),(0,T.p_)(!!n8&&(null==n8?void 0:n8.length)>0,(null==nC?void 0:null===(m=nC.response)||void 0===m?void 0:null===(h=m.docs)||void 0===h?void 0:h.length)>0,(null==n6?void 0:n6.length)>0&&(null===(p=n6[0])||void 0===p?void 0:null===(f=p.answer)||void 0===f?void 0:null===(g=f.citations)||void 0===g?void 0:g.length)>0,null==l?void 0:l.href);return}oE(e,l,n)}},oU=e=>{oE(e),oq(nO||1)},oq=e=>{.1!==e&&nr&&nO&&(nB(e),1===e?nb(0):nj===S.SearchTabName.IMAGE_TAB?nb((e-1)*36):o_(nj)?nb((e-1)*40):nb((e-1)*10),e>1?nM(!0):nM(!1),0!=nF&&e<nF?nD(!0):nD(!1),oO(e))},oO=e=>{if(0!=nF&&nF>1){if(e&&e<=6&&e<=nF){let l=[];
1if(nF>e+4){for(let n=1;n<=e+4;n++)null==l||l.push(n);null==l||l.push(.1),null==l||l.push(nF)}else for(let e=1;e<=nF;e++)null==l||l.push(e);nq([...l])}else if(e>6){let l=[1,.1];for(let n=e-4;n<e;n++)null==l||l.push(n);for(let n=e;n<e+5;n++)n<nF&&(null==l||l.push(n));e<nF-4&&(null==l||l.push(.1)),null==l||l.push(nF),nq([...l])}}else nq([])},oB=async e=>{om(!0),nE("All"),nJ(e),l7(!1),nB(1),nb(0),n2&&n9&&(n4(!1),ny(!1))},oF=e=>{nW(e)},ok=(null==nn?void 0:nn.includes(S.Media.MEDIA_PRINT))||(null==nn?void 0:nn.includes(S.Media.MEDIA_HYBRID)),oG=null==nC?void 0:null===(ec=nC.facet_counts)||void 0===ec?void 0:null===(er=ec.facet_fields)||void 0===er?void 0:er._templatename,oH=(0,E.useEditionSwitcherVisibility)(null!==(lZ=null==e?void 0:null===(em=e.fields)||void 0===em?void 0:em.ContentType)&&void 0!==lZ?lZ:[],nj),oV=()=>{oo(!0),ob.current&&(ob.current.value="",ob.current.placeholder=l9("enterFollowupQue"),ob.current.focus())},oQ=()=>{oo(!1),ob.current&&(ob.current.value="",ob.current.placeholder=l9("enterNewQue"),ob.current.focus())},oK=(()=>{var e;let l=null!==(e=null==nV?void 0:nV.findIndex(e=>e===S.SearchTabName.IMAGE||e===S.SearchTabName.JPEG))&&void 0!==e?e:-1;return l>=0&&nV[l+1]>0})(),oY=(null==nC?void 0:null===(eh=nC.response)||void 0===eh?void 0:null===(ep=eh.docs)||void 0===ep?void 0:ep.length)>0||Boolean(n8),oZ=(null==nC?void 0:null===(ef=nC.facet_counts)||void 0===ef?void 0:null===(eg=ef.facet_fields)||void 0===eg?void 0:null===(e_=eg._templatename)||void 0===e_?void 0:e_.length)===2&&(null==nC?void 0:null===(eS=nC.facet_counts)||void 0===eS?void 0:null===(eT=eS.facet_fields)||void 0===eT?void 0:eT._templatename[0])===S.SearchTabName.MM_TOPIC||(null==n8?void 0:n8.length),oJ=ox?nj===S.SearchTabName.ALL_TAB?(null==nC?void 0:null===(l0=nC.response)||void 0===l0?void 0:null===(l1=l0.docs)||void 0===l1?void 0:l1.length)===0&&(!n8||0===n8.length)&&!on&&!oe:nj===S.SearchTabName.TOPIC?(null==nC?void 0:null===(l2=nC.response)||void 0===l2?void 0:null===(l3=l2.docs)||void 0===l3?void 0:l3.length)===0&&(!n8||0===n8.length):(null==nC?void 0:null===(l$=nC.response)||void 0===l$?void 0:null===(lX=l$.docs)||void 0===lX?void 0:lX.length)===0&&!oe:nj===S.SearchTabName.TOP_IMAGES?0===ot.length&&!oe:(null==nC?void 0:null===(lz=nC.response)||void 0===lz?void 0:null===(lW=lz.docs)||void 0===lW?void 0:lW.length)===0,oz=nd!==S.Edition.VETERINARY&&oH,oW=(0,t.useCallback)(()=>{let e=new URLSearchParams(window.location.search),l=e.get("query");ob.current&&null!==l&&!on&&(ob.current.value=l)},[on]);return(0,t.useEffect)(()=>{let e=e=>{e.persisted&&oW()},l=()=>{oW()};return window.addEventListener("pageshow",e),window.addEventListener("popstate",l),()=>{window.removeEventListener("pageshow",e),window.removeEventListener("popstate",l)}},[oW]),(0,o.jsxs)("section",{className:"".concat(l5===S.Theme.LIGHT?c().themeLight:c().themeDark," ").concat(c().sectionContainer," ").concat(nT&&"outerCurvedBorder"),"data-testid":"searchResult",children:[(0,o.jsxs)("div",{className:c().topContainer,children:[(null==ow?void 0:ow.fields)&&(0,o.jsx)("div",{className:"".concat(c().mainSearch," ").concat(ox&&c().searchContainer," ").concat(ok?c().printMainSearch:""),children:ox?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:c().aiSearchContainer,"data-testid":"aiSearchContainer",children:[on&&(0,o.jsxs)("div",{className:c().parentQue,children:[(0,o.jsx)(h(),{src:l5===S.Theme.LIGHT?x.Z.src:y.Z.src,width:19,height:19,loader:e=>(0,D.customImageLoader)(e),alt:l9("SearchText")}),(0,o.jsx)("div",{className:c().parentQueText,children:null===(ew=n6[n6.length-1])||void 0===ew?void 0:ew.query})]}),(0,o.jsxs)("div",{className:c().aiSearchAndButtonContainer,children:[(0,o.jsx)(j.default,{ref:ob,searchOnclick:()=>{var e,l;oL(null!==(l=null==ob?void 0:null===(e=ob.current)||void 0===e?void 0:e.value.trim())&&void 0!==l?l:"",on)},isFollowup:null!=on&&on,isAIBorder:!0,speechLanguage:(0,L.TH)(null==nt?void 0:nt.language),onVoiceResult:e=>{oL(e.trim(),on)}}),oi&&(0,o.jsx)(o.Fragment,{children:on?(0,o.jsx)(f.Z,{className:c().followupBtn,onClick:oQ,id:"newQuestionBtn","data-testid":"newQuestionBtn",children:l9("AskANewQuestion")}):of?null:(0,o.jsxs)(f.Z,{className:c().followupBtn,onClick:oV,id:"followupBtn","data-testid":"followupBtn",children:[(0,o.jsx)(h(),{className:c().followupBtnImg,src:p.Z.src,height:15,width:22,alt:l9("AskAFollowup"),loader:e=>(0,D.customImageLoader)(e),role:"none"}),l9("AskAFollowup")]})}
1),nd!==S.Edition.VETERINARY&&oH?(0,o.jsx)("div",{className:c().editionSwitcherContainer,children:(0,o.jsx)(a.V,{isAiSearch:ox,name:"OtherEditionSearch",rendering:null==e?void 0:e.rendering})}):null]}),nT&&(0,o.jsx)("div",{className:c().aiIntroContainer,children:(0,o.jsx)(M.default,{})})]})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:c().searchPageContainer,"data-testid":"mainSearchContainer",children:[(0,o.jsx)(N.default,{searchProps:null==ow?void 0:ow.fields,page:"searchresult",containerClassname:c().mainSearchContainer}),(0,o.jsx)("div",{className:c().editionSwitcherContainer,children:oz?(0,o.jsx)(a.V,{name:"OtherEditionSearch",rendering:null==e?void 0:e.rendering}):null})]}),nT&&(0,o.jsx)("div",{className:c().mainIntroContainer,children:(0,o.jsx)(R.default,{})})]})}),nx&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:oS,children:nj&&nx&&(0,o.jsx)(k,{tabDataCount:nV,selectedTab:oP,tabData:nG,showRefine:l8,setShowRefine:l7,activeTab:nj,setActivePage:nB,isAISearch:ox,isSearchStaxTopicFacetPresent:ou,pageNumber:nO||0})}),l8&&(0,o.jsx)(F,{semanticscomputedsm:n0,sectionList:(null==e?void 0:null===(eN=e.sectionList)||void 0===eN?void 0:null===(eb=eN.response)||void 0===eb?void 0:eb.docs)?null==e?void 0:null===(ex=e.sectionList)||void 0===ex?void 0:null===(ey=ex.response)||void 0===ey?void 0:ey.docs:[],sitecoreLanguage:null==nt?void 0:nt.language,checkedFilter:nZ,handleApplyFilter:oB,data:eo,setShowRefine:l7})," "]})]}),nx&&(0,o.jsx)(o.Fragment,{children:oY||nj===S.SearchTabName.IMAGE_TAB&&(null==nz?void 0:nz.length)>0?(0,o.jsx)("div",{className:"".concat(!(nj===S.SearchTabName.ALL_TAB&&ox)&&c().searchResults),children:(0,o.jsx)("div",{className:c().content,children:(0,o.jsx)(B.default,{shouldNotShow:oJ,children:(0,o.jsx)("div",{className:" ".concat(o_(nj)||nj===S.SearchTabName.IMAGE_TAB||nj===S.SearchTabName.CASESTUDY_TAB||nj===S.SearchTabName.ALL_TAB?c().contentLeftFull:c().contentLeftHalf),children:(0,o.jsxs)("div",{className:c().tabContent,children:[nj===S.SearchTabName.ALL_TAB&&!or&&(0,o.jsx)(U.default,{answers:n6,aiSearchResults:n8,loadingState:oe,queryParam:oi,disclaimerText:ox&&null!==(lJ=null==na?void 0:null===(eL=na.Disclaimer)||void 0===eL?void 0:eL.value)&&void 0!==lJ?lJ:"",resourcesResults:ot,queryUrl:n_,media:nn,dateformat:e.dateformat,selectedTab:oP,searchStaxProps:{isSearchStaxTopicFacetPresent:ou},searchLayoutRef:oS,data:null==nC?void 0:nC.response,isAiSearch:ox,firsLoadCompleted:nx}),nj===S.SearchTabName.TOP_IMAGES&&ot.length>0&&(0,o.jsx)(O.default,{resourcesResults:ot,queryUrl:n_,media:nn,dateformat:e.dateformat,selectedTab:oP}),nj===S.SearchTabName.TOPIC&&oZ&&(ou?(0,o.jsx)(G,{query:n_,data:null==nC?void 0:nC.response,isAiSearch:ox}):n8&&(0,o.jsx)("div",{className:c().searchResultsAIContainer,children:(0,o.jsx)(q.default,{searchResults:n8,queryParam:oi,isSearchPage:!0})})),nj===S.SearchTabName.PET_HEALTH_TAB&&(null==nC?void 0:null===(eA=nC.facet_counts)||void 0===eA?void 0:null===(eC=eA.facet_fields)||void 0===eC?void 0:null===(eI=eC._templatename)||void 0===eI?void 0:eI.length)===2&&(null==nC?void 0:null===(ej=nC.facet_counts)||void 0===ej?void 0:null===(eE=ej.facet_fields)||void 0===eE?void 0:eE._templatename[0])===S.SearchTabName.MM_TOPIC&&(0,o.jsx)(G,{query:n_,data:null==nC?void 0:nC.response}),nj===S.SearchTabName.VET_TOPIC&&(null==nC?void 0:null===(eR=nC.facet_counts)||void 0===eR?void 0:null===(eM=eR.facet_fields)||void 0===eM?void 0:null===(eP=eM._templatename)||void 0===eP?void 0:eP.length)===2&&(null==nC?void 0:null===(eD=nC.facet_counts)||void 0===eD?void 0:null===(eU=eD.facet_fields)||void 0===eU?void 0:eU._templatename[0])===S.SearchTabName.MM_TOPIC&&(0,o.jsx)(G,{query:n_,data:null==nC?void 0:nC.response}),nj===S.SearchTabName.AUTHOR&&(null==nC?void 0:null===(eq=nC.facet_counts)||void 0===eq?void 0:null===(eO=eq.facet_fields)||void 0===eO?void 0:null===(eB=eO._templatename)||void 0===eB?void 0:eB.length)===2&&(null==nC?void 0:null===(eF=nC.facet_counts)||void 0===eF?void 0:null===(ek=eF.facet_fields)||void 0===ek?void 0:ek._templatename[0])===S.SearchTabName.AUTHOR.toLowerCase()&&(0,o.jsx)(C.default,{queryUrl:n_,data:null==nC?void 0:nC.response}),o_(nj)&&oG&&(null==oG?void 0:oG.length)>=2&&(oG[0]===S.SearchTabName.VIDEO||oG[0]===(null===(eG=S.Media.Video)||void 0===eG?void 0:eG.toLowerCase()))&&
1(0,o.jsx)(H,{tab:S.SearchTabName.VIDEO,queryUrl:n_,data:null==nC?void 0:nC.response,media:nn}),nj===S.SearchTabName.QUIZ_TAB&&(null==nC?void 0:null===(eH=nC.facet_counts)||void 0===eH?void 0:null===(eV=eH.facet_fields)||void 0===eV?void 0:null===(eQ=eV._templatename)||void 0===eQ?void 0:eQ.length)===2&&(null==nC?void 0:null===(eK=nC.facet_counts)||void 0===eK?void 0:null===(eY=eK.facet_fields)||void 0===eY?void 0:eY._templatename[0])===S.SearchTabName.QUIZ&&(0,o.jsx)(K,{data:null==nC?void 0:nC.response,media:nn,queryUrl:n_}),nj===S.SearchTabName.ABOUT_TAB&&((null==nC?void 0:null===(eZ=nC.facet_counts)||void 0===eZ?void 0:null===(eJ=eZ.facet_fields)||void 0===eJ?void 0:null===(ez=eJ._templatename)||void 0===ez?void 0:ez.length)===2||(null==nC?void 0:null===(eW=nC.facet_counts)||void 0===eW?void 0:null===(e$=eW.facet_fields)||void 0===e$?void 0:null===(eX=e$._templatename)||void 0===eX?void 0:eX.length)===4)&&((null==nC?void 0:null===(e0=nC.facet_counts)||void 0===e0?void 0:null===(e1=e0.facet_fields)||void 0===e1?void 0:e1._templatename[0])===S.SearchTabName.ABOUT_TAB_CONTENT1||(null==nC?void 0:null===(e2=nC.facet_counts)||void 0===e2?void 0:null===(e3=e2.facet_fields)||void 0===e3?void 0:e3._templatename[0])===S.SearchTabName.ABOUT_TAB_CONTENT2)&&(0,o.jsx)(en,{data:null==nC?void 0:nC.response,queryUrl:n_}),nj===S.SearchTabName.NEWS_TAB&&(null==nC?void 0:null===(e9=nC.facet_counts)||void 0===e9?void 0:null===(e4=e9.facet_fields)||void 0===e4?void 0:null===(e6=e4._templatename)||void 0===e6?void 0:e6.length)===2&&(null==nC?void 0:null===(e5=nC.facet_counts)||void 0===e5?void 0:null===(e8=e5.facet_fields)||void 0===e8?void 0:e8._templatename[0])===S.SearchTabName.NEWS&&(0,o.jsx)(V,{data:null==nC?void 0:nC.response,dateformat:e.dateformat,queryUrl:n_}),nj.trim().toUpperCase()===S.SearchTabName.CALCULATOR_TAB.trim().toUpperCase()&&(null==nC?void 0:null===(e7=nC.facet_counts)||void 0===e7?void 0:null===(le=e7.facet_fields)||void 0===le?void 0:null===(ll=le._templatename)||void 0===ll?void 0:ll.length)===2&&(null==nC?void 0:null===(ln=nC.facet_counts)||void 0===ln?void 0:null===(lo=ln.facet_fields)||void 0===lo?void 0:lo._templatename[0])===S.SearchTabName.CALCULATOR&&(0,o.jsx)(Q,{data:null==nC?void 0:nC.response,media:nn,queryUrl:n_}),nj===S.SearchTabName.IMAGE_TAB&&(0,o.jsx)(Y,{query:nr,queryUrl:n_,language:l6,startIndex:nN,activeTab:nj,refineFilter:nZ,getImageData:oF,VetFilterData:n$,media:nn,shouldFetchImageData:oK}),nj===S.SearchTabName.BIODIGITAL_TAB&&(null==nC?void 0:null===(li=nC.facet_counts)||void 0===li?void 0:null===(la=li.facet_fields)||void 0===la?void 0:null===(lt=la._templatename)||void 0===lt?void 0:lt.length)===2&&(null==nC?void 0:null===(ld=nC.facet_counts)||void 0===ld?void 0:null===(lu=ld.facet_fields)||void 0===lu?void 0:lu._templatename[0])===S.SearchTabName.BIODIGITAL&&(0,o.jsx)(X,{data:null==nC?void 0:nC.response,media:nn,queryUrl:n_}),nj===S.SearchTabName.INFOGRAPHIC_TAB&&(null==nC?void 0:null===(ls=nC.facet_counts)||void 0===ls?void 0:null===(lv=ls.facet_fields)||void 0===lv?void 0:null===(lc=lv._templatename)||void 0===lc?void 0:lc.length)===2&&(null==nC?void 0:null===(lr=nC.facet_counts)||void 0===lr?void 0:null===(lm=lr.facet_fields)||void 0===lm?void 0:lm._templatename[0].toLowerCase())===S.SearchTabName.MM_INFOGRAPHIC.toLowerCase()&&(0,o.jsx)(z,{data:null==nC?void 0:nC.response,queryUrl:n_}),nj===S.SearchTabName.CASESTUDY_TAB&&(null==nC?void 0:null===(lh=nC.response)||void 0===lh?void 0:null===(lp=lh.docs)||void 0===lp?void 0:lp.length)>0&&(0,o.jsx)(J,{data:null==nC?void 0:nC.response,queryUrl:n_}),nj===S.SearchTabName.TABLE_TAB&&(null==nC?void 0:null===(lf=nC.facet_counts)||void 0===lf?void 0:null===(lg=lf.facet_fields)||void 0===lg?void 0:null===(l_=lg._templatename)||void 0===l_?void 0:l_.length)===2&&(null==nC?void 0:null===(lS=nC.facet_counts)||void 0===lS?void 0:null===(lT=lS.facet_fields)||void 0===lT?void 0:lT._templatename[0])===S.SearchTabName.TABLE&&(0,o.jsx)(el,{data:null==nC?void 0:nC.response,media:nn,queryUrl:n_}),nj===S.SearchTabName.PODCAST_TAB&&(null==nC?void 0:null===(lw=nC.facet_counts)||void 0===lw?void 0:null===(lN=lw.facet_fields)||void 0===lN?void 0:null===(lb=lN._templatename)||void 0===lb?void 0:lb.length)===2&&(null==nC?void 0:null===(lx=nC.facet_counts)||void 0===lx?void 0:null===(ly=lx.facet_fields)||void 0===ly?void 0:ly._templatename[0])===S.SearchTabName.PODCAST&&(0,o.jsx)(Z,{data:null==nC?void 0:nC.response,queryUrl:n_}),nj===S.SearchTabName.LABTEST_TAB&&(null==nC?void 0:null===(lL=nC.facet_counts)||void 0===l
1L?void 0:null===(lA=lL.facet_fields)||void 0===lA?void 0:null===(lC=lA._templatename)||void 0===lC?void 0:lC.length)===2&&(null==nC?void 0:null===(lI=nC.facet_counts)||void 0===lI?void 0:null===(lj=lI.facet_fields)||void 0===lj?void 0:lj._templatename[0])===S.SearchTabName.LABTEST&&(0,o.jsx)(W,{data:null==nC?void 0:nC.response,media:nn,queryUrl:n_}),nj===S.SearchTabName.AUDIO_TAB&&(null==nC?void 0:null===(lE=nC.facet_counts)||void 0===lE?void 0:null===(lR=lE.facet_fields)||void 0===lR?void 0:null===(lM=lR._templatename)||void 0===lM?void 0:lM.length)===2&&(null==nC?void 0:null===(lP=nC.facet_counts)||void 0===lP?void 0:null===(lD=lP.facet_fields)||void 0===lD?void 0:lD._templatename[0])===S.SearchTabName.AUDIO&&(0,o.jsx)($,{data:null==nC?void 0:nC.response,media:nn,queryUrl:n_}),nj===S.SearchTabName.DRUG_TAB&&(null==nC?void 0:null===(lU=nC.facet_counts)||void 0===lU?void 0:null===(lq=lU.facet_fields)||void 0===lq?void 0:null===(lO=lq._templatename)||void 0===lO?void 0:lO.length)===2&&(null==nC?void 0:null===(lB=nC.facet_counts)||void 0===lB?void 0:null===(lF=lB.facet_fields)||void 0===lF?void 0:lF._templatename[0])===S.SearchTabName.PARENTMONOGRAPH&&(0,o.jsx)(ee,{data:null==nC?void 0:nC.response,media:nn,queryUrl:n_}),nj===S.SearchTabName.PRONUNCIATION_TAB&&(null==nC?void 0:null===(lk=nC.facet_counts)||void 0===lk?void 0:null===(lG=lk.facet_fields)||void 0===lG?void 0:null===(lH=lG._templatename)||void 0===lH?void 0:lH.length)===2&&(null==nC?void 0:null===(lV=nC.facet_counts)||void 0===lV?void 0:null===(lQ=lV.facet_fields)||void 0===lQ?void 0:lQ._templatename[0])===S.SearchTabName.PRONUNCIATION&&(0,o.jsx)(b.default,{pronunciationsArray:null==nC?void 0:null===(lK=nC.response)||void 0===lK?void 0:lK.docs,mediaType:nn}),!ne&&nU&&nU.length>0&&!(nj===S.SearchTabName.ALL_TAB||nj===S.SearchTabName.TOP_IMAGES)&&(0,o.jsx)("div",{className:c().newsPagination,children:(0,o.jsxs)("div",{className:c().paginationContent,children:[nR&&(0,o.jsxs)("span",{className:"".concat(c().paginationPage," ").concat(c().paginationInactive," ").concat((null==ni?void 0:ni.isClientTheme)&&"clientFontColor"),"data-testid":"getPageData",onClick:()=>oq(nO?nO-1:1),tabIndex:0,role:"link",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),oq(nO?nO-1:1))},children:[(0,o.jsx)("span",{"aria-hidden":"true",children:"<"})," ",l9("PreviousText").toUpperCase()]}),null==nU?void 0:nU.map((e,l)=>(0,o.jsx)("span",{role:"link",className:"".concat(c().paginationPage," ").concat(nO===e?c().paginationPage_active:c().paginationInactive," ").concat(nO!==e&&(null==ni?void 0:ni.isClientTheme)&&"clientFontColor"),"data-testid":"getPageData","aria-label":"".concat(l9("gotopage")," ").concat(.1===e?"...":e),onClick:()=>oq(e),onKeyDown:l=>{"Enter"===l.key&&(l.preventDefault(),oq(e))},tabIndex:0,"aria-current":nO===e?"page":void 0,children:.1===e?"...":e},l)),nP&&(0,o.jsxs)("span",{"data-testid":"getPageData",onClick:()=>oq(nO?nO+1:1),className:"".concat(c().paginationPage," ").concat(c().paginationInactive," ").concat((null==ni?void 0:ni.isClientTheme)&&"clientFontColor"),tabIndex:0,role:"link",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),oq(nO?nO+1:1))}
1,children:[l9("NextText").toUpperCase()," ",(0,o.jsx)("span",{"aria-hidden":"true",children:">"})]})]})}),ne||ok||nj===S.SearchTabName.ALL_TAB||nj===S.SearchTabName.TOP_IMAGES?null:(0,o.jsx)("div",{className:" ".concat(o_(nj)||nj===S.SearchTabName.IMAGE_TAB||nj===S.SearchTabName.ALL_TAB?c().contentLeftHalf:c().contentLeftFull),children:(0,o.jsx)(a.V,{name:"RelatedSearch",rendering:null==e?void 0:e.rendering})})]})})})})}):(0,o.jsx)(o.Fragment,{children:nx&&(0,o.jsx)("div",{className:c().noResults,children:ne?"":l9("NoResults")})})})]})},et=async(e,l)=>{var o,i,a,t,d,u,s,v,c,r,m;let h=null==l?void 0:null===(o=l.sitecore)||void 0===o?void 0:null===(i=o.route)||void 0===i?void 0:null===(a=i.placeholders)||void 0===a?void 0:null===(t=a["jss-main"])||void 0===t?void 0:t.find(e=>"MainContainer"===e.componentName),p=null==h?void 0:null===(d=h.fields)||void 0===d?void 0:d.data,f=null==p?void 0:p.LanguageSettings,_=(null==f?void 0:null===(u=f.DateFormat)||void 0===u?void 0:u.value)?null==f?void 0:null===(s=f.DateFormat)||void 0===s?void 0:s.value:"DD/MM/YY",T=(null==l?void 0:null===(v=l.sitecore)||void 0===v?void 0:null===(c=v.context)||void 0===c?void 0:c.language)?null==l?void 0:null===(r=l.sitecore)||void 0===r?void 0:null===(m=r.context)||void 0===m?void 0:m.language:"",w=(0,g.SearchstaxParams)(S.DefaultSearchStaxParam.QUERY,S.DefaultSearchStaxParam.ROWSHUNDRED,S.DefaultSearchStaxParam.START,S.SearchStaxModelName.MM_SECTION,T,"","titlecomputed_t,uniqueid_t",void 0,[]),N=await n.e(2249).then(n.bind(n,82249)),b=await N.GetSelectDataFromServer(w).then(e=>null==e?void 0:e.data).catch(e=>(console.log(e),null));return{sectionList:b,dateformat:_}};l.default=ea}}]);
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.