1import{_ as q}from"./CTnYL1et.js";import{v as J,au as K,aw as X,aK as G,$ as Q,a2 as l,o as s,l as r,ai as x,r as $,ak as W,n as D,F as C,a9 as A,X as I,aM as Y,aN as Z,aJ as ee,c as te,a8 as _,j as i,d as oe}from"./BYRJHJV6.js";import{I as ae}from"./PtYAQsea.js";import{s as ne}from"./vXitiGrt.js";const le={class:"container"},se={class:"title is-1 is-uppercase mb-5"},ce={key:0,class:"accordion-search-wrapper"},re={key:1,class:"accordion",role:"list"},ie=["id","aria-expanded","aria-controls","onClick"],ue={class:"accordion-title"},de={key:0,class:"search-highlight"},he={key:1},ve=["id","aria-labelledby"],me={class:"content"},ge=J({__name:"accordion-block",props:{block:{default:()=>({title:"",description:"",items:[],search:!1,background:"white"})}},setup(N){const{t:O,locale:m}=K(),{$firebase:y}=X(),d=N,c=_(-1),g=_(""),p=_(null),k=_(null);let w="";const h=i(()=>d.block?.items??[]),L=i(()=>`accordion-${d.block?.id??Math.random().toString(36).substring(2,7)}`),u=i(()=>g.value.trim()),f=i(()=>u.value.length>0),E=i(()=>u.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),F=i(()=>h.value.filter(e=>V(e))),B=i(()=>f.value?new RegExp(E.value,"gi"):null);G(u,()=>{c.value=-1,j(u.value)});function M(e){const t=c.value===e?-1:e,o=h.value[e];y.log("accordion_toggle",{accordion_title:o?.title,is_open:t===e}),c.value=c.value===e?-1:e,k.value=t===e?e:null}function b(e){return`${L.value}-control-${e}`}function S(e){return`${L.value}-panel-${e}`}function P(e){if(k.value!==e)return;k.value=null;const t=b(e),o=document.getElementById(t);if(!o)return;const a=o.getBoundingClientRect();(a.top<0||a.bottom>window.innerHeight)&&ne(t,600,-96)}function R(e){return e?B.value?e.replace(B.value,t=>`<mark class="search-highlight">${t}</mark>`):e:""}function H(e){if(!e)return[];if(!f.value)return[{text:e,match:!1}];const t=new RegExp(`(${E.value})`,"gi");return e.split(t).filter(o=>o.length>0).map(o=>({text:o,match:o.toLowerCase()===u.value.toLowerCase()}))}function V(e){if(!f.value)return!0;const t=u.value.toLocaleLowerCase(m.value),o=(e?.title??"").toLocaleLowerCase(m.value),a=(e?.description??"").toLocaleLowerCase(m.value);return o.includes(t)||a.includes(t)}function U(e){const t=F.value.length;y.log("accordion_search",{query:e,results_count:t,total_count:h.value.length,has_results:t>0})}function T(){p.value&&(window.clearTimeout(p.value),p.value=null)}function j(e){const t=e.trim().toLocaleLowerCase(m.value);if(T(),!t){w="";return}p.value=window.setTimeout(()=>{t!==w&&(w=t,U(t))},500)}return Q(()=>{T()}),(e,t)=>{const o=q;return l(),s("section",{class:I(["section accordion-block",[`background-${d.block.background}`]])},[r("div",le,[r("h2",se,x(d.block.title),1),d.block.search?(l(),s("div",ce,[$(ae,{modelValue:g.value,"onUpdate:modelValue":t[0]||(t[0]=a=>g.value=a),name:"accordion_search",class:"accordion-search","input-class":"accordion-search__input",placeholder:W(O)("layout.search"),"show-clear-button":"",type:"search",onClear:t[1]||(t[1]=a=>g.value="")},null,8,["modelValue","placeholder"])])):D("",!0),h.value.length?(l(),s("div",re,[(l(!0),s(C,null,A(h.value,(a,n)=>(l(),s("div",{key:a?.id||n,class:I(["accordion-item",{"is-dimmed":f.value&&!V(a)}]),role:"listitem"},[r("button",{id:b(n),class:"is-fullwidth accordion-item-row",type:"button","aria-expanded":c.value===n,"aria-controls":S(n),onClick:v=>M(n)},[r("span",ue,[(l(!0),s(C,null,A(H(a?.title),(v,z)=>(l(),s(C,{key:`title-${a?.id||n}-${z}`},[v.match?(l(),s("mark",de,x(v.text),1)):(l(),s("span",he,x(v.text),1))],64))),128))]),r("span",{class:I(["accordion-toggle",{"is-active":c.value===n}]),"aria-hidden":"true"},null,2)],8,ie),$(te,{name:"accordion",onAfterEnter:v=>P(n)},{default:Y(()=>[Z(r("div",{id:S(n),class:"accordion-panel",role:"region","aria-labelledby":b(n)},[r("div",me,[$(o,{value:R(a?.description||"")},null,8,["value"])])],8,ve),[[ee,c.value===n]])]),_:2},1032,["onAfterEnter"])],2))),128))])):D("",!0)])],2)}}}),we=Object.assign(oe(ge,[["__scopeId","data-v-e78494d6"]]),{__name:"UiPartialsAccordionBlock"});export{we 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.