zoneminder/web/skins/classic/js/bootstrap-table-auto-refres...

11 lines
14 KiB
JavaScript

/**
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
*
* @version v1.17.1
* @homepage https://bootstrap-table.com
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=function(t){return t&&t.Math==Math&&t},u=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r&&r)||Function("return this")(),c=function(t){try{return!!t()}catch(t){return!0}},f=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,l={f:s&&!a.call({1:2},1)?function(t){var e=s(this,t);return!!e&&e.enumerable}:a},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,y=function(t){return h.call(t).slice(8,-1)},d="".split,b=c((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==y(t)?d.call(t,""):Object(t)}:Object,v=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return b(v(t))},m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t,e){if(!m(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!m(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},O={}.hasOwnProperty,S=function(t,e){return O.call(t,e)},j=u.document,R=m(j)&&m(j.createElement),T=function(t){return R?j.createElement(t):{}},A=!f&&!c((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),P=Object.getOwnPropertyDescriptor,E={f:f?P:function(t,e){if(t=g(t),e=w(e,!0),A)try{return P(t,e)}catch(t){}if(S(t,e))return p(!l.f.call(t,e),t[e])}},x=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},_=Object.defineProperty,I={f:f?_:function(t,e,n){if(x(t),e=w(e,!0),x(n),A)try{return _(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},k=f?function(t,e,n){return I.f(t,e,p(1,n))}:function(t,e,n){return t[e]=n,t},C=function(t,e){try{k(u,t,e)}catch(n){u[t]=e}return e},F="__core-js_shared__",M=u[F]||C(F,{}),D=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return D.call(t)});var B,L,N,q=M.inspectSource,z=u.WeakMap,W="function"==typeof z&&/native code/.test(q(z)),$=o((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),G=0,K=Math.random(),Q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+K).toString(36)},V=$("keys"),X=function(t){return V[t]||(V[t]=Q(t))},Y={},H=u.WeakMap;if(W){var J=new H,U=J.get,Z=J.has,tt=J.set;B=function(t,e){return tt.call(J,t,e),e},L=function(t){return U.call(J,t)||{}},N=function(t){return Z.call(J,t)}}else{var et=X("state");Y[et]=!0,B=function(t,e){return k(t,et,e),e},L=function(t){return S(t,et)?t[et]:{}},N=function(t){return S(t,et)}}var nt,rt,ot={set:B,get:L,has:N,enforce:function(t){return N(t)?L(t):B(t,{})},getterFor:function(t){return function(e){var n;if(!m(e)||(n=L(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},it=o((function(t){var e=ot.get,n=ot.enforce,r=String(String).split("String");(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,f=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||S(o,"name")||k(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==u?(c?!a&&t[e]&&(f=!0):delete t[e],f?t[e]=o:k(t,e,o)):f?t[e]=o:C(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||q(this)}))})),ut=u,ct=function(t){return"function"==typeof t?t:void 0},ft=function(t,e){return arguments.length<2?ct(ut[t])||ct(u[t]):ut[t]&&ut[t][e]||u[t]&&u[t][e]},at=Math.ceil,st=Math.floor,lt=function(t){return isNaN(t=+t)?0:(t>0?st:at)(t)},pt=Math.min,ht=function(t){return t>0?pt(lt(t),9007199254740991):0},yt=Math.max,dt=Math.min,bt=function(t){return function(e,n,r){var o,i=g(e),u=ht(i.length),c=function(t,e){var n=lt(t);return n<0?yt(n+e,0):dt(n,e)}(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},vt={includes:bt(!0),indexOf:bt(!1)}.indexOf,gt=function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!S(Y,n)&&S(r,n)&&i.push(n);for(;e.length>o;)S(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i},mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],wt=mt.concat("length","prototype"),Ot={f:Object.getOwnPropertyNames||function(t){return gt(t,wt)}},St={f:Object.getOwnPropertySymbols},jt=ft("Reflect","ownKeys")||function(t){var e=Ot.f(x(t)),n=St.f;return n?e.concat(n(t)):e},Rt=function(t,e){for(var n=jt(e),r=I.f,o=E.f,i=0;i<n.length;i++){var u=n[i];S(t,u)||r(t,u,o(e,u))}},Tt=/#|\.prototype\./,At=function(t,e){var n=Et[Pt(t)];return n==_t||n!=xt&&("function"==typeof e?c(e):!!e)},Pt=At.normalize=function(t){return String(t).replace(Tt,".").toLowerCase()},Et=At.data={},xt=At.NATIVE="N",_t=At.POLYFILL="P",It=At,kt=E.f,Ct=function(t,e){var n,r,o,i,c,f=t.target,a=t.global,s=t.stat;if(n=a?u:s?u[f]||C(f,{}):(u[f]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=kt(n,r))&&c.value:n[r],!It(a?r:f+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Rt(i,o)}(t.sham||o&&o.sham)&&k(i,"sham",!0),it(n,r,i,t)}},Ft=Array.isArray||function(t){return"Array"==y(t)},Mt=function(t){return Object(v(t))},Dt=function(t,e,n){var r=w(e);r in t?I.f(t,r,p(0,n)):t[r]=n},Bt=!!Object.getOwnPropertySymbols&&!c((function(){return!String(Symbol())})),Lt=Bt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Nt=$("wks"),qt=u.Symbol,zt=Lt?qt:qt&&qt.withoutSetter||Q,Wt=function(t){return S(Nt,t)||(Bt&&S(qt,t)?Nt[t]=qt[t]:Nt[t]=zt("Symbol."+t)),Nt[t]},$t=Wt("species"),Gt=function(t,e){var n;return Ft(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Ft(n.prototype)?m(n)&&null===(n=n[$t])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Kt=ft("navigator","userAgent")||"",Qt=u.process,Vt=Qt&&Qt.versions,Xt=Vt&&Vt.v8;Xt?rt=(nt=Xt.split("."))[0]+nt[1]:Kt&&(!(nt=Kt.match(/Edge\/(\d+)/))||nt[1]>=74)&&(nt=Kt.match(/Chrome\/(\d+)/))&&(rt=nt[1]);var Yt,Ht=rt&&+rt,Jt=Wt("species"),Ut=Wt("isConcatSpreadable"),Zt=9007199254740991,te="Maximum allowed index exceeded",ee=Ht>=51||!c((function(){var t=[];return t[Ut]=!1,t.concat()[0]!==t})),ne=(Yt="concat",Ht>=51||!c((function(){var t=[];return(t.constructor={})[Jt]=function(){return{foo:1}},1!==t[Yt](Boolean).foo}))),re=function(t){if(!m(t))return!1;var e=t[Ut];return void 0!==e?!!e:Ft(t)};Ct({target:"Array",proto:!0,forced:!ee||!ne},{concat:function(t){var e,n,r,o,i,u=Mt(this),c=Gt(u,0),f=0;for(e=-1,r=arguments.length;e<r;e++)if(re(i=-1===e?u:arguments[e])){if(f+(o=ht(i.length))>Zt)throw TypeError(te);for(n=0;n<o;n++,f++)n in i&&Dt(c,f,i[n])}else{if(f>=Zt)throw TypeError(te);Dt(c,f++,i)}return c.length=f,c}});var oe,ie=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ue=[].push,ce=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,u=5==t||i;return function(c,f,a,s){for(var l,p,h=Mt(c),y=b(h),d=ie(f,a,3),v=ht(y.length),g=0,m=s||Gt,w=e?m(c,v):n?m(c,0):void 0;v>g;g++)if((u||g in y)&&(p=d(l=y[g],g,h),t))if(e)w[g]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return g;case 2:ue.call(w,l)}else if(o)return!1;return i?-1:r||o?o:w}},fe={forEach:ce(0),map:ce(1),filter:ce(2),some:ce(3),every:ce(4),find:ce(5),findIndex:ce(6)},ae=Object.keys||function(t){return gt(t,mt)},se=f?Object.defineProperties:function(t,e){x(t);for(var n,r=ae(e),o=r.length,i=0;o>i;)I.f(t,n=r[i++],e[n]);return t},le=ft("document","documentElement"),pe=X("IE_PROTO"),he=function(){},ye=function(t){return"<script>"+t+"</"+"script>"},de=function(){try{oe=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;de=oe?function(t){t.write(ye("")),t.close();var e=t.parentWindow.Object;return t=null,e}(oe):((e=T("iframe")).style.display="none",le.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(ye("document.F=Object")),t.close(),t.F);for(var n=mt.length;n--;)delete de.prototype[mt[n]];return de()};Y[pe]=!0;var be=Object.create||function(t,e){var n;return null!==t?(he.prototype=x(t),n=new he,he.prototype=null,n[pe]=t):n=de(),void 0===e?n:se(n,e)},ve=Wt("unscopables"),ge=Array.prototype;null==ge[ve]&&I.f(ge,ve,{configurable:!0,value:be(null)});var me,we=Object.defineProperty,Oe={},Se=function(t){throw t},je=fe.find,Re="find",Te=!0,Ae=function(t,e){if(S(Oe,t))return Oe[t];e||(e={});var n=[][t],r=!!S(e,"ACCESSORS")&&e.ACCESSORS,o=S(e,0)?e[0]:Se,i=S(e,1)?e[1]:void 0;return Oe[t]=!!n&&!c((function(){if(r&&!f)return!0;var t={length:-1};r?we(t,1,{enumerable:!0,get:Se}):t[1]=1,n.call(t,o,i)}))}(Re);function Pe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xe(t){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _e(t,e){return(_e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ie(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=xe(t);if(e){var o=xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ie(this,n)}}function Ce(t,e,n){return(Ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}Re in[]&&Array(1).find((function(){Te=!1})),Ct({target:"Array",proto:!0,forced:Te||!Ae},{find:function(t){return je(this,t,arguments.length>1?arguments[1]:void 0)}}),me=Re,ge[ve][me]=!0;var Fe=n.default.fn.bootstrapTable.utils;n.default.extend(n.default.fn.bootstrapTable.defaults,{autoRefresh:!1,autoRefreshInterval:60,autoRefreshSilent:!0,autoRefreshStatus:!0,autoRefreshFunction:null}),n.default.extend(n.default.fn.bootstrapTable.defaults.icons,{autoRefresh:{bootstrap3:"glyphicon-time icon-time",materialize:"access_time","bootstrap-table":"icon-clock"}[n.default.fn.bootstrapTable.theme]||"fa-clock"}),n.default.extend(n.default.fn.bootstrapTable.locales,{formatAutoRefresh:function(){return"Auto Refresh"}}),n.default.extend(n.default.fn.bootstrapTable.defaults,n.default.fn.bootstrapTable.locales),n.default.BootstrapTable=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_e(t,e)}(u,t);var e,r,o,i=ke(u);function u(){return Pe(this,u),i.apply(this,arguments)}return e=u,(r=[{key:"init",value:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];(t=Ce(xe(u.prototype),"init",this)).call.apply(t,[this].concat(r)),this.options.autoRefresh&&this.options.autoRefreshStatus&&(this.options.autoRefreshFunction=setInterval((function(){e.refresh({silent:e.options.autoRefreshSilent})}),1e3*this.options.autoRefreshInterval))}},{key:"initToolbar",value:function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];if((t=Ce(xe(u.prototype),"initToolbar",this)).call.apply(t,[this].concat(r)),this.options.autoRefresh){var i=this.$toolbar.find(">.columns"),c=i.find(".auto-refresh");c.length||(c=n.default('\n <button class="auto-refresh '.concat(this.constants.buttonsClass,"\n ").concat(this.options.autoRefreshStatus?" ".concat(this.constants.classes.buttonActive):"",'"\n type="button" title="').concat(this.options.formatAutoRefresh(),'">\n ').concat(this.options.showButtonIcons?Fe.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.autoRefresh):"","\n ").concat(this.options.showButtonText?this.options.formatAutoRefresh():"","\n </button>\n ")).appendTo(i)).on("click",n.default.proxy(this.toggleAutoRefresh,this))}}},{key:"toggleAutoRefresh",value:function(){var t=this;this.options.autoRefresh&&(this.options.autoRefreshStatus?(clearInterval(this.options.autoRefreshFunction),this.$toolbar.find(">.columns").find(".auto-refresh").removeClass(this.constants.classes.buttonActive)):(this.options.autoRefreshFunction=setInterval((function(){t.refresh({silent:t.options.autoRefreshSilent})}),1e3*this.options.autoRefreshInterval),this.$toolbar.find(">.columns").find(".auto-refresh").addClass(this.constants.classes.buttonActive)),this.options.autoRefreshStatus=!this.options.autoRefreshStatus)}}])&&Ee(e.prototype,r),o&&Ee(e,o),u}(n.default.BootstrapTable)}));