diff --git a/.laminas-ci/pre-run.sh b/.laminas-ci/pre-run.sh index c24f8f1d..2b5300aa 100755 --- a/.laminas-ci/pre-run.sh +++ b/.laminas-ci/pre-run.sh @@ -12,6 +12,4 @@ if [[ ${COMMAND} =~ phpunit ]];then cp config/autoload/mail.local.php.dist config/autoload/mail.local.php cp config/autoload/local.test.php.dist config/autoload/local.test.php - echo 'running if' - fi diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 35fe0e50..4c71f0da 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -11,4 +11,14 @@ iterable + + + init + + + + + init + + diff --git a/public/js/app.js b/public/js/app.js index de80ce89..42abca1b 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -79,4 +79,4 @@ const nb=new Map,ib={set(t,e,n){nb.has(t)||nb.set(t,new Map);const i=nb.get(t);i * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT */ -function Lw(t){return getComputedStyle(t)}function jw(t,e){for(var n in e){var i=e[n];"number"==typeof i&&(i+="px"),t.style[n]=i}return t}function Hw(t){var e=document.createElement("div");return e.className=t,e}var Bw="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Fw(t,e){if(!Bw)throw new Error("No element matching method supported");return Bw.call(t,e)}function Ww(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function zw(t,e){return Array.prototype.filter.call(t.children,(function(t){return Fw(t,e)}))}var Vw={main:"ps",rtl:"ps__rtl",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},$w={x:null,y:null};function Uw(t,e){var n=t.element.classList,i=Vw.state.scrolling(e);n.contains(i)?clearTimeout($w[e]):n.add(i)}function qw(t,e){$w[e]=setTimeout((function(){return t.isAlive&&t.element.classList.remove(Vw.state.scrolling(e))}),t.settings.scrollingThreshold)}var Yw=function(t){this.element=t,this.handlers={}},Gw={isEmpty:{configurable:!0}};Yw.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},Yw.prototype.unbind=function(t,e){var n=this;this.handlers[t]=this.handlers[t].filter((function(i){return!(!e||i===e)||(n.element.removeEventListener(t,i,!1),!1)}))},Yw.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},Gw.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every((function(e){return 0===t.handlers[e].length}))},Object.defineProperties(Yw.prototype,Gw);var Xw=function(){this.eventElements=[]};function Qw(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}function Zw(t,e,n,i,r){var s;if(void 0===i&&(i=!0),void 0===r&&(r=!1),"top"===e)s=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");s=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(t,e,n,i,r){var s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],h=n[5];void 0===i&&(i=!0);void 0===r&&(r=!1);var u=t.element;t.reach[l]=null,u[a]<1&&(t.reach[l]="start");u[a]>t[s]-t[o]-1&&(t.reach[l]="end");e&&(u.dispatchEvent(Qw("ps-scroll-"+l)),e<0?u.dispatchEvent(Qw("ps-scroll-"+c)):e>0&&u.dispatchEvent(Qw("ps-scroll-"+h)),i&&function(t,e){Uw(t,e),qw(t,e)}(t,l));t.reach[l]&&(e||r)&&u.dispatchEvent(Qw("ps-"+l+"-reach-"+t.reach[l]))}(t,n,s,i,r)}function Kw(t){return parseInt(t,10)||0}Xw.prototype.eventElement=function(t){var e=this.eventElements.filter((function(e){return e.element===t}))[0];return e||(e=new Yw(t),this.eventElements.push(e)),e},Xw.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},Xw.prototype.unbind=function(t,e,n){var i=this.eventElement(t);i.unbind(e,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)},Xw.prototype.unbindAll=function(){this.eventElements.forEach((function(t){return t.unbindAll()})),this.eventElements=[]},Xw.prototype.once=function(t,e,n){var i=this.eventElement(t),r=function(t){i.unbind(e,r),n(t)};i.bind(e,r)};var Jw={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function tS(t){var e=t.element,n=Math.floor(e.scrollTop),i=e.getBoundingClientRect();t.containerWidth=Math.round(i.width),t.containerHeight=Math.round(i.height),t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(zw(e,Vw.element.rail("x")).forEach((function(t){return Ww(t)})),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(zw(e,Vw.element.rail("y")).forEach((function(t){return Ww(t)})),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),function(t,e){var n={width:e.railXWidth},i=Math.floor(t.scrollTop);e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft;e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-i:n.top=e.scrollbarXTop+i;jw(e.scrollbarXRail,n);var r={top:i,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?r.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:r.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?r.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:r.left=e.scrollbarYLeft+t.scrollLeft;jw(e.scrollbarYRail,r),jw(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),jw(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}(e,t),t.scrollbarXActive?e.classList.add(Vw.state.active("x")):(e.classList.remove(Vw.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=!0===t.isRtl?t.contentWidth:0),t.scrollbarYActive?e.classList.add(Vw.state.active("y")):(e.classList.remove(Vw.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)}function eS(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function nS(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=t.element,d=null,f=null,p=null;function g(e){e.touches&&e.touches[0]&&(e[r]=e.touches[0].pageY),u[l]=d+p*(e[r]-f),Uw(t,c),tS(t),e.stopPropagation(),e.type.startsWith("touch")&&e.changedTouches.length>1&&e.preventDefault()}function m(){qw(t,c),t[h].classList.remove(Vw.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",g)}function v(e,o){d=u[l],o&&e.touches&&(e[r]=e.touches[0].pageY),f=e[r],p=(t[i]-t[n])/(t[s]-t[a]),o?t.event.bind(t.ownerDocument,"touchmove",g):(t.event.bind(t.ownerDocument,"mousemove",g),t.event.once(t.ownerDocument,"mouseup",m),e.preventDefault()),t[h].classList.add(Vw.state.clicking),e.stopPropagation()}t.event.bind(t[o],"mousedown",(function(t){v(t)})),t.event.bind(t[o],"touchstart",(function(t){v(t,!0)}))}var iS={"click-rail":function(t){t.element,t.event.bind(t.scrollbarY,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarYRail,"mousedown",(function(e){var n=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=n*t.containerHeight,tS(t),e.stopPropagation()})),t.event.bind(t.scrollbarX,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarXRail,"mousedown",(function(e){var n=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=n*t.containerWidth,tS(t),e.stopPropagation()}))},"drag-thumb":function(t){nS(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),nS(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",(function(n){if(!(n.isDefaultPrevented&&n.isDefaultPrevented()||n.defaultPrevented)&&(Fw(e,":hover")||Fw(t.scrollbarX,":focus")||Fw(t.scrollbarY,":focus"))){var i,r=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(r){if("IFRAME"===r.tagName)r=r.contentDocument.activeElement;else for(;r.shadowRoot;)r=r.shadowRoot.activeElement;if(Fw(i=r,"input,[contenteditable]")||Fw(i,"select,[contenteditable]")||Fw(i,"textarea,[contenteditable]")||Fw(i,"button,[contenteditable]"))return}var s=0,o=0;switch(n.which){case 37:s=n.metaKey?-t.contentWidth:n.altKey?-t.containerWidth:-30;break;case 38:o=n.metaKey?t.contentHeight:n.altKey?t.containerHeight:30;break;case 39:s=n.metaKey?t.contentWidth:n.altKey?t.containerWidth:30;break;case 40:o=n.metaKey?-t.contentHeight:n.altKey?-t.containerHeight:-30;break;case 32:o=n.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:o=t.containerHeight;break;case 34:o=-t.containerHeight;break;case 36:o=t.contentHeight;break;case 35:o=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==s||t.settings.suppressScrollY&&0!==o||(e.scrollTop-=o,e.scrollLeft+=s,tS(t),function(n,i){var r=Math.floor(e.scrollTop);if(0===n){if(!t.scrollbarYActive)return!1;if(0===r&&i>0||r>=t.contentHeight-t.containerHeight&&i<0)return!t.settings.wheelPropagation}var s=e.scrollLeft;if(0===i){if(!t.scrollbarXActive)return!1;if(0===s&&n<0||s>=t.contentWidth-t.containerWidth&&n>0)return!t.settings.wheelPropagation}return!0}(s,o)&&n.preventDefault())}}))},wheel:function(t){var e=t.element;function n(n){var i=function(t){var e=t.deltaX,n=-1*t.deltaY;return void 0!==e&&void 0!==n||(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!=e&&n!=n&&(e=0,n=t.wheelDelta),t.shiftKey?[-n,-e]:[e,n]}(n),r=i[0],s=i[1];if(!function(t,n,i){if(!Jw.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var r=t;r&&r!==e;){if(r.classList.contains(Vw.element.consuming))return!0;var s=Lw(r);if(i&&s.overflowY.match(/(scroll|auto)/)){var o=r.scrollHeight-r.clientHeight;if(o>0&&(r.scrollTop>0&&i<0||r.scrollTop0))return!0}if(n&&s.overflowX.match(/(scroll|auto)/)){var a=r.scrollWidth-r.clientWidth;if(a>0&&(r.scrollLeft>0&&n<0||r.scrollLeft0))return!0}r=r.parentNode}return!1}(n.target,r,s)){var o=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(s?e.scrollTop-=s*t.settings.wheelSpeed:e.scrollTop+=r*t.settings.wheelSpeed,o=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(r?e.scrollLeft+=r*t.settings.wheelSpeed:e.scrollLeft-=s*t.settings.wheelSpeed,o=!0):(e.scrollTop-=s*t.settings.wheelSpeed,e.scrollLeft+=r*t.settings.wheelSpeed),tS(t),o=o||function(n,i){var r=Math.floor(e.scrollTop),s=0===e.scrollTop,o=r+e.offsetHeight===e.scrollHeight,a=0===e.scrollLeft,l=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(i)>Math.abs(n)?s||o:a||l)||!t.settings.wheelPropagation}(r,s),o&&!n.ctrlKey&&(n.stopPropagation(),n.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",n):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",n)},touch:function(t){if(Jw.supportsTouch||Jw.supportsIePointer){var e=t.element,n={},i=0,r={},s=null;Jw.supportsTouch?(t.event.bind(e,"touchstart",c),t.event.bind(e,"touchmove",h),t.event.bind(e,"touchend",u)):Jw.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",c),t.event.bind(e,"pointermove",h),t.event.bind(e,"pointerup",u)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",c),t.event.bind(e,"MSPointerMove",h),t.event.bind(e,"MSPointerUp",u)))}function o(n,i){e.scrollTop-=i,e.scrollLeft-=n,tS(t)}function a(t){return t.targetTouches?t.targetTouches[0]:t}function l(t){return(!t.pointerType||"pen"!==t.pointerType||0!==t.buttons)&&(!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function c(t){if(l(t)){var e=a(t);n.pageX=e.pageX,n.pageY=e.pageY,i=(new Date).getTime(),null!==s&&clearInterval(s)}}function h(s){if(l(s)){var c=a(s),h={pageX:c.pageX,pageY:c.pageY},u=h.pageX-n.pageX,d=h.pageY-n.pageY;if(function(t,n,i){if(!e.contains(t))return!1;for(var r=t;r&&r!==e;){if(r.classList.contains(Vw.element.consuming))return!0;var s=Lw(r);if(i&&s.overflowY.match(/(scroll|auto)/)){var o=r.scrollHeight-r.clientHeight;if(o>0&&(r.scrollTop>0&&i<0||r.scrollTop0))return!0}if(n&&s.overflowX.match(/(scroll|auto)/)){var a=r.scrollWidth-r.clientWidth;if(a>0&&(r.scrollLeft>0&&n<0||r.scrollLeft0))return!0}r=r.parentNode}return!1}(s.target,u,d))return;o(u,d),n=h;var f=(new Date).getTime(),p=f-i;p>0&&(r.x=u/p,r.y=d/p,i=f),function(n,i){var r=Math.floor(e.scrollTop),s=e.scrollLeft,o=Math.abs(n),a=Math.abs(i);if(a>o){if(i<0&&r===t.contentHeight-t.containerHeight||i>0&&0===r)return 0===window.scrollY&&i>0&&Jw.isChrome}else if(o>a&&(n<0&&s===t.contentWidth-t.containerWidth||n>0&&0===s))return!0;return!0}(u,d)&&s.preventDefault()}}function u(){t.settings.swipeEasing&&(clearInterval(s),s=setInterval((function(){t.isInitialized?clearInterval(s):r.x||r.y?Math.abs(r.x)<.01&&Math.abs(r.y)<.01?clearInterval(s):t.element?(o(30*r.x,30*r.y),r.x*=.8,r.y*=.8):clearInterval(s):clearInterval(s)}),10))}}},rS=function(t,e){var n=this;if(void 0===e&&(e={}),"string"==typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var i in this.element=t,t.classList.add(Vw.main),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},e)this.settings[i]=e[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var r,s,o=function(){return t.classList.add(Vw.state.focus)},a=function(){return t.classList.remove(Vw.state.focus)};this.isRtl="rtl"===Lw(t).direction,!0===this.isRtl&&t.classList.add(Vw.rtl),this.isNegativeScroll=(s=t.scrollLeft,t.scrollLeft=-1,r=t.scrollLeft<0,t.scrollLeft=s,r),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new Xw,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=Hw(Vw.element.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=Hw(Vw.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",o),this.event.bind(this.scrollbarX,"blur",a),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var l=Lw(this.scrollbarXRail);this.scrollbarXBottom=parseInt(l.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Kw(l.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Kw(l.borderLeftWidth)+Kw(l.borderRightWidth),jw(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Kw(l.marginLeft)+Kw(l.marginRight),jw(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Hw(Vw.element.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=Hw(Vw.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",o),this.event.bind(this.scrollbarY,"blur",a),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var c=Lw(this.scrollbarYRail);this.scrollbarYRight=parseInt(c.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Kw(c.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(t){var e=Lw(t);return Kw(e.width)+Kw(e.paddingLeft)+Kw(e.paddingRight)+Kw(e.borderLeftWidth)+Kw(e.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=Kw(c.borderTopWidth)+Kw(c.borderBottomWidth),jw(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Kw(c.marginTop)+Kw(c.marginBottom),jw(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach((function(t){return iS[t](n)})),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",(function(t){return n.onScroll(t)})),tS(this)};rS.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,jw(this.scrollbarXRail,{display:"block"}),jw(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Kw(Lw(this.scrollbarXRail).marginLeft)+Kw(Lw(this.scrollbarXRail).marginRight),this.railYMarginHeight=Kw(Lw(this.scrollbarYRail).marginTop)+Kw(Lw(this.scrollbarYRail).marginBottom),jw(this.scrollbarXRail,{display:"none"}),jw(this.scrollbarYRail,{display:"none"}),tS(this),Zw(this,"top",0,!1,!0),Zw(this,"left",0,!1,!0),jw(this.scrollbarXRail,{display:""}),jw(this.scrollbarYRail,{display:""}))},rS.prototype.onScroll=function(t){this.isAlive&&(tS(this),Zw(this,"top",this.element.scrollTop-this.lastScrollTop),Zw(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},rS.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Ww(this.scrollbarX),Ww(this.scrollbarY),Ww(this.scrollbarXRail),Ww(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},rS.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter((function(t){return!t.match(/^ps([-_].+|)$/)})).join(" ")};const sS=rS;(function(){const t=Bl(".scrollable");t.length>0&&t.each(((t,e)=>{new sS(e)}))})(),Bl(".search-toggle").on("click",(t=>{Bl(".search-box, .search-input").toggleClass("active"),Bl(".search-input input").focus(),t.preventDefault()})),function(){Bl(".sidebar .sidebar-menu li a").on("click",(function(){const t=Bl(this);t.parent().hasClass("open")?t.parent().children(".dropdown-menu").slideUp(200,(()=>{t.parent().removeClass("open")})):(t.parent().parent().children("li.open").children(".dropdown-menu").slideUp(200),t.parent().parent().children("li.open").children("a").removeClass("open"),t.parent().parent().children("li.open").removeClass("open"),t.parent().children(".dropdown-menu").slideDown(200,(()=>{t.parent().addClass("open")})))}));Bl(".sidebar").find(".sidebar-link").each(((t,e)=>{Bl(e).removeClass("active")})).filter((function(){const t=Bl(this).attr("href");return("/"===t[0]?t.substr(1):t)===window.location.pathname.substr(1)})).addClass("active"),Bl(".sidebar-toggle").on("click",(t=>{Bl(".app").toggleClass("is-collapsed"),t.preventDefault()})),Bl("#sidebar-toggle").click((t=>{t.preventDefault(),setTimeout((()=>{window.dispatchEvent(window.EVENT)}),300)}))}();var oS=n(743);const aS=n.n(oS)()(window);(function(){const t=new aS({color:"#ff6849"}),e=["clear-day","clear-night","partly-cloudy-day","partly-cloudy-night","cloudy","rain","sleet","snow","wind","fog"];let n=e.length;for(;n--;){const i=e[n],r=document.getElementsByClassName(i);let s=r.length;for(;s--;)t.set(r[s],i)}t.play()})(),Bl("#chat-sidebar-toggle").on("click",(t=>{Bl("#chat-sidebar").toggleClass("open"),t.preventDefault()}));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.array.find.js"),require("core-js/modules/es.array.find-index.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.array.index-of.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.array.reverse.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.array.sort.js"),require("core-js/modules/es.array.splice.js"),require("core-js/modules/es.date.to-json.js"),require("core-js/modules/es.number.constructor.js"),require("core-js/modules/es.object.assign.js"),require("core-js/modules/es.object.entries.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.parse-float.js"),require("core-js/modules/es.parse-int.js"),require("core-js/modules/es.regexp.constructor.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.string.split.js"),require("core-js/modules/es.string.trim.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("jquery"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.string.ends-with.js"),require("core-js/modules/es.string.match.js"),require("core-js/modules/es.string.starts-with.js")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.array.filter.js","core-js/modules/es.array.find.js","core-js/modules/es.array.find-index.js","core-js/modules/es.array.includes.js","core-js/modules/es.array.index-of.js","core-js/modules/es.array.iterator.js","core-js/modules/es.array.join.js","core-js/modules/es.array.map.js","core-js/modules/es.array.reverse.js","core-js/modules/es.array.slice.js","core-js/modules/es.array.sort.js","core-js/modules/es.array.splice.js","core-js/modules/es.date.to-json.js","core-js/modules/es.number.constructor.js","core-js/modules/es.object.assign.js","core-js/modules/es.object.entries.js","core-js/modules/es.object.keys.js","core-js/modules/es.object.to-string.js","core-js/modules/es.parse-float.js","core-js/modules/es.parse-int.js","core-js/modules/es.regexp.constructor.js","core-js/modules/es.regexp.exec.js","core-js/modules/es.regexp.to-string.js","core-js/modules/es.string.includes.js","core-js/modules/es.string.replace.js","core-js/modules/es.string.search.js","core-js/modules/es.string.split.js","core-js/modules/es.string.trim.js","core-js/modules/web.dom-collections.for-each.js","core-js/modules/web.dom-collections.iterator.js","jquery","core-js/modules/es.object.get-prototype-of.js","core-js/modules/es.string.ends-with.js","core-js/modules/es.string.match.js","core-js/modules/es.string.starts-with.js"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).BootstrapTable=e(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,t.jQuery)}(void 0,(function(t,e,n,i,r,s,o,a,l,c,h,u,d,f,p,g,m,v,b,y,_,x,w,S,C,k,A,E,D,T,M,R){function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw s}}}}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t,e)||F(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||F(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function F(t,e){if(t){if("string"==typeof t)return O(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}var W={getBootstrapVersion:function(){var t=5;try{var e=R.fn.dropdown.Constructor.VERSION;void 0!==e&&(t=parseInt(e,10))}catch(t){}try{var n=bootstrap.Tooltip.VERSION;void 0!==n&&(t=parseInt(n,10))}catch(t){}return t},getIconsPrefix:function(t){return{bootstrap3:"glyphicon",bootstrap4:"fa",bootstrap5:"bi","bootstrap-table":"icon",bulma:"fa",foundation:"fa",materialize:"material-icons",semantic:"fa"}[t]||"fa"},getIcons:function(t){return{glyphicon:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggleOff:"glyphicon-list-alt icon-list-alt",toggleOn:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus",fullscreen:"glyphicon-fullscreen",search:"glyphicon-search",clearSearch:"glyphicon-trash"},fa:{paginationSwitchDown:"fa-caret-square-down",paginationSwitchUp:"fa-caret-square-up",refresh:"fa-sync",toggleOff:"fa-toggle-off",toggleOn:"fa-toggle-on",columns:"fa-th-list",detailOpen:"fa-plus",detailClose:"fa-minus",fullscreen:"fa-arrows-alt",search:"fa-search",clearSearch:"fa-trash"},bi:{paginationSwitchDown:"bi-caret-down-square",paginationSwitchUp:"bi-caret-up-square",refresh:"bi-arrow-clockwise",toggleOff:"bi-toggle-off",toggleOn:"bi-toggle-on",columns:"bi-list-ul",detailOpen:"bi-plus",detailClose:"bi-dash",fullscreen:"bi-arrows-move",search:"bi-search",clearSearch:"bi-trash"},icon:{paginationSwitchDown:"icon-arrow-up-circle",paginationSwitchUp:"icon-arrow-down-circle",refresh:"icon-refresh-cw",toggleOff:"icon-toggle-right",toggleOn:"icon-toggle-right",columns:"icon-list",detailOpen:"icon-plus",detailClose:"icon-minus",fullscreen:"icon-maximize",search:"icon-search",clearSearch:"icon-trash-2"},"material-icons":{paginationSwitchDown:"grid_on",paginationSwitchUp:"grid_off",refresh:"refresh",toggleOff:"tablet",toggleOn:"tablet_android",columns:"view_list",detailOpen:"add",detailClose:"remove",fullscreen:"fullscreen",sort:"sort",search:"search",clearSearch:"delete"}}[t]||{}},getSearchInput:function(t){return"string"==typeof t.options.searchSelector?R(t.options.searchSelector):t.$toolbar.find(".search input")},extend:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;i1?e-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.entries(t).length&&t.constructor===Object},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},getFieldTitle:function(t,e){var n,i=N(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.field===e)return r.title}}catch(t){i.e(t)}finally{i.f()}return""},setFieldIndex:function(t){var e,n=0,i=[],r=N(t[0]);try{for(r.s();!(e=r.n()).done;)n+=e.value.colspan||1}catch(t){r.e(t)}finally{r.f()}for(var s=0;s1){for(var c=0,h=function(t){var e=r.filter((function(e){return e.fieldIndex===t})),n=e[e.length-1];if(e.length>1)for(var i=0;i0}}}catch(t){a.e(t)}finally{a.f()}}}catch(t){s.e(t)}finally{s.f()}if(!(t.length<2)){var d,f=N(e);try{var p=function(){var t=d.value,e=r.filter((function(e){return e.fieldIndex===t.fieldIndex}));if(e.length>1){var n,i=N(e);try{for(i.s();!(n=i.n()).done;)n.value.visible=t.visible}catch(t){i.e(t)}finally{i.f()}}};for(f.s();!(d=f.n()).done;)p()}catch(t){f.e(t)}finally{f.f()}}},getScrollBarWidth:function(){if(void 0===this.cachedWidth){var t=R("
").addClass("fixed-table-scroll-inner"),e=R("
").addClass("fixed-table-scroll-outer");e.append(t),R("body").append(e);var n=t[0].offsetWidth;e.css("overflow","scroll");var i=t[0].offsetWidth;n===i&&(i=e[0].clientWidth),e.remove(),this.cachedWidth=n-i}return this.cachedWidth},calculateObjectValue:function(t,e,n,i){var r=e;if("string"==typeof e){var s=e.split(".");if(s.length>1){r=window;var o,a=N(s);try{for(a.s();!(o=a.n()).done;)r=r[o.value]}catch(t){a.e(t)}finally{a.f()}}else r=window[e]}return null!==r&&"object"===B(r)?r:"function"==typeof r?r.apply(t,n||[]):!r&&"string"==typeof e&&n&&this.sprintf.apply(this,[e].concat(j(n)))?this.sprintf.apply(this,[e].concat(j(n))):i},compareObjects:function(t,e,n){var i=Object.keys(t),r=Object.keys(e);if(n&&i.length!==r.length)return!1;for(var s=0,o=i;s/g,">").replace(/"/g,""").replace(/'/g,"'"):t},unescapeHTML:function(t){return"string"==typeof t&&t?t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'"):t},removeHTML:function(t){return t?t.toString().replace(/(<([^>]+)>)/gi,"").replace(/&[#A-Za-z0-9]+;/gi,"").trim():t},getRealDataAttr:function(t){for(var e=0,n=Object.entries(t);e3&&void 0!==arguments[3]?arguments[3]:void 0,r=t;if(void 0!==i&&(n=i),"string"!=typeof e||t.hasOwnProperty(e))return n?this.escapeHTML(t[e]):t[e];var s,o=N(e.split("."));try{for(o.s();!(s=o.n()).done;){var a=s.value;r=r&&r[a]}}catch(t){o.e(t)}finally{o.f()}return n?this.escapeHTML(r):r},isIEBrowser:function(){return navigator.userAgent.includes("MSIE ")||/Trident.*rv:11\./.test(navigator.userAgent)},findIndex:function(t,e){var n,i=N(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(JSON.stringify(r)===JSON.stringify(e))return t.indexOf(r)}}catch(t){i.e(t)}finally{i.f()}return-1},trToData:function(t,e){var n=this,i=[],r=[];return e.each((function(e,s){var o=R(s),a={};a._id=o.attr("id"),a._class=o.attr("class"),a._data=n.getRealDataAttr(o.data()),a._style=o.attr("style"),o.find(">td,>th").each((function(i,s){for(var o=R(s),l=+o.attr("colspan")||1,c=+o.attr("rowspan")||1,h=i;r[e]&&r[e][h];h++);for(var u=h;ue?n:0;if(i.sortEmptyLast){if(""===t)return 1;if(""===e)return-1}return t===e?0:("string"!=typeof t&&(t=t.toString()),-1===t.localeCompare(e)?-1*n:n)},getEventName:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=e||"".concat(+new Date).concat(~~(1e6*Math.random())),"".concat(t,"-").concat(e)},hasDetailViewIcon:function(t){return t.detailView&&t.detailViewIcon&&!t.cardView},getDetailViewIndexOffset:function(t){return this.hasDetailViewIcon(t)&&"right"!==t.detailViewAlign?1:0},checkAutoMergeCells:function(t){var e,n=N(t);try{for(n.s();!(e=n.n()).done;)for(var i=e.value,r=0,s=Object.keys(i);r',""],toolbarDropdownItem:'',toolbarDropdownSeparator:'
  • ',pageDropdown:['"],pageDropdownItem:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}},4:{classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",select:"form-control",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s
    %s
    ',searchInput:'',searchButton:'',searchClearButton:''}},5:{classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",select:"form-select",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{dataToggle:"data-bs-toggle",toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}}}[z],$={height:void 0,classes:"table table-bordered table-hover",buttons:{},theadClasses:"",headerStyle:function(t){return{}},rowStyle:function(t,e){return{}},rowAttributes:function(t,e){return{}},undefinedText:"-",locale:void 0,virtualScroll:!1,virtualScrollItemHeight:void 0,sortable:!0,sortClass:void 0,silentSort:!0,sortEmptyLast:!1,sortName:void 0,sortOrder:void 0,sortReset:!1,sortStable:!1,sortResetPage:!1,rememberOrder:!1,serverSort:!0,customSort:void 0,columns:[[]],data:[],url:void 0,method:"get",cache:!0,contentType:"application/json",dataType:"json",ajax:void 0,ajaxOptions:{},queryParams:function(t){return t},queryParamsType:"limit",responseHandler:function(t){return t},totalField:"total",totalNotFilteredField:"totalNotFiltered",dataField:"rows",footerField:"footer",pagination:!1,paginationParts:["pageInfo","pageSize","pageList"],showExtendedPagination:!1,paginationLoop:!0,sidePagination:"client",totalRows:0,totalNotFiltered:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"‹",paginationNextText:"›",paginationSuccessivelySize:5,paginationPagesBySide:1,paginationUseIntermediate:!1,paginationLoadMore:!1,search:!1,searchable:!1,searchHighlight:!1,searchOnEnterKey:!1,strictSearch:!1,regexSearch:!1,searchSelector:!1,visibleSearch:!1,showButtonIcons:!0,showButtonText:!1,showSearchButton:!1,showSearchClearButton:!1,trimOnSearch:!0,searchAlign:"right",searchTimeOut:500,searchText:"",customSearch:void 0,showHeader:!0,showFooter:!1,footerStyle:function(t){return{}},searchAccentNeutralise:!1,showColumns:!1,showColumnsToggleAll:!1,showColumnsSearch:!1,minimumCountColumns:1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,showFullscreen:!1,smartDisplay:!0,escape:!1,escapeTitle:!0,filterOptions:{filterAlgorithm:"and"},idField:void 0,selectItemName:"btSelectItem",clickToSelect:!1,ignoreClickToSelectOn:function(t){var e=t.tagName;return["A","BUTTON"].includes(e)},singleSelect:!1,checkboxHeader:!0,maintainMetaData:!1,multipleSelectRow:!1,uniqueId:void 0,cardView:!1,detailView:!1,detailViewIcon:!0,detailViewByClick:!1,detailViewAlign:"left",detailFormatter:function(t,e){return""},detailFilter:function(t,e){return!0},toolbar:void 0,toolbarAlign:"left",buttonsToolbar:void 0,buttonsAlign:"right",buttonsOrder:["paginationSwitch","refresh","toggle","fullscreen","columns"],buttonsPrefix:V.classes.buttonsPrefix,buttonsClass:V.classes.buttons,iconsPrefix:void 0,icons:{},iconSize:void 0,fixedScroll:!1,loadingFontSize:"auto",loadingTemplate:function(t){return'\n '.concat(t,'\n \n \n ')},onAll:function(t,e){return!1},onClickCell:function(t,e,n,i){return!1},onDblClickCell:function(t,e,n,i){return!1},onClickRow:function(t,e){return!1},onDblClickRow:function(t,e){return!1},onSort:function(t,e){return!1},onCheck:function(t){return!1},onUncheck:function(t){return!1},onCheckAll:function(t){return!1},onUncheckAll:function(t){return!1},onCheckSome:function(t){return!1},onUncheckSome:function(t){return!1},onLoadSuccess:function(t){return!1},onLoadError:function(t){return!1},onColumnSwitch:function(t,e){return!1},onColumnSwitchAll:function(t){return!1},onPageChange:function(t,e){return!1},onSearch:function(t){return!1},onToggle:function(t){return!1},onPreBody:function(t){return!1},onPostBody:function(){return!1},onPostHeader:function(){return!1},onPostFooter:function(){return!1},onExpandRow:function(t,e,n){return!1},onCollapseRow:function(t,e){return!1},onRefreshOptions:function(t){return!1},onRefresh:function(t){return!1},onResetView:function(){return!1},onScrollBody:function(){return!1},onTogglePagination:function(t){return!1},onVirtualScroll:function(t,e){return!1}},U={formatLoadingMessage:function(){return"Loading, please wait"},formatRecordsPerPage:function(t){return"".concat(t," rows per page")},formatShowingRows:function(t,e,n,i){return void 0!==i&&i>0&&i>n?"Showing ".concat(t," to ").concat(e," of ").concat(n," rows (filtered from ").concat(i," total rows)"):"Showing ".concat(t," to ").concat(e," of ").concat(n," rows")},formatSRPaginationPreText:function(){return"previous page"},formatSRPaginationPageText:function(t){return"to page ".concat(t)},formatSRPaginationNextText:function(){return"next page"},formatDetailPagination:function(t){return"Showing ".concat(t," rows")},formatSearch:function(){return"Search"},formatClearSearch:function(){return"Clear Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatPaginationSwitchDown:function(){return"Show pagination"},formatPaginationSwitchUp:function(){return"Hide pagination"},formatRefresh:function(){return"Refresh"},formatToggleOn:function(){return"Show card view"},formatToggleOff:function(){return"Hide card view"},formatColumns:function(){return"Columns"},formatColumnsToggleAll:function(){return"Toggle all"},formatFullscreen:function(){return"Fullscreen"},formatAllRows:function(){return"All"}};Object.assign($,U);var q={VERSION:"1.23.0",THEME:"bootstrap".concat(z),CONSTANTS:V,DEFAULTS:$,COLUMN_DEFAULTS:{field:void 0,title:void 0,titleTooltip:void 0,class:void 0,width:void 0,widthUnit:"px",rowspan:void 0,colspan:void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,cellStyle:void 0,radio:!1,checkbox:!1,checkboxEnabled:!0,clickToSelect:!0,showSelectTitle:!1,sortable:!1,sortName:void 0,order:"asc",sorter:void 0,visible:!0,switchable:!0,switchableLabel:void 0,cardVisible:!0,searchable:!0,formatter:void 0,footerFormatter:void 0,footerStyle:void 0,detailFormatter:void 0,searchFormatter:!0,searchHighlightFormatter:!1,escape:void 0,events:void 0},METHODS:["getOptions","refreshOptions","getData","getSelections","load","append","prepend","remove","removeAll","insertRow","updateRow","getRowByUniqueId","updateByUniqueId","removeByUniqueId","updateCell","updateCellByUniqueId","showRow","hideRow","getHiddenRows","showColumn","hideColumn","getVisibleColumns","getHiddenColumns","showAllColumns","hideAllColumns","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","destroy","resetView","showLoading","hideLoading","togglePagination","toggleFullscreen","toggleView","resetSearch","filterBy","sortBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","toggleDetailView","expandRow","collapseRow","expandRowByUniqueId","collapseRowByUniqueId","expandAllRows","collapseAllRows","updateColumnTitle","updateFormatText"],EVENTS:{"all.bs.table":"onAll","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","column-switch-all.bs.table":"onColumnSwitchAll","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","post-footer.bs.table":"onPostFooter","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh","scroll-body.bs.table":"onScrollBody","toggle-pagination.bs.table":"onTogglePagination","virtual-scroll.bs.table":"onVirtualScroll"},LOCALES:{en:U,"en-US":U}},Y=P((function t(e){var n=this;I(this,t),this.rows=e.rows,this.scrollEl=e.scrollEl,this.contentEl=e.contentEl,this.callback=e.callback,this.itemHeight=e.itemHeight,this.cache={},this.scrollTop=this.scrollEl.scrollTop,this.initDOM(this.rows,e.fixedScroll),this.scrollEl.scrollTop=this.scrollTop,this.lastCluster=0;var i=function(){n.lastCluster!==(n.lastCluster=n.getNum())&&(n.initDOM(n.rows),n.callback(n.startIndex,n.endIndex))};this.scrollEl.addEventListener("scroll",i,!1),this.destroy=function(){n.contentEl.innerHtml="",n.scrollEl.removeEventListener("scroll",i,!1)}}),[{key:"initDOM",value:function(t,e){void 0===this.clusterHeight?(this.cache.scrollTop=this.scrollEl.scrollTop,this.cache.data=this.contentEl.innerHTML=t[0]+t[0]+t[0],this.getRowsHeight(t)):0===this.blockHeight&&this.getRowsHeight(t);var n=this.initData(t,this.getNum(e)),i=n.rows.join(""),r=this.checkChanges("data",i),s=this.checkChanges("top",n.topOffset),o=this.checkChanges("bottom",n.bottomOffset),a=[];r&&s?(n.topOffset&&a.push(this.getExtra("top",n.topOffset)),a.push(i),n.bottomOffset&&a.push(this.getExtra("bottom",n.bottomOffset)),this.startIndex=n.start,this.endIndex=n.end,this.contentEl.innerHTML=a.join(""),e&&(this.contentEl.scrollTop=this.cache.scrollTop)):o&&(this.contentEl.lastChild.style.height="".concat(n.bottomOffset,"px"))}},{key:"getRowsHeight",value:function(){if(void 0===this.itemHeight||0===this.itemHeight){var t=this.contentEl.children,e=t[Math.floor(t.length/2)];this.itemHeight=e.offsetHeight}this.blockHeight=50*this.itemHeight,this.clusterRows=200,this.clusterHeight=4*this.blockHeight}},{key:"getNum",value:function(t){return this.scrollTop=t?this.cache.scrollTop:this.scrollEl.scrollTop,Math.floor(this.scrollTop/(this.clusterHeight-this.blockHeight))||0}},{key:"initData",value:function(t,e){if(t.length<50)return{topOffset:0,bottomOffset:0,rowsAbove:0,rows:t};var n=Math.max((this.clusterRows-50)*e,0),i=n+this.clusterRows,r=Math.max(n*this.itemHeight,0),s=Math.max((t.length-i)*this.itemHeight,0),o=[],a=n;r<1&&a++;for(var l=n;l
    ':"",e=["bottom","both"].includes(this.options.paginationVAlign)?'
    ':"",n=W.calculateObjectValue(this.options,this.options.loadingTemplate,[this.options.formatLoadingMessage()]);this.$container=R('\n
    \n
    \n ').concat(t,'\n
    \n
    \n
    \n
    \n ').concat(n,'\n
    \n
    \n \n
    \n ').concat(e,"\n
    \n ")),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find(".fixed-table-container"),this.$tableHeader=this.$container.find(".fixed-table-header"),this.$tableBody=this.$container.find(".fixed-table-body"),this.$tableLoading=this.$container.find(".fixed-table-loading"),this.$tableFooter=this.$el.find("tfoot"),this.options.buttonsToolbar?this.$toolbar=R("body").find(this.options.buttonsToolbar):this.$toolbar=this.$container.find(".fixed-table-toolbar"),this.$pagination=this.$container.find(".fixed-table-pagination"),this.$tableBody.append(this.$el),this.$container.after('
    '),this.$el.addClass(this.options.classes),this.$tableLoading.addClass(this.options.classes),this.options.height&&(this.$tableContainer.addClass("fixed-height"),this.options.showFooter&&this.$tableContainer.addClass("has-footer"),this.options.classes.split(" ").includes("table-bordered")&&(this.$tableBody.append('
    '),this.$tableBorder=this.$tableBody.find(".fixed-table-border"),this.$tableLoading.addClass("fixed-table-border")),this.$tableFooter=this.$container.find(".fixed-table-footer"))}},{key:"initTable",value:function(){var e=this,n=[];if(this.$header=this.$el.find(">thead"),this.$header.length?this.options.theadClasses&&this.$header.addClass(this.options.theadClasses):this.$header=R('')).appendTo(this.$el),this._headerTrClasses=[],this._headerTrStyles=[],this.$header.find("tr").each((function(t,i){var r=R(i),s=[];r.find("th").each((function(t,e){var n=R(e);void 0!==n.data("field")&&n.data("field","".concat(n.data("field")));var i=Object.assign({},n.data());for(var r in i)R.fn.bootstrapTable.columnDefaults.hasOwnProperty(r)&&delete i[r];s.push(W.extend({},{_data:W.getRealDataAttr(i),title:n.html(),class:n.attr("class"),titleTooltip:n.attr("title"),rowspan:n.attr("rowspan")?+n.attr("rowspan"):void 0,colspan:n.attr("colspan")?+n.attr("colspan"):void 0},n.data()))})),n.push(s),r.attr("class")&&e._headerTrClasses.push(r.attr("class")),r.attr("style")&&e._headerTrStyles.push(r.attr("style"))})),Array.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=W.extend(!0,[],n,this.options.columns),this.columns=[],this.fieldsColumnsIndex=[],W.setFieldIndex(this.options.columns),this.options.columns.forEach((function(n,i){n.forEach((function(n,r){var s=W.extend({},t.COLUMN_DEFAULTS,n,{passed:n});void 0!==s.fieldIndex&&(e.columns[s.fieldIndex]=s,e.fieldsColumnsIndex[s.field]=s.fieldIndex),e.options.columns[i][r]=s}))})),!this.options.data.length){var i=W.trToData(this.columns,this.$el.find(">tbody>tr"));i.length&&(this.options.data=i,this.fromHtml=!0)}this.options.pagination&&"server"!==this.options.sidePagination||(this.footerData=W.trToData(this.columns,this.$el.find(">tfoot>tr"))),this.footerData&&this.$el.find("tfoot").html(""),!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()}},{key:"initHeader",value:function(){var t=this,e={},n=[];this.header={fields:[],styles:[],classes:[],formatters:[],detailFormatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]},W.updateFieldGroup(this.options.columns,this.columns),this.options.columns.forEach((function(i,r){var s=[];s.push(""));var o="";if(0===r&&W.hasDetailViewIcon(t.options)){var a=t.options.columns.length>1?' rowspan="'.concat(t.options.columns.length,'"'):"";o='\n
    \n ')}o&&"right"!==t.options.detailViewAlign&&s.push(o),i.forEach((function(n,i){var o=W.sprintf(' class="%s"',n.class),a=n.widthUnit,l=parseFloat(n.width),c=n.halign?n.halign:n.align,h=W.sprintf("text-align: %s; ",c),u=W.sprintf("text-align: %s; ",n.align),d=W.sprintf("vertical-align: %s; ",n.valign);if(d+=W.sprintf("width: %s; ",!n.checkbox&&!n.radio||l?l?l+a:void 0:n.showSelectTitle?void 0:"36px"),void 0!==n.fieldIndex||n.visible){var f=W.calculateObjectValue(null,t.options.headerStyle,[n]),p=[],g=[],m="";if(f&&f.css)for(var v=0,b=Object.entries(f.css);v0)for(var w=0,S=Object.entries(n._data);w0?" data-not-first-th":"",g.length>0?g.join(" "):"",">"),s.push(W.sprintf('
    ',t.options.sortable&&n.sortable?"sortable".concat("center"===c?" sortable-center":""," both"):""));var E=t.options.escape&&t.options.escapeTitle?W.escapeHTML(n.title):n.title,D=E;n.checkbox&&(E="",!t.options.singleSelect&&t.options.checkboxHeader&&(E=''),t.header.stateField=n.field),n.radio&&(E="",t.header.stateField=n.field),!E&&n.showSelectTitle&&(E+=D),s.push(E),s.push("
    "),s.push('
    '),s.push("
    "),s.push("")}})),o&&"right"===t.options.detailViewAlign&&s.push(o),s.push(""),s.length>3&&n.push(s.join(""))})),this.$header.html(n.join("")),this.$header.find("th[data-field]").each((function(t,n){R(n).data(e[R(n).data("field")])})),this.$container.off("click",".th-inner").on("click",".th-inner",(function(e){var n=R(e.currentTarget);if(t.options.detailView&&!n.parent().hasClass("bs-checkbox")&&n.closest(".bootstrap-table")[0]!==t.$container[0])return!1;t.options.sortable&&n.parent().data().sortable&&t.onSort(e)}));var i=W.getEventName("resize.bootstrap-table",this.$el.attr("id"));R(window).off(i),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css("top",this.$header.outerHeight()+1),this.getCaret(),R(window).on(i,(function(){return t.resetView()}))),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off("click").on("click",(function(e){e.stopPropagation();var n=R(e.currentTarget).prop("checked");t[n?"checkAll":"uncheckAll"](),t.updateSelected()}))}},{key:"initData",value:function(t,e){"append"===e?this.options.data=this.options.data.concat(t):"prepend"===e?this.options.data=[].concat(t).concat(this.options.data):(t=t||W.deepCopy(this.options.data),this.options.data=Array.isArray(t)?t:t[this.options.dataField]),this.data=j(this.options.data),this.options.sortReset&&(this.unsortedData=j(this.data)),"server"!==this.options.sidePagination&&this.initSort()}},{key:"initSort",value:function(){var t=this,e=this.options.sortName,n="desc"===this.options.sortOrder?-1:1,i=this.header.fields.indexOf(this.options.sortName),r=0;-1!==i?(this.options.sortStable&&this.data.forEach((function(t,e){t.hasOwnProperty("_position")||(t._position=e)})),this.options.customSort?W.calculateObjectValue(this.options,this.options.customSort,[this.options.sortName,this.options.sortOrder,this.data]):this.data.sort((function(r,s){t.header.sortNames[i]&&(e=t.header.sortNames[i]);var o=W.getItemField(r,e,t.options.escape),a=W.getItemField(s,e,t.options.escape),l=W.calculateObjectValue(t.header,t.header.sorters[i],[o,a,r,s]);return void 0!==l?t.options.sortStable&&0===l?n*(r._position-s._position):n*l:W.sort(o,a,n,t.options,r._position,s._position)})),void 0!==this.options.sortClass&&(clearTimeout(r),r=setTimeout((function(){t.$el.removeClass(t.options.sortClass);var e=t.$header.find('[data-field="'.concat(t.options.sortName,'"]')).index();t.$el.find("tr td:nth-child(".concat(e+1,")")).addClass(t.options.sortClass)}),250))):this.options.sortReset&&(this.data=j(this.unsortedData))}},{key:"sortBy",value:function(t){this.options.sortName=t.field,this.options.sortOrder=t.hasOwnProperty("sortOrder")?t.sortOrder:"asc",this._sort()}},{key:"onSort",value:function(t){var e=t.type,n=t.currentTarget,i="keypress"===e?R(n):R(n).parent(),r=this.$header.find("th").eq(i.index());if(this.$header.add(this.$header_).find("span.order").remove(),this.options.sortName===i.data("field")){var s=this.options.sortOrder,o=this.columns[this.fieldsColumnsIndex[i.data("field")]].sortOrder||this.columns[this.fieldsColumnsIndex[i.data("field")]].order;void 0===s?this.options.sortOrder="asc":"asc"===s?this.options.sortOrder=this.options.sortReset?"asc"===o?"desc":void 0:"desc":"desc"===this.options.sortOrder&&(this.options.sortOrder=this.options.sortReset?"desc"===o?"asc":void 0:"asc"),void 0===this.options.sortOrder&&(this.options.sortName=void 0)}else this.options.sortName=i.data("field"),this.options.rememberOrder?this.options.sortOrder="asc"===i.data("order")?"desc":"asc":this.options.sortOrder=this.columns[this.fieldsColumnsIndex[i.data("field")]].sortOrder||this.columns[this.fieldsColumnsIndex[i.data("field")]].order;i.add(r).data("order",this.options.sortOrder),this.getCaret(),this._sort()}},{key:"_sort",value:function(){if("server"===this.options.sidePagination&&this.options.serverSort)return this.options.pageNumber=1,this.trigger("sort",this.options.sortName,this.options.sortOrder),void this.initServer(this.options.silentSort);this.options.pagination&&this.options.sortResetPage&&(this.options.pageNumber=1,this.initPagination()),this.trigger("sort",this.options.sortName,this.options.sortOrder),this.initSort(),this.initBody()}},{key:"initToolbar",value:function(){var t,e=this,n=this.options,i=[],r=0,s=0;this.$toolbar.find(".bs-bars").children().length&&R("body").append(R(n.toolbar)),this.$toolbar.html(""),"string"!=typeof n.toolbar&&"object"!==B(n.toolbar)||R(W.sprintf('
    ',this.constants.classes.pull,n.toolbarAlign)).appendTo(this.$toolbar).append(R(n.toolbar)),i=['
    ')],"string"==typeof n.buttonsOrder&&(n.buttonsOrder=n.buttonsOrder.replace(/\[|\]| |'/g,"").split(",")),this.buttons=Object.assign(this.buttons,{paginationSwitch:{text:n.pagination?n.formatPaginationSwitchUp():n.formatPaginationSwitchDown(),icon:n.pagination?n.icons.paginationSwitchDown:n.icons.paginationSwitchUp,render:!1,event:this.togglePagination,attributes:{"aria-label":n.formatPaginationSwitch(),title:n.formatPaginationSwitch()}},refresh:{text:n.formatRefresh(),icon:n.icons.refresh,render:!1,event:this.refresh,attributes:{"aria-label":n.formatRefresh(),title:n.formatRefresh()}},toggle:{text:n.formatToggleOn(),icon:n.icons.toggleOff,render:!1,event:this.toggleView,attributes:{"aria-label":n.formatToggleOn(),title:n.formatToggleOn()}},fullscreen:{text:n.formatFullscreen(),icon:n.icons.fullscreen,render:!1,event:this.toggleFullscreen,attributes:{"aria-label":n.formatFullscreen(),title:n.formatFullscreen()}},columns:{render:!1,html:function(){var t=[];if(t.push('
    \n \n ").concat(e.constants.html.toolbarDropdown[0])),n.showColumnsSearch&&(t.push(W.sprintf(e.constants.html.toolbarDropdownItem,W.sprintf('',e.constants.classes.input,n.formatSearch()))),t.push(e.constants.html.toolbarDropdownSeparator)),n.showColumnsToggleAll){var i=e.getVisibleColumns().length===e.columns.filter((function(t){return!e.isSelectionColumn(t)})).length;t.push(W.sprintf(e.constants.html.toolbarDropdownItem,W.sprintf(' %s',i?'checked="checked"':"",n.formatColumnsToggleAll()))),t.push(e.constants.html.toolbarDropdownSeparator)}var r=0;return e.columns.forEach((function(t){t.visible&&r++})),e.columns.forEach((function(i,o){if(!e.isSelectionColumn(i)&&(!n.cardView||i.cardVisible)){var a=i.visible?' checked="checked"':"",l=r<=n.minimumCountColumns&&a?' disabled="disabled"':"";i.switchable&&(t.push(W.sprintf(e.constants.html.toolbarDropdownItem,W.sprintf(' %s',i.field,o,a,l,i.switchableLabel||i.title))),s++)}})),t.push(e.constants.html.toolbarDropdown[1],"
    "),t.join("")}}});for(var o={},a=0,l=Object.entries(this.buttons);a"}o[h]=d;var y="show".concat(h.charAt(0).toUpperCase()).concat(h.substring(1)),_=n[y];!(!u.hasOwnProperty("render")||u.hasOwnProperty("render")&&u.render)||void 0!==_&&!0!==_||(n[y]=!0),n.buttonsOrder.includes(h)||n.buttonsOrder.push(h)}var x,w=N(n.buttonsOrder);try{for(w.s();!(x=w.n()).done;){var S=x.value;n["show".concat(S.charAt(0).toUpperCase()).concat(S.substring(1))]&&i.push(o[S])}}catch(t){w.e(t)}finally{w.f()}i.push("
    "),(this.showToolbar||i.length>2)&&this.$toolbar.append(i.join(""));for(var C=function(){var t=L(A[k],2),n=t[0],i=t[1];if(i.hasOwnProperty("event")){if("function"==typeof i.event||"string"==typeof i.event){var r="string"==typeof i.event?window[i.event]:i.event;return e.$toolbar.find('button[name="'.concat(n,'"]')).off("click").on("click",(function(){return r.call(e)})),1}for(var s=function(){var t=L(a[o],2),i=t[0],r=t[1],s="string"==typeof r?window[r]:r;e.$toolbar.find('button[name="'.concat(n,'"]')).off(i).on(i,(function(){return s.call(e)}))},o=0,a=Object.entries(i.event);o'),H=j;if(n.showSearchButton||n.showSearchClearButton){var F=(n.showSearchButton?I:"")+(n.showSearchClearButton?P:"");H=n.search?W.sprintf(this.constants.html.inputGroup,j,F):F}i.push(W.sprintf('\n
    \n %s\n
    \n '),H)),this.$toolbar.append(i.join(""));var z=W.getSearchInput(this);n.showSearchButton?(this.$toolbar.find(".search button[name=search]").off("click").on("click",(function(){clearTimeout(r),r=setTimeout((function(){e.onSearch({currentTarget:z})}),n.searchTimeOut)})),n.searchOnEnterKey&&O(z)):O(z),n.showSearchClearButton&&this.$toolbar.find(".search button[name=clearSearch]").click((function(){e.resetSearch()}))}else"string"==typeof n.searchSelector&&O(W.getSearchInput(this))}},{key:"onSearch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.currentTarget,n=t.firedByInitSearchText,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0!==e&&R(e).length&&i){var r=R(e).val().trim();if(this.options.trimOnSearch&&R(e).val()!==r&&R(e).val(r),this.searchText===r)return;var s=W.getSearchInput(this),o=e instanceof jQuery?e:R(e);(o.is(s)||o.hasClass("search-input"))&&(this.searchText=r,this.options.searchText=r)}n||(this.options.pageNumber=1),this.initSearch(),n?"client"===this.options.sidePagination&&this.updatePagination():this.updatePagination(),this.trigger("search",this.searchText)}},{key:"initSearch",value:function(){var t=this;if(this.filterOptions=this.filterOptions||this.options.filterOptions,"server"!==this.options.sidePagination){if(this.options.customSearch)return this.data=W.calculateObjectValue(this.options,this.options.customSearch,[this.options.data,this.searchText,this.filterColumns]),this.options.sortReset&&(this.unsortedData=j(this.data)),void this.initSort();var e=this.searchText&&(this.fromHtml?W.escapeHTML(this.searchText):this.searchText),n=e?e.toLowerCase():"",i=W.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.options.searchAccentNeutralise&&(n=W.normalizeAccent(n)),"function"==typeof this.filterOptions.filterAlgorithm?this.data=this.options.data.filter((function(e){return t.filterOptions.filterAlgorithm.apply(null,[e,i])})):"string"==typeof this.filterOptions.filterAlgorithm&&(this.data=i?this.options.data.filter((function(e){var n=t.filterOptions.filterAlgorithm;if("and"===n){for(var r in i)if(Array.isArray(i[r])&&!i[r].includes(e[r])||!Array.isArray(i[r])&&e[r]!==i[r])return!1}else if("or"===n){var s=!1;for(var o in i)(Array.isArray(i[o])&&i[o].includes(e[o])||!Array.isArray(i[o])&&e[o]===i[o])&&(s=!0);return s}return!0})):j(this.options.data));var r=this.getVisibleFields();this.data=n?this.data.filter((function(i,s){for(var o=0;o|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm.exec(t.searchText),f=!1;if(d){var p=d[1]||"".concat(d[5],"l"),g=d[2]||d[3],m=parseInt(c,10),v=parseInt(g,10);switch(p){case">":case"v;break;case"<":case">l":f=m=l":case"=>l":f=m<=v;break;case">=":case"=>":case"<=l":case"==v}}if(f||"".concat(c).toLowerCase().includes(n))return!0}}return!1})):this.data,this.options.sortReset&&(this.unsortedData=j(this.data)),this.initSort()}}},{key:"initPagination",value:function(){var t=this,e=this.options;if(e.pagination){this.$pagination.show();var n,i,r,s,o,a,l,c=[],h=!1,u=this.getData({includeHiddenRows:!1}),d=e.pageList;if("string"==typeof d&&(d=d.replace(/\[|\]| /g,"").toLowerCase().split(",")),d=d.map((function(t){return"string"==typeof t?t.toLowerCase()===e.formatAllRows().toLowerCase()||["all","unlimited"].includes(t.toLowerCase())?e.formatAllRows():+t:t})),this.paginationParts=e.paginationParts,"string"==typeof this.paginationParts&&(this.paginationParts=this.paginationParts.replace(/\[|\]| |'/g,"").split(",")),"server"!==e.sidePagination&&(e.totalRows=u.length),this.totalPages=0,e.totalRows&&(e.pageSize===e.formatAllRows()&&(e.pageSize=e.totalRows,h=!0),this.totalPages=1+~~((e.totalRows-1)/e.pageSize),e.totalPages=this.totalPages),this.totalPages>0&&e.pageNumber>this.totalPages&&(e.pageNumber=this.totalPages),this.pageFrom=(e.pageNumber-1)*e.pageSize+1,this.pageTo=e.pageNumber*e.pageSize,this.pageTo>e.totalRows&&(this.pageTo=e.totalRows),this.options.pagination&&"server"!==this.options.sidePagination&&(this.options.totalNotFiltered=this.options.data.length),this.options.showExtendedPagination||(this.options.totalNotFiltered=void 0),(this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))&&c.push('
    ')),this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")){var f=this.options.totalRows+("client"===this.options.sidePagination&&this.options.paginationLoadMore&&!this._paginationLoaded?" +":""),p=this.paginationParts.includes("pageInfoShort")?e.formatDetailPagination(f):e.formatShowingRows(this.pageFrom,this.pageTo,f,e.totalNotFiltered);c.push('\n '.concat(p,"\n "))}if(this.paginationParts.includes("pageSize")){c.push('
    ');var g=['
    \n \n ").concat(this.constants.html.pageDropdown[0])];d.forEach((function(n,i){var r;(!e.smartDisplay||0===i||d[i-1]")),c.push(e.formatRecordsPerPage(g.join("")))}if((this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))&&c.push("
    "),this.paginationParts.includes("pageList")){c.push('
    '),W.sprintf(this.constants.html.pagination[0],W.sprintf(" pagination-%s",e.iconSize)),W.sprintf(this.constants.html.paginationItem," page-pre",e.formatSRPaginationPreText(),e.paginationPreText)),this.totalPagesthis.totalPages-i&&(i=i-(e.paginationSuccessivelySize-(this.totalPages-i))+1),i<1&&(i=1),r>this.totalPages&&(r=this.totalPages);var m=Math.round(e.paginationPagesBySide/2),v=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return W.sprintf(t.constants.html.paginationItem,i+(n===e.pageNumber?" ".concat(t.constants.classes.paginationActive):""),e.formatSRPaginationPageText(n),n)};if(i>1){var b=e.paginationPagesBySide;for(b>=i&&(b=i-1),n=1;n<=b;n++)c.push(v(n));i-1===b+1?(n=i-1,c.push(v(n))):i-1>b&&(i-2*e.paginationPagesBySide>e.paginationPagesBySide&&e.paginationUseIntermediate?(n=Math.round((i-m)/2+m),c.push(v(n," page-intermediate"))):c.push(W.sprintf(this.constants.html.paginationItem," page-first-separator disabled","","...")))}for(n=i;n<=r;n++)c.push(v(n));if(this.totalPages>r){var y=this.totalPages-(e.paginationPagesBySide-1);for(r>=y&&(y=r+1),r+1===y-1?(n=r+1,c.push(v(n))):y>r+1&&(this.totalPages-r>2*e.paginationPagesBySide&&e.paginationUseIntermediate?(n=Math.round((this.totalPages-m-r)/2+r),c.push(v(n," page-intermediate"))):c.push(W.sprintf(this.constants.html.paginationItem," page-last-separator disabled","","..."))),n=y;n<=this.totalPages;n++)c.push(v(n))}c.push(W.sprintf(this.constants.html.paginationItem," page-next",e.formatSRPaginationNextText(),e.paginationNextText)),c.push(this.constants.html.pagination[1],"
    ")}this.$pagination.html(c.join(""));var _=["bottom","both"].includes(e.paginationVAlign)?" ".concat(this.constants.classes.dropup):"";this.$pagination.last().find(".page-list > div").addClass(_),e.onlyInfoPagination||(s=this.$pagination.find(".page-list a"),o=this.$pagination.find(".page-pre"),a=this.$pagination.find(".page-next"),l=this.$pagination.find(".page-item").not(".page-next, .page-pre, .page-last-separator, .page-first-separator"),this.totalPages<=1&&this.$pagination.find("div.pagination").hide(),e.smartDisplay&&(d.length<2||e.totalRows<=d[0])&&this.$pagination.find("div.page-list").hide(),this.$pagination[this.getData().length?"show":"hide"](),e.paginationLoop||(1===e.pageNumber&&o.addClass("disabled"),e.pageNumber===this.totalPages&&a.addClass("disabled")),h&&(e.pageSize=e.formatAllRows()),s.off("click").on("click",(function(e){return t.onPageListChange(e)})),o.off("click").on("click",(function(e){return t.onPagePre(e)})),a.off("click").on("click",(function(e){return t.onPageNext(e)})),l.off("click").on("click",(function(e){return t.onPageNumber(e)})))}else this.$pagination.hide()}},{key:"updatePagination",value:function(t){t&&R(t.currentTarget).hasClass("disabled")||(this.options.maintainMetaData||this.resetRows(),this.initPagination(),this.trigger("page-change",this.options.pageNumber,this.options.pageSize),"server"===this.options.sidePagination||"client"===this.options.sidePagination&&this.options.paginationLoadMore&&!this._paginationLoaded&&this.options.pageNumber===this.totalPages?this.initServer():this.initBody())}},{key:"onPageListChange",value:function(t){t.preventDefault();var e=R(t.currentTarget);return e.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive),this.options.pageSize=e.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+e.text(),this.$toolbar.find(".page-size").text(this.options.pageSize),this.updatePagination(t),!1}},{key:"onPagePre",value:function(t){if(!R(t.target).hasClass("disabled"))return t.preventDefault(),this.options.pageNumber-1==0?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(t),!1}},{key:"onPageNext",value:function(t){if(!R(t.target).hasClass("disabled"))return t.preventDefault(),this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(t),!1}},{key:"onPageNumber",value:function(t){if(t.preventDefault(),this.options.pageNumber!==+R(t.currentTarget).text())return this.options.pageNumber=+R(t.currentTarget).text(),this.updatePagination(t),!1}},{key:"initRow",value:function(t,e,n,i){var r=this,s=[],o={},a=[],l="",c={},h=[];if(!(W.findIndex(this.hiddenRows,t)>-1)){if((o=W.calculateObjectValue(this.options,this.options.rowStyle,[t,e],o))&&o.css)for(var u=0,d=Object.entries(o.css);u"),this.options.cardView&&s.push('
    '));var A="";return W.hasDetailViewIcon(this.options)&&(A="",W.calculateObjectValue(null,this.options.detailFilter,[e,t])&&(A+='\n \n '.concat(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen),"\n \n ")),A+=""),A&&"right"!==this.options.detailViewAlign&&s.push(A),this.header.fields.forEach((function(n,i){var o=r.columns[i],l="",c=W.getItemField(t,n,r.options.escape,o.escape),h="",u="",d={},f="",p=r.header.classes[i],g="",m="",v="",b="",y="",_="";if((!r.fromHtml&&!r.autoMergeCells||void 0!==c||o.checkbox||o.radio)&&o.visible&&(!r.options.cardView||o.cardVisible)){if(a.concat([r.header.styles[i]]).length&&(m+="".concat(a.concat([r.header.styles[i]]).join("; "))),t["_".concat(n,"_style")]&&(m+="".concat(t["_".concat(n,"_style")])),m&&(g=' style="'.concat(m,'"')),t["_".concat(n,"_id")]&&(f=W.sprintf(' id="%s"',t["_".concat(n,"_id")])),t["_".concat(n,"_class")]&&(p=W.sprintf(' class="%s"',t["_".concat(n,"_class")])),t["_".concat(n,"_rowspan")]&&(b=W.sprintf(' rowspan="%s"',t["_".concat(n,"_rowspan")])),t["_".concat(n,"_colspan")]&&(y=W.sprintf(' colspan="%s"',t["_".concat(n,"_colspan")])),t["_".concat(n,"_title")]&&(_=W.sprintf(' title="%s"',t["_".concat(n,"_title")])),(d=W.calculateObjectValue(r.header,r.header.cellStyles[i],[c,t,e,n],d)).classes&&(p=' class="'.concat(d.classes,'"')),d.css){for(var x=[],w=0,S=Object.entries(d.css);w|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(h)){var O=(new DOMParser).parseFromString(h.toString(),"text/html").documentElement.textContent,I=O.replace(M,R);O=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),E=h.replace(new RegExp("(>\\s*)(".concat(O,")(\\s*)"),"gm"),"$1".concat(I,"$3"))}else E=h.toString().replace(M,R);h=W.calculateObjectValue(o,o.searchHighlightFormatter,[h,r.searchText],E)}if(t["_".concat(n,"_data")]&&!W.isEmptyObject(t["_".concat(n,"_data")]))for(var P=0,N=Object.entries(t["_".concat(n,"_data")]);P'):'"),'"),r.header.formatters[i]&&"string"==typeof h?h:"",r.options.cardView?"
    ":""].join(""),t[r.header.stateField]=!0===h||!!c||h&&h.checked}else if(r.options.cardView){var $=r.options.showHeader?'").concat(W.getFieldTitle(r.columns,n),""):"";l='
    '.concat($,'").concat(h,"
    "),r.options.smartDisplay&&""===h&&(l='
    ')}else l="").concat(h,"");s.push(l)}})),A&&"right"===this.options.detailViewAlign&&s.push(A),this.options.cardView&&s.push("
    "),s.push(""),s.join("")}}},{key:"initBody",value:function(t,e){var n=this,i=this.getData();this.trigger("pre-body",i),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=R("").appendTo(this.$el)),this.options.pagination&&"server"!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=i.length);var r=[],s=R(document.createDocumentFragment()),o=!1,a=[];this.autoMergeCells=W.checkAutoMergeCells(i.slice(this.pageFrom-1,this.pageTo));for(var l=this.pageFrom-1;l tr[data-uniqueid="%s"][data-has-detail-view]',d)).next();f.is("tr.detail-view")&&(a.push(l),e&&d===e||(h+=f[0].outerHTML))}this.options.virtualScroll?r.push(h):s.append(h)}}o?this.options.virtualScroll?(this.virtualScroll&&this.virtualScroll.destroy(),this.virtualScroll=new Y({rows:r,fixedScroll:t,scrollEl:this.$tableBody[0],contentEl:this.$body[0],itemHeight:this.options.virtualScrollItemHeight,callback:function(t,e){n.fitHeader(),n.initBodyEvent(),n.trigger("virtual-scroll",t,e)}})):this.$body.html(s):this.$body.html(''.concat(W.sprintf('%s',this.getVisibleFields().length+W.getDetailViewIndexOffset(this.options),this.options.formatNoMatches()),"")),a.forEach((function(t){n.expandRow(t)})),t||this.scrollTo(0),this.initBodyEvent(),this.initFooter(),this.resetView(),this.updateSelected(),"server"!==this.options.sidePagination&&(this.options.totalRows=i.length),this.trigger("post-body",i)}},{key:"initBodyEvent",value:function(){var t=this;this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",(function(e){var n=R(e.currentTarget);if(!(n.find(".detail-icon").length||n.index()-W.getDetailViewIndexOffset(t.options)<0)){var i=n.parent(),r=R(e.target).parents(".card-views").children(),s=R(e.target).parents(".card-view"),o=i.data("index"),a=t.data[o],l=t.options.cardView?r.index(s):n[0].cellIndex,c=t.getVisibleFields()[l-W.getDetailViewIndexOffset(t.options)],h=t.columns[t.fieldsColumnsIndex[c]],u=W.getItemField(a,c,t.options.escape,h.escape);if(t.trigger("click"===e.type?"click-cell":"dbl-click-cell",c,u,a,n),t.trigger("click"===e.type?"click-row":"dbl-click-row",a,i,c),"click"===e.type&&t.options.clickToSelect&&h.clickToSelect&&!W.calculateObjectValue(t.options,t.options.ignoreClickToSelectOn,[e.target])){var d=i.find(W.sprintf('[name="%s"]',t.options.selectItemName));d.length&&d[0].click()}"click"===e.type&&t.options.detailViewByClick&&t.toggleDetailView(o,t.header.detailFormatters[t.fieldsColumnsIndex[c]])}})).off("mousedown").on("mousedown",(function(e){t.multipleSelectRowCtrlKey=e.ctrlKey||e.metaKey,t.multipleSelectRowShiftKey=e.shiftKey})),this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",(function(e){return e.preventDefault(),t.toggleDetailView(R(e.currentTarget).parent().parent().data("index")),!1})),this.$selectItem=this.$body.find(W.sprintf('[name="%s"]',this.options.selectItemName)),this.$selectItem.off("click").on("click",(function(e){e.stopImmediatePropagation();var n=R(e.currentTarget);t._toggleCheck(n.prop("checked"),n.data("index"))})),this.header.events.forEach((function(e,n){var i=e;if(i){if("string"==typeof i&&(i=W.calculateObjectValue(null,i)),!i)throw new Error("Unknown event in the scope: ".concat(e));var r=t.header.fields[n],s=t.getVisibleFields().indexOf(r);if(-1!==s){s+=W.getDetailViewIndexOffset(t.options);var o=function(e){if(!i.hasOwnProperty(e))return 1;var n=i[e];t.$body.find(">tr:not(.no-records-found)").each((function(i,o){var a=R(o),l=a.find(t.options.cardView?".card-views>.card-view":">td").eq(s),c=e.indexOf(" "),h=e.substring(0,c),u=e.substring(c+1);l.find(u).off(h).on(h,(function(e){var i=a.data("index"),s=t.data[i],o=s[r];n.apply(t,[e,o,s,i])}))}))};for(var a in i)o(a)}}}))}},{key:"initServer",value:function(t,e,n){var i=this,r={},s=this.header.fields.indexOf(this.options.sortName),o={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};if(this.header.sortNames[s]&&(o.sortName=this.header.sortNames[s]),this.options.pagination&&"server"===this.options.sidePagination&&(o.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,o.pageNumber=this.options.pageNumber),n||this.options.url||this.options.ajax){if("limit"===this.options.queryParamsType&&(o={search:o.searchText,sort:o.sortName,order:o.sortOrder},this.options.pagination&&"server"===this.options.sidePagination&&(o.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),o.limit=this.options.pageSize,0!==o.limit&&this.options.pageSize!==this.options.formatAllRows()||delete o.limit)),this.options.search&&"server"===this.options.sidePagination&&this.options.searchable&&this.columns.filter((function(t){return t.searchable})).length){o.searchable=[];var a,l=N(this.columns);try{for(l.s();!(a=l.n()).done;){var c=a.value;!c.checkbox&&c.searchable&&(this.options.visibleSearch&&c.visible||!this.options.visibleSearch)&&o.searchable.push(c.field)}}catch(t){l.e(t)}finally{l.f()}}if(W.isEmptyObject(this.filterColumnsPartial)||(o.filter=JSON.stringify(this.filterColumnsPartial,null)),W.extend(o,e||{}),!1!==(r=W.calculateObjectValue(this.options,this.options.queryParams,[o],r))){t||this.showLoading();var h=W.extend({},W.calculateObjectValue(null,this.options.ajaxOptions),{type:this.options.method,url:n||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(r):r,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(e,n,r){var s=W.calculateObjectValue(i.options,i.options.responseHandler,[e,r],e);"client"===i.options.sidePagination&&i.options.paginationLoadMore&&(i._paginationLoaded=i.data.length===s.length),i.load(s),i.trigger("load-success",s,r&&r.status,r),t||i.hideLoading(),"server"===i.options.sidePagination&&i.options.pageNumber>1&&s[i.options.totalField]>0&&!s[i.options.dataField].length&&i.updatePagination()},error:function(e){if(e&&0===e.status&&i._xhrAbort)i._xhrAbort=!1;else{var n=[];"server"===i.options.sidePagination&&((n={})[i.options.totalField]=0,n[i.options.dataField]=[]),i.load(n),i.trigger("load-error",e&&e.status,e),t||i.hideLoading()}}});return this.options.ajax?W.calculateObjectValue(this,this.options.ajax,[h],null):(this._xhr&&4!==this._xhr.readyState&&(this._xhrAbort=!0,this._xhr.abort()),this._xhr=R.ajax(h)),r}}}},{key:"initSearchText",value:function(){if(this.options.search&&(this.searchText="",""!==this.options.searchText)){var t=W.getSearchInput(this);t.val(this.options.searchText),this.onSearch({currentTarget:t,firedByInitSearchText:!0})}}},{key:"getCaret",value:function(){var t=this;this.$header.find("th").each((function(e,n){R(n).find(".sortable").removeClass("desc asc").addClass(R(n).data("field")===t.options.sortName?t.options.sortOrder:"both")}))}},{key:"updateSelected",value:function(){var t=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",t),this.$selectItem.each((function(t,e){R(e).closest("tr")[R(e).prop("checked")?"addClass":"removeClass"]("selected")}))}},{key:"updateRows",value:function(){var t=this;this.$selectItem.each((function(e,n){t.data[R(n).data("index")][t.header.stateField]=R(n).prop("checked")}))}},{key:"resetRows",value:function(){var t,e=N(this.data);try{for(e.s();!(t=e.n()).done;){var n=t.value;this.$selectAll.prop("checked",!1),this.$selectItem.prop("checked",!1),this.header.stateField&&(n[this.header.stateField]=!1)}}catch(t){e.e(t)}finally{e.f()}this.initHiddenRows()}},{key:"trigger",value:function(e){for(var n,i,r="".concat(e,".bs.table"),s=arguments.length,o=new Array(s>1?s-1:0),a=1;ae.clientHeight+this.$header.outerHeight()?W.getScrollBarWidth():0;this.$el.css("margin-top",-this.$header.outerHeight());var i=this.$tableHeader.find(":focus");if(i.length>0){var r=i.parents("th");if(r.length>0){var s=r.attr("data-field");if(void 0!==s){var o=this.$header.find("[data-field='".concat(s,"']"));o.length>0&&o.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css("margin-right",n).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),this.$tableLoading.css("width",this.$el.outerWidth());var a=R(".focus-temp:visible:eq(0)");a.length>0&&(a.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each((function(e,n){t.$header_.find(W.sprintf('th[data-field="%s"]',R(n).data("field"))).data(R(n).data())}));for(var l=this.getVisibleFields(),c=this.$header_.find("th"),h=this.$body.find(">tr:not(.no-records-found,.virtual-scroll-top)").eq(0);h.length&&h.find('>td[colspan]:not([colspan="1"])').length;)h=h.next();var u=h.find("> *").length;h.find("> *").each((function(e,n){var i=R(n);if(W.hasDetailViewIcon(t.options)&&(0===e&&"right"!==t.options.detailViewAlign||e===u-1&&"right"===t.options.detailViewAlign)){var r=c.filter(".detail"),s=r.innerWidth()-r.find(".fht-cell").width();r.find(".fht-cell").width(i.innerWidth()-s)}else{var o=e-W.getDetailViewIndexOffset(t.options),a=t.$header_.find(W.sprintf('th[data-field="%s"]',l[o]));a.length>1&&(a=R(c[i[0].cellIndex]));var h=a.innerWidth()-a.find(".fht-cell").width();a.find(".fht-cell").width(i.innerWidth()-h)}})),this.horizontalScroll(),this.trigger("post-header")}}},{key:"initFooter",value:function(){if(this.options.showFooter&&!this.options.cardView){var t=this.getData(),e=[],n="";W.hasDetailViewIcon(this.options)&&(n='
    '),n&&"right"!==this.options.detailViewAlign&&e.push(n);var i,r=N(this.columns);try{for(r.s();!(i=r.n()).done;){var s,o,a=i.value,l=[],c={},h=W.sprintf(' class="%s"',a.class);if(!(!a.visible||this.footerData&&this.footerData.length>0&&!(a.field in this.footerData[0]))){if(this.options.cardView&&!a.cardVisible)return;if(s=W.sprintf("text-align: %s; ",a.falign?a.falign:a.align),o=W.sprintf("vertical-align: %s; ",a.valign),(c=W.calculateObjectValue(null,a.footerStyle||this.options.footerStyle,[a]))&&c.css)for(var u=0,d=Object.entries(c.css);u0&&(m=this.footerData[0]["_".concat(a.field,"_colspan")]||0),m&&e.push(' colspan="'.concat(m,'" ')),e.push(">"),e.push('
    ');var v="";this.footerData&&this.footerData.length>0&&(v=this.footerData[0][a.field]||""),e.push(W.calculateObjectValue(a,a.footerFormatter,[t,v],v)),e.push("
    "),e.push('
    '),e.push(""),e.push("")}}}catch(t){r.e(t)}finally{r.f()}n&&"right"===this.options.detailViewAlign&&e.push(n),this.options.height||this.$tableFooter.length||(this.$el.append(""),this.$tableFooter=this.$el.find("tfoot")),this.$tableFooter.find("tr").length||this.$tableFooter.html("
    "),this.$tableFooter.find("tr").html(e.join("")),this.trigger("post-footer",this.$tableFooter)}}},{key:"fitFooter",value:function(){var t=this;if(this.$el.is(":hidden"))setTimeout((function(){return t.fitFooter()}),100);else{var e=this.$tableBody.get(0),n=this.hasScrollBar&&e.scrollHeight>e.clientHeight+this.$header.outerHeight()?W.getScrollBarWidth():0;this.$tableFooter.css("margin-right",n).find("table").css("width",this.$el.outerWidth()).attr("class",this.$el.attr("class"));var i=this.$tableFooter.find("th"),r=this.$body.find(">tr:first-child:not(.no-records-found)");for(i.find(".fht-cell").width("auto");r.length&&r.find('>td[colspan]:not([colspan="1"])').length;)r=r.next();var s=r.find("> *").length;r.find("> *").each((function(e,n){var r=R(n);if(W.hasDetailViewIcon(t.options)&&(0===e&&"left"===t.options.detailViewAlign||e===s-1&&"right"===t.options.detailViewAlign)){var o=i.filter(".detail"),a=o.innerWidth()-o.find(".fht-cell").width();o.find(".fht-cell").width(r.innerWidth()-a)}else{var l=i.eq(e),c=l.innerWidth()-l.find(".fht-cell").width();l.find(".fht-cell").width(r.innerWidth()-c)}})),this.horizontalScroll()}}},{key:"horizontalScroll",value:function(){var t=this;this.$tableBody.off("scroll").on("scroll",(function(){var e=t.$tableBody.scrollLeft();t.options.showHeader&&t.options.height&&t.$tableHeader.scrollLeft(e),t.options.showFooter&&!t.options.cardView&&t.$tableFooter.scrollLeft(e),t.trigger("scroll-body",t.$tableBody)}))}},{key:"getVisibleFields",value:function(){var t,e=[],n=N(this.header.fields);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=this.columns[this.fieldsColumnsIndex[i]];r&&r.visible&&(!this.options.cardView||r.cardVisible)&&e.push(i)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"initHiddenRows",value:function(){this.hiddenRows=[]}},{key:"getOptions",value:function(){var t=W.extend({},this.options);return delete t.data,W.extend(!0,{},t)}},{key:"refreshOptions",value:function(t){W.compareObjects(this.options,t,!0)||(this.options=W.extend(this.options,t),this.trigger("refresh-options",this.options),this.destroy(),this.init())}},{key:"getData",value:function(t){var e=this,n=this.options.data;if(!(this.searchText||this.options.customSearch||void 0!==this.options.sortName||this.enableCustomSort)&&W.isEmptyObject(this.filterColumns)&&"function"!=typeof this.options.filterOptions.filterAlgorithm&&W.isEmptyObject(this.filterColumnsPartial)||t&&t.unfiltered||(n=this.data),t&&!t.includeHiddenRows){var i=this.getHiddenRows();n=n.filter((function(t){return-1===W.findIndex(i,t)}))}return t&&t.useCurrentPage&&(n=n.slice(this.pageFrom-1,this.pageTo)),t&&t.formatted?n.map((function(t){for(var n=0,i=Object.entries(t);n=0;n--){var i=this.options.data[n],r=W.getItemField(i,t.field,this.options.escape,i.escape);void 0===r&&"$index"!==t.field||(!i.hasOwnProperty(t.field)&&"$index"===t.field&&t.values.includes(n)||t.values.includes(r))&&(e++,this.options.data.splice(n,1))}e&&("server"===this.options.sidePagination&&(this.options.totalRows-=e,this.data=j(this.options.data)),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},{key:"removeAll",value:function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))}},{key:"insertRow",value:function(t){t.hasOwnProperty("index")&&t.hasOwnProperty("row")&&(this.options.data.splice(t.index,0,t.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},{key:"updateRow",value:function(t){var e,n=N(Array.isArray(t)?t:[t]);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.hasOwnProperty("index")&&i.hasOwnProperty("row")&&(i.hasOwnProperty("replace")&&i.replace?this.options.data[i.index]=i.row:W.extend(this.options.data[i.index],i.row))}}catch(t){n.e(t)}finally{n.f()}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)}},{key:"getRowByUniqueId",value:function(t){var e,n,i=this.options.uniqueId,r=t,s=null;for(e=this.options.data.length-1;e>=0;e--){n=this.options.data[e];var o=W.getItemField(n,i,this.options.escape,n.escape);if(void 0!==o&&("string"==typeof o?r=t.toString():"number"==typeof o&&(Number(o)===o&&o%1==0?r=parseInt(t,10):o===Number(o)&&0!==o&&(r=parseFloat(t))),o===r)){s=n;break}}return s}},{key:"updateByUniqueId",value:function(t){var e,n=null,i=N(Array.isArray(t)?t:[t]);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.hasOwnProperty("id")&&r.hasOwnProperty("row")){var s=this.options.data.indexOf(this.getRowByUniqueId(r.id));-1!==s&&(r.hasOwnProperty("replace")&&r.replace?this.options.data[s]=r.row:W.extend(this.options.data[s],r.row),n=r.id)}}}catch(t){i.e(t)}finally{i.f()}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0,n)}},{key:"removeByUniqueId",value:function(t){var e=this.options.data.length,n=this.getRowByUniqueId(t);n&&this.options.data.splice(this.options.data.indexOf(n),1),e!==this.options.data.length&&("server"===this.options.sidePagination&&(this.options.totalRows-=1,this.data=j(this.options.data)),this.initSearch(),this.initPagination(),this.initBody(!0))}},{key:"_updateCellOnly",value:function(t,e){var n=this.initRow(this.options.data[e],e),i=this.getVisibleFields().indexOf(t);-1!==i&&(i+=W.getDetailViewIndexOffset(this.options),this.$body.find(">tr[data-index=".concat(e,"]")).find(">td:eq(".concat(i,")")).replaceWith(R(n).find(">td:eq(".concat(i,")"))),this.initBodyEvent(),this.initFooter(),this.resetView(),this.updateSelected())}},{key:"updateCell",value:function(t){t.hasOwnProperty("index")&&t.hasOwnProperty("field")&&t.hasOwnProperty("value")&&(this.options.data[t.index][t.field]=t.value,!1!==t.reinit?(this.initSort(),this.initBody(!0)):this._updateCellOnly(t.field,t.index))}},{key:"updateCellByUniqueId",value:function(t){var e=this;(Array.isArray(t)?t:[t]).forEach((function(t){var n=t.id,i=t.field,r=t.value,s=e.options.data.indexOf(e.getRowByUniqueId(n));-1!==s&&(e.options.data[s][i]=r)})),!1!==t.reinit?(this.initSort(),this.initBody(!0)):this._updateCellOnly(t.field,this.options.data.indexOf(this.getRowByUniqueId(t.id)))}},{key:"showRow",value:function(t){this._toggleRow(t,!0)}},{key:"hideRow",value:function(t){this._toggleRow(t,!1)}},{key:"_toggleRow",value:function(t,e){var n;if(t.hasOwnProperty("index")?n=this.getData()[t.index]:t.hasOwnProperty("uniqueId")&&(n=this.getRowByUniqueId(t.uniqueId)),n){var i=W.findIndex(this.hiddenRows,n);e||-1!==i?e&&i>-1&&this.hiddenRows.splice(i,1):this.hiddenRows.push(n),this.initBody(!0),this.initPagination()}}},{key:"getHiddenRows",value:function(t){if(t)return this.initHiddenRows(),this.initBody(!0),void this.initPagination();var e,n=[],i=N(this.getData());try{for(i.s();!(e=i.n()).done;){var r=e.value;this.hiddenRows.includes(r)&&n.push(r)}}catch(t){i.e(t)}finally{i.f()}return this.hiddenRows=n,n}},{key:"showColumn",value:function(t){var e=this;(Array.isArray(t)?t:[t]).forEach((function(t){e._toggleColumn(e.fieldsColumnsIndex[t],!0,!0)}))}},{key:"hideColumn",value:function(t){var e=this;(Array.isArray(t)?t:[t]).forEach((function(t){e._toggleColumn(e.fieldsColumnsIndex[t],!1,!0)}))}},{key:"_toggleColumn",value:function(t,e,n){if(void 0!==t&&this.columns[t].visible!==e&&(this.columns[t].visible=e,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var i=this.$toolbar.find('.keep-open input:not(".toggle-all")').prop("disabled",!1);n&&i.filter(W.sprintf('[value="%s"]',t)).prop("checked",e),i.filter(":checked").length<=this.options.minimumCountColumns&&i.filter(":checked").prop("disabled",!0)}}},{key:"getVisibleColumns",value:function(){var t=this;return this.columns.filter((function(e){return e.visible&&!t.isSelectionColumn(e)}))}},{key:"getHiddenColumns",value:function(){return this.columns.filter((function(t){return!t.visible}))}},{key:"isSelectionColumn",value:function(t){return t.radio||t.checkbox}},{key:"showAllColumns",value:function(){this._toggleAllColumns(!0)}},{key:"hideAllColumns",value:function(){this._toggleAllColumns(!1)}},{key:"_toggleAllColumns",value:function(t){var e,n=this,i=N(this.columns.slice().reverse());try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.switchable){if(!t&&this.options.showColumns&&this.getVisibleColumns().filter((function(t){return t.switchable})).length===this.options.minimumCountColumns)continue;r.visible=t}}}catch(t){i.e(t)}finally{i.f()}if(this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var s=this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop("disabled",!1);t?s.prop("checked",t):s.get().reverse().forEach((function(e){s.filter(":checked").length>n.options.minimumCountColumns&&R(e).prop("checked",t)})),s.filter(":checked").length<=this.options.minimumCountColumns&&s.filter(":checked").prop("disabled",!0)}}},{key:"mergeCells",value:function(t){var e,n,i=t.index,r=this.getVisibleFields().indexOf(t.field),s=t.rowspan||1,o=t.colspan||1,a=this.$body.find(">tr[data-index]");r+=W.getDetailViewIndexOffset(this.options);var l=a.eq(i).find(">td").eq(r);if(!(i<0||r<0||i>=this.data.length)){for(e=i;etd").eq(n).hide();l.attr("rowspan",s).attr("colspan",o).show()}}},{key:"checkAll",value:function(){this._toggleCheckAll(!0)}},{key:"uncheckAll",value:function(){this._toggleCheckAll(!1)}},{key:"_toggleCheckAll",value:function(t){var e=this.getSelections();this.$selectAll.add(this.$selectAll_).prop("checked",t),this.$selectItem.filter(":enabled").prop("checked",t),this.updateRows(),this.updateSelected();var n=this.getSelections();t?this.trigger("check-all",n,e):this.trigger("uncheck-all",n,e)}},{key:"checkInvert",value:function(){var t=this.$selectItem.filter(":enabled"),e=t.filter(":checked");t.each((function(t,e){R(e).prop("checked",!R(e).prop("checked"))})),this.updateRows(),this.updateSelected(),this.trigger("uncheck-some",e),e=this.getSelections(),this.trigger("check-some",e)}},{key:"check",value:function(t){this._toggleCheck(!0,t)}},{key:"uncheck",value:function(t){this._toggleCheck(!1,t)}},{key:"_toggleCheck",value:function(t,e){var n=this.$selectItem.filter('[data-index="'.concat(e,'"]')),i=this.data[e];if(n.is(":radio")||this.options.singleSelect||this.options.multipleSelectRow&&!this.multipleSelectRowCtrlKey&&!this.multipleSelectRowShiftKey){var r,s=N(this.options.data);try{for(s.s();!(r=s.n()).done;)r.value[this.header.stateField]=!1}catch(t){s.e(t)}finally{s.f()}this.$selectItem.filter(":checked").not(n).prop("checked",!1)}if(i[this.header.stateField]=t,this.options.multipleSelectRow){if(this.multipleSelectRowShiftKey&&this.multipleSelectRowLastSelectedIndex>=0)for(var o=L(this.multipleSelectRowLastSelectedIndexn.clientWidth}if(!this.options.cardView&&this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),e+=this.$header.outerHeight(!0)+1):(this.$tableHeader.hide(),this.trigger("post-header")),!this.options.cardView&&this.options.showFooter&&(this.$tableFooter.show(),this.fitFooter(),this.options.height&&(e+=this.$tableFooter.outerHeight(!0))),this.$container.hasClass("fullscreen"))this.$tableContainer.css("height",""),this.$tableContainer.css("width","");else if(this.options.height){this.$tableBorder&&(this.$tableBorder.css("width",""),this.$tableBorder.css("height",""));var i=this.$toolbar.outerHeight(!0),r=this.$pagination.outerHeight(!0),s=this.options.height-i-r,o=this.$tableBody.find(">table"),a=o.outerHeight();if(this.$tableContainer.css("height","".concat(s,"px")),this.$tableBorder&&o.is(":visible")){var l=s-a-2;this.hasScrollBar&&(l-=W.getScrollBarWidth()),this.$tableBorder.css("width","".concat(o.outerWidth(),"px")),this.$tableBorder.css("height","".concat(l,"px"))}}this.options.cardView?(this.$el.css("margin-top","0"),this.$tableContainer.css("padding-bottom","0"),this.$tableFooter.hide()):(this.getCaret(),this.$tableContainer.css("padding-bottom","".concat(e,"px"))),this.trigger("reset-view")}},{key:"showLoading",value:function(){this.$tableLoading.toggleClass("open",!0);var t=this.options.loadingFontSize;"auto"===this.options.loadingFontSize&&(t=.04*this.$tableLoading.width(),t=Math.max(12,t),t=Math.min(32,t),t="".concat(t,"px")),this.$tableLoading.find(".loading-text").css("font-size",t)}},{key:"hideLoading",value:function(){this.$tableLoading.toggleClass("open",!1)}},{key:"togglePagination",value:function(){this.options.pagination=!this.options.pagination;var t=this.options.showButtonIcons?this.options.pagination?this.options.icons.paginationSwitchDown:this.options.icons.paginationSwitchUp:"",e=this.options.showButtonText?this.options.pagination?this.options.formatPaginationSwitchUp():this.options.formatPaginationSwitchDown():"";this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)),this.updatePagination(),this.trigger("toggle-pagination",this.options.pagination)}},{key:"toggleFullscreen",value:function(){this.$el.closest(".bootstrap-table").toggleClass("fullscreen"),this.resetView()}},{key:"toggleView",value:function(){this.options.cardView=!this.options.cardView,this.initHeader();var t=this.options.showButtonIcons?this.options.cardView?this.options.icons.toggleOn:this.options.icons.toggleOff:"",e=this.options.showButtonText?this.options.cardView?this.options.formatToggleOff():this.options.formatToggleOn():"";this.$toolbar.find('button[name="toggle"]').html("".concat(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)).attr("aria-label",e).attr("title",e),this.initBody(),this.trigger("toggle",this.options.cardView)}},{key:"resetSearch",value:function(t){var e=W.getSearchInput(this),n=t||"";e.val(n),this.searchText=n,this.onSearch({currentTarget:e},!1)}},{key:"filterBy",value:function(t,e){this.filterOptions=W.isEmptyObject(e)?this.options.filterOptions:W.extend(this.options.filterOptions,e),this.filterColumns=W.isEmptyObject(t)?{}:t,this.options.pageNumber=1,this.initSearch(),this.updatePagination()}},{key:"scrollTo",value:function(t){var e={unit:"px",value:0};"object"===B(t)?e=Object.assign(e,t):"string"==typeof t&&"bottom"===t?e.value=this.$tableBody[0].scrollHeight:"string"!=typeof t&&"number"!=typeof t||(e.value=t);var n=e.value;"rows"===e.unit&&(n=0,this.$body.find("> tr:lt(".concat(e.value,")")).each((function(t,e){n+=R(e).outerHeight(!0)}))),this.$tableBody.scrollTop(n)}},{key:"getScrollPosition",value:function(){return this.$tableBody.scrollTop()}},{key:"selectPage",value:function(t){t>0&&t<=this.options.totalPages&&(this.options.pageNumber=t,this.updatePagination())}},{key:"prevPage",value:function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())}},{key:"nextPage",value:function(){this.options.pageNumber tr[data-index="%s"]',t)).next().is("tr.detail-view")?this.collapseRow(t):this.expandRow(t,e),this.resetView()}},{key:"expandRow",value:function(t,e){var n=this.data[t],i=this.$body.find(W.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));if(this.options.detailViewIcon&&i.find("a.detail-icon").html(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailClose)),!i.next().is("tr.detail-view")){i.after(W.sprintf('',i.children("td").length));var r=i.next().find("td"),s=e||this.options.detailFormatter,o=W.calculateObjectValue(this.options,s,[t,n,r],"");1===r.length&&r.append(o),this.trigger("expand-row",t,n,r)}}},{key:"expandRowByUniqueId",value:function(t){var e=this.getRowByUniqueId(t);e&&this.expandRow(this.data.indexOf(e))}},{key:"collapseRow",value:function(t){var e=this.data[t],n=this.$body.find(W.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));n.next().is("tr.detail-view")&&(this.options.detailViewIcon&&n.find("a.detail-icon").html(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen)),this.trigger("collapse-row",t,e,n.next()),n.next().remove())}},{key:"collapseRowByUniqueId",value:function(t){var e=this.getRowByUniqueId(t);e&&this.collapseRow(this.data.indexOf(e))}},{key:"expandAllRows",value:function(){for(var t=this.$body.find("> tr[data-index][data-has-detail-view]"),e=0;e tr[data-index][data-has-detail-view]"),e=0;e1?e-1:0),i=1;i{Bl(".email-app").toggleClass("side-active"),t.preventDefault()})),Bl(".email-list-item, .back-to-mailbox").on("click",(t=>{Bl(".email-content").toggleClass("open"),t.preventDefault()}));var lS=n(748),cS=n.n(lS);Bl("#google-map").length>0&&cS()({key:""}).then((()=>{const t=26.8206,e=30.8025,{google:n}=window,i={center:new n.maps.LatLng(t,e),zoom:5,mapTypeId:n.maps.MapTypeId.ROADMAP,styles:[{featureType:"landscape",stylers:[{hue:"#FFBB00"},{saturation:43.400000000000006},{lightness:37.599999999999994},{gamma:1}]},{featureType:"road.highway",stylers:[{hue:"#FFC200"},{saturation:-61.8},{lightness:45.599999999999994},{gamma:1}]},{featureType:"road.arterial",stylers:[{hue:"#FF0300"},{saturation:-100},{lightness:51.19999999999999},{gamma:1}]},{featureType:"road.local",stylers:[{hue:"#FF0300"},{saturation:-100},{lightness:52},{gamma:1}]},{featureType:"water",stylers:[{hue:"#0078FF"},{saturation:-13.200000000000003},{lightness:2.4000000000000057},{gamma:1}]},{featureType:"poi",stylers:[{hue:"#00FF6A"},{saturation:-1.0989010989011234},{lightness:11.200000000000017},{gamma:1}]}]},r=new n.maps.Map(document.getElementById("google-map"),i);new n.maps.Marker({map:r,position:new n.maps.LatLng(t,e),visible:!0})})),function(){const t=document.createEvent("UIEvents");window.EVENT=t,t.initUIEvent("resize",!0,!1,window,0),window.addEventListener("load",(()=>{window.dispatchEvent(t)})),Bl("a").filter('[href^="http"], [href^="//"]').not(`[href*="${window.location.host}"]`).attr("rel","noopener noreferrer").attr("target","_blank"),document.addEventListener("click",(()=>{window.dispatchEvent(window.EVENT)}))}();$(document).ready((function(){const t=$("#adminEditBtn"),e=$("#adminDeleteBtn"),n=$("#bsTable"),i=n=>{const i=n.length;0===i?(t.prop("disabled",!0),e.prop("disabled",!0)):1===i?(t.prop("disabled",!1),e.prop("disabled",!1)):(t.prop("disabled",!0),e.prop("disabled",!1))},r=()=>{t.prop("disabled",!0),e.prop("disabled",!0)};n.on("load-success.bs.table",(()=>{r()})),n.on("load-error.bs.table",((t,e,n)=>{showFailDialog(n),r()})),n.on("check.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)})),n.on("uncheck.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)})),n.on("check-all.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)})),n.on("uncheck-all.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)}));const s=n.data("identifier");s&&(n.on("column-switch.bs.table",(()=>{const t=n.bootstrapTable("getVisibleColumns").map((t=>t.field));(0,u.E)("POST",`/setting/store-setting/${s}`,JSON.stringify({value:t})).catch((t=>console.error("Error:",t)))})),(0,u.E)("GET",`/setting/get-setting/${s}`).then((t=>{n.bootstrapTable("getVisibleColumns").forEach((t=>{n.bootstrapTable("hideColumn",t.field)})),t?.data?.value?.forEach((t=>{n.bootstrapTable("showColumn",t)}))})).catch((t=>console.error("Error:",t))))})),$(document).ready((()=>{const t=$("#adminModal"),e=$("#deleteFormModal"),n=$("#bsTable");$("#adminEditBtn").prop("disabled",!0),$("#adminDeleteBtn").prop("disabled",!0),$(document).on("click","#adminAddBtn",(()=>{t.find(".modal-messages").html(""),(0,u.E)("GET","/admin/add").catch((t=>console.error("Error:",t))).then((e=>{t.find(".modal-title").text("Add admin"),t.find(".modal-form").html(e.data),t.modal("show")}))})),$(document).on("click","#formModalSubmit",(()=>{const e=$("#ajaxForm"),i=t.find(".modal-messages");e.length<1||(0,u.E)("POST",e.attr("action"),new FormData(e.get(0))).then((e=>{i.html(""),i.append($("
    ").prop({innerHTML:e.message,className:"alert alert-success",role:"alert"})),n.bootstrapTable("refresh"),setTimeout((function(){t.modal("hide")}),1500)})).catch((t=>{i.html(""),i.append($("
    ").prop({innerHTML:t.cause,className:"alert alert-danger",role:"alert"}))})).finally((()=>{t.modal("show")}))})),$(document).on("click","#adminEditBtn",(()=>{const e=$("#bsTable").bootstrapTable("getSelections");1===e.length&&(t.find(".modal-messages")?.html(""),(0,u.E)("GET",`/admin/edit/${e[0].uuid}`).catch((t=>console.error("Error:",t))).then((e=>{t.find(".modal-title").text("Edit admin"),t.find(".modal-form").html(e.data),t.modal("show")})))})),$(document).on("click","#adminDeleteBtn",(()=>{const t=$("#bsTable").bootstrapTable("getSelections");1===t.length&&(e.find(".modal-form").html(`Are you sure you want to delete ${t[0].identity}?`),e.modal("show"))})),$(document).on("click","#modalDeleteBtn",(()=>{const t=$("#bsTable").bootstrapTable("getSelections"),i=e.find(".modal-messages");(0,u.E)("DELETE",`/admin/delete/${t[0].uuid}`).then((t=>{i.html(""),i.append($("
    ").prop({innerHTML:t.message,className:"alert alert-success",role:"alert"})),n.bootstrapTable("refresh"),setTimeout((function(){e.modal("hide")}),1500)})).catch((t=>{i.append($("
    ").prop({innerHTML:t.cause,className:"alert alert-danger",role:"alert"}))})).finally((()=>{e.modal("show")}))}))}))})()})(); \ No newline at end of file +function Lw(t){return getComputedStyle(t)}function jw(t,e){for(var n in e){var i=e[n];"number"==typeof i&&(i+="px"),t.style[n]=i}return t}function Hw(t){var e=document.createElement("div");return e.className=t,e}var Bw="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Fw(t,e){if(!Bw)throw new Error("No element matching method supported");return Bw.call(t,e)}function Ww(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function zw(t,e){return Array.prototype.filter.call(t.children,(function(t){return Fw(t,e)}))}var Vw={main:"ps",rtl:"ps__rtl",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},$w={x:null,y:null};function Uw(t,e){var n=t.element.classList,i=Vw.state.scrolling(e);n.contains(i)?clearTimeout($w[e]):n.add(i)}function qw(t,e){$w[e]=setTimeout((function(){return t.isAlive&&t.element.classList.remove(Vw.state.scrolling(e))}),t.settings.scrollingThreshold)}var Yw=function(t){this.element=t,this.handlers={}},Gw={isEmpty:{configurable:!0}};Yw.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},Yw.prototype.unbind=function(t,e){var n=this;this.handlers[t]=this.handlers[t].filter((function(i){return!(!e||i===e)||(n.element.removeEventListener(t,i,!1),!1)}))},Yw.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},Gw.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every((function(e){return 0===t.handlers[e].length}))},Object.defineProperties(Yw.prototype,Gw);var Xw=function(){this.eventElements=[]};function Qw(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}function Zw(t,e,n,i,r){var s;if(void 0===i&&(i=!0),void 0===r&&(r=!1),"top"===e)s=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");s=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(t,e,n,i,r){var s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],h=n[5];void 0===i&&(i=!0);void 0===r&&(r=!1);var u=t.element;t.reach[l]=null,u[a]<1&&(t.reach[l]="start");u[a]>t[s]-t[o]-1&&(t.reach[l]="end");e&&(u.dispatchEvent(Qw("ps-scroll-"+l)),e<0?u.dispatchEvent(Qw("ps-scroll-"+c)):e>0&&u.dispatchEvent(Qw("ps-scroll-"+h)),i&&function(t,e){Uw(t,e),qw(t,e)}(t,l));t.reach[l]&&(e||r)&&u.dispatchEvent(Qw("ps-"+l+"-reach-"+t.reach[l]))}(t,n,s,i,r)}function Kw(t){return parseInt(t,10)||0}Xw.prototype.eventElement=function(t){var e=this.eventElements.filter((function(e){return e.element===t}))[0];return e||(e=new Yw(t),this.eventElements.push(e)),e},Xw.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},Xw.prototype.unbind=function(t,e,n){var i=this.eventElement(t);i.unbind(e,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)},Xw.prototype.unbindAll=function(){this.eventElements.forEach((function(t){return t.unbindAll()})),this.eventElements=[]},Xw.prototype.once=function(t,e,n){var i=this.eventElement(t),r=function(t){i.unbind(e,r),n(t)};i.bind(e,r)};var Jw={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function tS(t){var e=t.element,n=Math.floor(e.scrollTop),i=e.getBoundingClientRect();t.containerWidth=Math.round(i.width),t.containerHeight=Math.round(i.height),t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(zw(e,Vw.element.rail("x")).forEach((function(t){return Ww(t)})),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(zw(e,Vw.element.rail("y")).forEach((function(t){return Ww(t)})),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),function(t,e){var n={width:e.railXWidth},i=Math.floor(t.scrollTop);e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft;e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-i:n.top=e.scrollbarXTop+i;jw(e.scrollbarXRail,n);var r={top:i,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?r.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:r.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?r.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:r.left=e.scrollbarYLeft+t.scrollLeft;jw(e.scrollbarYRail,r),jw(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),jw(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}(e,t),t.scrollbarXActive?e.classList.add(Vw.state.active("x")):(e.classList.remove(Vw.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=!0===t.isRtl?t.contentWidth:0),t.scrollbarYActive?e.classList.add(Vw.state.active("y")):(e.classList.remove(Vw.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)}function eS(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function nS(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=t.element,d=null,f=null,p=null;function g(e){e.touches&&e.touches[0]&&(e[r]=e.touches[0].pageY),u[l]=d+p*(e[r]-f),Uw(t,c),tS(t),e.stopPropagation(),e.type.startsWith("touch")&&e.changedTouches.length>1&&e.preventDefault()}function m(){qw(t,c),t[h].classList.remove(Vw.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",g)}function v(e,o){d=u[l],o&&e.touches&&(e[r]=e.touches[0].pageY),f=e[r],p=(t[i]-t[n])/(t[s]-t[a]),o?t.event.bind(t.ownerDocument,"touchmove",g):(t.event.bind(t.ownerDocument,"mousemove",g),t.event.once(t.ownerDocument,"mouseup",m),e.preventDefault()),t[h].classList.add(Vw.state.clicking),e.stopPropagation()}t.event.bind(t[o],"mousedown",(function(t){v(t)})),t.event.bind(t[o],"touchstart",(function(t){v(t,!0)}))}var iS={"click-rail":function(t){t.element,t.event.bind(t.scrollbarY,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarYRail,"mousedown",(function(e){var n=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=n*t.containerHeight,tS(t),e.stopPropagation()})),t.event.bind(t.scrollbarX,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarXRail,"mousedown",(function(e){var n=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=n*t.containerWidth,tS(t),e.stopPropagation()}))},"drag-thumb":function(t){nS(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),nS(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",(function(n){if(!(n.isDefaultPrevented&&n.isDefaultPrevented()||n.defaultPrevented)&&(Fw(e,":hover")||Fw(t.scrollbarX,":focus")||Fw(t.scrollbarY,":focus"))){var i,r=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(r){if("IFRAME"===r.tagName)r=r.contentDocument.activeElement;else for(;r.shadowRoot;)r=r.shadowRoot.activeElement;if(Fw(i=r,"input,[contenteditable]")||Fw(i,"select,[contenteditable]")||Fw(i,"textarea,[contenteditable]")||Fw(i,"button,[contenteditable]"))return}var s=0,o=0;switch(n.which){case 37:s=n.metaKey?-t.contentWidth:n.altKey?-t.containerWidth:-30;break;case 38:o=n.metaKey?t.contentHeight:n.altKey?t.containerHeight:30;break;case 39:s=n.metaKey?t.contentWidth:n.altKey?t.containerWidth:30;break;case 40:o=n.metaKey?-t.contentHeight:n.altKey?-t.containerHeight:-30;break;case 32:o=n.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:o=t.containerHeight;break;case 34:o=-t.containerHeight;break;case 36:o=t.contentHeight;break;case 35:o=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==s||t.settings.suppressScrollY&&0!==o||(e.scrollTop-=o,e.scrollLeft+=s,tS(t),function(n,i){var r=Math.floor(e.scrollTop);if(0===n){if(!t.scrollbarYActive)return!1;if(0===r&&i>0||r>=t.contentHeight-t.containerHeight&&i<0)return!t.settings.wheelPropagation}var s=e.scrollLeft;if(0===i){if(!t.scrollbarXActive)return!1;if(0===s&&n<0||s>=t.contentWidth-t.containerWidth&&n>0)return!t.settings.wheelPropagation}return!0}(s,o)&&n.preventDefault())}}))},wheel:function(t){var e=t.element;function n(n){var i=function(t){var e=t.deltaX,n=-1*t.deltaY;return void 0!==e&&void 0!==n||(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!=e&&n!=n&&(e=0,n=t.wheelDelta),t.shiftKey?[-n,-e]:[e,n]}(n),r=i[0],s=i[1];if(!function(t,n,i){if(!Jw.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var r=t;r&&r!==e;){if(r.classList.contains(Vw.element.consuming))return!0;var s=Lw(r);if(i&&s.overflowY.match(/(scroll|auto)/)){var o=r.scrollHeight-r.clientHeight;if(o>0&&(r.scrollTop>0&&i<0||r.scrollTop0))return!0}if(n&&s.overflowX.match(/(scroll|auto)/)){var a=r.scrollWidth-r.clientWidth;if(a>0&&(r.scrollLeft>0&&n<0||r.scrollLeft0))return!0}r=r.parentNode}return!1}(n.target,r,s)){var o=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(s?e.scrollTop-=s*t.settings.wheelSpeed:e.scrollTop+=r*t.settings.wheelSpeed,o=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(r?e.scrollLeft+=r*t.settings.wheelSpeed:e.scrollLeft-=s*t.settings.wheelSpeed,o=!0):(e.scrollTop-=s*t.settings.wheelSpeed,e.scrollLeft+=r*t.settings.wheelSpeed),tS(t),o=o||function(n,i){var r=Math.floor(e.scrollTop),s=0===e.scrollTop,o=r+e.offsetHeight===e.scrollHeight,a=0===e.scrollLeft,l=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(i)>Math.abs(n)?s||o:a||l)||!t.settings.wheelPropagation}(r,s),o&&!n.ctrlKey&&(n.stopPropagation(),n.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",n):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",n)},touch:function(t){if(Jw.supportsTouch||Jw.supportsIePointer){var e=t.element,n={},i=0,r={},s=null;Jw.supportsTouch?(t.event.bind(e,"touchstart",c),t.event.bind(e,"touchmove",h),t.event.bind(e,"touchend",u)):Jw.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",c),t.event.bind(e,"pointermove",h),t.event.bind(e,"pointerup",u)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",c),t.event.bind(e,"MSPointerMove",h),t.event.bind(e,"MSPointerUp",u)))}function o(n,i){e.scrollTop-=i,e.scrollLeft-=n,tS(t)}function a(t){return t.targetTouches?t.targetTouches[0]:t}function l(t){return(!t.pointerType||"pen"!==t.pointerType||0!==t.buttons)&&(!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function c(t){if(l(t)){var e=a(t);n.pageX=e.pageX,n.pageY=e.pageY,i=(new Date).getTime(),null!==s&&clearInterval(s)}}function h(s){if(l(s)){var c=a(s),h={pageX:c.pageX,pageY:c.pageY},u=h.pageX-n.pageX,d=h.pageY-n.pageY;if(function(t,n,i){if(!e.contains(t))return!1;for(var r=t;r&&r!==e;){if(r.classList.contains(Vw.element.consuming))return!0;var s=Lw(r);if(i&&s.overflowY.match(/(scroll|auto)/)){var o=r.scrollHeight-r.clientHeight;if(o>0&&(r.scrollTop>0&&i<0||r.scrollTop0))return!0}if(n&&s.overflowX.match(/(scroll|auto)/)){var a=r.scrollWidth-r.clientWidth;if(a>0&&(r.scrollLeft>0&&n<0||r.scrollLeft0))return!0}r=r.parentNode}return!1}(s.target,u,d))return;o(u,d),n=h;var f=(new Date).getTime(),p=f-i;p>0&&(r.x=u/p,r.y=d/p,i=f),function(n,i){var r=Math.floor(e.scrollTop),s=e.scrollLeft,o=Math.abs(n),a=Math.abs(i);if(a>o){if(i<0&&r===t.contentHeight-t.containerHeight||i>0&&0===r)return 0===window.scrollY&&i>0&&Jw.isChrome}else if(o>a&&(n<0&&s===t.contentWidth-t.containerWidth||n>0&&0===s))return!0;return!0}(u,d)&&s.preventDefault()}}function u(){t.settings.swipeEasing&&(clearInterval(s),s=setInterval((function(){t.isInitialized?clearInterval(s):r.x||r.y?Math.abs(r.x)<.01&&Math.abs(r.y)<.01?clearInterval(s):t.element?(o(30*r.x,30*r.y),r.x*=.8,r.y*=.8):clearInterval(s):clearInterval(s)}),10))}}},rS=function(t,e){var n=this;if(void 0===e&&(e={}),"string"==typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var i in this.element=t,t.classList.add(Vw.main),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},e)this.settings[i]=e[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var r,s,o=function(){return t.classList.add(Vw.state.focus)},a=function(){return t.classList.remove(Vw.state.focus)};this.isRtl="rtl"===Lw(t).direction,!0===this.isRtl&&t.classList.add(Vw.rtl),this.isNegativeScroll=(s=t.scrollLeft,t.scrollLeft=-1,r=t.scrollLeft<0,t.scrollLeft=s,r),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new Xw,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=Hw(Vw.element.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=Hw(Vw.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",o),this.event.bind(this.scrollbarX,"blur",a),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var l=Lw(this.scrollbarXRail);this.scrollbarXBottom=parseInt(l.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Kw(l.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Kw(l.borderLeftWidth)+Kw(l.borderRightWidth),jw(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Kw(l.marginLeft)+Kw(l.marginRight),jw(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Hw(Vw.element.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=Hw(Vw.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",o),this.event.bind(this.scrollbarY,"blur",a),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var c=Lw(this.scrollbarYRail);this.scrollbarYRight=parseInt(c.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Kw(c.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(t){var e=Lw(t);return Kw(e.width)+Kw(e.paddingLeft)+Kw(e.paddingRight)+Kw(e.borderLeftWidth)+Kw(e.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=Kw(c.borderTopWidth)+Kw(c.borderBottomWidth),jw(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Kw(c.marginTop)+Kw(c.marginBottom),jw(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach((function(t){return iS[t](n)})),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",(function(t){return n.onScroll(t)})),tS(this)};rS.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,jw(this.scrollbarXRail,{display:"block"}),jw(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Kw(Lw(this.scrollbarXRail).marginLeft)+Kw(Lw(this.scrollbarXRail).marginRight),this.railYMarginHeight=Kw(Lw(this.scrollbarYRail).marginTop)+Kw(Lw(this.scrollbarYRail).marginBottom),jw(this.scrollbarXRail,{display:"none"}),jw(this.scrollbarYRail,{display:"none"}),tS(this),Zw(this,"top",0,!1,!0),Zw(this,"left",0,!1,!0),jw(this.scrollbarXRail,{display:""}),jw(this.scrollbarYRail,{display:""}))},rS.prototype.onScroll=function(t){this.isAlive&&(tS(this),Zw(this,"top",this.element.scrollTop-this.lastScrollTop),Zw(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},rS.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Ww(this.scrollbarX),Ww(this.scrollbarY),Ww(this.scrollbarXRail),Ww(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},rS.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter((function(t){return!t.match(/^ps([-_].+|)$/)})).join(" ")};const sS=rS;(function(){const t=Bl(".scrollable");t.length>0&&t.each(((t,e)=>{new sS(e)}))})(),Bl(".search-toggle").on("click",(t=>{Bl(".search-box, .search-input").toggleClass("active"),Bl(".search-input input").focus(),t.preventDefault()})),function(){Bl(".sidebar .sidebar-menu li a").on("click",(function(){const t=Bl(this);t.parent().hasClass("open")?t.parent().children(".dropdown-menu").slideUp(200,(()=>{t.parent().removeClass("open")})):(t.parent().parent().children("li.open").children(".dropdown-menu").slideUp(200),t.parent().parent().children("li.open").children("a").removeClass("open"),t.parent().parent().children("li.open").removeClass("open"),t.parent().children(".dropdown-menu").slideDown(200,(()=>{t.parent().addClass("open")})))}));Bl(".sidebar").find(".sidebar-link").each(((t,e)=>{Bl(e).removeClass("active")})).filter((function(){const t=Bl(this).attr("href");return("/"===t[0]?t.substr(1):t)===window.location.pathname.substr(1)})).addClass("active"),Bl(".sidebar-toggle").on("click",(t=>{Bl(".app").toggleClass("is-collapsed"),t.preventDefault()})),Bl("#sidebar-toggle").click((t=>{t.preventDefault(),setTimeout((()=>{window.dispatchEvent(window.EVENT)}),300)}))}();var oS=n(743);const aS=n.n(oS)()(window);(function(){const t=new aS({color:"#ff6849"}),e=["clear-day","clear-night","partly-cloudy-day","partly-cloudy-night","cloudy","rain","sleet","snow","wind","fog"];let n=e.length;for(;n--;){const i=e[n],r=document.getElementsByClassName(i);let s=r.length;for(;s--;)t.set(r[s],i)}t.play()})(),Bl("#chat-sidebar-toggle").on("click",(t=>{Bl("#chat-sidebar").toggleClass("open"),t.preventDefault()}));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.array.find.js"),require("core-js/modules/es.array.find-index.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.array.index-of.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.array.reverse.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.array.sort.js"),require("core-js/modules/es.array.splice.js"),require("core-js/modules/es.date.to-json.js"),require("core-js/modules/es.number.constructor.js"),require("core-js/modules/es.object.assign.js"),require("core-js/modules/es.object.entries.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.parse-float.js"),require("core-js/modules/es.parse-int.js"),require("core-js/modules/es.regexp.constructor.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.string.split.js"),require("core-js/modules/es.string.trim.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("jquery"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.string.ends-with.js"),require("core-js/modules/es.string.match.js"),require("core-js/modules/es.string.starts-with.js")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.array.filter.js","core-js/modules/es.array.find.js","core-js/modules/es.array.find-index.js","core-js/modules/es.array.includes.js","core-js/modules/es.array.index-of.js","core-js/modules/es.array.iterator.js","core-js/modules/es.array.join.js","core-js/modules/es.array.map.js","core-js/modules/es.array.reverse.js","core-js/modules/es.array.slice.js","core-js/modules/es.array.sort.js","core-js/modules/es.array.splice.js","core-js/modules/es.date.to-json.js","core-js/modules/es.number.constructor.js","core-js/modules/es.object.assign.js","core-js/modules/es.object.entries.js","core-js/modules/es.object.keys.js","core-js/modules/es.object.to-string.js","core-js/modules/es.parse-float.js","core-js/modules/es.parse-int.js","core-js/modules/es.regexp.constructor.js","core-js/modules/es.regexp.exec.js","core-js/modules/es.regexp.to-string.js","core-js/modules/es.string.includes.js","core-js/modules/es.string.replace.js","core-js/modules/es.string.search.js","core-js/modules/es.string.split.js","core-js/modules/es.string.trim.js","core-js/modules/web.dom-collections.for-each.js","core-js/modules/web.dom-collections.iterator.js","jquery","core-js/modules/es.object.get-prototype-of.js","core-js/modules/es.string.ends-with.js","core-js/modules/es.string.match.js","core-js/modules/es.string.starts-with.js"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).BootstrapTable=e(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,t.jQuery)}(void 0,(function(t,e,n,i,r,s,o,a,l,c,h,u,d,f,p,g,m,v,b,y,_,x,w,S,C,k,A,E,D,T,M,R){function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw s}}}}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t,e)||F(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||F(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function F(t,e){if(t){if("string"==typeof t)return O(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}var W={getBootstrapVersion:function(){var t=5;try{var e=R.fn.dropdown.Constructor.VERSION;void 0!==e&&(t=parseInt(e,10))}catch(t){}try{var n=bootstrap.Tooltip.VERSION;void 0!==n&&(t=parseInt(n,10))}catch(t){}return t},getIconsPrefix:function(t){return{bootstrap3:"glyphicon",bootstrap4:"fa",bootstrap5:"bi","bootstrap-table":"icon",bulma:"fa",foundation:"fa",materialize:"material-icons",semantic:"fa"}[t]||"fa"},getIcons:function(t){return{glyphicon:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggleOff:"glyphicon-list-alt icon-list-alt",toggleOn:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus",fullscreen:"glyphicon-fullscreen",search:"glyphicon-search",clearSearch:"glyphicon-trash"},fa:{paginationSwitchDown:"fa-caret-square-down",paginationSwitchUp:"fa-caret-square-up",refresh:"fa-sync",toggleOff:"fa-toggle-off",toggleOn:"fa-toggle-on",columns:"fa-th-list",detailOpen:"fa-plus",detailClose:"fa-minus",fullscreen:"fa-arrows-alt",search:"fa-search",clearSearch:"fa-trash"},bi:{paginationSwitchDown:"bi-caret-down-square",paginationSwitchUp:"bi-caret-up-square",refresh:"bi-arrow-clockwise",toggleOff:"bi-toggle-off",toggleOn:"bi-toggle-on",columns:"bi-list-ul",detailOpen:"bi-plus",detailClose:"bi-dash",fullscreen:"bi-arrows-move",search:"bi-search",clearSearch:"bi-trash"},icon:{paginationSwitchDown:"icon-arrow-up-circle",paginationSwitchUp:"icon-arrow-down-circle",refresh:"icon-refresh-cw",toggleOff:"icon-toggle-right",toggleOn:"icon-toggle-right",columns:"icon-list",detailOpen:"icon-plus",detailClose:"icon-minus",fullscreen:"icon-maximize",search:"icon-search",clearSearch:"icon-trash-2"},"material-icons":{paginationSwitchDown:"grid_on",paginationSwitchUp:"grid_off",refresh:"refresh",toggleOff:"tablet",toggleOn:"tablet_android",columns:"view_list",detailOpen:"add",detailClose:"remove",fullscreen:"fullscreen",sort:"sort",search:"search",clearSearch:"delete"}}[t]||{}},getSearchInput:function(t){return"string"==typeof t.options.searchSelector?R(t.options.searchSelector):t.$toolbar.find(".search input")},extend:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;i1?e-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.entries(t).length&&t.constructor===Object},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},getFieldTitle:function(t,e){var n,i=N(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.field===e)return r.title}}catch(t){i.e(t)}finally{i.f()}return""},setFieldIndex:function(t){var e,n=0,i=[],r=N(t[0]);try{for(r.s();!(e=r.n()).done;)n+=e.value.colspan||1}catch(t){r.e(t)}finally{r.f()}for(var s=0;s1){for(var c=0,h=function(t){var e=r.filter((function(e){return e.fieldIndex===t})),n=e[e.length-1];if(e.length>1)for(var i=0;i0}}}catch(t){a.e(t)}finally{a.f()}}}catch(t){s.e(t)}finally{s.f()}if(!(t.length<2)){var d,f=N(e);try{var p=function(){var t=d.value,e=r.filter((function(e){return e.fieldIndex===t.fieldIndex}));if(e.length>1){var n,i=N(e);try{for(i.s();!(n=i.n()).done;)n.value.visible=t.visible}catch(t){i.e(t)}finally{i.f()}}};for(f.s();!(d=f.n()).done;)p()}catch(t){f.e(t)}finally{f.f()}}},getScrollBarWidth:function(){if(void 0===this.cachedWidth){var t=R("
    ").addClass("fixed-table-scroll-inner"),e=R("
    ").addClass("fixed-table-scroll-outer");e.append(t),R("body").append(e);var n=t[0].offsetWidth;e.css("overflow","scroll");var i=t[0].offsetWidth;n===i&&(i=e[0].clientWidth),e.remove(),this.cachedWidth=n-i}return this.cachedWidth},calculateObjectValue:function(t,e,n,i){var r=e;if("string"==typeof e){var s=e.split(".");if(s.length>1){r=window;var o,a=N(s);try{for(a.s();!(o=a.n()).done;)r=r[o.value]}catch(t){a.e(t)}finally{a.f()}}else r=window[e]}return null!==r&&"object"===B(r)?r:"function"==typeof r?r.apply(t,n||[]):!r&&"string"==typeof e&&n&&this.sprintf.apply(this,[e].concat(j(n)))?this.sprintf.apply(this,[e].concat(j(n))):i},compareObjects:function(t,e,n){var i=Object.keys(t),r=Object.keys(e);if(n&&i.length!==r.length)return!1;for(var s=0,o=i;s/g,">").replace(/"/g,""").replace(/'/g,"'"):t},unescapeHTML:function(t){return"string"==typeof t&&t?t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'"):t},removeHTML:function(t){return t?t.toString().replace(/(<([^>]+)>)/gi,"").replace(/&[#A-Za-z0-9]+;/gi,"").trim():t},getRealDataAttr:function(t){for(var e=0,n=Object.entries(t);e3&&void 0!==arguments[3]?arguments[3]:void 0,r=t;if(void 0!==i&&(n=i),"string"!=typeof e||t.hasOwnProperty(e))return n?this.escapeHTML(t[e]):t[e];var s,o=N(e.split("."));try{for(o.s();!(s=o.n()).done;){var a=s.value;r=r&&r[a]}}catch(t){o.e(t)}finally{o.f()}return n?this.escapeHTML(r):r},isIEBrowser:function(){return navigator.userAgent.includes("MSIE ")||/Trident.*rv:11\./.test(navigator.userAgent)},findIndex:function(t,e){var n,i=N(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(JSON.stringify(r)===JSON.stringify(e))return t.indexOf(r)}}catch(t){i.e(t)}finally{i.f()}return-1},trToData:function(t,e){var n=this,i=[],r=[];return e.each((function(e,s){var o=R(s),a={};a._id=o.attr("id"),a._class=o.attr("class"),a._data=n.getRealDataAttr(o.data()),a._style=o.attr("style"),o.find(">td,>th").each((function(i,s){for(var o=R(s),l=+o.attr("colspan")||1,c=+o.attr("rowspan")||1,h=i;r[e]&&r[e][h];h++);for(var u=h;ue?n:0;if(i.sortEmptyLast){if(""===t)return 1;if(""===e)return-1}return t===e?0:("string"!=typeof t&&(t=t.toString()),-1===t.localeCompare(e)?-1*n:n)},getEventName:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=e||"".concat(+new Date).concat(~~(1e6*Math.random())),"".concat(t,"-").concat(e)},hasDetailViewIcon:function(t){return t.detailView&&t.detailViewIcon&&!t.cardView},getDetailViewIndexOffset:function(t){return this.hasDetailViewIcon(t)&&"right"!==t.detailViewAlign?1:0},checkAutoMergeCells:function(t){var e,n=N(t);try{for(n.s();!(e=n.n()).done;)for(var i=e.value,r=0,s=Object.keys(i);r',""],toolbarDropdownItem:'',toolbarDropdownSeparator:'
  • ',pageDropdown:['"],pageDropdownItem:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}},4:{classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",select:"form-control",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s
    %s
    ',searchInput:'',searchButton:'',searchClearButton:''}},5:{classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",select:"form-select",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{dataToggle:"data-bs-toggle",toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}}}[z],$={height:void 0,classes:"table table-bordered table-hover",buttons:{},theadClasses:"",headerStyle:function(t){return{}},rowStyle:function(t,e){return{}},rowAttributes:function(t,e){return{}},undefinedText:"-",locale:void 0,virtualScroll:!1,virtualScrollItemHeight:void 0,sortable:!0,sortClass:void 0,silentSort:!0,sortEmptyLast:!1,sortName:void 0,sortOrder:void 0,sortReset:!1,sortStable:!1,sortResetPage:!1,rememberOrder:!1,serverSort:!0,customSort:void 0,columns:[[]],data:[],url:void 0,method:"get",cache:!0,contentType:"application/json",dataType:"json",ajax:void 0,ajaxOptions:{},queryParams:function(t){return t},queryParamsType:"limit",responseHandler:function(t){return t},totalField:"total",totalNotFilteredField:"totalNotFiltered",dataField:"rows",footerField:"footer",pagination:!1,paginationParts:["pageInfo","pageSize","pageList"],showExtendedPagination:!1,paginationLoop:!0,sidePagination:"client",totalRows:0,totalNotFiltered:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"‹",paginationNextText:"›",paginationSuccessivelySize:5,paginationPagesBySide:1,paginationUseIntermediate:!1,paginationLoadMore:!1,search:!1,searchable:!1,searchHighlight:!1,searchOnEnterKey:!1,strictSearch:!1,regexSearch:!1,searchSelector:!1,visibleSearch:!1,showButtonIcons:!0,showButtonText:!1,showSearchButton:!1,showSearchClearButton:!1,trimOnSearch:!0,searchAlign:"right",searchTimeOut:500,searchText:"",customSearch:void 0,showHeader:!0,showFooter:!1,footerStyle:function(t){return{}},searchAccentNeutralise:!1,showColumns:!1,showColumnsToggleAll:!1,showColumnsSearch:!1,minimumCountColumns:1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,showFullscreen:!1,smartDisplay:!0,escape:!1,escapeTitle:!0,filterOptions:{filterAlgorithm:"and"},idField:void 0,selectItemName:"btSelectItem",clickToSelect:!1,ignoreClickToSelectOn:function(t){var e=t.tagName;return["A","BUTTON"].includes(e)},singleSelect:!1,checkboxHeader:!0,maintainMetaData:!1,multipleSelectRow:!1,uniqueId:void 0,cardView:!1,detailView:!1,detailViewIcon:!0,detailViewByClick:!1,detailViewAlign:"left",detailFormatter:function(t,e){return""},detailFilter:function(t,e){return!0},toolbar:void 0,toolbarAlign:"left",buttonsToolbar:void 0,buttonsAlign:"right",buttonsOrder:["paginationSwitch","refresh","toggle","fullscreen","columns"],buttonsPrefix:V.classes.buttonsPrefix,buttonsClass:V.classes.buttons,iconsPrefix:void 0,icons:{},iconSize:void 0,fixedScroll:!1,loadingFontSize:"auto",loadingTemplate:function(t){return'\n '.concat(t,'\n \n \n ')},onAll:function(t,e){return!1},onClickCell:function(t,e,n,i){return!1},onDblClickCell:function(t,e,n,i){return!1},onClickRow:function(t,e){return!1},onDblClickRow:function(t,e){return!1},onSort:function(t,e){return!1},onCheck:function(t){return!1},onUncheck:function(t){return!1},onCheckAll:function(t){return!1},onUncheckAll:function(t){return!1},onCheckSome:function(t){return!1},onUncheckSome:function(t){return!1},onLoadSuccess:function(t){return!1},onLoadError:function(t){return!1},onColumnSwitch:function(t,e){return!1},onColumnSwitchAll:function(t){return!1},onPageChange:function(t,e){return!1},onSearch:function(t){return!1},onToggle:function(t){return!1},onPreBody:function(t){return!1},onPostBody:function(){return!1},onPostHeader:function(){return!1},onPostFooter:function(){return!1},onExpandRow:function(t,e,n){return!1},onCollapseRow:function(t,e){return!1},onRefreshOptions:function(t){return!1},onRefresh:function(t){return!1},onResetView:function(){return!1},onScrollBody:function(){return!1},onTogglePagination:function(t){return!1},onVirtualScroll:function(t,e){return!1}},U={formatLoadingMessage:function(){return"Loading, please wait"},formatRecordsPerPage:function(t){return"".concat(t," rows per page")},formatShowingRows:function(t,e,n,i){return void 0!==i&&i>0&&i>n?"Showing ".concat(t," to ").concat(e," of ").concat(n," rows (filtered from ").concat(i," total rows)"):"Showing ".concat(t," to ").concat(e," of ").concat(n," rows")},formatSRPaginationPreText:function(){return"previous page"},formatSRPaginationPageText:function(t){return"to page ".concat(t)},formatSRPaginationNextText:function(){return"next page"},formatDetailPagination:function(t){return"Showing ".concat(t," rows")},formatSearch:function(){return"Search"},formatClearSearch:function(){return"Clear Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatPaginationSwitchDown:function(){return"Show pagination"},formatPaginationSwitchUp:function(){return"Hide pagination"},formatRefresh:function(){return"Refresh"},formatToggleOn:function(){return"Show card view"},formatToggleOff:function(){return"Hide card view"},formatColumns:function(){return"Columns"},formatColumnsToggleAll:function(){return"Toggle all"},formatFullscreen:function(){return"Fullscreen"},formatAllRows:function(){return"All"}};Object.assign($,U);var q={VERSION:"1.23.0",THEME:"bootstrap".concat(z),CONSTANTS:V,DEFAULTS:$,COLUMN_DEFAULTS:{field:void 0,title:void 0,titleTooltip:void 0,class:void 0,width:void 0,widthUnit:"px",rowspan:void 0,colspan:void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,cellStyle:void 0,radio:!1,checkbox:!1,checkboxEnabled:!0,clickToSelect:!0,showSelectTitle:!1,sortable:!1,sortName:void 0,order:"asc",sorter:void 0,visible:!0,switchable:!0,switchableLabel:void 0,cardVisible:!0,searchable:!0,formatter:void 0,footerFormatter:void 0,footerStyle:void 0,detailFormatter:void 0,searchFormatter:!0,searchHighlightFormatter:!1,escape:void 0,events:void 0},METHODS:["getOptions","refreshOptions","getData","getSelections","load","append","prepend","remove","removeAll","insertRow","updateRow","getRowByUniqueId","updateByUniqueId","removeByUniqueId","updateCell","updateCellByUniqueId","showRow","hideRow","getHiddenRows","showColumn","hideColumn","getVisibleColumns","getHiddenColumns","showAllColumns","hideAllColumns","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","destroy","resetView","showLoading","hideLoading","togglePagination","toggleFullscreen","toggleView","resetSearch","filterBy","sortBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","toggleDetailView","expandRow","collapseRow","expandRowByUniqueId","collapseRowByUniqueId","expandAllRows","collapseAllRows","updateColumnTitle","updateFormatText"],EVENTS:{"all.bs.table":"onAll","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","column-switch-all.bs.table":"onColumnSwitchAll","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","post-footer.bs.table":"onPostFooter","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh","scroll-body.bs.table":"onScrollBody","toggle-pagination.bs.table":"onTogglePagination","virtual-scroll.bs.table":"onVirtualScroll"},LOCALES:{en:U,"en-US":U}},Y=P((function t(e){var n=this;I(this,t),this.rows=e.rows,this.scrollEl=e.scrollEl,this.contentEl=e.contentEl,this.callback=e.callback,this.itemHeight=e.itemHeight,this.cache={},this.scrollTop=this.scrollEl.scrollTop,this.initDOM(this.rows,e.fixedScroll),this.scrollEl.scrollTop=this.scrollTop,this.lastCluster=0;var i=function(){n.lastCluster!==(n.lastCluster=n.getNum())&&(n.initDOM(n.rows),n.callback(n.startIndex,n.endIndex))};this.scrollEl.addEventListener("scroll",i,!1),this.destroy=function(){n.contentEl.innerHtml="",n.scrollEl.removeEventListener("scroll",i,!1)}}),[{key:"initDOM",value:function(t,e){void 0===this.clusterHeight?(this.cache.scrollTop=this.scrollEl.scrollTop,this.cache.data=this.contentEl.innerHTML=t[0]+t[0]+t[0],this.getRowsHeight(t)):0===this.blockHeight&&this.getRowsHeight(t);var n=this.initData(t,this.getNum(e)),i=n.rows.join(""),r=this.checkChanges("data",i),s=this.checkChanges("top",n.topOffset),o=this.checkChanges("bottom",n.bottomOffset),a=[];r&&s?(n.topOffset&&a.push(this.getExtra("top",n.topOffset)),a.push(i),n.bottomOffset&&a.push(this.getExtra("bottom",n.bottomOffset)),this.startIndex=n.start,this.endIndex=n.end,this.contentEl.innerHTML=a.join(""),e&&(this.contentEl.scrollTop=this.cache.scrollTop)):o&&(this.contentEl.lastChild.style.height="".concat(n.bottomOffset,"px"))}},{key:"getRowsHeight",value:function(){if(void 0===this.itemHeight||0===this.itemHeight){var t=this.contentEl.children,e=t[Math.floor(t.length/2)];this.itemHeight=e.offsetHeight}this.blockHeight=50*this.itemHeight,this.clusterRows=200,this.clusterHeight=4*this.blockHeight}},{key:"getNum",value:function(t){return this.scrollTop=t?this.cache.scrollTop:this.scrollEl.scrollTop,Math.floor(this.scrollTop/(this.clusterHeight-this.blockHeight))||0}},{key:"initData",value:function(t,e){if(t.length<50)return{topOffset:0,bottomOffset:0,rowsAbove:0,rows:t};var n=Math.max((this.clusterRows-50)*e,0),i=n+this.clusterRows,r=Math.max(n*this.itemHeight,0),s=Math.max((t.length-i)*this.itemHeight,0),o=[],a=n;r<1&&a++;for(var l=n;l
    ':"",e=["bottom","both"].includes(this.options.paginationVAlign)?'
    ':"",n=W.calculateObjectValue(this.options,this.options.loadingTemplate,[this.options.formatLoadingMessage()]);this.$container=R('\n
    \n
    \n ').concat(t,'\n
    \n
    \n
    \n
    \n ').concat(n,'\n
    \n
    \n \n
    \n ').concat(e,"\n
    \n ")),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find(".fixed-table-container"),this.$tableHeader=this.$container.find(".fixed-table-header"),this.$tableBody=this.$container.find(".fixed-table-body"),this.$tableLoading=this.$container.find(".fixed-table-loading"),this.$tableFooter=this.$el.find("tfoot"),this.options.buttonsToolbar?this.$toolbar=R("body").find(this.options.buttonsToolbar):this.$toolbar=this.$container.find(".fixed-table-toolbar"),this.$pagination=this.$container.find(".fixed-table-pagination"),this.$tableBody.append(this.$el),this.$container.after('
    '),this.$el.addClass(this.options.classes),this.$tableLoading.addClass(this.options.classes),this.options.height&&(this.$tableContainer.addClass("fixed-height"),this.options.showFooter&&this.$tableContainer.addClass("has-footer"),this.options.classes.split(" ").includes("table-bordered")&&(this.$tableBody.append('
    '),this.$tableBorder=this.$tableBody.find(".fixed-table-border"),this.$tableLoading.addClass("fixed-table-border")),this.$tableFooter=this.$container.find(".fixed-table-footer"))}},{key:"initTable",value:function(){var e=this,n=[];if(this.$header=this.$el.find(">thead"),this.$header.length?this.options.theadClasses&&this.$header.addClass(this.options.theadClasses):this.$header=R('')).appendTo(this.$el),this._headerTrClasses=[],this._headerTrStyles=[],this.$header.find("tr").each((function(t,i){var r=R(i),s=[];r.find("th").each((function(t,e){var n=R(e);void 0!==n.data("field")&&n.data("field","".concat(n.data("field")));var i=Object.assign({},n.data());for(var r in i)R.fn.bootstrapTable.columnDefaults.hasOwnProperty(r)&&delete i[r];s.push(W.extend({},{_data:W.getRealDataAttr(i),title:n.html(),class:n.attr("class"),titleTooltip:n.attr("title"),rowspan:n.attr("rowspan")?+n.attr("rowspan"):void 0,colspan:n.attr("colspan")?+n.attr("colspan"):void 0},n.data()))})),n.push(s),r.attr("class")&&e._headerTrClasses.push(r.attr("class")),r.attr("style")&&e._headerTrStyles.push(r.attr("style"))})),Array.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=W.extend(!0,[],n,this.options.columns),this.columns=[],this.fieldsColumnsIndex=[],W.setFieldIndex(this.options.columns),this.options.columns.forEach((function(n,i){n.forEach((function(n,r){var s=W.extend({},t.COLUMN_DEFAULTS,n,{passed:n});void 0!==s.fieldIndex&&(e.columns[s.fieldIndex]=s,e.fieldsColumnsIndex[s.field]=s.fieldIndex),e.options.columns[i][r]=s}))})),!this.options.data.length){var i=W.trToData(this.columns,this.$el.find(">tbody>tr"));i.length&&(this.options.data=i,this.fromHtml=!0)}this.options.pagination&&"server"!==this.options.sidePagination||(this.footerData=W.trToData(this.columns,this.$el.find(">tfoot>tr"))),this.footerData&&this.$el.find("tfoot").html(""),!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()}},{key:"initHeader",value:function(){var t=this,e={},n=[];this.header={fields:[],styles:[],classes:[],formatters:[],detailFormatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]},W.updateFieldGroup(this.options.columns,this.columns),this.options.columns.forEach((function(i,r){var s=[];s.push(""));var o="";if(0===r&&W.hasDetailViewIcon(t.options)){var a=t.options.columns.length>1?' rowspan="'.concat(t.options.columns.length,'"'):"";o='\n
    \n ')}o&&"right"!==t.options.detailViewAlign&&s.push(o),i.forEach((function(n,i){var o=W.sprintf(' class="%s"',n.class),a=n.widthUnit,l=parseFloat(n.width),c=n.halign?n.halign:n.align,h=W.sprintf("text-align: %s; ",c),u=W.sprintf("text-align: %s; ",n.align),d=W.sprintf("vertical-align: %s; ",n.valign);if(d+=W.sprintf("width: %s; ",!n.checkbox&&!n.radio||l?l?l+a:void 0:n.showSelectTitle?void 0:"36px"),void 0!==n.fieldIndex||n.visible){var f=W.calculateObjectValue(null,t.options.headerStyle,[n]),p=[],g=[],m="";if(f&&f.css)for(var v=0,b=Object.entries(f.css);v0)for(var w=0,S=Object.entries(n._data);w0?" data-not-first-th":"",g.length>0?g.join(" "):"",">"),s.push(W.sprintf('
    ',t.options.sortable&&n.sortable?"sortable".concat("center"===c?" sortable-center":""," both"):""));var E=t.options.escape&&t.options.escapeTitle?W.escapeHTML(n.title):n.title,D=E;n.checkbox&&(E="",!t.options.singleSelect&&t.options.checkboxHeader&&(E=''),t.header.stateField=n.field),n.radio&&(E="",t.header.stateField=n.field),!E&&n.showSelectTitle&&(E+=D),s.push(E),s.push("
    "),s.push('
    '),s.push("
    "),s.push("")}})),o&&"right"===t.options.detailViewAlign&&s.push(o),s.push(""),s.length>3&&n.push(s.join(""))})),this.$header.html(n.join("")),this.$header.find("th[data-field]").each((function(t,n){R(n).data(e[R(n).data("field")])})),this.$container.off("click",".th-inner").on("click",".th-inner",(function(e){var n=R(e.currentTarget);if(t.options.detailView&&!n.parent().hasClass("bs-checkbox")&&n.closest(".bootstrap-table")[0]!==t.$container[0])return!1;t.options.sortable&&n.parent().data().sortable&&t.onSort(e)}));var i=W.getEventName("resize.bootstrap-table",this.$el.attr("id"));R(window).off(i),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css("top",this.$header.outerHeight()+1),this.getCaret(),R(window).on(i,(function(){return t.resetView()}))),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off("click").on("click",(function(e){e.stopPropagation();var n=R(e.currentTarget).prop("checked");t[n?"checkAll":"uncheckAll"](),t.updateSelected()}))}},{key:"initData",value:function(t,e){"append"===e?this.options.data=this.options.data.concat(t):"prepend"===e?this.options.data=[].concat(t).concat(this.options.data):(t=t||W.deepCopy(this.options.data),this.options.data=Array.isArray(t)?t:t[this.options.dataField]),this.data=j(this.options.data),this.options.sortReset&&(this.unsortedData=j(this.data)),"server"!==this.options.sidePagination&&this.initSort()}},{key:"initSort",value:function(){var t=this,e=this.options.sortName,n="desc"===this.options.sortOrder?-1:1,i=this.header.fields.indexOf(this.options.sortName),r=0;-1!==i?(this.options.sortStable&&this.data.forEach((function(t,e){t.hasOwnProperty("_position")||(t._position=e)})),this.options.customSort?W.calculateObjectValue(this.options,this.options.customSort,[this.options.sortName,this.options.sortOrder,this.data]):this.data.sort((function(r,s){t.header.sortNames[i]&&(e=t.header.sortNames[i]);var o=W.getItemField(r,e,t.options.escape),a=W.getItemField(s,e,t.options.escape),l=W.calculateObjectValue(t.header,t.header.sorters[i],[o,a,r,s]);return void 0!==l?t.options.sortStable&&0===l?n*(r._position-s._position):n*l:W.sort(o,a,n,t.options,r._position,s._position)})),void 0!==this.options.sortClass&&(clearTimeout(r),r=setTimeout((function(){t.$el.removeClass(t.options.sortClass);var e=t.$header.find('[data-field="'.concat(t.options.sortName,'"]')).index();t.$el.find("tr td:nth-child(".concat(e+1,")")).addClass(t.options.sortClass)}),250))):this.options.sortReset&&(this.data=j(this.unsortedData))}},{key:"sortBy",value:function(t){this.options.sortName=t.field,this.options.sortOrder=t.hasOwnProperty("sortOrder")?t.sortOrder:"asc",this._sort()}},{key:"onSort",value:function(t){var e=t.type,n=t.currentTarget,i="keypress"===e?R(n):R(n).parent(),r=this.$header.find("th").eq(i.index());if(this.$header.add(this.$header_).find("span.order").remove(),this.options.sortName===i.data("field")){var s=this.options.sortOrder,o=this.columns[this.fieldsColumnsIndex[i.data("field")]].sortOrder||this.columns[this.fieldsColumnsIndex[i.data("field")]].order;void 0===s?this.options.sortOrder="asc":"asc"===s?this.options.sortOrder=this.options.sortReset?"asc"===o?"desc":void 0:"desc":"desc"===this.options.sortOrder&&(this.options.sortOrder=this.options.sortReset?"desc"===o?"asc":void 0:"asc"),void 0===this.options.sortOrder&&(this.options.sortName=void 0)}else this.options.sortName=i.data("field"),this.options.rememberOrder?this.options.sortOrder="asc"===i.data("order")?"desc":"asc":this.options.sortOrder=this.columns[this.fieldsColumnsIndex[i.data("field")]].sortOrder||this.columns[this.fieldsColumnsIndex[i.data("field")]].order;i.add(r).data("order",this.options.sortOrder),this.getCaret(),this._sort()}},{key:"_sort",value:function(){if("server"===this.options.sidePagination&&this.options.serverSort)return this.options.pageNumber=1,this.trigger("sort",this.options.sortName,this.options.sortOrder),void this.initServer(this.options.silentSort);this.options.pagination&&this.options.sortResetPage&&(this.options.pageNumber=1,this.initPagination()),this.trigger("sort",this.options.sortName,this.options.sortOrder),this.initSort(),this.initBody()}},{key:"initToolbar",value:function(){var t,e=this,n=this.options,i=[],r=0,s=0;this.$toolbar.find(".bs-bars").children().length&&R("body").append(R(n.toolbar)),this.$toolbar.html(""),"string"!=typeof n.toolbar&&"object"!==B(n.toolbar)||R(W.sprintf('
    ',this.constants.classes.pull,n.toolbarAlign)).appendTo(this.$toolbar).append(R(n.toolbar)),i=['
    ')],"string"==typeof n.buttonsOrder&&(n.buttonsOrder=n.buttonsOrder.replace(/\[|\]| |'/g,"").split(",")),this.buttons=Object.assign(this.buttons,{paginationSwitch:{text:n.pagination?n.formatPaginationSwitchUp():n.formatPaginationSwitchDown(),icon:n.pagination?n.icons.paginationSwitchDown:n.icons.paginationSwitchUp,render:!1,event:this.togglePagination,attributes:{"aria-label":n.formatPaginationSwitch(),title:n.formatPaginationSwitch()}},refresh:{text:n.formatRefresh(),icon:n.icons.refresh,render:!1,event:this.refresh,attributes:{"aria-label":n.formatRefresh(),title:n.formatRefresh()}},toggle:{text:n.formatToggleOn(),icon:n.icons.toggleOff,render:!1,event:this.toggleView,attributes:{"aria-label":n.formatToggleOn(),title:n.formatToggleOn()}},fullscreen:{text:n.formatFullscreen(),icon:n.icons.fullscreen,render:!1,event:this.toggleFullscreen,attributes:{"aria-label":n.formatFullscreen(),title:n.formatFullscreen()}},columns:{render:!1,html:function(){var t=[];if(t.push('
    \n \n ").concat(e.constants.html.toolbarDropdown[0])),n.showColumnsSearch&&(t.push(W.sprintf(e.constants.html.toolbarDropdownItem,W.sprintf('',e.constants.classes.input,n.formatSearch()))),t.push(e.constants.html.toolbarDropdownSeparator)),n.showColumnsToggleAll){var i=e.getVisibleColumns().length===e.columns.filter((function(t){return!e.isSelectionColumn(t)})).length;t.push(W.sprintf(e.constants.html.toolbarDropdownItem,W.sprintf(' %s',i?'checked="checked"':"",n.formatColumnsToggleAll()))),t.push(e.constants.html.toolbarDropdownSeparator)}var r=0;return e.columns.forEach((function(t){t.visible&&r++})),e.columns.forEach((function(i,o){if(!e.isSelectionColumn(i)&&(!n.cardView||i.cardVisible)){var a=i.visible?' checked="checked"':"",l=r<=n.minimumCountColumns&&a?' disabled="disabled"':"";i.switchable&&(t.push(W.sprintf(e.constants.html.toolbarDropdownItem,W.sprintf(' %s',i.field,o,a,l,i.switchableLabel||i.title))),s++)}})),t.push(e.constants.html.toolbarDropdown[1],"
    "),t.join("")}}});for(var o={},a=0,l=Object.entries(this.buttons);a"}o[h]=d;var y="show".concat(h.charAt(0).toUpperCase()).concat(h.substring(1)),_=n[y];!(!u.hasOwnProperty("render")||u.hasOwnProperty("render")&&u.render)||void 0!==_&&!0!==_||(n[y]=!0),n.buttonsOrder.includes(h)||n.buttonsOrder.push(h)}var x,w=N(n.buttonsOrder);try{for(w.s();!(x=w.n()).done;){var S=x.value;n["show".concat(S.charAt(0).toUpperCase()).concat(S.substring(1))]&&i.push(o[S])}}catch(t){w.e(t)}finally{w.f()}i.push("
    "),(this.showToolbar||i.length>2)&&this.$toolbar.append(i.join(""));for(var C=function(){var t=L(A[k],2),n=t[0],i=t[1];if(i.hasOwnProperty("event")){if("function"==typeof i.event||"string"==typeof i.event){var r="string"==typeof i.event?window[i.event]:i.event;return e.$toolbar.find('button[name="'.concat(n,'"]')).off("click").on("click",(function(){return r.call(e)})),1}for(var s=function(){var t=L(a[o],2),i=t[0],r=t[1],s="string"==typeof r?window[r]:r;e.$toolbar.find('button[name="'.concat(n,'"]')).off(i).on(i,(function(){return s.call(e)}))},o=0,a=Object.entries(i.event);o'),H=j;if(n.showSearchButton||n.showSearchClearButton){var F=(n.showSearchButton?I:"")+(n.showSearchClearButton?P:"");H=n.search?W.sprintf(this.constants.html.inputGroup,j,F):F}i.push(W.sprintf('\n
    \n %s\n
    \n '),H)),this.$toolbar.append(i.join(""));var z=W.getSearchInput(this);n.showSearchButton?(this.$toolbar.find(".search button[name=search]").off("click").on("click",(function(){clearTimeout(r),r=setTimeout((function(){e.onSearch({currentTarget:z})}),n.searchTimeOut)})),n.searchOnEnterKey&&O(z)):O(z),n.showSearchClearButton&&this.$toolbar.find(".search button[name=clearSearch]").click((function(){e.resetSearch()}))}else"string"==typeof n.searchSelector&&O(W.getSearchInput(this))}},{key:"onSearch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.currentTarget,n=t.firedByInitSearchText,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0!==e&&R(e).length&&i){var r=R(e).val().trim();if(this.options.trimOnSearch&&R(e).val()!==r&&R(e).val(r),this.searchText===r)return;var s=W.getSearchInput(this),o=e instanceof jQuery?e:R(e);(o.is(s)||o.hasClass("search-input"))&&(this.searchText=r,this.options.searchText=r)}n||(this.options.pageNumber=1),this.initSearch(),n?"client"===this.options.sidePagination&&this.updatePagination():this.updatePagination(),this.trigger("search",this.searchText)}},{key:"initSearch",value:function(){var t=this;if(this.filterOptions=this.filterOptions||this.options.filterOptions,"server"!==this.options.sidePagination){if(this.options.customSearch)return this.data=W.calculateObjectValue(this.options,this.options.customSearch,[this.options.data,this.searchText,this.filterColumns]),this.options.sortReset&&(this.unsortedData=j(this.data)),void this.initSort();var e=this.searchText&&(this.fromHtml?W.escapeHTML(this.searchText):this.searchText),n=e?e.toLowerCase():"",i=W.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.options.searchAccentNeutralise&&(n=W.normalizeAccent(n)),"function"==typeof this.filterOptions.filterAlgorithm?this.data=this.options.data.filter((function(e){return t.filterOptions.filterAlgorithm.apply(null,[e,i])})):"string"==typeof this.filterOptions.filterAlgorithm&&(this.data=i?this.options.data.filter((function(e){var n=t.filterOptions.filterAlgorithm;if("and"===n){for(var r in i)if(Array.isArray(i[r])&&!i[r].includes(e[r])||!Array.isArray(i[r])&&e[r]!==i[r])return!1}else if("or"===n){var s=!1;for(var o in i)(Array.isArray(i[o])&&i[o].includes(e[o])||!Array.isArray(i[o])&&e[o]===i[o])&&(s=!0);return s}return!0})):j(this.options.data));var r=this.getVisibleFields();this.data=n?this.data.filter((function(i,s){for(var o=0;o|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm.exec(t.searchText),f=!1;if(d){var p=d[1]||"".concat(d[5],"l"),g=d[2]||d[3],m=parseInt(c,10),v=parseInt(g,10);switch(p){case">":case"v;break;case"<":case">l":f=m=l":case"=>l":f=m<=v;break;case">=":case"=>":case"<=l":case"==v}}if(f||"".concat(c).toLowerCase().includes(n))return!0}}return!1})):this.data,this.options.sortReset&&(this.unsortedData=j(this.data)),this.initSort()}}},{key:"initPagination",value:function(){var t=this,e=this.options;if(e.pagination){this.$pagination.show();var n,i,r,s,o,a,l,c=[],h=!1,u=this.getData({includeHiddenRows:!1}),d=e.pageList;if("string"==typeof d&&(d=d.replace(/\[|\]| /g,"").toLowerCase().split(",")),d=d.map((function(t){return"string"==typeof t?t.toLowerCase()===e.formatAllRows().toLowerCase()||["all","unlimited"].includes(t.toLowerCase())?e.formatAllRows():+t:t})),this.paginationParts=e.paginationParts,"string"==typeof this.paginationParts&&(this.paginationParts=this.paginationParts.replace(/\[|\]| |'/g,"").split(",")),"server"!==e.sidePagination&&(e.totalRows=u.length),this.totalPages=0,e.totalRows&&(e.pageSize===e.formatAllRows()&&(e.pageSize=e.totalRows,h=!0),this.totalPages=1+~~((e.totalRows-1)/e.pageSize),e.totalPages=this.totalPages),this.totalPages>0&&e.pageNumber>this.totalPages&&(e.pageNumber=this.totalPages),this.pageFrom=(e.pageNumber-1)*e.pageSize+1,this.pageTo=e.pageNumber*e.pageSize,this.pageTo>e.totalRows&&(this.pageTo=e.totalRows),this.options.pagination&&"server"!==this.options.sidePagination&&(this.options.totalNotFiltered=this.options.data.length),this.options.showExtendedPagination||(this.options.totalNotFiltered=void 0),(this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))&&c.push('
    ')),this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")){var f=this.options.totalRows+("client"===this.options.sidePagination&&this.options.paginationLoadMore&&!this._paginationLoaded?" +":""),p=this.paginationParts.includes("pageInfoShort")?e.formatDetailPagination(f):e.formatShowingRows(this.pageFrom,this.pageTo,f,e.totalNotFiltered);c.push('\n '.concat(p,"\n "))}if(this.paginationParts.includes("pageSize")){c.push('
    ');var g=['
    \n \n ").concat(this.constants.html.pageDropdown[0])];d.forEach((function(n,i){var r;(!e.smartDisplay||0===i||d[i-1]")),c.push(e.formatRecordsPerPage(g.join("")))}if((this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))&&c.push("
    "),this.paginationParts.includes("pageList")){c.push('
    '),W.sprintf(this.constants.html.pagination[0],W.sprintf(" pagination-%s",e.iconSize)),W.sprintf(this.constants.html.paginationItem," page-pre",e.formatSRPaginationPreText(),e.paginationPreText)),this.totalPagesthis.totalPages-i&&(i=i-(e.paginationSuccessivelySize-(this.totalPages-i))+1),i<1&&(i=1),r>this.totalPages&&(r=this.totalPages);var m=Math.round(e.paginationPagesBySide/2),v=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return W.sprintf(t.constants.html.paginationItem,i+(n===e.pageNumber?" ".concat(t.constants.classes.paginationActive):""),e.formatSRPaginationPageText(n),n)};if(i>1){var b=e.paginationPagesBySide;for(b>=i&&(b=i-1),n=1;n<=b;n++)c.push(v(n));i-1===b+1?(n=i-1,c.push(v(n))):i-1>b&&(i-2*e.paginationPagesBySide>e.paginationPagesBySide&&e.paginationUseIntermediate?(n=Math.round((i-m)/2+m),c.push(v(n," page-intermediate"))):c.push(W.sprintf(this.constants.html.paginationItem," page-first-separator disabled","","...")))}for(n=i;n<=r;n++)c.push(v(n));if(this.totalPages>r){var y=this.totalPages-(e.paginationPagesBySide-1);for(r>=y&&(y=r+1),r+1===y-1?(n=r+1,c.push(v(n))):y>r+1&&(this.totalPages-r>2*e.paginationPagesBySide&&e.paginationUseIntermediate?(n=Math.round((this.totalPages-m-r)/2+r),c.push(v(n," page-intermediate"))):c.push(W.sprintf(this.constants.html.paginationItem," page-last-separator disabled","","..."))),n=y;n<=this.totalPages;n++)c.push(v(n))}c.push(W.sprintf(this.constants.html.paginationItem," page-next",e.formatSRPaginationNextText(),e.paginationNextText)),c.push(this.constants.html.pagination[1],"
    ")}this.$pagination.html(c.join(""));var _=["bottom","both"].includes(e.paginationVAlign)?" ".concat(this.constants.classes.dropup):"";this.$pagination.last().find(".page-list > div").addClass(_),e.onlyInfoPagination||(s=this.$pagination.find(".page-list a"),o=this.$pagination.find(".page-pre"),a=this.$pagination.find(".page-next"),l=this.$pagination.find(".page-item").not(".page-next, .page-pre, .page-last-separator, .page-first-separator"),this.totalPages<=1&&this.$pagination.find("div.pagination").hide(),e.smartDisplay&&(d.length<2||e.totalRows<=d[0])&&this.$pagination.find("div.page-list").hide(),this.$pagination[this.getData().length?"show":"hide"](),e.paginationLoop||(1===e.pageNumber&&o.addClass("disabled"),e.pageNumber===this.totalPages&&a.addClass("disabled")),h&&(e.pageSize=e.formatAllRows()),s.off("click").on("click",(function(e){return t.onPageListChange(e)})),o.off("click").on("click",(function(e){return t.onPagePre(e)})),a.off("click").on("click",(function(e){return t.onPageNext(e)})),l.off("click").on("click",(function(e){return t.onPageNumber(e)})))}else this.$pagination.hide()}},{key:"updatePagination",value:function(t){t&&R(t.currentTarget).hasClass("disabled")||(this.options.maintainMetaData||this.resetRows(),this.initPagination(),this.trigger("page-change",this.options.pageNumber,this.options.pageSize),"server"===this.options.sidePagination||"client"===this.options.sidePagination&&this.options.paginationLoadMore&&!this._paginationLoaded&&this.options.pageNumber===this.totalPages?this.initServer():this.initBody())}},{key:"onPageListChange",value:function(t){t.preventDefault();var e=R(t.currentTarget);return e.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive),this.options.pageSize=e.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+e.text(),this.$toolbar.find(".page-size").text(this.options.pageSize),this.updatePagination(t),!1}},{key:"onPagePre",value:function(t){if(!R(t.target).hasClass("disabled"))return t.preventDefault(),this.options.pageNumber-1==0?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(t),!1}},{key:"onPageNext",value:function(t){if(!R(t.target).hasClass("disabled"))return t.preventDefault(),this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(t),!1}},{key:"onPageNumber",value:function(t){if(t.preventDefault(),this.options.pageNumber!==+R(t.currentTarget).text())return this.options.pageNumber=+R(t.currentTarget).text(),this.updatePagination(t),!1}},{key:"initRow",value:function(t,e,n,i){var r=this,s=[],o={},a=[],l="",c={},h=[];if(!(W.findIndex(this.hiddenRows,t)>-1)){if((o=W.calculateObjectValue(this.options,this.options.rowStyle,[t,e],o))&&o.css)for(var u=0,d=Object.entries(o.css);u"),this.options.cardView&&s.push('
    '));var A="";return W.hasDetailViewIcon(this.options)&&(A="",W.calculateObjectValue(null,this.options.detailFilter,[e,t])&&(A+='\n \n '.concat(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen),"\n \n ")),A+=""),A&&"right"!==this.options.detailViewAlign&&s.push(A),this.header.fields.forEach((function(n,i){var o=r.columns[i],l="",c=W.getItemField(t,n,r.options.escape,o.escape),h="",u="",d={},f="",p=r.header.classes[i],g="",m="",v="",b="",y="",_="";if((!r.fromHtml&&!r.autoMergeCells||void 0!==c||o.checkbox||o.radio)&&o.visible&&(!r.options.cardView||o.cardVisible)){if(a.concat([r.header.styles[i]]).length&&(m+="".concat(a.concat([r.header.styles[i]]).join("; "))),t["_".concat(n,"_style")]&&(m+="".concat(t["_".concat(n,"_style")])),m&&(g=' style="'.concat(m,'"')),t["_".concat(n,"_id")]&&(f=W.sprintf(' id="%s"',t["_".concat(n,"_id")])),t["_".concat(n,"_class")]&&(p=W.sprintf(' class="%s"',t["_".concat(n,"_class")])),t["_".concat(n,"_rowspan")]&&(b=W.sprintf(' rowspan="%s"',t["_".concat(n,"_rowspan")])),t["_".concat(n,"_colspan")]&&(y=W.sprintf(' colspan="%s"',t["_".concat(n,"_colspan")])),t["_".concat(n,"_title")]&&(_=W.sprintf(' title="%s"',t["_".concat(n,"_title")])),(d=W.calculateObjectValue(r.header,r.header.cellStyles[i],[c,t,e,n],d)).classes&&(p=' class="'.concat(d.classes,'"')),d.css){for(var x=[],w=0,S=Object.entries(d.css);w|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(h)){var O=(new DOMParser).parseFromString(h.toString(),"text/html").documentElement.textContent,I=O.replace(M,R);O=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),E=h.replace(new RegExp("(>\\s*)(".concat(O,")(\\s*)"),"gm"),"$1".concat(I,"$3"))}else E=h.toString().replace(M,R);h=W.calculateObjectValue(o,o.searchHighlightFormatter,[h,r.searchText],E)}if(t["_".concat(n,"_data")]&&!W.isEmptyObject(t["_".concat(n,"_data")]))for(var P=0,N=Object.entries(t["_".concat(n,"_data")]);P'):'"),'"),r.header.formatters[i]&&"string"==typeof h?h:"",r.options.cardView?"
    ":""].join(""),t[r.header.stateField]=!0===h||!!c||h&&h.checked}else if(r.options.cardView){var $=r.options.showHeader?'").concat(W.getFieldTitle(r.columns,n),""):"";l='
    '.concat($,'").concat(h,"
    "),r.options.smartDisplay&&""===h&&(l='
    ')}else l="").concat(h,"");s.push(l)}})),A&&"right"===this.options.detailViewAlign&&s.push(A),this.options.cardView&&s.push("
    "),s.push(""),s.join("")}}},{key:"initBody",value:function(t,e){var n=this,i=this.getData();this.trigger("pre-body",i),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=R("").appendTo(this.$el)),this.options.pagination&&"server"!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=i.length);var r=[],s=R(document.createDocumentFragment()),o=!1,a=[];this.autoMergeCells=W.checkAutoMergeCells(i.slice(this.pageFrom-1,this.pageTo));for(var l=this.pageFrom-1;l tr[data-uniqueid="%s"][data-has-detail-view]',d)).next();f.is("tr.detail-view")&&(a.push(l),e&&d===e||(h+=f[0].outerHTML))}this.options.virtualScroll?r.push(h):s.append(h)}}o?this.options.virtualScroll?(this.virtualScroll&&this.virtualScroll.destroy(),this.virtualScroll=new Y({rows:r,fixedScroll:t,scrollEl:this.$tableBody[0],contentEl:this.$body[0],itemHeight:this.options.virtualScrollItemHeight,callback:function(t,e){n.fitHeader(),n.initBodyEvent(),n.trigger("virtual-scroll",t,e)}})):this.$body.html(s):this.$body.html(''.concat(W.sprintf('%s',this.getVisibleFields().length+W.getDetailViewIndexOffset(this.options),this.options.formatNoMatches()),"")),a.forEach((function(t){n.expandRow(t)})),t||this.scrollTo(0),this.initBodyEvent(),this.initFooter(),this.resetView(),this.updateSelected(),"server"!==this.options.sidePagination&&(this.options.totalRows=i.length),this.trigger("post-body",i)}},{key:"initBodyEvent",value:function(){var t=this;this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",(function(e){var n=R(e.currentTarget);if(!(n.find(".detail-icon").length||n.index()-W.getDetailViewIndexOffset(t.options)<0)){var i=n.parent(),r=R(e.target).parents(".card-views").children(),s=R(e.target).parents(".card-view"),o=i.data("index"),a=t.data[o],l=t.options.cardView?r.index(s):n[0].cellIndex,c=t.getVisibleFields()[l-W.getDetailViewIndexOffset(t.options)],h=t.columns[t.fieldsColumnsIndex[c]],u=W.getItemField(a,c,t.options.escape,h.escape);if(t.trigger("click"===e.type?"click-cell":"dbl-click-cell",c,u,a,n),t.trigger("click"===e.type?"click-row":"dbl-click-row",a,i,c),"click"===e.type&&t.options.clickToSelect&&h.clickToSelect&&!W.calculateObjectValue(t.options,t.options.ignoreClickToSelectOn,[e.target])){var d=i.find(W.sprintf('[name="%s"]',t.options.selectItemName));d.length&&d[0].click()}"click"===e.type&&t.options.detailViewByClick&&t.toggleDetailView(o,t.header.detailFormatters[t.fieldsColumnsIndex[c]])}})).off("mousedown").on("mousedown",(function(e){t.multipleSelectRowCtrlKey=e.ctrlKey||e.metaKey,t.multipleSelectRowShiftKey=e.shiftKey})),this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",(function(e){return e.preventDefault(),t.toggleDetailView(R(e.currentTarget).parent().parent().data("index")),!1})),this.$selectItem=this.$body.find(W.sprintf('[name="%s"]',this.options.selectItemName)),this.$selectItem.off("click").on("click",(function(e){e.stopImmediatePropagation();var n=R(e.currentTarget);t._toggleCheck(n.prop("checked"),n.data("index"))})),this.header.events.forEach((function(e,n){var i=e;if(i){if("string"==typeof i&&(i=W.calculateObjectValue(null,i)),!i)throw new Error("Unknown event in the scope: ".concat(e));var r=t.header.fields[n],s=t.getVisibleFields().indexOf(r);if(-1!==s){s+=W.getDetailViewIndexOffset(t.options);var o=function(e){if(!i.hasOwnProperty(e))return 1;var n=i[e];t.$body.find(">tr:not(.no-records-found)").each((function(i,o){var a=R(o),l=a.find(t.options.cardView?".card-views>.card-view":">td").eq(s),c=e.indexOf(" "),h=e.substring(0,c),u=e.substring(c+1);l.find(u).off(h).on(h,(function(e){var i=a.data("index"),s=t.data[i],o=s[r];n.apply(t,[e,o,s,i])}))}))};for(var a in i)o(a)}}}))}},{key:"initServer",value:function(t,e,n){var i=this,r={},s=this.header.fields.indexOf(this.options.sortName),o={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};if(this.header.sortNames[s]&&(o.sortName=this.header.sortNames[s]),this.options.pagination&&"server"===this.options.sidePagination&&(o.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,o.pageNumber=this.options.pageNumber),n||this.options.url||this.options.ajax){if("limit"===this.options.queryParamsType&&(o={search:o.searchText,sort:o.sortName,order:o.sortOrder},this.options.pagination&&"server"===this.options.sidePagination&&(o.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),o.limit=this.options.pageSize,0!==o.limit&&this.options.pageSize!==this.options.formatAllRows()||delete o.limit)),this.options.search&&"server"===this.options.sidePagination&&this.options.searchable&&this.columns.filter((function(t){return t.searchable})).length){o.searchable=[];var a,l=N(this.columns);try{for(l.s();!(a=l.n()).done;){var c=a.value;!c.checkbox&&c.searchable&&(this.options.visibleSearch&&c.visible||!this.options.visibleSearch)&&o.searchable.push(c.field)}}catch(t){l.e(t)}finally{l.f()}}if(W.isEmptyObject(this.filterColumnsPartial)||(o.filter=JSON.stringify(this.filterColumnsPartial,null)),W.extend(o,e||{}),!1!==(r=W.calculateObjectValue(this.options,this.options.queryParams,[o],r))){t||this.showLoading();var h=W.extend({},W.calculateObjectValue(null,this.options.ajaxOptions),{type:this.options.method,url:n||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(r):r,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(e,n,r){var s=W.calculateObjectValue(i.options,i.options.responseHandler,[e,r],e);"client"===i.options.sidePagination&&i.options.paginationLoadMore&&(i._paginationLoaded=i.data.length===s.length),i.load(s),i.trigger("load-success",s,r&&r.status,r),t||i.hideLoading(),"server"===i.options.sidePagination&&i.options.pageNumber>1&&s[i.options.totalField]>0&&!s[i.options.dataField].length&&i.updatePagination()},error:function(e){if(e&&0===e.status&&i._xhrAbort)i._xhrAbort=!1;else{var n=[];"server"===i.options.sidePagination&&((n={})[i.options.totalField]=0,n[i.options.dataField]=[]),i.load(n),i.trigger("load-error",e&&e.status,e),t||i.hideLoading()}}});return this.options.ajax?W.calculateObjectValue(this,this.options.ajax,[h],null):(this._xhr&&4!==this._xhr.readyState&&(this._xhrAbort=!0,this._xhr.abort()),this._xhr=R.ajax(h)),r}}}},{key:"initSearchText",value:function(){if(this.options.search&&(this.searchText="",""!==this.options.searchText)){var t=W.getSearchInput(this);t.val(this.options.searchText),this.onSearch({currentTarget:t,firedByInitSearchText:!0})}}},{key:"getCaret",value:function(){var t=this;this.$header.find("th").each((function(e,n){R(n).find(".sortable").removeClass("desc asc").addClass(R(n).data("field")===t.options.sortName?t.options.sortOrder:"both")}))}},{key:"updateSelected",value:function(){var t=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",t),this.$selectItem.each((function(t,e){R(e).closest("tr")[R(e).prop("checked")?"addClass":"removeClass"]("selected")}))}},{key:"updateRows",value:function(){var t=this;this.$selectItem.each((function(e,n){t.data[R(n).data("index")][t.header.stateField]=R(n).prop("checked")}))}},{key:"resetRows",value:function(){var t,e=N(this.data);try{for(e.s();!(t=e.n()).done;){var n=t.value;this.$selectAll.prop("checked",!1),this.$selectItem.prop("checked",!1),this.header.stateField&&(n[this.header.stateField]=!1)}}catch(t){e.e(t)}finally{e.f()}this.initHiddenRows()}},{key:"trigger",value:function(e){for(var n,i,r="".concat(e,".bs.table"),s=arguments.length,o=new Array(s>1?s-1:0),a=1;ae.clientHeight+this.$header.outerHeight()?W.getScrollBarWidth():0;this.$el.css("margin-top",-this.$header.outerHeight());var i=this.$tableHeader.find(":focus");if(i.length>0){var r=i.parents("th");if(r.length>0){var s=r.attr("data-field");if(void 0!==s){var o=this.$header.find("[data-field='".concat(s,"']"));o.length>0&&o.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css("margin-right",n).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),this.$tableLoading.css("width",this.$el.outerWidth());var a=R(".focus-temp:visible:eq(0)");a.length>0&&(a.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each((function(e,n){t.$header_.find(W.sprintf('th[data-field="%s"]',R(n).data("field"))).data(R(n).data())}));for(var l=this.getVisibleFields(),c=this.$header_.find("th"),h=this.$body.find(">tr:not(.no-records-found,.virtual-scroll-top)").eq(0);h.length&&h.find('>td[colspan]:not([colspan="1"])').length;)h=h.next();var u=h.find("> *").length;h.find("> *").each((function(e,n){var i=R(n);if(W.hasDetailViewIcon(t.options)&&(0===e&&"right"!==t.options.detailViewAlign||e===u-1&&"right"===t.options.detailViewAlign)){var r=c.filter(".detail"),s=r.innerWidth()-r.find(".fht-cell").width();r.find(".fht-cell").width(i.innerWidth()-s)}else{var o=e-W.getDetailViewIndexOffset(t.options),a=t.$header_.find(W.sprintf('th[data-field="%s"]',l[o]));a.length>1&&(a=R(c[i[0].cellIndex]));var h=a.innerWidth()-a.find(".fht-cell").width();a.find(".fht-cell").width(i.innerWidth()-h)}})),this.horizontalScroll(),this.trigger("post-header")}}},{key:"initFooter",value:function(){if(this.options.showFooter&&!this.options.cardView){var t=this.getData(),e=[],n="";W.hasDetailViewIcon(this.options)&&(n='
    '),n&&"right"!==this.options.detailViewAlign&&e.push(n);var i,r=N(this.columns);try{for(r.s();!(i=r.n()).done;){var s,o,a=i.value,l=[],c={},h=W.sprintf(' class="%s"',a.class);if(!(!a.visible||this.footerData&&this.footerData.length>0&&!(a.field in this.footerData[0]))){if(this.options.cardView&&!a.cardVisible)return;if(s=W.sprintf("text-align: %s; ",a.falign?a.falign:a.align),o=W.sprintf("vertical-align: %s; ",a.valign),(c=W.calculateObjectValue(null,a.footerStyle||this.options.footerStyle,[a]))&&c.css)for(var u=0,d=Object.entries(c.css);u0&&(m=this.footerData[0]["_".concat(a.field,"_colspan")]||0),m&&e.push(' colspan="'.concat(m,'" ')),e.push(">"),e.push('
    ');var v="";this.footerData&&this.footerData.length>0&&(v=this.footerData[0][a.field]||""),e.push(W.calculateObjectValue(a,a.footerFormatter,[t,v],v)),e.push("
    "),e.push('
    '),e.push("
    "),e.push("")}}}catch(t){r.e(t)}finally{r.f()}n&&"right"===this.options.detailViewAlign&&e.push(n),this.options.height||this.$tableFooter.length||(this.$el.append(""),this.$tableFooter=this.$el.find("tfoot")),this.$tableFooter.find("tr").length||this.$tableFooter.html("
    "),this.$tableFooter.find("tr").html(e.join("")),this.trigger("post-footer",this.$tableFooter)}}},{key:"fitFooter",value:function(){var t=this;if(this.$el.is(":hidden"))setTimeout((function(){return t.fitFooter()}),100);else{var e=this.$tableBody.get(0),n=this.hasScrollBar&&e.scrollHeight>e.clientHeight+this.$header.outerHeight()?W.getScrollBarWidth():0;this.$tableFooter.css("margin-right",n).find("table").css("width",this.$el.outerWidth()).attr("class",this.$el.attr("class"));var i=this.$tableFooter.find("th"),r=this.$body.find(">tr:first-child:not(.no-records-found)");for(i.find(".fht-cell").width("auto");r.length&&r.find('>td[colspan]:not([colspan="1"])').length;)r=r.next();var s=r.find("> *").length;r.find("> *").each((function(e,n){var r=R(n);if(W.hasDetailViewIcon(t.options)&&(0===e&&"left"===t.options.detailViewAlign||e===s-1&&"right"===t.options.detailViewAlign)){var o=i.filter(".detail"),a=o.innerWidth()-o.find(".fht-cell").width();o.find(".fht-cell").width(r.innerWidth()-a)}else{var l=i.eq(e),c=l.innerWidth()-l.find(".fht-cell").width();l.find(".fht-cell").width(r.innerWidth()-c)}})),this.horizontalScroll()}}},{key:"horizontalScroll",value:function(){var t=this;this.$tableBody.off("scroll").on("scroll",(function(){var e=t.$tableBody.scrollLeft();t.options.showHeader&&t.options.height&&t.$tableHeader.scrollLeft(e),t.options.showFooter&&!t.options.cardView&&t.$tableFooter.scrollLeft(e),t.trigger("scroll-body",t.$tableBody)}))}},{key:"getVisibleFields",value:function(){var t,e=[],n=N(this.header.fields);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=this.columns[this.fieldsColumnsIndex[i]];r&&r.visible&&(!this.options.cardView||r.cardVisible)&&e.push(i)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"initHiddenRows",value:function(){this.hiddenRows=[]}},{key:"getOptions",value:function(){var t=W.extend({},this.options);return delete t.data,W.extend(!0,{},t)}},{key:"refreshOptions",value:function(t){W.compareObjects(this.options,t,!0)||(this.options=W.extend(this.options,t),this.trigger("refresh-options",this.options),this.destroy(),this.init())}},{key:"getData",value:function(t){var e=this,n=this.options.data;if(!(this.searchText||this.options.customSearch||void 0!==this.options.sortName||this.enableCustomSort)&&W.isEmptyObject(this.filterColumns)&&"function"!=typeof this.options.filterOptions.filterAlgorithm&&W.isEmptyObject(this.filterColumnsPartial)||t&&t.unfiltered||(n=this.data),t&&!t.includeHiddenRows){var i=this.getHiddenRows();n=n.filter((function(t){return-1===W.findIndex(i,t)}))}return t&&t.useCurrentPage&&(n=n.slice(this.pageFrom-1,this.pageTo)),t&&t.formatted?n.map((function(t){for(var n=0,i=Object.entries(t);n=0;n--){var i=this.options.data[n],r=W.getItemField(i,t.field,this.options.escape,i.escape);void 0===r&&"$index"!==t.field||(!i.hasOwnProperty(t.field)&&"$index"===t.field&&t.values.includes(n)||t.values.includes(r))&&(e++,this.options.data.splice(n,1))}e&&("server"===this.options.sidePagination&&(this.options.totalRows-=e,this.data=j(this.options.data)),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},{key:"removeAll",value:function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))}},{key:"insertRow",value:function(t){t.hasOwnProperty("index")&&t.hasOwnProperty("row")&&(this.options.data.splice(t.index,0,t.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},{key:"updateRow",value:function(t){var e,n=N(Array.isArray(t)?t:[t]);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.hasOwnProperty("index")&&i.hasOwnProperty("row")&&(i.hasOwnProperty("replace")&&i.replace?this.options.data[i.index]=i.row:W.extend(this.options.data[i.index],i.row))}}catch(t){n.e(t)}finally{n.f()}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)}},{key:"getRowByUniqueId",value:function(t){var e,n,i=this.options.uniqueId,r=t,s=null;for(e=this.options.data.length-1;e>=0;e--){n=this.options.data[e];var o=W.getItemField(n,i,this.options.escape,n.escape);if(void 0!==o&&("string"==typeof o?r=t.toString():"number"==typeof o&&(Number(o)===o&&o%1==0?r=parseInt(t,10):o===Number(o)&&0!==o&&(r=parseFloat(t))),o===r)){s=n;break}}return s}},{key:"updateByUniqueId",value:function(t){var e,n=null,i=N(Array.isArray(t)?t:[t]);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.hasOwnProperty("id")&&r.hasOwnProperty("row")){var s=this.options.data.indexOf(this.getRowByUniqueId(r.id));-1!==s&&(r.hasOwnProperty("replace")&&r.replace?this.options.data[s]=r.row:W.extend(this.options.data[s],r.row),n=r.id)}}}catch(t){i.e(t)}finally{i.f()}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0,n)}},{key:"removeByUniqueId",value:function(t){var e=this.options.data.length,n=this.getRowByUniqueId(t);n&&this.options.data.splice(this.options.data.indexOf(n),1),e!==this.options.data.length&&("server"===this.options.sidePagination&&(this.options.totalRows-=1,this.data=j(this.options.data)),this.initSearch(),this.initPagination(),this.initBody(!0))}},{key:"_updateCellOnly",value:function(t,e){var n=this.initRow(this.options.data[e],e),i=this.getVisibleFields().indexOf(t);-1!==i&&(i+=W.getDetailViewIndexOffset(this.options),this.$body.find(">tr[data-index=".concat(e,"]")).find(">td:eq(".concat(i,")")).replaceWith(R(n).find(">td:eq(".concat(i,")"))),this.initBodyEvent(),this.initFooter(),this.resetView(),this.updateSelected())}},{key:"updateCell",value:function(t){t.hasOwnProperty("index")&&t.hasOwnProperty("field")&&t.hasOwnProperty("value")&&(this.options.data[t.index][t.field]=t.value,!1!==t.reinit?(this.initSort(),this.initBody(!0)):this._updateCellOnly(t.field,t.index))}},{key:"updateCellByUniqueId",value:function(t){var e=this;(Array.isArray(t)?t:[t]).forEach((function(t){var n=t.id,i=t.field,r=t.value,s=e.options.data.indexOf(e.getRowByUniqueId(n));-1!==s&&(e.options.data[s][i]=r)})),!1!==t.reinit?(this.initSort(),this.initBody(!0)):this._updateCellOnly(t.field,this.options.data.indexOf(this.getRowByUniqueId(t.id)))}},{key:"showRow",value:function(t){this._toggleRow(t,!0)}},{key:"hideRow",value:function(t){this._toggleRow(t,!1)}},{key:"_toggleRow",value:function(t,e){var n;if(t.hasOwnProperty("index")?n=this.getData()[t.index]:t.hasOwnProperty("uniqueId")&&(n=this.getRowByUniqueId(t.uniqueId)),n){var i=W.findIndex(this.hiddenRows,n);e||-1!==i?e&&i>-1&&this.hiddenRows.splice(i,1):this.hiddenRows.push(n),this.initBody(!0),this.initPagination()}}},{key:"getHiddenRows",value:function(t){if(t)return this.initHiddenRows(),this.initBody(!0),void this.initPagination();var e,n=[],i=N(this.getData());try{for(i.s();!(e=i.n()).done;){var r=e.value;this.hiddenRows.includes(r)&&n.push(r)}}catch(t){i.e(t)}finally{i.f()}return this.hiddenRows=n,n}},{key:"showColumn",value:function(t){var e=this;(Array.isArray(t)?t:[t]).forEach((function(t){e._toggleColumn(e.fieldsColumnsIndex[t],!0,!0)}))}},{key:"hideColumn",value:function(t){var e=this;(Array.isArray(t)?t:[t]).forEach((function(t){e._toggleColumn(e.fieldsColumnsIndex[t],!1,!0)}))}},{key:"_toggleColumn",value:function(t,e,n){if(void 0!==t&&this.columns[t].visible!==e&&(this.columns[t].visible=e,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var i=this.$toolbar.find('.keep-open input:not(".toggle-all")').prop("disabled",!1);n&&i.filter(W.sprintf('[value="%s"]',t)).prop("checked",e),i.filter(":checked").length<=this.options.minimumCountColumns&&i.filter(":checked").prop("disabled",!0)}}},{key:"getVisibleColumns",value:function(){var t=this;return this.columns.filter((function(e){return e.visible&&!t.isSelectionColumn(e)}))}},{key:"getHiddenColumns",value:function(){return this.columns.filter((function(t){return!t.visible}))}},{key:"isSelectionColumn",value:function(t){return t.radio||t.checkbox}},{key:"showAllColumns",value:function(){this._toggleAllColumns(!0)}},{key:"hideAllColumns",value:function(){this._toggleAllColumns(!1)}},{key:"_toggleAllColumns",value:function(t){var e,n=this,i=N(this.columns.slice().reverse());try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.switchable){if(!t&&this.options.showColumns&&this.getVisibleColumns().filter((function(t){return t.switchable})).length===this.options.minimumCountColumns)continue;r.visible=t}}}catch(t){i.e(t)}finally{i.f()}if(this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var s=this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop("disabled",!1);t?s.prop("checked",t):s.get().reverse().forEach((function(e){s.filter(":checked").length>n.options.minimumCountColumns&&R(e).prop("checked",t)})),s.filter(":checked").length<=this.options.minimumCountColumns&&s.filter(":checked").prop("disabled",!0)}}},{key:"mergeCells",value:function(t){var e,n,i=t.index,r=this.getVisibleFields().indexOf(t.field),s=t.rowspan||1,o=t.colspan||1,a=this.$body.find(">tr[data-index]");r+=W.getDetailViewIndexOffset(this.options);var l=a.eq(i).find(">td").eq(r);if(!(i<0||r<0||i>=this.data.length)){for(e=i;etd").eq(n).hide();l.attr("rowspan",s).attr("colspan",o).show()}}},{key:"checkAll",value:function(){this._toggleCheckAll(!0)}},{key:"uncheckAll",value:function(){this._toggleCheckAll(!1)}},{key:"_toggleCheckAll",value:function(t){var e=this.getSelections();this.$selectAll.add(this.$selectAll_).prop("checked",t),this.$selectItem.filter(":enabled").prop("checked",t),this.updateRows(),this.updateSelected();var n=this.getSelections();t?this.trigger("check-all",n,e):this.trigger("uncheck-all",n,e)}},{key:"checkInvert",value:function(){var t=this.$selectItem.filter(":enabled"),e=t.filter(":checked");t.each((function(t,e){R(e).prop("checked",!R(e).prop("checked"))})),this.updateRows(),this.updateSelected(),this.trigger("uncheck-some",e),e=this.getSelections(),this.trigger("check-some",e)}},{key:"check",value:function(t){this._toggleCheck(!0,t)}},{key:"uncheck",value:function(t){this._toggleCheck(!1,t)}},{key:"_toggleCheck",value:function(t,e){var n=this.$selectItem.filter('[data-index="'.concat(e,'"]')),i=this.data[e];if(n.is(":radio")||this.options.singleSelect||this.options.multipleSelectRow&&!this.multipleSelectRowCtrlKey&&!this.multipleSelectRowShiftKey){var r,s=N(this.options.data);try{for(s.s();!(r=s.n()).done;)r.value[this.header.stateField]=!1}catch(t){s.e(t)}finally{s.f()}this.$selectItem.filter(":checked").not(n).prop("checked",!1)}if(i[this.header.stateField]=t,this.options.multipleSelectRow){if(this.multipleSelectRowShiftKey&&this.multipleSelectRowLastSelectedIndex>=0)for(var o=L(this.multipleSelectRowLastSelectedIndexn.clientWidth}if(!this.options.cardView&&this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),e+=this.$header.outerHeight(!0)+1):(this.$tableHeader.hide(),this.trigger("post-header")),!this.options.cardView&&this.options.showFooter&&(this.$tableFooter.show(),this.fitFooter(),this.options.height&&(e+=this.$tableFooter.outerHeight(!0))),this.$container.hasClass("fullscreen"))this.$tableContainer.css("height",""),this.$tableContainer.css("width","");else if(this.options.height){this.$tableBorder&&(this.$tableBorder.css("width",""),this.$tableBorder.css("height",""));var i=this.$toolbar.outerHeight(!0),r=this.$pagination.outerHeight(!0),s=this.options.height-i-r,o=this.$tableBody.find(">table"),a=o.outerHeight();if(this.$tableContainer.css("height","".concat(s,"px")),this.$tableBorder&&o.is(":visible")){var l=s-a-2;this.hasScrollBar&&(l-=W.getScrollBarWidth()),this.$tableBorder.css("width","".concat(o.outerWidth(),"px")),this.$tableBorder.css("height","".concat(l,"px"))}}this.options.cardView?(this.$el.css("margin-top","0"),this.$tableContainer.css("padding-bottom","0"),this.$tableFooter.hide()):(this.getCaret(),this.$tableContainer.css("padding-bottom","".concat(e,"px"))),this.trigger("reset-view")}},{key:"showLoading",value:function(){this.$tableLoading.toggleClass("open",!0);var t=this.options.loadingFontSize;"auto"===this.options.loadingFontSize&&(t=.04*this.$tableLoading.width(),t=Math.max(12,t),t=Math.min(32,t),t="".concat(t,"px")),this.$tableLoading.find(".loading-text").css("font-size",t)}},{key:"hideLoading",value:function(){this.$tableLoading.toggleClass("open",!1)}},{key:"togglePagination",value:function(){this.options.pagination=!this.options.pagination;var t=this.options.showButtonIcons?this.options.pagination?this.options.icons.paginationSwitchDown:this.options.icons.paginationSwitchUp:"",e=this.options.showButtonText?this.options.pagination?this.options.formatPaginationSwitchUp():this.options.formatPaginationSwitchDown():"";this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)),this.updatePagination(),this.trigger("toggle-pagination",this.options.pagination)}},{key:"toggleFullscreen",value:function(){this.$el.closest(".bootstrap-table").toggleClass("fullscreen"),this.resetView()}},{key:"toggleView",value:function(){this.options.cardView=!this.options.cardView,this.initHeader();var t=this.options.showButtonIcons?this.options.cardView?this.options.icons.toggleOn:this.options.icons.toggleOff:"",e=this.options.showButtonText?this.options.cardView?this.options.formatToggleOff():this.options.formatToggleOn():"";this.$toolbar.find('button[name="toggle"]').html("".concat(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)).attr("aria-label",e).attr("title",e),this.initBody(),this.trigger("toggle",this.options.cardView)}},{key:"resetSearch",value:function(t){var e=W.getSearchInput(this),n=t||"";e.val(n),this.searchText=n,this.onSearch({currentTarget:e},!1)}},{key:"filterBy",value:function(t,e){this.filterOptions=W.isEmptyObject(e)?this.options.filterOptions:W.extend(this.options.filterOptions,e),this.filterColumns=W.isEmptyObject(t)?{}:t,this.options.pageNumber=1,this.initSearch(),this.updatePagination()}},{key:"scrollTo",value:function(t){var e={unit:"px",value:0};"object"===B(t)?e=Object.assign(e,t):"string"==typeof t&&"bottom"===t?e.value=this.$tableBody[0].scrollHeight:"string"!=typeof t&&"number"!=typeof t||(e.value=t);var n=e.value;"rows"===e.unit&&(n=0,this.$body.find("> tr:lt(".concat(e.value,")")).each((function(t,e){n+=R(e).outerHeight(!0)}))),this.$tableBody.scrollTop(n)}},{key:"getScrollPosition",value:function(){return this.$tableBody.scrollTop()}},{key:"selectPage",value:function(t){t>0&&t<=this.options.totalPages&&(this.options.pageNumber=t,this.updatePagination())}},{key:"prevPage",value:function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())}},{key:"nextPage",value:function(){this.options.pageNumber tr[data-index="%s"]',t)).next().is("tr.detail-view")?this.collapseRow(t):this.expandRow(t,e),this.resetView()}},{key:"expandRow",value:function(t,e){var n=this.data[t],i=this.$body.find(W.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));if(this.options.detailViewIcon&&i.find("a.detail-icon").html(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailClose)),!i.next().is("tr.detail-view")){i.after(W.sprintf('',i.children("td").length));var r=i.next().find("td"),s=e||this.options.detailFormatter,o=W.calculateObjectValue(this.options,s,[t,n,r],"");1===r.length&&r.append(o),this.trigger("expand-row",t,n,r)}}},{key:"expandRowByUniqueId",value:function(t){var e=this.getRowByUniqueId(t);e&&this.expandRow(this.data.indexOf(e))}},{key:"collapseRow",value:function(t){var e=this.data[t],n=this.$body.find(W.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));n.next().is("tr.detail-view")&&(this.options.detailViewIcon&&n.find("a.detail-icon").html(W.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen)),this.trigger("collapse-row",t,e,n.next()),n.next().remove())}},{key:"collapseRowByUniqueId",value:function(t){var e=this.getRowByUniqueId(t);e&&this.collapseRow(this.data.indexOf(e))}},{key:"expandAllRows",value:function(){for(var t=this.$body.find("> tr[data-index][data-has-detail-view]"),e=0;e tr[data-index][data-has-detail-view]"),e=0;e1?e-1:0),i=1;i{Bl(".email-app").toggleClass("side-active"),t.preventDefault()})),Bl(".email-list-item, .back-to-mailbox").on("click",(t=>{Bl(".email-content").toggleClass("open"),t.preventDefault()}));var lS=n(748),cS=n.n(lS);Bl("#google-map").length>0&&cS()({key:""}).then((()=>{const t=26.8206,e=30.8025,{google:n}=window,i={center:new n.maps.LatLng(t,e),zoom:5,mapTypeId:n.maps.MapTypeId.ROADMAP,styles:[{featureType:"landscape",stylers:[{hue:"#FFBB00"},{saturation:43.400000000000006},{lightness:37.599999999999994},{gamma:1}]},{featureType:"road.highway",stylers:[{hue:"#FFC200"},{saturation:-61.8},{lightness:45.599999999999994},{gamma:1}]},{featureType:"road.arterial",stylers:[{hue:"#FF0300"},{saturation:-100},{lightness:51.19999999999999},{gamma:1}]},{featureType:"road.local",stylers:[{hue:"#FF0300"},{saturation:-100},{lightness:52},{gamma:1}]},{featureType:"water",stylers:[{hue:"#0078FF"},{saturation:-13.200000000000003},{lightness:2.4000000000000057},{gamma:1}]},{featureType:"poi",stylers:[{hue:"#00FF6A"},{saturation:-1.0989010989011234},{lightness:11.200000000000017},{gamma:1}]}]},r=new n.maps.Map(document.getElementById("google-map"),i);new n.maps.Marker({map:r,position:new n.maps.LatLng(t,e),visible:!0})})),function(){const t=document.createEvent("UIEvents");window.EVENT=t,t.initUIEvent("resize",!0,!1,window,0),window.addEventListener("load",(()=>{window.dispatchEvent(t)})),Bl("a").filter('[href^="http"], [href^="//"]').not(`[href*="${window.location.host}"]`).attr("rel","noopener noreferrer").attr("target","_blank"),document.addEventListener("click",(()=>{window.dispatchEvent(window.EVENT)}))}();$(document).ready((function(){const t=$("#adminEditBtn"),e=$("#adminDeleteBtn"),n=$("#bsTable"),i=n=>{const i=n.length;0===i?(t.prop("disabled",!0),e.prop("disabled",!0)):1===i?(t.prop("disabled",!1),e.prop("disabled",!1)):(t.prop("disabled",!0),e.prop("disabled",!1))},r=()=>{t.prop("disabled",!0),e.prop("disabled",!0)};n.on("load-success.bs.table",(()=>{r()})),n.on("load-error.bs.table",((t,e,n)=>{showFailDialog(n),r()})),n.on("check.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)})),n.on("uncheck.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)})),n.on("check-all.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)})),n.on("uncheck-all.bs.table",(()=>{const t=n.bootstrapTable("getSelections");i(t)}));const s=n.data("identifier");s&&(n.on("column-switch.bs.table",(()=>{const t=n.bootstrapTable("getVisibleColumns").map((t=>t.field));(0,u.E)("POST",`/setting/store-setting/${s}`,JSON.stringify({value:t})).catch((t=>console.error("Error:",t)))})),(0,u.E)("GET",`/setting/get-setting/${s}`).then((t=>{n.bootstrapTable("getVisibleColumns").forEach((t=>{n.bootstrapTable("hideColumn",t.field)})),t?.data?.value?.forEach((t=>{n.bootstrapTable("showColumn",t)}))})).catch((t=>console.error("Error:",t))))})),$(document).ready((()=>{const t=$("#adminModal"),e=$("#deleteFormModal"),n=$("#bsTable");$("#adminEditBtn").prop("disabled",!0),$("#adminDeleteBtn").prop("disabled",!0),$(document).on("click","#adminAddBtn",(()=>{t.find(".modal-messages").html(""),(0,u.E)("GET","/admin/add").catch((t=>console.error("Error:",t))).then((e=>{t.find(".modal-title").text("Add admin"),t.find(".modal-form").html(e.data),t.modal("show")}))})),$(document).on("click","#formModalSubmit",(()=>{const e=$("#ajaxForm"),i=t.find(".modal-messages");e.length<1||(0,u.E)(e.attr("method"),e.attr("action"),new FormData(e.get(0))).then((e=>{i.html(""),i.append($("
    ").prop({innerHTML:e.message,className:"alert alert-success",role:"alert"})),n.bootstrapTable("refresh"),setTimeout((function(){t.modal("hide")}),1500)})).catch((t=>{i.html(""),i.append($("
    ").prop({innerHTML:t.cause,className:"alert alert-danger",role:"alert"}))})).finally((()=>{t.modal("show")}))})),$(document).on("click","#adminEditBtn",(()=>{const e=$("#bsTable").bootstrapTable("getSelections");1===e.length&&(t.find(".modal-messages")?.html(""),(0,u.E)("GET",`/admin/edit/${e[0].uuid}`).catch((t=>console.error("Error:",t))).then((e=>{t.find(".modal-title").text("Edit admin"),t.find(".modal-form").html(e.data),t.modal("show")})))})),$(document).on("click","#adminDeleteBtn",(()=>{const t=$("#bsTable").bootstrapTable("getSelections");1===t.length&&(e.find("#adminIdentity").html(`${t[0].identity}`),e.modal("show"))})),$("#deleteAdminForm").on("submit",(t=>{t.preventDefault();const i=$("#bsTable").bootstrapTable("getSelections"),r=$("#deleteAdminForm"),s=$(r).find(".modal-messages");s.html(""),(0,u.E)("POST",`/admin/delete/${i[0].uuid}`,new FormData(r.get(0))).then((t=>{s.append($("
    ").prop({innerHTML:t.message,className:"alert alert-success",role:"alert"})),n.bootstrapTable("refresh"),setTimeout((function(){e.modal("hide"),s.html("")}),1500)})).catch((t=>{s.append($("
    ").prop({innerHTML:t.cause,className:"alert alert-danger",role:"alert"}))})).finally((()=>{e.modal("show")}))})),e.on("show.bs.modal","hidden.bs.modal",(function(){e.find("#confirmation").prop("checked",!1)}))}))})()})(); \ No newline at end of file diff --git a/src/Admin/src/ConfigProvider.php b/src/Admin/src/ConfigProvider.php index 48340cb0..1808132c 100644 --- a/src/Admin/src/ConfigProvider.php +++ b/src/Admin/src/ConfigProvider.php @@ -13,6 +13,7 @@ use Frontend\Admin\Entity\Admin; use Frontend\Admin\Entity\AdminInterface; use Frontend\Admin\Factory\AuthenticationServiceFactory; +use Frontend\Admin\Form\AdminDeleteForm; use Frontend\Admin\Form\AdminForm; use Frontend\Admin\Form\ChangePasswordForm; use Frontend\Admin\Form\LoginForm; @@ -79,6 +80,7 @@ public function getForms(): array 'factories' => [ LoginForm::class => ElementFactory::class, ChangePasswordForm::class => ElementFactory::class, + AdminDeleteForm::class => ElementFactory::class, ], 'aliases' => [], 'delegators' => [], diff --git a/src/Admin/src/Controller/AdminController.php b/src/Admin/src/Controller/AdminController.php index cc02af20..3509a85b 100644 --- a/src/Admin/src/Controller/AdminController.php +++ b/src/Admin/src/Controller/AdminController.php @@ -4,18 +4,18 @@ namespace Frontend\Admin\Controller; -use Doctrine\ORM\Exception\ORMException; use Doctrine\ORM\NonUniqueResultException; use Dot\Controller\AbstractActionController; use Dot\DependencyInjection\Attribute\Inject; use Dot\FlashMessenger\FlashMessengerInterface; -use Exception; +use Fig\Http\Message\RequestMethodInterface; use Fig\Http\Message\StatusCodeInterface; use Frontend\Admin\Adapter\AuthenticationAdapter; use Frontend\Admin\Entity\Admin; use Frontend\Admin\Entity\AdminIdentity; use Frontend\Admin\Entity\AdminLogin; use Frontend\Admin\Form\AccountForm; +use Frontend\Admin\Form\AdminDeleteForm; use Frontend\Admin\Form\AdminForm; use Frontend\Admin\Form\ChangePasswordForm; use Frontend\Admin\Form\LoginForm; @@ -23,6 +23,7 @@ use Frontend\Admin\InputFilter\EditAdminInputFilter; use Frontend\Admin\Service\AdminServiceInterface; use Frontend\App\Common\ServerRequestAwareTrait; +use Frontend\App\Exception\IdentityException; use Frontend\App\Message; use Frontend\App\Plugin\FormsPlugin; use Laminas\Authentication\AuthenticationServiceInterface; @@ -37,8 +38,6 @@ use Psr\Http\Message\ResponseInterface; use Throwable; -use function password_verify; - class AdminController extends AbstractActionController { use ServerRequestAwareTrait; @@ -75,11 +74,11 @@ public function addAction(): ResponseInterface try { $this->adminService->createAdmin($result); return new JsonResponse(['message' => Message::ADMIN_CREATED_SUCCESSFULLY]); - } catch (ORMException $e) { + } catch (IdentityException $e) { $this->logErrors($e, Message::CREATE_ADMIN); return new JsonResponse( ['message' => $e->getMessage()], - StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR + StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY ); } catch (Throwable $e) { $this->logErrors($e, Message::CREATE_ADMIN); @@ -102,14 +101,12 @@ public function addAction(): ResponseInterface [ 'form' => $this->adminForm, 'formAction' => '/admin/add', + 'method' => RequestMethodInterface::METHOD_POST, ] ), ]); } - /** - * @throws NonUniqueResultException - */ public function editAction(): ResponseInterface { $uuid = $this->getAttribute('uuid'); @@ -121,18 +118,18 @@ public function editAction(): ResponseInterface if ($this->isPost()) { $this->adminForm->setData($this->getPostParams()); - $this->adminForm->setDifferentInputFilter(new EditAdminInputFilter()); + $this->adminForm->setInputFilter(new EditAdminInputFilter()); if ($this->adminForm->isValid()) { /** @var array $result */ $result = $this->adminForm->getData(); try { $this->adminService->updateAdmin($admin, $result); return new JsonResponse(['message' => Message::ADMIN_UPDATED_SUCCESSFULLY]); - } catch (ORMException $e) { + } catch (IdentityException $e) { $this->logErrors($e, Message::UPDATE_ADMIN); return new JsonResponse( ['message' => $e->getMessage()], - StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR + StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY ); } catch (Throwable $e) { $this->logErrors($e, Message::UPDATE_ADMIN); @@ -157,24 +154,19 @@ public function editAction(): ResponseInterface [ 'form' => $this->adminForm, 'formAction' => '/admin/edit/' . $uuid, + 'method' => RequestMethodInterface::METHOD_POST, ] ), ]); } - /** - * @throws NonUniqueResultException - */ public function deleteAction(): ResponseInterface { - if (! $this->isDelete()) { - return new JsonResponse([ - 'error' => [ - 'messages' => [ - [Message::METHOD_NOT_ALLOWED], - ], - ], - ], StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED); + if (! $this->isPost()) { + return new JsonResponse( + ['message' => Message::METHOD_NOT_ALLOWED], + StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED + ); } $uuid = $this->getAttribute('uuid'); @@ -185,9 +177,17 @@ public function deleteAction(): ResponseInterface ); } + $form = new AdminDeleteForm(); + $form->setData($this->getPostParams()); + if (! $form->isValid()) { + return new JsonResponse( + ['message' => $this->forms->getMessages($form)], + StatusCodeInterface::STATUS_BAD_REQUEST + ); + } + /** @var Admin $admin */ $admin = $this->adminService->getAdminRepository()->findOneBy(['uuid' => $uuid]); - try { $this->adminService->getAdminRepository()->deleteAdmin($admin); return new JsonResponse(['message' => Message::ADMIN_DELETED_SUCCESSFULLY]); @@ -200,9 +200,6 @@ public function deleteAction(): ResponseInterface } } - /** - * @throws NonUniqueResultException - */ public function listAction(): ResponseInterface { $result = $this->adminService->getAdmins( @@ -219,7 +216,9 @@ public function listAction(): ResponseInterface public function manageAction(): ResponseInterface { return new HtmlResponse( - $this->template->render('admin::list') + $this->template->render('admin::list', [ + 'form' => new AdminDeleteForm(), + ]) ); } @@ -233,8 +232,7 @@ public function loginAction(): ResponseInterface return new RedirectResponse($this->router->generateUri("dashboard")); } - $form = new LoginForm(); - + $form = new LoginForm(); $shouldRebind = $this->messenger->getData('shouldRebind') ?? true; if ($shouldRebind) { $this->forms->restoreState($form); @@ -297,6 +295,7 @@ public function loginAction(): ResponseInterface public function logoutAction(): ResponseInterface { $this->authenticationService->clearIdentity(); + return new RedirectResponse( $this->router->generateUri('admin', ['action' => 'login']) ); @@ -317,7 +316,7 @@ public function accountAction(): ResponseInterface try { $this->adminService->updateAdmin($admin, $result); $this->messenger->addSuccess(Message::ACCOUNT_UPDATE_SUCCESSFULLY); - } catch (ORMException $e) { + } catch (IdentityException $e) { $this->logErrors($e, Message::UPDATE_ADMIN); $this->messenger->addError($e->getMessage()); } catch (Throwable $e) { @@ -354,11 +353,11 @@ public function changePasswordAction(): ResponseInterface if ($changePasswordForm->isValid()) { /** @var array $result */ $result = $changePasswordForm->getData(); - if (password_verify($result['currentPassword'], $admin->getPassword())) { + if ($admin->verifyPassword($result['currentPassword'])) { try { $this->adminService->updateAdmin($admin, $result); $this->messenger->addSuccess(Message::ACCOUNT_UPDATE_SUCCESSFULLY); - } catch (ORMException $e) { + } catch (IdentityException $e) { $this->logErrors($e, Message::CHANGE_PASSWORD); $this->messenger->addError($e->getMessage()); } catch (Throwable $e) { @@ -398,7 +397,7 @@ public function listLoginsAction(): ResponseInterface return new JsonResponse($result); } - public function logErrors(Throwable|Exception $e, string $message): void + private function logErrors(Throwable $e, string $message): void { $this->logger->err($message, [ 'error' => $e->getMessage(), diff --git a/src/Admin/src/Entity/Admin.php b/src/Admin/src/Entity/Admin.php index dac3e1ab..c7592d66 100644 --- a/src/Admin/src/Entity/Admin.php +++ b/src/Admin/src/Entity/Admin.php @@ -13,6 +13,7 @@ use Frontend\Setting\Entity\Setting; use function array_map; +use function password_verify; #[ORM\Entity(repositoryClass: AdminRepository::class)] #[ORM\Table(name: "admin")] @@ -131,6 +132,11 @@ public function setPassword(string $password): self return $this; } + public function verifyPassword(string $password): bool + { + return password_verify($password, $this->getPassword()); + } + public function getStatus(): string { return $this->status; diff --git a/src/Admin/src/Form/AdminDeleteForm.php b/src/Admin/src/Form/AdminDeleteForm.php new file mode 100644 index 00000000..ee95a8c8 --- /dev/null +++ b/src/Admin/src/Form/AdminDeleteForm.php @@ -0,0 +1,78 @@ + */ +class AdminDeleteForm extends Form +{ + protected InputFilterInterface $inputFilter; + + public function __construct(?string $name = null, array $options = []) + { + parent::__construct($name, $options); + + $this->init(); + + $this->inputFilter = new AdminDeleteInputFilter(); + $this->inputFilter->init(); + } + + public function init(): void + { + $this->add([ + 'name' => 'confirmation', + 'type' => 'checkbox', + 'options' => [ + 'label' => 'Confirmation', + 'checked_value' => 'yes', + 'unchecked_value' => 'no', + ], + 'attributes' => [ + 'value' => 'no', + 'id' => 'confirmation', + 'class' => 'form-check-input', + ], + ]); + + $this->add([ + 'name' => 'close', + 'type' => 'button', + 'options' => [ + 'label' => 'Close', + ], + 'attributes' => [ + 'class' => 'btn btn-default', + 'data-bs-dismiss' => 'modal', + 'role' => 'button', + ], + ]); + + $this->add([ + 'name' => 'submit', + 'type' => 'submit', + 'attributes' => [ + 'class' => 'btn btn-danger', + 'id' => 'modalDeleteBtn', + 'value' => 'Delete', + ], + ]); + } + + public function getInputFilter(): InputFilterInterface + { + return $this->inputFilter; + } + + public function setInputFilter(InputFilterInterface $inputFilter): void + { + $this->inputFilter = $inputFilter; + $this->inputFilter->init(); + } +} diff --git a/src/Admin/src/Form/AdminForm.php b/src/Admin/src/Form/AdminForm.php index a9245a1f..48758aa2 100644 --- a/src/Admin/src/Form/AdminForm.php +++ b/src/Admin/src/Form/AdminForm.php @@ -8,7 +8,6 @@ use Frontend\Admin\InputFilter\AdminInputFilter; use Laminas\Form\Form; use Laminas\Form\FormInterface; -use Laminas\InputFilter\InputFilter; use Laminas\InputFilter\InputFilterInterface; /** @template-extends Form */ @@ -119,7 +118,7 @@ public function getInputFilter(): InputFilterInterface return $this->inputFilter; } - public function setDifferentInputFilter(InputFilter $inputFilter): void + public function setInputFilter(InputFilterInterface $inputFilter): void { $this->inputFilter = $inputFilter; $this->inputFilter->init(); diff --git a/src/Admin/src/InputFilter/AdminDeleteInputFilter.php b/src/Admin/src/InputFilter/AdminDeleteInputFilter.php new file mode 100644 index 00000000..8c485002 --- /dev/null +++ b/src/Admin/src/InputFilter/AdminDeleteInputFilter.php @@ -0,0 +1,34 @@ + */ +class AdminDeleteInputFilter extends InputFilter +{ + public function init(): void + { + $confirmation = new Input('confirmation'); + $confirmation->setRequired(true); + $confirmation->getValidatorChain()->attachByName(NotEmpty::class, [ + 'break_chain_on_failure' => true, + 'message' => 'Please confirm admin deletion.', + ]); + + $confirmation->getValidatorChain()->attachByName(InArray::class, [ + 'haystack' => [ + 'yes', + ], + 'break_chain_on_failure' => true, + 'message' => 'Please confirm the admin deletion.', + ]); + + $this->add($confirmation); + } +} diff --git a/src/Admin/src/RoutesDelegator.php b/src/Admin/src/RoutesDelegator.php index 4c93ea23..65eecc97 100644 --- a/src/Admin/src/RoutesDelegator.php +++ b/src/Admin/src/RoutesDelegator.php @@ -19,11 +19,7 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal $app->route( '/admin[/{action}[/{uuid}]]', AdminController::class, - [ - RequestMethodInterface::METHOD_GET, - RequestMethodInterface::METHOD_POST, - RequestMethodInterface::METHOD_DELETE, - ], + [RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST], 'admin' ); diff --git a/src/Admin/src/Service/AdminService.php b/src/Admin/src/Service/AdminService.php index 37e147b2..c7d89d6d 100644 --- a/src/Admin/src/Service/AdminService.php +++ b/src/Admin/src/Service/AdminService.php @@ -6,7 +6,6 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\EntityRepository; -use Doctrine\ORM\Exception\ORMException; use Doctrine\ORM\NonUniqueResultException; use Dot\DependencyInjection\Attribute\Inject; use Dot\GeoIP\Service\LocationServiceInterface; @@ -15,6 +14,7 @@ use Frontend\Admin\Entity\AdminRole; use Frontend\Admin\Repository\AdminRepository; use Frontend\Admin\Repository\AdminRoleRepository; +use Frontend\App\Exception\IdentityException; use Frontend\App\Service\IpService; use function implode; @@ -127,14 +127,10 @@ public function getAdminLogins( return $result; } - /** - * @throws NonUniqueResultException - * @throws ORMException - */ public function createAdmin(array $data): Admin { if ($this->exists($data['identity'])) { - throw new \Frontend\App\Exception\ORMException('An account with this identity already exists.'); + throw IdentityException::duplicate(); } $admin = (new Admin()) @@ -152,17 +148,13 @@ public function createAdmin(array $data): Admin return $this->getAdminRepository()->saveAdmin($admin); } - /** - * @throws NonUniqueResultException - * @throws ORMException - */ public function updateAdmin(Admin $admin, array $data): Admin { if (! empty($data['identity'])) { if (! $this->exists($data['identity'])) { $admin->setIdentity($data['identity']); } elseif ($admin->getIdentity() !== $data['identity']) { - throw new \Frontend\App\Exception\ORMException('An account with this identity already exists'); + throw IdentityException::duplicate(); } } if (! empty($data['password'])) { diff --git a/src/Admin/templates/admin/list.html.twig b/src/Admin/templates/admin/list.html.twig index 67aed94b..d062dd53 100644 --- a/src/Admin/templates/admin/list.html.twig +++ b/src/Admin/templates/admin/list.html.twig @@ -68,19 +68,33 @@ diff --git a/src/App/assets/js/components/_admin.js b/src/App/assets/js/components/_admin.js index c25ce104..b30ceede 100644 --- a/src/App/assets/js/components/_admin.js +++ b/src/App/assets/js/components/_admin.js @@ -26,7 +26,7 @@ $(document).ready(() => { return; } - request('POST', form.attr('action'), new FormData(form.get(0))) + request(form.attr('method'), form.attr('action'), new FormData(form.get(0))) .then(data => { messages.html(''); messages.append( @@ -54,7 +54,6 @@ $(document).ready(() => { }); }); - $(document).on('click', '#adminEditBtn', () => { const selections = $("#bsTable").bootstrapTable('getSelections'); if (selections.length !== 1) { @@ -77,16 +76,18 @@ $(document).ready(() => { return; } - adminDeleteModal.find('.modal-form').html(`Are you sure you want to delete ${selections[0].identity}?`); + adminDeleteModal.find('#adminIdentity').html(`${selections[0].identity}`); adminDeleteModal.modal('show'); }); - $(document).on('click', '#modalDeleteBtn', () => { + $("#deleteAdminForm").on('submit', (e) => { + e.preventDefault(); const selections = $("#bsTable").bootstrapTable('getSelections'); - const messages = adminDeleteModal.find('.modal-messages'); - request('DELETE', `/admin/delete/${selections[0].uuid}`) + const form = $('#deleteAdminForm'); + const messages = $(form).find('.modal-messages'); + messages.html(''); + request('POST', `/admin/delete/${selections[0].uuid}`, new FormData(form.get(0))) .then(data => { - messages.html(''); messages.append( $('
    ').prop({ innerHTML: data.message, @@ -97,17 +98,22 @@ $(document).ready(() => { bsTable.bootstrapTable('refresh'); setTimeout(function () { adminDeleteModal.modal('hide'); + messages.html(''); },1500); }).catch(error => { - messages.append( - $('
    ').prop({ - innerHTML: error.cause, - className: 'alert alert-danger', - role: "alert" - }) - ); - }).finally(() => { - adminDeleteModal.modal('show'); - }); + messages.append( + $('
    ').prop({ + innerHTML: error.cause, + className: 'alert alert-danger', + role: "alert" + }) + ); + }).finally(() => { + adminDeleteModal.modal('show'); + }); + }); + + adminDeleteModal.on('show.bs.modal', 'hidden.bs.modal', function () { + adminDeleteModal.find('#confirmation').prop('checked', false); }); }); diff --git a/src/App/src/Exception/IdentityException.php b/src/App/src/Exception/IdentityException.php new file mode 100644 index 00000000..52295201 --- /dev/null +++ b/src/App/src/Exception/IdentityException.php @@ -0,0 +1,20 @@ +isPost()) { - return new JsonResponse([ - 'error' => [ - 'messages' => [ - [Message::METHOD_NOT_ALLOWED], - ], - ], - ], StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED); - } - $data = json_decode($this->getRequest()->getBody()->getContents(), true); $identifier = $this->getRequest()->getAttribute('identifier'); $value = $data['value'] ?? null; @@ -100,16 +90,6 @@ public function storeSettingAction(): JsonResponse public function getSettingAction(): JsonResponse { - if (! $this->isGet()) { - return new JsonResponse([ - 'error' => [ - 'messages' => [ - [Message::METHOD_NOT_ALLOWED], - ], - ], - ], StatusCodeInterface::STATUS_METHOD_NOT_ALLOWED); - } - $identifier = $this->getRequest()->getAttribute('identifier'); $inputFilter = new SettingInputFilter(); $inputFilter->setData([ diff --git a/test/Unit/Admin/Form/AdminFormTest.php b/test/Unit/Admin/Form/AdminFormTest.php index 9b9a7f0e..0a1835d4 100644 --- a/test/Unit/Admin/Form/AdminFormTest.php +++ b/test/Unit/Admin/Form/AdminFormTest.php @@ -51,7 +51,7 @@ public function testFormWillSetDifferentInputFilter(): void $this->assertInstanceOf(AdminInputFilter::class, $oldInputFilter); $customInputFilter = new EditAdminInputFilter(); - $form->setDifferentInputFilter($customInputFilter); + $form->setInputFilter($customInputFilter); $newInputFilter = $form->getInputFilter(); $this->assertInstanceOf(EditAdminInputFilter::class, $newInputFilter);