import{a as O}from"./chunk-7JONB6ME.js";import{a as E}from"./chunk-E3IZHVKP.js";import{b as D,g as I,j as S,n as F,z as A}from"./chunk-MTR2L2TG.js";import{a as k}from"./chunk-5JDCLYZA.js";import{j as T}from"./chunk-YJYOGSOO.js";import{Bc as v,Hb as h,Ic as M,Jc as w,Sb as d,Tb as b,Ub as g,Xc as y,cb as l,hb as s,ib as p,ob as m,pa as c,qa as n,rb as f,tb as u,vc as x,wc as C}from"./chunk-FWZCAEAJ.js";var q=(()=>{let t=class t{set orderMode(e){this.formControl.setValue(e)}constructor(){this.formControl=new S(!1),this.orderModeChange=new m,this.formControl.valueChanges.pipe(k()).subscribe(e=>{this.orderModeChange.next(e===null?!1:e)})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275cmp=n({type:t,selectors:[["app-order-mode-switch"]],inputs:{orderMode:[c.HasDecoratorInputTransform,"orderMode","orderMode",y]},outputs:{orderModeChange:"orderModeChange"},standalone:!0,features:[u,v],decls:5,vars:4,consts:[[1,"form-check","form-switch","mb-0"],["type","checkbox","role","switch","id","orderMode",1,"form-check-input",3,"formControl"],["for","orderMode",1,"form-check-label","text-nowrap"]],template:function(r,i){r&1&&(d(0,"div",0),g(1,"input",1),d(2,"label",2),x(3),M(4,"tr"),b()()),r&2&&(s(),h("formControl",i.formControl),s(2),C(w(4,2,"ORDER_MODE_SWITCH")))},dependencies:[A,D,I,F,T],encapsulation:2,changeDetection:0});let o=t;return o})();var Y=(()=>{let t=class t extends O{constructor(e){super(e),this.entitiesService=e,this.orderMode=l(!1)}setOrderMode(e){this.orderMode.set(e),e?(this.selection.clear(),this.sort?.sort({id:"",start:"asc",disableClear:!1})):this.sort?.sort({id:"name",start:"desc",disableClear:!1})}drop(e){let r=this._dataSource.data.slice(),i=r.findIndex(a=>a.id===e.item.data.id);E(r,i,e.currentIndex),this._dataSource.data=r,this.entitiesService.order$(r.map((a,W)=>({entityId:a.id,order:W}))).subscribe()}};t.\u0275fac=function(r){return new(r||t)(p(null))},t.\u0275cmp=n({type:t,selectors:[["abstract-models-with-name-list-with-delete-and-order"]],features:[f],decls:0,vars:0,template:function(r,i){},encapsulation:2});let o=t;return o})();export{q as a,Y as b};
