1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/public/js/ninja.js

5 lines
101 KiB
JavaScript
Raw Normal View History

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jquery"),require("perfect-scrollbar")):"function"==typeof define&&define.amd?define(["exports","jquery","perfect-scrollbar"],t):t(e.coreui={},e.jQuery,e.PerfectScrollbar)}(this,function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}t=t&&t.hasOwnProperty("default")?t.default:t,n=n&&n.hasOwnProperty("default")?n.default:n;var o=function(e){var t="ajaxLoad",n=e.fn[t],r={ACTIVE:"active",NAV_PILLS:"nav-pills",NAV_TABS:"nav-tabs",OPEN:"open",VIEW_SCRIPT:"view-script"},o={CLICK:"click"},a={HEAD:"head",NAV_DROPDOWN:".sidebar-nav .nav-dropdown",NAV_LINK:".sidebar-nav .nav-link",NAV_ITEM:".sidebar-nav .nav-item",VIEW_SCRIPT:".view-script"},s={defaultPage:"main.html",errorPage:"404.html",subpagesDirectory:"views/"},c=function(){function t(e,t){this._config=this._getConfig(t),this._element=e;var n=location.hash.replace(/^#/,"");""!==n?this.setUpUrl(n):this.setUpUrl(this._config.defaultPage),this._addEventListeners()}var n=t.prototype;return n.loadPage=function(t){var n=this._element,i=this._config,o=function e(t,n){void 0===n&&(n=0);var i=document.createElement("script");i.type="text/javascript",i.src=t[n],i.className=r.VIEW_SCRIPT,i.onload=i.onreadystatechange=function(){this.readyState&&"complete"!==this.readyState||t.length>n+1&&e(t,n+1)},document.getElementsByTagName("body")[0].appendChild(i)};e.ajax({type:"GET",url:i.subpagesDirectory+t,dataType:"html",beforeSend:function(){e(a.VIEW_SCRIPT).remove()},success:function(r){var i=document.createElement("div");i.innerHTML=r;var a=Array.from(i.querySelectorAll("script")).map(function(e){return e.attributes.getNamedItem("src").nodeValue});i.querySelectorAll("script").forEach(function(e){return e.parentNode.removeChild(e)}),e("body").animate({scrollTop:0},0),e(n).html(i),a.length&&o(a),window.location.hash=t},error:function(){window.location.href=i.errorPage}})},n.setUpUrl=function(t){e(a.NAV_LINK).removeClass(r.ACTIVE),e(a.NAV_DROPDOWN).removeClass(r.OPEN),e(a.NAV_DROPDOWN+':has(a[href="'+t.replace(/^\//,"").split("?")[0]+'"])').addClass(r.OPEN),e(a.NAV_ITEM+' a[href="'+t.replace(/^\//,"").split("?")[0]+'"]').addClass(r.ACTIVE),this.loadPage(t)},n.loadBlank=function(e){window.open(e)},n.loadTop=function(e){window.location=e},n._getConfig=function(e){return e=Object.assign({},s,e)},n._addEventListeners=function(){var t=this;e(document).on(o.CLICK,a.NAV_LINK+'[href!="#"]',function(e){e.preventDefault(),e.stopPropagation(),"_top"===e.currentTarget.target?t.loadTop(e.currentTarget.href):"_blank"===e.currentTarget.target?t.loadBlank(e.currentTarget.href):t.setUpUrl(e.currentTarget.getAttribute("href"))})},t._jQueryInterface=function(n){return this.each(function(){var r=e(this).data("coreui.ajaxLoad"),i="object"==typeof n&&n;r||(r=new t(this,i),e(this).data("coreui.ajaxLoad",r))})},i(t,null,[{key:"VERSION",get:function(){return"2.0.18"}},{key:"Default",get:function(){return s}}]),t}();return e.fn[t]=c._jQueryInterface,e.fn[t].Constructor=c,e.fn[t].noConflict=function(){return e.fn[t]=n,c._jQueryInterface},c}(t),a=function(e){return-1!==e.map(function(e){return document.body.classList.contains(e)}).indexOf(!0)},s=function(e,t){var n=t.indexOf(e),r=t.slice(0,n+1);a(r)?r.map(function(e){return document.body.classList.remove(e)}):document.body.classList.add(e)},c=function(e){var t="aside-menu",n="coreui.aside-menu",r=e.fn[t],o={CLICK:"click",LOAD_DATA_API:"load.coreui.aside-menu.data-api",TOGGLE:"toggle"},a={BODY:"body",ASIDE_MENU:".aside-menu",ASIDE_MENU_TOGGLER:".aside-menu-toggler"},c=["aside-menu-show","aside-menu-sm-show","aside-menu-md-show","aside-menu-lg-show","aside-menu-xl-show"],u=function(){function t(e){this._element=e,this._addEventListeners()}return t.prototype._addEventListeners=function(){e(a.ASIDE_MENU_TOGGLER).on(o.CLICK,function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget.dat
return Array.isArray(e)?function(e){for(var t,n="",r=0,o=e.length;r<o;r++)i(t=Ye(e[r]))&&""!==t&&(n&&(n+=" "),n+=t);return n}(e):s(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}function et(e){return Si(e)?"svg":"math"===e?"math":void 0}function tt(e){if("string"==typeof e){return document.querySelector(e)||document.createElement("div")}return e}function nt(e,t){var n=e.data.ref;if(i(n)){var r=e.context,o=e.componentInstance||e.elm,a=r.$refs;t?Array.isArray(a[n])?v(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}function rt(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&i(e.data)===i(t.data)&&function(e,t){if("input"!==e.tag)return!0;var n,r=i(n=e.data)&&i(n=n.attrs)&&n.type,o=i(n=t.data)&&i(n=n.attrs)&&n.type;return r===o||Li(r)&&Li(o)}(e,t)||o(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&r(t.asyncFactory.error))}function it(e,t,n){var r,o,a={};for(r=t;r<=n;++r)i(o=e[r].key)&&(a[o]=r);return a}function ot(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,o=e===Pi,a=t===Pi,s=at(e.data.directives,e.context),c=at(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,ct(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(ct(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)ct(u[n],"inserted",t,e)};o?ne(t,"insert",f):f()}if(l.length&&ne(t,"postpatch",function(){for(var n=0;n<l.length;n++)ct(l[n],"componentUpdated",t,e)}),!o)for(n in s)c[n]||ct(s[n],"unbind",e,e,a)}(e,t)}function at(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=Fi),i[st(r)]=r,r.def=H(t.$options,"directives",r.name);return i}function st(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function ct(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){q(r,n.context,"directive "+e.name+" "+t+" hook")}}function ut(e,t){var n=t.componentOptions;if(!(i(n)&&!1===n.Ctor.options.inheritAttrs||r(e.data.attrs)&&r(t.data.attrs))){var o,a,s=t.elm,c=e.data.attrs||{},u=t.data.attrs||{};for(o in i(u.__ob__)&&(u=t.data.attrs=y({},u)),u)a=u[o],c[o]!==a&&lt(s,o,a);for(o in(dr||vr)&&u.value!==c.value&&lt(s,"value",u.value),c)r(u[o])&&(Ii(o)?s.removeAttributeNS(xi,Oi(o)):Ai(o)||s.removeAttribute(o))}}function lt(e,t,n){e.tagName.indexOf("-")>-1?ft(e,t,n):$i(t)?Ti(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Ai(t)?e.setAttribute(t,Ti(n)||"false"===n?"false":"true"):Ii(t)?Ti(n)?e.removeAttributeNS(xi,Oi(t)):e.setAttributeNS(xi,t,n):ft(e,t,n)}function ft(e,t,n){if(Ti(n))e.removeAttribute(t);else{if(dr&&!pr&&"TEXTAREA"===e.tagName&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}function dt(e,t){var n=t.elm,o=t.data,a=e.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Ze(t),c=n._transitionClasses;i(c)&&(s=Xe(s,Ye(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}function pt(e){function t(){(a||(a=[])).push(e.slice(v,i).trim()),v=i+1}var n,r,i,o,a,s=!1,c=!1,u=!1,l=!1,f=0,d=0,p=0,v=0;for(i=0;i<e.length;i++)if(r=n,n=e.charCodeAt(i),s)39===n&&92!==r&&(s=!1);else if(c)34===n&&92!==r&&(c=!1);else if(u)96===n&&92!==r&&(u=!1);else if(l)47===n&&92!==r&&(l=!1);else if(124!==n||124===e.charCodeAt(i+1)||124===e.charCodeAt(i-1)||f||d||p){switch(n){case 34:c=!0;break;case 39:s=!0;break;case 96:u=!0;break;case 40:p++;break;case 41:p--;break;case 91:d++;break;case 93:d--;break;case 123:f++;break;case 125:f--}if(47===n){for(var h=i-1,m=void 0;h>=0&&" "===(m=e.charAt(h));h--);m&&Gi.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==v&&t(),a)for(i=0;i<a.length;i++)o=vt(o,a[i]);return o}function vt(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";va
jr[e+"s"]=B}),jr.watch=function(e,t,n,r){if(e===mr&&(e=void 0),t===mr&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in y(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},jr.props=jr.methods=jr.inject=jr.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return y(i,e),t&&y(i,t),i},jr.provide=V;var Mr,Pr,Rr=function(e,t){return void 0===t?e:t},Vr=[],Fr=!1,Br=!1;if(void 0!==n&&I(n))Pr=function(){n(Q)};else if("undefined"==typeof MessageChannel||!I(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString())Pr=function(){setTimeout(Q,0)};else{var Ur=new MessageChannel,Hr=Ur.port2;Ur.port1.onmessage=Q,Pr=function(){Hr.postMessage(1)}}if("undefined"!=typeof Promise&&I(Promise)){var Gr=Promise.resolve();Mr=function(){Gr.then(Q),hr&&setTimeout(b)}}else Mr=Pr;var Kr,Wr=new _r,zr=m(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}}),qr=null,Jr=[],Zr=[],Qr={},Xr=!1,Yr=!1,ei=0,ti=0,ni=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ti,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new _r,this.newDepIds=new _r,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!ar.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get()};ni.prototype.get=function(){var e;O(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;q(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Y(e),T(),this.cleanupDeps()}return e},ni.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},ni.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ni.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==Qr[t]){if(Qr[t]=!0,Yr){for(var n=Jr.length-1;n>ei&&Jr[n].id>e.id;)n--;Jr.splice(n+1,0,e)}else Jr.push(e);Xr||(Xr=!0,X(ye))}}(this)},ni.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||s(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){q(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},ni.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ni.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},ni.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var ri={enumerable:!0,configurable:!0,get:b,set:b},ii={lazy:!0};Me(Pe.prototype);var oi={init:function(e,t,n,r){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var o=e;oi.prepatch(o,o)}else(e.componentInstance=function(e,t,n,r){var o={_isComponent:!0,parent:t,_parentVnode:e,_parentElm:n||null,_refElm:r||null},a=e.data.inlineTemplate;return i(a)&&(o.render=a.render,o.staticRenderFns=a.staticRenderFns),new e.componentOptions.Ctor(o)}(e,qr,n,r)).$mount(t?e.elm:void 0,t)},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,r,i){var o=!!(i||e.$options._renderChildren||r.data.scopedSlots||e.$scopedSlots!==Hn);if(e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=i,e.$attrs=r.data.attrs||Hn,e.$listeners=n||Hn,t&&e.$options.props){S(!1);for(var a=e._props,s=e.$op
right:wa("'button' in $event && $event.button !== 2")},Aa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:b},$a=function(e){this.options=e,this.warn=e.warn||ht,this.transforms=mt(e.modules,"transformCode"),this.dataGenFns=mt(e.modules,"genData"),this.directives=y(y({},Aa),e.directives);var t=e.isReservedTag||er;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]};new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)");var xa,Ia,Oa=(xa=function(e,t){var n=yn(e.trim(),t);!1!==t.optimize&&$n(n,t);var r=Tn(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],o=[];if(r.warn=function(e,t){(t?o:i).push(e)},n)for(var a in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=y(Object.create(e.directives||null),n.directives)),n)"modules"!==a&&"directives"!==a&&(r[a]=n[a]);var s=xa(t,r);return s.errors=i,s.tips=o,s}return{compile:t,compileToFunctions:function(e){var t=Object.create(null);return function(n,r,i){(r=y({},r)).warn,delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},c=[];return s.render=Fn(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Fn(e,c)}),t[o]=s}}(t)}})(ha).compileToFunctions,Ta=!!cr&&Bn(!1),ka=!!cr&&Bn(!0),Ea=m(function(e){var t=tt(e);return t&&t.innerHTML}),Sa=Ge.prototype.$mount;Ge.prototype.$mount=function(e,t){if((e=e&&tt(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ea(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=Oa(r,{shouldDecodeNewlines:Ta,shouldDecodeNewlinesForHref:ka,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Sa.call(this,e,t)},Ge.compile=Oa,e.exports=Ge}).call(t,n("DuR2"),n("162o").setImmediate)},MxN9:function(e,t){e.exports={render:function(){return this.$createElement,this._self._c,this._m(0)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"container"},[t("div",{staticClass:"row justify-content-center"},[t("div",{staticClass:"col-md-8"},[t("div",{staticClass:"card card-default"},[t("div",{staticClass:"card-header"},[this._v("Example Component")]),this._v(" "),t("div",{staticClass:"card-body"},[this._v("\n I'm an example component.\n ")])])])])])}]}},"VU/8":function(e,t){e.exports=function(e,t,n,r,i,o){var a,s=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(a=e,s=e.default);var u,l="function"==typeof s?s.options:s;if(t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId=i),o?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=u):r&&(u=r),u){var f=l.functional,d=f?l.render:l.beforeCreate;f?(l._injectStyles=u,l.render=function(e,t){return u.call(t),d(e,t)}):l.beforeCreate=d?[].concat(d,u):[u]}return{esModule:a,exports:s,options:l}}},W2nU:function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defin