1import{_ as T}from"./CJduDl6F.js";import{d as $,i as x,j as B,o as d,e as m,f as e,t as u,h as I,k as M,p as Y,a,E as w,a6 as S,g as N,a0 as j,B as L,w as k,bB as R,F as K,r as F,n as q,M as A,m as _}from"./DjRoh7cm.js";import{u as O}from"./dI5mY376.js";const U={for:"pulse-search",class:"sr-only"},z={class:"relative flex w-full"},P={class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-4 text-base-content"},G=["placeholder"],H={class:"absolute inset-y-0 right-3 flex items-center text-base-content"},J=$({__name:"DNSearch",props:{modelValue:{},placeholder:{}},emits:["update:modelValue","inputElementReady"],setup(i,{emit:b}){const o=i,p=b,l=x(),s=x();B(()=>{l.value=o.modelValue,p("inputElementReady",s.value)});function g(){l.value="",p("update:modelValue",l.value),s.value.focus()}return(h,r)=>{const v=T;return d(),m("form",{onSubmit:r[2]||(r[2]=S(()=>{},["prevent"]))},[e("label",U,u(i.placeholder??h.$t("common.search")),1),e("div",z,[e("div",P,[I(v,{icon:"search"})]),M(e("input",{ref_key:"searchInputElement",ref:s,"onUpdate:modelValue":r[0]||(r[0]=f=>w(l)?l.value=f:null),autocomplete:"off",name:"pulse-search",type:"text",class:"w-full rounded-3xl bg-base-100 p-2.5 pl-10 pr-8 text-sm text-base-content",placeholder:i.placeholder??h.$t("common.search"),required:"",onInput:r[1]||(r[1]=f=>p("update:modelValue",a(l)))},null,40,G),[[Y,a(l)]]),e("div",H,[a(l)?.length?(d(),m("button",{key:0,class:"flex items-center",onClick:S(g,["stop"])},[I(v,{icon:"e-remove"})])):N("",!0)])])],32)}}}),Q=Object.assign(J,{__name:"DNSearch"}),W={for:"pulse-search",class:"sr-only"},X={class:"relative w-full"},Z={key:0,class:"flex h-28 items-center justify-center font-mono"},ee={key:1},te=["aria-selected"],ne=["onClick"],se={key:2,class:"mb-3 hidden lg:inline"},oe={class:"mb-2 text-xs text-base-content"},ae={class:"mb-2 text-xs text-base-content"},le={class:"mb-2 text-xs text-base-content"},re=1e3,ie=$({__name:"DNInstrumentSearch",props:{isShowingInstructions:{type:Boolean},filter:{type:Function},instrumentTypes:{},avoidInstrumentTypes:{},omitList:{},placeholder:{},isKeyNavigationEnabled:{type:Boolean}},emits:["selectedInstrument","searchChanged","searchStopped"],setup(i,{emit:b}){const o=i,p=b,l=j().public,s=x();function g(t){if(!o.omitList&&!o.instrumentTypes&&!o.avoidInstrumentTypes)return!0;let n=!0;return o.omitList?.length&&(n=!o.omitList.includes(t.quant)),n!==!1&&o.avoidInstrumentTypes?.length&&(n=!o.avoidInstrumentTypes.includes(t._t),o.avoidInstrumentTypes.includes("crypto")&&(n=!["Y74","Y75","Y76","Y77","Y78","Y79","Y80"].includes(t.quant))),n!==!1&&o.instrumentTypes?.length&&(n=o.instrumentTypes.includes(t._t)),n}const{results:h,activeIndex:r,selectedInstrument:v}=O(s,{maxResults:6,isKeyNavigationEnabled:o.isKeyNavigationEnabled,filter:o.filter??g});function f(){s.value="",p("searchStopped")}const V=L("secret-search",()=>{});l.isEasterEggsEnabled&&k(s,t=>{t==="!space"&&(V.value=t,f())});function E(t){f(),p("selectedInstrument",t,s.value),s.value=""}k(v,t=>{t&&E(t)});const C=R(s,re);return k(C,t=>{p("searchChanged",t,h.value?.length??0)}),(t,n)=>{const D=Q;return d(),m("div",null,[e("label",W,u(t.$t("common.search")),1),e("div",X,[I(D,{modelValue:a(s),"onUpdate:modelValue":n[0]||(n[0]=c=>w(s)?s.value=c:null),placeholder:i.placeholder,onInputElementReady:n[1]||(n[1]=c=>c.focus())},null,8,["modelValue","placeholder"])]),a(h)?.length?(d(),m("ul",ee,[(d(!0),m(K,null,F(a(h),(c,y)=>(d(),m("li",{key:y,class:"my-5","aria-selected":i.isKeyNavigationEnabled&&a(r)===y},[e("div",{class:q(["flex h-14 w-full items-center rounded-sm border border-primary/40 p-5 font-mono transition-all hover:scale-105 hover:cursor-pointer",{"scale-105 bg-primary/80 text-gray-100 dark:text-gray-700":i.isKeyNavigationEnabled&&a(r)===y}]),onClick:ce=>E(c)},u(c.displayName)+" "+u("ticker"in c?`(${c.ticker})`:""),11,ne)],8,te))),128))])):(d(),m("div",Z,u(a(s)?.length>2?`Ingen resultater for «${a(s)}»`:"Søk etter noe i Investor"),1)),A(t.$slots,"external-links",{search:a(s),stopSearch:f}),o.isShowingInstructions?(d(),m("div",se,[e("div",oe,[n[2]||(n[2]=e("kbd",{class:"kbd pointer-events-none mr-1"}
1,"Enter",-1)),_(" "+u(t.$t("common.to-choose")),1)]),e("div",ae,[n[3]||(n[3]=e("kbd",{class:"kbd pointer-events-none mr-1"},[e("svg",{width:"15",height:"15","aria-label":"Arrow down",role:"img"},[e("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.2"},[e("path",{d:"M7.5 3.5v8M10.5 8.5l-3 3-3-3"})])])],-1)),n[4]||(n[4]=e("kbd",{class:"kbd pointer-events-none mr-1"},[e("svg",{width:"15",height:"15","aria-label":"Arrow up",role:"img"},[e("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.2"},[e("path",{d:"M7.5 11.5v-8M10.5 6.5l-3-3-3 3"})])])],-1)),_(" "+u(t.$t("common.to-navigate")),1)]),e("div",le,[n[5]||(n[5]=e("kbd",{class:"kbd pointer-events-none mr-1"},"Esc",-1)),_(" "+u(t.$t("common.to-close")),1)])])):N("",!0)])}}}),pe=Object.assign(ie,{__name:"DNInstrumentSearch"});export{pe as _};
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.