mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-21 00:50:07 +00:00
8 lines
93 KiB
JavaScript
8 lines
93 KiB
JavaScript
|
|
function $n(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ai}=Object.prototype,{getPrototypeOf:qt}=Object,Je=(e=>t=>{const n=Ai.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),L=e=>(e=e.toLowerCase(),t=>Je(t)===e),Ge=e=>t=>typeof t===e,{isArray:ce}=Array,Se=Ge("undefined");function Pi(e){return e!==null&&!Se(e)&&e.constructor!==null&&!Se(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Bn=L("ArrayBuffer");function Mi(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Bn(e.buffer),t}const Ri=Ge("string"),R=Ge("function"),In=Ge("number"),Xe=e=>e!==null&&typeof e=="object",Di=e=>e===!0||e===!1,Ue=e=>{if(Je(e)!=="object")return!1;const t=qt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ni=L("Date"),ki=L("File"),Fi=L("Blob"),Ui=L("FileList"),Li=e=>Xe(e)&&R(e.pipe),$i=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=Je(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},Bi=L("URLSearchParams"),Ii=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ce(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),ce(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(r=0;r<o;r++)s=a[r],t.call(null,e[s],s,e)}}function jn(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Wn=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Hn=e=>!Se(e)&&e!==Wn;function Et(){const{caseless:e}=Hn(this)&&this||{},t={},n=(r,i)=>{const a=e&&jn(t,i)||i;Ue(t[a])&&Ue(r)?t[a]=Et(t[a],r):Ue(r)?t[a]=Et({},r):ce(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ce(arguments[r],n);return t}const ji=(e,t,n,{allOwnKeys:r}={})=>(Ce(t,(i,a)=>{n&&R(i)?e[a]=$n(i,n):e[a]=i},{allOwnKeys:r}),e),Wi=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Hi=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},qi=(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&qt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Yi=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},zi=e=>{if(!e)return null;if(ce(e))return e;let t=e.length;if(!In(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ki=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qt(Uint8Array)),Vi=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},Ji=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Gi=L("HTMLFormElement"),Xi=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),gn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Qi=L("RegExp"),qn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ce(n,(i,a)=>{t(i,a,e)!==!1&&(r[a]=i)}),Object.defineProperties(e,r)},Zi=e=>{qn(e,(t,n)=>{if(R(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(R(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ea=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return ce(e)?r(e):r(String(e).split(t)),n},ta=()=>{},na=(e,t)=>(e=+e,Number.isFinite(e)?e:t),pt="abcdefghijklmnopqrstuvwxyz",_n="0123456789",Yn={DIGIT:_n,ALPHA:pt,ALPHA_DIGIT:pt+pt.toUpperCase()+_n},ra=(e=16,t=Yn.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function ia(e){return!!(e&&R(e.
|
||
|
|
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&Ea[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},bn=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function Le(e){return e===!1||e==null?e:f.isArray(e)?e.map(Le):String(e)}function Oa(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Ta=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mt(e,t,n,r,i){if(f.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!f.isString(t)){if(f.isString(r))return t.indexOf(r)!==-1;if(f.isRegExp(r))return r.test(t)}}function Ca(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Aa(e,t){const n=f.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,a,o){return this[r].call(this,t,i,a,o)},configurable:!0})})}class et{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function a(s,c,u){const l=me(c);if(!l)throw new Error("header name must be a non-empty string");const d=f.findKey(i,l);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||c]=Le(s))}const o=(s,c)=>f.forEach(s,(u,l)=>a(u,l,c));return f.isPlainObject(t)||t instanceof this.constructor?o(t,n):f.isString(t)&&(t=t.trim())&&!Ta(t)?o(Sa(t),n):t!=null&&a(n,t,r),this}get(t,n){if(t=me(t),t){const r=f.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Oa(i);if(f.isFunction(n))return n.call(this,i,r);if(f.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=me(t),t){const r=f.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||mt(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function a(o){if(o=me(o),o){const s=f.findKey(r,o);s&&(!n||mt(r,r[s],s,n))&&(delete r[s],i=!0)}}return f.isArray(t)?t.forEach(a):a(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!t||mt(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const n=this,r={};return f.forEach(this,(i,a)=>{const o=f.findKey(r,a);if(o){n[o]=Le(i),delete n[a];return}const s=t?Ca(a):String(a).trim();s!==a&&delete n[a],n[s]=Le(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return f.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&f.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
|
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[bn]=this[bn]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=me(o);r[s]||(Aa(i,o),r[s]=!0)}return f.isArray(t)?t.forEach(a):a(t),this}}et.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);f.freezeMethods(et.prototype);f.freezeMethods(et);const B=et;function gt(e,t){const n=this||zt,r=t||n,i=B.from(r.headers);let a=r.data;return f.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Zn(e){return!!(e&&e.__CANCEL__)}function Ae(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}f.inherits(Ae,y,{__CANCEL__:!0});function Pa(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Ma=U.isStandardBrowserEnv?function(){return{write:function(n,r,i,a,o,s){const c=[];c.push(n+"="+encodeURIComponent(r)),f.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),f.isString(a)&&c.push("path="+a),f.isString(o)&&c.push("domain="+o),s===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ra(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Da(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function er(e,t){return e&&!Ra(t)?Da(e,t):t}const Na=U.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(a){let o=a;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const s=f.isString(o)?i(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function ka(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Fa(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),l=r[a];o||(o=u),n[i]=c,r[i]=u;let d=a,p=0;for(;d!==i;)p+=n[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const g=l&&u-l;return g?Math.round(p*1e3/g):void 0}}function xn(e,t){let n=0;const r=Fa(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,c=r(s),u=a<=o;n=a;const l={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&u?(o-a)/c:void 0,event:i};l[t?"download":"upload"]=!0,e(l)}}const Ua=typeof XMLHttpRequest<"u",La=Ua&&function(e){return new Promise(function(n,r){let i=e.data;const a=B.from(e.headers).normalize(),o=e.responseType;let s;function c(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}f.isFormData(i)&&(U.isStandardBrowserEnv||U.isStandardBrowserWebWorkerEnv?a.setContentType(!1):a.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const g=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(g+":"+h))}const l=er(e.baseURL,e.url);u.open(e.method.toUpperCase(),Gn(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function d(){if(!u)return;const g=B.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),_={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:g,config:e,request:u};Pa(function(v){n
|
||
|
|
|
||
|
|
${n?'Expression: "'+n+`"
|
||
|
|
|
||
|
|
`:""}`,t),setTimeout(()=>{throw e},0)}var Ie=!0;function mr(e){let t=Ie;Ie=!1;let n=e();return Ie=t,n}function ee(e,t,n={}){let r;return A(e,t)(i=>r=i,n),r}function A(...e){return gr(...e)}var gr=_r;function oo(e){gr=e}function _r(e,t){let n={};Dt(n,e);let r=[n,...se(e)],i=typeof t=="function"?so(r,t):co(r,t,e);return ao.bind(null,e,t,i)}function so(e,t){return(n=()=>{},{scope:r={},params:i=[]}={})=>{let a=t.apply(Re([r,...e]),i);He(n,a)}}var yt={};function uo(e,t){if(yt[e])return yt[e];let n=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(async()=>{ ${e} })()`:e,a=(()=>{try{return new n(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`)}catch(o){return Oe(o,t,e),Promise.resolve()}})();return yt[e]=a,a}function co(e,t,n){let r=uo(t,n);return(i=()=>{},{scope:a={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=Re([a,...e]);if(typeof r=="function"){let c=r(r,s).catch(u=>Oe(u,n,t));r.finished?(He(i,r.result,s,o,n),r.result=void 0):c.then(u=>{He(i,u,s,o,n)}).catch(u=>Oe(u,n,t)).finally(()=>r.result=void 0)}}}function He(e,t,n,r,i){if(Ie&&typeof t=="function"){let a=t.apply(n,r);a instanceof Promise?a.then(o=>He(e,o,n,r)).catch(o=>Oe(o,i,t)):e(a)}else typeof t=="object"&&t instanceof Promise?t.then(a=>e(a)):e(t)}var tn="x-";function de(e=""){return tn+e}function lo(e){tn=e}var Nt={};function S(e,t){return Nt[e]=t,{before(n){if(!Nt[n]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}const r=Q.indexOf(n);Q.splice(r>=0?r:Q.indexOf("DEFAULT"),0,e)}}}function nn(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let a=Object.entries(e._x_virtualDirectives).map(([s,c])=>({name:s,value:c})),o=vr(a);a=a.map(s=>o.find(c=>c.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),t=t.concat(a)}let r={};return t.map(Er((a,o)=>r[a]=o)).filter(Or).map(po(r,n)).sort(mo).map(a=>ho(e,a))}function vr(e){return Array.from(e).map(Er()).filter(t=>!Or(t))}var kt=!1,we=new Map,yr=Symbol();function fo(e){kt=!0;let t=Symbol();yr=t,we.set(t,[]);let n=()=>{for(;we.get(t).length;)we.get(t).shift()();we.delete(t)},r=()=>{kt=!1,n()};e(n),r()}function wr(e){let t=[],n=s=>t.push(s),[r,i]=Ga(e);return t.push(i),[{Alpine:Ne,effect:r,cleanup:n,evaluateLater:A.bind(A,e),evaluate:ee.bind(ee,e)},()=>t.forEach(s=>s())]}function ho(e,t){let n=()=>{},r=Nt[t.type]||n,[i,a]=wr(e);Za(e,t.original,a);let o=()=>{e._x_ignore||e._x_ignoreSelf||(r.inline&&r.inline(e,t,i),r=r.bind(r,e,t,i),kt?we.get(yr).push(r):r())};return o.runCleanups=a,o}var br=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r}),xr=e=>e;function Er(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:i}=Sr.reduce((a,o)=>o(a),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:i}}}var Sr=[];function rn(e){Sr.push(e)}function Or({name:e}){return Tr().test(e)}var Tr=()=>new RegExp(`^${tn}([^:^.]+)\\b`);function po(e,t){return({name:n,value:r})=>{let i=n.match(Tr()),a=n.match(/:([a-zA-Z0-9\-:]+)/),o=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[n]||n;return{type:i?i[1]:null,value:a?a[1]:null,modifiers:o.map(c=>c.replace(".","")),expression:r,original:s}}}var Ft="DEFAULT",Q=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",Ft,"teleport"];function mo(e,t){let n=Q.indexOf(e.type)===-1?Ft:e.type,r=Q.indexOf(t.type)===-1?Ft:t.type;return Q.indexOf(n)-Q.indexOf(r)}function xe(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function z(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>z(i,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let r=e.firstElementChild;for(;r;)z(r,t),r=r.nextElementSibling}function K(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Cn=!1;function go(){Cn&&K("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Cn=!0,document.body||K("Unable to initialize. Trying to load A
|