Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 832

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
import{i as Q,b as G,a5 as I,j as W,a6 as X,r as b,$ as Y,B as F,q as Z,a7 as ee,c,o as u,e as d,y as B,K as te,L as se,g as n,J as S,N as oe,F as x,h as T,x as E,t as $,m as ne,a8 as le}from"./CQhRy8FD.js";const ie=["id"],re={role:"search",class:"form-box",autocomplete:"off"},ae={class:"search-box"},ce=["id","placeholder","aria-label"],ue={key:0,id:"search-list",role:"list","aria-label":"Suggested search list"},de=["onClick","onKeydown","aria-selected"],he={class:"search-item-chip"},ve={key:0,color:"purple"},pe={key:1,id:"search-list",role:"list","aria-label":"Suggested search list"},fe=["onClick","onKeydown","aria-selected"],ge=["aria-label"],ye=["disabled"],be=["aria-label"],Se={__name:"SearchAutocomplete",props:["product","siteSearch","closeButton"],emits:["customChange"],setup(_,{emit:j}){G({script:[{type:"module",innerHTML:` import "@rhds/elements/rh-button/rh-button.js"; import '@rhds/elements/rh-tag/rh-tag.js'; `}]});const f=_,q=j,{onsiteSearchPerformed:H}=I(),M=W(),{params:e}=M,h=X({}),a=b(!1),K=b([]),C=b(null),D=b(null);Y(async()=>{try{const t=await fetch("/api/search-suggestions.json");if(!t.ok)throw new Error("No search results are found");K.value=await t.json()}catch(t){console.error("Error fetching the JSON file:",t)}window.addEventListener("pageshow",t=>{t.persisted&&(i.value="",a.value=!1,h.value={})})});const P=F(()=>f.siteSearch==="home_page"?{"data-analytics-category":"RHDOC|HP|Hero|Search documentation","data-analytics-text":"Search","data-analytics-linkType":"cta"}:{}),i=b(""),p=F(()=>{let t={},s=[];return e!=null&&e.product&&(e!=null&&e.version)&&(s.push({text:i.value,product:f.product,version:e==null?void 0:e.version}),s.push({text:i.value,product:"",version:""})),t.scopeList=s,t.suggestionList=(K.value||[]).filter(r=>r&&r.includes(i.value)).slice(0,5),t}),R=()=>{var r,m,k,w,L,o,v;H("Manual",i.value,f.siteSearch);const t="/search/?p=1&rows=10&search-type=global&documentKind=Documentation",s=new URLSearchParams;if((r=h.value)!=null&&r.product&&((m=h.value)!=null&&m.version)){s.set("src","scoped"),s.set("q",(k=h.value)==null?void 0:k.text),s.set("product",(w=h.value)==null?void 0:w.product),s.set("documentation_version","&"+((L=h.value)==null?void 0:L.product)+"&"+((o=h.value)==null?void 0:o.version));const y=s.toString();window.location=t+"&"+y}else{s.set("q",(v=h.value)==null?void 0:v.text);const y=s.toString();window.location=t+"&"+y}},g=t=>{e!=null&&e.product&&(e!=null&&e.version)?h.value=t.hasOwnProperty("product")?t:{text:t,product:f.product,version:e==null?void 0:e.version}:h.value={text:t},a.value=!1,R()},U=()=>{i.value="",e!=null&&e.product||(a.value=!1),document.getElementById(`input-search-${f.siteSearch}`).focus()},l=b(-1),V=t=>{let s;if(e!=null&&e.product?s=p.value.scopeList.length:s=p.value.suggestionList.length,t.key==="ArrowDown")t.preventDefault(),l.value0?l.value-=1:l.value===0&&(l.value=-1);else if(t.key==="Enter"&&(t.preventDefault(),l.value>=0&&l.value{a.value=!1,l.value=-1,document.getElementById(`input-search-${f.siteSearch}`).focus()},O=()=>{f.closeButton?q("toggle-search",!1):(a.value=!1,document.getElementById(`input-search-${f.siteSearch}`).focus())},N=()=>{e!=null&&e.product&&(e!=null&&e.version)&&(a.value=!0),!(e!=null&&e.product)&&!i.value&&(a.value=!1),!(e!=null&&e.product)&&i.value&&(a.value=!0)};Z(()=>{document.addEventListener("click",z)}),ee(()=>{document.removeEventListener("click",z)});function z(t){C.value&&!C.value.contains(t.target)&&(a.value=!1)}function J(t){const s=t.relatedTarget;D.value===s&&(a.value=!1)}return(t,s)=>{var r,m,k,w,L;return u(),c("div",{id:`search-form-${_.siteSearch}`,class:"search-container",ref_key:"searchContainer",ref:C,onFocusout:J},[d("form",re,[d("div",ae,[s[7]||(s[7]=d("rh-icon",{set:"ui",icon:"search",size:"md",class:"search-icon-form"},null,-1)),te(d("input",{type:"text",id:`input-search-${_.siteSearch}`,class:"input-search-box",placeholder:(r=n(e))!=null&&r.product?t.$t("search_within_product"):t.$t("search_doc"),"aria-label":(m=n(e))!=null&&m.product?t.$t("search_within_product"):t.$t("search_doc"),"onUpdate:modelValue":s[0]||(s[0]=o=>oe(i)?i.value=o:null),onKeyup:S(O,["esc"]),onKeydown:[s[1]||(s[1]=S(o=>g(n(i)),["enter"])),V],onFocusin:N,onInput:N,onAriaAutocomplete:s[2]||(s[2]=(...o)=>t.list&&t.list(...o))},null,40,ce),[[se,n(i)]]),((w=(k=n(p))==null?void 0:k.scopeList)==null?void 0:w.length)>0&&n(a)?(u(),c("ul",ue,[(u(!0),c(x,null,T(n(p).scopeList,(o,v)=>(u(),c("li",{key:`${o.text}:${v}`,role:"button",onClick:y=>g(o),class:E({active:v===n(l)}),onKeydown:S(y=>g(o),["enter"]),onKeyup:S(A,["esc"]),"aria-selected":v===n(l)},[s[4]||(s[4]=d("rh-icon",{set:"ui",icon:"search",size:"md",class:"search-icon-form"},null,-1)),d("span",{class:E({"search-item-text":!0,"search-item-text-elipsis":o.product})},$(o.text),3),d("span",he,[o.product?(u(),c("rh-tag",ve,"in: "+$(o.product)+": "+$(o.version),1)):(u(),c(x,{key:1},[ne($(t.$t("search_all_products")),1)],64))])],42,de))),128))])):B("",!0),!((L=n(e))!=null&&L.product)&&n(a)?(u(),c("ul",pe,[(u(!0),c(x,null,T(n(p).suggestionList,(o,v)=>(u(),c("li",{key:`${o}:${v}`,role:"button",onClick:y=>g(o),class:E({active:v===n(l)}),onKeydown:S(y=>g(o),["enter"]),onKeyup:S(A,["esc"]),"aria-selected":v===n(l)},$(o),43,fe))),128))])):B("",!0),n(i).length?(u(),c("button",{key:2,class:"input-clear-btn",onClick:U,"aria-label":t.$t("clear")},s[5]||(s[5]=[d("rh-icon",{set:"ui",icon:"close",size:"md",class:"input-clear-icon"},null,-1)]),8,ge)):B("",!0),d("rh-button",le({disabled:n(i).length<=0,variant:"tertiary",label:"Submit search",class:"form-submit-btn"},n(P),{onClick:s[3]||(s[3]=o=>g(n(i))),ref_key:"submitBtn",ref:D}),s[6]||(s[6]=[d("rh-icon",{set:"ui",icon:"arrow-right",size:"md",class:"form-submit-icon"},null,-1)]),16,ye)])]),_.closeButton?(u(),c("button",{key:0,class:"input-close-btn",onClick:O,"aria-label":t.$t("nav_close_search")},s[8]||(s[8]=[d("rh-icon",{set:"ui",icon:"close",size:"md",class:"input-close-icon"},null,-1)]),8,be)):B("",!0)],40,ie)}}},ke=Q(Se,[["__scopeId","data-v-7ec4cdc4"]]);export{ke as _};