import{b as v,d as u,h as c,e as h,T as L,p as S,g as E,s as Q,U as A,j as b,b3 as K,aE as $,n as j}from"./app-DzAYC6xy.js";const q=["B","KB","MB","GB","TB","PB"];function T(e,t=1){let a=0;for(;parseInt(e,10)>=1024&&a<q.length-1;)e/=1024,++a;return`${e.toFixed(t)}${q[a]}`}function z(e){return e.charAt(0).toUpperCase()+e.slice(1)}function F(e,t,a){return a<=t?t:Math.min(a,Math.max(t,e))}function M(e,t,a){if(a<=t)return t;const l=a-t+1;let i=t+(e-t)%l;return i<t&&(i=l+i),i===0?0:i}function P(e,t=2,a="0"){if(e==null)return e;const l=""+e;return l.length>=t?l:new Array(t-l.length+1).join(a)+l}const p=v({name:"QItemSection",props:{avatar:Boolean,thumbnail:Boolean,side:Boolean,top:Boolean,noWrap:Boolean},setup(e,{slots:t}){const a=u(()=>`q-item__section column q-item__section--${e.avatar===!0||e.side===!0||e.thumbnail===!0?"side":"main"}`+(e.top===!0?" q-item__section--top justify-start":" justify-center")+(e.avatar===!0?" q-item__section--avatar":"")+(e.thumbnail===!0?" q-item__section--thumbnail":"")+(e.noWrap===!0?" q-item__section--nowrap":""));return()=>c("div",{class:a.value},h(t.default))}}),D=v({name:"QItem",props:{...S,...L,tag:{type:String,default:"div"},active:{type:Boolean,default:null},clickable:Boolean,dense:Boolean,insetLevel:Number,tabindex:[String,Number],focused:Boolean,manualFocus:Boolean},emits:["click","keyup"],setup(e,{slots:t,emit:a}){const{proxy:{$q:l}}=E(),i=Q(e,l),{hasLink:d,linkAttrs:k,linkClass:_,linkTag:B,navigateOnClick:g}=A(),o=b(null),r=b(null),f=u(()=>e.clickable===!0||d.value===!0||e.tag==="label"),s=u(()=>e.disable!==!0&&f.value===!0),y=u(()=>"q-item q-item-type row no-wrap"+(e.dense===!0?" q-item--dense":"")+(i.value===!0?" q-item--dark":"")+(d.value===!0&&e.active===null?_.value:e.active===!0?` q-item--active${e.activeClass!==void 0?` ${e.activeClass}`:""}`:"")+(e.disable===!0?" disabled":"")+(s.value===!0?" q-item--clickable q-link cursor-pointer "+(e.manualFocus===!0?"q-manual-focusable":"q-focusable q-hoverable")+(e.focused===!0?" q-manual-focusable--focused":""):"")),x=u(()=>e.insetLevel===void 0?null:{["padding"+(l.lang.rtl===!0?"Right":"Left")]:16+e.insetLevel*56+"px"});function w(n){s.value===!0&&(r.value!==null&&n.qAvoidFocus!==!0&&(n.qKeyEvent!==!0&&document.activeElement===o.value?r.value.focus():document.activeElement===r.value&&o.value.focus()),g(n))}function C(n){if(s.value===!0&&K(n,[13,32])===!0){$(n),n.qKeyEvent=!0;const m=new MouseEvent("click",n);m.qKeyEvent=!0,o.value.dispatchEvent(m)}a("keyup",n)}function I(){const n=j(t.default,[]);return s.value===!0&&n.unshift(c("div",{class:"q-focus-helper",tabindex:-1,ref:r})),n}return()=>{const n={ref:o,class:y.value,style:x.value,role:"listitem",onClick:w,onKeyup:C};return s.value===!0?(n.tabindex=e.tabindex||"0",Object.assign(n,k.value)):f.value===!0&&(n["aria-disabled"]="true"),c(B.value,n,I())}}}),N=v({name:"QItemLabel",props:{overline:Boolean,caption:Boolean,header:Boolean,lines:[Number,String]},setup(e,{slots:t}){const a=u(()=>parseInt(e.lines,10)),l=u(()=>"q-item__label"+(e.overline===!0?" q-item__label--overline text-overline":"")+(e.caption===!0?" q-item__label--caption text-caption":"")+(e.header===!0?" q-item__label--header":"")+(a.value===1?" ellipsis":"")),i=u(()=>e.lines!==void 0&&a.value>1?{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":a.value}:null);return()=>c("div",{style:i.value,class:l.value},h(t.default))}});export{p as Q,D as a,F as b,N as c,z as d,T as h,M as n,P as p};
