import{r as e,c as t,h as i,H as s}from"./p-BIwHMk6j.js";const o=class{constructor(i){e(this,i),this.itemChange=t(this,"itemChange"),this.handlePathChange=e=>{e.stopPropagation();const t=e.detail;if(!t){const e=this.item[Object.keys(this.item)[0]]||"ASC";return void this.itemChange.emit({"":e})}const i=Object.keys(this.item)[0],s=this.item[i]||"ASC";this.itemChange.emit({[t]:s})},this.handleToggleDirection=()=>{const e=Object.keys(this.item)[0]||"",t="ASC"===(this.item[e]||"ASC")?"DESC":"ASC";this.itemChange.emit({[e]:t})},this.handleRemove=()=>{this.itemChange.emit(null)}}render(){const e=Object.keys(this.item)[0]||"",t=this.item[e]||"ASC";return i(s,{key:"f8b1d7505feec325eae8668672afe3768a4892aa"},i("limebb-property-selector",{key:"03f71edd8692c6a46612f87a9df21aabd2bf71eb",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:e,required:!0,onChange:this.handlePathChange}),i("div",{key:"a1a6db7060f8dc862d7acfb5750861293e2411d3",class:"control-buttons"},i("limel-icon-button",{key:"76703911899c38d71f116dc8256d00cb7c937971",icon:"ASC"===t?"sort_ascending":"sort_descending",label:"ASC"===t?"Ascending":"Descending",onClick:this.handleToggleDirection}),i("limel-icon-button",{key:"91a3370d5c6151370b96e7b67d59f226ad526f21",icon:"trash",label:"Remove",onClick:this.handleRemove})))}};o.style="*{box-sizing:border-box}:host(limebb-lime-query-order-by-item){box-sizing:border-box;display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}limebb-property-selector{flex-grow:1}.control-buttons{flex-shrink:0;display:flex;align-items:center;gap:0.25rem}";export{o as limebb_lime_query_order_by_item}