1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 06:32:40 +01:00
invoiceninja/public/js/ninja.js

5 lines
114 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.21"}},{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
;if(r(e.cid)&&void 0===(e=function(e,t,n){if(o(e.error)&&i(e.errorComp))return e.errorComp;if(i(e.resolved))return e.resolved;if(o(e.loading)&&i(e.loadingComp))return e.loadingComp;if(!i(e.contexts)){var a=e.contexts=[n],c=!0,u=function(){for(var e=0,t=a.length;e<t;e++)a[e].$forceUpdate()},l=x(function(n){e.resolved=ae(n,t),c||u()}),f=x(function(t){i(e.errorComp)&&(e.error=!0,u())}),d=e(l,f);return s(d)&&("function"==typeof d.then?r(e.resolved)&&d.then(l,f):i(d.component)&&"function"==typeof d.component.then&&(d.component.then(l,f),i(d.error)&&(e.errorComp=ae(d.error,t)),i(d.loading)&&(e.loadingComp=ae(d.loading,t),0===d.delay?e.loading=!0:setTimeout(function(){r(e.resolved)&&r(e.error)&&(e.loading=!0,u())},d.delay||200)),i(d.timeout)&&setTimeout(function(){r(e.resolved)&&f(null)},d.timeout))),c=!1,e.loading?e.loadingComp:e.resolved}e.contexts.push(n)}(l=e,u,n)))return function(e,t,n,r,i){var o=Tr();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}(l,t,n,a,c);t=t||{},Ue(e),i(t.model)&&function(e,t){var n=e.model&&e.model.prop||"value",r=e.model&&e.model.event||"input";(t.props||(t.props={}))[n]=t.model.value;var o=t.on||(t.on={});i(o[r])?o[r]=[t.model.callback].concat(o[r]):o[r]=t.model.callback}(e.options,t);var f=function(e,t,n){var o=t.options.props;if(!r(o)){var a={},s=e.attrs,c=e.props;if(i(s)||i(c))for(var u in o){var l=Zn(u);re(a,c,u,l,!0)||re(a,s,u,l,!1)}return a}}(t,e);if(o(e.options.functional))return function(e,t,n,r,o){var a=e.options,s={},c=a.props;if(i(c))for(var u in c)s[u]=H(u,c,t||Gn);else i(n.attrs)&&Be(s,n.attrs),i(n.props)&&Be(s,n.props);var l=new Pe(n,s,o,r,e),f=a.render.call(null,l._c,l);if(f instanceof Ir)return Me(f,n,l.parent,a);if(Array.isArray(f)){for(var d=ie(f)||[],p=new Array(d.length),v=0;v<d.length;v++)p[v]=Me(d[v],n,l.parent,a);return p}}(e,f,t,n,a);var d=t.on;if(t.on=t.nativeOn,o(e.options.abstract)){var p=t.slot;t={},p&&(t.slot=p)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<ai.length;n++){var r=ai[n];t[r]=oi[r]}}(t);var v=e.options.name||c;return new Ir("vue-component-"+e.cid+(v?"-"+v:""),t,void 0,void 0,void 0,n,{Ctor:e,propsData:f,listeners:d,tag:c,children:a},l)}}}function Ve(e,t,n,c,u,l){return(Array.isArray(n)||a(n))&&(u=c,c=n,n=void 0),o(l)&&(u=ci),function(e,t,n,a,c){if(i(n)&&i(n.__ob__))return Tr();if(i(n)&&i(n.is)&&(t=n.is),!t)return Tr();Array.isArray(a)&&"function"==typeof a[0]&&((n=n||{}).scopedSlots={default:a[0]},a.length=0),c===ci?a=ie(a):c===si&&(a=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(a));var u,l;if("string"==typeof t){var f;l=e.$vnode&&e.$vnode.ns||or.getTagNamespace(t),u=or.isReservedTag(t)?new Ir(or.parsePlatformTagName(t),n,a,void 0,void 0,e):i(f=G(e.$options,"components",t))?Fe(f,n,e,a,t):new Ir(t,n,a,void 0,void 0,e)}else u=Fe(t,n,e,a);return Array.isArray(u)?u:i(u)?(i(l)&&function e(t,n,a){if(t.ns=n,"foreignObject"===t.tag&&(n=void 0,a=!0),i(t.children))for(var s=0,c=t.children.length;s<c;s++){var u=t.children[s];i(u.tag)&&(r(u.ns)||o(a)&&"svg"!==u.tag)&&e(u,n,a)}}(u,l),i(n)&&function(e){s(e.style)&&Y(e.style),s(e.class)&&Y(e.class)}(n),u):Tr()}(e,t,n,c,u)}function Ue(e){var t=e.options;if(e.super){var n=Ue(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.extendOptions,i=e.sealedOptions;for(var o in n)n[o]!==i[o]&&(t||(t={}),t[o]=Ge(n[o],r[o],i[o]));return t}(e);r&&y(e.extendOptions,r),(t=e.options=U(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Ge(e,t,n){if(Array.isArray(e)){var r=[];n=Array.isArray(n)?n:[n],t=Array.isArray(t)?t:[t];for(var i=0;i<e.length;i++)(t.indexOf(e[i])>=0||n.indexOf(e[i])<0)&&r.push(e[i]);return r}return e}function He(e){this._init(e)}function qe(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=U(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(
;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag)return(r||Tn)(a,t);var s=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Rn(i)||i.ifConditions&&i.ifConditions.some(function(e){return Rn(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(o,t.maybeComponent):0,c=i||Pn;return"["+o.map(function(e){return c(e,t)}).join(",")+"]"+(s?","+s:"")}}function Rn(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function Pn(e,t){return 1===e.type?Tn(e,t):3===e.type&&e.isComment?(r=e,"_e("+JSON.stringify(r.text)+")"):"_v("+(2===(n=e).type?n.expression:Bn(JSON.stringify(n.text)))+")";var n,r}function Mn(e){for(var t="",n=0;n<e.length;n++){var r=e[n];t+='"'+r.name+'":'+Bn(r.value)+","}return t.slice(0,-1)}function Bn(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Fn(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),b}}function Vn(e){return($a=$a||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',$a.innerHTML.indexOf("&#10;")>0}var Un,Gn=Object.freeze({}),Hn=Object.prototype.toString,qn=p("slot,component",!0),Kn=p("key,ref,slot,slot-scope,is"),Wn=Object.prototype.hasOwnProperty,zn=/-(\w)/g,Jn=m(function(e){return e.replace(zn,function(e,t){return t?t.toUpperCase():""})}),Qn=m(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),Xn=/\B([A-Z])/g,Zn=m(function(e){return e.replace(Xn,"-$1").toLowerCase()}),Yn=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n},er=function(e,t,n){return!1},tr=function(e){return e},nr="data-server-rendered",rr=["component","directive","filter"],ir=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],or={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:er,isReservedAttr:er,isUnknownElement:er,getTagNamespace:b,parsePlatformTagName:tr,mustUseProp:er,_lifecycleHooks:ir},ar=/[^\w.$]/,sr="__proto__"in{},cr="undefined"!=typeof window,ur="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,lr=ur&&WXEnvironment.platform.toLowerCase(),fr=cr&&window.navigator.userAgent.toLowerCase(),dr=fr&&/msie|trident/.test(fr),pr=fr&&fr.indexOf("msie 9.0")>0,vr=fr&&fr.indexOf("edge/")>0,hr=(fr&&fr.indexOf("android"),fr&&/iphone|ipad|ipod|ios/.test(fr)||"ios"===lr),mr=(fr&&/chrome\/\d+/.test(fr),{}.watch),gr=!1;if(cr)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){gr=!0}}),window.addEventListener("test-passive",null,yr)}catch(e){}var _r,br=function(){return void 0===Un&&(Un=!cr&&!ur&&void 0!==t&&"server"===t.process.env.VUE_ENV),Un},wr=cr&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Cr="undefined"!=typeof Symbol&&$(Symbol)&&"undefined"!=typeof Reflect&&$(Reflect.ownKeys);_r="undefined"!=typeof Set&&$(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var xr=b,Ar=0,Or=function(){this.id=Ar++,this.subs=[]};Or.prototype.addSub=function(e){this.subs.push(e)},Or.prototype.removeSub=function(e){v(this.subs,e)},Or.prototype.depend=function(){Or.target&&Or.target.addDep(this)},Or.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},Or.target=null;var $r=[],Ir=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnc
transformNode:function(e,t){t.warn;var n=xt(e,"style");n&&(e.staticStyle=JSON.stringify(Ji(n)));var r=Ct(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},$o=function(e){return(bo=bo||document.createElement("div")).innerHTML=e,bo.textContent},Io=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),ko=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),To=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Eo=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,So="[a-zA-Z_][\\w\\-\\.]*",No="((?:"+So+"\\:)?"+So+")",Lo=new RegExp("^<"+No),Do=/^\s*(\/?)>/,jo=new RegExp("^<\\/"+No+"[^>]*>"),Ro=/^<!DOCTYPE [^>]+>/i,Po=/^<!\--/,Mo=/^<!\[/,Bo=!1;"x".replace(/x(.)?/g,function(e,t){Bo=""===t});var Fo,Vo,Uo,Go,Ho,qo,Ko,Wo,zo,Jo,Qo=p("script,style,textarea",!0),Xo={},Zo={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t"},Yo=/&(?:lt|gt|quot|amp);/g,ea=/&(?:lt|gt|quot|amp|#10|#9);/g,ta=p("pre,textarea",!0),na=function(e,t){return e&&ta(e)&&"\n"===t[0]},ra=/^@|^v-on:/,ia=/^v-|^@|^:/,oa=/([^]*?)\s+(?:in|of)\s+([^]*)/,aa=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,sa=/^\(|\)$/g,ca=/:(.*)$/,ua=/^:|^v-bind:/,la=/\.[^.]+/g,fa=m($o),da=/^xmlns:NS\d+/,pa=/^NS\d+:/,va=[Ao,Oo,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Ct(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=xt(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=xt(e,"v-else",!0),s=xt(e,"v-else-if",!0),c=xn(e);bn(c),_t(c,"type","checkbox"),_n(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,wn(c,{exp:c.if,block:c});var u=xn(e);xt(u,"v-for",!0),_t(u,"type","radio"),_n(u,t),wn(c,{exp:"("+n+")==='radio'"+o,block:u});var l=xn(e);return xt(l,"v-for",!0),_t(l,":type",n),_n(l,t),wn(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}}],ha={expectHTML:!0,modules:va,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return At(e,r,i),!1;if("select"===o)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";r=r+" "+Ot(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),wt(e,"change",r,null,!0)}(e,r,i);else if("input"===o&&"checkbox"===a)!function(e,t,n){var r=n&&n.number,i=Ct(e,"value")||"null",o=Ct(e,"true-value")||"true",a=Ct(e,"false-value")||"false";gt(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),wt(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Ot(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Ot(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Ot(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Ct(e,"value")||"null";gt(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),wt(e,"change",Ot(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?qi:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Ot(t,l);c&&(f="if($event.target.composing)return;"+f),gt(e,"value","("+t+")"),wt(e,u,f,null,!0),(s||a)&&wt(e,"blur","$forceUpdate()")}(e,r,i);else if(!or.isReservedTag(o))return At(e,r,i),!1;return!0},text:function(e,t){t.value&&gt(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&gt(e,"innerHTML","_s("+t.value