/*! AutoFill 2.5.3 * ©2008-2023 SpryMedia Ltd - datatables.net/license */ import $ from"jquery";import DataTable from"datatables.net";var _instance=0,AutoFill=function(t,e){if(!DataTable.versionCheck||!DataTable.versionCheck("1.10.8"))throw"Warning: AutoFill requires DataTables 1.10.8 or greater";this.c=$.extend(!0,{},DataTable.defaults.autoFill,AutoFill.defaults,e),this.s={dt:new DataTable.Api(t),namespace:".autoFill"+_instance++,scroll:{},scrollInterval:null,handle:{height:0,width:0},enabled:!1},this.dom={closeButton:$('
x
'),handle:$('
'),select:{top:$('
'),right:$('
'),bottom:$('
'),left:$('
')},background:$('
'),list:$('
'+this.s.dt.i18n("autoFill.info","")+"
    "),dtScroll:null,offsetParent:null},this._constructor()},Api=($.extend(AutoFill.prototype,{enabled:function(){return this.s.enabled},enable:function(t){var e=this;if(!1===t)return this.disable();this.s.enabled=!0,this._focusListener(),this.dom.handle.on("mousedown touchstart",function(t){return e._mousedown(t),!1}),$(window).on("resize",function(){0<$("div.dt-autofill-handle").length&&void 0!==e.dom.attachedTo&&e._attach(e.dom.attachedTo)});function o(){e.s.handle={height:!1,width:!1},$(e.dom.handle).css({height:"",width:""}),void 0!==e.dom.attachedTo&&e._attach(e.dom.attachedTo)}return $(window).on("orientationchange",function(){setTimeout(function(){o(),setTimeout(o,150)},50)}),this},disable:function(){return this.s.enabled=!1,this._focusListenerRemove(),this},_constructor:function(){var t=this,e=this.s.dt,o=$("div.dataTables_scrollBody",this.s.dt.table().container());e.settings()[0].autoFill=this,o.length&&"static"===(this.dom.dtScroll=o).css("position")&&o.css("position","relative"),!1!==this.c.enable&&this.enable(),e.on("destroy.autoFill",function(){t._focusListenerRemove()})},_attach:function(t){var e=this.s.dt,o=e.cell(t).index(),i=this.dom.handle,l=this.s.handle;o&&-1!==e.columns(this.c.columns).indexes().indexOf(o.column)?(this.dom.offsetParent||(this.dom.offsetParent=$(e.table().node()).offsetParent()),l.height&&l.width||(i.appendTo("body"),l.height=i.outerHeight(),l.width=i.outerWidth()),o=this._getPosition(t,this.dom.offsetParent),this.dom.attachedTo=t,i.css({top:o.top+t.offsetHeight-l.height,left:o.left+t.offsetWidth-l.width}).appendTo(this.dom.offsetParent)):this._detach()},_actionSelector:function(o){var t,i,l=this,n=this.s.dt,s=AutoFill.actions,a=[];$.each(s,function(t,e){e.available(n,o)&&a.push(t)}),1===a.length&&!1===this.c.alwaysAsk?(t=s[a[0]].execute(n,o),this._update(t,o)):1").append('
    '+s[e].option(n,o)+"
    ").append($('
    ').append($('"))).on("click",function(){var t=s[e].execute(n,o,$(this).closest("li"));l._update(t,o),l.dom.background.remove(),l.dom.list.remove()}))}),this.dom.background.appendTo("body"),this.dom.background.one("click",function(){l.dom.background.remove(),l.dom.list.remove()}),this.dom.list.appendTo("body"),this.c.closeButton&&(this.dom.list.prepend(this.dom.closeButton).addClass(AutoFill.classes.closeable),this.dom.closeButton.on("click",function(){return l.dom.background.click()})),this.dom.list.css("margin-top",this.dom.list.outerHeight()/2*-1))},_detach:function(){this.dom.attachedTo=null,this.dom.handle.detach()},_drawSelection:function(t,e){var o,i=this.s.dt,l=this.s.start,n=$(this.dom.start),t={row:this.c.vertical?i.rows({page:"current"}).nodes().indexOf(t.parentNode):l.row,column:this.c.horizontal?$(t).index():l.column},s=i.column.index("toData",t.column),a=i.row(":eq("+t.row+")",{page:"current"}),a=$(i.cell(a.index(),s).node());i.cell(a).any()&&-1!==i.columns(this.c.columns).indexes().indexOf(s)&&-1!==t.row&&(this.s.end=t,i=l.rows.windowHeight-65&&(e=5),d<65?o=-5:d>s.windowWidth-65&&(o=5),null!==s.dtTop&&ts.dtTop+s.dtHeight-65&&(i=5),null!==s.dtLeft&&ds.dtLeft+s.dtWidth-65&&(l=5),e||o||i||l?(s.windowVert=e,s.windowHoriz=o,s.dtVert=i,s.dtHoriz=l,a=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval),this.s.scrollInterval=null),!this.s.scrollInterval&&a&&(this.s.scrollInterval=setInterval(function(){var t;window.scrollTo(window.scrollX+(s.windowHoriz||0),window.scrollY+(s.windowVert||0)),(s.dtVert||s.dtHoriz)&&(t=n.dom.dtScroll[0],s.dtVert&&(t.scrollTop+=s.dtVert),s.dtHoriz&&(t.scrollLeft+=s.dtHoriz))},20))},_update:function(t,e){if(!1!==t){var o,t=this.s.dt,i=t.columns(this.c.columns).indexes();if(this._emitEvent("preAutoFill",[t,e]),this._editor(e),null!==this.c.update?this.c.update:!this.c.editor){for(var l=0,n=e.length;l')},execute:function(t,e,o){for(var i=+e[0][0].data,l=+$("input",o).val(),n=0,s=e.length;n%d",e[0][0].label)},execute:function(t,e,o){for(var i=e[0][0].data,l=0,n=e.length;l