From b13a4e101639ef7efb61dc38676373b5a8dad3e1 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 01:29:20 +0100 Subject: [PATCH] Auto commit for release 'develop' on 2024-02-15 --- .../FireflyIIIOrg/Update/UpdateRequest.php | 5 +- composer.lock | 122 +++++++-------- package-lock.json | 6 +- ...{create-af0e6c17.js => create-6378bb8a.js} | 2 +- ...b341.js => create-empty-split-aae839d5.js} | 2 +- ...oard-d1d540db.js => dashboard-5ef2eea4.js} | 2 +- .../{edit-a939c15a.js => edit-a6845b23.js} | 2 +- ...y-03f73825.js => format-money-62afb78b.js} | 2 +- .../{get-7f8692a5.js => get-5b4283ca.js} | 2 +- .../{get-10f1237b.js => get-ea675e30.js} | 2 +- .../{index-089e7bf2.js => index-78b5f723.js} | 2 +- ...js => parse-downloaded-splits-6b9adc20.js} | 2 +- .../{put-d747f13c.js => put-c9d3942f.js} | 2 +- .../{show-7827ee8e.js => show-c2b3bd03.js} | 2 +- ...lice-errors-into-transactions-528a3749.js} | 2 +- ...{vendor-cc723e37.js => vendor-2609b2c9.js} | 2 +- public/build/manifest.json | 140 +++++++++--------- resources/lang/bg_BG/firefly.php | 2 + resources/lang/ca_ES/firefly.php | 2 + resources/lang/cs_CZ/firefly.php | 2 + resources/lang/da_DK/firefly.php | 2 + resources/lang/de_DE/firefly.php | 2 + resources/lang/el_GR/firefly.php | 2 + resources/lang/en_GB/firefly.php | 2 + resources/lang/es_ES/firefly.php | 2 + resources/lang/fi_FI/firefly.php | 2 + resources/lang/fr_FR/firefly.php | 2 + resources/lang/hu_HU/firefly.php | 2 + resources/lang/id_ID/firefly.php | 2 + resources/lang/it_IT/firefly.php | 2 + resources/lang/ja_JP/firefly.php | 2 + resources/lang/ko_KR/firefly.php | 2 + resources/lang/nb_NO/firefly.php | 2 + resources/lang/nl_NL/firefly.php | 2 + resources/lang/nn_NO/firefly.php | 2 + resources/lang/pl_PL/firefly.php | 4 +- resources/lang/pt_BR/firefly.php | 2 + resources/lang/pt_PT/firefly.php | 2 + resources/lang/ro_RO/firefly.php | 2 + resources/lang/ru_RU/firefly.php | 2 + resources/lang/sk_SK/firefly.php | 2 + resources/lang/sl_SI/firefly.php | 2 + resources/lang/sv_SE/firefly.php | 2 + resources/lang/th_TH/firefly.php | 2 + resources/lang/tr_TR/firefly.php | 2 + resources/lang/uk_UA/firefly.php | 2 + resources/lang/vi_VN/firefly.php | 2 + resources/lang/zh_CN/firefly.php | 2 + resources/lang/zh_TW/firefly.php | 2 + 49 files changed, 213 insertions(+), 152 deletions(-) rename public/build/assets/{create-af0e6c17.js => create-6378bb8a.js} (97%) rename public/build/assets/{create-empty-split-d82bb341.js => create-empty-split-aae839d5.js} (93%) rename public/build/assets/{dashboard-d1d540db.js => dashboard-5ef2eea4.js} (98%) rename public/build/assets/{edit-a939c15a.js => edit-a6845b23.js} (94%) rename public/build/assets/{format-money-03f73825.js => format-money-62afb78b.js} (99%) rename public/build/assets/{get-7f8692a5.js => get-5b4283ca.js} (81%) rename public/build/assets/{get-10f1237b.js => get-ea675e30.js} (75%) rename public/build/assets/{index-089e7bf2.js => index-78b5f723.js} (97%) rename public/build/assets/{parse-downloaded-splits-fb2d62df.js => parse-downloaded-splits-6b9adc20.js} (91%) rename public/build/assets/{put-d747f13c.js => put-c9d3942f.js} (55%) rename public/build/assets/{show-7827ee8e.js => show-c2b3bd03.js} (98%) rename public/build/assets/{splice-errors-into-transactions-e53c1920.js => splice-errors-into-transactions-528a3749.js} (98%) rename public/build/assets/{vendor-cc723e37.js => vendor-2609b2c9.js} (98%) diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index 16f56f4393..27629a99c4 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -131,10 +131,6 @@ class UpdateRequest implements UpdateRequestInterface /** * TODO make shorter - * - * @param array $information - * - * @return array */ private function parseResult(array $information): array { @@ -150,6 +146,7 @@ class UpdateRequest implements UpdateRequestInterface if (str_starts_with($current, 'develop')) { Log::debug(sprintf('User is running develop version "%s"', $current)); $parts = explode('/', $current); + /** @var Carbon $devDate */ $devDate = Carbon::createFromFormat('Y-m-d', $parts[1]); diff --git a/composer.lock b/composer.lock index 8d51023dc6..470d251fed 100644 --- a/composer.lock +++ b/composer.lock @@ -542,16 +542,16 @@ }, { "name": "doctrine/dbal", - "version": "3.8.1", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "c9ea252cdce4da324ede3d6c5913dd89f769afd2" + "reference": "a19a1d05ca211f41089dffcc387733a6875196cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/c9ea252cdce4da324ede3d6c5913dd89f769afd2", - "reference": "c9ea252cdce4da324ede3d6c5913dd89f769afd2", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/a19a1d05ca211f41089dffcc387733a6875196cb", + "reference": "a19a1d05ca211f41089dffcc387733a6875196cb", "shasum": "" }, "require": { @@ -635,7 +635,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.8.1" + "source": "https://github.com/doctrine/dbal/tree/3.8.2" }, "funding": [ { @@ -651,7 +651,7 @@ "type": "tidelift" } ], - "time": "2024-02-03T17:33:49+00:00" + "time": "2024-02-12T18:36:36+00:00" }, { "name": "doctrine/deprecations", @@ -2219,16 +2219,16 @@ }, { "name": "laravel/passport", - "version": "v11.10.4", + "version": "v11.10.5", "source": { "type": "git", "url": "https://github.com/laravel/passport.git", - "reference": "8a75495f431e52df2ffa178851c402d7a5e8f037" + "reference": "4d81207941d6efc198857847d9e4c17520f28d75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/passport/zipball/8a75495f431e52df2ffa178851c402d7a5e8f037", - "reference": "8a75495f431e52df2ffa178851c402d7a5e8f037", + "url": "https://api.github.com/repos/laravel/passport/zipball/4d81207941d6efc198857847d9e4c17520f28d75", + "reference": "4d81207941d6efc198857847d9e4c17520f28d75", "shasum": "" }, "require": { @@ -2293,7 +2293,7 @@ "issues": "https://github.com/laravel/passport/issues", "source": "https://github.com/laravel/passport" }, - "time": "2024-01-30T15:44:09+00:00" + "time": "2024-02-09T16:27:49+00:00" }, { "name": "laravel/prompts", @@ -8990,36 +8990,36 @@ "packages-dev": [ { "name": "barryvdh/laravel-debugbar", - "version": "v3.9.2", + "version": "v3.10.4", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1" + "reference": "09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/bfd0131c146973cab164e50f5cdd8a67cc60cab1", - "reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d", + "reference": "09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d", "shasum": "" }, "require": { - "illuminate/routing": "^9|^10", - "illuminate/session": "^9|^10", - "illuminate/support": "^9|^10", - "maximebf/debugbar": "^1.18.2", + "illuminate/routing": "^9|^10|^11", + "illuminate/session": "^9|^10|^11", + "illuminate/support": "^9|^10|^11", + "maximebf/debugbar": "~1.20.1", "php": "^8.0", - "symfony/finder": "^6" + "symfony/finder": "^6|^7" }, "require-dev": { "mockery/mockery": "^1.3.3", - "orchestra/testbench-dusk": "^5|^6|^7|^8", + "orchestra/testbench-dusk": "^5|^6|^7|^8|^9", "phpunit/phpunit": "^8.5.30|^9.0", "squizlabs/php_codesniffer": "^3.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.8-dev" + "dev-master": "3.10-dev" }, "laravel": { "providers": [ @@ -9058,7 +9058,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-debugbar/issues", - "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.9.2" + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.10.4" }, "funding": [ { @@ -9070,43 +9070,43 @@ "type": "github" } ], - "time": "2023-08-25T18:43:57+00:00" + "time": "2024-02-14T08:52:12+00:00" }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.14.0", + "version": "v2.15.0", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "485c756f6cff408d6b273274c5e86112c3973d98" + "reference": "dca3ebe81ea385632651791cb8b3db42153c380c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/485c756f6cff408d6b273274c5e86112c3973d98", - "reference": "485c756f6cff408d6b273274c5e86112c3973d98", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/dca3ebe81ea385632651791cb8b3db42153c380c", + "reference": "dca3ebe81ea385632651791cb8b3db42153c380c", "shasum": "" }, "require": { "barryvdh/reflection-docblock": "^2.0.6", "composer/class-map-generator": "^1.0", - "doctrine/dbal": "^2.6 || ^3", + "doctrine/dbal": "^2.6 || ^3.1.4", "ext-json": "*", - "illuminate/console": "^8 || ^9 || ^10", - "illuminate/filesystem": "^8 || ^9 || ^10", - "illuminate/support": "^8 || ^9 || ^10", + "illuminate/console": "^9 || ^10", + "illuminate/filesystem": "^9 || ^10", + "illuminate/support": "^9 || ^10", "nikic/php-parser": "^4.18 || ^5", - "php": "^7.3 || ^8.0", + "php": "^8.0", "phpdocumentor/type-resolver": "^1.1.0" }, "require-dev": { "ext-pdo_sqlite": "*", - "friendsofphp/php-cs-fixer": "^2", - "illuminate/config": "^8 || ^9 || ^10", - "illuminate/view": "^8 || ^9 || ^10", + "friendsofphp/php-cs-fixer": "^3", + "illuminate/config": "^9 || ^10", + "illuminate/view": "^9 || ^10", "mockery/mockery": "^1.4", - "orchestra/testbench": "^6 || ^7 || ^8", - "phpunit/phpunit": "^8.5 || ^9", - "spatie/phpunit-snapshot-assertions": "^3 || ^4", + "orchestra/testbench": "^7 || ^8", + "phpunit/phpunit": "^9", + "spatie/phpunit-snapshot-assertions": "^4", "vimeo/psalm": "^5.4" }, "suggest": { @@ -9115,7 +9115,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.14-dev" + "dev-master": "2.15-dev" }, "laravel": { "providers": [ @@ -9152,7 +9152,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", - "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.14.0" + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.15.0" }, "funding": [ { @@ -9164,7 +9164,7 @@ "type": "github" } ], - "time": "2024-02-05T08:16:36+00:00" + "time": "2024-02-14T11:19:26+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -9550,16 +9550,16 @@ }, { "name": "larastan/larastan", - "version": "v2.8.1", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "b7cc6a29c457a7d4f3de90466392ae9ad3e17022" + "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/b7cc6a29c457a7d4f3de90466392ae9ad3e17022", - "reference": "b7cc6a29c457a7d4f3de90466392ae9ad3e17022", + "url": "https://api.github.com/repos/larastan/larastan/zipball/35fa9cbe1895e76215bbe74571a344f2705fbe01", + "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01", "shasum": "" }, "require": { @@ -9627,7 +9627,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.8.1" + "source": "https://github.com/larastan/larastan/tree/v2.9.0" }, "funding": [ { @@ -9647,26 +9647,26 @@ "type": "patreon" } ], - "time": "2024-01-08T09:11:17+00:00" + "time": "2024-02-13T11:49:22+00:00" }, { "name": "maximebf/debugbar", - "version": "v1.19.1", + "version": "v1.20.1", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523" + "reference": "06ebf922ccedfa4cc43015825697ee8c1fb80f7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/03dd40a1826f4d585ef93ef83afa2a9874a00523", - "reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/06ebf922ccedfa4cc43015825697ee8c1fb80f7e", + "reference": "06ebf922ccedfa4cc43015825697ee8c1fb80f7e", "shasum": "" }, "require": { "php": "^7.1|^8", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^4|^5|^6" + "symfony/var-dumper": "^4|^5|^6|^7" }, "require-dev": { "phpunit/phpunit": ">=7.5.20 <10.0", @@ -9680,7 +9680,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-master": "1.20-dev" } }, "autoload": { @@ -9711,9 +9711,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.19.1" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.20.1" }, - "time": "2023-10-12T08:10:52+00:00" + "time": "2024-02-13T19:03:14+00:00" }, { "name": "mockery/mockery", @@ -10318,16 +10318,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.57", + "version": "1.10.58", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" + "reference": "a23518379ec4defd9e47cbf81019526861623ec2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a23518379ec4defd9e47cbf81019526861623ec2", + "reference": "a23518379ec4defd9e47cbf81019526861623ec2", "shasum": "" }, "require": { @@ -10376,7 +10376,7 @@ "type": "tidelift" } ], - "time": "2024-01-24T11:51:34+00:00" + "time": "2024-02-12T20:02:57+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", diff --git a/package-lock.json b/package-lock.json index 706ec44c44..354a918aa3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -530,9 +530,9 @@ "integrity": "sha512-6Z7vzlVBJduPUi7U1MPRBzoXmJf8ob9tGcUNxxos6qU1bbjPX7Li30r1Dhtk55hSBfPmVuN7p6zahF7G38xtWA==" }, "node_modules/bootstrap5-tags": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.0.tgz", - "integrity": "sha512-FyOKAvC1nYMIrTMhyx7KbiBDGkOQETU5ozJwUf+jCIwyuy/QcRnaq3jCFOl7KhYRySbZXGr1zbAZ/fmtGitMLQ==" + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.1.tgz", + "integrity": "sha512-qBgtw8E4b+zNfNGPNZAaiC4oR2QSI2OWQYx523S03+ZFXPFUU7fJyMA4ynTYG2CE6hpy3e8HB5Lx9nWn1jrlNA==" }, "node_modules/braces": { "version": "3.0.2", diff --git a/public/build/assets/create-af0e6c17.js b/public/build/assets/create-6378bb8a.js similarity index 97% rename from public/build/assets/create-af0e6c17.js rename to public/build/assets/create-6378bb8a.js index 2f84867264..d70fe0fa9c 100644 --- a/public/build/assets/create-af0e6c17.js +++ b/public/build/assets/create-6378bb8a.js @@ -1 +1 @@ -import{a as m,d as y,f as d}from"./format-money-03f73825.js";import{d as w,c as b}from"./create-empty-split-d82bb341.js";import{l as v,a as C,b as T,c as _,p as E,d as P,s as L,e as c,f as S,g as D,h as A,i as x,j as k,k as h,m as p}from"./splice-errors-into-transactions-e53c1920.js";import{l,i as r,m as B}from"./vendor-cc723e37.js";import"./get-7f8692a5.js";class M{post(t){let s="/api/v2/transactions";return m.post(s,t)}}let n=[],u=[];document.addEventListener("location-remove",e=>{u[e.detail.index].remove()});function O(e){let t=0;if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].hasLocation===!1){u[t]=new l.marker(e.latlng,{draggable:!0}),u[t].on("dragend",U),u[t].addTo(n[t]);const i=new CustomEvent("location-set",{detail:{latitude:e.latlng.lat,longitude:e.latlng.lng,index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(i)}}function F(e){let t=0;const s=new CustomEvent("location-zoom",{detail:{index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(s)}function U(e){let t=e.target,s=t.getLatLng();t.setLatLng(new l.LatLng(s.lat,s.lng),{draggable:"true"});const i=new CustomEvent("location-move",{detail:{latitude:s.lat,longitude:s.lng,index:0}});document.dispatchEvent(i)}function z(e){if(e>0){console.warn("Corwardly refuse to add a map on split #"+(e+1));return}if(typeof n[e]>"u"){let t=document.getElementById("location_map");t&&(n[e]=l.map(t).setView([t.dataset.latitude,t.dataset.longitude],t.dataset.zoomLevel),l.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© OpenStreetMap'}).addTo(n[e]),n[e].on("click",O),n[e].on("zoomend",F))}}const a=k();let I=function(){return{entries:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"create",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},filters:{source:[],destination:[]},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){this.detectTransactionType()},changedSourceAccount(e){this.detectTransactionType()},detectTransactionType(){const e=this.entries[0].source_account.type??"unknown",t=this.entries[0].destination_account.type??"unknown";if(e==="unknown"&&t==="unknown"){this.groupProperties.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(e===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)){this.groupProperties.transactionType="transfer",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log("filter down currencies for transfer."),this.filterNativeCurrencies(this.entries[0].source_account.currency_code),this.filterForeignCurrencies(this.entries[0].destination_account.currency_code);return}if(e==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="withdrawal",console.log('[a] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Asset account"&&t==="unknown"){this.groupProperties.transactionType="withdrawal",console.log('[b] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log(this.entries[0].source_account),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Expense account"){this.groupProperties.transactionType="withdrawal",console.log('[c] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Asset account"){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}console.warn('Unknown account combination between "'+e+'" and "'+t+'".')},formattedTotalAmount(){return this.entries.length===0?d(this.groupProperties.totalAmount,"EUR"):d(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},filterForeignCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.foreignCurrencies=t,t.length===1&&t[0].code===this.entries[0].source_account.currency_code&&(console.log("Foreign currency is same as source currency. Disable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!1),t.length===1&&t[0].code!==this.entries[0].source_account.currency_code&&(console.log("Foreign currency is NOT same as source currency. Enable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!0);for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].foreign_currency_code=e)},filterNativeCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.nativeCurrencies=t;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].currency_code=e)},changedAmount(e){const t=parseInt(e.target.dataset.index);this.entries[t].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let s in this.entries)this.entries.hasOwnProperty(s)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[s].amount))},addedSplit(){},processUpload(e){this.showMessageOrRedirectUser()},processUploadError(e){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_upload"),console.error(e)},init(){this.addSplit(),v().then(e=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=e.defaultCurrency,this.formData.enabledCurrencies=e.enabledCurrencies,this.formData.nativeCurrencies=e.nativeCurrencies,this.formData.foreignCurrencies=e.foreignCurrencies}),C().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),T().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),_().then(e=>{this.formData.subscriptions=e,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",e=>{this.processUpload(e),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",e=>{this.processUploadError(e)}),document.addEventListener("location-move",e=>{this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude}),document.addEventListener("location-set",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),document.addEventListener("location-zoom",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].errors=w());this.formStates.isSubmitting=!0,this.detectTransactionType();let e=E(this.entries,null,this.groupProperties.transactionType),t={group_title:this.groupProperties.title,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:e};this.groupProperties.title===null&&e.length>1&&(t.group_title=e[0].description);let s=new M;console.log(t),s.post(t).then(i=>{const o=i.data.data;if(this.groupProperties.id=parseInt(o.id),this.groupProperties.title=o.attributes.group_title??o.attributes.transactions[0].description,P(this.groupProperties.id,o.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=r.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(i=>{this.submitting=!1,console.log(i),typeof i.response<"u"&&this.parseErrors(i.response.data)})},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=r.t("firefly.stored_journal_js",{description:this.groupProperties.title}),this.formStates.resetButton&&(this.entries=[],this.addSplit(),this.groupProperties.totalAmount=0);return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=created"},parseErrors(e){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_submission_v2",{errorMessage:e.message}),e.hasOwnProperty("errors")&&(this.entries=L(e.errors,this.entries))},addSplit(){this.entries.push(b()),setTimeout(()=>{B.init("select.ac-tags",{allowClear:!0,server:a.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:r.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}});const e=this.entries.length-1;z(e);const t=function(s,i,o){return s.name_with_balance+'
'+r.t("firefly.account_type_"+s.type)+""};c({selector:"input.ac-source",serverUrl:a.account,onChange:S,onSelectItem:D,hiddenValue:this.entries[e].source_account.alpine_name}),c({selector:"input.ac-dest",serverUrl:a.account,filters:this.filters.destination,onRenderItem:t,onChange:A,onSelectItem:x}),c({selector:"input.ac-category",serverUrl:a.category,valueField:"id",labelField:"name",onChange:h,onSelectItem:h}),c({selector:"input.ac-description",serverUrl:a.description,valueField:"id",labelField:"description",onChange:p,onSelectItem:p})},150)},removeSplit(e){this.entries.splice(e,1),document.querySelector("#split-0-tab").click()},clearLocation(e){e.preventDefault();const t=e.currentTarget,s=parseInt(t.attributes["data-index"].value);this.entries[s].hasLocation=!1,this.entries[s].latitude=null,this.entries[s].longitude=null,this.entries[s].zoomLevel=null;const i=new CustomEvent("location-remove",{detail:{index:s}});return document.dispatchEvent(i),!1}}},f={transactions:I,dates:y};function g(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),g()});window.bootstrapped&&(console.log("Loaded through window variable."),g()); +import{a as m,d as y,f as d}from"./format-money-62afb78b.js";import{d as w,c as b}from"./create-empty-split-aae839d5.js";import{l as v,a as C,b as T,c as _,p as E,d as P,s as L,e as c,f as S,g as D,h as A,i as x,j as k,k as h,m as p}from"./splice-errors-into-transactions-528a3749.js";import{l,i as r,m as B}from"./vendor-2609b2c9.js";import"./get-5b4283ca.js";class M{post(t){let s="/api/v2/transactions";return m.post(s,t)}}let n=[],u=[];document.addEventListener("location-remove",e=>{u[e.detail.index].remove()});function O(e){let t=0;if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].hasLocation===!1){u[t]=new l.marker(e.latlng,{draggable:!0}),u[t].on("dragend",U),u[t].addTo(n[t]);const i=new CustomEvent("location-set",{detail:{latitude:e.latlng.lat,longitude:e.latlng.lng,index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(i)}}function F(e){let t=0;const s=new CustomEvent("location-zoom",{detail:{index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(s)}function U(e){let t=e.target,s=t.getLatLng();t.setLatLng(new l.LatLng(s.lat,s.lng),{draggable:"true"});const i=new CustomEvent("location-move",{detail:{latitude:s.lat,longitude:s.lng,index:0}});document.dispatchEvent(i)}function z(e){if(e>0){console.warn("Corwardly refuse to add a map on split #"+(e+1));return}if(typeof n[e]>"u"){let t=document.getElementById("location_map");t&&(n[e]=l.map(t).setView([t.dataset.latitude,t.dataset.longitude],t.dataset.zoomLevel),l.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© OpenStreetMap'}).addTo(n[e]),n[e].on("click",O),n[e].on("zoomend",F))}}const a=k();let I=function(){return{entries:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"create",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},filters:{source:[],destination:[]},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){this.detectTransactionType()},changedSourceAccount(e){this.detectTransactionType()},detectTransactionType(){const e=this.entries[0].source_account.type??"unknown",t=this.entries[0].destination_account.type??"unknown";if(e==="unknown"&&t==="unknown"){this.groupProperties.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(e===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)){this.groupProperties.transactionType="transfer",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log("filter down currencies for transfer."),this.filterNativeCurrencies(this.entries[0].source_account.currency_code),this.filterForeignCurrencies(this.entries[0].destination_account.currency_code);return}if(e==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="withdrawal",console.log('[a] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Asset account"&&t==="unknown"){this.groupProperties.transactionType="withdrawal",console.log('[b] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log(this.entries[0].source_account),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Expense account"){this.groupProperties.transactionType="withdrawal",console.log('[c] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Asset account"){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}console.warn('Unknown account combination between "'+e+'" and "'+t+'".')},formattedTotalAmount(){return this.entries.length===0?d(this.groupProperties.totalAmount,"EUR"):d(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},filterForeignCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.foreignCurrencies=t,t.length===1&&t[0].code===this.entries[0].source_account.currency_code&&(console.log("Foreign currency is same as source currency. Disable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!1),t.length===1&&t[0].code!==this.entries[0].source_account.currency_code&&(console.log("Foreign currency is NOT same as source currency. Enable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!0);for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].foreign_currency_code=e)},filterNativeCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.nativeCurrencies=t;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].currency_code=e)},changedAmount(e){const t=parseInt(e.target.dataset.index);this.entries[t].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let s in this.entries)this.entries.hasOwnProperty(s)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[s].amount))},addedSplit(){},processUpload(e){this.showMessageOrRedirectUser()},processUploadError(e){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_upload"),console.error(e)},init(){this.addSplit(),v().then(e=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=e.defaultCurrency,this.formData.enabledCurrencies=e.enabledCurrencies,this.formData.nativeCurrencies=e.nativeCurrencies,this.formData.foreignCurrencies=e.foreignCurrencies}),C().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),T().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),_().then(e=>{this.formData.subscriptions=e,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",e=>{this.processUpload(e),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",e=>{this.processUploadError(e)}),document.addEventListener("location-move",e=>{this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude}),document.addEventListener("location-set",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),document.addEventListener("location-zoom",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].errors=w());this.formStates.isSubmitting=!0,this.detectTransactionType();let e=E(this.entries,null,this.groupProperties.transactionType),t={group_title:this.groupProperties.title,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:e};this.groupProperties.title===null&&e.length>1&&(t.group_title=e[0].description);let s=new M;console.log(t),s.post(t).then(i=>{const o=i.data.data;if(this.groupProperties.id=parseInt(o.id),this.groupProperties.title=o.attributes.group_title??o.attributes.transactions[0].description,P(this.groupProperties.id,o.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=r.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(i=>{this.submitting=!1,console.log(i),typeof i.response<"u"&&this.parseErrors(i.response.data)})},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=r.t("firefly.stored_journal_js",{description:this.groupProperties.title}),this.formStates.resetButton&&(this.entries=[],this.addSplit(),this.groupProperties.totalAmount=0);return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=created"},parseErrors(e){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_submission_v2",{errorMessage:e.message}),e.hasOwnProperty("errors")&&(this.entries=L(e.errors,this.entries))},addSplit(){this.entries.push(b()),setTimeout(()=>{B.init("select.ac-tags",{allowClear:!0,server:a.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:r.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}});const e=this.entries.length-1;z(e);const t=function(s,i,o){return s.name_with_balance+'
'+r.t("firefly.account_type_"+s.type)+""};c({selector:"input.ac-source",serverUrl:a.account,onChange:S,onSelectItem:D,hiddenValue:this.entries[e].source_account.alpine_name}),c({selector:"input.ac-dest",serverUrl:a.account,filters:this.filters.destination,onRenderItem:t,onChange:A,onSelectItem:x}),c({selector:"input.ac-category",serverUrl:a.category,valueField:"id",labelField:"name",onChange:h,onSelectItem:h}),c({selector:"input.ac-description",serverUrl:a.description,valueField:"id",labelField:"description",onChange:p,onSelectItem:p})},150)},removeSplit(e){this.entries.splice(e,1),document.querySelector("#split-0-tab").click()},clearLocation(e){e.preventDefault();const t=e.currentTarget,s=parseInt(t.attributes["data-index"].value);this.entries[s].hasLocation=!1,this.entries[s].latitude=null,this.entries[s].longitude=null,this.entries[s].zoomLevel=null;const i=new CustomEvent("location-remove",{detail:{index:s}});return document.dispatchEvent(i),!1}}},f={transactions:I,dates:y};function g(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),g()});window.bootstrapped&&(console.log("Loaded through window variable."),g()); diff --git a/public/build/assets/create-empty-split-d82bb341.js b/public/build/assets/create-empty-split-aae839d5.js similarity index 93% rename from public/build/assets/create-empty-split-d82bb341.js rename to public/build/assets/create-empty-split-aae839d5.js index 03624d4c6d..7c0e917984 100644 --- a/public/build/assets/create-empty-split-d82bb341.js +++ b/public/build/assets/create-empty-split-aae839d5.js @@ -1 +1 @@ -import{f as n}from"./vendor-cc723e37.js";function e(){return{id:"",name:"",alpine_name:""}}function o(){return{description:[],amount:[],currency_code:[],foreign_amount:[],foreign_currency_code:[],source_account:[],destination_account:[],budget_id:[],category_name:[],piggy_bank_id:[],bill_id:[],tags:[],notes:[],internal_reference:[],external_url:[],latitude:[],longitude:[],zoom_level:[],date:[],interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[]}}function d(){let t=n(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",foreign_amount:"",foreign_currency_code:"",source_account:e(),destination_account:e(),budget_id:null,category_name:"",piggy_bank_id:null,bill_id:null,tags:[],notes:"",internal_reference:"",external_url:"",hasLocation:!1,latitude:null,longitude:null,zoomLevel:null,date:t,interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",errors:o()}}export{d as c,o as d}; +import{f as n}from"./vendor-2609b2c9.js";function e(){return{id:"",name:"",alpine_name:""}}function o(){return{description:[],amount:[],currency_code:[],foreign_amount:[],foreign_currency_code:[],source_account:[],destination_account:[],budget_id:[],category_name:[],piggy_bank_id:[],bill_id:[],tags:[],notes:[],internal_reference:[],external_url:[],latitude:[],longitude:[],zoom_level:[],date:[],interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[]}}function d(){let t=n(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",foreign_amount:"",foreign_currency_code:"",source_account:e(),destination_account:e(),budget_id:null,category_name:"",piggy_bank_id:null,bill_id:null,tags:[],notes:"",internal_reference:"",external_url:"",hasLocation:!1,latitude:null,longitude:null,zoomLevel:null,date:t,interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",errors:o()}}export{d as c,o as d}; diff --git a/public/build/assets/dashboard-d1d540db.js b/public/build/assets/dashboard-5ef2eea4.js similarity index 98% rename from public/build/assets/dashboard-d1d540db.js rename to public/build/assets/dashboard-5ef2eea4.js index 2a9ef8c06a..13d03f11f7 100644 --- a/public/build/assets/dashboard-d1d540db.js +++ b/public/build/assets/dashboard-5ef2eea4.js @@ -1 +1 @@ -import{a as O,f,g as v,P as bt,d as wt}from"./format-money-03f73825.js";import{f as g,C as m,a as S,i as p,S as vt,F as mt,L as Ct,b as kt,A as Pt,B as Dt,T as xt,P as Ot,c as Mt,d as Ft,p as St,e as At,g as Bt,h as jt,j as Wt,k as It}from"./vendor-cc723e37.js";import{G as $t}from"./get-10f1237b.js";import{G as Vt,a as Kt}from"./get-7f8692a5.js";class Lt{get(e,n,a){return O.get("/api/v2/summary/basic",{params:{start:e,end:n,code:a}})}}function P(t,e,n){const a=g(e,"y-MM-dd")+"_"+g(n,"y-MM-dd")+"_"+t;return console.log("getCacheKey: "+a),String(a)}let U=!1;const Et=()=>({balanceBox:{amounts:[],subtitles:[]},billBox:{paid:[],unpaid:[]},leftBox:{left:[],perDay:[]},netBox:{net:[]},autoConversion:!1,loading:!1,boxData:null,boxOptions:null,getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-boxes-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.boxData=r,this.generateOptions(this.boxData);return}new Lt().get(g(t,"yyyy-MM-dd"),g(e,"yyyy-MM-dd"),null).then(i=>{this.boxData=i.data,window.store.set(n,i.data),this.generateOptions(this.boxData)})},generateOptions(t){this.balanceBox={amounts:[],subtitles:[]},this.billBox={paid:[],unpaid:[]},this.leftBox={left:[],perDay:[]},this.netBox={net:[]};let e={};for(const n in t)if(t.hasOwnProperty(n)){const a=t[n];if(!a.hasOwnProperty("key"))continue;let r=a.key;if(this.autoConversion){if(r.startsWith("balance-in-native")){this.balanceBox.amounts.push(f(a.value,a.currency_code)),e.hasOwnProperty(a.currency_code)||(e[a.currency_code]="");continue}if(r.startsWith("spent-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-native")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-native")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-native")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-native")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}if(r.startsWith("net-worth-in-native")){this.netBox.net.push(f(a.value,a.currency_code));continue}}if(!this.autoConversion&&!r.endsWith("native")){if(r.startsWith("balance-in-")){this.balanceBox.amounts.push(f(a.value,a.currency_code));continue}if(r.startsWith("spent-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}r.startsWith("net-worth-in-")&&this.netBox.net.push(f(a.value,a.currency_code))}}for(let n in e)e.hasOwnProperty(n)&&this.balanceBox.subtitles.push(e[n]);this.loading=!1},loadBoxes(){if(this.loading!==!0){if(this.loading=!0,this.boxData===null){this.getFreshData();return}this.generateOptions(this.boxData),this.loading=!1}},init(){Promise.all([v("viewRange"),v("autoConversion",!1)]).then(t=>{U=!0,this.autoConversion=t[1],this.loadBoxes()}),window.store.observe("end",()=>{U&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",t=>{U&&(this.autoConversion=t,this.loadBoxes())})}});class Gt{put(e,n){let a="/api/v1/preferences/"+e;return O.put(a,{data:n})}}function Tt(t,e=null){window.store.set(t,e),new Gt().put(t,e).then(a=>{}).catch(()=>{new bt().post(t,e).then(r=>{})})}let Rt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/dashboard",{params:{start:a,end:r}})}expense(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/expense-dashboard",{params:{start:a,end:r}})}};class st{get(e,n){let a={date:g(n,"y-MM-dd").slice(0,10)};return n?O.get("/api/v2/accounts/"+e,{params:a}):O.get("/api/v2/accounts/"+e)}transactions(e,n){const a={page:n.page??1};return n.hasOwnProperty("start")&&(a.start=g(n.start,"y-MM-dd")),n.hasOwnProperty("end")&&(a.end=g(n.end,"y-MM-dd")),O.get("/api/v2/accounts/"+e+"/transactions",{params:a})}}function N(t){return t==="sankey"?{type:"sankey",data:{datasets:[]},options:{animations:!1}}:t==="pie"?{type:"pie",data:{datasets:[]}}:t==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{}}}:t==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let q=new m("#36a2eb"),I=new m("#ff6384"),G=new m("#4bc0c0"),ft=new m("#ff9f40"),qt=new m("#9966ff"),Nt=new m("#ffcd56"),Yt=new m("#c9cbcf"),lt=0;window.theme==="dark"&&(I.darken(.3).desaturate(.3),G.darken(.3).desaturate(.3),q.darken(.3).desaturate(.3),ft.darken(.3).desaturate(.3));let z=[I,ft,q,G,qt,Nt,Yt,G];function j(t,e){let n={borderColor:I.rgbString(),backgroundColor:I.rgbString()},a;switch(t){default:let o=Math.floor(lt/2)%z.length;a=new m(z[o].rgbString()),a.lighten(.38),n={borderColor:z[o].hexString(),backgroundColor:a.hexString()};break;case"spent":a=new m(q.rgbString()),a.lighten(.38),n={borderColor:q.rgbString(),backgroundColor:a.rgbString()};break;case"left":a=new m(G.rgbString()),a.lighten(.38),n={borderColor:G.rgbString(),backgroundColor:a.rgbString()};break;case"overspent":a=new m(I.rgbString()),a.lighten(.22),n={borderColor:I.rgbString(),backgroundColor:a.rgbString()};break}return lt++,e==="border"?n.borderColor:e==="background"?n.backgroundColor:"#FF0000"}let A=[],$=null,H=null,J=!1;const Ut=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Tt("autoConversion",this.autoConversion)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){console.log(r),this.drawChart(this.generateOptions(r)),this.loading=!1;return}new Rt().dashboard(t,e,null).then(i=>{this.chartData=i.data,window.store.set(n,i.data),console.log(i.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(t){A=[];let e=N("line");for(let n=0;n0){this.loadingAccounts=!1;return}const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.accountList=r,this.loadingAccounts=!1;return}const o=10;let i=0,l=0,u=[];Promise.all([v("frontpageAccounts")]).then(d=>{i=d[0].length;for(let h in d[0]){let c=d[0];if(c.hasOwnProperty(h)){let _=c[h];new st().get(_,new Date(window.store.get("end"))).then(w=>{let C=w.data.data;const yt={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new st().transactions(C.id,yt).then(at=>{let nt=[];for(let B=0;B=o);B++){let M=at.data.data[B],rt={title:M.attributes.group_title===null?"":M.attributes.group_title,id:M.id,transactions:[]};for(let Y=0;YB.order-M.order),this.accountList=u,this.loadingAccounts=!1,window.store.set(n,u))})})}}})},init(){Promise.all([v("viewRange","1M"),v("autoConversion",!1),v("language","en_US")]).then(t=>{this.autoConversion=t[1],J=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{J&&(H=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{J&&(this.loadChart(),this.loadAccounts())})}});let zt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/budget/dashboard",{params:{start:a,end:r}})}},V=[],T=null,F=null,Z=!1;const Ht=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,F!==null){this.drawChart(this.generateOptions(F)),this.loading=!1;return}this.getFreshData()}},drawChart(t){if(T!==null){T.data.datasets=t.data.datasets,T.update();return}T=new S(document.querySelector("#budget-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-budgets-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){F=r,this.drawChart(this.generateOptions(F)),this.loading=!1;return}new zt().dashboard(t,e,null).then(i=>{F=i.data,this.drawChart(this.generateOptions(F)),window.store.set(n,F),this.loading=!1})},generateOptions(t){V=[];let e=N("column");e.options.locale=window.store.get("locale").replace("_","-"),e.options.plugins={tooltip:{callbacks:{title:function(n){return n.label},label:function(n){let a=n.dataset.label||"";return a&&(a+=": "),a+" "+f(n.parsed.y,V[n.parsed.x]??"EUR")}}}},e.data={labels:[],datasets:[{label:p.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:j("spent","background"),borderColor:j("spent","border")},{label:p.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:j("left","background"),borderColor:j("left","border")},{label:p.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:j("overspent","background"),borderColor:j("overspent","border")}]};for(const n in t)if(t.hasOwnProperty(n)){let a=t[n],r=a.label+" ("+a.currency_code+")";e.data.labels.push(r),this.autoConversion&&(V.push(a.native_currency_code),e.data.datasets[0].data.push(parseFloat(a.native_entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.native_entries.left)),e.data.datasets[2].data.push(parseFloat(a.native_entries.overspent))),this.autoConversion||(V.push(a.currency_code),e.data.datasets[0].data.push(parseFloat(a.entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.entries.left)),e.data.datasets[2].data.push(parseFloat(a.entries.overspent)))}return e.options.scales={y:{ticks:{callback:function(n){return f(n,V[0]??"EUR")}}}},e},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Z=!0,this.loading===!1&&this.loadChart()}),window.store.observe("end",()=>{Z&&this.loading===!1&&(F=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Z&&(this.autoConversion=t,this.loading===!1&&this.loadChart())})}});class Jt{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/category/dashboard",{params:{start:a,end:r}})}}let ut=[],K=null,W=null,Q=!1;const Zt=()=>({loading:!1,autoConversion:!1,generateOptions(t){ut=[];let e=N("column"),n={};for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code),n.hasOwnProperty(i)||(n[i]={name:i,yAxisID:"",data:{}},ut.push(i))}for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code);for(const l in n)if(n.hasOwnProperty(l)){let u=0;i===l&&(u=parseFloat(o.amount),""+o.currency_code,this.autoConversion&&(u=parseFloat(o.native_amount),""+o.native_currency_code)),n[l].data.hasOwnProperty(o.label)&&(n[l].data[o.label]=n[l].data[o.label]+u),n[l].data.hasOwnProperty(o.label)||(n[l].data[o.label]=u)}e.data.labels.includes(o.label)||e.data.labels.push(o.label)}let a=0;for(const r in n){let o="y"+r,i={label:r,currency_code:r,yAxisID:o,data:[]};for(const l in n[r].data)i.data.push(n[r].data[l]);e.data.datasets.push(i),e.options.scales.hasOwnProperty(o)||(e.options.scales[o]={beginAtZero:!0,type:"linear",position:a===1?"right":"left",ticks:{callback:function(l,u,d){return f(l,r)}}},a++)}return e},drawChart(t){if(K!==null){K.options=t.options,K.data=t.data,K.update();return}K=new S(document.querySelector("#category-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-categories-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){W=r,this.drawChart(this.generateOptions(W)),this.loading=!1;return}new Jt().dashboard(t,e,null).then(i=>{W=i.data,this.drawChart(this.generateOptions(i.data)),window.store.set(n,W),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,W!==null){this.drawChart(this.generateOptions(W)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Q=!0,this.loadChart()}),window.store.observe("end",()=>{Q&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Q&&(this.autoConversion=t,this.loadChart())})}});S.register({SankeyController:vt,Flow:mt});const ct="dashboard-sankey-data";let X=!1,R=null,D=[],y=!1,s={category:null,unknown_category:null,in:null,out:null,unknown_source:null,unknown_dest:null,unknown_account:null,expense_account:null,revenue_account:null,budget:null,unknown_budget:null,all_money:null};const dt=function(t){return t.includes(s.revenue_account)?"forestgreen":t.includes("("+s.in+",")?"green":t.includes(s.budget)||t.includes(s.unknown_budget)?"Orchid":t.includes("("+s.out+",")?"MediumOrchid":t.includes(s.all_money)?"blue":"red"};function L(t,e,n,a){if(t==="category"&&e!==null&&n==="in")return s.category+' "'+e+'" ('+s.in+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="in")return s.unknown_category+" ("+s.in+(y?", "+a+")":")");if(t==="category"&&e!==null&&n==="out")return s.category+' "'+e+'" ('+s.out+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="out")return s.unknown_category+" ("+s.out+(y?", "+a+")":")");if(t==="account"&&e===null&&n==="in")return s.unknown_source+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="in")return s.revenue_account+'"'+e+'"'+(y?" ("+a+")":"");if(t==="account"&&e===null&&n==="out")return s.unknown_dest+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="out")return s.expense_account+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+a+")":"");console.error('Cannot handle: type:"'+t+'", dir: "'+n+'"')}function E(t,e,n){if(t==="category"&&e!==null)return s.category+' "'+e+'"'+(y?" ("+n+")":"");if(t==="category"&&e===null)return s.unknown_category+(y?" ("+n+")":"");if(t==="account"&&e===null)return s.unknown_account+(y?" ("+n+")":"");if(t==="account"&&e!==null)return e+(y?" ("+n+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+n+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+n+")":"");console.error('Cannot handle: type:"'+t+'"')}const Qt=()=>({loading:!1,autoConversion:!1,generateOptions(){let t=N("sankey"),e={},n={};for(let r in D)if(D.hasOwnProperty(r)){let o=D[r];for(let i in o.attributes.transactions)if(o.attributes.transactions.hasOwnProperty(i)){let l=o.attributes.transactions[i],u=this.autoConversion?l.native_currency_code:l.currency_code,d=this.autoConversion?parseFloat(l.native_amount):parseFloat(l.amount),h;if(l.type==="deposit"){let c=L("category",l.category_name,"in",u),_=L("account",l.source_name,"in",u);n[c]=E("category",l.category_name,u),n[_]=E("account",l.source_name,u),h=_+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:c,amount:0}),e[h].amount+=d,h=c+"-"+s.all_money+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:s.all_money+(this.autoConversion?" ("+u+")":""),amount:0}),e[h].amount+=d}if(l.type==="withdrawal"){let c=L("budget",l.budget_name,"out",u);n[c]=E("budget",l.budget_name,u),h=s.all_money+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:s.all_money+(this.autoConversion?" ("+u+")":""),to:c,amount:0}),e[h].amount+=d;let _=L("category",l.category_name,"out",u);n[_]=E("category",l.category_name,u),h=c+"-"+_+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:_,amount:0}),e[h].amount+=d;let w=L("account",l.destination_name,"out",u);n[w]=E("account",l.destination_name,u),h=_+"-"+w+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:w,amount:0}),e[h].amount+=d}}}let a={label:"Firefly III dashboard sankey chart",data:[],colorFrom:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].from:""),colorTo:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].to:""),colorMode:"gradient",labels:n,size:"min"};for(let r in e)if(e.hasOwnProperty(r)){let o=e[r];a.data.push({from:o.from,to:o.to,flow:o.amount})}return t.data.datasets.push(a),t},drawChart(t){if(R!==null){R.data.datasets=t.data.datasets,R.update();return}R=new S(document.querySelector("#sankey-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ct,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){D=r,this.drawChart(this.generateOptions()),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),type:"withdrawal,deposit",page:1};this.downloadTransactions(o)},downloadTransactions(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ct,e,n);new $t().list(t).then(o=>{if(D=[...D,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadTransactions(t);return}window.store.set(a,D),this.drawChart(this.generateOptions()),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,D.length!==0){this.drawChart(this.generateOptions()),this.loading=!1;return}this.getFreshData()}},init(){D=[],Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],y=t[0],s.all_money=p.t("firefly.all_money"),s.category=p.t("firefly.category"),s.in=p.t("firefly.money_flowing_in"),s.out=p.t("firefly.money_flowing_out"),s.unknown_category=p.t("firefly.unknown_category_plain"),s.unknown_source=p.t("firefly.unknown_source_plain"),s.unknown_dest=p.t("firefly.unknown_dest_plain"),s.unknown_account=p.t("firefly.unknown_any_plain"),s.unknown_budget=p.t("firefly.unknown_budget_plain"),s.expense_account=p.t("firefly.expense_account"),s.revenue_account=p.t("firefly.revenue_account"),s.budget=p.t("firefly.budget"),X=!0,this.loadChart()}),window.store.observe("end",()=>{X&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",t=>{X&&(this.autoConversion=t,this.loadChart())})}});let tt=!1,b={};function gt(t){return new Vt().list(t).then(n=>{let a=n.data.data;for(let r in a)if(a.hasOwnProperty(r)){let o=a[r];if(o.attributes.active&&o.attributes.pay_dates.length>0){let i=o.attributes.object_group_id===null?0:o.attributes.object_group_id,l=o.attributes.object_group_title===null?p.t("firefly.default_group_title_name_plain"):o.attributes.object_group_title,u=o.attributes.object_group_order===null?0:o.attributes.object_group_order;b.hasOwnProperty(i)||(b[i]={id:i,title:l,order:u,payment_info:{},bills:[]});let d={id:o.id,name:o.attributes.name,amount_min:o.attributes.amount_min,amount_max:o.attributes.amount_max,amount:(parseFloat(o.attributes.amount_max)+parseFloat(o.attributes.amount_min))/2,currency_code:o.attributes.currency_code,native_amount_min:o.attributes.native_amount_min,native_amount_max:o.attributes.native_amount_max,native_amount:(parseFloat(o.attributes.native_amount_max)+parseFloat(o.attributes.native_amount_min))/2,native_currency_code:o.attributes.native_currency_code,transactions:[],pay_dates:o.attributes.pay_dates,paid:o.attributes.paid_dates.length>0};d.expected_amount=t.autoConversion?f(d.native_amount,d.native_currency_code):f(d.amount,d.currency_code),d.expected_times=p.t("firefly.subscr_expected_x_times",{times:o.attributes.pay_dates.length,amount:d.expected_amount});for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){const c=o.attributes.paid_dates[h];let _=100;t.autoConversion&&(_=Math.round(-100+parseFloat(c.native_amount)*-1/parseFloat(d.native_amount)*100)),t.autoConversion||(_=Math.round(-100+parseFloat(c.amount)*-1/parseFloat(d.amount)*100));let w={amount:t.autoConversion?f(c.native_amount,c.native_currency_code):f(c.amount,c.currency_code),percentage:_,date:g(new Date(c.date),"PP"),foreign_amount:null};c.foreign_currency_code!==null&&(w.foreign_amount=t.autoConversion?c.foreign_native_amount:c.foreign_amount,w.foreign_currency_code=t.autoConversion?c.native_currency_code:c.foreign_currency_code),d.transactions.push(w)}if(b[i].bills.push(d),o.attributes.paid_dates.length===0){const h=o.attributes.pay_dates.length*d.amount,c=o.attributes.pay_dates.length*d.native_amount;b[i].payment_info.hasOwnProperty(d.currency_code)||(b[i].payment_info[d.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0}),b[i].payment_info[d.currency_code].unpaid+=h,b[i].payment_info[d.currency_code].native_unpaid+=c}if(o.attributes.paid_dates.length>0){for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){let c=o.attributes.paid_dates[h];b[i].payment_info.hasOwnProperty(c.currency_code)||(b[i].payment_info[c.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0});const _=parseFloat(c.amount)*-1,w=parseFloat(c.native_amount)*-1;b[i].payment_info[c.currency_code].paid+=_,b[i].payment_info[c.currency_code].native_paid+=w}}}}return parseInt(n.data.meta.pagination.total_pages)>t.page?(t.page++,gt(t)):Promise.resolve()})}const Xt=()=>({loading:!1,autoConversion:!1,subscriptions:[],startSubscriptions(){this.loading=!0;let t=new Date(window.store.get("start")),e=new Date(window.store.get("end"));const n=window.store.get("cacheValid");let a=window.store.get(P("subscriptions-data-dashboard",t,e));n&&typeof a<"u",b={},this.subscriptions=[];let r={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),autoConversion:this.autoConversion,page:1};gt(r).then(()=>{let o=Object.values(b);for(let i in o)if(o.hasOwnProperty(i)){let l=o[i];const u=Object.keys(l.payment_info);l.col_size=u.length===1?"col-6 offset-3":"col-6",l.chart_width=u.length===1?"50%":"100%",l.payment_length=u.length,this.subscriptions.push(l)}this.loading=!1})},drawPieChart(t,e,n){let a="#pie_"+t+"_"+n.currency_code;const r=this.autoConversion?n.native_unpaid:n.unpaid,o=this.autoConversion?n.native_paid:n.paid,i=this.autoConversion?n.native_currency_code:n.currency_code,u={type:"doughnut",data:{labels:[p.t("firefly.paid"),p.t("firefly.unpaid")],datasets:[{label:p.t("firefly.subscriptions_in_group",{title:e}),data:[o,r],backgroundColor:["rgb(54, 162, 235)","rgb(255, 99, 132)"],hoverOffset:4}]},options:{plugins:{tooltip:{callbacks:{label:function(h){return h.dataset.label+": "+f(h.raw,i)}}}}}};var d=S.getChart(document.querySelector(a));typeof d<"u"&&d.destroy(),new S(document.querySelector(a),u)},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],tt=!0,this.loading===!1&&this.startSubscriptions()}),window.store.observe("end",()=>{tt&&this.loading===!1&&this.startSubscriptions()}),window.store.observe("autoConversion",t=>{tt&&(this.autoConversion=t,this.loading===!1&&this.startSubscriptions())})}});let x={},et=!1;const ht="dashboard-piggies-data",te=()=>({loading:!1,autoConversion:!1,sankeyGrouping:"account",piggies:[],getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ht,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){x=r,this.parsePiggies(),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),page:1};this.downloadPiggyBanks(o)},downloadPiggyBanks(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ht,e,n);new Kt().list(t).then(o=>{if(x=[...x,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadPiggyBanks(t);return}window.store.set(a,x),this.parsePiggies(),this.loading=!1})},parsePiggies(){let t=[];for(let e in x)if(x.hasOwnProperty(e)){let n=x[e];if(n.attributes.percentage>=100||n.attributes.percentage===0)continue;let a=n.object_group_title??p.t("firefly.default_group_title_name_plain");t.hasOwnProperty(a)||(t[a]={id:n.object_group_id??0,title:a,order:n.object_group_order??0,piggies:[]});let r={id:n.id,name:n.attributes.name,percentage:parseInt(n.attributes.percentage),amount:this.autoConversion?n.attributes.native_current_amount:n.attributes.current_amount,left_to_save:this.autoConversion?n.attributes.native_left_to_save:n.attributes.left_to_save,target_amount:this.autoConversion?n.attributes.native_target_amount:n.attributes.target_amount,save_per_month:this.autoConversion?n.attributes.native_save_per_month:n.attributes.save_per_month,currency_code:this.autoConversion?n.attributes.native_currency_code:n.attributes.currency_code};t[a].piggies.push(r)}this.piggies=Object.values(t)},loadPiggyBanks(){if(this.loading!==!0){if(this.loading=!0,this.piggies.length!==0){this.parsePiggies(),this.loading=!1;return}this.getFreshData()}},init(){x=[],Promise.all([v("autoConversion",!1)]).then(t=>{et=!0,this.autoConversion=t[0],this.loadPiggyBanks()}),window.store.observe("end",()=>{et&&(x=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",t=>{et&&(this.autoConversion=t,this.loadPiggyBanks())})}});S.register({LineController:Ct,LineElement:kt,ArcElement:Pt,BarController:Dt,TimeScale:xt,PieController:Ot,BarElement:Mt,Filler:Ft,Colors:St,LinearScale:At,CategoryScale:Bt,PointElement:jt,Tooltip:Wt,Legend:It});const pt={dates:wt,boxes:Et,accounts:Ut,budgets:Ht,categories:Zt,sankey:Qt,subscriptions:Xt,piggies:te};function _t(t){Object.keys(t).forEach(e=>{let n=t[e]();Alpine.data(e,()=>n)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),_t(pt)});window.bootstrapped&&(console.log("Loaded through window variable."),_t(pt)); +import{a as O,f,g as v,P as bt,d as wt}from"./format-money-62afb78b.js";import{f as g,C as m,a as S,i as p,S as vt,F as mt,L as Ct,b as kt,A as Pt,B as Dt,T as xt,P as Ot,c as Mt,d as Ft,p as St,e as At,g as Bt,h as jt,j as Wt,k as It}from"./vendor-2609b2c9.js";import{G as $t}from"./get-ea675e30.js";import{G as Vt,a as Kt}from"./get-5b4283ca.js";class Lt{get(e,n,a){return O.get("/api/v2/summary/basic",{params:{start:e,end:n,code:a}})}}function P(t,e,n){const a=g(e,"y-MM-dd")+"_"+g(n,"y-MM-dd")+"_"+t;return console.log("getCacheKey: "+a),String(a)}let U=!1;const Et=()=>({balanceBox:{amounts:[],subtitles:[]},billBox:{paid:[],unpaid:[]},leftBox:{left:[],perDay:[]},netBox:{net:[]},autoConversion:!1,loading:!1,boxData:null,boxOptions:null,getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-boxes-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.boxData=r,this.generateOptions(this.boxData);return}new Lt().get(g(t,"yyyy-MM-dd"),g(e,"yyyy-MM-dd"),null).then(i=>{this.boxData=i.data,window.store.set(n,i.data),this.generateOptions(this.boxData)})},generateOptions(t){this.balanceBox={amounts:[],subtitles:[]},this.billBox={paid:[],unpaid:[]},this.leftBox={left:[],perDay:[]},this.netBox={net:[]};let e={};for(const n in t)if(t.hasOwnProperty(n)){const a=t[n];if(!a.hasOwnProperty("key"))continue;let r=a.key;if(this.autoConversion){if(r.startsWith("balance-in-native")){this.balanceBox.amounts.push(f(a.value,a.currency_code)),e.hasOwnProperty(a.currency_code)||(e[a.currency_code]="");continue}if(r.startsWith("spent-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-native")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-native")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-native")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-native")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}if(r.startsWith("net-worth-in-native")){this.netBox.net.push(f(a.value,a.currency_code));continue}}if(!this.autoConversion&&!r.endsWith("native")){if(r.startsWith("balance-in-")){this.balanceBox.amounts.push(f(a.value,a.currency_code));continue}if(r.startsWith("spent-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}r.startsWith("net-worth-in-")&&this.netBox.net.push(f(a.value,a.currency_code))}}for(let n in e)e.hasOwnProperty(n)&&this.balanceBox.subtitles.push(e[n]);this.loading=!1},loadBoxes(){if(this.loading!==!0){if(this.loading=!0,this.boxData===null){this.getFreshData();return}this.generateOptions(this.boxData),this.loading=!1}},init(){Promise.all([v("viewRange"),v("autoConversion",!1)]).then(t=>{U=!0,this.autoConversion=t[1],this.loadBoxes()}),window.store.observe("end",()=>{U&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",t=>{U&&(this.autoConversion=t,this.loadBoxes())})}});class Gt{put(e,n){let a="/api/v1/preferences/"+e;return O.put(a,{data:n})}}function Tt(t,e=null){window.store.set(t,e),new Gt().put(t,e).then(a=>{}).catch(()=>{new bt().post(t,e).then(r=>{})})}let Rt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/dashboard",{params:{start:a,end:r}})}expense(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/expense-dashboard",{params:{start:a,end:r}})}};class st{get(e,n){let a={date:g(n,"y-MM-dd").slice(0,10)};return n?O.get("/api/v2/accounts/"+e,{params:a}):O.get("/api/v2/accounts/"+e)}transactions(e,n){const a={page:n.page??1};return n.hasOwnProperty("start")&&(a.start=g(n.start,"y-MM-dd")),n.hasOwnProperty("end")&&(a.end=g(n.end,"y-MM-dd")),O.get("/api/v2/accounts/"+e+"/transactions",{params:a})}}function N(t){return t==="sankey"?{type:"sankey",data:{datasets:[]},options:{animations:!1}}:t==="pie"?{type:"pie",data:{datasets:[]}}:t==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{}}}:t==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let q=new m("#36a2eb"),I=new m("#ff6384"),G=new m("#4bc0c0"),ft=new m("#ff9f40"),qt=new m("#9966ff"),Nt=new m("#ffcd56"),Yt=new m("#c9cbcf"),lt=0;window.theme==="dark"&&(I.darken(.3).desaturate(.3),G.darken(.3).desaturate(.3),q.darken(.3).desaturate(.3),ft.darken(.3).desaturate(.3));let z=[I,ft,q,G,qt,Nt,Yt,G];function j(t,e){let n={borderColor:I.rgbString(),backgroundColor:I.rgbString()},a;switch(t){default:let o=Math.floor(lt/2)%z.length;a=new m(z[o].rgbString()),a.lighten(.38),n={borderColor:z[o].hexString(),backgroundColor:a.hexString()};break;case"spent":a=new m(q.rgbString()),a.lighten(.38),n={borderColor:q.rgbString(),backgroundColor:a.rgbString()};break;case"left":a=new m(G.rgbString()),a.lighten(.38),n={borderColor:G.rgbString(),backgroundColor:a.rgbString()};break;case"overspent":a=new m(I.rgbString()),a.lighten(.22),n={borderColor:I.rgbString(),backgroundColor:a.rgbString()};break}return lt++,e==="border"?n.borderColor:e==="background"?n.backgroundColor:"#FF0000"}let A=[],$=null,H=null,J=!1;const Ut=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Tt("autoConversion",this.autoConversion)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){console.log(r),this.drawChart(this.generateOptions(r)),this.loading=!1;return}new Rt().dashboard(t,e,null).then(i=>{this.chartData=i.data,window.store.set(n,i.data),console.log(i.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(t){A=[];let e=N("line");for(let n=0;n0){this.loadingAccounts=!1;return}const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.accountList=r,this.loadingAccounts=!1;return}const o=10;let i=0,l=0,u=[];Promise.all([v("frontpageAccounts")]).then(d=>{i=d[0].length;for(let h in d[0]){let c=d[0];if(c.hasOwnProperty(h)){let _=c[h];new st().get(_,new Date(window.store.get("end"))).then(w=>{let C=w.data.data;const yt={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new st().transactions(C.id,yt).then(at=>{let nt=[];for(let B=0;B=o);B++){let M=at.data.data[B],rt={title:M.attributes.group_title===null?"":M.attributes.group_title,id:M.id,transactions:[]};for(let Y=0;YB.order-M.order),this.accountList=u,this.loadingAccounts=!1,window.store.set(n,u))})})}}})},init(){Promise.all([v("viewRange","1M"),v("autoConversion",!1),v("language","en_US")]).then(t=>{this.autoConversion=t[1],J=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{J&&(H=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{J&&(this.loadChart(),this.loadAccounts())})}});let zt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/budget/dashboard",{params:{start:a,end:r}})}},V=[],T=null,F=null,Z=!1;const Ht=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,F!==null){this.drawChart(this.generateOptions(F)),this.loading=!1;return}this.getFreshData()}},drawChart(t){if(T!==null){T.data.datasets=t.data.datasets,T.update();return}T=new S(document.querySelector("#budget-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-budgets-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){F=r,this.drawChart(this.generateOptions(F)),this.loading=!1;return}new zt().dashboard(t,e,null).then(i=>{F=i.data,this.drawChart(this.generateOptions(F)),window.store.set(n,F),this.loading=!1})},generateOptions(t){V=[];let e=N("column");e.options.locale=window.store.get("locale").replace("_","-"),e.options.plugins={tooltip:{callbacks:{title:function(n){return n.label},label:function(n){let a=n.dataset.label||"";return a&&(a+=": "),a+" "+f(n.parsed.y,V[n.parsed.x]??"EUR")}}}},e.data={labels:[],datasets:[{label:p.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:j("spent","background"),borderColor:j("spent","border")},{label:p.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:j("left","background"),borderColor:j("left","border")},{label:p.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:j("overspent","background"),borderColor:j("overspent","border")}]};for(const n in t)if(t.hasOwnProperty(n)){let a=t[n],r=a.label+" ("+a.currency_code+")";e.data.labels.push(r),this.autoConversion&&(V.push(a.native_currency_code),e.data.datasets[0].data.push(parseFloat(a.native_entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.native_entries.left)),e.data.datasets[2].data.push(parseFloat(a.native_entries.overspent))),this.autoConversion||(V.push(a.currency_code),e.data.datasets[0].data.push(parseFloat(a.entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.entries.left)),e.data.datasets[2].data.push(parseFloat(a.entries.overspent)))}return e.options.scales={y:{ticks:{callback:function(n){return f(n,V[0]??"EUR")}}}},e},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Z=!0,this.loading===!1&&this.loadChart()}),window.store.observe("end",()=>{Z&&this.loading===!1&&(F=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Z&&(this.autoConversion=t,this.loading===!1&&this.loadChart())})}});class Jt{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/category/dashboard",{params:{start:a,end:r}})}}let ut=[],K=null,W=null,Q=!1;const Zt=()=>({loading:!1,autoConversion:!1,generateOptions(t){ut=[];let e=N("column"),n={};for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code),n.hasOwnProperty(i)||(n[i]={name:i,yAxisID:"",data:{}},ut.push(i))}for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code);for(const l in n)if(n.hasOwnProperty(l)){let u=0;i===l&&(u=parseFloat(o.amount),""+o.currency_code,this.autoConversion&&(u=parseFloat(o.native_amount),""+o.native_currency_code)),n[l].data.hasOwnProperty(o.label)&&(n[l].data[o.label]=n[l].data[o.label]+u),n[l].data.hasOwnProperty(o.label)||(n[l].data[o.label]=u)}e.data.labels.includes(o.label)||e.data.labels.push(o.label)}let a=0;for(const r in n){let o="y"+r,i={label:r,currency_code:r,yAxisID:o,data:[]};for(const l in n[r].data)i.data.push(n[r].data[l]);e.data.datasets.push(i),e.options.scales.hasOwnProperty(o)||(e.options.scales[o]={beginAtZero:!0,type:"linear",position:a===1?"right":"left",ticks:{callback:function(l,u,d){return f(l,r)}}},a++)}return e},drawChart(t){if(K!==null){K.options=t.options,K.data=t.data,K.update();return}K=new S(document.querySelector("#category-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-categories-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){W=r,this.drawChart(this.generateOptions(W)),this.loading=!1;return}new Jt().dashboard(t,e,null).then(i=>{W=i.data,this.drawChart(this.generateOptions(i.data)),window.store.set(n,W),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,W!==null){this.drawChart(this.generateOptions(W)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Q=!0,this.loadChart()}),window.store.observe("end",()=>{Q&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Q&&(this.autoConversion=t,this.loadChart())})}});S.register({SankeyController:vt,Flow:mt});const ct="dashboard-sankey-data";let X=!1,R=null,D=[],y=!1,s={category:null,unknown_category:null,in:null,out:null,unknown_source:null,unknown_dest:null,unknown_account:null,expense_account:null,revenue_account:null,budget:null,unknown_budget:null,all_money:null};const dt=function(t){return t.includes(s.revenue_account)?"forestgreen":t.includes("("+s.in+",")?"green":t.includes(s.budget)||t.includes(s.unknown_budget)?"Orchid":t.includes("("+s.out+",")?"MediumOrchid":t.includes(s.all_money)?"blue":"red"};function L(t,e,n,a){if(t==="category"&&e!==null&&n==="in")return s.category+' "'+e+'" ('+s.in+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="in")return s.unknown_category+" ("+s.in+(y?", "+a+")":")");if(t==="category"&&e!==null&&n==="out")return s.category+' "'+e+'" ('+s.out+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="out")return s.unknown_category+" ("+s.out+(y?", "+a+")":")");if(t==="account"&&e===null&&n==="in")return s.unknown_source+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="in")return s.revenue_account+'"'+e+'"'+(y?" ("+a+")":"");if(t==="account"&&e===null&&n==="out")return s.unknown_dest+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="out")return s.expense_account+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+a+")":"");console.error('Cannot handle: type:"'+t+'", dir: "'+n+'"')}function E(t,e,n){if(t==="category"&&e!==null)return s.category+' "'+e+'"'+(y?" ("+n+")":"");if(t==="category"&&e===null)return s.unknown_category+(y?" ("+n+")":"");if(t==="account"&&e===null)return s.unknown_account+(y?" ("+n+")":"");if(t==="account"&&e!==null)return e+(y?" ("+n+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+n+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+n+")":"");console.error('Cannot handle: type:"'+t+'"')}const Qt=()=>({loading:!1,autoConversion:!1,generateOptions(){let t=N("sankey"),e={},n={};for(let r in D)if(D.hasOwnProperty(r)){let o=D[r];for(let i in o.attributes.transactions)if(o.attributes.transactions.hasOwnProperty(i)){let l=o.attributes.transactions[i],u=this.autoConversion?l.native_currency_code:l.currency_code,d=this.autoConversion?parseFloat(l.native_amount):parseFloat(l.amount),h;if(l.type==="deposit"){let c=L("category",l.category_name,"in",u),_=L("account",l.source_name,"in",u);n[c]=E("category",l.category_name,u),n[_]=E("account",l.source_name,u),h=_+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:c,amount:0}),e[h].amount+=d,h=c+"-"+s.all_money+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:s.all_money+(this.autoConversion?" ("+u+")":""),amount:0}),e[h].amount+=d}if(l.type==="withdrawal"){let c=L("budget",l.budget_name,"out",u);n[c]=E("budget",l.budget_name,u),h=s.all_money+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:s.all_money+(this.autoConversion?" ("+u+")":""),to:c,amount:0}),e[h].amount+=d;let _=L("category",l.category_name,"out",u);n[_]=E("category",l.category_name,u),h=c+"-"+_+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:_,amount:0}),e[h].amount+=d;let w=L("account",l.destination_name,"out",u);n[w]=E("account",l.destination_name,u),h=_+"-"+w+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:w,amount:0}),e[h].amount+=d}}}let a={label:"Firefly III dashboard sankey chart",data:[],colorFrom:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].from:""),colorTo:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].to:""),colorMode:"gradient",labels:n,size:"min"};for(let r in e)if(e.hasOwnProperty(r)){let o=e[r];a.data.push({from:o.from,to:o.to,flow:o.amount})}return t.data.datasets.push(a),t},drawChart(t){if(R!==null){R.data.datasets=t.data.datasets,R.update();return}R=new S(document.querySelector("#sankey-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ct,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){D=r,this.drawChart(this.generateOptions()),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),type:"withdrawal,deposit",page:1};this.downloadTransactions(o)},downloadTransactions(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ct,e,n);new $t().list(t).then(o=>{if(D=[...D,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadTransactions(t);return}window.store.set(a,D),this.drawChart(this.generateOptions()),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,D.length!==0){this.drawChart(this.generateOptions()),this.loading=!1;return}this.getFreshData()}},init(){D=[],Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],y=t[0],s.all_money=p.t("firefly.all_money"),s.category=p.t("firefly.category"),s.in=p.t("firefly.money_flowing_in"),s.out=p.t("firefly.money_flowing_out"),s.unknown_category=p.t("firefly.unknown_category_plain"),s.unknown_source=p.t("firefly.unknown_source_plain"),s.unknown_dest=p.t("firefly.unknown_dest_plain"),s.unknown_account=p.t("firefly.unknown_any_plain"),s.unknown_budget=p.t("firefly.unknown_budget_plain"),s.expense_account=p.t("firefly.expense_account"),s.revenue_account=p.t("firefly.revenue_account"),s.budget=p.t("firefly.budget"),X=!0,this.loadChart()}),window.store.observe("end",()=>{X&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",t=>{X&&(this.autoConversion=t,this.loadChart())})}});let tt=!1,b={};function gt(t){return new Vt().list(t).then(n=>{let a=n.data.data;for(let r in a)if(a.hasOwnProperty(r)){let o=a[r];if(o.attributes.active&&o.attributes.pay_dates.length>0){let i=o.attributes.object_group_id===null?0:o.attributes.object_group_id,l=o.attributes.object_group_title===null?p.t("firefly.default_group_title_name_plain"):o.attributes.object_group_title,u=o.attributes.object_group_order===null?0:o.attributes.object_group_order;b.hasOwnProperty(i)||(b[i]={id:i,title:l,order:u,payment_info:{},bills:[]});let d={id:o.id,name:o.attributes.name,amount_min:o.attributes.amount_min,amount_max:o.attributes.amount_max,amount:(parseFloat(o.attributes.amount_max)+parseFloat(o.attributes.amount_min))/2,currency_code:o.attributes.currency_code,native_amount_min:o.attributes.native_amount_min,native_amount_max:o.attributes.native_amount_max,native_amount:(parseFloat(o.attributes.native_amount_max)+parseFloat(o.attributes.native_amount_min))/2,native_currency_code:o.attributes.native_currency_code,transactions:[],pay_dates:o.attributes.pay_dates,paid:o.attributes.paid_dates.length>0};d.expected_amount=t.autoConversion?f(d.native_amount,d.native_currency_code):f(d.amount,d.currency_code),d.expected_times=p.t("firefly.subscr_expected_x_times",{times:o.attributes.pay_dates.length,amount:d.expected_amount});for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){const c=o.attributes.paid_dates[h];let _=100;t.autoConversion&&(_=Math.round(-100+parseFloat(c.native_amount)*-1/parseFloat(d.native_amount)*100)),t.autoConversion||(_=Math.round(-100+parseFloat(c.amount)*-1/parseFloat(d.amount)*100));let w={amount:t.autoConversion?f(c.native_amount,c.native_currency_code):f(c.amount,c.currency_code),percentage:_,date:g(new Date(c.date),"PP"),foreign_amount:null};c.foreign_currency_code!==null&&(w.foreign_amount=t.autoConversion?c.foreign_native_amount:c.foreign_amount,w.foreign_currency_code=t.autoConversion?c.native_currency_code:c.foreign_currency_code),d.transactions.push(w)}if(b[i].bills.push(d),o.attributes.paid_dates.length===0){const h=o.attributes.pay_dates.length*d.amount,c=o.attributes.pay_dates.length*d.native_amount;b[i].payment_info.hasOwnProperty(d.currency_code)||(b[i].payment_info[d.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0}),b[i].payment_info[d.currency_code].unpaid+=h,b[i].payment_info[d.currency_code].native_unpaid+=c}if(o.attributes.paid_dates.length>0){for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){let c=o.attributes.paid_dates[h];b[i].payment_info.hasOwnProperty(c.currency_code)||(b[i].payment_info[c.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0});const _=parseFloat(c.amount)*-1,w=parseFloat(c.native_amount)*-1;b[i].payment_info[c.currency_code].paid+=_,b[i].payment_info[c.currency_code].native_paid+=w}}}}return parseInt(n.data.meta.pagination.total_pages)>t.page?(t.page++,gt(t)):Promise.resolve()})}const Xt=()=>({loading:!1,autoConversion:!1,subscriptions:[],startSubscriptions(){this.loading=!0;let t=new Date(window.store.get("start")),e=new Date(window.store.get("end"));const n=window.store.get("cacheValid");let a=window.store.get(P("subscriptions-data-dashboard",t,e));n&&typeof a<"u",b={},this.subscriptions=[];let r={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),autoConversion:this.autoConversion,page:1};gt(r).then(()=>{let o=Object.values(b);for(let i in o)if(o.hasOwnProperty(i)){let l=o[i];const u=Object.keys(l.payment_info);l.col_size=u.length===1?"col-6 offset-3":"col-6",l.chart_width=u.length===1?"50%":"100%",l.payment_length=u.length,this.subscriptions.push(l)}this.loading=!1})},drawPieChart(t,e,n){let a="#pie_"+t+"_"+n.currency_code;const r=this.autoConversion?n.native_unpaid:n.unpaid,o=this.autoConversion?n.native_paid:n.paid,i=this.autoConversion?n.native_currency_code:n.currency_code,u={type:"doughnut",data:{labels:[p.t("firefly.paid"),p.t("firefly.unpaid")],datasets:[{label:p.t("firefly.subscriptions_in_group",{title:e}),data:[o,r],backgroundColor:["rgb(54, 162, 235)","rgb(255, 99, 132)"],hoverOffset:4}]},options:{plugins:{tooltip:{callbacks:{label:function(h){return h.dataset.label+": "+f(h.raw,i)}}}}}};var d=S.getChart(document.querySelector(a));typeof d<"u"&&d.destroy(),new S(document.querySelector(a),u)},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],tt=!0,this.loading===!1&&this.startSubscriptions()}),window.store.observe("end",()=>{tt&&this.loading===!1&&this.startSubscriptions()}),window.store.observe("autoConversion",t=>{tt&&(this.autoConversion=t,this.loading===!1&&this.startSubscriptions())})}});let x={},et=!1;const ht="dashboard-piggies-data",te=()=>({loading:!1,autoConversion:!1,sankeyGrouping:"account",piggies:[],getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ht,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){x=r,this.parsePiggies(),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),page:1};this.downloadPiggyBanks(o)},downloadPiggyBanks(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ht,e,n);new Kt().list(t).then(o=>{if(x=[...x,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadPiggyBanks(t);return}window.store.set(a,x),this.parsePiggies(),this.loading=!1})},parsePiggies(){let t=[];for(let e in x)if(x.hasOwnProperty(e)){let n=x[e];if(n.attributes.percentage>=100||n.attributes.percentage===0)continue;let a=n.object_group_title??p.t("firefly.default_group_title_name_plain");t.hasOwnProperty(a)||(t[a]={id:n.object_group_id??0,title:a,order:n.object_group_order??0,piggies:[]});let r={id:n.id,name:n.attributes.name,percentage:parseInt(n.attributes.percentage),amount:this.autoConversion?n.attributes.native_current_amount:n.attributes.current_amount,left_to_save:this.autoConversion?n.attributes.native_left_to_save:n.attributes.left_to_save,target_amount:this.autoConversion?n.attributes.native_target_amount:n.attributes.target_amount,save_per_month:this.autoConversion?n.attributes.native_save_per_month:n.attributes.save_per_month,currency_code:this.autoConversion?n.attributes.native_currency_code:n.attributes.currency_code};t[a].piggies.push(r)}this.piggies=Object.values(t)},loadPiggyBanks(){if(this.loading!==!0){if(this.loading=!0,this.piggies.length!==0){this.parsePiggies(),this.loading=!1;return}this.getFreshData()}},init(){x=[],Promise.all([v("autoConversion",!1)]).then(t=>{et=!0,this.autoConversion=t[0],this.loadPiggyBanks()}),window.store.observe("end",()=>{et&&(x=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",t=>{et&&(this.autoConversion=t,this.loadPiggyBanks())})}});S.register({LineController:Ct,LineElement:kt,ArcElement:Pt,BarController:Dt,TimeScale:xt,PieController:Ot,BarElement:Mt,Filler:Ft,Colors:St,LinearScale:At,CategoryScale:Bt,PointElement:jt,Tooltip:Wt,Legend:It});const pt={dates:wt,boxes:Et,accounts:Ut,budgets:Ht,categories:Zt,sankey:Qt,subscriptions:Xt,piggies:te};function _t(t){Object.keys(t).forEach(e=>{let n=t[e]();Alpine.data(e,()=>n)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),_t(pt)});window.bootstrapped&&(console.log("Loaded through window variable."),_t(pt)); diff --git a/public/build/assets/edit-a939c15a.js b/public/build/assets/edit-a6845b23.js similarity index 94% rename from public/build/assets/edit-a939c15a.js rename to public/build/assets/edit-a6845b23.js index ea2f06a58f..aa5994e12e 100644 --- a/public/build/assets/edit-a939c15a.js +++ b/public/build/assets/edit-a6845b23.js @@ -1 +1 @@ -import{d as p,f as l}from"./format-money-03f73825.js";import{G as f}from"./get-10f1237b.js";import{p as g}from"./parse-downloaded-splits-fb2d62df.js";import{p as m,d as w,e as a,f as y,g as b,h as P,i as S,l as v,a as C,b as A,c as _,s as E,j as D,k as c,m as u}from"./splice-errors-into-transactions-e53c1920.js";import{i as o,m as T}from"./vendor-cc723e37.js";import{d as x}from"./create-empty-split-d82bb341.js";import{P as B}from"./put-d747f13c.js";import"./get-7f8692a5.js";const n=D();let L=function(){return{entries:[],originals:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"edit",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,editTitle:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.entries[e].errors=x());this.formStates.isSubmitting=!0;let t=m(this.entries,this.originals,this.groupProperties.transactionType),s={group_title:this.groupProperties.editTitle,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:t};this.groupProperties.title===null&&t.length>1&&(s.group_title=t[0].description);let r=new B;console.log(s),r.put(s,{id:this.groupProperties.id}).then(e=>{const i=e.data.data;if(this.groupProperties.id=parseInt(i.id),this.groupProperties.title=i.attributes.group_title??i.attributes.transactions[0].description,w(this.groupProperties.id,i.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(e=>{this.submitting=!1,console.log(e),typeof e.response<"u"&&this.parseErrors(e.response.data)})},filters:{source:[],destination:[]},addedSplit(){setTimeout(()=>{const t=function(s,r,e){return s.name_with_balance+'
'+o.t("firefly.account_type_"+s.type)+""};a({selector:"input.ac-source",serverUrl:n.account,filters:this.filters.source,onRenderItem:t,onChange:y,onSelectItem:b}),a({selector:"input.ac-dest",serverUrl:n.account,filters:this.filters.destination,onRenderItem:t,onChange:P,onSelectItem:S}),a({selector:"input.ac-category",serverUrl:n.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),a({selector:"input.ac-description",serverUrl:n.description,valueField:"id",labelField:"description",onChange:u,onSelectItem:u})},250)},changedDateTime(t){console.warn("changedDateTime, event is not used")},changedDescription(t){console.warn("changedDescription, event is not used")},changedDestinationAccount(t){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(t){console.warn("changedSourceAccount, event is not used")},formattedTotalAmount(){return this.entries.length===0?l(this.groupProperties.totalAmount,"EUR"):l(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},getTags(t){return console.log("at get tags "+t),console.log(this.entries[t].tags),this.entries[t].tags??[]},getTransactionGroup(){this.entries=[];const t=window.location.href.split("/"),s=parseInt(t[t.length-1]);new f().show(s,{}).then(e=>{const i=e.data.data;this.groupProperties.id=parseInt(i.id),this.groupProperties.transactionType=i.attributes.transactions[0].type.toLowerCase(),this.groupProperties.title=i.attributes.title??i.attributes.transactions[0].description,this.entries=g(i.attributes.transactions,parseInt(i.id)),this.notifications.wait.show=!1}).then(()=>{this.groupProperties.totalAmount=0;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[e].amount),this.filters.source.push(this.entries[e].source_account.type),this.filters.destination.push(this.entries[e].destination_account.type));console.log(this.filters),setTimeout(()=>{T.init("select.ac-tags",{allowClear:!0,server:n.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:o.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}})},150)})},init(){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_loading_transaction"),this.getTransactionGroup(),v().then(t=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=t.defaultCurrency,this.formData.enabledCurrencies=t.enabledCurrencies,this.formData.nativeCurrencies=t.nativeCurrencies,this.formData.foreignCurrencies=t.foreignCurrencies}),C().then(t=>{this.formData.budgets=t,this.formStates.loadingBudgets=!1}),A().then(t=>{this.formData.piggyBanks=t,this.formStates.loadingPiggyBanks=!1}),_().then(t=>{this.formData.subscriptions=t,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",t=>{this.processUpload(t),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",t=>{this.processUploadError(t)}),document.addEventListener("location-move",t=>{this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude}),document.addEventListener("location-set",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel}),document.addEventListener("location-zoom",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel})},changedAmount(t){const s=parseInt(t.target.dataset.index);this.entries[s].amount=parseFloat(t.target.value),this.groupProperties.totalAmount=0;for(let r in this.entries)this.entries.hasOwnProperty(r)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[r].amount))},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=o.t("firefly.updated_journal_js",{description:this.groupProperties.title});return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=updated"},parseErrors(t){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_submission_v2",{errorMessage:t.message}),t.hasOwnProperty("errors")&&(this.entries=E(t.errors,this.entries))},processUpload(t){this.showMessageOrRedirectUser()},processUploadError(t){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_upload"),console.error(t)}}},h={transactions:L,dates:p};function d(){Object.keys(h).forEach(t=>{console.log(`Loading page component "${t}"`);let s=h[t]();Alpine.data(t,()=>s)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),d()});window.bootstrapped&&(console.log("Loaded through window variable."),d()); +import{d as p,f as l}from"./format-money-62afb78b.js";import{G as f}from"./get-ea675e30.js";import{p as g}from"./parse-downloaded-splits-6b9adc20.js";import{p as m,d as w,e as a,f as y,g as b,h as P,i as S,l as v,a as C,b as A,c as _,s as E,j as D,k as c,m as u}from"./splice-errors-into-transactions-528a3749.js";import{i as o,m as T}from"./vendor-2609b2c9.js";import{d as x}from"./create-empty-split-aae839d5.js";import{P as B}from"./put-c9d3942f.js";import"./get-5b4283ca.js";const n=D();let L=function(){return{entries:[],originals:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"edit",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,editTitle:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.entries[e].errors=x());this.formStates.isSubmitting=!0;let t=m(this.entries,this.originals,this.groupProperties.transactionType),s={group_title:this.groupProperties.editTitle,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:t};this.groupProperties.title===null&&t.length>1&&(s.group_title=t[0].description);let r=new B;console.log(s),r.put(s,{id:this.groupProperties.id}).then(e=>{const i=e.data.data;if(this.groupProperties.id=parseInt(i.id),this.groupProperties.title=i.attributes.group_title??i.attributes.transactions[0].description,w(this.groupProperties.id,i.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(e=>{this.submitting=!1,console.log(e),typeof e.response<"u"&&this.parseErrors(e.response.data)})},filters:{source:[],destination:[]},addedSplit(){setTimeout(()=>{const t=function(s,r,e){return s.name_with_balance+'
'+o.t("firefly.account_type_"+s.type)+""};a({selector:"input.ac-source",serverUrl:n.account,filters:this.filters.source,onRenderItem:t,onChange:y,onSelectItem:b}),a({selector:"input.ac-dest",serverUrl:n.account,filters:this.filters.destination,onRenderItem:t,onChange:P,onSelectItem:S}),a({selector:"input.ac-category",serverUrl:n.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),a({selector:"input.ac-description",serverUrl:n.description,valueField:"id",labelField:"description",onChange:u,onSelectItem:u})},250)},changedDateTime(t){console.warn("changedDateTime, event is not used")},changedDescription(t){console.warn("changedDescription, event is not used")},changedDestinationAccount(t){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(t){console.warn("changedSourceAccount, event is not used")},formattedTotalAmount(){return this.entries.length===0?l(this.groupProperties.totalAmount,"EUR"):l(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},getTags(t){return console.log("at get tags "+t),console.log(this.entries[t].tags),this.entries[t].tags??[]},getTransactionGroup(){this.entries=[];const t=window.location.href.split("/"),s=parseInt(t[t.length-1]);new f().show(s,{}).then(e=>{const i=e.data.data;this.groupProperties.id=parseInt(i.id),this.groupProperties.transactionType=i.attributes.transactions[0].type.toLowerCase(),this.groupProperties.title=i.attributes.title??i.attributes.transactions[0].description,this.entries=g(i.attributes.transactions,parseInt(i.id)),this.notifications.wait.show=!1}).then(()=>{this.groupProperties.totalAmount=0;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[e].amount),this.filters.source.push(this.entries[e].source_account.type),this.filters.destination.push(this.entries[e].destination_account.type));console.log(this.filters),setTimeout(()=>{T.init("select.ac-tags",{allowClear:!0,server:n.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:o.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}})},150)})},init(){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_loading_transaction"),this.getTransactionGroup(),v().then(t=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=t.defaultCurrency,this.formData.enabledCurrencies=t.enabledCurrencies,this.formData.nativeCurrencies=t.nativeCurrencies,this.formData.foreignCurrencies=t.foreignCurrencies}),C().then(t=>{this.formData.budgets=t,this.formStates.loadingBudgets=!1}),A().then(t=>{this.formData.piggyBanks=t,this.formStates.loadingPiggyBanks=!1}),_().then(t=>{this.formData.subscriptions=t,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",t=>{this.processUpload(t),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",t=>{this.processUploadError(t)}),document.addEventListener("location-move",t=>{this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude}),document.addEventListener("location-set",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel}),document.addEventListener("location-zoom",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel})},changedAmount(t){const s=parseInt(t.target.dataset.index);this.entries[s].amount=parseFloat(t.target.value),this.groupProperties.totalAmount=0;for(let r in this.entries)this.entries.hasOwnProperty(r)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[r].amount))},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=o.t("firefly.updated_journal_js",{description:this.groupProperties.title});return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=updated"},parseErrors(t){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_submission_v2",{errorMessage:t.message}),t.hasOwnProperty("errors")&&(this.entries=E(t.errors,this.entries))},processUpload(t){this.showMessageOrRedirectUser()},processUploadError(t){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_upload"),console.error(t)}}},h={transactions:L,dates:p};function d(){Object.keys(h).forEach(t=>{console.log(`Loading page component "${t}"`);let s=h[t]();Alpine.data(t,()=>s)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),d()});window.bootstrapped&&(console.log("Loaded through window variable."),d()); diff --git a/public/build/assets/format-money-03f73825.js b/public/build/assets/format-money-62afb78b.js similarity index 99% rename from public/build/assets/format-money-03f73825.js rename to public/build/assets/format-money-62afb78b.js index aee7425a0d..b262f51d4a 100644 --- a/public/build/assets/format-money-03f73825.js +++ b/public/build/assets/format-money-62afb78b.js @@ -1 +1 @@ -import{q as y,s as d,r as l,t as p,u as _,v as c,w as b,x as N,y as P,z as v,D as g,i as C,E as B,G as x,H as O,J as o,K as E,N as T,f as L,O as S,Q as W,R as U,U as I,V as q,W as Q,X as V,Y,Z as $,_ as j,$ as z,a0 as X,a1 as F,a2 as G,a3 as H,a4 as J,a5 as K,a6 as Z,a7 as ee,a8 as te,a9 as ae,aa as se,ab as ne,ac as re,ad as le,ae as de,af as oe,ag as ie,ah as ue,ai as ge,aj as ce,ak as we,al as he,am as ye}from"./vendor-cc723e37.js";const k="/",h=y.create({baseURL:k,withCredentials:!0});y.defaults.withCredentials=!0;y.defaults.baseURL=k;class R{getByName(e){return h.get("/api/v1/preferences/"+e)}getByNameNow(e){return h.get("/api/v1/preferences/"+e)}postByName(e,a){return h.post("/api/v1/preferences",{name:e,data:a})}}class A{post(e,a){let s="/api/v1/preferences";return h.post(s,{name:e,data:a})}}function fe(t,e=null){return new R().getByName(t).then(s=>Promise.resolve(m(t,s))).catch(()=>{new A().post(t,e).then(i=>Promise.resolve(m(t,i)))})}function m(t,e){return e.data.data.attributes.data}function w(t,e=null){const a=window.store.get("cacheValid");if(a&&window.hasOwnProperty(t))return Promise.resolve(window[t]);const s=window.store.get(t);return a&&typeof s<"u"?Promise.resolve(s):new R().getByName(t).then(u=>Promise.resolve(M(t,u))).catch(()=>{new A().post(t,e).then(n=>Promise.resolve(M(t,n)))})}function M(t,e){let a=e.data.data.attributes.data;return window.store.set(t,a),a}function be(t,e){let a,s;switch(t){case"last365":a=d(g(e,365)),s=l(e);break;case"last90":a=d(g(e,90)),s=l(e);break;case"last30":a=d(g(e,30)),s=l(e);break;case"last7":a=d(g(e,7)),s=l(e);break;case"YTD":a=v(e),s=l(e);break;case"QTD":a=p(e),s=l(e);break;case"MTD":a=c(e),s=l(e);break;case"1D":a=d(e),s=l(e);break;case"1W":a=d(N(e,{weekStartsOn:1})),s=l(P(e,{weekStartsOn:1}));break;case"1M":a=d(c(e)),s=l(b(e));break;case"3M":a=d(p(e)),s=l(_(e));break;case"6M":e.getMonth()<=5&&(a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(5),s.setDate(30),s=l(a)),e.getMonth()>5&&(a=new Date(e),a.setMonth(6),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(a));break;case"1Y":a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(s);break}return{start:a,end:s}}let D=!1;function pe(t){if(D===!1){const e=t.replace("-","_");D=!0;const a=7*24*60*60*1e3;return console.log('Will load language "'+e+'"'),C.use(B).init({load:"languageOnly",fallbackLng:"en",lng:e,debug:!1,backend:{backends:[x,O],backendOptions:[{load:"languageOnly",expirationTime:a},{loadPath:"./v2/i18n/{{lng}}.json"}]}})}return console.warn("Loading translations skipped."),Promise.resolve()}o.addPlugin(E);window.bootstrapped=!1;window.store=o;fe("lastActivity").then(t=>{const e=o.get("lastActivity");o.set("cacheValid",e===t),o.set("lastActivity",t),console.log("Server value: "+t),console.log("Local value: "+e),console.log("Cache valid: "+(e===t))}).then(()=>{Promise.all([w("viewRange"),w("darkMode"),w("locale"),w("language")]).then(t=>{if(!o.get("start")||!o.get("end")){const e=be(t[0],new Date);o.set("start",e.start),o.set("end",e.end)}window.__localeId__=t[2],o.set("language",t[3]),o.set("locale",t[3]),pe(t[3]).then(()=>{const e=new Event("firefly-iii-bootstrapped");document.dispatchEvent(e),window.bootstrapped=!0})})});window.axios=y;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.Alpine=T;const f={bg:S,cs:W,da:U,de:I,el:q,enGB:Q,enUS:V,es:Y,ca:$,fi:j,fr:z,hu:X,id:F,it:G,ja:H,ko:J,nb:K,nn:Z,nl:ee,pl:te,ptBR:ae,pt:se,ro:ne,ru:re,sk:le,sl:de,sv:oe,tr:ie,uk:ue,vi:ge,zhTW:ce,zhCN:we};function r(t,e="PP"){let a=window.__localeId__.replace("_","");return L(t,e,{locale:f[a]??f[a.slice(0,2)]??f.enUS})}const Me=()=>({range:{start:null,end:null},defaultRange:{start:null,end:null},language:"en_US",init(){this.range={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.defaultRange={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.language=window.store.get("language"),this.locale=window.store.get("locale"),this.locale=this.locale==="equal"?this.language:this.locale,window.__localeId__=this.language,this.buildDateRange(),window.store.observe("start",t=>{this.range.start=new Date(t)}),window.store.observe("end",t=>{this.range.end=new Date(t),this.buildDateRange()})},buildDateRange(){let t=this.getNextRange(),e=this.getPrevRange(),a=this.lastDays(7),s=this.lastDays(30),i=this.mtd(),u=this.ytd(),n=document.getElementsByClassName("daterange-holder")[0];n.textContent=r(this.range.start)+" - "+r(this.range.end),n.setAttribute("data-start",r(this.range.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.range.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-current")[0],n.textContent=r(this.defaultRange.start)+" - "+r(this.defaultRange.end),n.setAttribute("data-start",r(this.defaultRange.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.defaultRange.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-next")[0],n.textContent=r(t.start)+" - "+r(t.end),n.setAttribute("data-start",r(t.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(t.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-prev")[0],n.textContent=r(e.start)+" - "+r(e.end),n.setAttribute("data-start",r(e.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(e.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-7d")[0],n.setAttribute("data-start",r(a.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(a.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-90d")[0],n.setAttribute("data-start",r(s.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(s.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-mtd")[0],n.setAttribute("data-start",r(i.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(i.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-ytd")[0],n.setAttribute("data-start",r(u.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(u.end,"yyyy-MM-dd"))},getNextRange(){let t=c(this.range.start),e=he(t,1),a=b(e);return{start:e,end:a}},getPrevRange(){let t=c(this.range.start),e=ye(t,1),a=b(e);return{start:e,end:a}},ytd(){let t=new Date;return{start:v(this.range.start),end:t}},mtd(){let t=new Date;return{start:c(this.range.start),end:t}},lastDays(t){let e=new Date;return{start:g(e,t),end:e}},changeDateRange(t){t.preventDefault();let e=t.currentTarget,a=new Date(e.getAttribute("data-start")),s=new Date(e.getAttribute("data-end"));return window.store.set("start",a),window.store.set("end",s),!1}});function De(t,e){let a=window.__localeId__.replace("_","-");return Intl.NumberFormat(a,{style:"currency",currency:e}).format(t)}export{A as P,h as a,r as b,Me as d,De as f,w as g}; +import{q as y,s as d,r as l,t as p,u as _,v as c,w as b,x as N,y as P,z as v,D as g,i as C,E as B,G as x,H as O,J as o,K as E,N as T,f as L,O as S,Q as W,R as U,U as I,V as q,W as Q,X as V,Y,Z as $,_ as j,$ as z,a0 as X,a1 as F,a2 as G,a3 as H,a4 as J,a5 as K,a6 as Z,a7 as ee,a8 as te,a9 as ae,aa as se,ab as ne,ac as re,ad as le,ae as de,af as oe,ag as ie,ah as ue,ai as ge,aj as ce,ak as we,al as he,am as ye}from"./vendor-2609b2c9.js";const k="/",h=y.create({baseURL:k,withCredentials:!0});y.defaults.withCredentials=!0;y.defaults.baseURL=k;class R{getByName(e){return h.get("/api/v1/preferences/"+e)}getByNameNow(e){return h.get("/api/v1/preferences/"+e)}postByName(e,a){return h.post("/api/v1/preferences",{name:e,data:a})}}class A{post(e,a){let s="/api/v1/preferences";return h.post(s,{name:e,data:a})}}function fe(t,e=null){return new R().getByName(t).then(s=>Promise.resolve(m(t,s))).catch(()=>{new A().post(t,e).then(i=>Promise.resolve(m(t,i)))})}function m(t,e){return e.data.data.attributes.data}function w(t,e=null){const a=window.store.get("cacheValid");if(a&&window.hasOwnProperty(t))return Promise.resolve(window[t]);const s=window.store.get(t);return a&&typeof s<"u"?Promise.resolve(s):new R().getByName(t).then(u=>Promise.resolve(M(t,u))).catch(()=>{new A().post(t,e).then(n=>Promise.resolve(M(t,n)))})}function M(t,e){let a=e.data.data.attributes.data;return window.store.set(t,a),a}function be(t,e){let a,s;switch(t){case"last365":a=d(g(e,365)),s=l(e);break;case"last90":a=d(g(e,90)),s=l(e);break;case"last30":a=d(g(e,30)),s=l(e);break;case"last7":a=d(g(e,7)),s=l(e);break;case"YTD":a=v(e),s=l(e);break;case"QTD":a=p(e),s=l(e);break;case"MTD":a=c(e),s=l(e);break;case"1D":a=d(e),s=l(e);break;case"1W":a=d(N(e,{weekStartsOn:1})),s=l(P(e,{weekStartsOn:1}));break;case"1M":a=d(c(e)),s=l(b(e));break;case"3M":a=d(p(e)),s=l(_(e));break;case"6M":e.getMonth()<=5&&(a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(5),s.setDate(30),s=l(a)),e.getMonth()>5&&(a=new Date(e),a.setMonth(6),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(a));break;case"1Y":a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(s);break}return{start:a,end:s}}let D=!1;function pe(t){if(D===!1){const e=t.replace("-","_");D=!0;const a=7*24*60*60*1e3;return console.log('Will load language "'+e+'"'),C.use(B).init({load:"languageOnly",fallbackLng:"en",lng:e,debug:!1,backend:{backends:[x,O],backendOptions:[{load:"languageOnly",expirationTime:a},{loadPath:"./v2/i18n/{{lng}}.json"}]}})}return console.warn("Loading translations skipped."),Promise.resolve()}o.addPlugin(E);window.bootstrapped=!1;window.store=o;fe("lastActivity").then(t=>{const e=o.get("lastActivity");o.set("cacheValid",e===t),o.set("lastActivity",t),console.log("Server value: "+t),console.log("Local value: "+e),console.log("Cache valid: "+(e===t))}).then(()=>{Promise.all([w("viewRange"),w("darkMode"),w("locale"),w("language")]).then(t=>{if(!o.get("start")||!o.get("end")){const e=be(t[0],new Date);o.set("start",e.start),o.set("end",e.end)}window.__localeId__=t[2],o.set("language",t[3]),o.set("locale",t[3]),pe(t[3]).then(()=>{const e=new Event("firefly-iii-bootstrapped");document.dispatchEvent(e),window.bootstrapped=!0})})});window.axios=y;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.Alpine=T;const f={bg:S,cs:W,da:U,de:I,el:q,enGB:Q,enUS:V,es:Y,ca:$,fi:j,fr:z,hu:X,id:F,it:G,ja:H,ko:J,nb:K,nn:Z,nl:ee,pl:te,ptBR:ae,pt:se,ro:ne,ru:re,sk:le,sl:de,sv:oe,tr:ie,uk:ue,vi:ge,zhTW:ce,zhCN:we};function r(t,e="PP"){let a=window.__localeId__.replace("_","");return L(t,e,{locale:f[a]??f[a.slice(0,2)]??f.enUS})}const Me=()=>({range:{start:null,end:null},defaultRange:{start:null,end:null},language:"en_US",init(){this.range={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.defaultRange={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.language=window.store.get("language"),this.locale=window.store.get("locale"),this.locale=this.locale==="equal"?this.language:this.locale,window.__localeId__=this.language,this.buildDateRange(),window.store.observe("start",t=>{this.range.start=new Date(t)}),window.store.observe("end",t=>{this.range.end=new Date(t),this.buildDateRange()})},buildDateRange(){let t=this.getNextRange(),e=this.getPrevRange(),a=this.lastDays(7),s=this.lastDays(30),i=this.mtd(),u=this.ytd(),n=document.getElementsByClassName("daterange-holder")[0];n.textContent=r(this.range.start)+" - "+r(this.range.end),n.setAttribute("data-start",r(this.range.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.range.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-current")[0],n.textContent=r(this.defaultRange.start)+" - "+r(this.defaultRange.end),n.setAttribute("data-start",r(this.defaultRange.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.defaultRange.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-next")[0],n.textContent=r(t.start)+" - "+r(t.end),n.setAttribute("data-start",r(t.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(t.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-prev")[0],n.textContent=r(e.start)+" - "+r(e.end),n.setAttribute("data-start",r(e.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(e.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-7d")[0],n.setAttribute("data-start",r(a.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(a.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-90d")[0],n.setAttribute("data-start",r(s.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(s.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-mtd")[0],n.setAttribute("data-start",r(i.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(i.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-ytd")[0],n.setAttribute("data-start",r(u.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(u.end,"yyyy-MM-dd"))},getNextRange(){let t=c(this.range.start),e=he(t,1),a=b(e);return{start:e,end:a}},getPrevRange(){let t=c(this.range.start),e=ye(t,1),a=b(e);return{start:e,end:a}},ytd(){let t=new Date;return{start:v(this.range.start),end:t}},mtd(){let t=new Date;return{start:c(this.range.start),end:t}},lastDays(t){let e=new Date;return{start:g(e,t),end:e}},changeDateRange(t){t.preventDefault();let e=t.currentTarget,a=new Date(e.getAttribute("data-start")),s=new Date(e.getAttribute("data-end"));return window.store.set("start",a),window.store.set("end",s),!1}});function De(t,e){let a=window.__localeId__.replace("_","-");return Intl.NumberFormat(a,{style:"currency",currency:e}).format(t)}export{A as P,h as a,r as b,Me as d,De as f,w as g}; diff --git a/public/build/assets/get-7f8692a5.js b/public/build/assets/get-5b4283ca.js similarity index 81% rename from public/build/assets/get-7f8692a5.js rename to public/build/assets/get-5b4283ca.js index 128753a053..63de7ff1ab 100644 --- a/public/build/assets/get-7f8692a5.js +++ b/public/build/assets/get-5b4283ca.js @@ -1 +1 @@ -import{a as s}from"./format-money-03f73825.js";let t=class{list(a){return s.get("/api/v2/subscriptions",{params:a})}paid(a){return s.get("/api/v2/subscriptions/sum/paid",{params:a})}unpaid(a){return s.get("/api/v2/subscriptions/sum/unpaid",{params:a})}};class e{list(a){return s.get("/api/v2/piggy-banks",{params:a})}}export{t as G,e as a}; +import{a as s}from"./format-money-62afb78b.js";let t=class{list(a){return s.get("/api/v2/subscriptions",{params:a})}paid(a){return s.get("/api/v2/subscriptions/sum/paid",{params:a})}unpaid(a){return s.get("/api/v2/subscriptions/sum/unpaid",{params:a})}};class e{list(a){return s.get("/api/v2/piggy-banks",{params:a})}}export{t as G,e as a}; diff --git a/public/build/assets/get-10f1237b.js b/public/build/assets/get-ea675e30.js similarity index 75% rename from public/build/assets/get-10f1237b.js rename to public/build/assets/get-ea675e30.js index 1204e20820..fe38611d0b 100644 --- a/public/build/assets/get-10f1237b.js +++ b/public/build/assets/get-ea675e30.js @@ -1 +1 @@ -import{a as t}from"./format-money-03f73825.js";class n{list(a){return t.get("/api/v2/transactions",{params:a})}listByCount(a){return t.get("/api/v2/transactions-inf",{params:a})}show(a,s){return t.get("/api/v2/transactions/"+a,{params:s})}}export{n as G}; +import{a as t}from"./format-money-62afb78b.js";class n{list(a){return t.get("/api/v2/transactions",{params:a})}listByCount(a){return t.get("/api/v2/transactions-inf",{params:a})}show(a,s){return t.get("/api/v2/transactions/"+a,{params:s})}}export{n as G}; diff --git a/public/build/assets/index-089e7bf2.js b/public/build/assets/index-78b5f723.js similarity index 97% rename from public/build/assets/index-089e7bf2.js rename to public/build/assets/index-78b5f723.js index 1d225bcc38..f01d626c40 100644 --- a/public/build/assets/index-089e7bf2.js +++ b/public/build/assets/index-78b5f723.js @@ -1 +1 @@ -import{b,d as V,f as u}from"./format-money-03f73825.js";import{M as E,I as j,f as h,i as d,o as C}from"./vendor-cc723e37.js";import{G as m}from"./get-10f1237b.js";import{P as c}from"./put-d747f13c.js";class T{init(t){document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")}),console.log("AmountEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="number",this.input.min="0",this.input.step="any",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.autofocus=!0,this.input.value=parseFloat(t.value.amount).toFixed(t.value.decimal_places)}onChange(t){console.log("AmountEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus(),this.input.select()}getGui(){return console.log("AmountEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("AmountEditor.getValue"),this.originalValue.amount=parseFloat(this.input.value),this.submitAmount(this.originalValue),this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}class v{constructor(){this.type="all",this.rowCount=null}rowCount(){return this.rowCount}getRows(t){new m().listByCount({start_row:t.startRow,end_row:t.endRow,type:this.type}).then(n=>{this.parseTransactions(n.data.data,t.successCallback),this.rowCount=n.data.meta.pagination.total}).catch(n=>{console.log(n)})}parseTransactions(t,i){let n=[];for(let r in t)if(t.hasOwnProperty(r)){let a=t[r],l=a.attributes.transactions.length>1,g=!0;for(let p in a.attributes.transactions)if(a.attributes.transactions.hasOwnProperty(p)){let o=a.attributes.transactions[p],s={};s.split=l,s.firstSplit=g,s.group_title=a.attributes.group_title,s.created_at=a.attributes.created_at,s.updated_at=a.attributes.updated_at,s.user=a.attributes.user,s.user_group=a.attributes.user_group,s.id=parseInt(a.id),s.transaction_journal_id=parseInt(o.transaction_journal_id),s.description=o.description,s.date=new Date(o.date),s.from={name:o.source_name,id:o.source_id,type:o.source_type},s.to={name:o.destination_name,id:o.destination_id,type:o.destination_type},s.category={name:o.category_name,id:o.category_id},s.budget={name:o.budget_name,id:o.budget_id},s.amount={id:parseInt(a.id),transaction_journal_id:parseInt(o.transaction_journal_id),type:o.type,amount:o.amount,currency_code:o.currency_code,decimal_places:o.currency_decimal_places,foreign_amount:o.foreign_amount,foreign_currency_code:o.foreign_currency_code,foreign_decimal_places:o.foreign_currency_decimal_places},s.icon={classes:"fa fa-solid fa-arrow-left",id:s.id},g=!1,n.push(s)}}return i(n,!1),n}setType(t){this.type=t}}class x{init(t){console.log("DateTimeEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="datetime-local",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.value=b(t.value,"yyyy-MM-dd HH:mm")}onChange(t){console.log("DateTimeEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus()}getGui(){return console.log("DateTimeEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("DateTimeEditor.getValue"),this.originalValue=this.input.value,this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}const _=new v;_.setType("withdrawal");document.addEventListener("cellEditRequest",()=>{console.log("Loaded through event listener.")});let w;const A=["description","amount","date"],R=e=>{console.log("onCellEditRequestMethod");const t=e.data,i=e.colDef.field;let n=e.newValue;if(!A.includes(i)){console.log("Field "+i+" is not editable.");return}i==="amount"&&(n=e.newValue.amount,console.log("New value is now"+n)),console.log('New value for field "'+i+'" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+n+'"'),t[i]=n,w.getRowNode(String(e.rowIndex)).updateData(t);let a={transactions:[{transaction_journal_id:t.transaction_journal_id}]};a.transactions[0][i]=n,new c().put(a,{id:t.id})};document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")});document.addEventListener("onCellValueChanged",()=>{console.log("I just realized a cell value has changed.")});const D={rowModelType:"infinite",datasource:_,onCellEditRequest:R,readOnlyEdit:!0,columnDefs:[{field:"icon",editable:!1,headerName:"",sortable:!1,width:40,cellRenderer:function(e){return e.getValue()?'':""}},{field:"description",cellDataType:"text",editable:!0},{field:"amount",editable:function(e){return e.data.amount.foreign_amount===null&&e.data.amount.foreign_currency_code===null},cellEditor:T,cellRenderer(e){if(e.getValue()){let t="",i=parseFloat(e.getValue().amount),n=e.getValue(),r="text-danger";if(n.type==="withdrawal"&&(i=i*-1),n.type==="deposit"&&(r="text-success"),n.type==="transfer"&&(r="text-info"),t+=''+u(i,e.getValue().currency_code)+"",n.foreign_amount){let a=parseFloat(e.getValue().foreign_amount);n.type==="withdrawal"&&(a=a*-1),t+=' ('+u(a,n.foreign_currency_code)+")"}return t}return""}},{field:"date",editable:!0,cellDataType:"date",cellEditor:x,cellEditorPopup:!0,cellEditorPopupPosition:"under",cellRenderer(e){return e.getValue()?h(e.getValue(),d.t("config.date_time_fns_short")):""}},{field:"from",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return''+t.name+""}return""}},{field:"to",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return''+t.name+""}return""}},{field:"category",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return''+t.name+""}return""}},{field:"budget",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return''+t.name+""}return""}}]};E.registerModules([j]);let G=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},transactions:[],totalPages:1,perPage:50,page:1,tableColumns:{description:{enabled:!0},source:{enabled:!0},destination:{enabled:!0},amount:{enabled:!0}},table:null,formatMoney(e,t){return u(e,t)},format(e){return h(e,d.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=d.t("firefly.wait_loading_data"),w=C(document.querySelector("#grid"),D)},getTransactions(e){const t=window.location.href.split("/"),i=t[t.length-1];new m().list({page:e,type:i}).then(r=>{this.parseTransactions(r.data.data),this.totalPages=r.data.meta.pagination.total_pages,this.perPage=r.data.meta.pagination.per_page,this.page=r.data.meta.pagination.current_page}).catch(r=>{this.notifications.wait.show=!1,this.notifications.error.show=!0,this.notifications.error.text=r.response.data.message})},parseTransactions(e){for(let t in e)if(e.hasOwnProperty(t)){let i=e[t],n=i.attributes.transactions.length>1,r=!0;for(let a in i.attributes.transactions)if(i.attributes.transactions.hasOwnProperty(a)){let l=i.attributes.transactions[a];l.split=n,tranaction.icon="fa fa-solid fa-arrow-left",l.firstSplit=r,l.group_title=i.attributes.group_title,l.id=i.id,l.created_at=i.attributes.created_at,l.updated_at=i.attributes.updated_at,l.user=i.attributes.user,l.user_group=i.attributes.user_group,r=!1,this.transactions.push(l)}}this.notifications.wait.show=!1,console.log("refresh!")}}},f={index:G,dates:V};function y(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),y()});window.bootstrapped&&(console.log("Loaded through window variable."),y()); +import{b,d as V,f as u}from"./format-money-62afb78b.js";import{M as E,I as j,f as h,i as d,o as C}from"./vendor-2609b2c9.js";import{G as m}from"./get-ea675e30.js";import{P as c}from"./put-c9d3942f.js";class T{init(t){document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")}),console.log("AmountEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="number",this.input.min="0",this.input.step="any",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.autofocus=!0,this.input.value=parseFloat(t.value.amount).toFixed(t.value.decimal_places)}onChange(t){console.log("AmountEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus(),this.input.select()}getGui(){return console.log("AmountEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("AmountEditor.getValue"),this.originalValue.amount=parseFloat(this.input.value),this.submitAmount(this.originalValue),this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}class v{constructor(){this.type="all",this.rowCount=null}rowCount(){return this.rowCount}getRows(t){new m().listByCount({start_row:t.startRow,end_row:t.endRow,type:this.type}).then(n=>{this.parseTransactions(n.data.data,t.successCallback),this.rowCount=n.data.meta.pagination.total}).catch(n=>{console.log(n)})}parseTransactions(t,i){let n=[];for(let r in t)if(t.hasOwnProperty(r)){let a=t[r],l=a.attributes.transactions.length>1,g=!0;for(let p in a.attributes.transactions)if(a.attributes.transactions.hasOwnProperty(p)){let o=a.attributes.transactions[p],s={};s.split=l,s.firstSplit=g,s.group_title=a.attributes.group_title,s.created_at=a.attributes.created_at,s.updated_at=a.attributes.updated_at,s.user=a.attributes.user,s.user_group=a.attributes.user_group,s.id=parseInt(a.id),s.transaction_journal_id=parseInt(o.transaction_journal_id),s.description=o.description,s.date=new Date(o.date),s.from={name:o.source_name,id:o.source_id,type:o.source_type},s.to={name:o.destination_name,id:o.destination_id,type:o.destination_type},s.category={name:o.category_name,id:o.category_id},s.budget={name:o.budget_name,id:o.budget_id},s.amount={id:parseInt(a.id),transaction_journal_id:parseInt(o.transaction_journal_id),type:o.type,amount:o.amount,currency_code:o.currency_code,decimal_places:o.currency_decimal_places,foreign_amount:o.foreign_amount,foreign_currency_code:o.foreign_currency_code,foreign_decimal_places:o.foreign_currency_decimal_places},s.icon={classes:"fa fa-solid fa-arrow-left",id:s.id},g=!1,n.push(s)}}return i(n,!1),n}setType(t){this.type=t}}class x{init(t){console.log("DateTimeEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="datetime-local",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.value=b(t.value,"yyyy-MM-dd HH:mm")}onChange(t){console.log("DateTimeEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus()}getGui(){return console.log("DateTimeEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("DateTimeEditor.getValue"),this.originalValue=this.input.value,this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}const _=new v;_.setType("withdrawal");document.addEventListener("cellEditRequest",()=>{console.log("Loaded through event listener.")});let w;const A=["description","amount","date"],R=e=>{console.log("onCellEditRequestMethod");const t=e.data,i=e.colDef.field;let n=e.newValue;if(!A.includes(i)){console.log("Field "+i+" is not editable.");return}i==="amount"&&(n=e.newValue.amount,console.log("New value is now"+n)),console.log('New value for field "'+i+'" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+n+'"'),t[i]=n,w.getRowNode(String(e.rowIndex)).updateData(t);let a={transactions:[{transaction_journal_id:t.transaction_journal_id}]};a.transactions[0][i]=n,new c().put(a,{id:t.id})};document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")});document.addEventListener("onCellValueChanged",()=>{console.log("I just realized a cell value has changed.")});const D={rowModelType:"infinite",datasource:_,onCellEditRequest:R,readOnlyEdit:!0,columnDefs:[{field:"icon",editable:!1,headerName:"",sortable:!1,width:40,cellRenderer:function(e){return e.getValue()?'':""}},{field:"description",cellDataType:"text",editable:!0},{field:"amount",editable:function(e){return e.data.amount.foreign_amount===null&&e.data.amount.foreign_currency_code===null},cellEditor:T,cellRenderer(e){if(e.getValue()){let t="",i=parseFloat(e.getValue().amount),n=e.getValue(),r="text-danger";if(n.type==="withdrawal"&&(i=i*-1),n.type==="deposit"&&(r="text-success"),n.type==="transfer"&&(r="text-info"),t+=''+u(i,e.getValue().currency_code)+"",n.foreign_amount){let a=parseFloat(e.getValue().foreign_amount);n.type==="withdrawal"&&(a=a*-1),t+=' ('+u(a,n.foreign_currency_code)+")"}return t}return""}},{field:"date",editable:!0,cellDataType:"date",cellEditor:x,cellEditorPopup:!0,cellEditorPopupPosition:"under",cellRenderer(e){return e.getValue()?h(e.getValue(),d.t("config.date_time_fns_short")):""}},{field:"from",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return''+t.name+""}return""}},{field:"to",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return''+t.name+""}return""}},{field:"category",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return''+t.name+""}return""}},{field:"budget",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return''+t.name+""}return""}}]};E.registerModules([j]);let G=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},transactions:[],totalPages:1,perPage:50,page:1,tableColumns:{description:{enabled:!0},source:{enabled:!0},destination:{enabled:!0},amount:{enabled:!0}},table:null,formatMoney(e,t){return u(e,t)},format(e){return h(e,d.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=d.t("firefly.wait_loading_data"),w=C(document.querySelector("#grid"),D)},getTransactions(e){const t=window.location.href.split("/"),i=t[t.length-1];new m().list({page:e,type:i}).then(r=>{this.parseTransactions(r.data.data),this.totalPages=r.data.meta.pagination.total_pages,this.perPage=r.data.meta.pagination.per_page,this.page=r.data.meta.pagination.current_page}).catch(r=>{this.notifications.wait.show=!1,this.notifications.error.show=!0,this.notifications.error.text=r.response.data.message})},parseTransactions(e){for(let t in e)if(e.hasOwnProperty(t)){let i=e[t],n=i.attributes.transactions.length>1,r=!0;for(let a in i.attributes.transactions)if(i.attributes.transactions.hasOwnProperty(a)){let l=i.attributes.transactions[a];l.split=n,tranaction.icon="fa fa-solid fa-arrow-left",l.firstSplit=r,l.group_title=i.attributes.group_title,l.id=i.id,l.created_at=i.attributes.created_at,l.updated_at=i.attributes.updated_at,l.user=i.attributes.user,l.user_group=i.attributes.user_group,r=!1,this.transactions.push(l)}}this.notifications.wait.show=!1,console.log("refresh!")}}},f={index:G,dates:V};function y(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),y()});window.bootstrapped&&(console.log("Loaded through window variable."),y()); diff --git a/public/build/assets/parse-downloaded-splits-fb2d62df.js b/public/build/assets/parse-downloaded-splits-6b9adc20.js similarity index 91% rename from public/build/assets/parse-downloaded-splits-fb2d62df.js rename to public/build/assets/parse-downloaded-splits-6b9adc20.js index 2d36356d3b..e9784de594 100644 --- a/public/build/assets/parse-downloaded-splits-fb2d62df.js +++ b/public/build/assets/parse-downloaded-splits-6b9adc20.js @@ -1 +1 @@ -import{c as o}from"./create-empty-split-d82bb341.js";import{f as _}from"./vendor-cc723e37.js";function l(a,r){let n=[];for(let i in a)if(a.hasOwnProperty(i)){let e=a[i],t=o();t.transaction_journal_id=e.transaction_journal_id,t.transaction_group_id=r,t.bill_id=e.bill_id,t.bill_name=e.bill_name,t.budget_id=e.budget_id,t.budget_name=e.budget_name,t.category_name=e.category_name,t.category_id=e.category_id,t.piggy_bank_id=e.piggy_bank_id,t.piggy_bank_name=e.piggy_bank_name,t.book_date=e.book_date,t.due_date=e.due_date,t.interest_date=e.interest_date,t.invoice_date=e.invoice_date,t.payment_date=e.payment_date,t.process_date=e.process_date,t.external_url=e.external_url,t.internal_reference=e.internal_reference,t.notes=e.notes,t.tags=e.tags,t.amount=parseFloat(e.amount).toFixed(e.currency_decimal_places),t.currency_code=e.currency_code,e.foreign_amount!==null&&(t.forein_currency_code=e.foreign_currency_code,t.foreign_amount=parseFloat(e.foreign_amount).toFixed(e.foreign_currency_decimal_places)),t.date=_(new Date(e.date),"yyyy-MM-dd HH:mm"),t.description=e.description,t.destination_account={id:e.destination_id,name:e.destination_name,type:e.destination_type,alpine_name:e.destination_name},t.source_account={id:e.source_id,name:e.source_name,type:e.source_type,alpine_name:e.source_name},e.latitude!==null&&(t.hasLocation=!0,t.latitude=e.latitude,t.longitude=e.longitude,t.zoomLevel=e.zoom_level),n.push(t)}return n}export{l as p}; +import{c as o}from"./create-empty-split-aae839d5.js";import{f as _}from"./vendor-2609b2c9.js";function l(a,r){let n=[];for(let i in a)if(a.hasOwnProperty(i)){let e=a[i],t=o();t.transaction_journal_id=e.transaction_journal_id,t.transaction_group_id=r,t.bill_id=e.bill_id,t.bill_name=e.bill_name,t.budget_id=e.budget_id,t.budget_name=e.budget_name,t.category_name=e.category_name,t.category_id=e.category_id,t.piggy_bank_id=e.piggy_bank_id,t.piggy_bank_name=e.piggy_bank_name,t.book_date=e.book_date,t.due_date=e.due_date,t.interest_date=e.interest_date,t.invoice_date=e.invoice_date,t.payment_date=e.payment_date,t.process_date=e.process_date,t.external_url=e.external_url,t.internal_reference=e.internal_reference,t.notes=e.notes,t.tags=e.tags,t.amount=parseFloat(e.amount).toFixed(e.currency_decimal_places),t.currency_code=e.currency_code,e.foreign_amount!==null&&(t.forein_currency_code=e.foreign_currency_code,t.foreign_amount=parseFloat(e.foreign_amount).toFixed(e.foreign_currency_decimal_places)),t.date=_(new Date(e.date),"yyyy-MM-dd HH:mm"),t.description=e.description,t.destination_account={id:e.destination_id,name:e.destination_name,type:e.destination_type,alpine_name:e.destination_name},t.source_account={id:e.source_id,name:e.source_name,type:e.source_type,alpine_name:e.source_name},e.latitude!==null&&(t.hasLocation=!0,t.latitude=e.latitude,t.longitude=e.longitude,t.zoomLevel=e.zoom_level),n.push(t)}return n}export{l as p}; diff --git a/public/build/assets/put-d747f13c.js b/public/build/assets/put-c9d3942f.js similarity index 55% rename from public/build/assets/put-d747f13c.js rename to public/build/assets/put-c9d3942f.js index 5ab46a4c2c..b7259b3ef3 100644 --- a/public/build/assets/put-d747f13c.js +++ b/public/build/assets/put-c9d3942f.js @@ -1 +1 @@ -import{a as p}from"./format-money-03f73825.js";class u{put(t,a){let r="/api/v2/transactions/"+parseInt(a.id);return p.put(r,t)}}export{u as P}; +import{a as p}from"./format-money-62afb78b.js";class u{put(t,a){let r="/api/v2/transactions/"+parseInt(a.id);return p.put(r,t)}}export{u as P}; diff --git a/public/build/assets/show-7827ee8e.js b/public/build/assets/show-c2b3bd03.js similarity index 98% rename from public/build/assets/show-7827ee8e.js rename to public/build/assets/show-c2b3bd03.js index 3898374c50..408cd95d8b 100644 --- a/public/build/assets/show-7827ee8e.js +++ b/public/build/assets/show-c2b3bd03.js @@ -1 +1 @@ -var y=Object.defineProperty;var w=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>(w(i,typeof t!="symbol"?t+"":t,e),e);import{d as v,f as b}from"./format-money-03f73825.js";import{f as g,i as h}from"./vendor-cc723e37.js";import{G as E}from"./get-10f1237b.js";import{p as _}from"./parse-downloaded-splits-fb2d62df.js";import"./create-empty-split-d82bb341.js";class l{constructor(t){if(this.constructor===l)throw new Error("It's abstract class");this.context=t}event_show(){this.context.typeElement.hideError(),this.context.typeElement.element.value=this.context.value,this.context.element.dispatchEvent(new CustomEvent("show"))}event_shown(){this.context.element.dispatchEvent(new CustomEvent("shown"))}event_hide(){this.context.element.dispatchEvent(new CustomEvent("hide"))}event_hidden(){this.context.element.dispatchEvent(new CustomEvent("hidden"))}init(){throw new Error("Method `init` not define!")}enable(){throw new Error("Method `enable` not define!")}disable(){throw new Error("Method `disable` not define!")}hide(){throw new Error("Method `hide` not define!")}}class L extends l{init(){this.popover=new bootstrap.Popover(this.context.element,{container:"body",content:this.context.typeElement.create(),html:!0,customClass:"dark-editable",title:this.context.title}),this.context.element.addEventListener("show.bs.popover",()=>{this.event_show()}),this.context.element.addEventListener("shown.bs.popover",()=>{this.event_shown()}),this.context.element.addEventListener("hide.bs.popover",()=>{this.event_hide()}),this.context.element.addEventListener("hidden.bs.popover",()=>{this.event_hidden()}),document.addEventListener("click",t=>{const e=t.target;if(e===this.popover.tip||e===this.context.element)return;let n=e;for(;n=n.parentNode;)if(n===this.popover.tip)return;this.hide()})}enable(){this.popover.enable()}disable(){this.popover.disable()}hide(){this.popover.hide()}}class T extends l{init(){const t=()=>{if(!this.context.disabled){const e=this.context.typeElement.create();this.event_show(),this.context.element.removeEventListener("click",t),this.context.element.innerHTML="",this.context.element.append(e),this.event_shown()}};this.context.element.addEventListener("click",t)}enable(){}disable(){}hide(){this.event_hide(),this.context.element.innerHTML=this.context.value,setTimeout(()=>{this.init(),this.event_hidden()},100)}}class c{constructor(t){r(this,"context",null);r(this,"element",null);r(this,"error",null);r(this,"form",null);r(this,"load",null);r(this,"buttonGroup",null);r(this,"buttons",{success:null,cancel:null});if(this.constructor===c)throw new Error("It's abstract class");this.context=t}create(){throw new Error("Method `create` not define!")}createContainer(t){const e=document.createElement("div");this.element=t,this.error=this.createContainerError(),this.form=this.createContainerForm(),this.load=this.createContainerLoad(),this.buttons.success=this.createButtonSuccess(),this.buttons.cancel=this.createButtonCancel();const n=document.createElement("div");n.classList.add("col-12");const s=document.createElement("label");s.classList.add("visually-hidden"),s.for=t.id,n.append(s,t);const o=document.createElement("div");return o.classList.add("col-12"),this.buttonGroup=this.createButtonGroup(),this.buttonGroup.append(this.buttons.success,this.buttons.cancel),o.append(this.buttonGroup),this.form.append(n,o),e.append(this.error,this.form),e}createButtonGroup(){const t=document.createElement("div");return t.classList.add("btn-group","btn-group-sm"),t}createContainerError(){const t=document.createElement("div");return t.classList.add("text-danger","fst-italic","mb-2","fw-bold"),t.style.display="none",t}createContainerForm(){const t=document.createElement("form");return t.classList.add("row","row-cols-lg-auto","g-3","align-items-center"),t.addEventListener("submit",async e=>{e.preventDefault();const n=this.getValue();if(this.context.send&&this.context.pk&&this.context.url&&this.context.value!==n){this.showLoad();let s;try{const o=await this.ajax(n);o.ok?s=await this.context.success(o,n):s=await this.context.error(o,n)||`${o.status} ${o.statusText}`}catch(o){console.error(o),s=o}s?(this.setError(s),this.showError()):(this.setError(null),this.hideError(),this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText()),this.hideLoad()}else this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText();this.context.element.dispatchEvent(new CustomEvent("save"))}),t}createContainerLoad(){const t=document.createElement("div");t.style.display="none",t.style.position="absolute",t.style.background="white",t.style.width="100%",t.style.height="100%",t.style.top=0,t.style.left=0;const e=document.createElement("div");return e.classList.add("dark-editable-loader"),t.append(e),t}createButton(){const t=document.createElement("button");return t.type="button",t.classList.add("btn","btn-sm"),t.style.color="transparent",t.style.textShadow="0 0 0 white",t}createButtonSuccess(){const t=this.createButton();return t.type="submit",t.classList.add("btn-success"),t.innerHTML="✔",t}createButtonCancel(){const t=this.createButton();t.classList.add("btn-danger");const e=document.createElement("div");return e.innerHTML="✖",t.append(e),t.addEventListener("click",()=>{this.context.modeElement.hide()}),t}hideLoad(){this.load.style.display="none"}showLoad(){this.load.style.display="block"}ajax(t){let e=this.context.url,n,s=!1;console.log(this.context),this.context.options.formType==="journal_description"&&(s=!0,n={transactions:[{transaction_journal_id:this.context.options.journalId,description:t}]}),s===!1&&console.error('Cannot deal with form type "'+this.context.formType+'"');const o={headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}};return o.method=this.context.ajaxOptions.method,this.context.options.method&&(o.method=this.context.options.method),o.method==="POST"||this.context.options.method==="PUT"?o.body=JSON.stringify(n):e+="?"+new URLSearchParams(form).toString(),fetch(e,o)}async successResponse(t,e){}async errorResponse(t,e){}setError(t){this.error.innerHTML=t}showError(){this.error.style.display="block"}hideError(){this.error&&(this.error.style.display="none")}createElement(t){const e=document.createElement(t);return console.log(e),e.classList.add("form-control"),this.context.required&&(e.required=this.context.required),this.add_focus(e),e}add_focus(t){this.context.element.addEventListener("shown",function(){t.focus()})}initText(){return this.context.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=this.context.value,!1)}initOptions(){}getValue(){return this.element.value}}class M extends c{create(){const t=this.createElement("input"),e=this.context.element.id+"_input";return t.type=this.context.type,t.id=e,t.autocomplete="off",t.placeholder=this.context.element.innerText,t.classList.add("form-control","form-control-md"),this.createContainer(t)}}class C extends c{create(){const t=this.createElement("textarea");return this.createContainer(t)}}class k extends c{create(){const t=this.createElement("select");return this.context.source.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.innerHTML=e.text,t.append(n)}),this.createContainer(t)}initText(){if(this.context.element.innerHTML=this.context.emptytext,this.context.value!==""&&this.context.source.length>0)for(const t in this.context.source){const e=this.context.source[t];if(e.value==this.context.value)return this.context.element.innerHTML=e.text,!1}return!0}initOptions(){this.context.get_opt("source",[]),typeof this.context.source=="string"&&this.context.source!==""&&(this.context.source=JSON.parse(this.context.source))}}class f extends c{create(){const t=this.createElement("input");return t.type="date",this.createContainer(t)}initText(){return this.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=moment(this.context.value).format(this.context.viewformat),!1)}initOptions(){this.context.get_opt("format","YYYY-MM-DD"),this.context.get_opt("viewformat","YYYY-MM-DD")}}class D extends f{create(){const t=this.createElement("input");return t.type="datetime-local",this.createContainer(t)}initOptions(){this.context.get_opt("format","YYYY-MM-DD HH:mm"),this.context.get_opt("viewformat","YYYY-MM-DD HH:mm"),this.context.value=moment(this.context.value).format("YYYY-MM-DDTHH:mm")}}class Y{constructor(t,e={}){r(this,"modeElement",null);r(this,"typeElement",null);r(this,"mode",null);r(this,"type",null);r(this,"emptytext",null);r(this,"viewformat",null);r(this,"pk",null);r(this,"name",null);this.element=t,this.options=e,this.init_options(),this.typeElement=this.route_type(),this.typeElement.initOptions(),this.modeElement=this.route_mode(),this.modeElement.init(),this.init_text(),this.init_style(),this.disabled&&this.disable(),this.element.dispatchEvent(new CustomEvent("init"))}get_opt(t,e){var n,s;return this[t]=((n=this.element.dataset)==null?void 0:n[t])??((s=this.options)==null?void 0:s[t])??e}get_opt_bool(t,e){return this.get_opt(t,e),typeof this[t]!="boolean"&&(this[t]==="true"?this[t]=!0:this[t]==="false"?this[t]=!1:this[t]=e),this[t]}init_options(){var t,e,n,s;this.get_opt("value",this.element.innerHTML),this.get_opt("name",this.element.id),this.get_opt("pk",null),this.get_opt("title",""),this.get_opt("type","text"),this.get_opt("emptytext","Empty"),this.get_opt("mode","popup"),this.get_opt("url",null),this.get_opt("ajaxOptions",{}),this.ajaxOptions=Object.assign({method:"POST",dataType:"text"},this.ajaxOptions),this.get_opt_bool("send",!0),this.get_opt_bool("disabled",!1),this.get_opt_bool("required",!1),(t=this.options)!=null&&t.success&&typeof((e=this.options)==null?void 0:e.success)=="function"&&(this.success=this.options.success),(n=this.options)!=null&&n.error&&typeof((s=this.options)==null?void 0:s.error)=="function"&&(this.error=this.options.error)}init_text(){const t="dark-editable-element-empty";this.element.classList.remove(t),this.typeElement.initText()&&this.element.classList.add(t)}init_style(){this.element.classList.add("dark-editable-element")}route_mode(){switch(this.mode){default:throw new Error(`Mode ${this.mode} not found!`);case"popup":return new L(this);case"inline":return new T(this)}}route_type(){if(this.type.prototype instanceof c)return new this.type(this);if(typeof this.type=="string")switch(this.type){case"text":case"password":case"email":case"url":case"tel":case"number":case"range":case"time":return new M(this);case"textarea":return new C(this);case"select":return new k(this);case"date":return new f(this);case"datetime":return new D(this)}throw new Error("Undefined type")}async success(t,e){return await this.typeElement.successResponse(t,e)}async error(t,e){return await this.typeElement.errorResponse(t,e)}enable(){this.disabled=!1,this.element.classList.remove("dark-editable-element-disabled"),this.modeElement.enable()}disable(){this.disabled=!0,this.element.classList.add("dark-editable-element-disabled"),this.modeElement.enable()}setValue(t){this.value=t,this.init_text()}getValue(){return this.value}}function H(i){const t=parseInt(i.dataset.id),e=parseInt(i.dataset.group),n={pk:e,mode:"inline",url:"./api/v2/transactions/"+e,formType:"journal_description",journalId:t,method:"PUT"};new Y(i,n)}let I=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},groupProperties:{id:0,transactionType:"",transactionTypeTranslated:"",title:"",date:new Date},dateFields:["book_date","due_date","interest_date","invoice_date","payment_date","process_date"],metaFields:["external_id","internal_reference","sepa_batch_id","sepa_ct_id","sepa_ct_op","sepa_db","sepa_country","sepa_cc","sepa_ep","sepa_ci","external_url"],amounts:{},entries:[],pageProperties:{},formatMoney(i,t){return console.log("formatting",i,t),t===""&&(t="EUR"),b(i,t)},format(i){return g(i,h.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=h.t("firefly.wait_loading_data");const i=window.location.href.split("/"),t=parseInt(i[i.length-1]);new E().show(t,{}).then(n=>{const s=n.data.data;this.groupProperties.id=parseInt(s.id),this.groupProperties.transactionType=s.attributes.transactions[0].type,this.groupProperties.transactionTypeTranslated=h.t("firefly."+s.attributes.transactions[0].type),this.groupProperties.title=s.attributes.title??s.attributes.transactions[0].description,this.entries=_(s.attributes.transactions,parseInt(s.id)),this.notifications.wait.show=!1}).then(()=>{for(let s in this.entries)if(this.entries.hasOwnProperty(s)){const o=this.entries[s].currency_code,a=this.entries[s].foreign_currency_code;this.amounts[o]===void 0&&(this.amounts[o]=0,this.amounts[o]+=parseFloat(this.entries[s].amount)),a!==null&&a!==""&&this.amounts[a]===void 0&&(this.amounts[a]=0,this.amounts[a]+=parseFloat(this.entries[s].foreign_amount)),parseInt(s)===0&&(this.groupProperties.date=this.entries[s].date)}const n=document.querySelectorAll(".journal_description");for(const s in n)if(n.hasOwnProperty(s)){const o=n[s];o.addEventListener("save",function(a){parseInt(a.currentTarget.dataset.id);const d=parseInt(a.currentTarget.dataset.group),u=parseInt(a.currentTarget.dataset.length),p=a.currentTarget.textContent;console.log(u),u===1&&(document.querySelector('.group_title[data-group="'+d+'"]').textContent=p,document.querySelector('.group_title_title[data-group="'+d+'"]').textContent=p)}),H(o)}}).catch(n=>{this.notifications.error.show=!0,this.notifications.error.text=n.message})}}},m={show:I,dates:v};function x(){Object.keys(m).forEach(i=>{console.log(`Loading page component "${i}"`);let t=m[i]();Alpine.data(i,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),x()});window.bootstrapped&&(console.log("Loaded through window variable."),x()); +var y=Object.defineProperty;var w=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>(w(i,typeof t!="symbol"?t+"":t,e),e);import{d as v,f as b}from"./format-money-62afb78b.js";import{f as g,i as h}from"./vendor-2609b2c9.js";import{G as E}from"./get-ea675e30.js";import{p as _}from"./parse-downloaded-splits-6b9adc20.js";import"./create-empty-split-aae839d5.js";class l{constructor(t){if(this.constructor===l)throw new Error("It's abstract class");this.context=t}event_show(){this.context.typeElement.hideError(),this.context.typeElement.element.value=this.context.value,this.context.element.dispatchEvent(new CustomEvent("show"))}event_shown(){this.context.element.dispatchEvent(new CustomEvent("shown"))}event_hide(){this.context.element.dispatchEvent(new CustomEvent("hide"))}event_hidden(){this.context.element.dispatchEvent(new CustomEvent("hidden"))}init(){throw new Error("Method `init` not define!")}enable(){throw new Error("Method `enable` not define!")}disable(){throw new Error("Method `disable` not define!")}hide(){throw new Error("Method `hide` not define!")}}class L extends l{init(){this.popover=new bootstrap.Popover(this.context.element,{container:"body",content:this.context.typeElement.create(),html:!0,customClass:"dark-editable",title:this.context.title}),this.context.element.addEventListener("show.bs.popover",()=>{this.event_show()}),this.context.element.addEventListener("shown.bs.popover",()=>{this.event_shown()}),this.context.element.addEventListener("hide.bs.popover",()=>{this.event_hide()}),this.context.element.addEventListener("hidden.bs.popover",()=>{this.event_hidden()}),document.addEventListener("click",t=>{const e=t.target;if(e===this.popover.tip||e===this.context.element)return;let n=e;for(;n=n.parentNode;)if(n===this.popover.tip)return;this.hide()})}enable(){this.popover.enable()}disable(){this.popover.disable()}hide(){this.popover.hide()}}class T extends l{init(){const t=()=>{if(!this.context.disabled){const e=this.context.typeElement.create();this.event_show(),this.context.element.removeEventListener("click",t),this.context.element.innerHTML="",this.context.element.append(e),this.event_shown()}};this.context.element.addEventListener("click",t)}enable(){}disable(){}hide(){this.event_hide(),this.context.element.innerHTML=this.context.value,setTimeout(()=>{this.init(),this.event_hidden()},100)}}class c{constructor(t){r(this,"context",null);r(this,"element",null);r(this,"error",null);r(this,"form",null);r(this,"load",null);r(this,"buttonGroup",null);r(this,"buttons",{success:null,cancel:null});if(this.constructor===c)throw new Error("It's abstract class");this.context=t}create(){throw new Error("Method `create` not define!")}createContainer(t){const e=document.createElement("div");this.element=t,this.error=this.createContainerError(),this.form=this.createContainerForm(),this.load=this.createContainerLoad(),this.buttons.success=this.createButtonSuccess(),this.buttons.cancel=this.createButtonCancel();const n=document.createElement("div");n.classList.add("col-12");const s=document.createElement("label");s.classList.add("visually-hidden"),s.for=t.id,n.append(s,t);const o=document.createElement("div");return o.classList.add("col-12"),this.buttonGroup=this.createButtonGroup(),this.buttonGroup.append(this.buttons.success,this.buttons.cancel),o.append(this.buttonGroup),this.form.append(n,o),e.append(this.error,this.form),e}createButtonGroup(){const t=document.createElement("div");return t.classList.add("btn-group","btn-group-sm"),t}createContainerError(){const t=document.createElement("div");return t.classList.add("text-danger","fst-italic","mb-2","fw-bold"),t.style.display="none",t}createContainerForm(){const t=document.createElement("form");return t.classList.add("row","row-cols-lg-auto","g-3","align-items-center"),t.addEventListener("submit",async e=>{e.preventDefault();const n=this.getValue();if(this.context.send&&this.context.pk&&this.context.url&&this.context.value!==n){this.showLoad();let s;try{const o=await this.ajax(n);o.ok?s=await this.context.success(o,n):s=await this.context.error(o,n)||`${o.status} ${o.statusText}`}catch(o){console.error(o),s=o}s?(this.setError(s),this.showError()):(this.setError(null),this.hideError(),this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText()),this.hideLoad()}else this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText();this.context.element.dispatchEvent(new CustomEvent("save"))}),t}createContainerLoad(){const t=document.createElement("div");t.style.display="none",t.style.position="absolute",t.style.background="white",t.style.width="100%",t.style.height="100%",t.style.top=0,t.style.left=0;const e=document.createElement("div");return e.classList.add("dark-editable-loader"),t.append(e),t}createButton(){const t=document.createElement("button");return t.type="button",t.classList.add("btn","btn-sm"),t.style.color="transparent",t.style.textShadow="0 0 0 white",t}createButtonSuccess(){const t=this.createButton();return t.type="submit",t.classList.add("btn-success"),t.innerHTML="✔",t}createButtonCancel(){const t=this.createButton();t.classList.add("btn-danger");const e=document.createElement("div");return e.innerHTML="✖",t.append(e),t.addEventListener("click",()=>{this.context.modeElement.hide()}),t}hideLoad(){this.load.style.display="none"}showLoad(){this.load.style.display="block"}ajax(t){let e=this.context.url,n,s=!1;console.log(this.context),this.context.options.formType==="journal_description"&&(s=!0,n={transactions:[{transaction_journal_id:this.context.options.journalId,description:t}]}),s===!1&&console.error('Cannot deal with form type "'+this.context.formType+'"');const o={headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}};return o.method=this.context.ajaxOptions.method,this.context.options.method&&(o.method=this.context.options.method),o.method==="POST"||this.context.options.method==="PUT"?o.body=JSON.stringify(n):e+="?"+new URLSearchParams(form).toString(),fetch(e,o)}async successResponse(t,e){}async errorResponse(t,e){}setError(t){this.error.innerHTML=t}showError(){this.error.style.display="block"}hideError(){this.error&&(this.error.style.display="none")}createElement(t){const e=document.createElement(t);return console.log(e),e.classList.add("form-control"),this.context.required&&(e.required=this.context.required),this.add_focus(e),e}add_focus(t){this.context.element.addEventListener("shown",function(){t.focus()})}initText(){return this.context.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=this.context.value,!1)}initOptions(){}getValue(){return this.element.value}}class M extends c{create(){const t=this.createElement("input"),e=this.context.element.id+"_input";return t.type=this.context.type,t.id=e,t.autocomplete="off",t.placeholder=this.context.element.innerText,t.classList.add("form-control","form-control-md"),this.createContainer(t)}}class C extends c{create(){const t=this.createElement("textarea");return this.createContainer(t)}}class k extends c{create(){const t=this.createElement("select");return this.context.source.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.innerHTML=e.text,t.append(n)}),this.createContainer(t)}initText(){if(this.context.element.innerHTML=this.context.emptytext,this.context.value!==""&&this.context.source.length>0)for(const t in this.context.source){const e=this.context.source[t];if(e.value==this.context.value)return this.context.element.innerHTML=e.text,!1}return!0}initOptions(){this.context.get_opt("source",[]),typeof this.context.source=="string"&&this.context.source!==""&&(this.context.source=JSON.parse(this.context.source))}}class f extends c{create(){const t=this.createElement("input");return t.type="date",this.createContainer(t)}initText(){return this.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=moment(this.context.value).format(this.context.viewformat),!1)}initOptions(){this.context.get_opt("format","YYYY-MM-DD"),this.context.get_opt("viewformat","YYYY-MM-DD")}}class D extends f{create(){const t=this.createElement("input");return t.type="datetime-local",this.createContainer(t)}initOptions(){this.context.get_opt("format","YYYY-MM-DD HH:mm"),this.context.get_opt("viewformat","YYYY-MM-DD HH:mm"),this.context.value=moment(this.context.value).format("YYYY-MM-DDTHH:mm")}}class Y{constructor(t,e={}){r(this,"modeElement",null);r(this,"typeElement",null);r(this,"mode",null);r(this,"type",null);r(this,"emptytext",null);r(this,"viewformat",null);r(this,"pk",null);r(this,"name",null);this.element=t,this.options=e,this.init_options(),this.typeElement=this.route_type(),this.typeElement.initOptions(),this.modeElement=this.route_mode(),this.modeElement.init(),this.init_text(),this.init_style(),this.disabled&&this.disable(),this.element.dispatchEvent(new CustomEvent("init"))}get_opt(t,e){var n,s;return this[t]=((n=this.element.dataset)==null?void 0:n[t])??((s=this.options)==null?void 0:s[t])??e}get_opt_bool(t,e){return this.get_opt(t,e),typeof this[t]!="boolean"&&(this[t]==="true"?this[t]=!0:this[t]==="false"?this[t]=!1:this[t]=e),this[t]}init_options(){var t,e,n,s;this.get_opt("value",this.element.innerHTML),this.get_opt("name",this.element.id),this.get_opt("pk",null),this.get_opt("title",""),this.get_opt("type","text"),this.get_opt("emptytext","Empty"),this.get_opt("mode","popup"),this.get_opt("url",null),this.get_opt("ajaxOptions",{}),this.ajaxOptions=Object.assign({method:"POST",dataType:"text"},this.ajaxOptions),this.get_opt_bool("send",!0),this.get_opt_bool("disabled",!1),this.get_opt_bool("required",!1),(t=this.options)!=null&&t.success&&typeof((e=this.options)==null?void 0:e.success)=="function"&&(this.success=this.options.success),(n=this.options)!=null&&n.error&&typeof((s=this.options)==null?void 0:s.error)=="function"&&(this.error=this.options.error)}init_text(){const t="dark-editable-element-empty";this.element.classList.remove(t),this.typeElement.initText()&&this.element.classList.add(t)}init_style(){this.element.classList.add("dark-editable-element")}route_mode(){switch(this.mode){default:throw new Error(`Mode ${this.mode} not found!`);case"popup":return new L(this);case"inline":return new T(this)}}route_type(){if(this.type.prototype instanceof c)return new this.type(this);if(typeof this.type=="string")switch(this.type){case"text":case"password":case"email":case"url":case"tel":case"number":case"range":case"time":return new M(this);case"textarea":return new C(this);case"select":return new k(this);case"date":return new f(this);case"datetime":return new D(this)}throw new Error("Undefined type")}async success(t,e){return await this.typeElement.successResponse(t,e)}async error(t,e){return await this.typeElement.errorResponse(t,e)}enable(){this.disabled=!1,this.element.classList.remove("dark-editable-element-disabled"),this.modeElement.enable()}disable(){this.disabled=!0,this.element.classList.add("dark-editable-element-disabled"),this.modeElement.enable()}setValue(t){this.value=t,this.init_text()}getValue(){return this.value}}function H(i){const t=parseInt(i.dataset.id),e=parseInt(i.dataset.group),n={pk:e,mode:"inline",url:"./api/v2/transactions/"+e,formType:"journal_description",journalId:t,method:"PUT"};new Y(i,n)}let I=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},groupProperties:{id:0,transactionType:"",transactionTypeTranslated:"",title:"",date:new Date},dateFields:["book_date","due_date","interest_date","invoice_date","payment_date","process_date"],metaFields:["external_id","internal_reference","sepa_batch_id","sepa_ct_id","sepa_ct_op","sepa_db","sepa_country","sepa_cc","sepa_ep","sepa_ci","external_url"],amounts:{},entries:[],pageProperties:{},formatMoney(i,t){return console.log("formatting",i,t),t===""&&(t="EUR"),b(i,t)},format(i){return g(i,h.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=h.t("firefly.wait_loading_data");const i=window.location.href.split("/"),t=parseInt(i[i.length-1]);new E().show(t,{}).then(n=>{const s=n.data.data;this.groupProperties.id=parseInt(s.id),this.groupProperties.transactionType=s.attributes.transactions[0].type,this.groupProperties.transactionTypeTranslated=h.t("firefly."+s.attributes.transactions[0].type),this.groupProperties.title=s.attributes.title??s.attributes.transactions[0].description,this.entries=_(s.attributes.transactions,parseInt(s.id)),this.notifications.wait.show=!1}).then(()=>{for(let s in this.entries)if(this.entries.hasOwnProperty(s)){const o=this.entries[s].currency_code,a=this.entries[s].foreign_currency_code;this.amounts[o]===void 0&&(this.amounts[o]=0,this.amounts[o]+=parseFloat(this.entries[s].amount)),a!==null&&a!==""&&this.amounts[a]===void 0&&(this.amounts[a]=0,this.amounts[a]+=parseFloat(this.entries[s].foreign_amount)),parseInt(s)===0&&(this.groupProperties.date=this.entries[s].date)}const n=document.querySelectorAll(".journal_description");for(const s in n)if(n.hasOwnProperty(s)){const o=n[s];o.addEventListener("save",function(a){parseInt(a.currentTarget.dataset.id);const d=parseInt(a.currentTarget.dataset.group),u=parseInt(a.currentTarget.dataset.length),p=a.currentTarget.textContent;console.log(u),u===1&&(document.querySelector('.group_title[data-group="'+d+'"]').textContent=p,document.querySelector('.group_title_title[data-group="'+d+'"]').textContent=p)}),H(o)}}).catch(n=>{this.notifications.error.show=!0,this.notifications.error.text=n.message})}}},m={show:I,dates:v};function x(){Object.keys(m).forEach(i=>{console.log(`Loading page component "${i}"`);let t=m[i]();Alpine.data(i,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),x()});window.bootstrapped&&(console.log("Loaded through window variable."),x()); diff --git a/public/build/assets/splice-errors-into-transactions-e53c1920.js b/public/build/assets/splice-errors-into-transactions-528a3749.js similarity index 98% rename from public/build/assets/splice-errors-into-transactions-e53c1920.js rename to public/build/assets/splice-errors-into-transactions-528a3749.js index e20840e0e8..1161184eb9 100644 --- a/public/build/assets/splice-errors-into-transactions-e53c1920.js +++ b/public/build/assets/splice-errors-into-transactions-528a3749.js @@ -1 +1 @@ -import{a as l}from"./format-money-03f73825.js";import{a as p,G as f}from"./get-7f8692a5.js";import{n as m,i as _}from"./vendor-cc723e37.js";function x(r,t,a){let n=[];for(let o in r)if(r.hasOwnProperty(o)){const e=r[o];let i=!1,u={};t!==null&&t.hasOwnProperty(o)&&(i=!0,t[o]);let c={};(i&&u.description!==e.description||!i)&&(c.description=e.description),c.source_name=e.source_account.name,c.destination_name=e.destination_account.name,c.amount=e.amount,c.currency_code=e.currency_code,c.date=e.date,c.interest_date=e.interest_date,c.book_date=e.book_date,c.process_date=e.process_date,c.due_date=e.due_date,c.payment_date=e.payment_date,c.invoice_date=e.invoice_date,c.budget_id=e.budget_id,c.category_name=e.category_name,c.piggy_bank_id=e.piggy_bank_id,c.bill_id=e.bill_id,c.tags=e.tags,c.notes=e.notes,c.internal_reference=e.internal_reference,c.external_url=e.external_url,c.store_location=!1,e.hasLocation&&(c.store_location=!0,c.longitude=e.longitude.toString(),c.latitude=e.latitude.toString(),c.zoom_level=e.zoomLevel),typeof e.foreign_currency_code<"u"&&e.foreign_currency_code.toString()!==""&&(c.foreign_currency_code=e.foreign_currency_code,typeof e.foreign_amount<"u"&&e.foreign_amount.toString()!==""&&(c.foreign_amount=e.foreign_amount),(typeof e.foreign_amount>"u"||e.foreign_amount.toString()==="")&&(delete c.foreign_amount,delete c.foreign_currency_code)),typeof e.source_account.id<"u"&&e.source_account.id.toString()!==""&&(c.source_id=e.source_account.id),typeof e.destination_account.id<"u"&&e.destination_account.id.toString()!==""&&(c.destination_id=e.destination_account.id),c.type=a,n.push(c)}return n}let g=class{list(t){return l.get("/api/v2/currencies",{params:t})}};function C(){let r={page:1,limit:1337};return new g().list(r).then(a=>{let n={defaultCurrency:{},nativeCurrencies:[],foreignCurrencies:[],enabledCurrencies:[]};n.foreignCurrencies.push({id:0,name:"(no foreign currency)",code:"",default:!1,symbol:"",decimal_places:2});for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o];if(e.attributes.enabled){let i={id:e.id,name:e.attributes.name,code:e.attributes.code,default:e.attributes.default,symbol:e.attributes.symbol,decimal_places:e.attributes.decimal_places};i.default&&(n.defaultCurrency=i),n.enabledCurrencies.push(i),n.nativeCurrencies.push(i),n.foreignCurrencies.push(i)}}return n})}class y{list(t){return l.get("/api/v2/budgets",{params:t})}}function $(){let r={page:1,limit:1337};return new y().list(r).then(a=>{let n=[{id:0,name:"(no budget)"}];for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i={id:e.id,name:e.attributes.name};n.push(i)}return n})}function O(){let r={page:1,limit:1337};return new p().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,piggyBanks:[{id:0,name:"(no piggy bank)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,piggyBanks:[]}),n[i].piggyBanks.push(c),n[i].piggyBanks.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function P(){let r={page:1,limit:1337};return new f().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,subscriptions:[{id:0,name:"(no subscription)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,subscriptions:[]}),n[i].subscriptions.push(c),n[i].subscriptions.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function j(){return{description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts",category:"/api/v2/autocomplete/categories",tag:"/api/v2/autocomplete/tags"}}function A(r){const t={server:r.serverUrl,serverParams:{},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,highlightTyped:!0,liveServer:!0};typeof r.filters<"u"&&r.filters.length>0&&(t.serverParams.types=r.filters),typeof r.onRenderItem<"u"&&r.onRenderItem!==null&&(t.onRenderItem=r.onRenderItem),r.valueField&&(t.valueField=r.valueField),r.labelField&&(t.labelField=r.labelField),r.onSelectItem&&(t.onSelectItem=r.onSelectItem),r.onChange&&(t.onChange=r.onChange),r.hiddenValue&&(t.hiddenValue=r.hiddenValue),m.init(r.selector,t)}function q(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.name){document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=r.name;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=t._searchInput.value}function E(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.description){document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=r.description;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=t._searchInput.value}function B(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account.name===t._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+t._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}}function F(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}function G(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account.name===t._searchInput.value)return;document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}}function R(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}class h{post(t,a,n){let o="/api/v1/attachments";return l.post(o,{filename:t,attachable_type:a,attachable_id:n})}upload(t,a){let n="./api/v1/attachments/"+t+"/upload";return axios.post(n,a)}}let b=function(r){let t=r.length,a=0,n=!1;for(const o in r)if(r.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294&&n===!1){let e=new h;e.post(r[o].name,"TransactionJournal",r[o].journal).then(i=>{let u=parseInt(i.data.data.id);e.upload(u,r[o].content).then(c=>{if(a++,a===t){const d=new CustomEvent("upload-success",{some:"details"});document.dispatchEvent(d)}}).catch(c=>{console.error("Could not upload"),console.error(c),a++;const d=new CustomEvent("upload-failed",{error:c});document.dispatchEvent(d),n=!0})}).catch(i=>{console.error("Could not create upload."),console.error(i),a++;const u=new CustomEvent("upload-failed",{error:i});document.dispatchEvent(u),n=!0})}};function T(r,t){t=t.reverse();let a=[],n=0,o=[],e=document.querySelectorAll('input[name="attachments[]"]');for(const i in e)if(e.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294)for(const u in e[i].files)e[i].files.hasOwnProperty(u)&&/^0$|^[1-9]\d*$/.test(u)&&u<=4294967294&&(a.push({journal:t[i].transaction_journal_id,file:e[i].files[u]}),n++);for(const i in a)a.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&function(u,c){let d=new FileReader;d.onloadend=function(s){s.target.readyState===FileReader.DONE&&(o.push({name:a[c].file.name,journal:a[c].journal,content:new Blob([s.target.result])}),o.length===n&&b(o))},d.readAsArrayBuffer(u.file)}(a[i],i);return n}function v(r,t,a){let n=[];for(let o in a)a.hasOwnProperty(o)&&n.push(a[o].replace(r,t));return n}function D(r,t){let a,n,o;for(const e in r)if(r.hasOwnProperty(e)){if(e==="group_title"){console.error("Cannot handle error in group title.");continue}if(a=parseInt(e.split(".")[1]),n=e.split(".")[2],o=v(e,n,r[e]),!t.hasOwnProperty(a)){console.error("Cannot handle errors in index #"+a);continue}switch(n){case"currency_code":case"foreign_currency_code":case"category_name":case"piggy_bank_id":case"notes":case"internal_reference":case"external_url":case"latitude":case"longitude":case"zoom_level":case"interest_date":case"book_date":case"process_date":case"due_date":case"payment_date":case"invoice_date":case"amount":case"date":case"budget_id":case"bill_id":case"description":case"tags":t[a].errors[n]=o;break;case"source_name":case"source_id":t[a].errors.source_account=t[a].errors.source_account.concat(o);break;case"type":t[a].errors.source_account=t[a].errors.source_account.concat([_.t("validation.bad_type_source")]),t[a].errors.destination_account=t[a].errors.destination_account.concat([_.t("validation.bad_type_destination")]);break;case"destination_name":case"destination_id":t[a].errors.destination_account=t[a].errors.destination_account.concat(o);break;case"foreign_amount":case"foreign_currency_id":t[a].errors.foreign_amount=t[a].errors.foreign_amount.concat(o);break}typeof t[a]<"u"&&(t[a].errors.source_account=Array.from(new Set(t[a].errors.source_account)),t[a].errors.destination_account=Array.from(new Set(t[a].errors.destination_account)))}return console.log(t[0].errors),t}export{$ as a,O as b,P as c,T as d,A as e,G as f,R as g,B as h,F as i,j,q as k,C as l,E as m,x as p,D as s}; +import{a as l}from"./format-money-62afb78b.js";import{a as p,G as f}from"./get-5b4283ca.js";import{n as m,i as _}from"./vendor-2609b2c9.js";function x(r,t,a){let n=[];for(let o in r)if(r.hasOwnProperty(o)){const e=r[o];let i=!1,u={};t!==null&&t.hasOwnProperty(o)&&(i=!0,t[o]);let c={};(i&&u.description!==e.description||!i)&&(c.description=e.description),c.source_name=e.source_account.name,c.destination_name=e.destination_account.name,c.amount=e.amount,c.currency_code=e.currency_code,c.date=e.date,c.interest_date=e.interest_date,c.book_date=e.book_date,c.process_date=e.process_date,c.due_date=e.due_date,c.payment_date=e.payment_date,c.invoice_date=e.invoice_date,c.budget_id=e.budget_id,c.category_name=e.category_name,c.piggy_bank_id=e.piggy_bank_id,c.bill_id=e.bill_id,c.tags=e.tags,c.notes=e.notes,c.internal_reference=e.internal_reference,c.external_url=e.external_url,c.store_location=!1,e.hasLocation&&(c.store_location=!0,c.longitude=e.longitude.toString(),c.latitude=e.latitude.toString(),c.zoom_level=e.zoomLevel),typeof e.foreign_currency_code<"u"&&e.foreign_currency_code.toString()!==""&&(c.foreign_currency_code=e.foreign_currency_code,typeof e.foreign_amount<"u"&&e.foreign_amount.toString()!==""&&(c.foreign_amount=e.foreign_amount),(typeof e.foreign_amount>"u"||e.foreign_amount.toString()==="")&&(delete c.foreign_amount,delete c.foreign_currency_code)),typeof e.source_account.id<"u"&&e.source_account.id.toString()!==""&&(c.source_id=e.source_account.id),typeof e.destination_account.id<"u"&&e.destination_account.id.toString()!==""&&(c.destination_id=e.destination_account.id),c.type=a,n.push(c)}return n}let g=class{list(t){return l.get("/api/v2/currencies",{params:t})}};function C(){let r={page:1,limit:1337};return new g().list(r).then(a=>{let n={defaultCurrency:{},nativeCurrencies:[],foreignCurrencies:[],enabledCurrencies:[]};n.foreignCurrencies.push({id:0,name:"(no foreign currency)",code:"",default:!1,symbol:"",decimal_places:2});for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o];if(e.attributes.enabled){let i={id:e.id,name:e.attributes.name,code:e.attributes.code,default:e.attributes.default,symbol:e.attributes.symbol,decimal_places:e.attributes.decimal_places};i.default&&(n.defaultCurrency=i),n.enabledCurrencies.push(i),n.nativeCurrencies.push(i),n.foreignCurrencies.push(i)}}return n})}class y{list(t){return l.get("/api/v2/budgets",{params:t})}}function $(){let r={page:1,limit:1337};return new y().list(r).then(a=>{let n=[{id:0,name:"(no budget)"}];for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i={id:e.id,name:e.attributes.name};n.push(i)}return n})}function O(){let r={page:1,limit:1337};return new p().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,piggyBanks:[{id:0,name:"(no piggy bank)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,piggyBanks:[]}),n[i].piggyBanks.push(c),n[i].piggyBanks.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function P(){let r={page:1,limit:1337};return new f().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,subscriptions:[{id:0,name:"(no subscription)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,subscriptions:[]}),n[i].subscriptions.push(c),n[i].subscriptions.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function j(){return{description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts",category:"/api/v2/autocomplete/categories",tag:"/api/v2/autocomplete/tags"}}function A(r){const t={server:r.serverUrl,serverParams:{},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,highlightTyped:!0,liveServer:!0};typeof r.filters<"u"&&r.filters.length>0&&(t.serverParams.types=r.filters),typeof r.onRenderItem<"u"&&r.onRenderItem!==null&&(t.onRenderItem=r.onRenderItem),r.valueField&&(t.valueField=r.valueField),r.labelField&&(t.labelField=r.labelField),r.onSelectItem&&(t.onSelectItem=r.onSelectItem),r.onChange&&(t.onChange=r.onChange),r.hiddenValue&&(t.hiddenValue=r.hiddenValue),m.init(r.selector,t)}function q(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.name){document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=r.name;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=t._searchInput.value}function E(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.description){document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=r.description;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=t._searchInput.value}function B(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account.name===t._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+t._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}}function F(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}function G(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account.name===t._searchInput.value)return;document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}}function R(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}class h{post(t,a,n){let o="/api/v1/attachments";return l.post(o,{filename:t,attachable_type:a,attachable_id:n})}upload(t,a){let n="./api/v1/attachments/"+t+"/upload";return axios.post(n,a)}}let b=function(r){let t=r.length,a=0,n=!1;for(const o in r)if(r.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294&&n===!1){let e=new h;e.post(r[o].name,"TransactionJournal",r[o].journal).then(i=>{let u=parseInt(i.data.data.id);e.upload(u,r[o].content).then(c=>{if(a++,a===t){const d=new CustomEvent("upload-success",{some:"details"});document.dispatchEvent(d)}}).catch(c=>{console.error("Could not upload"),console.error(c),a++;const d=new CustomEvent("upload-failed",{error:c});document.dispatchEvent(d),n=!0})}).catch(i=>{console.error("Could not create upload."),console.error(i),a++;const u=new CustomEvent("upload-failed",{error:i});document.dispatchEvent(u),n=!0})}};function T(r,t){t=t.reverse();let a=[],n=0,o=[],e=document.querySelectorAll('input[name="attachments[]"]');for(const i in e)if(e.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294)for(const u in e[i].files)e[i].files.hasOwnProperty(u)&&/^0$|^[1-9]\d*$/.test(u)&&u<=4294967294&&(a.push({journal:t[i].transaction_journal_id,file:e[i].files[u]}),n++);for(const i in a)a.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&function(u,c){let d=new FileReader;d.onloadend=function(s){s.target.readyState===FileReader.DONE&&(o.push({name:a[c].file.name,journal:a[c].journal,content:new Blob([s.target.result])}),o.length===n&&b(o))},d.readAsArrayBuffer(u.file)}(a[i],i);return n}function v(r,t,a){let n=[];for(let o in a)a.hasOwnProperty(o)&&n.push(a[o].replace(r,t));return n}function D(r,t){let a,n,o;for(const e in r)if(r.hasOwnProperty(e)){if(e==="group_title"){console.error("Cannot handle error in group title.");continue}if(a=parseInt(e.split(".")[1]),n=e.split(".")[2],o=v(e,n,r[e]),!t.hasOwnProperty(a)){console.error("Cannot handle errors in index #"+a);continue}switch(n){case"currency_code":case"foreign_currency_code":case"category_name":case"piggy_bank_id":case"notes":case"internal_reference":case"external_url":case"latitude":case"longitude":case"zoom_level":case"interest_date":case"book_date":case"process_date":case"due_date":case"payment_date":case"invoice_date":case"amount":case"date":case"budget_id":case"bill_id":case"description":case"tags":t[a].errors[n]=o;break;case"source_name":case"source_id":t[a].errors.source_account=t[a].errors.source_account.concat(o);break;case"type":t[a].errors.source_account=t[a].errors.source_account.concat([_.t("validation.bad_type_source")]),t[a].errors.destination_account=t[a].errors.destination_account.concat([_.t("validation.bad_type_destination")]);break;case"destination_name":case"destination_id":t[a].errors.destination_account=t[a].errors.destination_account.concat(o);break;case"foreign_amount":case"foreign_currency_id":t[a].errors.foreign_amount=t[a].errors.foreign_amount.concat(o);break}typeof t[a]<"u"&&(t[a].errors.source_account=Array.from(new Set(t[a].errors.source_account)),t[a].errors.destination_account=Array.from(new Set(t[a].errors.destination_account)))}return console.log(t[0].errors),t}export{$ as a,O as b,P as c,T as d,A as e,G as f,R as g,B as h,F as i,j,q as k,C as l,E as m,x as p,D as s}; diff --git a/public/build/assets/vendor-cc723e37.js b/public/build/assets/vendor-2609b2c9.js similarity index 98% rename from public/build/assets/vendor-cc723e37.js rename to public/build/assets/vendor-2609b2c9.js index 2441ba7466..52c57bc2d0 100644 --- a/public/build/assets/vendor-cc723e37.js +++ b/public/build/assets/vendor-2609b2c9.js @@ -48,7 +48,7 @@ ${t?'Expression: "'+t+`" * Released under the MIT license */const FORMATS={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};adapters._date.override({_id:"date-fns",formats:function(){return FORMATS},parse:function(n,e){if(n===null||typeof n>"u")return null;const t=typeof n;return t==="number"||n instanceof Date?n=toDate(n):t==="string"&&(typeof e=="string"?n=parse$1(n,e,new Date,this.options):n=parseISO(n,this.options)),isValid(n)?n.getTime():null},format:function(n,e){return format(n,e,this.options)},add:function(n,e,t){switch(t){case"millisecond":return addMilliseconds(n,e);case"second":return addSeconds(n,e);case"minute":return addMinutes(n,e);case"hour":return addHours(n,e);case"day":return addDays(n,e);case"week":return addWeeks(n,e);case"month":return addMonths(n,e);case"quarter":return addQuarters(n,e);case"year":return addYears(n,e);default:return n}},diff:function(n,e,t){switch(t){case"millisecond":return differenceInMilliseconds(n,e);case"second":return differenceInSeconds(n,e);case"minute":return differenceInMinutes(n,e);case"hour":return differenceInHours(n,e);case"day":return differenceInDays(n,e);case"week":return differenceInWeeks(n,e);case"month":return differenceInMonths(n,e);case"quarter":return differenceInQuarters(n,e);case"year":return differenceInYears(n,e);default:return 0}},startOf:function(n,e,t){switch(e){case"second":return startOfSecond(n);case"minute":return startOfMinute(n);case"hour":return startOfHour(n);case"day":return startOfDay(n);case"week":return startOfWeek(n);case"isoWeek":return startOfWeek(n,{weekStartsOn:+t});case"month":return startOfMonth(n);case"quarter":return startOfQuarter(n);case"year":return startOfYear(n);default:return n}},endOf:function(n,e){switch(e){case"second":return endOfSecond(n);case"minute":return endOfMinute(n);case"hour":return endOfHour(n);case"day":return endOfDay(n);case"week":return endOfWeek(n);case"month":return endOfMonth(n);case"quarter":return endOfQuarter(n);case"year":return endOfYear(n);default:return n}}});const leaflet="",DEFAULTS$1={showAllSuggestions:!1,suggestionsThreshold:1,maximumItems:0,autoselectFirst:!0,ignoreEnter:!1,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!1,fixed:!1,fuzzy:!1,startsWith:!1,fillIn:!1,preventBrowserAutocomplete:!1,itemClass:"",activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",items:[],source:null,hiddenInput:!1,hiddenValue:"",clearControl:"",datalist:"",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>e,onSelectItem:(n,e)=>{},onServerResponse:(n,e)=>n.json(),onChange:(n,e)=>{},onBeforeFetch:n=>{},onAfterFetch:n=>{}},LOADING_CLASS$1="is-loading",ACTIVE_CLASS$1="is-active",SHOW_CLASS$1="show",NEXT$1="next",PREV$1="prev",INSTANCE_MAP$1=new WeakMap;let counter$1=0,activeCounter=0;function debounce$2(n,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}}function removeDiacritics$1(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize$1(n){return n?removeDiacritics$1(n.toString()).toLowerCase():""}function fuzzyMatch$1(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let i=0;ie+"‍").join("")}function nested$1(n,e="window"){return n.split(".").reduce((t,i)=>t[i],e)}class Autocomplete{constructor(e,t={}){G(this,"handleEvent",e=>{["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)});if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP$1.set(e,this),counter$1++,activeCounter++,this._searchInput=e,this._configure(t),this._preventInput=!1,this._keyboardNavigation=!1,this._searchFunc=debounce$2(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._configureSearchInput(),this._configureDropElement(),this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this));const i=this._getClearControl();i&&i.addEventListener("click",this),["focus","change","blur","input","keydown"].forEach(s=>{this._searchInput.addEventListener(s,this)}),["mousemove","mouseleave"].forEach(s=>{this._dropElement.addEventListener(s,this)}),this._fetchData()}static init(e="input.autocomplete",t={}){document.querySelectorAll(e).forEach(s=>{this.getOrCreateInstance(s,t)})}static getInstance(e){return INSTANCE_MAP$1.has(e)?INSTANCE_MAP$1.get(e):null}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,t)}dispose(){activeCounter--,["focus","change","blur","input","keydown"].forEach(t=>{this._searchInput.removeEventListener(t,this)}),["mousemove","mouseleave"].forEach(t=>{this._dropElement.removeEventListener(t,this)});const e=this._getClearControl();e&&e.removeEventListener("click",this),this._config.fixed&&activeCounter<=0&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._dropElement.parentElement.removeChild(this._dropElement),INSTANCE_MAP$1.delete(this._searchInput)}_getClearControl(){if(this._config.clearControl)return document.querySelector(this._config.clearControl)}_configure(e={}){this._config=Object.assign({},DEFAULTS$1);const t={...e,...this._searchInput.dataset},i=s=>["true","false","1","0",!0,!1].includes(s)&&!!JSON.parse(s);for(const[s,o]of Object.entries(DEFAULTS$1)){if(t[s]===void 0)continue;const r=t[s];switch(typeof o){case"number":this._config[s]=parseInt(r);break;case"boolean":this._config[s]=i(r);break;case"string":this._config[s]=r.toString();break;case"object":if(Array.isArray(o))if(typeof r=="string"){const a=r.includes("|")?"|":",";this._config[s]=r.split(a)}else this._config[s]=r;else this._config[s]=typeof r=="string"?JSON.parse(r):r;break;case"function":this._config[s]=typeof r=="string"?window[r]:r;break;default:this._config[s]=r;break}}}_configureSearchInput(){if(this._searchInput.autocomplete="off",this._searchInput.spellcheck=!1,attrs$1(this._searchInput,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false",role:"combobox"}),this._searchInput.id&&this._config.preventBrowserAutocomplete){const e=document.querySelector(`[for="${this._searchInput.id}"]`);e&&zwijit(e)}this._hiddenInput=null,this._config.hiddenInput&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.value=this._config.hiddenValue,this._hiddenInput.name=this._searchInput.name,this._searchInput.name="_"+this._searchInput.name,insertAfter(this._searchInput,this._hiddenInput))}_configureDropElement(){this._dropElement=document.createElement("ul"),this._dropElement.id="ac-menu-"+counter$1,this._dropElement.classList.add("dropdown-menu","autocomplete-menu","p-0"),this._dropElement.style.maxHeight="280px",this._config.fullWidth||(this._dropElement.style.maxWidth="360px"),this._config.fixed&&(this._dropElement.style.position="fixed"),this._dropElement.style.overflowY="auto",this._dropElement.style.overscrollBehavior="contain",this._dropElement.style.textAlign="unset",insertAfter(this._searchInput,this._dropElement),this._searchInput.setAttribute("aria-controls",this._dropElement.id)}onclick(e){e.target.matches(this._config.clearControl)&&this.clear()}oninput(e){this._preventInput||(this._hiddenInput&&(this._hiddenInput.value=null),this.showOrSearch())}onchange(e){const t=this._searchInput.value,i=Object.values(this._items).find(s=>s.label===t);this._config.onChange(i,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}setTimeout(()=>{this.hideSuggestions()},100)}onfocus(e){this.showOrSearch()}onkeydown(e){switch(e.keyCode||e.key){case 13:case"Enter":if(this.isDropdownVisible()){const i=this.getSelection();i&&i.click(),(i||!this._config.ignoreEnter)&&e.preventDefault()}break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV$1);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT$1):this.showOrSearch(!1);break;case 27:case"Escape":this.isDropdownVisible()&&(this._searchInput.focus(),this.hideSuggestions());break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}getConfig(e=null){return e!==null?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}setData(e){this._items={},this._addItems(e)}enable(){this._searchInput.setAttribute("disabled","")}disable(){this._searchInput.removeAttribute("disabled")}isDisabled(){return this._searchInput.hasAttribute("disabled")||this._searchInput.disabled||this._searchInput.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS$1)}clear(){this._searchInput.value="",this._hiddenInput&&(this._hiddenInput.value="")}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS$1)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS$1]}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT$1,t=null){const i=this.getSelection();if(i){const s=e===NEXT$1?"nextSibling":"previousSibling";t=i.parentNode;do t=t[s];while(t&&!this._isItemEnabled(t));t?(i.classList.remove(...this._activeClasses()),e===PREV$1?t.parentNode.scrollTop=t.offsetTop-t.parentNode.offsetTop:t.offsetTop>t.parentNode.offsetHeight-t.offsetHeight&&(t.parentNode.scrollTop+=t.offsetHeight)):i&&(t=i.parentElement)}else{if(e===PREV$1)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const s=t.querySelector("a");s.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",s.id),this._config.updateOnSelect&&(this._searchInput.value=s.dataset.label)}else this._searchInput.setAttribute("aria-activedescendant","");return t}_shouldShow(){return this.isDisabled()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions();return}this._config.liveServer?this._searchFunc():this._config.source?this._config.source(this._searchInput.value,t=>{this.setData(t),this._showSuggestions()}):this._showSuggestions()}_createGroup(e){const t=this._createLi(),i=document.createElement("span");return t.append(i),i.classList.add("dropdown-header","text-truncate"),i.innerHTML=e,t}_createItem(e,t){let i=t.label;if(this._config.highlightTyped){const r=normalize$1(i).indexOf(e);r!==-1&&(i=i.substring(0,r)+`${i.substring(r,r+e.length)}`+i.substring(r+e.length,i.length))}i=this._config.onRenderItem(t,i,this);const s=this._createLi(),o=document.createElement("a");if(s.append(o),o.id=this._dropElement.id+"-"+this._dropElement.children.length,o.classList.add("dropdown-item","text-truncate"),this._config.itemClass&&o.classList.add(...this._config.itemClass.split(" ")),o.setAttribute("data-value",t.value),o.setAttribute("data-label",t.label),o.setAttribute("tabindex","-1"),o.setAttribute("role","menuitem"),o.setAttribute("href","#"),o.innerHTML=i,t.data)for(const[r,a]of Object.entries(t.data))o.dataset[r]=a;if(this._config.fillIn){const r=document.createElement("button");r.type="button",r.classList.add("btn","btn-link","border-0"),r.innerHTML=` - `,s.append(r),s.classList.add("d-flex","justify-content-between"),r.addEventListener("click",a=>{this._searchInput.value=t.label,this._searchInput.focus()})}return o.addEventListener("mouseenter",r=>{this._keyboardNavigation||(this.removeSelection(),s.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{r.preventDefault(),this._preventInput=!0,this._searchInput.value=decodeHtml(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),s}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=normalize$1(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let i=0,s=null;const o=[];for(let r=0;r0&&this._config.searchFields.forEach(m=>{const v=normalize$1(l[m]);let y=!1;if(this._config.fuzzy)y=fuzzyMatch$1(v,e);else{const b=v.indexOf(e);y=this._config.startsWith?b===0:b>=0}y&&(h=!0)});const p=h||e.length===0;if(d||h){if(i++,l.group&&!o.includes(l.group)){const v=this._createGroup(l.group);this._dropElement.appendChild(v),o.push(l.group)}const m=this._createItem(e,l);if(!s&&p&&(s=m),this._dropElement.appendChild(m),this._config.maximumItems>0&&i>=this._config.maximumItems)break}}if(s&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT$1,s)),i===0)if(this._config.notFoundMessage){const r=this._createLi();r.innerHTML=`${this._config.notFoundMessage}`,this._dropElement.appendChild(r),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(SHOW_CLASS$1),this._dropElement.setAttribute("role","menu"),attrs$1(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(SHOW_CLASS$1)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(SHOW_CLASS$1),attrs$1(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),i=e.direction==="rtl",s=this._config.fullWidth,o=this._config.fixed;let r=null,a=null;o&&(r=t.x,a=t.y+t.height,i&&!s&&(r-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",s&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),r!==null&&(this._dropElement.style.left=r+"px"),a!==null&&(this._dropElement.style.top=a+"px");const l=this._dropElement.getBoundingClientRect(),d=window.innerHeight;if(l.y+l.height>d){const h=s?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+h+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const i=Array.from(t.children).map(s=>{const o=s.getAttribute("value")??s.innerHTML.toLowerCase(),r=s.innerHTML;return{value:o,label:r}});this._addItems(i)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let i=0;il.group=o.group),this._addItems(o.items);continue}const r=typeof o=="string"?o:o.label,a=typeof o!="object"?{}:o;a.label=o[this._config.labelField]??r,a.value=o[this._config.valueField]??s,a.label&&(this._items[a.value]=a)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._searchInput.classList.add(LOADING_CLASS$1),this._config.onBeforeFetch(this),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested$1(this._config.serverDataKey,a)||a;this.setData(l),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._searchInput.classList.remove(LOADING_CLASS$1),this._config.onAfterFetch(this)})}}const DEFAULTS={items:[],allowNew:!1,showAllSuggestions:!1,badgeStyle:"primary",allowClear:!1,clearEnd:!1,selected:[],regex:"",separator:[],max:0,clearLabel:"Clear",searchLabel:"Type a value",showDropIcon:!0,keepOpen:!1,allowSame:!1,baseClass:"",placeholder:"",addOnBlur:!1,showDisabled:!1,hideNativeValidation:!1,suggestionsThreshold:-1,maximumItems:0,autoselectFirst:!0,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!0,fixed:!1,fuzzy:!1,startsWith:!1,singleBadge:!1,activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,allowHtml:!1,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>t.config("allowHtml")?e:sanitize(e),onSelectItem:(n,e)=>{},onClearItem:(n,e)=>{},onCreateItem:(n,e)=>{},onBlur:(n,e)=>{},onFocus:(n,e)=>{},onCanAdd:(n,e,t)=>{},confirmClear:(n,e)=>Promise.resolve(),confirmAdd:(n,e)=>Promise.resolve(),onServerResponse:(n,e)=>n.json()},CLASS_PREFIX="tags-",LOADING_CLASS="is-loading",ACTIVE_CLASS="is-active",INVALID_CLASS="is-invalid",MAX_REACHED_CLASS="is-max-reached",SHOW_CLASS="show",VALUE_ATTRIBUTE="data-value",NEXT="next",PREV="prev",FOCUS_CLASS="form-control-focus",PLACEHOLDER_CLASS="form-placeholder-shown",DISABLED_CLASS="form-control-disabled",INSTANCE_MAP=new WeakMap;let counter=0,tooltip=window.bootstrap&&window.bootstrap.Tooltip;function debounce$1(n,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}}function calcTextWidth(n,e=null){const t=ce("span");document.body.appendChild(t),t.style.fontSize=e||"inherit",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="no-wrap",t.innerHTML=sanitize(n);const i=Math.ceil(t.clientWidth);return document.body.removeChild(t),i}function sanitize(n){return new Option(n).innerHTML}function removeDiacritics(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize(n){return n?removeDiacritics(n.toString()).toLowerCase():""}function fuzzyMatch(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let i=0;it[i],e)}class Tags{constructor(e,t={}){if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP.set(e,this),counter++,this._selectElement=e,this._configure(t),this._keyboardNavigation=!1,this._searchFunc=debounce$1(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._fireEvents=!0,this._configureParent(),this._holderElement=ce("div"),this._containerElement=ce("div"),this._dropElement=ce("ul"),this._searchInput=ce("input"),this._holderElement.appendChild(this._containerElement),this._selectElement.parentElement.insertBefore(this._holderElement,this._selectElement),this._configureHolderElement(),this._configureContainerElement(),this._configureSelectElement(),this._configureSearchInput(),this._configureDropElement(),this.resetState(),this.handleEvent=i=>{this._handleEvent(i)},this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this)),["focus","blur","input","keydown","paste"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this.loadData(!0)}static init(e="select[multiple]",t={},i=!1){let s=document.querySelectorAll(e);for(let o=0;o{this._searchInput.removeEventListener(e,this)}),["mousemove","mouseleave"].forEach(e=>{this._dropElement.removeEventListener(e,this)}),this._config.fixed&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._selectElement.style.display="block",this._holderElement.parentElement.removeChild(this._holderElement),this.parentForm&&this.parentForm.removeEventListener("reset",this),INSTANCE_MAP.delete(this._selectElement)}handleEvent(e){this._handleEvent(e)}_handleEvent(e){["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)}_configure(e={}){this._config=Object.assign({},DEFAULTS,{showDropIcon:!!this._findOption()});const t=this._selectElement.dataset.config?JSON.parse(this._selectElement.dataset.config):{},i={...e,...t,...this._selectElement.dataset};for(const[s,o]of Object.entries(DEFAULTS)){if(s=="config"||i[s]===void 0)continue;const r=i[s];switch(typeof o){case"number":this._config[s]=parseInt(r);break;case"boolean":this._config[s]=parseBool(r);break;case"string":this._config[s]=r.toString();break;case"object":this._config[s]=r,typeof r=="string"&&(["{","["].includes(r[0])?this._config[s]=JSON.parse(r):this._config[s]=r.split(r.includes("|")?"|":","));break;case"function":this._config[s]=typeof r=="string"?r.split(".").reduce((a,l)=>a[l],window):r,this._config[s]||console.error("Invalid function",r);break;default:this._config[s]=r;break}}this._config.placeholder||(this._config.placeholder=this._getPlaceholder()),this._config.suggestionsThreshold==-1&&(this._config.suggestionsThreshold=this._config.liveServer?1:0)}config(e=null){return e?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}_configureParent(){for(this.overflowParent=null,this.parentForm=this._selectElement.parentElement;this.parentForm&&(this.parentForm.style.overflow==="hidden"&&(this.overflowParent=this.parentForm),this.parentForm=this.parentForm.parentElement,!(this.parentForm&&this.parentForm.nodeName=="FORM")););this.parentForm&&this.parentForm.addEventListener("reset",this)}_getPlaceholder(){if(this._selectElement.hasAttribute("placeholder"))return this._selectElement.getAttribute("placeholder");if(this._selectElement.dataset.placeholder)return this._selectElement.dataset.placeholder;let e=this._selectElement.querySelector("option");return!e||!this._config.autoselectFirst?"":(rmAttr(e,"selected"),e.selected=!1,e.value?"":e.textContent)}_configureSelectElement(){const e=this._selectElement;this._config.hideNativeValidation?(e.style.position="absolute",e.style.left="-9999px"):e.style.cssText="height:1px;width:1px;opacity:0;padding:0;margin:0;border:0;float:left;flex-basis:100%;min-height:unset;",e.tabIndex=-1,e.addEventListener("focus",t=>{this.onclick(t)}),e.addEventListener("invalid",t=>{this._holderElement.classList.add(INVALID_CLASS)})}_configureDropElement(){const e=this._dropElement;e.classList.add("dropdown-menu",CLASS_PREFIX+"menu"),e.id=CLASS_PREFIX+"menu-"+counter,e.setAttribute("role","menu");const t=e.style;t.padding="0",t.maxHeight="280px",this._config.fullWidth||(t.maxWidth="360px"),this._config.fixed&&(t.position="fixed"),t.overflowY="auto",t.overscrollBehavior="contain",t.textAlign="unset",e.addEventListener("mouseenter",i=>{this._keyboardNavigation=!1}),this._holderElement.appendChild(e),this._searchInput.setAttribute("aria-controls",e.id)}_configureHolderElement(){const e=this._holderElement;e.classList.add("form-control","dropdown"),["form-select-lg","form-select-sm","is-invalid","is-valid"].forEach(t=>{this._selectElement.classList.contains(t)&&e.classList.add(t)}),this._config.suggestionsThreshold==0&&this._config.showDropIcon&&e.classList.add("form-select"),this.overflowParent&&(e.style.position="inherit"),e.style.height="auto",e.addEventListener("click",this)}_configureContainerElement(){this._containerElement.addEventListener("click",t=>{this.isDisabled()||this._searchInput.style.visibility!="hidden"&&this._searchInput.focus()});const e=this._containerElement.style;e.display="flex",e.alignItems="center",e.flexWrap="wrap"}_configureSearchInput(){const e=this._searchInput;e.type="text",e.autocomplete="off",e.spellcheck=!1,attrs(e,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false","aria-label":this._config.searchLabel,role:"combobox"}),e.style.cssText="background-color:transparent;color:currentColor;border:0;padding:0;outline:0;max-width:100%",this.resetSearchInput(!0),this._containerElement.appendChild(e),this._rtl=window.getComputedStyle(e).direction==="rtl"}onfocus(e){this._holderElement.classList.add(FOCUS_CLASS),this.showOrSearch(),this._config.onFocus(e,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}this.afteronblur(e)}afteronblur(e){this._abortController&&this._abortController.abort();let t=!0;if(this._config.addOnBlur&&this._searchInput.value&&(t=this._enterValue()),this._holderElement.classList.remove(FOCUS_CLASS),this.hideSuggestions(t),this._fireEvents){const i=this.getSelection(),s={selection:i?i.dataset.value:null,input:this._searchInput.value};this._config.onBlur(e,this),this._selectElement.dispatchEvent(new CustomEvent("tags.blur",{bubbles:!0,detail:s}))}}onpaste(e){const i=(e.clipboardData||window.clipboardData).getData("text/plain").replace(/\r\n|\n/g," ");if(i.length>2&&this._config.separator.length){const s=splitMulti(i,this._config.separator).filter(o=>o);s.length>1&&(e.preventDefault(),s.forEach(o=>{this._addPastedValue(o)}))}}_addPastedValue(e){let t=e,i={};if(this._config.allowNew)i.new=1;else{const s=this.getSelection();if(!s)return;e=s.getAttribute(VALUE_ATTRIBUTE),t=s.dataset.label}this._config.confirmAdd(e,this).then(()=>{this._add(t,e,i)}).catch(()=>{})}oninput(e){const t=this._searchInput.value;if(t){const i=t.slice(-1);if(this._config.separator.length&&this._config.separator.includes(i)){this._searchInput.value=this._searchInput.value.slice(0,-1);let s=this._searchInput.value;this._addPastedValue(s);return}}setTimeout(()=>{this._adjustWidth()}),this.showOrSearch()}onkeydown(e){let t=e.keyCode||e.key;const i=e.target;switch(e.keyCode==229&&(t=i.value.charAt(i.selectionStart-1).charCodeAt(0)),t){case 13:case"Enter":e.preventDefault(),this._enterValue();break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT):this.showOrSearch(!1);break;case 8:case"Backspace":const s=this.getLastItem();this._searchInput.value.length==0&&s&&this._config.confirmClear(s,this).then(()=>{this.removeLastItem(),this._adjustWidth(),this.showOrSearch()}).catch(()=>{});break;case 27:case"Escape":this._searchInput.focus(),this.hideSuggestions();break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}onclick(e=null){!this.isSingle()&&this.isMaxReached()||this._searchInput.focus()}onreset(e){this.reset()}loadData(e=!1){Object.keys(this._config.items).length>0?this.setData(this._config.items,!0):this.resetSuggestions(!0),this._config.server&&(this._config.liveServer||this._loadFromServer(!e))}_setSelectedAttributes(){const e=this._selectElement.selectedOptions||[];for(let t=0;t({value:s.getAttribute("value"),label:s.textContent,disabled:s.disabled,selected:s.selected,data:Object.assign({disabled:s.disabled},s.dataset)});let i=Array.from(this._selectElement.children).filter(s=>s.hasAttribute("label")||!s.disabled||this._config.showDisabled).map(s=>s.hasAttribute("label")?{group:s.getAttribute("label"),items:Array.from(s.children).map(o=>t(o))}:t(s));this.setData(i,e)}_enterValue(){let e=this.getSelection();if(e)return e.click(),!0;if(this._config.allowNew&&this._searchInput.value){let t=this._searchInput.value;return this._config.confirmAdd(t,this).then(()=>{this._add(t,t,{new:1})}).catch(()=>{}),!0}return!1}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._selectElement.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._holderElement.classList.add(LOADING_CLASS),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested(this._config.serverDataKey,a)||a;this.setData(l,!e),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._holderElement.classList.remove(LOADING_CLASS)})}_add(e,t=null,i={}){if(!this.canAdd(e,i))return null;const s=this.addItem(e,t,i);return this._resetHtmlState(),this._config.keepOpen?this._showSuggestions():this.resetSearchInput(),s}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT,t=null){const i=this.getSelection();if(i){const s=e===NEXT?"nextSibling":"previousSibling";t=i.parentNode;do t=t[s];while(t&&!this._isItemEnabled(t));t?i.classList.remove(...this._activeClasses()):i&&(t=i.parentElement)}else{if(e===PREV)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const s=t.offsetHeight,o=t.offsetTop,r=t.parentNode,a=r.offsetHeight,l=r.scrollHeight,d=r.offsetTop;if(s===0&&setTimeout(()=>{r.scrollTop=0}),e===PREV){const p=o-d>10?o-d:0;r.scrollTop=p}else o+s-(a+r.scrollTop)>0&&s>0&&(r.scrollTop=o+s-a+1,r.scrollTop+a>=l-10&&(r.scrollTop=o-d));const h=t.querySelector("a");h.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",h.id),this._config.updateOnSelect&&(this._searchInput.value=h.dataset.label,this._adjustWidth())}else this._searchInput.setAttribute("aria-activedescendant","");return t}_adjustWidth(){this._holderElement.classList.remove(PLACEHOLDER_CLASS),this._searchInput.value?this._searchInput.size=this._searchInput.value.length:this.getSelectedValues().length?(this._searchInput.placeholder="",this._searchInput.size=1):(this._searchInput.size=this._config.placeholder.length>0?this._config.placeholder.length:1,this._searchInput.placeholder=this._config.placeholder,this._holderElement.classList.add(PLACEHOLDER_CLASS));const e=this._searchInput.value||this._searchInput.placeholder,t=window.getComputedStyle(this._holderElement).fontSize,i=calcTextWidth(e,t)+16;this._searchInput.style.width=i+"px"}_buildSuggestions(e){for(;this._dropElement.lastChild;)this._dropElement.removeChild(this._dropElement.lastChild);let t=0,i=1;for(let s=0;s',this._dropElement.appendChild(s)}}_buildSuggestionsItem(e,t){if(!e[this._config.valueField])return;const i=e[this._config.valueField],s=e[this._config.labelField];let o=this._config.onRenderItem(e,s,this);const r=ce("li");r.setAttribute("role","presentation"),e.group_id&&r.setAttribute("data-group-id",""+e.group_id);const a=ce("a");r.append(a),a.id=this._dropElement.id+"-"+t,a.classList.add("dropdown-item","text-truncate"),e.disabled&&a.classList.add("disabled"),a.setAttribute(VALUE_ATTRIBUTE,i),a.dataset.label=s;const l={};this._config.searchFields.forEach(d=>{l[d]=e[d]}),a.dataset.searchData=JSON.stringify(l),a.setAttribute("href","#"),a.innerHTML=o,this._dropElement.appendChild(r),a.addEventListener("mouseenter",d=>{this._keyboardNavigation||(this.removeSelection(),r.querySelector("a").classList.add(...this._activeClasses()))}),a.addEventListener("mousedown",d=>{d.preventDefault()}),a.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this._config.confirmAdd(i,this).then(()=>{this._add(s,i,e.data),this._config.onSelectItem(e,this)}).catch(()=>{})})}initialOptions(){return this._selectElement.querySelectorAll("option[data-init]")}_removeSelectedAttrs(){this._selectElement.querySelectorAll("option").forEach(e=>{rmAttr(e,"selected")})}reset(){this.removeAll(),this._fireEvents=!1;const e=this.initialOptions();this._removeSelectedAttrs();for(let t=0;tt.value)}getAvailableValues(){const e=this._selectElement.querySelectorAll("option");return Array.from(e).map(t=>t.value)}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions(!1);return}this._config.liveServer?this._searchFunc():this._showSuggestions()}hideSuggestions(e=!0){this._dropElement.classList.remove(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"false"}),this.removeSelection(),e&&this._holderElement.classList.remove(INVALID_CLASS)}toggleSuggestions(e=!0,t=!0){this._dropElement.classList.contains(SHOW_CLASS)?this.hideSuggestions(t):this.showOrSearch(e)}_shouldShow(){return this.isDisabled()||this.isMaxReached()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}_showSuggestions(){if(this._searchInput.style.visibility=="hidden")return;const e=normalize(this._searchInput.value),t={},i=this._dropElement.querySelectorAll("li");let s=0,o=null,r=!1,a={};for(let l=0;l0){const y=JSON.parse(h.dataset.searchData);this._config.searchFields.forEach(b=>{const S=normalize(y[b]);let E=!1;if(this._config.fuzzy)E=fuzzyMatch(S,e);else{const T=S.indexOf(e);E=this._config.startsWith?T===0:T>=0}E&&(m=!0)})}const v=m||e.length===0;if(p||m?(s++,showItem(d),d.dataset.groupId&&(a[d.dataset.groupId]=!0),!o&&this._isItemEnabled(d)&&v&&(o=d),this._config.maximumItems>0&&s>this._config.maximumItems&&hideItem(d)):hideItem(d),this._config.highlightTyped){const y=h.textContent,b=normalize(y).indexOf(e),S=y.substring(0,b)+`${y.substring(b,b+e.length)}`+y.substring(b+e.length,y.length);h.innerHTML=S}this._isItemEnabled(d)&&(r=!0)}if(!this._config.allowNew&&!(e.length===0&&!r)&&this._holderElement.classList.add(INVALID_CLASS),this._config.allowNew&&this._config.regex&&this.isInvalid()&&this._holderElement.classList.remove(INVALID_CLASS),Array.from(i).filter(l=>l.dataset.id).forEach(l=>{a[l.dataset.id]===!0&&showItem(l)}),r&&(this._holderElement.classList.remove(INVALID_CLASS),o&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT,o))),s===0)if(this._config.notFoundMessage){const l=this._dropElement.querySelector("."+CLASS_PREFIX+"not-found");l.style.display="block";const d=this._config.notFoundMessage.replace("{{tag}}",this._searchInput.value);l.innerHTML=`${d}`,this._showDropdown()}else this.hideSuggestions(!1);else this._showDropdown()}_showDropdown(){const e=this._dropElement.classList.contains(SHOW_CLASS);e||(this._dropElement.classList.add(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"true"})),this._positionMenu(e)}_positionMenu(e=!1){const t=this._rtl,i=this._config.fixed,s=this._config.fullWidth,o=this._searchInput.getBoundingClientRect(),r=this._holderElement.getBoundingClientRect();let a=0,l=0;if(i?s?(a=r.x,l=r.y+r.height+2):(a=o.x,l=o.y+o.height):s?(a=0,l=r.height+2):(a=this._searchInput.offsetLeft,l=this._searchInput.offsetHeight+this._searchInput.offsetTop),t&&!s&&(a-=this._dropElement.offsetWidth-o.width),!s){const p=Math.min(window.innerWidth,document.body.offsetWidth),m=t?o.x+o.width-this._dropElement.offsetWidth-1:p-1-(o.x+this._dropElement.offsetWidth);m<0&&(a=t?a-m:a+m)}s&&(this._dropElement.style.width=this._holderElement.offsetWidth+"px"),e||(this._dropElement.style.transform="unset"),Object.assign(this._dropElement.style,{left:a+"px",top:l+"px"});const d=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(d.y+d.height>h||this._dropElement.style.transform.includes("translateY")){const p=s?r.height+4:o.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+p+"px))"}}_getBootstrapVersion(){let e=5,t=window.jQuery;return t&&t.fn.tooltip&&t.fn.tooltip.Constructor&&(e=parseInt(t.fn.tooltip.Constructor.VERSION.charAt(0))),e}_isSelected(e){return!!Array.from(this._selectElement.querySelectorAll("option")).find(s=>s.textContent==e&&s.getAttribute("selected"))}_isSelectable(e){const i=Array.from(this._selectElement.querySelectorAll("option")).filter(s=>s.textContent==e);return!(i.length>0&&!i.find(o=>!o.getAttribute("selected")))}hasItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.labelField]==e)return!0}return!1}getItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.valueField]==e)return s}return null}_validateRegex(e){return new RegExp(this._config.regex.trim()).test(e)}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS]}getActiveSelection(){return this.getSelection()}removeActiveSelection(){return this.removeSelection()}removeAll(){this.getSelectedValues().forEach(t=>{this.removeItem(t,!0)}),this._adjustWidth()}removeLastItem(e=!1){let t=this.getLastItem();t&&this.removeItem(t,e)}getLastItem(){let e=this._containerElement.querySelectorAll("span."+CLASS_PREFIX+"badge");return e.length?e[e.length-1].getAttribute(VALUE_ATTRIBUTE):void 0}enable(){this._selectElement.setAttribute("disabled",""),this.resetState()}disable(){rmAttr(this._selectElement,"disabled"),this.resetState()}isDisabled(){return this._selectElement.hasAttribute("disabled")||this._selectElement.disabled||this._selectElement.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS)}isInvalid(){return this._holderElement.classList.contains(INVALID_CLASS)}isSingle(){return!this._selectElement.hasAttribute("multiple")}isMaxReached(){return this._config.max&&this.getSelectedValues().length>=this._config.max}canAdd(e,t={}){if(!e||t.new&&!this._config.allowNew||!t.new&&!this.hasItem(e)||this.isDisabled())return!1;if(!this.isSingle()&&!this._config.allowSame){if(t.new){if(this._isSelected(e))return!1}else if(!this._isSelectable(e))return!1}return this.isMaxReached()?!1:this._config.regex&&t.new&&!this._validateRegex(e)?(this._holderElement.classList.add(INVALID_CLASS),!1):this._config.onCanAdd&&this._config.onCanAdd(e,t,this)===!1?(this._holderElement.classList.add(INVALID_CLASS),!1):!0}getData(){return this._config.items}setData(e,t=!1){Array.isArray(e)||(e=Object.entries(e).map(([i,s])=>({value:i,label:s}))),this._config.items!=e&&(this._config.items=e),t&&(this._removeSelectedAttrs(),e.reduce((s,o)=>s.concat(o.group?o.items:[o]),[]).forEach(s=>{const o=s[this._config.valueField],r=s[this._config.labelField];if(o&&(s.selected||this._config.selected.includes(o))){const a=this.addItem(r,o,s.data);a&&a.setAttribute("data-init","true")}})),this._buildSuggestions(e),this._resetHtmlState()}_findOption(e=null,t="",i=0){const o="option"+(e===null?"":'[value="'+CSS.escape(e)+'"]')+t;return this._selectElement.querySelectorAll(o)[i]||null}setItem(e,t={}){let i=null,s=this._findOption(e,":not([selected])");s&&(i=this.addItem(s.textContent,s.value,t));let o=this.getItem(e);if(o){const r=o[this._config.valueField],a=o[this._config.labelField];i=this.addItem(a,r,t)}return this._adjustWidth(),this._checkMax(),i}addItem(e,t=null,i={}){t||(t=e),this.isSingle()&&this.getSelectedValues().length&&this.removeLastItem(!0);let s=this._findOption(t,":not([selected])");if(!s){s=ce("option"),s.value=t,s.innerText=e;for(const[o,r]of Object.entries(i))s.dataset[o]=r;this._selectElement.appendChild(s),this._config.onCreateItem(s,this)}return s&&(i=Object.assign({title:s.getAttribute("title")},i,s.dataset)),s.setAttribute("selected","selected"),s.selected=!0,this._createBadge(e,t,i),this._fireEvents&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0})),s}_resetHtmlState(){const e=this._selectElement.innerHTML;this._selectElement.innerHTML="",this._selectElement.innerHTML=e,this._adjustWidth()}_createBadge(e,t=null,i={}){const s=this._getBootstrapVersion()===5,o=i.disabled&&parseBool(i.disabled),r=this._config.allowClear&&!o;let a=this._config.allowHtml?e:sanitize(e),l=ce("span"),d=[CLASS_PREFIX+"badge"];const h=this.isSingle()&&!this._config.singleBadge;if(!h){d.push("badge");let m=this._config.badgeStyle;i.badgeStyle&&(m=i.badgeStyle),i.badgeClass&&d.push(...i.badgeClass.split(" ")),this._config.baseClass?d.push(...this._config.baseClass.split(" ")):s?d=[...d,"bg-"+m,"text-truncate"]:d=[...d,"badge-"+m],l.style.maxWidth="100%"}o&&d.push("disabled","opacity-50");const p=h?0:2;if(l.style.margin=p+"px 6px "+p+"px 0px",l.style.marginBlock=p+"px",l.style.marginInline="0px 6px",l.style.display="flex",l.style.alignItems="center",l.classList.add(...d),l.setAttribute(VALUE_ATTRIBUTE,t),i.title&&l.setAttribute("title",i.title),r){const m=d.includes("text-dark")||h?"btn-close":"btn-close btn-close-white";let v="margin-inline: 0px 6px;",y="left";this._config.clearEnd&&(y="right"),y=="right"&&(v="margin-inline: 6px 0px;");const b=s?'':'';a=y=="left"?b+a:a+b}l.innerHTML=a,this._containerElement.insertBefore(l,this._searchInput),i.title&&tooltip&&s&&tooltip.getOrCreateInstance(l),r&&l.querySelector("button").addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),this.isDisabled()||this._config.confirmClear(t,this).then(()=>{this.removeItem(t),document.activeElement.blur(),this._adjustWidth()}).catch(()=>{})})}getHolder(){return this._holderElement}clear(){this.hideSuggestions(),this.reset()}updateData(e){this.setData(e,!1),this.reset()}removeItem(e,t=!1){const i=CSS.escape(e);let s=this._containerElement.querySelectorAll("span["+VALUE_ATTRIBUTE+'="'+i+'"]');if(!s.length)return;const o=s.length-1,r=s[o];r&&(r.dataset.bsOriginalTitle&&tooltip.getOrCreateInstance(r).dispose(),r.remove());let a=this._findOption(e,"[selected]",o);a&&(rmAttr(a,"selected"),a.selected=!1,this._fireEvents&&!t&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0}))),this._searchInput.style.visibility=="hidden"&&!this.isMaxReached()&&(this._searchInput.style.visibility="visible",this._holderElement.classList.remove(MAX_REACHED_CLASS)),t||this._config.onClearItem(e,this)}}var leafletSrc={exports:{}};/* @preserve + `,s.append(r),s.classList.add("d-flex","justify-content-between"),r.addEventListener("click",a=>{this._searchInput.value=t.label,this._searchInput.focus()})}return o.addEventListener("mouseenter",r=>{this._keyboardNavigation||(this.removeSelection(),s.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{r.preventDefault(),this._preventInput=!0,this._searchInput.value=decodeHtml(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),s}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=normalize$1(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let i=0,s=null;const o=[];for(let r=0;r0&&this._config.searchFields.forEach(m=>{const v=normalize$1(l[m]);let y=!1;if(this._config.fuzzy)y=fuzzyMatch$1(v,e);else{const b=v.indexOf(e);y=this._config.startsWith?b===0:b>=0}y&&(h=!0)});const p=h||e.length===0;if(d||h){if(i++,l.group&&!o.includes(l.group)){const v=this._createGroup(l.group);this._dropElement.appendChild(v),o.push(l.group)}const m=this._createItem(e,l);if(!s&&p&&(s=m),this._dropElement.appendChild(m),this._config.maximumItems>0&&i>=this._config.maximumItems)break}}if(s&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT$1,s)),i===0)if(this._config.notFoundMessage){const r=this._createLi();r.innerHTML=`${this._config.notFoundMessage}`,this._dropElement.appendChild(r),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(SHOW_CLASS$1),this._dropElement.setAttribute("role","menu"),attrs$1(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(SHOW_CLASS$1)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(SHOW_CLASS$1),attrs$1(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),i=e.direction==="rtl",s=this._config.fullWidth,o=this._config.fixed;let r=null,a=null;o&&(r=t.x,a=t.y+t.height,i&&!s&&(r-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",s&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),r!==null&&(this._dropElement.style.left=r+"px"),a!==null&&(this._dropElement.style.top=a+"px");const l=this._dropElement.getBoundingClientRect(),d=window.innerHeight;if(l.y+l.height>d){const h=s?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+h+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const i=Array.from(t.children).map(s=>{const o=s.getAttribute("value")??s.innerHTML.toLowerCase(),r=s.innerHTML;return{value:o,label:r}});this._addItems(i)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let i=0;il.group=o.group),this._addItems(o.items);continue}const r=typeof o=="string"?o:o.label,a=typeof o!="object"?{}:o;a.label=o[this._config.labelField]??r,a.value=o[this._config.valueField]??s,a.label&&(this._items[a.value]=a)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._searchInput.classList.add(LOADING_CLASS$1),this._config.onBeforeFetch(this),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested$1(this._config.serverDataKey,a)||a;this.setData(l),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._searchInput.classList.remove(LOADING_CLASS$1),this._config.onAfterFetch(this)})}}const DEFAULTS={items:[],allowNew:!1,showAllSuggestions:!1,badgeStyle:"primary",allowClear:!1,clearEnd:!1,selected:[],regex:"",separator:[],max:0,clearLabel:"Clear",searchLabel:"Type a value",showDropIcon:!0,keepOpen:!1,allowSame:!1,baseClass:"",placeholder:"",addOnBlur:!1,showDisabled:!1,hideNativeValidation:!1,suggestionsThreshold:-1,maximumItems:0,autoselectFirst:!0,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!0,fixed:!1,fuzzy:!1,startsWith:!1,singleBadge:!1,activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,allowHtml:!1,debounceTime:300,notFoundMessage:"",inputFilter:n=>n,sanitizer:n=>sanitize(n),onRenderItem:(n,e,t)=>t.config("allowHtml")?e:t.config("sanitizer")(e),onSelectItem:(n,e)=>{},onClearItem:(n,e)=>{},onCreateItem:(n,e)=>{},onBlur:(n,e)=>{},onFocus:(n,e)=>{},onCanAdd:(n,e,t)=>{},confirmClear:(n,e)=>Promise.resolve(),confirmAdd:(n,e)=>Promise.resolve(),onServerResponse:(n,e)=>n.json()},CLASS_PREFIX="tags-",LOADING_CLASS="is-loading",ACTIVE_CLASS="is-active",INVALID_CLASS="is-invalid",MAX_REACHED_CLASS="is-max-reached",SHOW_CLASS="show",VALUE_ATTRIBUTE="data-value",NEXT="next",PREV="prev",FOCUS_CLASS="form-control-focus",PLACEHOLDER_CLASS="form-placeholder-shown",DISABLED_CLASS="form-control-disabled",INSTANCE_MAP=new WeakMap;let counter=0,tooltip=window.bootstrap&&window.bootstrap.Tooltip;function debounce$1(n,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}}function calcTextWidth(n,e=null){const t=ce("span");document.body.appendChild(t),t.style.fontSize=e||"inherit",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="no-wrap",t.innerHTML=sanitize(n);const i=Math.ceil(t.clientWidth);return document.body.removeChild(t),i}function sanitize(n){return n.replace(/[\x26\x0A\<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})}function removeDiacritics(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize(n){return n?removeDiacritics(n.toString()).toLowerCase():""}function fuzzyMatch(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let i=0;it[i],e)}class Tags{constructor(e,t={}){if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP.set(e,this),counter++,this._selectElement=e,this._configure(t),this._keyboardNavigation=!1,this._searchFunc=debounce$1(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._fireEvents=!0,this._configureParent(),this._holderElement=ce("div"),this._containerElement=ce("div"),this._dropElement=ce("ul"),this._searchInput=ce("input"),this._holderElement.appendChild(this._containerElement),this._selectElement.parentElement.insertBefore(this._holderElement,this._selectElement),this._configureHolderElement(),this._configureContainerElement(),this._configureSelectElement(),this._configureSearchInput(),this._configureDropElement(),this.resetState(),this.handleEvent=i=>{this._handleEvent(i)},this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this)),["focus","blur","input","keydown","paste"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this.loadData(!0)}static init(e="select[multiple]",t={},i=!1){let s=document.querySelectorAll(e);for(let o=0;o{this._searchInput.removeEventListener(e,this)}),["mousemove","mouseleave"].forEach(e=>{this._dropElement.removeEventListener(e,this)}),this._config.fixed&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._selectElement.style.display="block",this._holderElement.parentElement.removeChild(this._holderElement),this.parentForm&&this.parentForm.removeEventListener("reset",this),INSTANCE_MAP.delete(this._selectElement)}handleEvent(e){this._handleEvent(e)}_handleEvent(e){["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)}_configure(e={}){this._config=Object.assign({},DEFAULTS,{showDropIcon:!!this._findOption()});const t=this._selectElement.dataset.config?JSON.parse(this._selectElement.dataset.config):{},i={...e,...t,...this._selectElement.dataset};for(const[s,o]of Object.entries(DEFAULTS)){if(s=="config"||i[s]===void 0)continue;const r=i[s];switch(typeof o){case"number":this._config[s]=parseInt(r);break;case"boolean":this._config[s]=parseBool(r);break;case"string":this._config[s]=r.toString();break;case"object":this._config[s]=r,typeof r=="string"&&(["{","["].includes(r[0])?this._config[s]=JSON.parse(r):this._config[s]=r.split(r.includes("|")?"|":","));break;case"function":this._config[s]=typeof r=="string"?r.split(".").reduce((a,l)=>a[l],window):r,this._config[s]||console.error("Invalid function",r);break;default:this._config[s]=r;break}}this._config.placeholder||(this._config.placeholder=this._getPlaceholder()),this._config.suggestionsThreshold==-1&&(this._config.suggestionsThreshold=this._config.liveServer?1:0)}config(e=null){return e?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}_configureParent(){for(this.overflowParent=null,this.parentForm=this._selectElement.parentElement;this.parentForm&&(this.parentForm.style.overflow==="hidden"&&(this.overflowParent=this.parentForm),this.parentForm=this.parentForm.parentElement,!(this.parentForm&&this.parentForm.nodeName=="FORM")););this.parentForm&&this.parentForm.addEventListener("reset",this)}_getPlaceholder(){if(this._selectElement.hasAttribute("placeholder"))return this._selectElement.getAttribute("placeholder");if(this._selectElement.dataset.placeholder)return this._selectElement.dataset.placeholder;let e=this._selectElement.querySelector("option");return!e||!this._config.autoselectFirst?"":(rmAttr(e,"selected"),e.selected=!1,e.value?"":e.textContent)}_configureSelectElement(){const e=this._selectElement;this._config.hideNativeValidation?(e.style.position="absolute",e.style.left="-9999px"):e.style.cssText="height:1px;width:1px;opacity:0;padding:0;margin:0;border:0;float:left;flex-basis:100%;min-height:unset;",e.tabIndex=-1,e.addEventListener("focus",t=>{this.onclick(t)}),e.addEventListener("invalid",t=>{this._holderElement.classList.add(INVALID_CLASS)})}_configureDropElement(){const e=this._dropElement;e.classList.add("dropdown-menu",CLASS_PREFIX+"menu"),e.id=CLASS_PREFIX+"menu-"+counter,e.setAttribute("role","menu");const t=e.style;t.padding="0",t.maxHeight="280px",this._config.fullWidth||(t.maxWidth="360px"),this._config.fixed&&(t.position="fixed"),t.overflowY="auto",t.overscrollBehavior="contain",t.textAlign="unset",e.addEventListener("mouseenter",i=>{this._keyboardNavigation=!1}),this._holderElement.appendChild(e),this._searchInput.setAttribute("aria-controls",e.id)}_configureHolderElement(){const e=this._holderElement;e.classList.add("form-control","dropdown"),["form-select-lg","form-select-sm","is-invalid","is-valid"].forEach(t=>{this._selectElement.classList.contains(t)&&e.classList.add(t)}),this._config.suggestionsThreshold==0&&this._config.showDropIcon&&e.classList.add("form-select"),this.overflowParent&&(e.style.position="inherit"),e.style.height="auto",e.addEventListener("click",this)}_configureContainerElement(){this._containerElement.addEventListener("click",t=>{this.isDisabled()||this._searchInput.style.visibility!="hidden"&&this._searchInput.focus()});const e=this._containerElement.style;e.display="flex",e.alignItems="center",e.flexWrap="wrap"}_configureSearchInput(){const e=this._searchInput;e.type="text",e.autocomplete="off",e.spellcheck=!1,attrs(e,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false","aria-label":this._config.searchLabel,role:"combobox"}),e.style.cssText="background-color:transparent;color:currentColor;border:0;padding:0;outline:0;max-width:100%",this.resetSearchInput(!0),this._containerElement.appendChild(e),this._rtl=window.getComputedStyle(e).direction==="rtl"}onfocus(e){this._holderElement.classList.add(FOCUS_CLASS),this.showOrSearch(),this._config.onFocus(e,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}this.afteronblur(e)}afteronblur(e){this._abortController&&this._abortController.abort();let t=!0;if(this._config.addOnBlur&&this._searchInput.value&&(t=this._enterValue()),this._holderElement.classList.remove(FOCUS_CLASS),this.hideSuggestions(t),this._fireEvents){const i=this.getSelection(),s={selection:i?i.dataset.value:null,input:this._searchInput.value};this._config.onBlur(e,this),this._selectElement.dispatchEvent(new CustomEvent("tags.blur",{bubbles:!0,detail:s}))}}onpaste(e){const i=(e.clipboardData||window.clipboardData).getData("text/plain").replace(/\r\n|\n/g," ");if(i.length>2&&this._config.separator.length){const s=splitMulti(i,this._config.separator).filter(o=>o);s.length>1&&(e.preventDefault(),s.forEach(o=>{this._addPastedValue(o)}))}}_addPastedValue(e){let t=e,i={};if(this._config.allowNew)i.new=1;else{const s=this.getSelection();if(!s)return;e=s.getAttribute(VALUE_ATTRIBUTE),t=s.dataset.label}this._config.confirmAdd(e,this).then(()=>{this._add(t,e,i)}).catch(()=>{})}oninput(e){const t=this._config.inputFilter(this._searchInput.value);if(t!=this._searchInput.value&&(this._searchInput.value=t),t){const i=t.slice(-1);if(this._config.separator.length&&this._config.separator.includes(i)){this._searchInput.value=this._searchInput.value.slice(0,-1);let s=this._searchInput.value;this._addPastedValue(s);return}}setTimeout(()=>{this._adjustWidth()}),this.showOrSearch()}onkeydown(e){let t=e.keyCode||e.key;const i=e.target;switch(e.keyCode==229&&(t=i.value.charAt(i.selectionStart-1).charCodeAt(0)),t){case 13:case"Enter":e.preventDefault(),this._enterValue();break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT):this.showOrSearch(!1);break;case 8:case"Backspace":const s=this.getLastItem();this._searchInput.value.length==0&&s&&this._config.confirmClear(s,this).then(()=>{this.removeLastItem(),this._adjustWidth(),this.showOrSearch()}).catch(()=>{});break;case 27:case"Escape":this._searchInput.focus(),this.hideSuggestions();break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}onclick(e=null){!this.isSingle()&&this.isMaxReached()||this._searchInput.focus()}onreset(e){this.reset()}loadData(e=!1){Object.keys(this._config.items).length>0?this.setData(this._config.items,!0):this.resetSuggestions(!0),this._config.server&&(this._config.liveServer||this._loadFromServer(!e))}_setSelectedAttributes(){const e=this._selectElement.selectedOptions||[];for(let t=0;t({value:s.getAttribute("value"),label:s.textContent,disabled:s.disabled,selected:s.selected,data:Object.assign({disabled:s.disabled},s.dataset)});let i=Array.from(this._selectElement.children).filter(s=>s.hasAttribute("label")||!s.disabled||this._config.showDisabled).map(s=>s.hasAttribute("label")?{group:s.getAttribute("label"),items:Array.from(s.children).map(o=>t(o))}:t(s));this.setData(i,e)}_enterValue(){let e=this.getSelection();if(e)return e.click(),!0;if(this._config.allowNew&&this._searchInput.value){let t=this._searchInput.value;return this._config.confirmAdd(t,this).then(()=>{this._add(t,t,{new:1})}).catch(()=>{}),!0}return!1}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._selectElement.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._holderElement.classList.add(LOADING_CLASS),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested(this._config.serverDataKey,a)||a;this.setData(l,!e),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._holderElement.classList.remove(LOADING_CLASS)})}_add(e,t=null,i={}){if(!this.canAdd(e,i))return null;const s=this.addItem(e,t,i);return this._resetHtmlState(),this._config.keepOpen?this._showSuggestions():this.resetSearchInput(),s}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT,t=null){const i=this.getSelection();if(i){const s=e===NEXT?"nextSibling":"previousSibling";t=i.parentNode;do t=t[s];while(t&&!this._isItemEnabled(t));t?i.classList.remove(...this._activeClasses()):i&&(t=i.parentElement)}else{if(e===PREV)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const s=t.offsetHeight,o=t.offsetTop,r=t.parentNode,a=r.offsetHeight,l=r.scrollHeight,d=r.offsetTop;if(s===0&&setTimeout(()=>{r.scrollTop=0}),e===PREV){const p=o-d>10?o-d:0;r.scrollTop=p}else o+s-(a+r.scrollTop)>0&&s>0&&(r.scrollTop=o+s-a+1,r.scrollTop+a>=l-10&&(r.scrollTop=o-d));const h=t.querySelector("a");h.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",h.id),this._config.updateOnSelect&&(this._searchInput.value=h.dataset.label,this._adjustWidth())}else this._searchInput.setAttribute("aria-activedescendant","");return t}_adjustWidth(){this._holderElement.classList.remove(PLACEHOLDER_CLASS),this._searchInput.value?this._searchInput.size=this._searchInput.value.length:this.getSelectedValues().length?(this._searchInput.placeholder="",this._searchInput.size=1):(this._searchInput.size=this._config.placeholder.length>0?this._config.placeholder.length:1,this._searchInput.placeholder=this._config.placeholder,this._holderElement.classList.add(PLACEHOLDER_CLASS));const e=this._searchInput.value||this._searchInput.placeholder,t=window.getComputedStyle(this._holderElement).fontSize,i=calcTextWidth(e,t)+16;this._searchInput.style.width=i+"px"}_buildSuggestions(e){for(;this._dropElement.lastChild;)this._dropElement.removeChild(this._dropElement.lastChild);let t=0,i=1;for(let s=0;s',this._dropElement.appendChild(s)}}_buildSuggestionsItem(e,t){if(!e[this._config.valueField])return;const i=e[this._config.valueField],s=e[this._config.labelField];let o=this._config.onRenderItem(e,s,this);const r=ce("li");r.setAttribute("role","presentation"),e.group_id&&r.setAttribute("data-group-id",""+e.group_id);const a=ce("a");r.append(a),a.id=this._dropElement.id+"-"+t,a.classList.add("dropdown-item","text-truncate"),e.disabled&&a.classList.add("disabled"),a.setAttribute(VALUE_ATTRIBUTE,i),a.dataset.label=s;const l={};this._config.searchFields.forEach(d=>{l[d]=e[d]}),a.dataset.searchData=JSON.stringify(l),a.setAttribute("href","#"),a.innerHTML=o,this._dropElement.appendChild(r),a.addEventListener("mouseenter",d=>{this._keyboardNavigation||(this.removeSelection(),r.querySelector("a").classList.add(...this._activeClasses()))}),a.addEventListener("mousedown",d=>{d.preventDefault()}),a.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this._config.confirmAdd(i,this).then(()=>{this._add(s,i,e.data),this._config.onSelectItem(e,this)}).catch(()=>{})})}initialOptions(){return this._selectElement.querySelectorAll("option[data-init]")}_removeSelectedAttrs(){this._selectElement.querySelectorAll("option").forEach(e=>{rmAttr(e,"selected")})}reset(){this.removeAll(),this._fireEvents=!1;const e=this.initialOptions();this._removeSelectedAttrs();for(let t=0;tt.value)}getAvailableValues(){const e=this._selectElement.querySelectorAll("option");return Array.from(e).map(t=>t.value)}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions(!1);return}this._config.liveServer?this._searchFunc():this._showSuggestions()}hideSuggestions(e=!0){this._dropElement.classList.remove(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"false"}),this.removeSelection(),e&&this._holderElement.classList.remove(INVALID_CLASS)}toggleSuggestions(e=!0,t=!0){this._dropElement.classList.contains(SHOW_CLASS)?this.hideSuggestions(t):this.showOrSearch(e)}_shouldShow(){return this.isDisabled()||this.isMaxReached()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}_showSuggestions(){if(this._searchInput.style.visibility=="hidden")return;const e=normalize(this._searchInput.value),t={},i=this._dropElement.querySelectorAll("li");let s=0,o=null,r=!1,a={};for(let l=0;l0){const y=JSON.parse(h.dataset.searchData);this._config.searchFields.forEach(b=>{const S=normalize(y[b]);let E=!1;if(this._config.fuzzy)E=fuzzyMatch(S,e);else{const T=S.indexOf(e);E=this._config.startsWith?T===0:T>=0}E&&(m=!0)})}const v=m||e.length===0;if(p||m?(s++,showItem(d),d.dataset.groupId&&(a[d.dataset.groupId]=!0),!o&&this._isItemEnabled(d)&&v&&(o=d),this._config.maximumItems>0&&s>this._config.maximumItems&&hideItem(d)):hideItem(d),this._config.highlightTyped){const y=h.textContent,b=normalize(y).indexOf(e),S=y.substring(0,b)+`${y.substring(b,b+e.length)}`+y.substring(b+e.length,y.length);h.innerHTML=S}this._isItemEnabled(d)&&(r=!0)}if(!this._config.allowNew&&!(e.length===0&&!r)&&this._holderElement.classList.add(INVALID_CLASS),this._config.allowNew&&this._config.regex&&this.isInvalid()&&this._holderElement.classList.remove(INVALID_CLASS),Array.from(i).filter(l=>l.dataset.id).forEach(l=>{a[l.dataset.id]===!0&&showItem(l)}),r&&(this._holderElement.classList.remove(INVALID_CLASS),o&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT,o))),s===0)if(this._config.notFoundMessage){const l=this._dropElement.querySelector("."+CLASS_PREFIX+"not-found");l.style.display="block";const d=this._config.notFoundMessage.replace("{{tag}}",this._searchInput.value);l.innerHTML=`${d}`,this._showDropdown()}else this.hideSuggestions(!1);else this._showDropdown()}_showDropdown(){const e=this._dropElement.classList.contains(SHOW_CLASS);e||(this._dropElement.classList.add(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"true"})),this._positionMenu(e)}_positionMenu(e=!1){const t=this._rtl,i=this._config.fixed,s=this._config.fullWidth,o=this._searchInput.getBoundingClientRect(),r=this._holderElement.getBoundingClientRect();let a=0,l=0;if(i?s?(a=r.x,l=r.y+r.height+2):(a=o.x,l=o.y+o.height):s?(a=0,l=r.height+2):(a=this._searchInput.offsetLeft,l=this._searchInput.offsetHeight+this._searchInput.offsetTop),t&&!s&&(a-=this._dropElement.offsetWidth-o.width),!s){const p=Math.min(window.innerWidth,document.body.offsetWidth),m=t?o.x+o.width-this._dropElement.offsetWidth-1:p-1-(o.x+this._dropElement.offsetWidth);m<0&&(a=t?a-m:a+m)}s&&(this._dropElement.style.width=this._holderElement.offsetWidth+"px"),e||(this._dropElement.style.transform="unset"),Object.assign(this._dropElement.style,{left:a+"px",top:l+"px"});const d=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(d.y+d.height>h||this._dropElement.style.transform.includes("translateY")){const p=s?r.height+4:o.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+p+"px))"}}_getBootstrapVersion(){let e=5,t=window.jQuery;return t&&t.fn.tooltip&&t.fn.tooltip.Constructor&&(e=parseInt(t.fn.tooltip.Constructor.VERSION.charAt(0))),e}_isSelected(e){return!!Array.from(this._selectElement.querySelectorAll("option")).find(s=>s.textContent==e&&s.getAttribute("selected"))}_isSelectable(e){const i=Array.from(this._selectElement.querySelectorAll("option")).filter(s=>s.textContent==e);return!(i.length>0&&!i.find(o=>!o.getAttribute("selected")))}hasItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.labelField]==e)return!0}return!1}getItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.valueField]==e)return s}return null}_validateRegex(e){return new RegExp(this._config.regex.trim()).test(e)}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS]}getActiveSelection(){return this.getSelection()}removeActiveSelection(){return this.removeSelection()}removeAll(){this.getSelectedValues().forEach(t=>{this.removeItem(t,!0)}),this._adjustWidth()}removeLastItem(e=!1){let t=this.getLastItem();t&&this.removeItem(t,e)}getLastItem(){let e=this._containerElement.querySelectorAll("span."+CLASS_PREFIX+"badge");return e.length?e[e.length-1].getAttribute(VALUE_ATTRIBUTE):void 0}enable(){this._selectElement.setAttribute("disabled",""),this.resetState()}disable(){rmAttr(this._selectElement,"disabled"),this.resetState()}isDisabled(){return this._selectElement.hasAttribute("disabled")||this._selectElement.disabled||this._selectElement.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS)}isInvalid(){return this._holderElement.classList.contains(INVALID_CLASS)}isSingle(){return!this._selectElement.hasAttribute("multiple")}isMaxReached(){return this._config.max&&this.getSelectedValues().length>=this._config.max}canAdd(e,t={}){if(!e||t.new&&!this._config.allowNew||!t.new&&!this.hasItem(e)||this.isDisabled())return!1;if(!this.isSingle()&&!this._config.allowSame){if(t.new){if(this._isSelected(e))return!1}else if(!this._isSelectable(e))return!1}return this.isMaxReached()?!1:this._config.regex&&t.new&&!this._validateRegex(e)?(this._holderElement.classList.add(INVALID_CLASS),!1):this._config.onCanAdd&&this._config.onCanAdd(e,t,this)===!1?(this._holderElement.classList.add(INVALID_CLASS),!1):!0}getData(){return this._config.items}setData(e,t=!1){Array.isArray(e)||(e=Object.entries(e).map(([i,s])=>({value:i,label:s}))),this._config.items!=e&&(this._config.items=e),t&&(this._removeSelectedAttrs(),e.reduce((s,o)=>s.concat(o.group?o.items:[o]),[]).forEach(s=>{const o=s[this._config.valueField],r=s[this._config.labelField];if(o&&(s.selected||this._config.selected.includes(o))){const a=this.addItem(r,o,s.data);a&&a.setAttribute("data-init","true")}})),this._buildSuggestions(e),this._resetHtmlState()}_findOption(e=null,t="",i=0){const o="option"+(e===null?"":'[value="'+CSS.escape(e)+'"]')+t;return this._selectElement.querySelectorAll(o)[i]||null}setItem(e,t={}){let i=null,s=this._findOption(e,":not([selected])");s&&(i=this.addItem(s.textContent,s.value,t));let o=this.getItem(e);if(o){const r=o[this._config.valueField],a=o[this._config.labelField];i=this.addItem(a,r,t)}return this._adjustWidth(),this._checkMax(),i}addItem(e,t=null,i={}){t||(t=e),this.isSingle()&&this.getSelectedValues().length&&this.removeLastItem(!0);let s=this._findOption(t,":not([selected])");if(!s){s=ce("option"),s.value=t,s.innerText=e;for(const[o,r]of Object.entries(i))s.dataset[o]=r;this._selectElement.appendChild(s),this._config.onCreateItem(s,this)}return s&&(i=Object.assign({title:s.getAttribute("title")},i,s.dataset)),s.setAttribute("selected","selected"),s.selected=!0,this._createBadge(e,t,i),this._fireEvents&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0})),s}_resetHtmlState(){const e=this._selectElement.innerHTML;this._selectElement.innerHTML="",this._selectElement.innerHTML=e,this._adjustWidth()}_createBadge(e,t=null,i={}){const s=this._getBootstrapVersion()===5,o=i.disabled&&parseBool(i.disabled),r=this._config.allowClear&&!o;let a=this._config.allowHtml?e:this._config.sanitizer(e),l=ce("span"),d=[CLASS_PREFIX+"badge"];const h=this.isSingle()&&!this._config.singleBadge;if(!h){d.push("badge");let m=this._config.badgeStyle;i.badgeStyle&&(m=i.badgeStyle),i.badgeClass&&d.push(...i.badgeClass.split(" ")),this._config.baseClass?d.push(...this._config.baseClass.split(" ")):s?d=[...d,"bg-"+m,"text-truncate"]:d=[...d,"badge-"+m],l.style.maxWidth="100%"}o&&d.push("disabled","opacity-50");const p=h?0:2;if(l.style.margin=p+"px 6px "+p+"px 0px",l.style.marginBlock=p+"px",l.style.marginInline="0px 6px",l.style.display="flex",l.style.alignItems="center",l.classList.add(...d),l.setAttribute(VALUE_ATTRIBUTE,t),i.title&&l.setAttribute("title",i.title),r){const m=d.includes("text-dark")||h?"btn-close":"btn-close btn-close-white";let v="margin-inline: 0px 6px;",y="left";this._config.clearEnd&&(y="right"),y=="right"&&(v="margin-inline: 6px 0px;");const b=s?'':'';a=y=="left"?b+a:a+b}l.innerHTML=a,this._containerElement.insertBefore(l,this._searchInput),i.title&&tooltip&&s&&tooltip.getOrCreateInstance(l),r&&l.querySelector("button").addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),this.isDisabled()||this._config.confirmClear(t,this).then(()=>{this.removeItem(t),document.activeElement.blur(),this._adjustWidth()}).catch(()=>{})})}getHolder(){return this._holderElement}clear(){this.hideSuggestions(),this.reset()}updateData(e){this.setData(e,!1),this.reset()}removeItem(e,t=!1){const i=CSS.escape(e);let s=this._containerElement.querySelectorAll("span["+VALUE_ATTRIBUTE+'="'+i+'"]');if(!s.length)return;const o=s.length-1,r=s[o];r&&(r.dataset.bsOriginalTitle&&tooltip.getOrCreateInstance(r).dispose(),r.remove());let a=this._findOption(e,"[selected]",o);a&&(rmAttr(a,"selected"),a.selected=!1,this._fireEvents&&!t&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0}))),this._searchInput.style.visibility=="hidden"&&!this.isMaxReached()&&(this._searchInput.style.visibility="visible",this._holderElement.classList.remove(MAX_REACHED_CLASS)),t||this._config.onClearItem(e,this)}}var leafletSrc={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */(function(n,e){(function(t,i){i(e)})(commonjsGlobal,function(t){var i="1.9.4";function s(c){var u,g,C,w;for(g=1,C=arguments.length;g"u"||!L||!L.Mixin)){c=R(c)?c:[c];for(var u=0;u0?Math.floor(c):Math.ceil(c)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(c){return this.clone()._add(U(c))},_add:function(c){return this.x+=c.x,this.y+=c.y,this},subtract:function(c){return this.clone()._subtract(U(c))},_subtract:function(c){return this.x-=c.x,this.y-=c.y,this},divideBy:function(c){return this.clone()._divideBy(c)},_divideBy:function(c){return this.x/=c,this.y/=c,this},multiplyBy:function(c){return this.clone()._multiplyBy(c)},_multiplyBy:function(c){return this.x*=c,this.y*=c,this},scaleBy:function(c){return new W(this.x*c.x,this.y*c.y)},unscaleBy:function(c){return new W(this.x/c.x,this.y/c.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=X(this.x),this.y=X(this.y),this},distanceTo:function(c){c=U(c);var u=c.x-this.x,g=c.y-this.y;return Math.sqrt(u*u+g*g)},equals:function(c){return c=U(c),c.x===this.x&&c.y===this.y},contains:function(c){return c=U(c),Math.abs(c.x)<=Math.abs(this.x)&&Math.abs(c.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function U(c,u,g){return c instanceof W?c:R(c)?new W(c[0],c[1]):c==null?c:typeof c=="object"&&"x"in c&&"y"in c?new W(c.x,c.y):new W(c,u,g)}function se(c,u){if(c)for(var g=u?[c,u]:c,C=0,w=g.length;C=this.min.x&&g.x<=this.max.x&&u.y>=this.min.y&&g.y<=this.max.y},intersects:function(c){c=pe(c);var u=this.min,g=this.max,C=c.min,w=c.max,P=w.x>=u.x&&C.x<=g.x,O=w.y>=u.y&&C.y<=g.y;return P&&O},overlaps:function(c){c=pe(c);var u=this.min,g=this.max,C=c.min,w=c.max,P=w.x>u.x&&C.xu.y&&C.y=u.lat&&w.lat<=g.lat&&C.lng>=u.lng&&w.lng<=g.lng},intersects:function(c){c=oe(c);var u=this._southWest,g=this._northEast,C=c.getSouthWest(),w=c.getNorthEast(),P=w.lat>=u.lat&&C.lat<=g.lat,O=w.lng>=u.lng&&C.lng<=g.lng;return P&&O},overlaps:function(c){c=oe(c);var u=this._southWest,g=this._northEast,C=c.getSouthWest(),w=c.getNorthEast(),P=w.lat>u.lat&&C.latu.lng&&C.lng1,Yn=function(){var c=!1;try{var u=Object.defineProperty({},"passive",{get:function(){c=!0}});window.addEventListener("testPassiveEventSupport",p,u),window.removeEventListener("testPassiveEventSupport",p,u)}catch{}return c}(),qn=function(){return!!document.createElement("canvas").getContext}(),ti=!!(document.createElementNS&&Mt("svg").createSVGRect),Xn=!!ti&&function(){var c=document.createElement("div");return c.innerHTML="",(c.firstChild&&c.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Qn=!ti&&function(){try{var c=document.createElement("div");c.innerHTML='';var u=c.firstChild;return u.style.behavior="url(#default#VML)",u&&typeof u.adj=="object"}catch{return!1}}(),Zn=navigator.platform.indexOf("Mac")===0,Jn=navigator.platform.indexOf("Linux")===0;function Me(c){return navigator.userAgent.toLowerCase().indexOf(c)>=0}var Q={ie:Ze,ielt9:Jt,edge:Oe,webkit:Ge,android:ht,android23:ft,androidStock:Lt,opera:Je,chrome:mt,gecko:vt,safari:Gn,phantom:Mi,opera12:Li,win:Vn,ie3d:xi,webkit3d:ei,gecko3d:Fi,any3d:Hn,mobile:Ct,mobileWebkit:Wn,mobileWebkit3d:Bn,msPointer:Ni,pointer:Ii,touch:zn,touchNative:$i,mobileOpera:jn,mobileGecko:Un,retina:Kn,passiveEvents:Yn,canvas:qn,svg:ti,vml:Qn,inlineSvg:Xn,mac:Zn,linux:Jn},ki=Q.msPointer?"MSPointerDown":"pointerdown",Gi=Q.msPointer?"MSPointerMove":"pointermove",Vi=Q.msPointer?"MSPointerUp":"pointerup",Hi=Q.msPointer?"MSPointerCancel":"pointercancel",ii={touchstart:ki,touchmove:Gi,touchend:Vi,touchcancel:Hi},Wi={touchstart:rs,touchmove:xt,touchend:xt,touchcancel:xt},et={},Bi=!1;function ts(c,u,g){return u==="touchstart"&&os(),Wi[u]?(g=Wi[u].bind(this,g),c.addEventListener(ii[u],g,!1),g):(console.warn("wrong event specified:",u),p)}function is(c,u,g){if(!ii[u]){console.warn("wrong event specified:",u);return}c.removeEventListener(ii[u],g,!1)}function ns(c){et[c.pointerId]=c}function ss(c){et[c.pointerId]&&(et[c.pointerId]=c)}function zi(c){delete et[c.pointerId]}function os(){Bi||(document.addEventListener(ki,ns,!0),document.addEventListener(Gi,ss,!0),document.addEventListener(Vi,zi,!0),document.addEventListener(Hi,zi,!0),Bi=!0)}function xt(c,u){if(u.pointerType!==(u.MSPOINTER_TYPE_MOUSE||"mouse")){u.touches=[];for(var g in et)u.touches.push(et[g]);u.changedTouches=[u],c(u)}}function rs(c,u){u.MSPOINTER_TYPE_TOUCH&&u.pointerType===u.MSPOINTER_TYPE_TOUCH&&ye(u),xt(c,u)}function as(c){var u={},g,C;for(C in c)g=c[C],u[C]=g&&g.bind?g.bind(c):g;return c=u,u.type="dblclick",u.detail=2,u.isTrusted=!1,u._simulated=!0,u}var ls=200;function ds(c,u){c.addEventListener("dblclick",u);var g=0,C;function w(P){if(P.detail!==1){C=P.detail;return}if(!(P.pointerType==="mouse"||P.sourceCapabilities&&!P.sourceCapabilities.firesTouchEvents)){var O=qi(P);if(!(O.some(function(k){return k instanceof HTMLLabelElement&&k.attributes.for})&&!O.some(function(k){return k instanceof HTMLInputElement||k instanceof HTMLSelectElement}))){var I=Date.now();I-g<=ls?(C++,C===2&&u(as(P))):C=1,g=I}}}return c.addEventListener("click",w),{dblclick:u,simDblclick:w}}function us(c,u){c.removeEventListener("dblclick",u.dblclick),c.removeEventListener("click",u.simDblclick)}var ni=It(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),_t=It(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ji=_t==="webkitTransition"||_t==="OTransition"?_t+"End":"transitionend";function Ui(c){return typeof c=="string"?document.getElementById(c):c}function yt(c,u){var g=c.style[u]||c.currentStyle&&c.currentStyle[u];if((!g||g==="auto")&&document.defaultView){var C=document.defaultView.getComputedStyle(c,null);g=C?C[u]:null}return g==="auto"?null:g}function he(c,u,g){var C=document.createElement(c);return C.className=u||"",g&&g.appendChild(C),C}function ge(c){var u=c.parentNode;u&&u.removeChild(c)}function Ft(c){for(;c.firstChild;)c.removeChild(c.firstChild)}function tt(c){var u=c.parentNode;u&&u.lastChild!==c&&u.appendChild(c)}function nt(c){var u=c.parentNode;u&&u.firstChild!==c&&u.insertBefore(c,u.firstChild)}function si(c,u){if(c.classList!==void 0)return c.classList.contains(u);var g=Nt(c);return g.length>0&&new RegExp("(^|\\s)"+u+"(\\s|$)").test(g)}function re(c,u){if(c.classList!==void 0)for(var g=y(u),C=0,w=g.length;C0?2*window.devicePixelRatio:1;function Qi(c){return Q.edge?c.wheelDeltaY/2:c.deltaY&&c.deltaMode===0?-c.deltaY/fs:c.deltaY&&c.deltaMode===1?-c.deltaY*20:c.deltaY&&c.deltaMode===2?-c.deltaY*60:c.deltaX||c.deltaZ?0:c.wheelDelta?(c.wheelDeltaY||c.wheelDelta)/2:c.detail&&Math.abs(c.detail)<32765?-c.detail*20:c.detail?c.detail/-32765*60:0}function Ci(c,u){var g=u.relatedTarget;if(!g)return!0;try{for(;g&&g!==c;)g=g.parentNode}catch{return!1}return g!==c}var gs={__proto__:null,on:ne,off:fe,stopPropagation:Ue,disableScrollPropagation:mi,disableClickPropagation:Et,preventDefault:ye,stop:Ke,getPropagationPath:qi,getMousePosition:Xi,getWheelDelta:Qi,isExternalTarget:Ci,addListener:ne,removeListener:fe},Zi=Y.extend({run:function(c,u,g,C){this.stop(),this._el=c,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(C||.5,.2),this._startPos=je(c),this._offset=u.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=B(this._animate,this),this._step()},_step:function(c){var u=+new Date-this._startTime,g=this._duration*1e3;uthis.options.maxZoom)?this.setZoom(c):this},panInsideBounds:function(c,u){this._enforcingBounds=!0;var g=this.getCenter(),C=this._limitCenter(g,this._zoom,oe(c));return g.equals(C)||this.panTo(C,u),this._enforcingBounds=!1,this},panInside:function(c,u){u=u||{};var g=U(u.paddingTopLeft||u.padding||[0,0]),C=U(u.paddingBottomRight||u.padding||[0,0]),w=this.project(this.getCenter()),P=this.project(c),O=this.getPixelBounds(),I=pe([O.min.add(g),O.max.subtract(C)]),k=I.getSize();if(!I.contains(P)){this._enforcingBounds=!0;var H=P.subtract(I.getCenter()),q=I.extend(P).getSize().subtract(k);w.x+=H.x<0?-q.x:q.x,w.y+=H.y<0?-q.y:q.y,this.panTo(this.unproject(w),u),this._enforcingBounds=!1}return this},invalidateSize:function(c){if(!this._loaded)return this;c=s({animate:!1,pan:!0},c===!0?{animate:!0}:c);var u=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),C=u.divideBy(2).round(),w=g.divideBy(2).round(),P=C.subtract(w);return!P.x&&!P.y?this:(c.animate&&c.pan?this.panBy(P):(c.pan&&this._rawPanBy(P),this.fire("move"),c.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:u,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(c){if(c=this._locateOptions=s({timeout:1e4,watch:!1},c),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var u=r(this._handleGeolocationResponse,this),g=r(this._handleGeolocationError,this);return c.watch?this._locationWatchId=navigator.geolocation.watchPosition(u,g,c):navigator.geolocation.getCurrentPosition(u,g,c),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(c){if(this._container._leaflet_id){var u=c.code,g=c.message||(u===1?"permission denied":u===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:u,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(c){if(this._container._leaflet_id){var u=c.coords.latitude,g=c.coords.longitude,C=new ie(u,g),w=C.toBounds(c.coords.accuracy*2),P=this._locateOptions;if(P.setView){var O=this.getBoundsZoom(w);this.setView(C,P.maxZoom?Math.min(O,P.maxZoom):O)}var I={latlng:C,bounds:w,timestamp:c.timestamp};for(var k in c.coords)typeof c.coords[k]=="number"&&(I[k]=c.coords[k]);this.fire("locationfound",I)}},addHandler:function(c,u){if(!u)return this;var g=this[c]=new u(this);return this._handlers.push(g),this.options[c]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ge(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(K(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var c;for(c in this._layers)this._layers[c].remove();for(c in this._panes)ge(this._panes[c]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(c,u){var g="leaflet-pane"+(c?" leaflet-"+c.replace("Pane","")+"-pane":""),C=he("div",g,u||this._mapPane);return c&&(this._panes[c]=C),C},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var c=this.getPixelBounds(),u=this.unproject(c.getBottomLeft()),g=this.unproject(c.getTopRight());return new ae(u,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(c,u,g){c=oe(c),g=U(g||[0,0]);var C=this.getZoom()||0,w=this.getMinZoom(),P=this.getMaxZoom(),O=c.getNorthWest(),I=c.getSouthEast(),k=this.getSize().subtract(g),H=pe(this.project(I,C),this.project(O,C)).getSize(),q=Q.any3d?this.options.zoomSnap:1,ee=k.x/H.x,le=k.y/H.y,we=u?Math.max(ee,le):Math.min(ee,le);return C=this.getScaleZoom(we,C),q&&(C=Math.round(C/(q/100))*(q/100),C=u?Math.ceil(C/q)*q:Math.floor(C/q)*q),Math.max(w,Math.min(P,C))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(c,u){var g=this._getTopLeftPoint(c,u);return new se(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(c){return this.options.crs.getProjectedBounds(c===void 0?this.getZoom():c)},getPane:function(c){return typeof c=="string"?this._panes[c]:c},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(c,u){var g=this.options.crs;return u=u===void 0?this._zoom:u,g.scale(c)/g.scale(u)},getScaleZoom:function(c,u){var g=this.options.crs;u=u===void 0?this._zoom:u;var C=g.zoom(c*g.scale(u));return isNaN(C)?1/0:C},project:function(c,u){return u=u===void 0?this._zoom:u,this.options.crs.latLngToPoint(te(c),u)},unproject:function(c,u){return u=u===void 0?this._zoom:u,this.options.crs.pointToLatLng(U(c),u)},layerPointToLatLng:function(c){var u=U(c).add(this.getPixelOrigin());return this.unproject(u)},latLngToLayerPoint:function(c){var u=this.project(te(c))._round();return u._subtract(this.getPixelOrigin())},wrapLatLng:function(c){return this.options.crs.wrapLatLng(te(c))},wrapLatLngBounds:function(c){return this.options.crs.wrapLatLngBounds(oe(c))},distance:function(c,u){return this.options.crs.distance(te(c),te(u))},containerPointToLayerPoint:function(c){return U(c).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(c){return U(c).add(this._getMapPanePos())},containerPointToLatLng:function(c){var u=this.containerPointToLayerPoint(U(c));return this.layerPointToLatLng(u)},latLngToContainerPoint:function(c){return this.layerPointToContainerPoint(this.latLngToLayerPoint(te(c)))},mouseEventToContainerPoint:function(c){return Xi(c,this._container)},mouseEventToLayerPoint:function(c){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(c))},mouseEventToLatLng:function(c){return this.layerPointToLatLng(this.mouseEventToLayerPoint(c))},_initContainer:function(c){var u=this._container=Ui(c);if(u){if(u._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ne(u,"scroll",this._onScroll,this),this._containerId=l(u)},_initLayout:function(){var c=this._container;this._fadeAnimated=this.options.fadeAnimation&&Q.any3d,re(c,"leaflet-container"+(Q.touch?" leaflet-touch":"")+(Q.retina?" leaflet-retina":"")+(Q.ielt9?" leaflet-oldie":"")+(Q.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var u=yt(c,"position");u!=="absolute"&&u!=="relative"&&u!=="fixed"&&u!=="sticky"&&(c.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var c=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ve(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(re(c.markerPane,"leaflet-zoom-hide"),re(c.shadowPane,"leaflet-zoom-hide"))},_resetView:function(c,u,g){ve(this._mapPane,new W(0,0));var C=!this._loaded;this._loaded=!0,u=this._limitZoom(u),this.fire("viewprereset");var w=this._zoom!==u;this._moveStart(w,g)._move(c,u)._moveEnd(w),this.fire("viewreset"),C&&this.fire("load")},_moveStart:function(c,u){return c&&this.fire("zoomstart"),u||this.fire("movestart"),this},_move:function(c,u,g,C){u===void 0&&(u=this._zoom);var w=this._zoom!==u;return this._zoom=u,this._lastCenter=c,this._pixelOrigin=this._getNewPixelOrigin(c),C?g&&g.pinch&&this.fire("zoom",g):((w||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(c){return c&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return K(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(c){ve(this._mapPane,this._getMapPanePos().subtract(c))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(c){this._targets={},this._targets[l(this._container)]=this;var u=c?fe:ne;u(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&u(window,"resize",this._onResize,this),Q.any3d&&this.options.transform3DLimit&&(c?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){K(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var c=this._getMapPanePos();Math.max(Math.abs(c.x),Math.abs(c.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(c,u){for(var g=[],C,w=u==="mouseout"||u==="mouseover",P=c.target||c.srcElement,O=!1;P;){if(C=this._targets[l(P)],C&&(u==="click"||u==="preclick")&&this._draggableMoved(C)){O=!0;break}if(C&&C.listens(u,!0)&&(w&&!Ci(P,c)||(g.push(C),w))||P===this._container)break;P=P.parentNode}return!g.length&&!O&&!w&&this.listens(u,!0)&&(g=[this]),g},_isClickDisabled:function(c){for(;c&&c!==this._container;){if(c._leaflet_disable_click)return!0;c=c.parentNode}},_handleDOMEvent:function(c){var u=c.target||c.srcElement;if(!(!this._loaded||u._leaflet_disable_events||c.type==="click"&&this._isClickDisabled(u))){var g=c.type;g==="mousedown"&&di(u),this._fireDOMEvent(c,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(c,u,g){if(c.type==="click"){var C=s({},c);C.type="preclick",this._fireDOMEvent(C,C.type,g)}var w=this._findEventTargets(c,u);if(g){for(var P=[],O=0;O0?Math.round(c-u)/2:Math.max(0,Math.ceil(c))-Math.max(0,Math.floor(u))},_limitZoom:function(c){var u=this.getMinZoom(),g=this.getMaxZoom(),C=Q.any3d?this.options.zoomSnap:1;return C&&(c=Math.round(c/C)*C),Math.max(u,Math.min(g,c))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){me(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(c,u){var g=this._getCenterOffset(c)._trunc();return(u&&u.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,u),!0)},_createAnimProxy:function(){var c=this._proxy=he("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(c),this.on("zoomanim",function(u){var g=ni,C=this._proxy.style[g];ze(this._proxy,this.project(u.center,u.zoom),this.getZoomScale(u.zoom,1)),C===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ge(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var c=this.getCenter(),u=this.getZoom();ze(this._proxy,this.project(c,u),this.getZoomScale(u,1))},_catchTransitionEnd:function(c){this._animatingZoom&&c.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(c,u,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(u-this._zoom)>this.options.zoomAnimationThreshold)return!1;var C=this.getZoomScale(u),w=this._getCenterOffset(c)._divideBy(1-1/C);return g.animate!==!0&&!this.getSize().contains(w)?!1:(B(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(c,u,!0)},this),!0)},_animateZoom:function(c,u,g,C){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=c,this._animateToZoom=u,re(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:c,zoom:u,noUpdate:C}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&me(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ms(c,u){return new ue(c,u)}var Ae=Z.extend({options:{position:"topright"},initialize:function(c){b(this,c)},getPosition:function(){return this.options.position},setPosition:function(c){var u=this._map;return u&&u.removeControl(this),this.options.position=c,u&&u.addControl(this),this},getContainer:function(){return this._container},addTo:function(c){this.remove(),this._map=c;var u=this._container=this.onAdd(c),g=this.getPosition(),C=c._controlCorners[g];return re(u,"leaflet-control"),g.indexOf("bottom")!==-1?C.insertBefore(u,C.firstChild):C.appendChild(u),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ge(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(c){this._map&&c&&c.screenX>0&&c.screenY>0&&this._map.getContainer().focus()}}),Pt=function(c){return new Ae(c)};ue.include({addControl:function(c){return c.addTo(this),this},removeControl:function(c){return c.remove(),this},_initControlPos:function(){var c=this._controlCorners={},u="leaflet-",g=this._controlContainer=he("div",u+"control-container",this._container);function C(w,P){var O=u+w+" "+u+P;c[w+P]=he("div",O,g)}C("top","left"),C("top","right"),C("bottom","left"),C("bottom","right")},_clearControlPos:function(){for(var c in this._controlCorners)ge(this._controlCorners[c]);ge(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ji=Ae.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(c,u,g,C){return g1,this._baseLayersList.style.display=c?"":"none"),this._separator.style.display=u&&c?"":"none",this},_onLayerChange:function(c){this._handlingClick||this._update();var u=this._getLayer(l(c.target)),g=u.overlay?c.type==="add"?"overlayadd":"overlayremove":c.type==="add"?"baselayerchange":null;g&&this._map.fire(g,u)},_createRadioElement:function(c,u){var g='",C=document.createElement("div");return C.innerHTML=g,C.firstChild},_addItem:function(c){var u=document.createElement("label"),g=this._map.hasLayer(c.layer),C;c.overlay?(C=document.createElement("input"),C.type="checkbox",C.className="leaflet-control-layers-selector",C.defaultChecked=g):C=this._createRadioElement("leaflet-base-layers_"+l(this),g),this._layerControlInputs.push(C),C.layerId=l(c.layer),ne(C,"click",this._onInputClick,this);var w=document.createElement("span");w.innerHTML=" "+c.name;var P=document.createElement("span");u.appendChild(P),P.appendChild(C),P.appendChild(w);var O=c.overlay?this._overlaysList:this._baseLayersList;return O.appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){if(!this._preventClick){var c=this._layerControlInputs,u,g,C=[],w=[];this._handlingClick=!0;for(var P=c.length-1;P>=0;P--)u=c[P],g=this._getLayer(u.layerId).layer,u.checked?C.push(g):u.checked||w.push(g);for(P=0;P=0;w--)u=c[w],g=this._getLayer(u.layerId).layer,u.disabled=g.options.minZoom!==void 0&&Cg.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var c=this._section;this._preventClick=!0,ne(c,"click",ye),this.expand();var u=this;setTimeout(function(){fe(c,"click",ye),u._preventClick=!1})}}),vs=function(c,u,g){return new Ji(c,u,g)},_i=Ae.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(c){var u="leaflet-control-zoom",g=he("div",u+" leaflet-bar"),C=this.options;return this._zoomInButton=this._createButton(C.zoomInText,C.zoomInTitle,u+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(C.zoomOutText,C.zoomOutTitle,u+"-out",g,this._zoomOut),this._updateDisabled(),c.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(c){c.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(c){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(c.shiftKey?3:1))},_createButton:function(c,u,g,C,w){var P=he("a",g,C);return P.innerHTML=c,P.href="#",P.title=u,P.setAttribute("role","button"),P.setAttribute("aria-label",u),Et(P),ne(P,"click",Ke),ne(P,"click",w,this),ne(P,"click",this._refocusOnMap,this),P},_updateDisabled:function(){var c=this._map,u="leaflet-disabled";me(this._zoomInButton,u),me(this._zoomOutButton,u),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||c._zoom===c.getMinZoom())&&(re(this._zoomOutButton,u),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||c._zoom===c.getMaxZoom())&&(re(this._zoomInButton,u),this._zoomInButton.setAttribute("aria-disabled","true"))}});ue.mergeOptions({zoomControl:!0}),ue.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new _i,this.addControl(this.zoomControl))});var Cs=function(c){return new _i(c)},en=Ae.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(c){var u="leaflet-control-scale",g=he("div",u),C=this.options;return this._addScales(C,u+"-line",g),c.on(C.updateWhenIdle?"moveend":"move",this._update,this),c.whenReady(this._update,this),g},onRemove:function(c){c.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(c,u,g){c.metric&&(this._mScale=he("div",u,g)),c.imperial&&(this._iScale=he("div",u,g))},_update:function(){var c=this._map,u=c.getSize().y/2,g=c.distance(c.containerPointToLatLng([0,u]),c.containerPointToLatLng([this.options.maxWidth,u]));this._updateScales(g)},_updateScales:function(c){this.options.metric&&c&&this._updateMetric(c),this.options.imperial&&c&&this._updateImperial(c)},_updateMetric:function(c){var u=this._getRoundNum(c),g=u<1e3?u+" m":u/1e3+" km";this._updateScale(this._mScale,g,u/c)},_updateImperial:function(c){var u=c*3.2808399,g,C,w;u>5280?(g=u/5280,C=this._getRoundNum(g),this._updateScale(this._iScale,C+" mi",C/g)):(w=this._getRoundNum(u),this._updateScale(this._iScale,w+" ft",w/u))},_updateScale:function(c,u,g){c.style.width=Math.round(this.options.maxWidth*g)+"px",c.innerHTML=u},_getRoundNum:function(c){var u=Math.pow(10,(Math.floor(c)+"").length-1),g=c/u;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,u*g}}),_s=function(c){return new en(c)},ys='',yi=Ae.extend({options:{position:"bottomright",prefix:''+(Q.inlineSvg?ys+" ":"")+"Leaflet"},initialize:function(c){b(this,c),this._attributions={}},onAdd:function(c){c.attributionControl=this,this._container=he("div","leaflet-control-attribution"),Et(this._container);for(var u in c._layers)c._layers[u].getAttribution&&this.addAttribution(c._layers[u].getAttribution());return this._update(),c.on("layeradd",this._addAttribution,this),this._container},onRemove:function(c){c.off("layeradd",this._addAttribution,this)},_addAttribution:function(c){c.layer.getAttribution&&(this.addAttribution(c.layer.getAttribution()),c.layer.once("remove",function(){this.removeAttribution(c.layer.getAttribution())},this))},setPrefix:function(c){return this.options.prefix=c,this._update(),this},addAttribution:function(c){return c?(this._attributions[c]||(this._attributions[c]=0),this._attributions[c]++,this._update(),this):this},removeAttribution:function(c){return c?(this._attributions[c]&&(this._attributions[c]--,this._update()),this):this},_update:function(){if(this._map){var c=[];for(var u in this._attributions)this._attributions[u]&&c.push(u);var g=[];this.options.prefix&&g.push(this.options.prefix),c.length&&g.push(c.join(", ")),this._container.innerHTML=g.join(' ')}}});ue.mergeOptions({attributionControl:!0}),ue.addInitHook(function(){this.options.attributionControl&&new yi().addTo(this)});var bs=function(c){return new yi(c)};Ae.Layers=Ji,Ae.Zoom=_i,Ae.Scale=en,Ae.Attribution=yi,Pt.layers=vs,Pt.zoom=Cs,Pt.scale=_s,Pt.attribution=bs;var xe=Z.extend({initialize:function(c){this._map=c},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xe.addTo=function(c,u){return c.addHandler(u,this),this};var ws={Events:$},tn=Q.touch?"touchstart mousedown":"mousedown",Ve=Y.extend({options:{clickTolerance:3},initialize:function(c,u,g,C){b(this,C),this._element=c,this._dragStartTarget=u||c,this._preventOutline=g},enable:function(){this._enabled||(ne(this._dragStartTarget,tn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ve._dragging===this&&this.finishDrag(!0),fe(this._dragStartTarget,tn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(c){if(this._enabled&&(this._moved=!1,!si(this._element,"leaflet-zoom-anim"))){if(c.touches&&c.touches.length!==1){Ve._dragging===this&&this.finishDrag();return}if(!(Ve._dragging||c.shiftKey||c.which!==1&&c.button!==1&&!c.touches)&&(Ve._dragging=this,this._preventOutline&&di(this._element),ai(),bt(),!this._moving)){this.fire("down");var u=c.touches?c.touches[0]:c,g=Ki(this._element);this._startPoint=new W(u.clientX,u.clientY),this._startPos=je(this._element),this._parentScale=ui(g);var C=c.type==="mousedown";ne(document,C?"mousemove":"touchmove",this._onMove,this),ne(document,C?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(c){if(this._enabled){if(c.touches&&c.touches.length>1){this._moved=!0;return}var u=c.touches&&c.touches.length===1?c.touches[0]:c,g=new W(u.clientX,u.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)P&&(O=I,P=k);P>g&&(u[O]=1,wi(c,u,g,C,O),wi(c,u,g,O,w))}function Ts(c,u){for(var g=[c[0]],C=1,w=0,P=c.length;Cu&&(g.push(c[C]),w=C);return wu.max.x&&(g|=2),c.yu.max.y&&(g|=8),g}function Rs(c,u){var g=u.x-c.x,C=u.y-c.y;return g*g+C*C}function Tt(c,u,g,C){var w=u.x,P=u.y,O=g.x-w,I=g.y-P,k=O*O+I*I,H;return k>0&&(H=((c.x-w)*O+(c.y-P)*I)/k,H>1?(w=g.x,P=g.y):H>0&&(w+=O*H,P+=I*H)),O=c.x-w,I=c.y-P,C?O*O+I*I:new W(w,P)}function Te(c){return!R(c[0])||typeof c[0][0]!="object"&&typeof c[0][0]<"u"}function un(c){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Te(c)}function hn(c,u){var g,C,w,P,O,I,k,H;if(!c||c.length===0)throw new Error("latlngs not passed");Te(c)||(console.warn("latlngs are not flat! Only the first ring will be used"),c=c[0]);var q=te([0,0]),ee=oe(c),le=ee.getNorthWest().distanceTo(ee.getSouthWest())*ee.getNorthEast().distanceTo(ee.getNorthWest());le<1700&&(q=bi(c));var we=c.length,_e=[];for(g=0;gC){k=(P-C)/w,H=[I.x-k*(I.x-O.x),I.y-k*(I.y-O.y)];break}var Ee=u.unproject(U(H));return te([Ee.lat+q.lat,Ee.lng+q.lng])}var As={__proto__:null,simplify:an,pointToSegmentDistance:ln,closestPointOnSegment:Es,clipSegment:dn,_getEdgeIntersection:Gt,_getBitCode:Ye,_sqClosestPointOnSegment:Tt,isFlat:Te,_flat:un,polylineCenter:hn},Si={project:function(c){return new W(c.lng,c.lat)},unproject:function(c){return new ie(c.y,c.x)},bounds:new se([-180,-90],[180,90])},Ei={R:6378137,R_MINOR:6356752314245179e-9,bounds:new se([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(c){var u=Math.PI/180,g=this.R,C=c.lat*u,w=this.R_MINOR/g,P=Math.sqrt(1-w*w),O=P*Math.sin(C),I=Math.tan(Math.PI/4-C/2)/Math.pow((1-O)/(1+O),P/2);return C=-g*Math.log(Math.max(I,1e-10)),new W(c.lng*u*g,C)},unproject:function(c){for(var u=180/Math.PI,g=this.R,C=this.R_MINOR/g,w=Math.sqrt(1-C*C),P=Math.exp(-c.y/g),O=Math.PI/2-2*Math.atan(P),I=0,k=.1,H;I<15&&Math.abs(k)>1e-7;I++)H=w*Math.sin(O),H=Math.pow((1-H)/(1+H),w/2),k=Math.PI/2-2*Math.atan(P*H)-O,O+=k;return new ie(O*u,c.x*u/g)}},Ds={__proto__:null,LonLat:Si,Mercator:Ei,SphericalMercator:dt},Os=s({},be,{code:"EPSG:3395",projection:Ei,transformation:function(){var c=.5/(Math.PI*Ei.R);return Be(c,.5,-c,.5)}()}),pn=s({},be,{code:"EPSG:4326",projection:Si,transformation:Be(1/180,1,-1/180,.5)}),Ms=s({},Se,{projection:Si,transformation:Be(1,0,-1,0),scale:function(c){return Math.pow(2,c)},zoom:function(c){return Math.log(c)/Math.LN2},distance:function(c,u){var g=u.lng-c.lng,C=u.lat-c.lat;return Math.sqrt(g*g+C*C)},infinite:!0});Se.Earth=be,Se.EPSG3395=Os,Se.EPSG3857=Xe,Se.EPSG900913=Zt,Se.EPSG4326=pn,Se.Simple=Ms;var De=Y.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(c){return c.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(c){return c&&c.removeLayer(this),this},getPane:function(c){return this._map.getPane(c?this.options[c]||c:this.options.pane)},addInteractiveTarget:function(c){return this._map._targets[l(c)]=this,this},removeInteractiveTarget:function(c){return delete this._map._targets[l(c)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(c){var u=c.target;if(u.hasLayer(this)){if(this._map=u,this._zoomAnimated=u._zoomAnimated,this.getEvents){var g=this.getEvents();u.on(g,this),this.once("remove",function(){u.off(g,this)},this)}this.onAdd(u),this.fire("add"),u.fire("layeradd",{layer:this})}}});ue.include({addLayer:function(c){if(!c._layerAdd)throw new Error("The provided object is not a Layer.");var u=l(c);return this._layers[u]?this:(this._layers[u]=c,c._mapToAdd=this,c.beforeAdd&&c.beforeAdd(this),this.whenReady(c._layerAdd,c),this)},removeLayer:function(c){var u=l(c);return this._layers[u]?(this._loaded&&c.onRemove(this),delete this._layers[u],this._loaded&&(this.fire("layerremove",{layer:c}),c.fire("remove")),c._map=c._mapToAdd=null,this):this},hasLayer:function(c){return l(c)in this._layers},eachLayer:function(c,u){for(var g in this._layers)c.call(u,this._layers[g]);return this},_addLayers:function(c){c=c?R(c)?c:[c]:[];for(var u=0,g=c.length;uthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&u[0]instanceof ie&&u[0].equals(u[g-1])&&u.pop(),u},_setLatLngs:function(c){Ie.prototype._setLatLngs.call(this,c),Te(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Te(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var c=this._renderer._bounds,u=this.options.weight,g=new W(u,u);if(c=new se(c.min.subtract(g),c.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(c))){if(this.options.noClip){this._parts=this._rings;return}for(var C=0,w=this._rings.length,P;Cc.y!=w.y>c.y&&c.x<(w.x-C.x)*(c.y-C.y)/(w.y-C.y)+C.x&&(u=!u);return u||Ie.prototype._containsPoint.call(this,c,!0)}});function Gs(c,u){return new rt(c,u)}var $e=Ne.extend({initialize:function(c,u){b(this,u),this._layers={},c&&this.addData(c)},addData:function(c){var u=R(c)?c:c.features,g,C,w;if(u){for(g=0,C=u.length;g0&&w.push(w[0].slice()),w}function at(c,u){return c.feature?s({},c.feature,{geometry:u}):jt(u)}function jt(c){return c.type==="Feature"||c.type==="FeatureCollection"?c:{type:"Feature",properties:{},geometry:c}}var Ai={toGeoJSON:function(c){return at(this,{type:"Point",coordinates:Ri(this.getLatLng(),c)})}};Vt.include(Ai),Pi.include(Ai),Ht.include(Ai),Ie.include({toGeoJSON:function(c){var u=!Te(this._latlngs),g=zt(this._latlngs,u?1:0,!1,c);return at(this,{type:(u?"Multi":"")+"LineString",coordinates:g})}}),rt.include({toGeoJSON:function(c){var u=!Te(this._latlngs),g=u&&!Te(this._latlngs[0]),C=zt(this._latlngs,g?2:u?1:0,!0,c);return u||(C=[C]),at(this,{type:(g?"Multi":"")+"Polygon",coordinates:C})}}),st.include({toMultiPoint:function(c){var u=[];return this.eachLayer(function(g){u.push(g.toGeoJSON(c).geometry.coordinates)}),at(this,{type:"MultiPoint",coordinates:u})},toGeoJSON:function(c){var u=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(u==="MultiPoint")return this.toMultiPoint(c);var g=u==="GeometryCollection",C=[];return this.eachLayer(function(w){if(w.toGeoJSON){var P=w.toGeoJSON(c);if(g)C.push(P.geometry);else{var O=jt(P);O.type==="FeatureCollection"?C.push.apply(C,O.features):C.push(O)}}}),g?at(this,{geometries:C,type:"GeometryCollection"}):{type:"FeatureCollection",features:C}}});function mn(c,u){return new $e(c,u)}var Vs=mn,Ut=De.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(c,u,g){this._url=c,this._bounds=oe(u),b(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(re(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ge(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(c){return this.options.opacity=c,this._image&&this._updateOpacity(),this},setStyle:function(c){return c.opacity&&this.setOpacity(c.opacity),this},bringToFront:function(){return this._map&&tt(this._image),this},bringToBack:function(){return this._map&&nt(this._image),this},setUrl:function(c){return this._url=c,this._image&&(this._image.src=c),this},setBounds:function(c){return this._bounds=oe(c),this._map&&this._reset(),this},getEvents:function(){var c={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(c.zoomanim=this._animateZoom),c},setZIndex:function(c){return this.options.zIndex=c,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var c=this._url.tagName==="IMG",u=this._image=c?this._url:he("img");if(re(u,"leaflet-image-layer"),this._zoomAnimated&&re(u,"leaflet-zoom-animated"),this.options.className&&re(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onload=r(this.fire,this,"load"),u.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),c){this._url=u.src;return}u.src=this._url,u.alt=this.options.alt},_animateZoom:function(c){var u=this._map.getZoomScale(c.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,c.zoom,c.center).min;ze(this._image,g,u)},_reset:function(){var c=this._image,u=new se(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=u.getSize();ve(c,u.min),c.style.width=g.x+"px",c.style.height=g.y+"px"},_updateOpacity:function(){Pe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var c=this.options.errorOverlayUrl;c&&this._url!==c&&(this._url=c,this._image.src=c)},getCenter:function(){return this._bounds.getCenter()}}),Hs=function(c,u,g){return new Ut(c,u,g)},vn=Ut.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var c=this._url.tagName==="VIDEO",u=this._image=c?this._url:he("video");if(re(u,"leaflet-image-layer"),this._zoomAnimated&&re(u,"leaflet-zoom-animated"),this.options.className&&re(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onloadeddata=r(this.fire,this,"load"),c){for(var g=u.getElementsByTagName("source"),C=[],w=0;w0?C:[u.src];return}R(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(u.style,"objectFit")&&(u.style.objectFit="fill"),u.autoplay=!!this.options.autoplay,u.loop=!!this.options.loop,u.muted=!!this.options.muted,u.playsInline=!!this.options.playsInline;for(var P=0;Pw?(u.height=w+"px",re(c,P)):me(c,P),this._containerWidth=this._container.offsetWidth},_animateZoom:function(c){var u=this._map._latLngToNewLayerPoint(this._latlng,c.zoom,c.center),g=this._getAnchor();ve(this._container,u.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var c=this._map,u=parseInt(yt(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+u,C=this._containerWidth,w=new W(this._containerLeft,-g-this._containerBottom);w._add(je(this._container));var P=c.layerPointToContainerPoint(w),O=U(this.options.autoPanPadding),I=U(this.options.autoPanPaddingTopLeft||O),k=U(this.options.autoPanPaddingBottomRight||O),H=c.getSize(),q=0,ee=0;P.x+C+k.x>H.x&&(q=P.x+C-H.x+k.x),P.x-q-I.x<0&&(q=P.x-I.x),P.y+g+k.y>H.y&&(ee=P.y+g-H.y+k.y),P.y-ee-I.y<0&&(ee=P.y-I.y),(q||ee)&&(this.options.keepInView&&(this._autopanning=!0),c.fire("autopanstart").panBy([q,ee]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),zs=function(c,u){return new Kt(c,u)};ue.mergeOptions({closePopupOnClick:!0}),ue.include({openPopup:function(c,u,g){return this._initOverlay(Kt,c,u,g).openOn(this),this},closePopup:function(c){return c=arguments.length?c:this._popup,c&&c.close(),this}}),De.include({bindPopup:function(c,u){return this._popup=this._initOverlay(Kt,this._popup,c,u),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(c){return this._popup&&(this instanceof Ne||(this._popup._source=this),this._popup._prepareOpen(c||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(c){return this._popup&&this._popup.setContent(c),this},getPopup:function(){return this._popup},_openPopup:function(c){if(!(!this._popup||!this._map)){Ke(c);var u=c.layer||c.target;if(this._popup._source===u&&!(u instanceof He)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(c.latlng);return}this._popup._source=u,this.openPopup(c.latlng)}},_movePopup:function(c){this._popup.setLatLng(c.latlng)},_onKeyPress:function(c){c.originalEvent.keyCode===13&&this._openPopup(c)}});var Yt=Fe.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(c){Fe.prototype.onAdd.call(this,c),this.setOpacity(this.options.opacity),c.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(c){Fe.prototype.onRemove.call(this,c),c.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var c=Fe.prototype.getEvents.call(this);return this.options.permanent||(c.preclick=this.close),c},_initLayout:function(){var c="leaflet-tooltip",u=c+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=he("div",u),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(c){var u,g,C=this._map,w=this._container,P=C.latLngToContainerPoint(C.getCenter()),O=C.layerPointToContainerPoint(c),I=this.options.direction,k=w.offsetWidth,H=w.offsetHeight,q=U(this.options.offset),ee=this._getAnchor();I==="top"?(u=k/2,g=H):I==="bottom"?(u=k/2,g=0):I==="center"?(u=k/2,g=H/2):I==="right"?(u=0,g=H/2):I==="left"?(u=k,g=H/2):O.xthis.options.maxZoom||gC?this._retainParent(w,P,O,C):!1)},_retainChildren:function(c,u,g,C){for(var w=2*c;w<2*c+2;w++)for(var P=2*u;P<2*u+2;P++){var O=new W(w,P);O.z=g+1;var I=this._tileCoordsToKey(O),k=this._tiles[I];if(k&&k.active){k.retain=!0;continue}else k&&k.loaded&&(k.retain=!0);g+1this.options.maxZoom||this.options.minZoom!==void 0&&w1){this._setView(c,g);return}for(var ee=w.min.y;ee<=w.max.y;ee++)for(var le=w.min.x;le<=w.max.x;le++){var we=new W(le,ee);if(we.z=this._tileZoom,!!this._isValidTile(we)){var _e=this._tiles[this._tileCoordsToKey(we)];_e?_e.current=!0:O.push(we)}}if(O.sort(function(Ee,ct){return Ee.distanceTo(P)-ct.distanceTo(P)}),O.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Re=document.createDocumentFragment();for(le=0;leg.max.x)||!u.wrapLat&&(c.yg.max.y))return!1}if(!this.options.bounds)return!0;var C=this._tileCoordsToBounds(c);return oe(this.options.bounds).overlaps(C)},_keyToBounds:function(c){return this._tileCoordsToBounds(this._keyToTileCoords(c))},_tileCoordsToNwSe:function(c){var u=this._map,g=this.getTileSize(),C=c.scaleBy(g),w=C.add(g),P=u.unproject(C,c.z),O=u.unproject(w,c.z);return[P,O]},_tileCoordsToBounds:function(c){var u=this._tileCoordsToNwSe(c),g=new ae(u[0],u[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(c){return c.x+":"+c.y+":"+c.z},_keyToTileCoords:function(c){var u=c.split(":"),g=new W(+u[0],+u[1]);return g.z=+u[2],g},_removeTile:function(c){var u=this._tiles[c];u&&(ge(u.el),delete this._tiles[c],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(c)}))},_initTile:function(c){re(c,"leaflet-tile");var u=this.getTileSize();c.style.width=u.x+"px",c.style.height=u.y+"px",c.onselectstart=p,c.onmousemove=p,Q.ielt9&&this.options.opacity<1&&Pe(c,this.options.opacity)},_addTile:function(c,u){var g=this._getTilePos(c),C=this._tileCoordsToKey(c),w=this.createTile(this._wrapCoords(c),r(this._tileReady,this,c));this._initTile(w),this.createTile.length<2&&B(r(this._tileReady,this,c,null,w)),ve(w,g),this._tiles[C]={el:w,coords:c,current:!0},u.appendChild(w),this.fire("tileloadstart",{tile:w,coords:c})},_tileReady:function(c,u,g){u&&this.fire("tileerror",{error:u,tile:g,coords:c});var C=this._tileCoordsToKey(c);g=this._tiles[C],g&&(g.loaded=+new Date,this._map._fadeAnimated?(Pe(g.el,0),K(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),u||(re(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:c})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Q.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(c){return c.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(c){var u=new W(this._wrapX?h(c.x,this._wrapX):c.x,this._wrapY?h(c.y,this._wrapY):c.y);return u.z=c.z,u},_pxBoundsToTileRange:function(c){var u=this.getTileSize();return new se(c.min.unscaleBy(u).floor(),c.max.unscaleBy(u).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var c in this._tiles)if(!this._tiles[c].loaded)return!1;return!0}});function Ks(c){return new At(c)}var lt=At.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(c,u){this._url=c,u=b(this,u),u.detectRetina&&Q.retina&&u.maxZoom>0?(u.tileSize=Math.floor(u.tileSize/2),u.zoomReverse?(u.zoomOffset--,u.minZoom=Math.min(u.maxZoom,u.minZoom+1)):(u.zoomOffset++,u.maxZoom=Math.max(u.minZoom,u.maxZoom-1)),u.minZoom=Math.max(0,u.minZoom)):u.zoomReverse?u.minZoom=Math.min(u.maxZoom,u.minZoom):u.maxZoom=Math.max(u.minZoom,u.maxZoom),typeof u.subdomains=="string"&&(u.subdomains=u.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(c,u){return this._url===c&&u===void 0&&(u=!0),this._url=c,u||this.redraw(),this},createTile:function(c,u){var g=document.createElement("img");return ne(g,"load",r(this._tileOnLoad,this,u,g)),ne(g,"error",r(this._tileOnError,this,u,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(c),g},getTileUrl:function(c){var u={r:Q.retina?"@2x":"",s:this._getSubdomain(c),x:c.x,y:c.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-c.y;this.options.tms&&(u.y=g),u["-y"]=g}return T(this._url,s(u,this.options))},_tileOnLoad:function(c,u){Q.ielt9?setTimeout(r(c,this,null,u),0):c(null,u)},_tileOnError:function(c,u,g){var C=this.options.errorTileUrl;C&&u.getAttribute("src")!==C&&(u.src=C),c(g,u)},_onTileRemove:function(c){c.tile.onload=null},_getZoomForUrl:function(){var c=this._tileZoom,u=this.options.maxZoom,g=this.options.zoomReverse,C=this.options.zoomOffset;return g&&(c=u-c),c+C},_getSubdomain:function(c){var u=Math.abs(c.x+c.y)%this.options.subdomains.length;return this.options.subdomains[u]},_abortLoading:function(){var c,u;for(c in this._tiles)if(this._tiles[c].coords.z!==this._tileZoom&&(u=this._tiles[c].el,u.onload=p,u.onerror=p,!u.complete)){u.src=D;var g=this._tiles[c].coords;ge(u),delete this._tiles[c],this.fire("tileabort",{tile:u,coords:g})}},_removeTile:function(c){var u=this._tiles[c];if(u)return u.el.setAttribute("src",D),At.prototype._removeTile.call(this,c)},_tileReady:function(c,u,g){if(!(!this._map||g&&g.getAttribute("src")===D))return At.prototype._tileReady.call(this,c,u,g)}});function yn(c,u){return new lt(c,u)}var bn=lt.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(c,u){this._url=c;var g=s({},this.defaultWmsParams);for(var C in u)C in this.options||(g[C]=u[C]);u=b(this,u);var w=u.detectRetina&&Q.retina?2:1,P=this.getTileSize();g.width=P.x*w,g.height=P.y*w,this.wmsParams=g},onAdd:function(c){this._crs=this.options.crs||c.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var u=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[u]=this._crs.code,lt.prototype.onAdd.call(this,c)},getTileUrl:function(c){var u=this._tileCoordsToNwSe(c),g=this._crs,C=pe(g.project(u[0]),g.project(u[1])),w=C.min,P=C.max,O=(this._wmsVersion>=1.3&&this._crs===pn?[w.y,w.x,P.y,P.x]:[w.x,w.y,P.x,P.y]).join(","),I=lt.prototype.getTileUrl.call(this,c);return I+S(this.wmsParams,I,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+O},setParams:function(c,u){return s(this.wmsParams,c),u||this.redraw(),this}});function Ys(c,u){return new bn(c,u)}lt.WMS=bn,yn.wms=Ys;var ke=De.extend({options:{padding:.1},initialize:function(c){b(this,c),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),re(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var c={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(c.zoomanim=this._onAnimZoom),c},_onAnimZoom:function(c){this._updateTransform(c.center,c.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(c,u){var g=this._map.getZoomScale(u,this._zoom),C=this._map.getSize().multiplyBy(.5+this.options.padding),w=this._map.project(this._center,u),P=C.multiplyBy(-g).add(w).subtract(this._map._getNewPixelOrigin(c,u));Q.any3d?ze(this._container,P,g):ve(this._container,P)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var c in this._layers)this._layers[c]._reset()},_onZoomEnd:function(){for(var c in this._layers)this._layers[c]._project()},_updatePaths:function(){for(var c in this._layers)this._layers[c]._update()},_update:function(){var c=this.options.padding,u=this._map.getSize(),g=this._map.containerPointToLayerPoint(u.multiplyBy(-c)).round();this._bounds=new se(g,g.add(u.multiplyBy(1+c*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),wn=ke.extend({options:{tolerance:0},getEvents:function(){var c=ke.prototype.getEvents.call(this);return c.viewprereset=this._onViewPreReset,c},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ke.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var c=this._container=document.createElement("canvas");ne(c,"mousemove",this._onMouseMove,this),ne(c,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ne(c,"mouseout",this._handleMouseOut,this),c._leaflet_disable_events=!0,this._ctx=c.getContext("2d")},_destroyContainer:function(){K(this._redrawRequest),delete this._ctx,ge(this._container),fe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var c;this._redrawBounds=null;for(var u in this._layers)c=this._layers[u],c._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ke.prototype._update.call(this);var c=this._bounds,u=this._container,g=c.getSize(),C=Q.retina?2:1;ve(u,c.min),u.width=C*g.x,u.height=C*g.y,u.style.width=g.x+"px",u.style.height=g.y+"px",Q.retina&&this._ctx.scale(2,2),this._ctx.translate(-c.min.x,-c.min.y),this.fire("update")}},_reset:function(){ke.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(c){this._updateDashArray(c),this._layers[l(c)]=c;var u=c._order={layer:c,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=u),this._drawLast=u,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(c){this._requestRedraw(c)},_removePath:function(c){var u=c._order,g=u.next,C=u.prev;g?g.prev=C:this._drawLast=C,C?C.next=g:this._drawFirst=g,delete c._order,delete this._layers[l(c)],this._requestRedraw(c)},_updatePath:function(c){this._extendRedrawBounds(c),c._project(),c._update(),this._requestRedraw(c)},_updateStyle:function(c){this._updateDashArray(c),this._requestRedraw(c)},_updateDashArray:function(c){if(typeof c.options.dashArray=="string"){var u=c.options.dashArray.split(/[, ]+/),g=[],C,w;for(w=0;w')}}catch{}return function(c){return document.createElement("<"+c+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),qs={_initContainer:function(){this._container=he("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ke.prototype._update.call(this),this.fire("update"))},_initPath:function(c){var u=c._container=Dt("shape");re(u,"leaflet-vml-shape "+(this.options.className||"")),u.coordsize="1 1",c._path=Dt("path"),u.appendChild(c._path),this._updateStyle(c),this._layers[l(c)]=c},_addPath:function(c){var u=c._container;this._container.appendChild(u),c.options.interactive&&c.addInteractiveTarget(u)},_removePath:function(c){var u=c._container;ge(u),c.removeInteractiveTarget(u),delete this._layers[l(c)]},_updateStyle:function(c){var u=c._stroke,g=c._fill,C=c.options,w=c._container;w.stroked=!!C.stroke,w.filled=!!C.fill,C.stroke?(u||(u=c._stroke=Dt("stroke")),w.appendChild(u),u.weight=C.weight+"px",u.color=C.color,u.opacity=C.opacity,C.dashArray?u.dashStyle=R(C.dashArray)?C.dashArray.join(" "):C.dashArray.replace(/( *, *)/g," "):u.dashStyle="",u.endcap=C.lineCap.replace("butt","flat"),u.joinstyle=C.lineJoin):u&&(w.removeChild(u),c._stroke=null),C.fill?(g||(g=c._fill=Dt("fill")),w.appendChild(g),g.color=C.fillColor||C.color,g.opacity=C.fillOpacity):g&&(w.removeChild(g),c._fill=null)},_updateCircle:function(c){var u=c._point.round(),g=Math.round(c._radius),C=Math.round(c._radiusY||g);this._setPath(c,c._empty()?"M0 0":"AL "+u.x+","+u.y+" "+g+","+C+" 0,"+65535*360)},_setPath:function(c,u){c._path.v=u},_bringToFront:function(c){tt(c._container)},_bringToBack:function(c){nt(c._container)}},qt=Q.vml?Dt:Mt,Ot=ke.extend({_initContainer:function(){this._container=qt("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qt("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ge(this._container),fe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ke.prototype._update.call(this);var c=this._bounds,u=c.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(u))&&(this._svgSize=u,g.setAttribute("width",u.x),g.setAttribute("height",u.y)),ve(g,c.min),g.setAttribute("viewBox",[c.min.x,c.min.y,u.x,u.y].join(" ")),this.fire("update")}},_initPath:function(c){var u=c._path=qt("path");c.options.className&&re(u,c.options.className),c.options.interactive&&re(u,"leaflet-interactive"),this._updateStyle(c),this._layers[l(c)]=c},_addPath:function(c){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(c._path),c.addInteractiveTarget(c._path)},_removePath:function(c){ge(c._path),c.removeInteractiveTarget(c._path),delete this._layers[l(c)]},_updatePath:function(c){c._project(),c._update()},_updateStyle:function(c){var u=c._path,g=c.options;u&&(g.stroke?(u.setAttribute("stroke",g.color),u.setAttribute("stroke-opacity",g.opacity),u.setAttribute("stroke-width",g.weight),u.setAttribute("stroke-linecap",g.lineCap),u.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?u.setAttribute("stroke-dasharray",g.dashArray):u.removeAttribute("stroke-dasharray"),g.dashOffset?u.setAttribute("stroke-dashoffset",g.dashOffset):u.removeAttribute("stroke-dashoffset")):u.setAttribute("stroke","none"),g.fill?(u.setAttribute("fill",g.fillColor||g.color),u.setAttribute("fill-opacity",g.fillOpacity),u.setAttribute("fill-rule",g.fillRule||"evenodd")):u.setAttribute("fill","none"))},_updatePoly:function(c,u){this._setPath(c,ut(c._parts,u))},_updateCircle:function(c){var u=c._point,g=Math.max(Math.round(c._radius),1),C=Math.max(Math.round(c._radiusY),1)||g,w="a"+g+","+C+" 0 1,0 ",P=c._empty()?"M0 0":"M"+(u.x-g)+","+u.y+w+g*2+",0 "+w+-g*2+",0 ";this._setPath(c,P)},_setPath:function(c,u){c._path.setAttribute("d",u)},_bringToFront:function(c){tt(c._path)},_bringToBack:function(c){nt(c._path)}});Q.vml&&Ot.include(qs);function En(c){return Q.svg||Q.vml?new Ot(c):null}ue.include({getRenderer:function(c){var u=c.options.renderer||this._getPaneRenderer(c.options.pane)||this.options.renderer||this._renderer;return u||(u=this._renderer=this._createRenderer()),this.hasLayer(u)||this.addLayer(u),u},_getPaneRenderer:function(c){if(c==="overlayPane"||c===void 0)return!1;var u=this._paneRenderers[c];return u===void 0&&(u=this._createRenderer({pane:c}),this._paneRenderers[c]=u),u},_createRenderer:function(c){return this.options.preferCanvas&&Sn(c)||En(c)}});var Pn=rt.extend({initialize:function(c,u){rt.prototype.initialize.call(this,this._boundsToLatLngs(c),u)},setBounds:function(c){return this.setLatLngs(this._boundsToLatLngs(c))},_boundsToLatLngs:function(c){return c=oe(c),[c.getSouthWest(),c.getNorthWest(),c.getNorthEast(),c.getSouthEast()]}});function Xs(c,u){return new Pn(c,u)}Ot.create=qt,Ot.pointsToPath=ut,$e.geometryToLayer=Wt,$e.coordsToLatLng=Ti,$e.coordsToLatLngs=Bt,$e.latLngToCoords=Ri,$e.latLngsToCoords=zt,$e.getFeature=at,$e.asFeature=jt,ue.mergeOptions({boxZoom:!0});var Tn=xe.extend({initialize:function(c){this._map=c,this._container=c._container,this._pane=c._panes.overlayPane,this._resetStateTimeout=0,c.on("unload",this._destroy,this)},addHooks:function(){ne(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){fe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ge(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(c){if(!c.shiftKey||c.which!==1&&c.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),bt(),ai(),this._startPoint=this._map.mouseEventToContainerPoint(c),ne(document,{contextmenu:Ke,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(c){this._moved||(this._moved=!0,this._box=he("div","leaflet-zoom-box",this._container),re(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(c);var u=new se(this._point,this._startPoint),g=u.getSize();ve(this._box,u.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(ge(this._box),me(this._container,"leaflet-crosshair")),wt(),li(),fe(document,{contextmenu:Ke,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(c){if(!(c.which!==1&&c.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var u=new ae(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(u).fire("boxzoomend",{boxZoomBounds:u})}},_onKeyDown:function(c){c.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ue.addInitHook("addHandler","boxZoom",Tn),ue.mergeOptions({doubleClickZoom:!0});var Rn=xe.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(c){var u=this._map,g=u.getZoom(),C=u.options.zoomDelta,w=c.originalEvent.shiftKey?g-C:g+C;u.options.doubleClickZoom==="center"?u.setZoom(w):u.setZoomAround(c.containerPoint,w)}});ue.addInitHook("addHandler","doubleClickZoom",Rn),ue.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var An=xe.extend({addHooks:function(){if(!this._draggable){var c=this._map;this._draggable=new Ve(c._mapPane,c._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),c.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),c.on("zoomend",this._onZoomEnd,this),c.whenReady(this._onZoomEnd,this))}re(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){me(this._map._container,"leaflet-grab"),me(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var c=this._map;if(c._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var u=oe(this._map.options.maxBounds);this._offsetLimit=pe(this._map.latLngToContainerPoint(u.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(u.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;c.fire("movestart").fire("dragstart"),c.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(c){if(this._map.options.inertia){var u=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(u),this._prunePositions(u)}this._map.fire("move",c).fire("drag",c)},_prunePositions:function(c){for(;this._positions.length>1&&c-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var c=this._map.getSize().divideBy(2),u=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=u.subtract(c).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(c,u){return c-(c-u)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var c=this._draggable._newPos.subtract(this._draggable._startPos),u=this._offsetLimit;c.xu.max.x&&(c.x=this._viscousLimit(c.x,u.max.x)),c.y>u.max.y&&(c.y=this._viscousLimit(c.y,u.max.y)),this._draggable._newPos=this._draggable._startPos.add(c)}},_onPreDragWrap:function(){var c=this._worldWidth,u=Math.round(c/2),g=this._initialWorldOffset,C=this._draggable._newPos.x,w=(C-u+g)%c+u-g,P=(C+u+g)%c-u-g,O=Math.abs(w+g)0?P:-P))-u;this._delta=0,this._startTime=null,O&&(c.options.scrollWheelZoom==="center"?c.setZoom(u+O):c.setZoomAround(this._lastMousePos,u+O))}});ue.addInitHook("addHandler","scrollWheelZoom",On);var Qs=600;ue.mergeOptions({tapHold:Q.touchNative&&Q.safari&&Q.mobile,tapTolerance:15});var Mn=xe.extend({addHooks:function(){ne(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){fe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(c){if(clearTimeout(this._holdTimeout),c.touches.length===1){var u=c.touches[0];this._startPos=this._newPos=new W(u.clientX,u.clientY),this._holdTimeout=setTimeout(r(function(){this._cancel(),this._isTapValid()&&(ne(document,"touchend",ye),ne(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",u))},this),Qs),ne(document,"touchend touchcancel contextmenu",this._cancel,this),ne(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function c(){fe(document,"touchend",ye),fe(document,"touchend touchcancel",c)},_cancel:function(){clearTimeout(this._holdTimeout),fe(document,"touchend touchcancel contextmenu",this._cancel,this),fe(document,"touchmove",this._onMove,this)},_onMove:function(c){var u=c.touches[0];this._newPos=new W(u.clientX,u.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(c,u){var g=new MouseEvent(c,{bubbles:!0,cancelable:!0,view:window,screenX:u.screenX,screenY:u.screenY,clientX:u.clientX,clientY:u.clientY});g._simulated=!0,u.target.dispatchEvent(g)}});ue.addInitHook("addHandler","tapHold",Mn),ue.mergeOptions({touchZoom:Q.touch,bounceAtZoomLimits:!0});var Ln=xe.extend({addHooks:function(){re(this._map._container,"leaflet-touch-zoom"),ne(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){me(this._map._container,"leaflet-touch-zoom"),fe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(c){var u=this._map;if(!(!c.touches||c.touches.length!==2||u._animatingZoom||this._zooming)){var g=u.mouseEventToContainerPoint(c.touches[0]),C=u.mouseEventToContainerPoint(c.touches[1]);this._centerPoint=u.getSize()._divideBy(2),this._startLatLng=u.containerPointToLatLng(this._centerPoint),u.options.touchZoom!=="center"&&(this._pinchStartLatLng=u.containerPointToLatLng(g.add(C)._divideBy(2))),this._startDist=g.distanceTo(C),this._startZoom=u.getZoom(),this._moved=!1,this._zooming=!0,u._stop(),ne(document,"touchmove",this._onTouchMove,this),ne(document,"touchend touchcancel",this._onTouchEnd,this),ye(c)}},_onTouchMove:function(c){if(!(!c.touches||c.touches.length!==2||!this._zooming)){var u=this._map,g=u.mouseEventToContainerPoint(c.touches[0]),C=u.mouseEventToContainerPoint(c.touches[1]),w=g.distanceTo(C)/this._startDist;if(this._zoom=u.getScaleZoom(w,this._startZoom),!u.options.bounceAtZoomLimits&&(this._zoomu.getMaxZoom()&&w>1)&&(this._zoom=u._limitZoom(this._zoom)),u.options.touchZoom==="center"){if(this._center=this._startLatLng,w===1)return}else{var P=g._add(C)._divideBy(2)._subtract(this._centerPoint);if(w===1&&P.x===0&&P.y===0)return;this._center=u.unproject(u.project(this._pinchStartLatLng,this._zoom).subtract(P),this._zoom)}this._moved||(u._moveStart(!0,!1),this._moved=!0),K(this._animRequest);var O=r(u._move,u,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(O,this,!0),ye(c)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,K(this._animRequest),fe(document,"touchmove",this._onTouchMove,this),fe(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});ue.addInitHook("addHandler","touchZoom",Ln),ue.BoxZoom=Tn,ue.DoubleClickZoom=Rn,ue.Drag=An,ue.Keyboard=Dn,ue.ScrollWheelZoom=On,ue.TapHold=Mn,ue.TouchZoom=Ln,t.Bounds=se,t.Browser=Q,t.CRS=Se,t.Canvas=wn,t.Circle=Pi,t.CircleMarker=Ht,t.Class=Z,t.Control=Ae,t.DivIcon=_n,t.DivOverlay=Fe,t.DomEvent=gs,t.DomUtil=ps,t.Draggable=Ve,t.Evented=Y,t.FeatureGroup=Ne,t.GeoJSON=$e,t.GridLayer=At,t.Handler=xe,t.Icon=ot,t.ImageOverlay=Ut,t.LatLng=ie,t.LatLngBounds=ae,t.Layer=De,t.LayerGroup=st,t.LineUtil=As,t.Map=ue,t.Marker=Vt,t.Mixin=ws,t.Path=He,t.Point=W,t.PolyUtil=Ss,t.Polygon=rt,t.Polyline=Ie,t.Popup=Kt,t.PosAnimation=Zi,t.Projection=Ds,t.Rectangle=Pn,t.Renderer=ke,t.SVG=Ot,t.SVGOverlay=Cn,t.TileLayer=lt,t.Tooltip=Yt,t.Transformation=We,t.Util=J,t.VideoOverlay=vn,t.bind=r,t.bounds=pe,t.canvas=Sn,t.circle=$s,t.circleMarker=Is,t.control=Pt,t.divIcon=Us,t.extend=s,t.featureGroup=xs,t.geoJSON=mn,t.geoJson=Vs,t.gridLayer=Ks,t.icon=Fs,t.imageOverlay=Hs,t.latLng=te,t.latLngBounds=oe,t.layerGroup=Ls,t.map=ms,t.marker=Ns,t.point=U,t.polygon=Gs,t.polyline=ks,t.popup=zs,t.rectangle=Xs,t.setOptions=b,t.stamp=l,t.svg=En,t.svgOverlay=Bs,t.tileLayer=yn,t.tooltip=js,t.transformation=Be,t.version=i,t.videoOverlay=Ws;var Zs=window.L;t.noConflict=function(){return window.L=Zs,this},window.L=t})})(leafletSrc,leafletSrc.exports);var leafletSrcExports=leafletSrc.exports;const L$1=getDefaultExportFromCjs(leafletSrcExports);function makeNull(n){return n==null||n===""?null:n}function exists(n,e=!1){return n!=null&&(n!==""||e)}function missing(n){return!exists(n)}function missingOrEmpty(n){return n==null||n.length===0}function toStringOrNull(n){return n!=null&&typeof n.toString=="function"?n.toString():null}function attrToNumber(n){if(n===void 0)return;if(n===null||n==="")return null;if(typeof n=="number")return isNaN(n)?void 0:n;const e=parseInt(n,10);return isNaN(e)?void 0:e}function attrToBoolean(n){if(n!==void 0)return n===null||n===""?!1:typeof n=="boolean"?n:/true/i.test(n)}function attrToString(n){if(!(n==null||n===""))return n}function jsonEquals(n,e){const t=n?JSON.stringify(n):null,i=e?JSON.stringify(e):null;return t===i}function defaultComparator(n,e,t=!1){const i=n==null,s=e==null;if(n&&n.toNumber&&(n=n.toNumber()),e&&e.toNumber&&(e=e.toNumber()),i&&s)return 0;if(i)return-1;if(s)return 1;function o(r,a){return r>a?1:re.push(t)),e}return Object.values(n)}const GenericUtils=Object.freeze(Object.defineProperty({__proto__:null,attrToBoolean,attrToNumber,attrToString,defaultComparator,exists,jsonEquals,makeNull,missing,missingOrEmpty,toStringOrNull,values},Symbol.toStringTag,{value:"Module"}));class ColumnKeyCreator{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t{if(e&&e.indexOf(s)>=0)return;const o=t[s];isNonNullObject(o)&&o.constructor===Object?i[s]=deepCloneDefinition(o):i[s]=o}),i}function getProperty(n,e){return n[e]}function setProperty(n,e,t){n[e]=t}function copyPropertiesIfPresent(n,e,...t){t.forEach(i=>copyPropertyIfPresent(n,e,i))}function copyPropertyIfPresent(n,e,t,i){const s=getProperty(n,t);s!==void 0&&setProperty(e,t,i?i(s):s)}function getAllKeysInObjects(n){const e={};return n.filter(t=>t!=null).forEach(t=>{Object.keys(t).forEach(i=>e[i]=null)}),Object.keys(e)}function getAllValuesInObject(n){if(!n)return[];const e=Object;if(typeof e.values=="function")return e.values(n);const t=[];for(const i in n)n.hasOwnProperty(i)&&n.propertyIsEnumerable(i)&&t.push(n[i]);return t}function mergeDeep(n,e,t=!0,i=!1){exists(e)&&iterateObject(e,(s,o)=>{let r=n[s];r!==o&&(i&&r==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(r={},n[s]=r),isNonNullObject(o)&&isNonNullObject(r)&&!Array.isArray(r)?mergeDeep(r,o,t,i):(t||o!==void 0)&&(n[s]=o))})}function missingOrEmptyObject(n){return missing(n)||Object.keys(n).length===0}function get(n,e,t){if(n==null)return t;const i=e.split(".");let s=n;for(;i.length>1;)if(s=s[i.shift()],s==null)return t;const o=s[i[0]];return o??t}function set(n,e,t){if(n==null)return;const i=e.split(".");let s=n;i.forEach((o,r)=>{s[o]||(s[o]={}),r{typeof n[r]=="object"&&!e.includes(r)&&(n[r]=void 0)});const i=Object.getPrototypeOf(n),s={},o=r=>`AG Grid: Grid API function ${r}() cannot be called as the grid has been destroyed. diff --git a/public/build/manifest.json b/public/build/manifest.json index 1443127241..5857d24240 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -1,57 +1,57 @@ { - "_create-empty-split-d82bb341.js": { - "file": "assets/create-empty-split-d82bb341.js", + "_create-empty-split-aae839d5.js": { + "file": "assets/create-empty-split-aae839d5.js", "imports": [ - "_vendor-cc723e37.js" + "_vendor-2609b2c9.js" ], - "integrity": "sha384-xqyk8VkCuWg3Pyh5tmtlOcjXCNVzHghsQICD/8eqKQqivrhLARahE2sHuw6SiZuK" + "integrity": "sha384-kUrPjqHkFqVzJQjH9DXySo3O27g0Jh9lAs8AJRf3MPN85968p9Du3UiQIZlTUPGc" }, - "_format-money-03f73825.js": { - "file": "assets/format-money-03f73825.js", + "_format-money-62afb78b.js": { + "file": "assets/format-money-62afb78b.js", "imports": [ - "_vendor-cc723e37.js" + "_vendor-2609b2c9.js" ], - "integrity": "sha384-zmpuSCeX+Xvs0IlpZqebAdDNiTGxuNaaFFWWEd6KF6sUQ2So61pu+jjH6RIkB3Pj" + "integrity": "sha384-TAio40YCcyMAfzXMbgBAmXaAeUHGFYD0n7FRC3hgtUuTUlGLnYrxZtDc0/ulWnPd" }, - "_get-10f1237b.js": { - "file": "assets/get-10f1237b.js", + "_get-5b4283ca.js": { + "file": "assets/get-5b4283ca.js", "imports": [ - "_format-money-03f73825.js" + "_format-money-62afb78b.js" ], - "integrity": "sha384-Qp3fLmVM9CLH0wJSAEvAjT1Q/TK7iIbVt4wNo9WCx04cEfMp+aXC49FqNYdUSVS8" + "integrity": "sha384-8G2j6ux1LVbsCSQQRonc1WDrDqdOxMoRJUeYlN1uMpZ/ui/8my/HGWOxFbLCStf3" }, - "_get-7f8692a5.js": { - "file": "assets/get-7f8692a5.js", + "_get-ea675e30.js": { + "file": "assets/get-ea675e30.js", "imports": [ - "_format-money-03f73825.js" + "_format-money-62afb78b.js" ], - "integrity": "sha384-Nu6mFNb909g9ZLzJpntU8cRhbRBwe8tWBcmxRJ5vt88JWYVdqqrPlvxHAwyG/3I+" + "integrity": "sha384-cdp/pfZrpvE6Rs9OyKGrNAEX4fKIl78uvKtlSQnphz3GkPJzMq01f/5+0sOF4xue" }, - "_parse-downloaded-splits-fb2d62df.js": { - "file": "assets/parse-downloaded-splits-fb2d62df.js", + "_parse-downloaded-splits-6b9adc20.js": { + "file": "assets/parse-downloaded-splits-6b9adc20.js", "imports": [ - "_create-empty-split-d82bb341.js", - "_vendor-cc723e37.js" + "_create-empty-split-aae839d5.js", + "_vendor-2609b2c9.js" ], - "integrity": "sha384-e2TYgrrrNUa1Khx6aS8Ai/mRtmiz8TPFLQZcZYz7OoOipiWHovDKven8sxIJmqkj" + "integrity": "sha384-5o93Kgc0sXYdoE/lS3IknfCFLno5CseAZ8y6HtDM5mkkg43y6DOTFcxIW3xuOPvb" }, - "_put-d747f13c.js": { - "file": "assets/put-d747f13c.js", + "_put-c9d3942f.js": { + "file": "assets/put-c9d3942f.js", "imports": [ - "_format-money-03f73825.js" + "_format-money-62afb78b.js" ], - "integrity": "sha384-m1RzGO6aYwXHYY7GIZAwxkr+70Iqu8hSxaMNWnXpQb2CB31CN5L2QqhSNBzvANc1" + "integrity": "sha384-jBUmdZ39Tp/GN4Zr3suYFGsrfKw3j3GJDvBo8vh0eRA2Pbwk2PLIE8TWhAXu6zR3" }, - "_splice-errors-into-transactions-e53c1920.js": { - "file": "assets/splice-errors-into-transactions-e53c1920.js", + "_splice-errors-into-transactions-528a3749.js": { + "file": "assets/splice-errors-into-transactions-528a3749.js", "imports": [ - "_format-money-03f73825.js", - "_get-7f8692a5.js", - "_vendor-cc723e37.js" + "_format-money-62afb78b.js", + "_get-5b4283ca.js", + "_vendor-2609b2c9.js" ], - "integrity": "sha384-SeZHC0EItDDobOAXWQwnZ76014a8Kn/UxN+X8zyf5ESIQ9yEnpH/PJqmt10lR+kh" + "integrity": "sha384-AuGtawK1GzB4IW0SN1e52QLD+A/tG/LKEDnodKNDU8rRZr9EeYnf6bOIbSemYm5A" }, - "_vendor-cc723e37.js": { + "_vendor-2609b2c9.js": { "assets": [ "assets/layers-1dbbe9d0.png", "assets/layers-2x-066daca8.png", @@ -60,8 +60,8 @@ "css": [ "assets/vendor-5c5099b4.css" ], - "file": "assets/vendor-cc723e37.js", - "integrity": "sha384-SBcU5qAqCE2yT4967bb7EkNvKlH48c6QqGE9S32LwfGECQA9k4nkyTlopJr0cmgR" + "file": "assets/vendor-2609b2c9.js", + "integrity": "sha384-dUB0xSeqzlyxX/anun8b4k38j63OmPyjAdpCLpuxq3A1CHRCnGMJswNn/NKzwhOS" }, "node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": { "file": "assets/fa-brands-400-5656d596.ttf", @@ -109,45 +109,45 @@ "integrity": "sha384-wg83fCOXjBtqzFAWhTL9Sd9vmLUNhfEEzfmNUX9zwv2igKlz/YQbdapF4ObdxF+R" }, "resources/assets/v2/pages/dashboard/dashboard.js": { - "file": "assets/dashboard-d1d540db.js", + "file": "assets/dashboard-5ef2eea4.js", "imports": [ - "_format-money-03f73825.js", - "_vendor-cc723e37.js", - "_get-10f1237b.js", - "_get-7f8692a5.js" + "_format-money-62afb78b.js", + "_vendor-2609b2c9.js", + "_get-ea675e30.js", + "_get-5b4283ca.js" ], "isEntry": true, "src": "resources/assets/v2/pages/dashboard/dashboard.js", - "integrity": "sha384-EG2YFwGswmDXurC8abNfvl04dS8utpeumKrlxYAOd1ZlLc4JUQ1AWG0cRKNCsb7U" + "integrity": "sha384-U59Ky3Sz6ruwvg1AfP8JjhiN9OMRcG8+Tzhyyu22rSPKTSop1CLyhsUmOCfM8YhT" }, "resources/assets/v2/pages/transactions/create.js": { - "file": "assets/create-af0e6c17.js", + "file": "assets/create-6378bb8a.js", "imports": [ - "_format-money-03f73825.js", - "_create-empty-split-d82bb341.js", - "_splice-errors-into-transactions-e53c1920.js", - "_vendor-cc723e37.js", - "_get-7f8692a5.js" + "_format-money-62afb78b.js", + "_create-empty-split-aae839d5.js", + "_splice-errors-into-transactions-528a3749.js", + "_vendor-2609b2c9.js", + "_get-5b4283ca.js" ], "isEntry": true, "src": "resources/assets/v2/pages/transactions/create.js", - "integrity": "sha384-SbUjMpGlNF36W0wZYbTQkpr7nb5fI1JpOtKp/oZB7d+KfcKNmdGIafsyu5hFw+3v" + "integrity": "sha384-MGu6/JpMYPxpIy/FqXPwlGo4LAGC3MB5dV9PtszBnijuB/3bl4lemzdsmM5NSRDI" }, "resources/assets/v2/pages/transactions/edit.js": { - "file": "assets/edit-a939c15a.js", + "file": "assets/edit-a6845b23.js", "imports": [ - "_format-money-03f73825.js", - "_get-10f1237b.js", - "_parse-downloaded-splits-fb2d62df.js", - "_splice-errors-into-transactions-e53c1920.js", - "_vendor-cc723e37.js", - "_create-empty-split-d82bb341.js", - "_put-d747f13c.js", - "_get-7f8692a5.js" + "_format-money-62afb78b.js", + "_get-ea675e30.js", + "_parse-downloaded-splits-6b9adc20.js", + "_splice-errors-into-transactions-528a3749.js", + "_vendor-2609b2c9.js", + "_create-empty-split-aae839d5.js", + "_put-c9d3942f.js", + "_get-5b4283ca.js" ], "isEntry": true, "src": "resources/assets/v2/pages/transactions/edit.js", - "integrity": "sha384-+e/kMTR2lpALsCeYoFbNh1ePnqaC56PrwtNMhbTlCGQmtxYiAMEOTH5jE+gAnqDN" + "integrity": "sha384-/O7vRaIUH+cd83DZccxnrXf8YYsg2KjC/d5C1q5qNeh+MuFVl4NFShMQvE3n5tZp" }, "resources/assets/v2/pages/transactions/index.css": { "file": "assets/index-badb0a41.css", @@ -158,16 +158,16 @@ "css": [ "assets/index-badb0a41.css" ], - "file": "assets/index-089e7bf2.js", + "file": "assets/index-78b5f723.js", "imports": [ - "_format-money-03f73825.js", - "_vendor-cc723e37.js", - "_get-10f1237b.js", - "_put-d747f13c.js" + "_format-money-62afb78b.js", + "_vendor-2609b2c9.js", + "_get-ea675e30.js", + "_put-c9d3942f.js" ], "isEntry": true, "src": "resources/assets/v2/pages/transactions/index.js", - "integrity": "sha384-LdFg7W8efK0nAmNDzVzSLaUnZ5JDpfcY7TCE5lYeh8RtvYeklsJZCJcbqbuUHint" + "integrity": "sha384-A/WqZ8EUl2gLfNfwuyfHiN61ME/6IT+OKaySatMo7qKgQ3mVan6PRkenaANbzYQH" }, "resources/assets/v2/pages/transactions/show.css": { "file": "assets/show-8b1429e5.css", @@ -178,17 +178,17 @@ "css": [ "assets/show-8b1429e5.css" ], - "file": "assets/show-7827ee8e.js", + "file": "assets/show-c2b3bd03.js", "imports": [ - "_format-money-03f73825.js", - "_vendor-cc723e37.js", - "_get-10f1237b.js", - "_parse-downloaded-splits-fb2d62df.js", - "_create-empty-split-d82bb341.js" + "_format-money-62afb78b.js", + "_vendor-2609b2c9.js", + "_get-ea675e30.js", + "_parse-downloaded-splits-6b9adc20.js", + "_create-empty-split-aae839d5.js" ], "isEntry": true, "src": "resources/assets/v2/pages/transactions/show.js", - "integrity": "sha384-IgbM4MiKR37X2FSkAG1AzDXGHnZccsdtSXNoDQ/2wVABwhL01ef9V7zCMWhhIJiu" + "integrity": "sha384-Cwohl3AO2jlS/+sY36BhwAFGmNhpWQZZZXsPVDd+a4a1jeJ0ScZBgxz8vtY+r4k0" }, "resources/assets/v2/sass/app.scss": { "file": "assets/app-fb7b26ec.css", diff --git a/resources/lang/bg_BG/firefly.php b/resources/lang/bg_BG/firefly.php index acf6a45804..99ae30928f 100644 --- a/resources/lang/bg_BG/firefly.php +++ b/resources/lang/bg_BG/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Налична е нова версия на Firefly III. Вие изпълнявате :your_version, последната версия е :new_version, която беше пусната на :date.', 'update_version_beta' => 'Това е BETA версия. Може да се натъкнете на проблеми.', 'update_version_alpha' => 'Това е ALPHA версия. Може да се натъкнете на проблеми.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Изпълнявате :version, която е най-новата налична версия.', 'update_newer_version_alert' => 'Изпълнявате: :your_version, която е по-нова от последната налична версия: :new_version.', 'update_check_error' => 'Възникна грешка при проверка за актуализации: :error', diff --git a/resources/lang/ca_ES/firefly.php b/resources/lang/ca_ES/firefly.php index 3e7680ff9e..27fedde31e 100644 --- a/resources/lang/ca_ES/firefly.php +++ b/resources/lang/ca_ES/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Hi ha una nova versió de Firefly III disponible. Estàs executant la versió :your_version, i l\'última versió és la :new_version que es va publicar el :date.', 'update_version_beta' => 'Aquesta és una versió BETA. Podries tenir problemes.', 'update_version_alpha' => 'Aquesta és una versió ALFA. Podries tenir problemes.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Estàs executant :version, que és l\'última versió disponible.', 'update_newer_version_alert' => 'Estàs executant :your_version, que és més nova que l\'última versió, :new_version.', 'update_check_error' => 'Ha succeït un error mentre es comprovaven les actualitzacions: :error', diff --git a/resources/lang/cs_CZ/firefly.php b/resources/lang/cs_CZ/firefly.php index 55d3271ae7..ef6073ce74 100644 --- a/resources/lang/cs_CZ/firefly.php +++ b/resources/lang/cs_CZ/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Je k dispozici nová verze Firefly III. Nyní provozujete verzi :your_version, nejnovější verze je :new_version, která byla vydaná :date.', 'update_version_beta' => 'Tato verze je BETA verze. Můžete narazit na problémy.', 'update_version_alpha' => 'Tato verze je ALFA verze. Můžete narazit na problémy.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Provozujete verzi :version, která je nejnovější dostupnou verzí.', 'update_newer_version_alert' => 'Používáte verzi :your_version, která je novější než poslední stabilní verze :new_version.', 'update_check_error' => 'Došlo k chybě při kontrole aktualizací: :error', diff --git a/resources/lang/da_DK/firefly.php b/resources/lang/da_DK/firefly.php index 69fef846dc..737465f339 100644 --- a/resources/lang/da_DK/firefly.php +++ b/resources/lang/da_DK/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'En ny version af Firefly III er tilgængelig. Du bruger :your_version, den nyeste version er :new_version, som blev udgivet den :date.', 'update_version_beta' => 'Denne version er en BETA version. Du kan løbe ind i problemer.', 'update_version_alpha' => 'Denne version er en ALPHA version. Du kan løbe ind i problemer.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Du bruger :version, som er den seneste tilgængelige udgivelse.', 'update_newer_version_alert' => 'Du bruger :your_version, som er nyere end den seneste udgivelse, :new_version.', 'update_check_error' => 'Der opstod en fejl under søgning efter opdateringer: :error', diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 8a46c03e86..f25fcc350c 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Eine neue Version von Firefly III ist verfügbar. Sie verwenden :your_version, die neueste Version ist :new_version, die am :date veröffentlicht wurde.', 'update_version_beta' => 'Seien Sie vorsichtig bei der Verwendung dieser BETA-Version. Sie könnte noch Fehler enthaltern.', 'update_version_alpha' => 'Seien Sie vorsichtig bei der Verwendung dieser APLPHA-Version. Sie kann Fehler enthaltern.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Sie verwenden Version :version. Dies ist die neueste verfügbare Version.', 'update_newer_version_alert' => 'Sie verwenden :your_version. Ihre Version ist neuer als die neueste Version (:new_version).', 'update_check_error' => 'Bei der Suche nach Aktualisierungen ist ein Fehler aufgetreten: :error', diff --git a/resources/lang/el_GR/firefly.php b/resources/lang/el_GR/firefly.php index 97aaca550d..160e63428a 100644 --- a/resources/lang/el_GR/firefly.php +++ b/resources/lang/el_GR/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Μία νέα έκδοση του Firefly III είναι διαθέσιμη. Έχετε την v:your_version, ενώ η τελευταία έκδοση είναι η v:new_version που κυκλοφόρησε στις :date.', 'update_version_beta' => 'Αυτή είναι μια BETA δοκιμαστική έκδοση. Μπορεί να συναντήσετε προβλήματα.', 'update_version_alpha' => 'Αυτή είναι μια ALPHA δοκιμαστική έκδοση. Μπορεί να συναντήσετε προβλήματα.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Έχετε την έκδοση v:version, που είναι η τελευταία διαθέσιμη.', 'update_newer_version_alert' => 'Έχετε την έκδοση v:your_version, που είναι νεότερη από την τελευταία έκδοση, v:new_version.', 'update_check_error' => 'Παρουσιάστηκε σφάλμα κατά τον έλεγχο για ενημερώσεις: :error', diff --git a/resources/lang/en_GB/firefly.php b/resources/lang/en_GB/firefly.php index c765a8473e..633e0b0d0a 100644 --- a/resources/lang/en_GB/firefly.php +++ b/resources/lang/en_GB/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.', 'update_version_beta' => 'This version is a BETA version. You may run into issues.', 'update_version_alpha' => 'This version is a ALPHA version. You may run into issues.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'You are running :version, which is the latest available release.', 'update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.', 'update_check_error' => 'An error occurred while checking for updates: :error', diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 851e1ea1f3..764fd2a74d 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Una nueva versión de Firefly III esta disponible. Estás usando :your_version, la ultima versión es :new_version que se lanzó en :date.', 'update_version_beta' => 'Esta versión es una versión BETA. Puede tener problemas.', 'update_version_alpha' => 'Esta versión es una versión de ALPHA. Puede tener problemas.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Estás usando :version, que es la última versión disponible.', 'update_newer_version_alert' => 'Estás usando :your_version, que es más reciente que la última versión, :new_version.', 'update_check_error' => 'Se ha producido un error al buscar actualizaciones: :error', diff --git a/resources/lang/fi_FI/firefly.php b/resources/lang/fi_FI/firefly.php index b62625ea3c..c2b1ba06b1 100644 --- a/resources/lang/fi_FI/firefly.php +++ b/resources/lang/fi_FI/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Firefly III:sta on julkaistu uusi versio. Käytät versiota :your_version, viimeisin versio :new_version on julkaistu :date.', 'update_version_beta' => 'Tämä on BETA versio. Saatat törmätä hankaluuksiin.', 'update_version_alpha' => 'Tämä on ALPHA versio. Saatat törmätä hankaluuksiin.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Käytät versiota :version, se on viimeisin julkaistu versio.', 'update_newer_version_alert' => 'Käytät versiota :your_version, joka on uudempi kuin viimeisin julkaistu versio, :new_version.', 'update_check_error' => 'Päivityksiä tarkistettaessa tapahtui virhe: :error', diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index 880f6ee7c9..ea7d20ff0f 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Une nouvelle version de Firefly III est disponible. Vous utilisez v:your_version. La dernière version v:new_version a été publiée le :date.', 'update_version_beta' => 'Cette version est une version BETA. Vous pouvez rencontrer des problèmes.', 'update_version_alpha' => 'Cette version est une version ALPHA. Vous pourriez rencontrer des problèmes.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Vous utilisez v:version, la dernière version disponible.', 'update_newer_version_alert' => 'Vous utilisez v:your_version, qui est plus récente que la dernière version, v:new_version.', 'update_check_error' => 'Une erreur est survenue lors de la vérification d\'une mise à jour : :error', diff --git a/resources/lang/hu_HU/firefly.php b/resources/lang/hu_HU/firefly.php index 16a4a3cea6..7db05ea58c 100644 --- a/resources/lang/hu_HU/firefly.php +++ b/resources/lang/hu_HU/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'A Firefly III új verziója elérhető. A jelenleg használt verzió :your_version, a legújabb verzió pedig :new_version, amely ekkor jelent meg: :date.', 'update_version_beta' => 'Ez egy BETA verzió. Előfordulhatnak problémák.', 'update_version_alpha' => 'Ez egy ALPHA verzió. Előfordulhatnak problémák.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'A jelenlegi verzió :version, ez egyben a legfrissebb elérhető verzió is.', 'update_newer_version_alert' => 'A jelenlegi verzió :your_version, amely újabb, mint a legfrissebb kiadott verzió, ami a :new_version.', 'update_check_error' => 'Hiba történt a frissítések ellenőrzése közben: :error', diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index 98a62ad8b1..478b488e9b 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.', 'update_version_beta' => 'This version is a BETA version. You may run into issues.', 'update_version_alpha' => 'This version is a ALPHA version. You may run into issues.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'You are running :version, which is the latest available release.', 'update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.', 'update_check_error' => 'An error occurred while checking for updates: :error', diff --git a/resources/lang/it_IT/firefly.php b/resources/lang/it_IT/firefly.php index 3f6055bef3..624cce97e6 100644 --- a/resources/lang/it_IT/firefly.php +++ b/resources/lang/it_IT/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'È disponibile una nuova versione di Firefly III. Stai utilizzando :your_version, l\'ultima versione è :new_version che è stata rilasciata il :date.', 'update_version_beta' => 'Questa versione è una versione BETA. Puoi avere problemi.', 'update_version_alpha' => 'Questa versione è una versione ALPHA. Puoi avere problemi.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Stai utilizzando :version, che è l\'ultima versione disponibile.', 'update_newer_version_alert' => 'Stai utilizzando :your_version, che è più recente dell\'ultima versione, :new_version.', 'update_check_error' => 'Si è verificato un errore durante il controllo degli aggiornamenti: :error', diff --git a/resources/lang/ja_JP/firefly.php b/resources/lang/ja_JP/firefly.php index 2156a19270..bcc4d906d3 100644 --- a/resources/lang/ja_JP/firefly.php +++ b/resources/lang/ja_JP/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Firefly III の新しいバージョンが利用可能です。あなたは現在 :your_version を実行していますが、最新バージョンは :date にリリースされた :new_version です。', 'update_version_beta' => 'このバージョンはベータ版です。問題が発生する可能性があります。', 'update_version_alpha' => 'このバージョンはアルファ版です。問題が発生する可能性があります。', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => '最新のリリースである :version を利用しています。', 'update_newer_version_alert' => '最新の :new_version よりも新しい :your_version を利用しています。', 'update_check_error' => 'アップデートの確認中にエラーが発生しました: :error', diff --git a/resources/lang/ko_KR/firefly.php b/resources/lang/ko_KR/firefly.php index 862c40c22d..5d45d62073 100644 --- a/resources/lang/ko_KR/firefly.php +++ b/resources/lang/ko_KR/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Firefly III의 새 버전을 사용할 수 있습니다. 현재 실행 중인 버전은 :your_version이며, 최신 버전은 :date에 릴리스된 :new_version입니다.', 'update_version_beta' => '이 버전은 베타 버전입니다. 문제가 발생할 수 있습니다.', 'update_version_alpha' => '이 버전은 알파 버전입니다. 문제가 발생할 수 있습니다.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => '사용 가능한 최신 릴리스인 :version을 실행 중입니다.', 'update_newer_version_alert' => '최신 릴리스인 :new_version보다 최신 버전인 :your_version을 실행중입니다.', 'update_check_error' => '업데이트 확인 중 오류가 발생했습니다: :error', diff --git a/resources/lang/nb_NO/firefly.php b/resources/lang/nb_NO/firefly.php index e2e2d9586a..bd9ae4113e 100644 --- a/resources/lang/nb_NO/firefly.php +++ b/resources/lang/nb_NO/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'En ny versjon av Firefly III er tilgjengelig. Du kjører :your_version, den nyeste versjonen er :new_version som ble utgitt den :date.', 'update_version_beta' => 'Dette er en BETA versjon, du kan oppleve problemer.', 'update_version_alpha' => 'Dette er en ALPHA versjon, du kan oppleve problemer.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Du kjører :version, som er den nyeste tilgjengelige utgivelsen.', 'update_newer_version_alert' => 'Du kjører :your_version, som er nyere enn den nyeste versjonen, :new_version.', 'update_check_error' => 'Det oppstod en feil under søk etter oppdatering: :error', diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 03c8a68af1..7fece2aa49 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Er is een nieuwe versie van Firefly III beschikbaar. Je gebruikt :your_version, de nieuwste versie is :new_version die werd uitgebracht op :date.', 'update_version_beta' => 'Dit is een BETA versie. Er kunnen bugs in zitten.', 'update_version_alpha' => 'Dit is een ALPHA versie. Er kunnen bugs in zitten.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Je gebruikt :version, de nieuwste beschikbare versie.', 'update_newer_version_alert' => 'Je gebruikt :your_version, wat nieuwer is dan de nieuwste versie, :new_version.', 'update_check_error' => 'Er is een fout opgetreden bij het controleren op updates: :error', diff --git a/resources/lang/nn_NO/firefly.php b/resources/lang/nn_NO/firefly.php index a3d66608af..a791f9572b 100644 --- a/resources/lang/nn_NO/firefly.php +++ b/resources/lang/nn_NO/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Ein ny versjon av Firefly III er tilgjengeleg. Du køyrer :your_version, den nyaste versjonen er :new_version som vart utgitt den :date.', 'update_version_beta' => 'Dette er ein BETA versjon, du kan oppleve problemer.', 'update_version_alpha' => 'Dette er ein ALPHA versjon, du kan oppleve problemer.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Du køyrer :version, som er den nyaste tilgjengelege utgjevinga.', 'update_newer_version_alert' => 'Du køyrer :your_version, som er nyare enn den nyaste versjonen, :new_version.', 'update_check_error' => 'Det oppstod ein feil under søk etter oppdatering: :error', diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index e400745cbf..63be886639 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -234,7 +234,7 @@ return [ // Webhooks 'webhooks' => 'Webhooki', 'webhooks_breadcrumb' => 'Webhooki', - 'webhooks_menu_disabled' => 'disabled', + 'webhooks_menu_disabled' => 'wyłączone', 'no_webhook_messages' => 'Brak wiadomości webhook', 'webhook_trigger_STORE_TRANSACTION' => 'Po utworzeniu transakcji', 'webhook_trigger_UPDATE_TRANSACTION' => 'Po zmodyfikowaniu transakcji', @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Dostępna jest nowa wersja Firefly III. Używasz wersji :your_version, najnowsza wersja to :new_version wydana :date.', 'update_version_beta' => 'Ta wersja jest wersją BETA. Możesz napotkać błędy.', 'update_version_alpha' => 'Ta wersja jest wersją ALPHA. Możesz napotkać błędy.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Używasz wersji :version, która jest najnowszą dostępną wersją.', 'update_newer_version_alert' => 'Używasz wersji :your_version, która jest nowsza niż najnowsza wersja, :new_version.', 'update_check_error' => 'Wystąpił błąd podczas sprawdzania aktualizacji :error', diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 86ce276019..6891a18773 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Uma nova versão do Firefly lll está disponível. Você está utilizando a versão :your_version, e a nova é a :new_version, que foi lançada no dia :date.', 'update_version_beta' => 'Esta versão é uma versão BETA. Você pode encontrar problemas.', 'update_version_alpha' => 'Esta versão é uma versão ALPHA. Você pode encontrar problemas.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Você está utilizando a versão :version, que é a última disponível.', 'update_newer_version_alert' => 'Você está utilizando a versão :your_version, que é mais nova do que a mais recente :new_version.', 'update_check_error' => 'Ocorreu um erro durante a verificação de atualizações: :error', diff --git a/resources/lang/pt_PT/firefly.php b/resources/lang/pt_PT/firefly.php index 614af846ee..8a514cbcd2 100644 --- a/resources/lang/pt_PT/firefly.php +++ b/resources/lang/pt_PT/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Está disponível uma versão nova do Firefly III. Está a usar a versão :your_version, a versão mais recente é :new_version que foi lançada em :date.', 'update_version_beta' => 'Esta versão é BETA. Pode ter problemas.', 'update_version_alpha' => 'Esta versão é ALPHA. Pode ter problemas.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Está a executar :version, que é a última versão disponível.', 'update_newer_version_alert' => 'Está a executar :your_version, que é mais recente que a última versão, :new_version.', 'update_check_error' => 'Ocorreu um erro durante a verificação de atualizações: :error', diff --git a/resources/lang/ro_RO/firefly.php b/resources/lang/ro_RO/firefly.php index fa77f66b22..d2d3c01299 100644 --- a/resources/lang/ro_RO/firefly.php +++ b/resources/lang/ro_RO/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'O nouă versiune de Firefly III este disponibilă. Dvs. aveți :your_version, ultima versiune este :new_version lansată în data de :date.', 'update_version_beta' => 'Această versiune este o versiune BETA. Este posibil să aveți probleme.', 'update_version_alpha' => 'Această versiune este o versiune ALFA. Este posibil să aveți probleme.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Aveți versiunea :version, care este ultima disponibilă.', 'update_newer_version_alert' => 'Aveți versiunea :your_version, care este mai nouă decât cea mai recentă versiune, :new_version.', 'update_check_error' => 'A apărut o eroare la verificarea actualizărilor: :error', diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index 852514648c..fc23e20d3a 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Доступна новая версия Firefly III. Вы используете версию v:your_version, самая свежая версия - v:new_version (выпущена :date).', 'update_version_beta' => 'Эта версия является БЕТА-версией. Вы можете столкнуться с проблемами.', 'update_version_alpha' => 'Эта версия является АЛЬФА-версией. Вы можете столкнуться с проблемами.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Вы используете v:version, которая является последним доступным релизом.', 'update_newer_version_alert' => 'Вы используете версию v:your_version, которая новее последнего релиза (v:new_version).', 'update_check_error' => 'Произошла ошибка при проверке обновлений: :error', diff --git a/resources/lang/sk_SK/firefly.php b/resources/lang/sk_SK/firefly.php index c0e4a20711..73e119bef0 100644 --- a/resources/lang/sk_SK/firefly.php +++ b/resources/lang/sk_SK/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Je dostupná nová verzia Firefly III. Pracujete s verziou :your_version, najnovšia verzia je :new_version zverejnená :date.', 'update_version_beta' => 'Toto je BETA verzia. Môžu sa vyskytnúť chyby.', 'update_version_alpha' => 'Toto je ALPHA verzia. Môžu sa vyskytnúť chyby.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Pracujete s verziou :version, čo je najnovšie dostupné vydanie.', 'update_newer_version_alert' => 'Pracujete s verziou :your_version, ktorá je novšia, než posledné vydanie, :new_version.', 'update_check_error' => 'Pri kontrole aktualizácii nastala chyba: :error', diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 46c05a4df6..4e332c505c 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Na voljo je nova različica Firefly III. Trenutno uporabljate :your_version, najnovejša različica pa je :new_version, izdana :date.', 'update_version_beta' => 'To je BETA verzija. Lahko naletite na težave.', 'update_version_alpha' => 'To je ALFA verzija. Lahko naletite na težave.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Uporabljate :version, ki je zadnja razpoložljiva izdaja.', 'update_newer_version_alert' => 'Uporabljate :your_version, ki je novejša od zadnje izdaje, :new_version.', 'update_check_error' => 'Pri preverjanju posodobitev smo naleteli na težavo: :error', diff --git a/resources/lang/sv_SE/firefly.php b/resources/lang/sv_SE/firefly.php index 6bd0f13fef..502ebcc24f 100644 --- a/resources/lang/sv_SE/firefly.php +++ b/resources/lang/sv_SE/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'En ny version av Firefly III är tillgänglig. Du har :your_version, den senaste är :new_version vilken släpptes :date.', 'update_version_beta' => 'Denna version är en BETA version. Det kan förekomma problem.', 'update_version_alpha' => 'Denna version är en ALPHA version. Det kan förekomma problem.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Du har :version, vilken är den senaste tillgängliga utgåva.', 'update_newer_version_alert' => 'Du har :your_version, vilken är nyare än senaste utgåva, :new_version.', 'update_check_error' => 'Ett fel inträffade vid sökning efter uppdateringar: :error', diff --git a/resources/lang/th_TH/firefly.php b/resources/lang/th_TH/firefly.php index 5fb28c4264..79bbf9c565 100644 --- a/resources/lang/th_TH/firefly.php +++ b/resources/lang/th_TH/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.', 'update_version_beta' => 'This version is a BETA version. You may run into issues.', 'update_version_alpha' => 'This version is a ALPHA version. You may run into issues.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'You are running :version, which is the latest available release.', 'update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.', 'update_check_error' => 'An error occurred while checking for updates: :error', diff --git a/resources/lang/tr_TR/firefly.php b/resources/lang/tr_TR/firefly.php index e053c653f6..054ff4b51d 100644 --- a/resources/lang/tr_TR/firefly.php +++ b/resources/lang/tr_TR/firefly.php @@ -309,6 +309,8 @@ return [ 'update_new_version_alert' => 'Firefly III\'ün yeni versiyonu mevcut. Şuan kullandığınız :your_version, son versiyon ise :date tarihinde yayınlanan :new_version versiyonu.', 'update_version_beta' => 'Bu bir BETA versiyonudur. Bazı hatalar ile karşılaşabilirsiniz.', 'update_version_alpha' => 'Bu bir ALPHA versiyonudur. Bazı hatalar ile karşılaşabilirsiniz.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'En son mevcut olan :version versiyonunu kullanıyorsunuz.', 'update_newer_version_alert' => 'Son mevcut olan :new_version versiyonundan daha yeni olan :your_version versiyonu kullanıyorsunuz.', 'update_check_error' => 'Güncellemeler kontrol edilirken bir hata oluştu: :error', diff --git a/resources/lang/uk_UA/firefly.php b/resources/lang/uk_UA/firefly.php index 51fb55d4cb..07c27b6170 100644 --- a/resources/lang/uk_UA/firefly.php +++ b/resources/lang/uk_UA/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Доступна нова версія Firefly III. Ви працюєте з :your_version, остання версія :new_version яка була випущена на :date.', 'update_version_beta' => 'Це бета-версія. Ви можете зіткнутися з проблемами.', 'update_version_alpha' => 'Це альфа-версія. Може містити баги та недоліки.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Ви працюєте в найновішій версії :version.', 'update_newer_version_alert' => 'Ви працюєте з :your_version версією, яка є новішою за останній реліз, :new_version.', 'update_check_error' => 'Сталася помилка під час перевірки наявності оновлень: :error', diff --git a/resources/lang/vi_VN/firefly.php b/resources/lang/vi_VN/firefly.php index 55d2675610..de7affd846 100644 --- a/resources/lang/vi_VN/firefly.php +++ b/resources/lang/vi_VN/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'Một phiên bản mới của Firefly III có sẵn. Bạn đang chạy :your_version, phiên bản mới nhất là :new_version được phát hành vào :date.', 'update_version_beta' => 'Phiên bản này là phiên bản BETA. Bạn có thể gặp vấn đề.', 'update_version_alpha' => 'Phiên bản này là phiên bản ALPHA. Bạn có thể gặp vấn đề.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'Bạn đang chạy :version , đây là phiên bản mới nhất có sẵn.', 'update_newer_version_alert' => 'Bạn đang chạy :your_version, mới hơn bản phát hành mới nhất , :new_version.', 'update_check_error' => 'Đã xảy ra lỗi trong khi kiểm tra cập nhật: :error', diff --git a/resources/lang/zh_CN/firefly.php b/resources/lang/zh_CN/firefly.php index 15ac484e87..80f41cb09f 100644 --- a/resources/lang/zh_CN/firefly.php +++ b/resources/lang/zh_CN/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => '发现可用的 Firefly III 新版本,您正在运行的版本是 :your_version,最新版本是 :new_version(发布于 :date)。', 'update_version_beta' => '此版本是 BETA 版本。您可能会遇到问题。', 'update_version_alpha' => '此版本是 ALPHA 版本。您可能会遇到问题。', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => '您正在运行 :version,这是最新的可用版本。', 'update_newer_version_alert' => '您正在运行 :your_version,它比最新发布的 :new_version 更新。', 'update_check_error' => '检查更新时发生错误::error', diff --git a/resources/lang/zh_TW/firefly.php b/resources/lang/zh_TW/firefly.php index 0645600738..64ab0cc817 100644 --- a/resources/lang/zh_TW/firefly.php +++ b/resources/lang/zh_TW/firefly.php @@ -308,6 +308,8 @@ return [ 'update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.', 'update_version_beta' => 'This version is a BETA version. You may run into issues.', 'update_version_alpha' => 'This version is a ALPHA version. You may run into issues.', + 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!', + 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.', 'update_current_version_alert' => 'You are running :version, which is the latest available release.', 'update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.', 'update_check_error' => 'An error occurred while checking for updates: :error',