openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.76 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{J_ as t,K_ as n,bC as r,yC as i}from"./control-ui-boot-shared-DFTSUQQ0.js";import{B as a,C as o,F as s,U as c,d as l,gt as u,j as d,l as f,u as p,v as m,x as h}from"./solid-runtime-C416s-HC.js";import{c as g,d as _,f as v,l as y,o as b,s as x}from"./virtual-core-runtime-BYd4CRBu.js";function S(e){let t=[],[r,c]=a({source:[],rows:[],height:0}),p=()=>c({source:t,rows:h.getVirtualItems().map(e=>({option:t[e.index],index:e.index,count:t.length,start:e.start})),height:h.getTotalSize()}),h=new b({count:0,getScrollElement:e.viewport,estimateSize:()=>32,observeElementRect:v,observeElementOffset:_,scrollToFn:g,overscan:5,useAnimationFrameWithResizeObserver:!0,onChange:p}),[y,S]=a(),w=t=>{h.measureElement(t),t&&t===e.target()&&S(t)};u(()=>{let{_didMount:e}=h;return e()}),i(()=>({rows:e.options,active:e.active}),e=>{if(!e)return;t=e.rows;let n=t.findIndex(t=>t.value===e.active);h.setOptions({...h.options,count:t.length,getItemKey:e=>t[e].value,rangeExtractor:e=>[...new Set([...x(e),...n<0?[]:[n]])].toSorted((e,t)=>e-t)});let{_willUpdate:r}=h;r(),p()},{targets:()=>[e.viewport()],changeTiming:`sync`});let T=()=>r().source===e.options?r().height:e.options.length*32,E=()=>r().source===e.options?r().rows:[],D=s(()=>{let t=y(),n=e.active;return e.target()??(t?.dataset.value===n?t:void 0)});n(()=>{let t=D();return{reveal:t?{identity:[e.options,e.active,t],target:()=>e.pointerHighlight()?void 0:t}:void 0}},{region:e.viewport});var O=C();return l(O,d(o,{get each(){return E()},keyed:e=>e.option.value,children:t=>e.renderRow(t,w)})),f(()=>`${T()}px`,e=>{m(O,`height`,e)}),O}var C;function w(){return(w=e((()=>{p(),y(),c(),r(),t(),C=h(`<div class=picker-select__window>`)})))()}w();export{S as default};