1import{ay as me,c as fe,b as pe,O as de,az as ve,L as ge,aA as _e,_ as S,aB as ye,l as be,V as ke,ad as j}from"./CczaoG5l.js";import{y as we,k as n,w as O,i as L,$ as Se,G as je,W as r,E as d,a0 as $,X as x,av as Le,a5 as m,A as s,a8 as xe,ah as Re,Z as J,a1 as q,_ as B,M as u,O as M,a2 as c,a4 as R,c as y}from"./2gc2_-wT.js";import W from"./CwcD4ecu.js";import{u as Ae}from"./DFBbysal.js";import{u as Te}from"./antXiplW.js";const Ce={for:"search",class:"sr-only"},Ie=["type","placeholder","aria-owns","aria-expanded","role"],Oe={role:"status","aria-live":"polite","aria-atomic":"true",class:"sr-only"},Je={key:0,class:"job-search-form__loading-container"},qe={key:1,class:"job-search-form__no-results font-copy-small"},Be=we({__name:"JobSearchForm",props:{size:{default:"loose"}},async setup(P){let b,K;const V=P,{push:Q}=me(),G=fe(),{t:a}=pe(),{searchJobSuggestion:X}=Te(),{domain:Y}=de().public,k=Ae(),v=n(),t=n(k.query);O(()=>k.query,e=>{t.value=e});const h=n(),l=n(!1),D=n([]),E=n([]),Z=L("searchInputRef",n());O(v,()=>{v.value&&(Z.value=v.value)});const A=ve(t,300),H=y(()=>`job_suggestion_${A.value}`),{data:F,pending:ee,execute:se}=([b,K]=Se(()=>ge(H,()=>X(A.value),{watch:[A],lazy:!0,server:!1})),b=await b,K(),b),te=y(()=>F.value?.jobs||[]),T=y(()=>F.value?.count||0),oe=()=>{l.value=!0},g=()=>{l.value=!1},C=n(!1),ae=e=>{e.key==="Tab"&&(C.value=!0)},le=e=>{e.key==="Tab"&&(C.value=!1)},ne=e=>{l.value&&C.value&&e.relatedTarget&&!h.value?.contains(e.relatedTarget)&&g()},ce=()=>{t.value="",v.value?.focus()};_e(h,()=>{g()});const z=e=>e.query?`${j(e.link)}?q=${e.query}`:j(e.link)??"#",re=document?.getElementsByClassName("hero-container__spotlight-overlay"),_=n(!1),f=L("contentSettings")?.mode,N=L("searchSuggestionItems")??n([]),w=L("searchSuggestionOptions")??n({limit:"5",searchShowAllInsightsLinks:void 0,searchShowAllJobsLink:void 0}),ie=y(()=>{const e=new URL(j(w.value.searchShowAllJobsLink),Y);return t.value&&e.searchParams.append("q",String(t.value)),e.pathname+e.search});function I(e){e.preventDefault()}O(l,async e=>{const i=document.getElementsByTagName("body"),p=e?300:0;e?(i[0].classList.add("lock-scroll"),document.addEventListener("touchmove",I,{passive:!1})):(i[0].classList.remove("lock-scroll"),document.removeEventListener("touchmove",I)),f==="default"&&(re?.[0]?.classList?.toggle("spotlight"),_.value=!1),await setTimeout(()=>{if(f==="default"){setTimeout(()=>{_.value=!0},400);const U=h.value?.getBoundingClientRect()?.top;h.value&&(U&&e?h.value.style.transform=`translateY(-${U-64}px)`:h.value.style.transform="unset")}else f==="modal"&&(_.value=!1,setTimeout(()=>{_.value=!0},50))},p)}),D.value=N[0]?.items??[],E.value=N[1]?.items??[];const ue=async()=>{await se(),k.setQuery(t.value),f==="modal"&&(k.showModal=!1);const e=w.value?.searchShowAllJobsLink;if(!e)return;const i=j(e)??"/";G.path!==i&&Q({path:i,query:{q:t.value}})};je(()=>{document.removeEventListener("touchmove",I)});const he=y(()=>({"job-search-form":!0,"job-search-form__loose":V.size==="loose","job-search-form__snug":V.size==="snug",spotlight:l.value&&f==="default"}));return(e,i)=>{const p=ke;return r(),d("div",{ref_key:"formWrapper",ref:h,class:$(he.value),"data-testid":"job-search-form",onFocusout:ne,onKeydown:ae,onKeyup:le},[x("form",{role:"search",class:"job-search-form__form",onSubmit:Le(ue,["prevent"])},[x("label",Ce,m(s(a)("jobs.search")),1),xe(x("input",{id:"search",ref_key:"searchInputRef",ref:v,"onUpdate:modelValue":i[0]||(i[0]=o=>t.value=o),type:l.value?"text":"search",class:"job-search-form__input ellipsis",placeholder:s(a)("jobs.search_jobs_placeholder"),"aria-owns":l.value?"suggestion-overlay":void 0,autocomplete:"off","aria-expanded":l.value?l.value:void 0,role:l.value?"combobox":"searchbox",onFocusin:oe,onKeydown:J(g,["escape"])},null,40,Ie),[[Re,t.value]]),t.value?.length?(r(),q(S,{key:0,"button-type":"button",class:"job-search-form__clear","aria-label":s(a)("jobs.clear"),type:"invisible",icon:"clear-input",theme:"on-light",action:()=>ce()},null,8,["aria-label","action"])):B("",!0),u(S,{"button-type":"submit",class:"job-search-form__search","aria-label":s(a)("jobs.search"),type:"primary",icon:"search",theme:"on-light",variant:"button",action:s(ye)},null,8,["aria-label","action"])],32),x("span",Oe,m(s(a)("search_suggestion.aria_found_items",{count:T.value})),1),s(f)!=="extended-search"?(r(),d(M,{key:0},[l.value?(r(),d("div",{key:0,id:"suggestion-overlay",class:$(["job-search-form__suggestion",{spotlight:_.value}])},[s(ee)&&T.value===0?(r(),d("div",Je,[u(be)])):t.value&&T.value===0?(r(),d("div",qe,m(s(a)("jobs.search_no_results_text",{searchTerm:t.value||""})),1)):(r(),d(M,{key:2},[!t.value||t.value?.length===0?(r(),q(W,{key:0,"column-left-items":D.value,"column-left-type":"link","column-left-title":s(a)("search_suggestion.common_search_term"),"column-right-type":"link","column-right-items":E.value,"column-right-title":s(a)("search_suggestion.quick_access"),onKeydown:J(g,["escape"])},{columnLeft:c(({item:o})=>[u(p,{class:"font-copy-medium ellipsis",to:z(o)},{default:c(()=>[R(m(o.label),1)]),_:2},1032,["to"])]),columnRight:c(({item:o})=>[u(p,{class:"font-copy-medium ellipsis",to:z(o)},{default:c(()=>[R(m(o.label),1)]),_:2},1032,["to"])]),_:1},8,["column-left-items","column-left-title","column-right-items","column-right-title"])):(r(),q(W,{key:1,"column-left-items":te.value,"column-left-type":"job","column-left-title":s(a)("search_suggestion.open_positions"),"column-right-type":"blog","column-right-items":[],"column-right-title":"",limit:+s(w).limit,onKeydown:J(g,["escape"])},{columnLeft:c(({item:o})=>[u(p,{class:"ellipsis font-copy-medium",to:o.link},{default:c(()=>[R(m(o.title),1)]),_:2},1032,["to"])]),columnLeftAction:c(()=>[u(S,{theme:"on-light",type:"invisible",label:s(a)("search_suggestion.show_all_jobs"),url:ie.value,class:"job-search-form__link","icon-pos":"right",icon:"arrow-right"}
1,null,8,["label","url"])]),columnRight:c(({item:o})=>[u(p,{href:"#",class:"ellipsis font-copy-medium"},{default:c(()=>[R(m(o.label),1)]),_:2},1024)]),columnRightAction:c(()=>[u(S,{theme:"on-light",type:"invisible",label:s(a)("search_suggestion.show_all_insights"),href:s(w).searchShowAllInsightsLinks,class:"job-search-form__link","icon-pos":"right",icon:"arrow-right"},null,8,["label","href"])]),_:1},8,["column-left-items","column-left-title","limit"]))],64))],2)):B("",!0)],64)):B("",!0)],34)}}}),Ne=Object.assign(Be,{__name:"JobSearchForm"});export{Ne as default};
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.