import{I as E}from"./IdnodeGrid-U6EqXqja.js";import{d as v,u as x,o as B,e as k,f as n,g as d,i as V,t as I,h as e,I as S,F as D,r as R,_ as F}from"./index-D92x6h1h.js";import{A as L}from"./ActionMenu-B3aKIJFu.js";import{B as o}from"./BooleanCell-BFiLlZVv.js";import{u as N}from"./useEditorMode-DvyB-mon.js";import{u as z}from"./useBulkAction-UV8yZtrd.js";import{b as M}from"./dvrToolbarHelpers-C5M0Cokf.js";import"./DataGrid-CbtTsx8d.js";import"./index-BG9mM10J.js";import"./index-7HNOjfAo.js";import"./localDay-CoEbUe3O.js";import"./SearchInput-DBHWpJgW.js";import"./useGridLayout-DCIiMD42.js";import"./CollapsibleSection.vue_vue_type_style_index_0_lang-Cq2AVc9p.js";import"./sliders-horizontal-Am8f4Xsv.js";import"./useStaleDataRecovery-BuNK-94T.js";const O={class:"channel-tags__empty"},U=v({__name:"ChannelTagsView",setup(G){const{t}=x(),c=[{field:"enabled",sortable:!0,filterType:"boolean",width:90,minVisible:"phone",phoneOrder:1,cellComponent:o,editable:!0},{field:"index",sortable:!0,filterType:"numeric",width:110,editable:!0},{field:"name",sortable:!0,filterType:"string",width:280,minVisible:"phone",phoneRole:"primary",editable:!0},{field:"internal",sortable:!0,filterType:"boolean",width:110,cellComponent:o,editable:!0},{field:"private",sortable:!0,filterType:"boolean",width:110,cellComponent:o,editable:!0},{field:"icon",sortable:!0,filterType:"string",width:240,editable:!0},{field:"titled_icon",sortable:!0,filterType:"boolean",width:130,cellComponent:o,editable:!0},{field:"comment",sortable:!0,filterType:"string",width:280,minVisible:"phone",phoneOrder:2,editable:!0}],p=R(""),{editingUuid:a,editingUuids:u,creatingBase:m,creatingSubclass:f,gridRef:b,editorLevel:g,editorList:h,openEditor:r,openCreate:y,closeEditor:_,flipToEdit:C}=N({createBase:"channeltag",editList:p,urlSync:!0}),T=z({endpoint:"idnode/delete",confirmText:t("Do you really want to delete the selected channel tags?"),confirmSeverity:"danger",failPrefix:t("Failed to delete")});function w(s,i){return M({selection:s,clearSelection:i,remove:T,onAdd:()=>y(),onEdit:r,addTooltip:t("Add a new channel tag")})}return(s,i)=>(B(),k(D,null,[n(E,{ref_key:"gridRef",ref:b,endpoint:"channeltag/grid","help-page":"class/channeltag","entity-class":"channeltag",columns:c,"store-key":"config-channel-tags","default-sort":{key:"name",dir:"ASC"},"extra-params":{all:1},"virtual-scroller-options":{itemSize:36,lazy:!1},"count-label":e(t)("tags"),"edit-mode":"cell",class:"channel-tags__grid",onRowDblclick:i[0]||(i[0]=l=>e(r)([l]))},{empty:d(()=>[V("p",O,I(e(t)("No channel tags defined. Tags group channels for display ordering and access-control rules.")),1)]),toolbarActions:d(({selection:l,clearSelection:A})=>[n(L,{actions:w(l,A)},null,8,["actions"])]),_:1},8,["count-label"]),n(S,{uuid:e(a),uuids:e(u),"create-base":e(m),subclass:e(f),level:e(g),list:e(h),title:e(a)?e(t)("Edit Channel Tag"):e(t)("Add Channel Tag"),onClose:e(_),onCreated:e(C)},null,8,["uuid","uuids","create-base","subclass","level","list","title","onClose","onCreated"])],64))}}),le=F(U,[["__scopeId","data-v-916c3897"]]);export{le as default};
