From 935634e487ec3bfad8816057e0336c5f2317d282 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 6 Jan 2024 14:23:20 +0100 Subject: [PATCH 01/39] Sanity check on number. --- app/Http/Controllers/Budget/BudgetLimitController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Budget/BudgetLimitController.php b/app/Http/Controllers/Budget/BudgetLimitController.php index 7eade3fe56..a293e25fae 100644 --- a/app/Http/Controllers/Budget/BudgetLimitController.php +++ b/app/Http/Controllers/Budget/BudgetLimitController.php @@ -202,7 +202,9 @@ class BudgetLimitController extends Controller if ('' === $amount) { $amount = '0'; } - + if ((int)$amount > 268435456) { // 268 million, intentional integer + $amount = '268435456'; + } // sanity check on amount: if (0 === bccomp($amount, '0')) { $budgetId = $budgetLimit->budget_id; @@ -217,9 +219,7 @@ class BudgetLimitController extends Controller return response()->json($array); } - if ((int)$amount > 268435456) { // 268 million, intentional integer - $amount = '268435456'; - } + if (-1 === bccomp($amount, '0')) { $amount = bcmul($amount, '-1'); } From c19b36a39142c5f4a02631de94273871547638fd Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 6 Jan 2024 14:40:06 +0100 Subject: [PATCH 02/39] Fix https://github.com/firefly-iii/firefly-iii/issues/8352 --- .../Support/CreditRecalculateService.php | 65 ++++++++++++++----- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/app/Services/Internal/Support/CreditRecalculateService.php b/app/Services/Internal/Support/CreditRecalculateService.php index aef6a058d1..cdffb55f25 100644 --- a/app/Services/Internal/Support/CreditRecalculateService.php +++ b/app/Services/Internal/Support/CreditRecalculateService.php @@ -33,6 +33,7 @@ use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use Illuminate\Support\Facades\Log; /** * Class CreditRecalculateService @@ -104,7 +105,7 @@ class CreditRecalculateService $destination = $this->getDestinationAccount($journal); // destination or source must be liability. - $valid = config('firefly.valid_liabilities'); + $valid = config('firefly.valid_liabilities'); if (in_array($destination->accountType->type, $valid, true)) { $this->work[] = $destination; } @@ -127,7 +128,7 @@ class CreditRecalculateService private function getAccountByDirection(TransactionJournal $journal, string $direction): Account { /** @var null|Transaction $transaction */ - $transaction = $journal->transactions()->where('amount', $direction, '0')->first(); + $transaction = $journal->transactions()->where('amount', $direction, '0')->first(); if (null === $transaction) { throw new FireflyException(sprintf('Cannot find "%s"-transaction of journal #%d', $direction, $journal->id)); } @@ -179,12 +180,12 @@ class CreditRecalculateService $this->validateOpeningBalance($account, $openingBalance); } } - $startOfDebt = $this->repository->getOpeningBalanceAmount($account) ?? '0'; - $leftOfDebt = app('steam')->positive($startOfDebt); + $startOfDebt = $this->repository->getOpeningBalanceAmount($account) ?? '0'; + $leftOfDebt = app('steam')->positive($startOfDebt); app('log')->debug(sprintf('Start of debt is "%s", so initial left of debt is "%s"', app('steam')->bcround($startOfDebt, 2), app('steam')->bcround($leftOfDebt, 2))); /** @var AccountMetaFactory $factory */ - $factory = app(AccountMetaFactory::class); + $factory = app(AccountMetaFactory::class); // amount is positive or negative, doesn't matter. $factory->crud($account, 'start_of_debt', $startOfDebt); @@ -192,12 +193,11 @@ class CreditRecalculateService app('log')->debug(sprintf('Debt direction is "%s"', $direction)); // now loop all transactions (except opening balance and credit thing) - $transactions = $account->transactions() - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->orderBy('transaction_journals.date', 'ASC') - ->get(['transactions.*']) - ; - $total = $transactions->count(); + $transactions = $account->transactions() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->orderBy('transaction_journals.date', 'ASC') + ->get(['transactions.*']); + $total = $transactions->count(); app('log')->debug(sprintf('Found %d transaction(s) to process.', $total)); /** @var Transaction $transaction */ @@ -218,7 +218,7 @@ class CreditRecalculateService $source = $openingBalance->transactions()->where('amount', '<', 0)->first(); /** @var Transaction $dest */ - $dest = $openingBalance->transactions()->where('amount', '>', 0)->first(); + $dest = $openingBalance->transactions()->where('amount', '>', 0)->first(); if ($source->account_id !== $account->id) { app('log')->info(sprintf('Liability #%d has a reversed opening balance. Will fix this now.', $account->id)); app('log')->debug(sprintf('Source amount "%s" is now "%s"', $source->amount, app('steam')->positive($source->amount))); @@ -267,12 +267,13 @@ class CreditRecalculateService return $leftOfDebt; } + Log::debug(sprintf('Liability direction is "%s"', $direction)); // amount to use depends on the currency: - $usedAmount = $this->getAmountToUse($transaction, $accountCurrency, $foreignCurrency); - $isSameAccount = $account->id === $transaction->account_id; - $isDebit = 'debit' === $direction; - $isCredit = 'credit' === $direction; + $usedAmount = $this->getAmountToUse($transaction, $accountCurrency, $foreignCurrency); + $isSameAccount = $account->id === $transaction->account_id; + $isDebit = 'debit' === $direction; + $isCredit = 'credit' === $direction; if ($isSameAccount && $isCredit && $this->isWithdrawalIn($usedAmount, $type)) { // case 1 $usedAmount = app('steam')->positive($usedAmount); @@ -334,6 +335,20 @@ class CreditRecalculateService return $result; } + if ($isSameAccount && $isDebit && $this->isTransferIn($usedAmount, $type)) { // case 9 + $usedAmount = app('steam')->positive($usedAmount); + $result = bcadd($leftOfDebt, $usedAmount); + app('log')->debug(sprintf('Case 9 (transfer into debit liability, means you owe more): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); + return $result; + } + if ($isSameAccount && $isDebit && $this->isTransferOut($usedAmount, $type)) { // case 10 + $usedAmount = app('steam')->positive($usedAmount); + $result = bcsub($leftOfDebt, $usedAmount); + app('log')->debug(sprintf('Case 5 (transfer out of debit liability, means you owe less): %s - %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); + + return $result; + } + // in any other case, remove amount from left of debt. if (in_array($type, [TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::TRANSFER], true)) { $usedAmount = app('steam')->negative($usedAmount); @@ -400,7 +415,7 @@ class CreditRecalculateService * because the person is paying us back. * * case 7 - * if it's a credit ("I am owed") this increases the amount due. + * if it's a debit ("I owe") this increases the amount due. * because we are borrowing more money. */ private function isDepositOut(string $amount, string $transactionType): bool @@ -423,9 +438,25 @@ class CreditRecalculateService * case 5: transfer into loan (from other loan). * if it's a credit ("I am owed") this increases the amount due, * because the person has to pay more back. + * + * case 8: transfer into loan (from other loan). + * if it's a debit ("I owe") this decreases the amount due. + * because the person has to pay more back. */ private function isTransferIn(string $amount, string $transactionType): bool { return TransactionType::TRANSFER === $transactionType && 1 === bccomp($amount, '0'); } + + /** + * it's a transfer out of loan (from other loan) + * + * case 9 + * if it's a debit ("I owe") this decreases the amount due. + * because we remove money from the amount left to owe + */ + private function isTransferOut(string $amount, string $transactionType): bool + { + return TransactionType::DEPOSIT === $transactionType && -1 === bccomp($amount, '0'); + } } From f615b9c252e2125c821587e3512b8f856f43f78f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 6 Jan 2024 14:44:50 +0100 Subject: [PATCH 03/39] Fix https://github.com/firefly-iii/firefly-iii/issues/8352 --- .../Support/CreditRecalculateService.php | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/app/Services/Internal/Support/CreditRecalculateService.php b/app/Services/Internal/Support/CreditRecalculateService.php index cdffb55f25..37e51e2c60 100644 --- a/app/Services/Internal/Support/CreditRecalculateService.php +++ b/app/Services/Internal/Support/CreditRecalculateService.php @@ -105,7 +105,7 @@ class CreditRecalculateService $destination = $this->getDestinationAccount($journal); // destination or source must be liability. - $valid = config('firefly.valid_liabilities'); + $valid = config('firefly.valid_liabilities'); if (in_array($destination->accountType->type, $valid, true)) { $this->work[] = $destination; } @@ -128,7 +128,7 @@ class CreditRecalculateService private function getAccountByDirection(TransactionJournal $journal, string $direction): Account { /** @var null|Transaction $transaction */ - $transaction = $journal->transactions()->where('amount', $direction, '0')->first(); + $transaction = $journal->transactions()->where('amount', $direction, '0')->first(); if (null === $transaction) { throw new FireflyException(sprintf('Cannot find "%s"-transaction of journal #%d', $direction, $journal->id)); } @@ -180,12 +180,12 @@ class CreditRecalculateService $this->validateOpeningBalance($account, $openingBalance); } } - $startOfDebt = $this->repository->getOpeningBalanceAmount($account) ?? '0'; - $leftOfDebt = app('steam')->positive($startOfDebt); + $startOfDebt = $this->repository->getOpeningBalanceAmount($account) ?? '0'; + $leftOfDebt = app('steam')->positive($startOfDebt); app('log')->debug(sprintf('Start of debt is "%s", so initial left of debt is "%s"', app('steam')->bcround($startOfDebt, 2), app('steam')->bcround($leftOfDebt, 2))); /** @var AccountMetaFactory $factory */ - $factory = app(AccountMetaFactory::class); + $factory = app(AccountMetaFactory::class); // amount is positive or negative, doesn't matter. $factory->crud($account, 'start_of_debt', $startOfDebt); @@ -193,11 +193,12 @@ class CreditRecalculateService app('log')->debug(sprintf('Debt direction is "%s"', $direction)); // now loop all transactions (except opening balance and credit thing) - $transactions = $account->transactions() - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->orderBy('transaction_journals.date', 'ASC') - ->get(['transactions.*']); - $total = $transactions->count(); + $transactions = $account->transactions() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->orderBy('transaction_journals.date', 'ASC') + ->get(['transactions.*']) + ; + $total = $transactions->count(); app('log')->debug(sprintf('Found %d transaction(s) to process.', $total)); /** @var Transaction $transaction */ @@ -218,7 +219,7 @@ class CreditRecalculateService $source = $openingBalance->transactions()->where('amount', '<', 0)->first(); /** @var Transaction $dest */ - $dest = $openingBalance->transactions()->where('amount', '>', 0)->first(); + $dest = $openingBalance->transactions()->where('amount', '>', 0)->first(); if ($source->account_id !== $account->id) { app('log')->info(sprintf('Liability #%d has a reversed opening balance. Will fix this now.', $account->id)); app('log')->debug(sprintf('Source amount "%s" is now "%s"', $source->amount, app('steam')->positive($source->amount))); @@ -270,10 +271,10 @@ class CreditRecalculateService Log::debug(sprintf('Liability direction is "%s"', $direction)); // amount to use depends on the currency: - $usedAmount = $this->getAmountToUse($transaction, $accountCurrency, $foreignCurrency); - $isSameAccount = $account->id === $transaction->account_id; - $isDebit = 'debit' === $direction; - $isCredit = 'credit' === $direction; + $usedAmount = $this->getAmountToUse($transaction, $accountCurrency, $foreignCurrency); + $isSameAccount = $account->id === $transaction->account_id; + $isDebit = 'debit' === $direction; + $isCredit = 'credit' === $direction; if ($isSameAccount && $isCredit && $this->isWithdrawalIn($usedAmount, $type)) { // case 1 $usedAmount = app('steam')->positive($usedAmount); @@ -339,6 +340,7 @@ class CreditRecalculateService $usedAmount = app('steam')->positive($usedAmount); $result = bcadd($leftOfDebt, $usedAmount); app('log')->debug(sprintf('Case 9 (transfer into debit liability, means you owe more): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); + return $result; } if ($isSameAccount && $isDebit && $this->isTransferOut($usedAmount, $type)) { // case 10 From 4c30a7bc5536d1d25f1f2cc595e9430a4d49ac5b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 6 Jan 2024 17:24:54 +0100 Subject: [PATCH 04/39] Expand edit form. --- .../Transaction/EditController.php | 2 +- config/search.php | 1 + public/build/assets/edit-6247ff45.js | 1 - public/build/assets/edit-9f80420b.js | 1 + public/build/manifest.json | 4 +- .../assets/v2/pages/transactions/edit.js | 59 +++++++++++++------ .../shared/parse-downloaded-splits.js | 11 ++-- .../partials/form/transaction/tags.blade.php | 3 - 8 files changed, 52 insertions(+), 30 deletions(-) delete mode 100644 public/build/assets/edit-6247ff45.js create mode 100644 public/build/assets/edit-9f80420b.js diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index 1945f8ea7d..91dff1c221 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -106,7 +106,7 @@ class EditController extends Controller $optionalFields['location'] ??= false; $optionalFields['location'] = $optionalFields['location'] && true === config('firefly.enable_external_map'); - // map info: + // map info voor v2: $longitude = config('firefly.default_location.longitude'); $latitude = config('firefly.default_location.latitude'); $zoomLevel = config('firefly.default_location.zoom_level'); diff --git a/config/search.php b/config/search.php index dbbfce291e..021da929f3 100644 --- a/config/search.php +++ b/config/search.php @@ -132,6 +132,7 @@ return [ 'has_any_tag' => ['alias' => false, 'needs_context' => false], 'any_notes' => ['alias' => false, 'needs_context' => false], 'has_any_notes' => ['alias' => true, 'alias_for' => 'any_notes', 'needs_context' => false], + 'has_notes' => ['alias' => true, 'alias_for' => 'any_notes', 'needs_context' => false], 'any_external_url' => ['alias' => false, 'needs_context' => false], 'has_any_external_url' => ['alias' => true, 'alias_for' => 'any_external_url', 'needs_context' => false], 'has_no_attachments' => ['alias' => false, 'needs_context' => false], diff --git a/public/build/assets/edit-6247ff45.js b/public/build/assets/edit-6247ff45.js deleted file mode 100644 index 444f0366c1..0000000000 --- a/public/build/assets/edit-6247ff45.js +++ /dev/null @@ -1 +0,0 @@ -import{d as m,f as l,g as p,l as h}from"./get-c53daca3.js";import{f,l as _,I as y}from"./vendor-4332182f.js";import{G as b}from"./get-c2292133.js";import{e as w,f as r,g as v,s as C,h as S,i as A,l as D,a as x,b as L,c as B,j as k,k as c,m as d}from"./autocomplete-functions-31caaca5.js";function E(e){let o=[];for(let a in e)if(e.hasOwnProperty(a)){let t=e[a],n=w();n.bill_id=t.bill_id,n.budget_id=t.budget_id,n.category_name=t.category_name,n.piggy_bank_id=t.piggy_bank_id,n.book_date=t.book_date,n.due_date=t.due_date,n.interest_date=t.interest_date,n.invoice_date=t.invoice_date,n.payment_date=t.payment_date,n.process_date=t.process_date,n.external_url=t.external_url,n.internal_reference=t.internal_reference,n.notes=t.notes,n.tags=t.tags,n.amount=parseFloat(t.amount).toFixed(t.currency_decimal_places),n.currency_code=t.currency_code,t.foreign_amount!==null&&(n.forein_currency_code=t.foreign_currency_code,n.foreign_amount=parseFloat(t.foreign_amount).toFixed(t.foreign_currency_decimal_places)),n.date=f(new Date(t.date),"yyyy-MM-dd HH:mm"),n.description=t.description,n.destination_account={id:t.destination_id,name:t.destination_name,alpine_name:t.destination_name},n.source_account={id:t.source_id,name:t.source_name,alpine_name:t.source_name},t.latitude!==null&&(n.hasLocation=!0,n.latitude=t.latitude,n.longitude=t.longitude,n.zoomLevel=t.zoom_level),console.log("download:"),console.log(t),console.log("current:"),console.log(n),o.push(n)}return o}let i;const s=k();let P=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:[]},addedSplit(){setTimeout(()=>{const e=function(o,a,t){return o.name_with_balance+'
'+i.t("firefly.account_type_"+o.type)+""};r({selector:"input.ac-source",serverUrl:s.account,filters:this.filters.source,onRenderItem:e,onChange:v,onSelectItem:C}),console.log("ok"),console.log(this.entries[0].source_account.alpine_name),r({selector:"input.ac-dest",serverUrl:s.account,filters:this.filters.destination,onRenderItem:e,onChange:S,onSelectItem:A}),r({selector:"input.ac-category",serverUrl:s.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),r({selector:"input.ac-description",serverUrl:s.description,valueField:"id",labelField:"description",onChange:d,onSelectItem:d})},250)},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(e){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")},getTransactionGroup(){const e=window.location.href.split("/"),o=parseInt(e[e.length-1]);new b().show(o,{}).then(t=>{const n=t.data.data;this.groupProperties.id=parseInt(n.id),this.groupProperties.transactionType=n.attributes.transactions[0].type,this.groupProperties.title=n.attributes.title??n.attributes.transactions[0].description,this.entries=E(n.attributes.transactions),this.notifications.wait.show=!1}).then(()=>{setTimeout(()=>{_.init("select.ac-tags",{allowClear:!0,selected:[{label:"Bla bla",value:1,selected:!0}]})},250)})},init(){Promise.all([p("language","en_US")]).then(e=>{i=new y;const o=e[0].replace("-","_");i.locale=o,h(i,o).then(()=>{this.notifications.wait.show=!0,this.notifications.wait.text=i.t("firefly.wait_loading_transaction"),this.getTransactionGroup()})}),D().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}),x().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),L().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),B().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})}}},u={transactions:P,dates:m};function g(){Object.keys(u).forEach(e=>{console.log(`Loading page component "${e}"`);let o=u[e]();Alpine.data(e,()=>o)}),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/edit-9f80420b.js b/public/build/assets/edit-9f80420b.js new file mode 100644 index 0000000000..974f543643 --- /dev/null +++ b/public/build/assets/edit-9f80420b.js @@ -0,0 +1 @@ +import{d as h,f as l,g as p,l as m}from"./get-c53daca3.js";import{f,l as _,I as y}from"./vendor-4332182f.js";import{G as b}from"./get-c2292133.js";import{e as w,f as r,g as v,s as A,h as S,i as C,l as P,a as D,b as x,c as L,j as k,k as c,m as u}from"./autocomplete-functions-31caaca5.js";function B(e){let o=[];for(let i in e)if(e.hasOwnProperty(i)){let t=e[i],n=w();n.bill_id=t.bill_id,n.budget_id=t.budget_id,n.category_name=t.category_name,n.piggy_bank_id=t.piggy_bank_id,n.book_date=t.book_date,n.due_date=t.due_date,n.interest_date=t.interest_date,n.invoice_date=t.invoice_date,n.payment_date=t.payment_date,n.process_date=t.process_date,n.external_url=t.external_url,n.internal_reference=t.internal_reference,n.notes=t.notes,n.tags=t.tags,n.amount=parseFloat(t.amount).toFixed(t.currency_decimal_places),n.currency_code=t.currency_code,t.foreign_amount!==null&&(n.forein_currency_code=t.foreign_currency_code,n.foreign_amount=parseFloat(t.foreign_amount).toFixed(t.foreign_currency_decimal_places)),n.date=f(new Date(t.date),"yyyy-MM-dd HH:mm"),n.description=t.description,n.destination_account={id:t.destination_id,name:t.destination_name,type:t.destination_type,alpine_name:t.destination_name},n.source_account={id:t.source_id,name:t.source_name,type:t.source_type,alpine_name:t.source_name},t.latitude!==null&&(n.hasLocation=!0,n.latitude=t.latitude,n.longitude=t.longitude,n.zoomLevel=t.zoom_level),console.log(n.tags),o.push(n)}return o}let s;const a=k();let E=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:"edit",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:[]},addedSplit(){setTimeout(()=>{const e=function(o,i,t){return o.name_with_balance+'
'+s.t("firefly.account_type_"+o.type)+""};r({selector:"input.ac-source",serverUrl:a.account,filters:this.filters.source,onRenderItem:e,onChange:v,onSelectItem:A}),console.log("ok"),console.log(this.entries[0].source_account.alpine_name),r({selector:"input.ac-dest",serverUrl:a.account,filters:this.filters.destination,onRenderItem:e,onChange:S,onSelectItem:C}),r({selector:"input.ac-category",serverUrl:a.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),r({selector:"input.ac-description",serverUrl:a.description,valueField:"id",labelField:"description",onChange:u,onSelectItem:u})},250)},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(e){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(e){return console.log("at get tags "+e),console.log(this.entries[e].tags),this.entries[e].tags??[]},getTransactionGroup(){this.entries=[];const e=window.location.href.split("/"),o=parseInt(e[e.length-1]);new b().show(o,{}).then(t=>{const n=t.data.data;this.groupProperties.id=parseInt(n.id),this.groupProperties.transactionType=n.attributes.transactions[0].type,this.groupProperties.title=n.attributes.title??n.attributes.transactions[0].description,this.entries=B(n.attributes.transactions),this.notifications.wait.show=!1}).then(()=>{this.groupProperties.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[t].amount),this.filters.source.push(this.entries[t].source_account.type),this.filters.destination.push(this.entries[t].source_account.type));console.log(this.filters),setTimeout(()=>{_.init("select.ac-tags",{allowClear:!0,server:a.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:s.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}})},150)})},init(){Promise.all([p("language","en_US")]).then(e=>{s=new y;const o=e[0].replace("-","_");s.locale=o,m(s,o).then(()=>{this.notifications.wait.show=!0,this.notifications.wait.text=s.t("firefly.wait_loading_transaction"),this.getTransactionGroup()})}),P().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}),D().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),x().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),L().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})},changedAmount(e){const o=parseInt(e.target.dataset.index);this.entries[o].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[i].amount))}}},d={transactions:E,dates:h};function g(){Object.keys(d).forEach(e=>{console.log(`Loading page component "${e}"`);let o=d[e]();Alpine.data(e,()=>o)}),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/manifest.json b/public/build/manifest.json index c04e4d5a26..546faf87ef 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -101,7 +101,7 @@ "integrity": "sha384-wA/Z8Z+hNOuOA5ZTX8ShykEkdtfxX6dBZFLmmYmanfuUYEeY427OaNi956vrN6cy" }, "resources/assets/v2/pages/transactions/edit.js": { - "file": "assets/edit-6247ff45.js", + "file": "assets/edit-9f80420b.js", "imports": [ "_get-c53daca3.js", "_vendor-4332182f.js", @@ -110,7 +110,7 @@ ], "isEntry": true, "src": "resources/assets/v2/pages/transactions/edit.js", - "integrity": "sha384-hJTbJsS4rExaV2BGHmiZ/J/nm8RicxSfwzr7TDUe/nwtYOm8gWtmNxrDrsmyzAqS" + "integrity": "sha384-aDpFfamLQtUwfrOIPa3rZYGluWoOFUl+/HT5HVFqxc2Qa78DCqiUGsw20xsnPH71" }, "resources/assets/v2/sass/app.scss": { "file": "assets/app-fb7b26ec.css", diff --git a/resources/assets/v2/pages/transactions/edit.js b/resources/assets/v2/pages/transactions/edit.js index 7680a12835..5cd83d1e46 100644 --- a/resources/assets/v2/pages/transactions/edit.js +++ b/resources/assets/v2/pages/transactions/edit.js @@ -57,7 +57,6 @@ let transactions = function () { // transactions are stored in "entries": entries: [], - // state of the form is stored in formState: formStates: { loadingCurrencies: true, @@ -74,7 +73,8 @@ let transactions = function () { // form behaviour during transaction formBehaviour: { - formType: 'create', foreignCurrencyEnabled: true, + formType: 'edit', + foreignCurrencyEnabled: true, }, // form data (except transactions) is stored in formData @@ -180,9 +180,14 @@ let transactions = function () { } return formatMoney(this.groupProperties.totalAmount, this.entries[0].currency_code ?? 'EUR'); }, - + getTags(index) { + console.log('at get tags ' + index); + console.log(this.entries[index].tags); + return this.entries[index].tags ?? []; + }, getTransactionGroup() { + this.entries = []; const page = window.location.href.split('/'); const groupId = parseInt(page[page.length - 1]); const getter = new Get(); @@ -192,34 +197,39 @@ let transactions = function () { this.groupProperties.transactionType = data.attributes.transactions[0].type; this.groupProperties.title = data.attributes.title ?? data.attributes.transactions[0].description; this.entries = parseDownloadedSplits(data.attributes.transactions); - //console.log(this.entries); // remove waiting thing. this.notifications.wait.show = false; }).then(() => { - + this.groupProperties.totalAmount = 0; + for (let i in this.entries) { + if (this.entries.hasOwnProperty(i)) { + this.groupProperties.totalAmount = this.groupProperties.totalAmount + parseFloat(this.entries[i].amount); + this.filters.source.push(this.entries[i].source_account.type); + this.filters.destination.push(this.entries[i].source_account.type); + } + } + console.log(this.filters); setTimeout(() => { // render tags: Tags.init('select.ac-tags', { allowClear: true, - // server: urls.tag, - // liveServer: true, - // clearEnd: true, - selected: [{label:'Bla bla',value:1,selected:true}], - //allowNew: true, - //notFoundMessage: i18n.t('firefly.nothing_found'), - // noCache: true, - // fetchOptions: { - // headers: { - // 'X-CSRF-TOKEN': document.head.querySelector('meta[name="csrf-token"]').content - // } - // } + server: urls.tag, + liveServer: true, + clearEnd: true, + allowNew: true, + notFoundMessage: i18n.t('firefly.nothing_found'), + noCache: true, + fetchOptions: { + headers: { + 'X-CSRF-TOKEN': document.head.querySelector('meta[name="csrf-token"]').content + } + } }); - }, 250); + }, 150); }); }, - init() { // download translations and get the transaction group. Promise.all([getVariable('language', 'en_US')]).then((values) => { @@ -282,6 +292,17 @@ let transactions = function () { this.entries[event.detail.index].zoomLevel = event.detail.zoomLevel; }); }, + + changedAmount(e) { + const index = parseInt(e.target.dataset.index); + this.entries[index].amount = parseFloat(e.target.value); + this.groupProperties.totalAmount = 0; + for (let i in this.entries) { + if (this.entries.hasOwnProperty(i)) { + this.groupProperties.totalAmount = this.groupProperties.totalAmount + parseFloat(this.entries[i].amount); + } + } + } } } diff --git a/resources/assets/v2/pages/transactions/shared/parse-downloaded-splits.js b/resources/assets/v2/pages/transactions/shared/parse-downloaded-splits.js index 091bb3c7c4..eacee32453 100644 --- a/resources/assets/v2/pages/transactions/shared/parse-downloaded-splits.js +++ b/resources/assets/v2/pages/transactions/shared/parse-downloaded-splits.js @@ -66,12 +66,14 @@ export function parseDownloadedSplits(downloads) { current.destination_account = { id: download.destination_id, name: download.destination_name, + type: download.destination_type, alpine_name: download.destination_name, }; current.source_account = { id: download.source_id, name: download.source_name, + type: download.source_type, alpine_name: download.source_name, }; @@ -87,10 +89,11 @@ export function parseDownloadedSplits(downloads) { // longitude: null // piggy_bank_id: null // zoomLevel: null - console.log('download:'); - console.log(download); - console.log('current:'); - console.log(current); + // console.log('download:'); + // console.log(download); + // console.log('current:'); + // console.log(current); + console.log(current.tags); returnArray.push(current); } } diff --git a/resources/views/v2/partials/form/transaction/tags.blade.php b/resources/views/v2/partials/form/transaction/tags.blade.php index 3dfe00f9ff..4f2a55b3bc 100644 --- a/resources/views/v2/partials/form/transaction/tags.blade.php +++ b/resources/views/v2/partials/form/transaction/tags.blade.php @@ -10,9 +10,6 @@ :name="'tags['+index+'][]'" multiple> - From 8043c86942e91749b014f6b031898554298602f0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 6 Jan 2024 19:22:38 +0100 Subject: [PATCH 05/39] Update readme. --- readme.md | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/readme.md b/readme.md index 246e0a0af9..58163ce522 100644 --- a/readme.md +++ b/readme.md @@ -32,15 +32,14 @@ - [About Firefly III](#about-firefly-iii) - [Purpose](#purpose) -- [Need help?](#need-help) - [Features](#features) - [Who's it for?](#whos-it-for) - [The Firefly III eco-system](#the-firefly-iii-eco-system) - [Getting Started](#getting-started) - [Contributing](#contributing) - - [Support the development of Firefly III](#support-the-development-of-firefly-iii) +- [Support the development of Firefly III](#support-the-development-of-firefly-iii) - [License](#license) -- [Contact](#contact) +- [Do you need help, or do you want to get in touch?](#do-you-need-help-or-do-you-want-to-get-in-touch) - [Acknowledgements](#acknowledgements) @@ -69,18 +68,6 @@ By keeping track of your expenses and your income you can budget accordingly and You can read more about the purpose of Firefly III in the [documentation](https://docs.firefly-iii.org/). - -## Need help? - -If you need support using Firefly III or the associated tools, come find us! - -- [GitHub Discussions for questions and support](https://github.com/firefly-iii/firefly-iii/discussions/) -- [Gitter.im for a good chat and a quick answer](https://gitter.im/firefly-iii/firefly-iii) -- [GitHub Issues for bugs and issues](https://github.com/firefly-iii/firefly-iii/issues) -- Follow me around for news and updates on Mastodon - - - ## Features Firefly III is pretty feature packed. Some important stuff first: @@ -153,24 +140,33 @@ There is also a [security policy](https://github.com/firefly-iii/firefly-iii/sec [![CII Best Practices][bp-badge]][bp-url] -### Support the development of Firefly III + -If you like Firefly III and if it helps you save lots of money, why not send me a dime for every dollar saved! :tada: +## Support the development of Firefly III -OK that was a joke. If you feel Firefly III made your life better, consider contributing as a sponsor. Please check out my [Patreon](https://www.patreon.com/jc5) and [GitHub Sponsors](https://github.com/sponsors/JC5) page for more information. Thank you for considering donating to Firefly III! +If you like Firefly III and if it helps you save lots of money, why not send me a dime for every dollar saved! 🥳 + +OK that was a joke. If you feel Firefly III made your life better, please consider contributing as a sponsor. Please check out my [Patreon](https://www.patreon.com/jc5) and [GitHub Sponsors](https://github.com/sponsors/JC5) page for more information. You can also [buy me a ☕️ coffee at ko-fi.com](https://ko-fi.com/Q5Q5R4SH1). Thank you for your consideration. + + ## License This work [is licensed](https://github.com/firefly-iii/firefly-iii/blob/main/LICENSE) under the [GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.html). -## Contact + -You can contact me at [james@firefly-iii.org](mailto:james@firefly-iii.org), you may open an issue or contact me through the support channels: +## Do you need help, or do you want to get in touch? + +Do you want to contact me? You can email me at [james@firefly-iii.org](mailto:james@firefly-iii.org) or get in touch through one of the following support channels: + +- [GitHub Discussions](https://github.com/firefly-iii/firefly-iii/discussions/) for questions and support +- [Gitter.im](https://gitter.im/firefly-iii/firefly-iii) for a good chat and a quick answer +- [GitHub Issues](https://github.com/firefly-iii/firefly-iii/issues) for bugs and issues +- Mastodon for news and updates + + -- [GitHub Discussions for questions and support](https://github.com/firefly-iii/firefly-iii/discussions/) -- [Gitter.im for a good chat and a quick answer](https://gitter.im/firefly-iii/firefly-iii) -- [GitHub Issues for bugs and issues](https://github.com/firefly-iii/firefly-iii/issues) -- [Follow me around for news and updates on Mastodon](https://fosstodon.org/@ff3) ## Acknowledgements From 0d2ae8ae23e4dedcce466657a78fda74aac2b577 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 7 Jan 2024 07:02:28 +0100 Subject: [PATCH 06/39] Clean up languages [skip ci] --- package-lock.json | 135 ++++++++++++++---- package.json | 5 +- public/v2/i18n/bg.json | 35 +++++ public/v2/i18n/bg_BG.json | 37 ----- public/v2/i18n/ca.json | 35 +++++ public/v2/i18n/ca_ES.json | 37 ----- public/v2/i18n/cs.json | 35 +++++ public/v2/i18n/cs_CZ.json | 37 ----- public/v2/i18n/da.json | 35 +++++ public/v2/i18n/da_DK.json | 37 ----- public/v2/i18n/de.json | 35 +++++ public/v2/i18n/de_DE.json | 37 ----- public/v2/i18n/el.json | 35 +++++ public/v2/i18n/el_GR.json | 37 ----- public/v2/i18n/en-gb.json | 35 +++++ public/v2/i18n/en.json | 35 +++++ public/v2/i18n/en_GB.json | 37 ----- public/v2/i18n/en_US.json | 37 ----- public/v2/i18n/es.json | 35 +++++ public/v2/i18n/es_ES.json | 37 ----- public/v2/i18n/fi.json | 35 +++++ public/v2/i18n/fi_FI.json | 37 ----- public/v2/i18n/fr.json | 35 +++++ public/v2/i18n/fr_FR.json | 37 ----- public/v2/i18n/hu.json | 35 +++++ public/v2/i18n/hu_HU.json | 37 ----- public/v2/i18n/id.json | 35 +++++ public/v2/i18n/id_ID.json | 37 ----- public/v2/i18n/it.json | 35 +++++ public/v2/i18n/it_IT.json | 37 ----- public/v2/i18n/ja.json | 35 +++++ public/v2/i18n/ja_JP.json | 37 ----- public/v2/i18n/ko.json | 35 +++++ public/v2/i18n/ko_KR.json | 37 ----- public/v2/i18n/nb.json | 35 +++++ public/v2/i18n/nb_NO.json | 37 ----- public/v2/i18n/nl.json | 35 +++++ public/v2/i18n/nl_NL.json | 37 ----- public/v2/i18n/nn.json | 35 +++++ public/v2/i18n/nn_NO.json | 37 ----- public/v2/i18n/pl.json | 35 +++++ public/v2/i18n/pl_PL.json | 37 ----- public/v2/i18n/pt-br.json | 35 +++++ public/v2/i18n/pt.json | 35 +++++ public/v2/i18n/pt_BR.json | 37 ----- public/v2/i18n/pt_PT.json | 37 ----- public/v2/i18n/ro.json | 35 +++++ public/v2/i18n/ro_RO.json | 37 ----- public/v2/i18n/ru.json | 35 +++++ public/v2/i18n/ru_RU.json | 37 ----- public/v2/i18n/sk.json | 35 +++++ public/v2/i18n/sk_SK.json | 37 ----- public/v2/i18n/sl.json | 35 +++++ public/v2/i18n/sl_SI.json | 37 ----- public/v2/i18n/sv.json | 35 +++++ public/v2/i18n/sv_SE.json | 37 ----- public/v2/i18n/tr.json | 35 +++++ public/v2/i18n/tr_TR.json | 37 ----- public/v2/i18n/uk.json | 35 +++++ public/v2/i18n/uk_UA.json | 37 ----- public/v2/i18n/vi.json | 35 +++++ public/v2/i18n/vi_VN.json | 37 ----- public/v2/i18n/zh-cn.json | 35 +++++ public/v2/i18n/zh-tw.json | 35 +++++ public/v2/i18n/zh_CN.json | 37 ----- public/v2/i18n/zh_TW.json | 37 ----- resources/assets/v2/pages/dashboard/boxes.js | 1 - .../assets/v2/pages/dashboard/budgets.js | 29 ++-- .../assets/v2/pages/dashboard/dashboard.js | 40 +++--- .../assets/v2/pages/dashboard/piggies.js | 21 +-- resources/assets/v2/pages/dashboard/sankey.js | 34 ++--- .../v2/pages/dashboard/subscriptions.js | 34 ++--- resources/assets/v2/pages/shared/dates.js | 21 +-- .../assets/v2/pages/transactions/create.js | 28 ++-- .../assets/v2/pages/transactions/edit.js | 21 +-- .../assets/v2/support/load-translations.js | 49 +++++-- 76 files changed, 1355 insertions(+), 1367 deletions(-) create mode 100644 public/v2/i18n/bg.json delete mode 100644 public/v2/i18n/bg_BG.json create mode 100644 public/v2/i18n/ca.json delete mode 100644 public/v2/i18n/ca_ES.json create mode 100644 public/v2/i18n/cs.json delete mode 100644 public/v2/i18n/cs_CZ.json create mode 100644 public/v2/i18n/da.json delete mode 100644 public/v2/i18n/da_DK.json create mode 100644 public/v2/i18n/de.json delete mode 100644 public/v2/i18n/de_DE.json create mode 100644 public/v2/i18n/el.json delete mode 100644 public/v2/i18n/el_GR.json create mode 100644 public/v2/i18n/en-gb.json create mode 100644 public/v2/i18n/en.json delete mode 100644 public/v2/i18n/en_GB.json delete mode 100644 public/v2/i18n/en_US.json create mode 100644 public/v2/i18n/es.json delete mode 100644 public/v2/i18n/es_ES.json create mode 100644 public/v2/i18n/fi.json delete mode 100644 public/v2/i18n/fi_FI.json create mode 100644 public/v2/i18n/fr.json delete mode 100644 public/v2/i18n/fr_FR.json create mode 100644 public/v2/i18n/hu.json delete mode 100644 public/v2/i18n/hu_HU.json create mode 100644 public/v2/i18n/id.json delete mode 100644 public/v2/i18n/id_ID.json create mode 100644 public/v2/i18n/it.json delete mode 100644 public/v2/i18n/it_IT.json create mode 100644 public/v2/i18n/ja.json delete mode 100644 public/v2/i18n/ja_JP.json create mode 100644 public/v2/i18n/ko.json delete mode 100644 public/v2/i18n/ko_KR.json create mode 100644 public/v2/i18n/nb.json delete mode 100644 public/v2/i18n/nb_NO.json create mode 100644 public/v2/i18n/nl.json delete mode 100644 public/v2/i18n/nl_NL.json create mode 100644 public/v2/i18n/nn.json delete mode 100644 public/v2/i18n/nn_NO.json create mode 100644 public/v2/i18n/pl.json delete mode 100644 public/v2/i18n/pl_PL.json create mode 100644 public/v2/i18n/pt-br.json create mode 100644 public/v2/i18n/pt.json delete mode 100644 public/v2/i18n/pt_BR.json delete mode 100644 public/v2/i18n/pt_PT.json create mode 100644 public/v2/i18n/ro.json delete mode 100644 public/v2/i18n/ro_RO.json create mode 100644 public/v2/i18n/ru.json delete mode 100644 public/v2/i18n/ru_RU.json create mode 100644 public/v2/i18n/sk.json delete mode 100644 public/v2/i18n/sk_SK.json create mode 100644 public/v2/i18n/sl.json delete mode 100644 public/v2/i18n/sl_SI.json create mode 100644 public/v2/i18n/sv.json delete mode 100644 public/v2/i18n/sv_SE.json create mode 100644 public/v2/i18n/tr.json delete mode 100644 public/v2/i18n/tr_TR.json create mode 100644 public/v2/i18n/uk.json delete mode 100644 public/v2/i18n/uk_UA.json create mode 100644 public/v2/i18n/vi.json delete mode 100644 public/v2/i18n/vi_VN.json create mode 100644 public/v2/i18n/zh-cn.json create mode 100644 public/v2/i18n/zh-tw.json delete mode 100644 public/v2/i18n/zh_CN.json delete mode 100644 public/v2/i18n/zh_TW.json diff --git a/package-lock.json b/package-lock.json index 8fc9beee88..16d915a809 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,10 @@ "chartjs-adapter-date-fns": "^3.0.0", "chartjs-chart-sankey": "^0.12.0", "date-fns": "^3.0.6", - "i18n-js": "^4.3.2", + "i18next": "^23.7.16", + "i18next-chained-backend": "^4.6.2", + "i18next-http-backend": "^2.4.2", + "i18next-localstorage-backend": "^4.2.0", "leaflet": "^1.9.4", "store": "^2.0.12" }, @@ -27,6 +30,17 @@ "vite-plugin-manifest-sri": "^0.1.0" } }, + "node_modules/@babel/runtime": { + "version": "7.23.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.7.tgz", + "integrity": "sha512-w06OXVOFso7LcbzMiDGt+3X7Rh7Ho8MmgPoWU3rarH+8upf+wSU/grlGbWzQyr3DkdN6ZeuMFjpdwW0Q+HxobA==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", @@ -453,14 +467,6 @@ "proxy-from-env": "^1.1.0" } }, - "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -577,6 +583,14 @@ "node": ">= 0.8" } }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/date-fns": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.1.0.tgz", @@ -704,14 +718,50 @@ "node": ">= 6" } }, - "node_modules/i18n-js": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/i18n-js/-/i18n-js-4.3.2.tgz", - "integrity": "sha512-n8gbEbQEueym2/q2yrZk5/xKWjFcKtg3/Escw4JHSVWa8qtKqP8j7se3UjkRbHlO/REqFA0V/MG1q8tEfyHeOA==", + "node_modules/i18next": { + "version": "23.7.16", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.7.16.tgz", + "integrity": "sha512-SrqFkMn9W6Wb43ZJ9qrO6U2U4S80RsFMA7VYFSqp7oc7RllQOYDCdRfsse6A7Cq/V8MnpxKvJCYgM8++27n4Fw==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], "dependencies": { - "bignumber.js": "*", - "lodash": "*", - "make-plural": "*" + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/i18next-chained-backend": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/i18next-chained-backend/-/i18next-chained-backend-4.6.2.tgz", + "integrity": "sha512-2P092fR+nAPQlGzPUoIIxbwo7PTBqQYgLxwv1XhSTQUAUoelLo5LkX+FqRxxSDg9WEAsrc8+2WL6mJtMGIa6WQ==", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/i18next-http-backend": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/i18next-http-backend/-/i18next-http-backend-2.4.2.tgz", + "integrity": "sha512-wKrgGcaFQ4EPjfzBTjzMU0rbFTYpa0S5gv9N/d8WBmWS64+IgJb7cHddMvV+tUkse7vUfco3eVs2lB+nJhPo3w==", + "dependencies": { + "cross-fetch": "4.0.0" + } + }, + "node_modules/i18next-localstorage-backend": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/i18next-localstorage-backend/-/i18next-localstorage-backend-4.2.0.tgz", + "integrity": "sha512-vglEQF0AnLriX7dLA2drHnqAYzHxnLwWQzBDw8YxcIDjOvYZz5rvpal59Dq4In+IHNmGNM32YgF0TDjBT0fHmA==", + "dependencies": { + "@babel/runtime": "^7.22.15" } }, "node_modules/immutable": { @@ -783,16 +833,6 @@ "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==" }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/make-plural": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-7.3.0.tgz", - "integrity": "sha512-/K3BC0KIsO+WK2i94LkMPv3wslMrazrQhfi5We9fMbLlLjzoOSJWr7TAdupLlDWaJcWxwoNosBkhFDejiu5VDw==" - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -832,6 +872,25 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -905,6 +964,11 @@ "node": ">=8.10.0" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, "node_modules/rollup": { "version": "3.29.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", @@ -967,6 +1031,11 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/vite": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.1.tgz", @@ -1037,6 +1106,20 @@ "resolved": "https://registry.npmjs.org/vite-plugin-manifest-sri/-/vite-plugin-manifest-sri-0.1.0.tgz", "integrity": "sha512-m4gcEXwcA1MfCVYTLVHYsB03Xsc6L4VYfhxXmcYcS+rN3kTjuWkXMaA8OuOV1gFdi1bMJFkLTJCPciYApvCm/g==", "dev": true + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } } } } diff --git a/package.json b/package.json index 3fb7d5b3be..02fc28b89c 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,10 @@ "chartjs-adapter-date-fns": "^3.0.0", "chartjs-chart-sankey": "^0.12.0", "date-fns": "^3.0.6", - "i18n-js": "^4.3.2", + "i18next": "^23.7.16", + "i18next-chained-backend": "^4.6.2", + "i18next-http-backend": "^2.4.2", + "i18next-localstorage-backend": "^4.2.0", "leaflet": "^1.9.4", "store": "^2.0.12" } diff --git a/public/v2/i18n/bg.json b/public/v2/i18n/bg.json new file mode 100644 index 0000000000..b612727071 --- /dev/null +++ b/public/v2/i18n/bg.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "bg" + }, + "firefly": { + "spent": "\u041f\u043e\u0445\u0430\u0440\u0447\u0435\u043d\u0438", + "left": "\u041e\u0441\u0442\u0430\u043d\u0430\u043b\u0438", + "paid": "\u041f\u043b\u0430\u0442\u0435\u043d\u0438", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\u041d\u0435\u043f\u043b\u0430\u0442\u0435\u043d\u0438", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Suscripciones en el grupo \"%{title}\"", + "subscr_expected_x_times": "Se debe pagar %{amount} %{times} veces este periodo", + "overspent": "\u041f\u0440\u0435\u0440\u0430\u0437\u0445\u043e\u0434", + "money_flowing_in": "\u0412\u0445\u043e\u0434\u044f\u0449\u0438", + "money_flowing_out": "\u0418\u0437\u0445\u043e\u0434\u044f\u0449\u0438", + "category": "\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "\u0411\u044e\u0434\u0436\u0435\u0442", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "\u0414\u044a\u043b\u0433", + "account_type_Loan": "\u0417\u0430\u0435\u043c", + "account_type_Mortgage": "\u0418\u043f\u043e\u0442\u0435\u043a\u0430" + } +} \ No newline at end of file diff --git a/public/v2/i18n/bg_BG.json b/public/v2/i18n/bg_BG.json deleted file mode 100644 index 7872262eeb..0000000000 --- a/public/v2/i18n/bg_BG.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "bg_BG": { - "config": { - "html_language": "bg" - }, - "firefly": { - "spent": "\u041f\u043e\u0445\u0430\u0440\u0447\u0435\u043d\u0438", - "left": "\u041e\u0441\u0442\u0430\u043d\u0430\u043b\u0438", - "paid": "\u041f\u043b\u0430\u0442\u0435\u043d\u0438", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\u041d\u0435\u043f\u043b\u0430\u0442\u0435\u043d\u0438", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Suscripciones en el grupo \"%{title}\"", - "subscr_expected_x_times": "Se debe pagar %{amount} %{times} veces este periodo", - "overspent": "\u041f\u0440\u0435\u0440\u0430\u0437\u0445\u043e\u0434", - "money_flowing_in": "\u0412\u0445\u043e\u0434\u044f\u0449\u0438", - "money_flowing_out": "\u0418\u0437\u0445\u043e\u0434\u044f\u0449\u0438", - "category": "\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "\u0411\u044e\u0434\u0436\u0435\u0442", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "\u0414\u044a\u043b\u0433", - "account_type_Loan": "\u0417\u0430\u0435\u043c", - "account_type_Mortgage": "\u0418\u043f\u043e\u0442\u0435\u043a\u0430" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/ca.json b/public/v2/i18n/ca.json new file mode 100644 index 0000000000..48d81962a3 --- /dev/null +++ b/public/v2/i18n/ca.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "ca" + }, + "firefly": { + "spent": "Gastat", + "left": "Queda", + "paid": "Pagat", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Pendent de pagament", + "default_group_title_name_plain": "no agrupades", + "subscriptions_in_group": "Subscripcions al grup \"%{title}\"", + "subscr_expected_x_times": "S'espera que pagues %{amount} %{times} vegades aquest per\u00edode", + "overspent": "Gastat de m\u00e9s", + "money_flowing_in": "Entrant", + "money_flowing_out": "Eixint", + "category": "Categoria", + "unknown_category_plain": "Sense categoria", + "all_money": "Tots els teus diners", + "unknown_source_plain": "Compte font desconegut", + "unknown_dest_plain": "Compte de dest\u00ed desconegut", + "unknown_any_plain": "Compte desconegut", + "unknown_budget_plain": "Cap pressupost", + "stored_journal_js": "S'ha creat la transacci\u00f3 \"%{description}\" correctament", + "expense_account": "Compte de despeses", + "revenue_account": "Compte d'ingressos", + "budget": "Pressupost", + "account_type_Asset account": "Compte d'actius", + "account_type_Expense account": "Compte de despeses", + "account_type_Revenue account": "Compte d'ingressos", + "account_type_Debt": "Deute", + "account_type_Loan": "Cr\u00e8dit", + "account_type_Mortgage": "Hipoteca" + } +} \ No newline at end of file diff --git a/public/v2/i18n/ca_ES.json b/public/v2/i18n/ca_ES.json deleted file mode 100644 index 077f9ebef2..0000000000 --- a/public/v2/i18n/ca_ES.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "ca_ES": { - "config": { - "html_language": "ca" - }, - "firefly": { - "spent": "Gastat", - "left": "Queda", - "paid": "Pagat", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Pendent de pagament", - "default_group_title_name_plain": "no agrupades", - "subscriptions_in_group": "Subscripcions al grup \"%{title}\"", - "subscr_expected_x_times": "S'espera que pagues %{amount} %{times} vegades aquest per\u00edode", - "overspent": "Gastat de m\u00e9s", - "money_flowing_in": "Entrant", - "money_flowing_out": "Eixint", - "category": "Categoria", - "unknown_category_plain": "Sense categoria", - "all_money": "Tots els teus diners", - "unknown_source_plain": "Compte font desconegut", - "unknown_dest_plain": "Compte de dest\u00ed desconegut", - "unknown_any_plain": "Compte desconegut", - "unknown_budget_plain": "Cap pressupost", - "stored_journal_js": "S'ha creat la transacci\u00f3 \"%{description}\" correctament", - "expense_account": "Compte de despeses", - "revenue_account": "Compte d'ingressos", - "budget": "Pressupost", - "account_type_Asset account": "Compte d'actius", - "account_type_Expense account": "Compte de despeses", - "account_type_Revenue account": "Compte d'ingressos", - "account_type_Debt": "Deute", - "account_type_Loan": "Cr\u00e8dit", - "account_type_Mortgage": "Hipoteca" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/cs.json b/public/v2/i18n/cs.json new file mode 100644 index 0000000000..c7a49f98ae --- /dev/null +++ b/public/v2/i18n/cs.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "cs" + }, + "firefly": { + "spent": "Utraceno", + "left": "Zb\u00fdv\u00e1", + "paid": "Zaplaceno", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Nezaplaceno", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "P\u0159ekro\u010deny v\u00fddaje", + "money_flowing_in": "Vstup", + "money_flowing_out": "V\u00fdstup", + "category": "Kategorie", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Rozpo\u010det", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Dluh", + "account_type_Loan": "P\u016fj\u010dka", + "account_type_Mortgage": "Hypot\u00e9ka" + } +} \ No newline at end of file diff --git a/public/v2/i18n/cs_CZ.json b/public/v2/i18n/cs_CZ.json deleted file mode 100644 index dff54f3444..0000000000 --- a/public/v2/i18n/cs_CZ.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "cs_CZ": { - "config": { - "html_language": "cs" - }, - "firefly": { - "spent": "Utraceno", - "left": "Zb\u00fdv\u00e1", - "paid": "Zaplaceno", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Nezaplaceno", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "P\u0159ekro\u010deny v\u00fddaje", - "money_flowing_in": "Vstup", - "money_flowing_out": "V\u00fdstup", - "category": "Kategorie", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Rozpo\u010det", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Dluh", - "account_type_Loan": "P\u016fj\u010dka", - "account_type_Mortgage": "Hypot\u00e9ka" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/da.json b/public/v2/i18n/da.json new file mode 100644 index 0000000000..09a1e6c1de --- /dev/null +++ b/public/v2/i18n/da.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "da" + }, + "firefly": { + "spent": "Spent", + "left": "Left", + "paid": "Paid", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Ubetalt", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Overspent", + "money_flowing_in": "In", + "money_flowing_out": "Ud", + "category": "Kategori", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budget", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "G\u00e6ld", + "account_type_Loan": "L\u00e5n", + "account_type_Mortgage": "Pant" + } +} \ No newline at end of file diff --git a/public/v2/i18n/da_DK.json b/public/v2/i18n/da_DK.json deleted file mode 100644 index 3d762da958..0000000000 --- a/public/v2/i18n/da_DK.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "da_DK": { - "config": { - "html_language": "da" - }, - "firefly": { - "spent": "Spent", - "left": "Left", - "paid": "Paid", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Ubetalt", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Overspent", - "money_flowing_in": "In", - "money_flowing_out": "Ud", - "category": "Kategori", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budget", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "G\u00e6ld", - "account_type_Loan": "L\u00e5n", - "account_type_Mortgage": "Pant" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/de.json b/public/v2/i18n/de.json new file mode 100644 index 0000000000..b7a1be45a4 --- /dev/null +++ b/public/v2/i18n/de.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "de" + }, + "firefly": { + "spent": "Ausgegeben", + "left": "\u00dcbrig", + "paid": "Bezahlt", + "errors_submission": "Problem bei der \u00dcbermittlung. Bitte \u00fcberpr\u00fcfen Sie die nachfolgenden Fehler: %{errorMessage}", + "unpaid": "Unbezahlt", + "default_group_title_name_plain": "ungruppiert", + "subscriptions_in_group": "Abonnements in Gruppe \"%{title}\"", + "subscr_expected_x_times": "Die Zahlung von %{amount} wird in diesem Zeitraum %{times}-mal erwartet", + "overspent": "Zuviel ausgegeben", + "money_flowing_in": "Eingehend", + "money_flowing_out": "Ausgehend", + "category": "Kategorie", + "unknown_category_plain": "Keine Kategorie", + "all_money": "All Ihr Geld", + "unknown_source_plain": "Unbekanntes Quellkonto", + "unknown_dest_plain": "Unbekanntes Zielkonto", + "unknown_any_plain": "Unbekanntes Konto", + "unknown_budget_plain": "Kein Budget", + "stored_journal_js": "Neue Buchung \u201e%{description}\u201d erfolgreich erstellt", + "expense_account": "Ausgabenkonto", + "revenue_account": "Einnahmekonto", + "budget": "Budget", + "account_type_Asset account": "Bestandskonto", + "account_type_Expense account": "Ausgabenkonto", + "account_type_Revenue account": "Einnahmenkonto", + "account_type_Debt": "Schuld", + "account_type_Loan": "Darlehen", + "account_type_Mortgage": "Hypothek" + } +} \ No newline at end of file diff --git a/public/v2/i18n/de_DE.json b/public/v2/i18n/de_DE.json deleted file mode 100644 index 4093c5941d..0000000000 --- a/public/v2/i18n/de_DE.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "de_DE": { - "config": { - "html_language": "de" - }, - "firefly": { - "spent": "Ausgegeben", - "left": "\u00dcbrig", - "paid": "Bezahlt", - "errors_submission": "Problem bei der \u00dcbermittlung. Bitte \u00fcberpr\u00fcfen Sie die nachfolgenden Fehler: %{errorMessage}", - "unpaid": "Unbezahlt", - "default_group_title_name_plain": "ungruppiert", - "subscriptions_in_group": "Abonnements in Gruppe \"%{title}\"", - "subscr_expected_x_times": "Die Zahlung von %{amount} wird in diesem Zeitraum %{times}-mal erwartet", - "overspent": "Zuviel ausgegeben", - "money_flowing_in": "Eingehend", - "money_flowing_out": "Ausgehend", - "category": "Kategorie", - "unknown_category_plain": "Keine Kategorie", - "all_money": "All Ihr Geld", - "unknown_source_plain": "Unbekanntes Quellkonto", - "unknown_dest_plain": "Unbekanntes Zielkonto", - "unknown_any_plain": "Unbekanntes Konto", - "unknown_budget_plain": "Kein Budget", - "stored_journal_js": "Neue Buchung \u201e%{description}\u201d erfolgreich erstellt", - "expense_account": "Ausgabenkonto", - "revenue_account": "Einnahmekonto", - "budget": "Budget", - "account_type_Asset account": "Bestandskonto", - "account_type_Expense account": "Ausgabenkonto", - "account_type_Revenue account": "Einnahmenkonto", - "account_type_Debt": "Schuld", - "account_type_Loan": "Darlehen", - "account_type_Mortgage": "Hypothek" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/el.json b/public/v2/i18n/el.json new file mode 100644 index 0000000000..73713a6c08 --- /dev/null +++ b/public/v2/i18n/el.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "el" + }, + "firefly": { + "spent": "\u0394\u03b1\u03c0\u03b1\u03bd\u03ae\u03b8\u03b7\u03ba\u03b1\u03bd", + "left": "\u0391\u03c0\u03bf\u03bc\u03ad\u03bd\u03bf\u03c5\u03bd", + "paid": "\u03a0\u03bb\u03b7\u03c1\u03c9\u03bc\u03ad\u03bd\u03bf", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\u0391\u03c0\u03bb\u03ae\u03c1\u03c9\u03c4\u03bf", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "\u03a5\u03c0\u03ad\u03c1\u03b2\u03b1\u03c3\u03b7 \u03c0\u03c1\u03bf\u03cb\u03c0\u03bf\u03bb\u03bf\u03b3\u03b9\u03c3\u03bc\u03ce\u03bd", + "money_flowing_in": "\u0395\u03b9\u03c3\u03c1\u03bf\u03ad\u03c2", + "money_flowing_out": "\u0395\u03ba\u03c1\u03bf\u03ad\u03c2", + "category": "\u039a\u03b1\u03c4\u03b7\u03b3\u03bf\u03c1\u03af\u03b1", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "\u0394\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03b8\u03b7\u03ba\u03b5 \u03b5\u03c0\u03b9\u03c4\u03c5\u03c7\u03ce\u03c2 \u03b7 \u03bd\u03ad\u03b1 \u03c3\u03c5\u03bd\u03b1\u03bb\u03bb\u03b1\u03b3\u03ae \u00ab%{description}\u00bb", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "\u03a0\u03c1\u03bf\u03cb\u03c0\u03bf\u03bb\u03bf\u03b3\u03b9\u03c3\u03bc\u03cc\u03c2", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "\u03a7\u03c1\u03ad\u03bf\u03c2", + "account_type_Loan": "\u0394\u03ac\u03bd\u03b5\u03b9\u03bf", + "account_type_Mortgage": "\u03a5\u03c0\u03bf\u03b8\u03ae\u03ba\u03b7" + } +} \ No newline at end of file diff --git a/public/v2/i18n/el_GR.json b/public/v2/i18n/el_GR.json deleted file mode 100644 index b9432d7cb6..0000000000 --- a/public/v2/i18n/el_GR.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "el_GR": { - "config": { - "html_language": "el" - }, - "firefly": { - "spent": "\u0394\u03b1\u03c0\u03b1\u03bd\u03ae\u03b8\u03b7\u03ba\u03b1\u03bd", - "left": "\u0391\u03c0\u03bf\u03bc\u03ad\u03bd\u03bf\u03c5\u03bd", - "paid": "\u03a0\u03bb\u03b7\u03c1\u03c9\u03bc\u03ad\u03bd\u03bf", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\u0391\u03c0\u03bb\u03ae\u03c1\u03c9\u03c4\u03bf", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "\u03a5\u03c0\u03ad\u03c1\u03b2\u03b1\u03c3\u03b7 \u03c0\u03c1\u03bf\u03cb\u03c0\u03bf\u03bb\u03bf\u03b3\u03b9\u03c3\u03bc\u03ce\u03bd", - "money_flowing_in": "\u0395\u03b9\u03c3\u03c1\u03bf\u03ad\u03c2", - "money_flowing_out": "\u0395\u03ba\u03c1\u03bf\u03ad\u03c2", - "category": "\u039a\u03b1\u03c4\u03b7\u03b3\u03bf\u03c1\u03af\u03b1", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "\u0394\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03b8\u03b7\u03ba\u03b5 \u03b5\u03c0\u03b9\u03c4\u03c5\u03c7\u03ce\u03c2 \u03b7 \u03bd\u03ad\u03b1 \u03c3\u03c5\u03bd\u03b1\u03bb\u03bb\u03b1\u03b3\u03ae \u00ab%{description}\u00bb", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "\u03a0\u03c1\u03bf\u03cb\u03c0\u03bf\u03bb\u03bf\u03b3\u03b9\u03c3\u03bc\u03cc\u03c2", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "\u03a7\u03c1\u03ad\u03bf\u03c2", - "account_type_Loan": "\u0394\u03ac\u03bd\u03b5\u03b9\u03bf", - "account_type_Mortgage": "\u03a5\u03c0\u03bf\u03b8\u03ae\u03ba\u03b7" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/en-gb.json b/public/v2/i18n/en-gb.json new file mode 100644 index 0000000000..6298a953c0 --- /dev/null +++ b/public/v2/i18n/en-gb.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "en-gb" + }, + "firefly": { + "spent": "Spent", + "left": "Left", + "paid": "Paid", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Unpaid", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Overspent", + "money_flowing_in": "In", + "money_flowing_out": "Out", + "category": "Category", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budget", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Debt", + "account_type_Loan": "Loan", + "account_type_Mortgage": "Mortgage" + } +} \ No newline at end of file diff --git a/public/v2/i18n/en.json b/public/v2/i18n/en.json new file mode 100644 index 0000000000..a9d0353335 --- /dev/null +++ b/public/v2/i18n/en.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "en" + }, + "firefly": { + "spent": "Spent", + "left": "Left", + "paid": "Paid", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Unpaid", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Overspent", + "money_flowing_in": "In", + "money_flowing_out": "Out", + "category": "Category", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budget", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Debt", + "account_type_Loan": "Loan", + "account_type_Mortgage": "Mortgage" + } +} \ No newline at end of file diff --git a/public/v2/i18n/en_GB.json b/public/v2/i18n/en_GB.json deleted file mode 100644 index 0a330895a5..0000000000 --- a/public/v2/i18n/en_GB.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "en_GB": { - "config": { - "html_language": "en-gb" - }, - "firefly": { - "spent": "Spent", - "left": "Left", - "paid": "Paid", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Unpaid", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Overspent", - "money_flowing_in": "In", - "money_flowing_out": "Out", - "category": "Category", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budget", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Debt", - "account_type_Loan": "Loan", - "account_type_Mortgage": "Mortgage" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/en_US.json b/public/v2/i18n/en_US.json deleted file mode 100644 index 4c176696f3..0000000000 --- a/public/v2/i18n/en_US.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "en_US": { - "config": { - "html_language": "en" - }, - "firefly": { - "spent": "Spent", - "left": "Left", - "paid": "Paid", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Unpaid", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Overspent", - "money_flowing_in": "In", - "money_flowing_out": "Out", - "category": "Category", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budget", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Debt", - "account_type_Loan": "Loan", - "account_type_Mortgage": "Mortgage" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/es.json b/public/v2/i18n/es.json new file mode 100644 index 0000000000..6ed8a41398 --- /dev/null +++ b/public/v2/i18n/es.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "es" + }, + "firefly": { + "spent": "Gastado", + "left": "Disponible", + "paid": "Pagado", + "errors_submission": "Hubo un error en tu env\u00edo. Por favor, revisa los siguientes errores: %{errorMessage}", + "unpaid": "No pagado", + "default_group_title_name_plain": "sin agrupar", + "subscriptions_in_group": "Suscripciones en el grupo \"%{title}\"", + "subscr_expected_x_times": "Se espera pagar %{amount} %{times} veces este periodo", + "overspent": "Sobrepasadas", + "money_flowing_in": "Entrada", + "money_flowing_out": "Salida", + "category": "Categoria", + "unknown_category_plain": "Sin categor\u00eda", + "all_money": "Todo tu dinero", + "unknown_source_plain": "Cuenta origen desconocida", + "unknown_dest_plain": "Direcci\u00f3n de destino desconocida", + "unknown_any_plain": "Cuenta desconocida", + "unknown_budget_plain": "Sin presupuesto", + "stored_journal_js": "Nueva transacci\u00f3n creada con \u00e9xito \"%{description}\"", + "expense_account": "Cuenta de gastos", + "revenue_account": "Cuenta de ingresos", + "budget": "Presupuesto", + "account_type_Asset account": "Cuenta de activos", + "account_type_Expense account": "Cuenta de gastos", + "account_type_Revenue account": "Cuenta de ingresos", + "account_type_Debt": "Deuda", + "account_type_Loan": "Pr\u00e9stamo", + "account_type_Mortgage": "Hipoteca" + } +} \ No newline at end of file diff --git a/public/v2/i18n/es_ES.json b/public/v2/i18n/es_ES.json deleted file mode 100644 index 4ba9aca619..0000000000 --- a/public/v2/i18n/es_ES.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "es_ES": { - "config": { - "html_language": "es" - }, - "firefly": { - "spent": "Gastado", - "left": "Disponible", - "paid": "Pagado", - "errors_submission": "Hubo un error en tu env\u00edo. Por favor, revisa los siguientes errores: %{errorMessage}", - "unpaid": "No pagado", - "default_group_title_name_plain": "sin agrupar", - "subscriptions_in_group": "Suscripciones en el grupo \"%{title}\"", - "subscr_expected_x_times": "Se espera pagar %{amount} %{times} veces este periodo", - "overspent": "Sobrepasadas", - "money_flowing_in": "Entrada", - "money_flowing_out": "Salida", - "category": "Categoria", - "unknown_category_plain": "Sin categor\u00eda", - "all_money": "Todo tu dinero", - "unknown_source_plain": "Cuenta origen desconocida", - "unknown_dest_plain": "Direcci\u00f3n de destino desconocida", - "unknown_any_plain": "Cuenta desconocida", - "unknown_budget_plain": "Sin presupuesto", - "stored_journal_js": "Nueva transacci\u00f3n creada con \u00e9xito \"%{description}\"", - "expense_account": "Cuenta de gastos", - "revenue_account": "Cuenta de ingresos", - "budget": "Presupuesto", - "account_type_Asset account": "Cuenta de activos", - "account_type_Expense account": "Cuenta de gastos", - "account_type_Revenue account": "Cuenta de ingresos", - "account_type_Debt": "Deuda", - "account_type_Loan": "Pr\u00e9stamo", - "account_type_Mortgage": "Hipoteca" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/fi.json b/public/v2/i18n/fi.json new file mode 100644 index 0000000000..5ac440a600 --- /dev/null +++ b/public/v2/i18n/fi.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "fi" + }, + "firefly": { + "spent": "K\u00e4ytetty", + "left": "J\u00e4ljell\u00e4", + "paid": "Maksettu", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Maksamatta", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Varojen ylitys", + "money_flowing_in": "Sis\u00e4\u00e4n", + "money_flowing_out": "Ulos", + "category": "Kategoria", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budjetti", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Velka", + "account_type_Loan": "Laina", + "account_type_Mortgage": "Kiinnelaina" + } +} \ No newline at end of file diff --git a/public/v2/i18n/fi_FI.json b/public/v2/i18n/fi_FI.json deleted file mode 100644 index db784ca9c4..0000000000 --- a/public/v2/i18n/fi_FI.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "fi_FI": { - "config": { - "html_language": "fi" - }, - "firefly": { - "spent": "K\u00e4ytetty", - "left": "J\u00e4ljell\u00e4", - "paid": "Maksettu", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Maksamatta", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Varojen ylitys", - "money_flowing_in": "Sis\u00e4\u00e4n", - "money_flowing_out": "Ulos", - "category": "Kategoria", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budjetti", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Velka", - "account_type_Loan": "Laina", - "account_type_Mortgage": "Kiinnelaina" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/fr.json b/public/v2/i18n/fr.json new file mode 100644 index 0000000000..0c246d5b05 --- /dev/null +++ b/public/v2/i18n/fr.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "fr" + }, + "firefly": { + "spent": "D\u00e9pens\u00e9", + "left": "Reste", + "paid": "Pay\u00e9", + "errors_submission": "Certaines informations ne sont pas correctes dans votre formulaire. Veuillez v\u00e9rifier les erreurs ci-dessous : %{errorMessage}", + "unpaid": "Impay\u00e9", + "default_group_title_name_plain": "non group\u00e9", + "subscriptions_in_group": "Abonnements dans le groupe \"%{title}\"", + "subscr_expected_x_times": "%{amount} \u00e0 payer %{times} fois cette p\u00e9riode", + "overspent": "Trop d\u00e9pens\u00e9", + "money_flowing_in": "Entr\u00e9e", + "money_flowing_out": "Sortie", + "category": "Cat\u00e9gorie", + "unknown_category_plain": "Sans cat\u00e9gorie", + "all_money": "Tout votre argent", + "unknown_source_plain": "Compte source inconnu", + "unknown_dest_plain": "Compte de destination inconnu", + "unknown_any_plain": "Compte inconnu", + "unknown_budget_plain": "Pas de budget", + "stored_journal_js": "Op\u00e9ration \"%{description}\" cr\u00e9\u00e9e avec succ\u00e8s", + "expense_account": "Compte de d\u00e9penses", + "revenue_account": "Compte de recettes", + "budget": "Budget", + "account_type_Asset account": "Compte d\u2019actif", + "account_type_Expense account": "Compte de d\u00e9penses", + "account_type_Revenue account": "Compte de recettes", + "account_type_Debt": "Dette", + "account_type_Loan": "Pr\u00eat", + "account_type_Mortgage": "Pr\u00eat hypoth\u00e9caire" + } +} \ No newline at end of file diff --git a/public/v2/i18n/fr_FR.json b/public/v2/i18n/fr_FR.json deleted file mode 100644 index 03a2693789..0000000000 --- a/public/v2/i18n/fr_FR.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "fr_FR": { - "config": { - "html_language": "fr" - }, - "firefly": { - "spent": "D\u00e9pens\u00e9", - "left": "Reste", - "paid": "Pay\u00e9", - "errors_submission": "Certaines informations ne sont pas correctes dans votre formulaire. Veuillez v\u00e9rifier les erreurs ci-dessous : %{errorMessage}", - "unpaid": "Impay\u00e9", - "default_group_title_name_plain": "non group\u00e9", - "subscriptions_in_group": "Abonnements dans le groupe \"%{title}\"", - "subscr_expected_x_times": "%{amount} \u00e0 payer %{times} fois cette p\u00e9riode", - "overspent": "Trop d\u00e9pens\u00e9", - "money_flowing_in": "Entr\u00e9e", - "money_flowing_out": "Sortie", - "category": "Cat\u00e9gorie", - "unknown_category_plain": "Sans cat\u00e9gorie", - "all_money": "Tout votre argent", - "unknown_source_plain": "Compte source inconnu", - "unknown_dest_plain": "Compte de destination inconnu", - "unknown_any_plain": "Compte inconnu", - "unknown_budget_plain": "Pas de budget", - "stored_journal_js": "Op\u00e9ration \"%{description}\" cr\u00e9\u00e9e avec succ\u00e8s", - "expense_account": "Compte de d\u00e9penses", - "revenue_account": "Compte de recettes", - "budget": "Budget", - "account_type_Asset account": "Compte d\u2019actif", - "account_type_Expense account": "Compte de d\u00e9penses", - "account_type_Revenue account": "Compte de recettes", - "account_type_Debt": "Dette", - "account_type_Loan": "Pr\u00eat", - "account_type_Mortgage": "Pr\u00eat hypoth\u00e9caire" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/hu.json b/public/v2/i18n/hu.json new file mode 100644 index 0000000000..dbde293bef --- /dev/null +++ b/public/v2/i18n/hu.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "hu" + }, + "firefly": { + "spent": "Elk\u00f6lt\u00f6tt", + "left": "Maradv\u00e1ny", + "paid": "Kifizetve", + "errors_submission": "Hiba t\u00f6rt\u00e9nt a bek\u00fcld\u00e9s sor\u00e1n. K\u00e9rlek jav\u00edtsd a k\u00f6vetkez\u0151 hib\u00e1kat: %{errorMessage}", + "unpaid": "Nincs fizetve", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "T\u00falk\u00f6lt\u00f6tt", + "money_flowing_in": "Be", + "money_flowing_out": "Ki", + "category": "Kateg\u00f3ria", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "K\u00f6lts\u00e9gkeret", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Ad\u00f3ss\u00e1g", + "account_type_Loan": "Hitel", + "account_type_Mortgage": "Jelz\u00e1log" + } +} \ No newline at end of file diff --git a/public/v2/i18n/hu_HU.json b/public/v2/i18n/hu_HU.json deleted file mode 100644 index 1795df1491..0000000000 --- a/public/v2/i18n/hu_HU.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "hu_HU": { - "config": { - "html_language": "hu" - }, - "firefly": { - "spent": "Elk\u00f6lt\u00f6tt", - "left": "Maradv\u00e1ny", - "paid": "Kifizetve", - "errors_submission": "Hiba t\u00f6rt\u00e9nt a bek\u00fcld\u00e9s sor\u00e1n. K\u00e9rlek jav\u00edtsd a k\u00f6vetkez\u0151 hib\u00e1kat: %{errorMessage}", - "unpaid": "Nincs fizetve", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "T\u00falk\u00f6lt\u00f6tt", - "money_flowing_in": "Be", - "money_flowing_out": "Ki", - "category": "Kateg\u00f3ria", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "K\u00f6lts\u00e9gkeret", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Ad\u00f3ss\u00e1g", - "account_type_Loan": "Hitel", - "account_type_Mortgage": "Jelz\u00e1log" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/id.json b/public/v2/i18n/id.json new file mode 100644 index 0000000000..5f6f2d62f7 --- /dev/null +++ b/public/v2/i18n/id.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "id" + }, + "firefly": { + "spent": "Menghabiskan", + "left": "Kiri", + "paid": "Dibayar", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Tidak dibayar", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Overspent", + "money_flowing_in": "Dalam", + "money_flowing_out": "Keluar", + "category": "Kategori", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Anggaran", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Debt", + "account_type_Loan": "Loan", + "account_type_Mortgage": "Mortgage" + } +} \ No newline at end of file diff --git a/public/v2/i18n/id_ID.json b/public/v2/i18n/id_ID.json deleted file mode 100644 index c4a71e5b68..0000000000 --- a/public/v2/i18n/id_ID.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "id_ID": { - "config": { - "html_language": "id" - }, - "firefly": { - "spent": "Menghabiskan", - "left": "Kiri", - "paid": "Dibayar", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Tidak dibayar", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Overspent", - "money_flowing_in": "Dalam", - "money_flowing_out": "Keluar", - "category": "Kategori", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Anggaran", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Debt", - "account_type_Loan": "Loan", - "account_type_Mortgage": "Mortgage" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/it.json b/public/v2/i18n/it.json new file mode 100644 index 0000000000..7e56167e50 --- /dev/null +++ b/public/v2/i18n/it.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "it" + }, + "firefly": { + "spent": "Speso", + "left": "Resto", + "paid": "Pagati", + "errors_submission": "Errore durante l'invio. Controlla gli errori segnalati qui sotto: %{errorMessage}", + "unpaid": "Da pagare", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Abbonamenti nel gruppo \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Speso troppo", + "money_flowing_in": "Entrate", + "money_flowing_out": "Uscite", + "category": "Categoria", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budget", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Debito", + "account_type_Loan": "Prestito", + "account_type_Mortgage": "Mutuo" + } +} \ No newline at end of file diff --git a/public/v2/i18n/it_IT.json b/public/v2/i18n/it_IT.json deleted file mode 100644 index 56222a75cc..0000000000 --- a/public/v2/i18n/it_IT.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "it_IT": { - "config": { - "html_language": "it" - }, - "firefly": { - "spent": "Speso", - "left": "Resto", - "paid": "Pagati", - "errors_submission": "Errore durante l'invio. Controlla gli errori segnalati qui sotto: %{errorMessage}", - "unpaid": "Da pagare", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Abbonamenti nel gruppo \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Speso troppo", - "money_flowing_in": "Entrate", - "money_flowing_out": "Uscite", - "category": "Categoria", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budget", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Debito", - "account_type_Loan": "Prestito", - "account_type_Mortgage": "Mutuo" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/ja.json b/public/v2/i18n/ja.json new file mode 100644 index 0000000000..2665510e27 --- /dev/null +++ b/public/v2/i18n/ja.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "ja" + }, + "firefly": { + "spent": "\u652f\u51fa", + "left": "\u6b8b\u308a", + "paid": "\u652f\u6255\u3044\u6e08\u307f", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\u672a\u6255\u3044", + "default_group_title_name_plain": "\u30b0\u30eb\u30fc\u30d7\u89e3\u9664", + "subscriptions_in_group": "\u30b0\u30eb\u30fc\u30d7\u300c%{title}\u300d\u306e\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3", + "subscr_expected_x_times": "\u3053\u306e\u671f\u9593\u306b %{amount} %{times} \u56de\u306e\u652f\u6255\u3044\u3092\u4e88\u5b9a", + "overspent": "\u4f7f\u3044\u3059\u304e", + "money_flowing_in": "\u5165", + "money_flowing_out": "\u51fa", + "category": "\u30ab\u30c6\u30b4\u30ea", + "unknown_category_plain": "\u30ab\u30c6\u30b4\u30ea\u306a\u3057", + "all_money": "\u3059\u3079\u3066\u306e\u304a\u91d1", + "unknown_source_plain": "\u4e0d\u660e\u306a\u5f15\u304d\u51fa\u3057\u53e3\u5ea7", + "unknown_dest_plain": "\u4e0d\u660e\u306a\u9810\u3051\u5165\u308c\u53e3\u5ea7", + "unknown_any_plain": "\u4e0d\u660e\u306a\u53e3\u5ea7", + "unknown_budget_plain": "\u4e88\u7b97\u306a\u3057", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "\u652f\u51fa\u53e3\u5ea7", + "revenue_account": "\u53ce\u5165\u53e3\u5ea7", + "budget": "\u4e88\u7b97", + "account_type_Asset account": "\u8cc7\u7523\u53e3\u5ea7", + "account_type_Expense account": "\u652f\u51fa\u53e3\u5ea7", + "account_type_Revenue account": "\u53ce\u5165\u53e3\u5ea7", + "account_type_Debt": "\u501f\u91d1", + "account_type_Loan": "\u30ed\u30fc\u30f3", + "account_type_Mortgage": "\u4f4f\u5b85\u30ed\u30fc\u30f3" + } +} \ No newline at end of file diff --git a/public/v2/i18n/ja_JP.json b/public/v2/i18n/ja_JP.json deleted file mode 100644 index 3359f8b261..0000000000 --- a/public/v2/i18n/ja_JP.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "ja_JP": { - "config": { - "html_language": "ja" - }, - "firefly": { - "spent": "\u652f\u51fa", - "left": "\u6b8b\u308a", - "paid": "\u652f\u6255\u3044\u6e08\u307f", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\u672a\u6255\u3044", - "default_group_title_name_plain": "\u30b0\u30eb\u30fc\u30d7\u89e3\u9664", - "subscriptions_in_group": "\u30b0\u30eb\u30fc\u30d7\u300c%{title}\u300d\u306e\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3", - "subscr_expected_x_times": "\u3053\u306e\u671f\u9593\u306b %{amount} %{times} \u56de\u306e\u652f\u6255\u3044\u3092\u4e88\u5b9a", - "overspent": "\u4f7f\u3044\u3059\u304e", - "money_flowing_in": "\u5165", - "money_flowing_out": "\u51fa", - "category": "\u30ab\u30c6\u30b4\u30ea", - "unknown_category_plain": "\u30ab\u30c6\u30b4\u30ea\u306a\u3057", - "all_money": "\u3059\u3079\u3066\u306e\u304a\u91d1", - "unknown_source_plain": "\u4e0d\u660e\u306a\u5f15\u304d\u51fa\u3057\u53e3\u5ea7", - "unknown_dest_plain": "\u4e0d\u660e\u306a\u9810\u3051\u5165\u308c\u53e3\u5ea7", - "unknown_any_plain": "\u4e0d\u660e\u306a\u53e3\u5ea7", - "unknown_budget_plain": "\u4e88\u7b97\u306a\u3057", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "\u652f\u51fa\u53e3\u5ea7", - "revenue_account": "\u53ce\u5165\u53e3\u5ea7", - "budget": "\u4e88\u7b97", - "account_type_Asset account": "\u8cc7\u7523\u53e3\u5ea7", - "account_type_Expense account": "\u652f\u51fa\u53e3\u5ea7", - "account_type_Revenue account": "\u53ce\u5165\u53e3\u5ea7", - "account_type_Debt": "\u501f\u91d1", - "account_type_Loan": "\u30ed\u30fc\u30f3", - "account_type_Mortgage": "\u4f4f\u5b85\u30ed\u30fc\u30f3" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/ko.json b/public/v2/i18n/ko.json new file mode 100644 index 0000000000..8f203b30bc --- /dev/null +++ b/public/v2/i18n/ko.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "ko" + }, + "firefly": { + "spent": "\uc9c0\ucd9c", + "left": "\ub0a8\uc74c", + "paid": "\uc9c0\ubd88\ub428", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\ubbf8\uc9c0\ubd88", + "default_group_title_name_plain": "\uadf8\ub8f9 \ud574\uc81c\ub428", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "\ucd08\uacfc \uc9c0\ucd9c", + "money_flowing_in": "\ub4e4\uc5b4\uc634", + "money_flowing_out": "\ub098\uac10", + "category": "\uce74\ud14c\uace0\ub9ac", + "unknown_category_plain": "\uce74\ud14c\uace0\ub9ac \uc5c6\uc74c", + "all_money": "\ubaa8\ub4e0 \ub3c8", + "unknown_source_plain": "\uc54c \uc218 \uc5c6\ub294 \uc18c\uc2a4 \uacc4\uc815", + "unknown_dest_plain": "\uc54c \uc218 \uc5c6\ub294 \ub300\uc0c1 \uacc4\uc815", + "unknown_any_plain": "\uc54c \uc218 \uc5c6\ub294 \uacc4\uc815", + "unknown_budget_plain": "\uc608\uc0b0 \uc5c6\uc74c", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "\uc9c0\ucd9c \uacc4\uc815", + "revenue_account": "\uc218\uc775 \uacc4\uc815", + "budget": "\uc608\uc0b0", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "\ub300\ucd9c", + "account_type_Loan": "\ube5a", + "account_type_Mortgage": "\ubaa8\uae30\uc9c0" + } +} \ No newline at end of file diff --git a/public/v2/i18n/ko_KR.json b/public/v2/i18n/ko_KR.json deleted file mode 100644 index 9f6a111e8e..0000000000 --- a/public/v2/i18n/ko_KR.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "ko_KR": { - "config": { - "html_language": "ko" - }, - "firefly": { - "spent": "\uc9c0\ucd9c", - "left": "\ub0a8\uc74c", - "paid": "\uc9c0\ubd88\ub428", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\ubbf8\uc9c0\ubd88", - "default_group_title_name_plain": "\uadf8\ub8f9 \ud574\uc81c\ub428", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "\ucd08\uacfc \uc9c0\ucd9c", - "money_flowing_in": "\ub4e4\uc5b4\uc634", - "money_flowing_out": "\ub098\uac10", - "category": "\uce74\ud14c\uace0\ub9ac", - "unknown_category_plain": "\uce74\ud14c\uace0\ub9ac \uc5c6\uc74c", - "all_money": "\ubaa8\ub4e0 \ub3c8", - "unknown_source_plain": "\uc54c \uc218 \uc5c6\ub294 \uc18c\uc2a4 \uacc4\uc815", - "unknown_dest_plain": "\uc54c \uc218 \uc5c6\ub294 \ub300\uc0c1 \uacc4\uc815", - "unknown_any_plain": "\uc54c \uc218 \uc5c6\ub294 \uacc4\uc815", - "unknown_budget_plain": "\uc608\uc0b0 \uc5c6\uc74c", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "\uc9c0\ucd9c \uacc4\uc815", - "revenue_account": "\uc218\uc775 \uacc4\uc815", - "budget": "\uc608\uc0b0", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "\ub300\ucd9c", - "account_type_Loan": "\ube5a", - "account_type_Mortgage": "\ubaa8\uae30\uc9c0" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/nb.json b/public/v2/i18n/nb.json new file mode 100644 index 0000000000..7932b8028c --- /dev/null +++ b/public/v2/i18n/nb.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "nb" + }, + "firefly": { + "spent": "Brukt", + "left": "Gjenv\u00e6rende", + "paid": "Betalt", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Ikke betalt", + "default_group_title_name_plain": "ikke gruppert", + "subscriptions_in_group": "Abonnementer i gruppe \"%{title}\"", + "subscr_expected_x_times": "Forvent \u00e5 betale %{amount}, %{times} ganger denne perioden", + "overspent": "Overforbruk", + "money_flowing_in": "Inn", + "money_flowing_out": "Ut", + "category": "Kategori", + "unknown_category_plain": "Ingen kategori", + "all_money": "Alle pengene dine", + "unknown_source_plain": "Ukjent kilde-konto", + "unknown_dest_plain": "Ukjent destinasjonskonto", + "unknown_any_plain": "Ukjent konto", + "unknown_budget_plain": "Mangler budsjett", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Utgiftskonto", + "revenue_account": "Inntektskonto", + "budget": "Budsjett", + "account_type_Asset account": "Aktivakonto", + "account_type_Expense account": "Utgiftskonto", + "account_type_Revenue account": "Inntektskonto", + "account_type_Debt": "Gjeld", + "account_type_Loan": "L\u00e5n", + "account_type_Mortgage": "Boligl\u00e5n" + } +} \ No newline at end of file diff --git a/public/v2/i18n/nb_NO.json b/public/v2/i18n/nb_NO.json deleted file mode 100644 index 800ae090d8..0000000000 --- a/public/v2/i18n/nb_NO.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "nb_NO": { - "config": { - "html_language": "nb" - }, - "firefly": { - "spent": "Brukt", - "left": "Gjenv\u00e6rende", - "paid": "Betalt", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Ikke betalt", - "default_group_title_name_plain": "ikke gruppert", - "subscriptions_in_group": "Abonnementer i gruppe \"%{title}\"", - "subscr_expected_x_times": "Forvent \u00e5 betale %{amount}, %{times} ganger denne perioden", - "overspent": "Overforbruk", - "money_flowing_in": "Inn", - "money_flowing_out": "Ut", - "category": "Kategori", - "unknown_category_plain": "Ingen kategori", - "all_money": "Alle pengene dine", - "unknown_source_plain": "Ukjent kilde-konto", - "unknown_dest_plain": "Ukjent destinasjonskonto", - "unknown_any_plain": "Ukjent konto", - "unknown_budget_plain": "Mangler budsjett", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Utgiftskonto", - "revenue_account": "Inntektskonto", - "budget": "Budsjett", - "account_type_Asset account": "Aktivakonto", - "account_type_Expense account": "Utgiftskonto", - "account_type_Revenue account": "Inntektskonto", - "account_type_Debt": "Gjeld", - "account_type_Loan": "L\u00e5n", - "account_type_Mortgage": "Boligl\u00e5n" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/nl.json b/public/v2/i18n/nl.json new file mode 100644 index 0000000000..163fa9d648 --- /dev/null +++ b/public/v2/i18n/nl.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "nl" + }, + "firefly": { + "spent": "Uitgegeven", + "left": "Over", + "paid": "Betaald", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Niet betaald", + "default_group_title_name_plain": "ongegroepeerd", + "subscriptions_in_group": "Abonnementen in groep \"%{title}\"", + "subscr_expected_x_times": "Verwacht %{amount} %{times} keer te betalen in deze periode", + "overspent": "Teveel uitgegeven", + "money_flowing_in": "In", + "money_flowing_out": "Uit", + "category": "Categorie", + "unknown_category_plain": "Geen categorie", + "all_money": "Al je geld", + "unknown_source_plain": "Onbekend bronrekening", + "unknown_dest_plain": "Onbekende doelrekening", + "unknown_any_plain": "Onbekende rekening", + "unknown_budget_plain": "Geen budget", + "stored_journal_js": "Nieuw transactie \"%{description}\" opgeslagen", + "expense_account": "Crediteur", + "revenue_account": "Debiteur", + "budget": "Budget", + "account_type_Asset account": "Betaalrekening", + "account_type_Expense account": "Crediteur", + "account_type_Revenue account": "Debiteur", + "account_type_Debt": "Schuld", + "account_type_Loan": "Lening", + "account_type_Mortgage": "Hypotheek" + } +} \ No newline at end of file diff --git a/public/v2/i18n/nl_NL.json b/public/v2/i18n/nl_NL.json deleted file mode 100644 index 7fec37eb10..0000000000 --- a/public/v2/i18n/nl_NL.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "nl_NL": { - "config": { - "html_language": "nl" - }, - "firefly": { - "spent": "Uitgegeven", - "left": "Over", - "paid": "Betaald", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Niet betaald", - "default_group_title_name_plain": "ongegroepeerd", - "subscriptions_in_group": "Abonnementen in groep \"%{title}\"", - "subscr_expected_x_times": "Verwacht %{amount} %{times} keer te betalen in deze periode", - "overspent": "Teveel uitgegeven", - "money_flowing_in": "In", - "money_flowing_out": "Uit", - "category": "Categorie", - "unknown_category_plain": "Geen categorie", - "all_money": "Al je geld", - "unknown_source_plain": "Onbekend bronrekening", - "unknown_dest_plain": "Onbekende doelrekening", - "unknown_any_plain": "Onbekende rekening", - "unknown_budget_plain": "Geen budget", - "stored_journal_js": "Nieuw transactie \"%{description}\" opgeslagen", - "expense_account": "Crediteur", - "revenue_account": "Debiteur", - "budget": "Budget", - "account_type_Asset account": "Betaalrekening", - "account_type_Expense account": "Crediteur", - "account_type_Revenue account": "Debiteur", - "account_type_Debt": "Schuld", - "account_type_Loan": "Lening", - "account_type_Mortgage": "Hypotheek" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/nn.json b/public/v2/i18n/nn.json new file mode 100644 index 0000000000..a66e716743 --- /dev/null +++ b/public/v2/i18n/nn.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "nn" + }, + "firefly": { + "spent": "Brukt", + "left": "Att", + "paid": "Betalt", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Ikke betalt", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Abonnement i gruppa \u00ab%{title}\u00bb", + "subscr_expected_x_times": "Forvent \u00e5 betal %{amount} %{times} gonger denne perioden", + "overspent": "Overforbruk", + "money_flowing_in": "Inn", + "money_flowing_out": "Ut", + "category": "Kategori", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Transaksjonen \u00ab%{description}\u00bb vart oppretta", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budsjett", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Gjeld", + "account_type_Loan": "L\u00e5n", + "account_type_Mortgage": "Boligl\u00e5n" + } +} \ No newline at end of file diff --git a/public/v2/i18n/nn_NO.json b/public/v2/i18n/nn_NO.json deleted file mode 100644 index 0ac5eca54f..0000000000 --- a/public/v2/i18n/nn_NO.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "nn_NO": { - "config": { - "html_language": "nn" - }, - "firefly": { - "spent": "Brukt", - "left": "Att", - "paid": "Betalt", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Ikke betalt", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Abonnement i gruppa \u00ab%{title}\u00bb", - "subscr_expected_x_times": "Forvent \u00e5 betal %{amount} %{times} gonger denne perioden", - "overspent": "Overforbruk", - "money_flowing_in": "Inn", - "money_flowing_out": "Ut", - "category": "Kategori", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Transaksjonen \u00ab%{description}\u00bb vart oppretta", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budsjett", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Gjeld", - "account_type_Loan": "L\u00e5n", - "account_type_Mortgage": "Boligl\u00e5n" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/pl.json b/public/v2/i18n/pl.json new file mode 100644 index 0000000000..3064437fa5 --- /dev/null +++ b/public/v2/i18n/pl.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "pl" + }, + "firefly": { + "spent": "Wydano", + "left": "Pozosta\u0142o", + "paid": "Zap\u0142acone", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Niezap\u0142acone", + "default_group_title_name_plain": "bez grupy", + "subscriptions_in_group": "Subskrypcje w grupie \"%{title}\"", + "subscr_expected_x_times": "Oczekuje zap\u0142aty %{amount} %{times} razy w tym okresie", + "overspent": "Przep\u0142acono", + "money_flowing_in": "Przychodz\u0105ce", + "money_flowing_out": "Wychodz\u0105ce", + "category": "Kategoria", + "unknown_category_plain": "Brak kategorii", + "all_money": "Wszystkie Twoje pieni\u0105dze", + "unknown_source_plain": "Nieznane konto \u017ar\u00f3d\u0142owe", + "unknown_dest_plain": "Nieznane konto docelowe", + "unknown_any_plain": "Nieznane konto", + "unknown_budget_plain": "Brak bud\u017cetu", + "stored_journal_js": "Pomy\u015blnie utworzono now\u0105 transakcj\u0119 \"%{description}\"", + "expense_account": "Konto wydatk\u00f3w", + "revenue_account": "Konto przychod\u00f3w", + "budget": "Bud\u017cet", + "account_type_Asset account": "Konto aktyw\u00f3w", + "account_type_Expense account": "Konto wydatk\u00f3w", + "account_type_Revenue account": "Konto przychod\u00f3w", + "account_type_Debt": "D\u0142ug", + "account_type_Loan": "Po\u017cyczka", + "account_type_Mortgage": "Hipoteka" + } +} \ No newline at end of file diff --git a/public/v2/i18n/pl_PL.json b/public/v2/i18n/pl_PL.json deleted file mode 100644 index ae5a85e618..0000000000 --- a/public/v2/i18n/pl_PL.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "pl_PL": { - "config": { - "html_language": "pl" - }, - "firefly": { - "spent": "Wydano", - "left": "Pozosta\u0142o", - "paid": "Zap\u0142acone", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Niezap\u0142acone", - "default_group_title_name_plain": "bez grupy", - "subscriptions_in_group": "Subskrypcje w grupie \"%{title}\"", - "subscr_expected_x_times": "Oczekuje zap\u0142aty %{amount} %{times} razy w tym okresie", - "overspent": "Przep\u0142acono", - "money_flowing_in": "Przychodz\u0105ce", - "money_flowing_out": "Wychodz\u0105ce", - "category": "Kategoria", - "unknown_category_plain": "Brak kategorii", - "all_money": "Wszystkie Twoje pieni\u0105dze", - "unknown_source_plain": "Nieznane konto \u017ar\u00f3d\u0142owe", - "unknown_dest_plain": "Nieznane konto docelowe", - "unknown_any_plain": "Nieznane konto", - "unknown_budget_plain": "Brak bud\u017cetu", - "stored_journal_js": "Pomy\u015blnie utworzono now\u0105 transakcj\u0119 \"%{description}\"", - "expense_account": "Konto wydatk\u00f3w", - "revenue_account": "Konto przychod\u00f3w", - "budget": "Bud\u017cet", - "account_type_Asset account": "Konto aktyw\u00f3w", - "account_type_Expense account": "Konto wydatk\u00f3w", - "account_type_Revenue account": "Konto przychod\u00f3w", - "account_type_Debt": "D\u0142ug", - "account_type_Loan": "Po\u017cyczka", - "account_type_Mortgage": "Hipoteka" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/pt-br.json b/public/v2/i18n/pt-br.json new file mode 100644 index 0000000000..3a86c8c970 --- /dev/null +++ b/public/v2/i18n/pt-br.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "pt-br" + }, + "firefly": { + "spent": "Gasto", + "left": "Restante", + "paid": "Pago", + "errors_submission": "Alguma coisa deu errado com seu envio. Por favor, verifique os erros abaixo: %{errorMessage}", + "unpaid": "N\u00e3o pago", + "default_group_title_name_plain": "sem grupo", + "subscriptions_in_group": "Assinaturas no grupo \"%{title}\"", + "subscr_expected_x_times": "Espera-se pagar %{amount} %{times} vezes neste per\u00edodo", + "overspent": "Gasto excedido", + "money_flowing_in": "Entrada", + "money_flowing_out": "Sa\u00edda", + "category": "Categoria", + "unknown_category_plain": "Sem categoria", + "all_money": "Todo o seu dinheiro", + "unknown_source_plain": "Conta de origem desconhecida", + "unknown_dest_plain": "Conta de destino desconhecida", + "unknown_any_plain": "Conta desconhecida", + "unknown_budget_plain": "Nenhum or\u00e7amento", + "stored_journal_js": "Transa\u00e7\u00e3o \"%{description}\" criada com sucesso", + "expense_account": "Conta de despesas", + "revenue_account": "Conta de Receitas", + "budget": "Or\u00e7amento", + "account_type_Asset account": "Conta de ativos", + "account_type_Expense account": "Conta de despesas", + "account_type_Revenue account": "Conta de receitas", + "account_type_Debt": "D\u00edvida", + "account_type_Loan": "Empr\u00e9stimo", + "account_type_Mortgage": "Hipoteca" + } +} \ No newline at end of file diff --git a/public/v2/i18n/pt.json b/public/v2/i18n/pt.json new file mode 100644 index 0000000000..fed4934b34 --- /dev/null +++ b/public/v2/i18n/pt.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "pt" + }, + "firefly": { + "spent": "Gasto", + "left": "Em falta", + "paid": "Pago", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Por pagar", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Gasto excedido", + "money_flowing_in": "Dentro", + "money_flowing_out": "Fora", + "category": "Categoria", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Or\u00e7amento", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "D\u00edvida", + "account_type_Loan": "Empr\u00e9stimo", + "account_type_Mortgage": "Hipoteca" + } +} \ No newline at end of file diff --git a/public/v2/i18n/pt_BR.json b/public/v2/i18n/pt_BR.json deleted file mode 100644 index 61ad59f354..0000000000 --- a/public/v2/i18n/pt_BR.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "pt_BR": { - "config": { - "html_language": "pt-br" - }, - "firefly": { - "spent": "Gasto", - "left": "Restante", - "paid": "Pago", - "errors_submission": "Alguma coisa deu errado com seu envio. Por favor, verifique os erros abaixo: %{errorMessage}", - "unpaid": "N\u00e3o pago", - "default_group_title_name_plain": "sem grupo", - "subscriptions_in_group": "Assinaturas no grupo \"%{title}\"", - "subscr_expected_x_times": "Espera-se pagar %{amount} %{times} vezes neste per\u00edodo", - "overspent": "Gasto excedido", - "money_flowing_in": "Entrada", - "money_flowing_out": "Sa\u00edda", - "category": "Categoria", - "unknown_category_plain": "Sem categoria", - "all_money": "Todo o seu dinheiro", - "unknown_source_plain": "Conta de origem desconhecida", - "unknown_dest_plain": "Conta de destino desconhecida", - "unknown_any_plain": "Conta desconhecida", - "unknown_budget_plain": "Nenhum or\u00e7amento", - "stored_journal_js": "Transa\u00e7\u00e3o \"%{description}\" criada com sucesso", - "expense_account": "Conta de despesas", - "revenue_account": "Conta de Receitas", - "budget": "Or\u00e7amento", - "account_type_Asset account": "Conta de ativos", - "account_type_Expense account": "Conta de despesas", - "account_type_Revenue account": "Conta de receitas", - "account_type_Debt": "D\u00edvida", - "account_type_Loan": "Empr\u00e9stimo", - "account_type_Mortgage": "Hipoteca" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/pt_PT.json b/public/v2/i18n/pt_PT.json deleted file mode 100644 index dd271dbc8b..0000000000 --- a/public/v2/i18n/pt_PT.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "pt_PT": { - "config": { - "html_language": "pt" - }, - "firefly": { - "spent": "Gasto", - "left": "Em falta", - "paid": "Pago", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Por pagar", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Gasto excedido", - "money_flowing_in": "Dentro", - "money_flowing_out": "Fora", - "category": "Categoria", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Or\u00e7amento", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "D\u00edvida", - "account_type_Loan": "Empr\u00e9stimo", - "account_type_Mortgage": "Hipoteca" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/ro.json b/public/v2/i18n/ro.json new file mode 100644 index 0000000000..e24886f144 --- /dev/null +++ b/public/v2/i18n/ro.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "ro" + }, + "firefly": { + "spent": "Cheltuit", + "left": "R\u0103mas", + "paid": "Pl\u0103tit", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Nepl\u0103tit", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Dep\u0103\u0219ire de buget", + "money_flowing_in": "\u00cen", + "money_flowing_out": "Afar\u0103", + "category": "Categorie", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Buget", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Datorie", + "account_type_Loan": "\u00cemprumut", + "account_type_Mortgage": "Credit ipotecar" + } +} \ No newline at end of file diff --git a/public/v2/i18n/ro_RO.json b/public/v2/i18n/ro_RO.json deleted file mode 100644 index dabf74ca9a..0000000000 --- a/public/v2/i18n/ro_RO.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "ro_RO": { - "config": { - "html_language": "ro" - }, - "firefly": { - "spent": "Cheltuit", - "left": "R\u0103mas", - "paid": "Pl\u0103tit", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Nepl\u0103tit", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Dep\u0103\u0219ire de buget", - "money_flowing_in": "\u00cen", - "money_flowing_out": "Afar\u0103", - "category": "Categorie", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Buget", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Datorie", - "account_type_Loan": "\u00cemprumut", - "account_type_Mortgage": "Credit ipotecar" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/ru.json b/public/v2/i18n/ru.json new file mode 100644 index 0000000000..94dc83d45e --- /dev/null +++ b/public/v2/i18n/ru.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "ru" + }, + "firefly": { + "spent": "\u0420\u0430\u0441\u0445\u043e\u0434", + "left": "\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c", + "paid": "\u041e\u043f\u043b\u0430\u0447\u0435\u043d\u043e", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\u041d\u0435 \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043e", + "default_group_title_name_plain": "\u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438", + "subscriptions_in_group": "\u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \"%{title}\"", + "subscr_expected_x_times": "\u041e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u043b\u0430\u0442\u0430 %{amount} %{times} \u0440\u0430\u0437 \u0437\u0430 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0438\u043e\u0434", + "overspent": "\u041f\u0435\u0440\u0435\u0440\u0430\u0441\u0445\u043e\u0434", + "money_flowing_in": "\u0412", + "money_flowing_out": "\u0418\u0437", + "category": "\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f", + "unknown_category_plain": "\u0411\u0435\u0437 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438", + "all_money": "\u0412\u0441\u0435 \u0432\u0430\u0448\u0438 \u0434\u0435\u043d\u044c\u0433\u0438", + "unknown_source_plain": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a", + "unknown_dest_plain": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f", + "unknown_any_plain": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442", + "unknown_budget_plain": "\u0411\u0435\u0437 \u0431\u044e\u0434\u0436\u0435\u0442\u0430", + "stored_journal_js": "\u041d\u043e\u0432\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \"%{description}\" \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0430", + "expense_account": "\u0421\u0447\u0435\u0442 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432", + "revenue_account": "\u0421\u0447\u0435\u0442 \u0434\u043e\u0445\u043e\u0434\u043e\u0432", + "budget": "\u0411\u044e\u0434\u0436\u0435\u0442", + "account_type_Asset account": "\u0421\u0447\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043e\u0432", + "account_type_Expense account": "\u0421\u0447\u0435\u0442\u0430 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432", + "account_type_Revenue account": "\u0421\u0447\u0435\u0442 \u0434\u043e\u0445\u043e\u0434\u043e\u0432", + "account_type_Debt": "\u0414\u0435\u0431\u0438\u0442", + "account_type_Loan": "\u0417\u0430\u0451\u043c", + "account_type_Mortgage": "\u0418\u043f\u043e\u0442\u0435\u043a\u0430" + } +} \ No newline at end of file diff --git a/public/v2/i18n/ru_RU.json b/public/v2/i18n/ru_RU.json deleted file mode 100644 index 90152d5a57..0000000000 --- a/public/v2/i18n/ru_RU.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "ru_RU": { - "config": { - "html_language": "ru" - }, - "firefly": { - "spent": "\u0420\u0430\u0441\u0445\u043e\u0434", - "left": "\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c", - "paid": "\u041e\u043f\u043b\u0430\u0447\u0435\u043d\u043e", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\u041d\u0435 \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043e", - "default_group_title_name_plain": "\u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438", - "subscriptions_in_group": "\u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \"%{title}\"", - "subscr_expected_x_times": "\u041e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u043b\u0430\u0442\u0430 %{amount} %{times} \u0440\u0430\u0437 \u0437\u0430 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0438\u043e\u0434", - "overspent": "\u041f\u0435\u0440\u0435\u0440\u0430\u0441\u0445\u043e\u0434", - "money_flowing_in": "\u0412", - "money_flowing_out": "\u0418\u0437", - "category": "\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f", - "unknown_category_plain": "\u0411\u0435\u0437 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438", - "all_money": "\u0412\u0441\u0435 \u0432\u0430\u0448\u0438 \u0434\u0435\u043d\u044c\u0433\u0438", - "unknown_source_plain": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a", - "unknown_dest_plain": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f", - "unknown_any_plain": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442", - "unknown_budget_plain": "\u0411\u0435\u0437 \u0431\u044e\u0434\u0436\u0435\u0442\u0430", - "stored_journal_js": "\u041d\u043e\u0432\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \"%{description}\" \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0430", - "expense_account": "\u0421\u0447\u0435\u0442 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432", - "revenue_account": "\u0421\u0447\u0435\u0442 \u0434\u043e\u0445\u043e\u0434\u043e\u0432", - "budget": "\u0411\u044e\u0434\u0436\u0435\u0442", - "account_type_Asset account": "\u0421\u0447\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043e\u0432", - "account_type_Expense account": "\u0421\u0447\u0435\u0442\u0430 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432", - "account_type_Revenue account": "\u0421\u0447\u0435\u0442 \u0434\u043e\u0445\u043e\u0434\u043e\u0432", - "account_type_Debt": "\u0414\u0435\u0431\u0438\u0442", - "account_type_Loan": "\u0417\u0430\u0451\u043c", - "account_type_Mortgage": "\u0418\u043f\u043e\u0442\u0435\u043a\u0430" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/sk.json b/public/v2/i18n/sk.json new file mode 100644 index 0000000000..f8eae1432c --- /dev/null +++ b/public/v2/i18n/sk.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "sk" + }, + "firefly": { + "spent": "Utraten\u00e9", + "left": "Zost\u00e1va", + "paid": "Uhraden\u00e9", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Neuhraden\u00e9", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Prekro\u010den\u00e9 v\u00fddaje", + "money_flowing_in": "Prich\u00e1dzaj\u00face", + "money_flowing_out": "Odch\u00e1dzaj\u00face", + "category": "Kateg\u00f3ria", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Rozpo\u010det", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Dlh", + "account_type_Loan": "P\u00f4\u017ei\u010dka", + "account_type_Mortgage": "Hypot\u00e9ka" + } +} \ No newline at end of file diff --git a/public/v2/i18n/sk_SK.json b/public/v2/i18n/sk_SK.json deleted file mode 100644 index 1a87bdeea5..0000000000 --- a/public/v2/i18n/sk_SK.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "sk_SK": { - "config": { - "html_language": "sk" - }, - "firefly": { - "spent": "Utraten\u00e9", - "left": "Zost\u00e1va", - "paid": "Uhraden\u00e9", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Neuhraden\u00e9", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Prekro\u010den\u00e9 v\u00fddaje", - "money_flowing_in": "Prich\u00e1dzaj\u00face", - "money_flowing_out": "Odch\u00e1dzaj\u00face", - "category": "Kateg\u00f3ria", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Rozpo\u010det", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Dlh", - "account_type_Loan": "P\u00f4\u017ei\u010dka", - "account_type_Mortgage": "Hypot\u00e9ka" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/sl.json b/public/v2/i18n/sl.json new file mode 100644 index 0000000000..0c47d2dfe1 --- /dev/null +++ b/public/v2/i18n/sl.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "sl" + }, + "firefly": { + "spent": "Porabljeno", + "left": "Preostalo", + "paid": "Pla\u010dano", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Nepla\u010dano", + "default_group_title_name_plain": "nezdru\u017eeno", + "subscriptions_in_group": "Naro\u010dnine v skupini \"%{title}\"", + "subscr_expected_x_times": "Pri\u010dakujte, da boste v tem obdobju pla\u010dali %{amount} %{times}-krat", + "overspent": "Preve\u010d porabljeno", + "money_flowing_in": "Na", + "money_flowing_out": "Iz", + "category": "Kategorija", + "unknown_category_plain": "Brez kategorije", + "all_money": "Ves va\u0161 denar", + "unknown_source_plain": "Neznan izvorni ra\u010dun", + "unknown_dest_plain": "Neznan ciljni ra\u010dun", + "unknown_any_plain": "Neznan ra\u010dun", + "unknown_budget_plain": "Ni prora\u010duna", + "stored_journal_js": "Nova transakcija \"%{description}\" je uspe\u0161no ustvarjena", + "expense_account": "Ra\u010dun stro\u0161kov", + "revenue_account": "Ra\u010dun prihodkov", + "budget": "Prora\u010dun", + "account_type_Asset account": "Ra\u010dun sredstev", + "account_type_Expense account": "Ra\u010dun stro\u0161kov", + "account_type_Revenue account": "Ra\u010dun prihodkov", + "account_type_Debt": "Dolg", + "account_type_Loan": "Posojilo", + "account_type_Mortgage": "Hipoteka" + } +} \ No newline at end of file diff --git a/public/v2/i18n/sl_SI.json b/public/v2/i18n/sl_SI.json deleted file mode 100644 index 532b5127ad..0000000000 --- a/public/v2/i18n/sl_SI.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "sl_SI": { - "config": { - "html_language": "sl" - }, - "firefly": { - "spent": "Porabljeno", - "left": "Preostalo", - "paid": "Pla\u010dano", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Nepla\u010dano", - "default_group_title_name_plain": "nezdru\u017eeno", - "subscriptions_in_group": "Naro\u010dnine v skupini \"%{title}\"", - "subscr_expected_x_times": "Pri\u010dakujte, da boste v tem obdobju pla\u010dali %{amount} %{times}-krat", - "overspent": "Preve\u010d porabljeno", - "money_flowing_in": "Na", - "money_flowing_out": "Iz", - "category": "Kategorija", - "unknown_category_plain": "Brez kategorije", - "all_money": "Ves va\u0161 denar", - "unknown_source_plain": "Neznan izvorni ra\u010dun", - "unknown_dest_plain": "Neznan ciljni ra\u010dun", - "unknown_any_plain": "Neznan ra\u010dun", - "unknown_budget_plain": "Ni prora\u010duna", - "stored_journal_js": "Nova transakcija \"%{description}\" je uspe\u0161no ustvarjena", - "expense_account": "Ra\u010dun stro\u0161kov", - "revenue_account": "Ra\u010dun prihodkov", - "budget": "Prora\u010dun", - "account_type_Asset account": "Ra\u010dun sredstev", - "account_type_Expense account": "Ra\u010dun stro\u0161kov", - "account_type_Revenue account": "Ra\u010dun prihodkov", - "account_type_Debt": "Dolg", - "account_type_Loan": "Posojilo", - "account_type_Mortgage": "Hipoteka" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/sv.json b/public/v2/i18n/sv.json new file mode 100644 index 0000000000..d34fff82a7 --- /dev/null +++ b/public/v2/i18n/sv.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "sv" + }, + "firefly": { + "spent": "Spenderat", + "left": "\u00c5terst\u00e5r", + "paid": "Betald", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Obetald", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "\u00d6veranstr\u00e4ngd", + "money_flowing_in": "In", + "money_flowing_out": "Ut", + "category": "Kategori", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budget", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Skuld", + "account_type_Loan": "L\u00e5n", + "account_type_Mortgage": "Bol\u00e5n" + } +} \ No newline at end of file diff --git a/public/v2/i18n/sv_SE.json b/public/v2/i18n/sv_SE.json deleted file mode 100644 index d5e9d8ab8c..0000000000 --- a/public/v2/i18n/sv_SE.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "sv_SE": { - "config": { - "html_language": "sv" - }, - "firefly": { - "spent": "Spenderat", - "left": "\u00c5terst\u00e5r", - "paid": "Betald", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Obetald", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "\u00d6veranstr\u00e4ngd", - "money_flowing_in": "In", - "money_flowing_out": "Ut", - "category": "Kategori", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budget", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Skuld", - "account_type_Loan": "L\u00e5n", - "account_type_Mortgage": "Bol\u00e5n" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/tr.json b/public/v2/i18n/tr.json new file mode 100644 index 0000000000..6a9f99718a --- /dev/null +++ b/public/v2/i18n/tr.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "tr" + }, + "firefly": { + "spent": "Harcanan", + "left": "Ayr\u0131ld\u0131", + "paid": "\u00d6dendi", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\u00d6denmedi", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Fazladan", + "money_flowing_in": "\u0130\u00e7eri", + "money_flowing_out": "D\u0131\u015far\u0131", + "category": "Kategori", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "B\u00fct\u00e7e", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "Debt", + "account_type_Loan": "Loan", + "account_type_Mortgage": "Mortgage" + } +} \ No newline at end of file diff --git a/public/v2/i18n/tr_TR.json b/public/v2/i18n/tr_TR.json deleted file mode 100644 index 0b00888666..0000000000 --- a/public/v2/i18n/tr_TR.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "tr_TR": { - "config": { - "html_language": "tr" - }, - "firefly": { - "spent": "Harcanan", - "left": "Ayr\u0131ld\u0131", - "paid": "\u00d6dendi", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\u00d6denmedi", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Fazladan", - "money_flowing_in": "\u0130\u00e7eri", - "money_flowing_out": "D\u0131\u015far\u0131", - "category": "Kategori", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "B\u00fct\u00e7e", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "Debt", - "account_type_Loan": "Loan", - "account_type_Mortgage": "Mortgage" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/uk.json b/public/v2/i18n/uk.json new file mode 100644 index 0000000000..b836e748b6 --- /dev/null +++ b/public/v2/i18n/uk.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "uk" + }, + "firefly": { + "spent": "Spent", + "left": "Left", + "paid": "Paid", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Unpaid", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Overspent", + "money_flowing_in": "In", + "money_flowing_out": "Out", + "category": "Category", + "unknown_category_plain": "No category", + "all_money": "\u0423\u0441\u0456 \u0432\u0430\u0448\u0456 \u0433\u0440\u043e\u0448\u0456", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Budget", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "\u0414\u0435\u0431\u0456\u0442", + "account_type_Loan": "\u041f\u043e\u0437\u0438\u043a\u0430", + "account_type_Mortgage": "\u0406\u043f\u043e\u0442\u0435\u043a\u0430" + } +} \ No newline at end of file diff --git a/public/v2/i18n/uk_UA.json b/public/v2/i18n/uk_UA.json deleted file mode 100644 index e300f1b8e4..0000000000 --- a/public/v2/i18n/uk_UA.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "uk_UA": { - "config": { - "html_language": "uk" - }, - "firefly": { - "spent": "Spent", - "left": "Left", - "paid": "Paid", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Unpaid", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Overspent", - "money_flowing_in": "In", - "money_flowing_out": "Out", - "category": "Category", - "unknown_category_plain": "No category", - "all_money": "\u0423\u0441\u0456 \u0432\u0430\u0448\u0456 \u0433\u0440\u043e\u0448\u0456", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Budget", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "\u0414\u0435\u0431\u0456\u0442", - "account_type_Loan": "\u041f\u043e\u0437\u0438\u043a\u0430", - "account_type_Mortgage": "\u0406\u043f\u043e\u0442\u0435\u043a\u0430" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/vi.json b/public/v2/i18n/vi.json new file mode 100644 index 0000000000..adec4b3e84 --- /dev/null +++ b/public/v2/i18n/vi.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "vi" + }, + "firefly": { + "spent": "\u0110\u00e3 chi", + "left": "C\u00f2n l\u1ea1i", + "paid": "\u0110\u00e3 thanh to\u00e1n", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "Ch\u01b0a thanh to\u00e1n", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "Qu\u00e1 h\u1ea1n", + "money_flowing_in": "V\u00e0o", + "money_flowing_out": "Ra", + "category": "Danh m\u1ee5c", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "Ng\u00e2n s\u00e1ch", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "M\u00f3n n\u1ee3", + "account_type_Loan": "Ti\u1ec1n vay", + "account_type_Mortgage": "Th\u1ebf ch\u1ea5p" + } +} \ No newline at end of file diff --git a/public/v2/i18n/vi_VN.json b/public/v2/i18n/vi_VN.json deleted file mode 100644 index 918077d665..0000000000 --- a/public/v2/i18n/vi_VN.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "vi_VN": { - "config": { - "html_language": "vi" - }, - "firefly": { - "spent": "\u0110\u00e3 chi", - "left": "C\u00f2n l\u1ea1i", - "paid": "\u0110\u00e3 thanh to\u00e1n", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "Ch\u01b0a thanh to\u00e1n", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "Qu\u00e1 h\u1ea1n", - "money_flowing_in": "V\u00e0o", - "money_flowing_out": "Ra", - "category": "Danh m\u1ee5c", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "Ng\u00e2n s\u00e1ch", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "M\u00f3n n\u1ee3", - "account_type_Loan": "Ti\u1ec1n vay", - "account_type_Mortgage": "Th\u1ebf ch\u1ea5p" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/zh-cn.json b/public/v2/i18n/zh-cn.json new file mode 100644 index 0000000000..3eaf152964 --- /dev/null +++ b/public/v2/i18n/zh-cn.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "zh-cn" + }, + "firefly": { + "spent": "\u652f\u51fa", + "left": "\u5269\u4f59", + "paid": "\u5df2\u4ed8\u6b3e", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\u672a\u4ed8\u6b3e", + "default_group_title_name_plain": "\u672a\u5206\u7ec4", + "subscriptions_in_group": "\u5206\u7ec4\u201c%{title}\u201d\u8ba2\u9605", + "subscr_expected_x_times": "\u6b64\u5468\u671f\u9884\u8ba1\u652f\u4ed8%{amount}%{times}\u6b21", + "overspent": "\u8d85\u652f", + "money_flowing_in": "\u6d41\u5165", + "money_flowing_out": "\u6d41\u51fa", + "category": "\u5206\u7c7b", + "unknown_category_plain": "\u6ca1\u6709\u5206\u7c7b", + "all_money": "\u5168\u90e8\u8d44\u91d1", + "unknown_source_plain": "\u672a\u77e5\u6765\u6e90\u8d26\u6237", + "unknown_dest_plain": "\u672a\u77e5\u76ee\u6807\u8d26\u6237", + "unknown_any_plain": "\u672a\u77e5\u8d26\u6237", + "unknown_budget_plain": "\u65e0\u9884\u7b97", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "\u652f\u51fa\u8d26\u6237", + "revenue_account": "\u6536\u5165\u8d26\u6237", + "budget": "\u9884\u7b97", + "account_type_Asset account": "\u8d44\u4ea7\u8d26\u6237", + "account_type_Expense account": "\u652f\u51fa\u8d26\u6237", + "account_type_Revenue account": "\u6536\u5165\u8d26\u6237", + "account_type_Debt": "\u6b20\u6b3e", + "account_type_Loan": "\u8d37\u6b3e", + "account_type_Mortgage": "\u62b5\u62bc" + } +} \ No newline at end of file diff --git a/public/v2/i18n/zh-tw.json b/public/v2/i18n/zh-tw.json new file mode 100644 index 0000000000..f5865a2773 --- /dev/null +++ b/public/v2/i18n/zh-tw.json @@ -0,0 +1,35 @@ +{ + "config": { + "html_language": "zh-tw" + }, + "firefly": { + "spent": "\u652f\u51fa", + "left": "\u5269\u9918", + "paid": "\u5df2\u4ed8\u6b3e", + "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", + "unpaid": "\u672a\u4ed8\u6b3e", + "default_group_title_name_plain": "ungrouped", + "subscriptions_in_group": "Subscriptions in group \"%{title}\"", + "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", + "overspent": "\u8d85\u652f", + "money_flowing_in": "\u5728", + "money_flowing_out": "\u5916", + "category": "\u5206\u985e", + "unknown_category_plain": "No category", + "all_money": "All your money", + "unknown_source_plain": "Unknown source account", + "unknown_dest_plain": "Unknown destination account", + "unknown_any_plain": "Unknown account", + "unknown_budget_plain": "No budget", + "stored_journal_js": "Successfully created new transaction \"%{description}\"", + "expense_account": "Expense account", + "revenue_account": "Revenue account", + "budget": "\u9810\u7b97", + "account_type_Asset account": "Asset account", + "account_type_Expense account": "Expense account", + "account_type_Revenue account": "Revenue account", + "account_type_Debt": "\u8ca0\u50b5", + "account_type_Loan": "\u8cb8\u6b3e", + "account_type_Mortgage": "\u62b5\u62bc" + } +} \ No newline at end of file diff --git a/public/v2/i18n/zh_CN.json b/public/v2/i18n/zh_CN.json deleted file mode 100644 index 6f1b308c91..0000000000 --- a/public/v2/i18n/zh_CN.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "zh_CN": { - "config": { - "html_language": "zh-cn" - }, - "firefly": { - "spent": "\u652f\u51fa", - "left": "\u5269\u4f59", - "paid": "\u5df2\u4ed8\u6b3e", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\u672a\u4ed8\u6b3e", - "default_group_title_name_plain": "\u672a\u5206\u7ec4", - "subscriptions_in_group": "\u5206\u7ec4\u201c%{title}\u201d\u8ba2\u9605", - "subscr_expected_x_times": "\u6b64\u5468\u671f\u9884\u8ba1\u652f\u4ed8%{amount}%{times}\u6b21", - "overspent": "\u8d85\u652f", - "money_flowing_in": "\u6d41\u5165", - "money_flowing_out": "\u6d41\u51fa", - "category": "\u5206\u7c7b", - "unknown_category_plain": "\u6ca1\u6709\u5206\u7c7b", - "all_money": "\u5168\u90e8\u8d44\u91d1", - "unknown_source_plain": "\u672a\u77e5\u6765\u6e90\u8d26\u6237", - "unknown_dest_plain": "\u672a\u77e5\u76ee\u6807\u8d26\u6237", - "unknown_any_plain": "\u672a\u77e5\u8d26\u6237", - "unknown_budget_plain": "\u65e0\u9884\u7b97", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "\u652f\u51fa\u8d26\u6237", - "revenue_account": "\u6536\u5165\u8d26\u6237", - "budget": "\u9884\u7b97", - "account_type_Asset account": "\u8d44\u4ea7\u8d26\u6237", - "account_type_Expense account": "\u652f\u51fa\u8d26\u6237", - "account_type_Revenue account": "\u6536\u5165\u8d26\u6237", - "account_type_Debt": "\u6b20\u6b3e", - "account_type_Loan": "\u8d37\u6b3e", - "account_type_Mortgage": "\u62b5\u62bc" - } - } -} \ No newline at end of file diff --git a/public/v2/i18n/zh_TW.json b/public/v2/i18n/zh_TW.json deleted file mode 100644 index 0c18ce612c..0000000000 --- a/public/v2/i18n/zh_TW.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "zh_TW": { - "config": { - "html_language": "zh-tw" - }, - "firefly": { - "spent": "\u652f\u51fa", - "left": "\u5269\u9918", - "paid": "\u5df2\u4ed8\u6b3e", - "errors_submission": "There was something wrong with your submission. Please check out the errors below: %{errorMessage}", - "unpaid": "\u672a\u4ed8\u6b3e", - "default_group_title_name_plain": "ungrouped", - "subscriptions_in_group": "Subscriptions in group \"%{title}\"", - "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", - "overspent": "\u8d85\u652f", - "money_flowing_in": "\u5728", - "money_flowing_out": "\u5916", - "category": "\u5206\u985e", - "unknown_category_plain": "No category", - "all_money": "All your money", - "unknown_source_plain": "Unknown source account", - "unknown_dest_plain": "Unknown destination account", - "unknown_any_plain": "Unknown account", - "unknown_budget_plain": "No budget", - "stored_journal_js": "Successfully created new transaction \"%{description}\"", - "expense_account": "Expense account", - "revenue_account": "Revenue account", - "budget": "\u9810\u7b97", - "account_type_Asset account": "Asset account", - "account_type_Expense account": "Expense account", - "account_type_Revenue account": "Revenue account", - "account_type_Debt": "\u8ca0\u50b5", - "account_type_Loan": "\u8cb8\u6b3e", - "account_type_Mortgage": "\u62b5\u62bc" - } - } -} \ No newline at end of file diff --git a/resources/assets/v2/pages/dashboard/boxes.js b/resources/assets/v2/pages/dashboard/boxes.js index 31fcb019f3..cdd1260fda 100644 --- a/resources/assets/v2/pages/dashboard/boxes.js +++ b/resources/assets/v2/pages/dashboard/boxes.js @@ -55,7 +55,6 @@ export default () => ({ this.boxData = response.data; window.store.set(boxesCacheKey, response.data); this.generateOptions(this.boxData); - //this.drawChart(); }); }, generateOptions(data) { diff --git a/resources/assets/v2/pages/dashboard/budgets.js b/resources/assets/v2/pages/dashboard/budgets.js index 9c9acb2a0a..903fb9549c 100644 --- a/resources/assets/v2/pages/dashboard/budgets.js +++ b/resources/assets/v2/pages/dashboard/budgets.js @@ -22,17 +22,15 @@ import Dashboard from "../../api/v2/chart/budget/dashboard.js"; import {getDefaultChartSettings} from "../../support/default-chart-settings.js"; import formatMoney from "../../util/format-money.js"; import {Chart} from 'chart.js'; -import {I18n} from "i18n-js"; -import {loadTranslations} from "../../support/load-translations.js"; import {getColors} from "../../support/get-colors.js"; import {getCacheKey} from "../../support/get-cache-key.js"; +import i18next from "i18next"; let currencies = []; let chart = null; let chartData = null; let afterPromises = false; -let i18n; // for translating items in the chart. export default () => ({ loading: false, @@ -105,7 +103,7 @@ export default () => ({ labels: [], datasets: [ { - label: i18n.t('firefly.spent'), + label: i18next.t('firefly.spent'), data: [], borderWidth: 1, stack: 1, @@ -113,7 +111,7 @@ export default () => ({ borderColor: getColors('spent', 'border'), }, { - label: i18n.t('firefly.left'), + label: i18next.t('firefly.left'), data: [], borderWidth: 1, stack: 1, @@ -121,7 +119,7 @@ export default () => ({ borderColor: getColors('left', 'border'), }, { - label: i18n.t('firefly.overspent'), + label: i18next.t('firefly.overspent'), data: [], borderWidth: 1, stack: 1, @@ -174,19 +172,12 @@ export default () => ({ init() { - // console.log('budgets init'); - Promise.all([getVariable('autoConversion', false), getVariable('language', 'en_US')]).then((values) => { - - i18n = new I18n(); - const locale = values[1].replace('-', '_'); - i18n.locale = locale; - loadTranslations(i18n, locale).then(() => { - this.autoConversion = values[0]; - afterPromises = true; - if (false === this.loading) { - this.loadChart(); - } - }); + Promise.all([getVariable('autoConversion', false)]).then((values) => { + this.autoConversion = values[0]; + afterPromises = true; + if (false === this.loading) { + this.loadChart(); + } }); window.store.observe('end', () => { if (!afterPromises) { diff --git a/resources/assets/v2/pages/dashboard/dashboard.js b/resources/assets/v2/pages/dashboard/dashboard.js index a7433873cb..d4d1ea6f25 100644 --- a/resources/assets/v2/pages/dashboard/dashboard.js +++ b/resources/assets/v2/pages/dashboard/dashboard.js @@ -27,26 +27,27 @@ import categories from './categories.js'; import sankey from './sankey.js'; import subscriptions from './subscriptions.js'; import piggies from './piggies.js'; - - import { + ArcElement, + BarController, + BarElement, + CategoryScale, Chart, + Colors, + Filler, + Legend, + LinearScale, LineController, LineElement, PieController, - BarController, - BarElement, - TimeScale, - ArcElement, - LinearScale, - Legend, - Filler, - Colors, - CategoryScale, PointElement, + TimeScale, Tooltip } from "chart.js"; import 'chartjs-adapter-date-fns'; +import {loadTranslations} from "../../support/load-translations.js"; +import {getVariable} from "../../store/get-variable.js"; +import i18next from "i18next"; // register things Chart.register({ @@ -77,13 +78,20 @@ const comps = { piggies }; +//let i18n; + function loadPage(comps) { - Object.keys(comps).forEach(comp => { - console.log(`Loading page component "${comp}"`); - let data = comps[comp](); - Alpine.data(comp, () => data); + Promise.all([getVariable('language', 'en_US')]).then((values) => { + loadTranslations(values[0]).then(() => { + Object.keys(comps).forEach(comp => { + let data = comps[comp](); + Alpine.data(comp, () => data); + }); + Alpine.start(); + }); }); - Alpine.start(); + + } // wait for load until bootstrapped event is received. diff --git a/resources/assets/v2/pages/dashboard/piggies.js b/resources/assets/v2/pages/dashboard/piggies.js index a3001a43c5..3b949d3e05 100644 --- a/resources/assets/v2/pages/dashboard/piggies.js +++ b/resources/assets/v2/pages/dashboard/piggies.js @@ -19,14 +19,12 @@ */ import {getVariable} from "../../store/get-variable.js"; import Get from "../../api/v2/model/piggy-bank/get.js"; -import {I18n} from "i18n-js"; -import {loadTranslations} from "../../support/load-translations.js"; import {getCacheKey} from "../../support/get-cache-key.js"; import {format} from "date-fns"; +import i18next from "i18next"; let apiData = {}; let afterPromises = false; -let i18n; const PIGGY_CACHE_KEY = 'dashboard-piggies-data'; export default () => ({ @@ -84,7 +82,7 @@ export default () => ({ if (0 === current.attributes.percentage) { continue; } - let groupName = current.object_group_title ?? i18n.t('firefly.default_group_title_name_plain'); + let groupName = current.object_group_title ?? i18next.t('firefly.default_group_title_name_plain'); if (!dataSet.hasOwnProperty(groupName)) { dataSet[groupName] = { id: current.object_group_id ?? 0, @@ -130,18 +128,11 @@ export default () => ({ init() { // console.log('piggies init'); apiData = []; - Promise.all([getVariable('autoConversion', false), getVariable('language', 'en_US')]).then((values) => { - - i18n = new I18n(); - const locale = values[1].replace('-', '_'); - i18n.locale = locale; - loadTranslations(i18n, locale).then(() => { - // console.log('piggies after promises'); - afterPromises = true; - this.autoConversion = values[0]; - this.loadPiggyBanks(); - }); + Promise.all([getVariable('autoConversion', false)]).then((values) => { + afterPromises = true; + this.autoConversion = values[0]; + this.loadPiggyBanks(); }); window.store.observe('end', () => { diff --git a/resources/assets/v2/pages/dashboard/sankey.js b/resources/assets/v2/pages/dashboard/sankey.js index c3aca8d4ae..582aae33fc 100644 --- a/resources/assets/v2/pages/dashboard/sankey.js +++ b/resources/assets/v2/pages/dashboard/sankey.js @@ -23,14 +23,13 @@ import {getDefaultChartSettings} from "../../support/default-chart-settings.js"; import {Chart} from 'chart.js'; import {Flow, SankeyController} from 'chartjs-chart-sankey'; import {loadTranslations} from "../../support/load-translations.js"; -import {I18n} from "i18n-js"; import {getCacheKey} from "../../support/get-cache-key.js"; import {format} from "date-fns"; +import i18next from "i18next"; Chart.register({SankeyController, Flow}); const SANKEY_CACHE_KEY = 'dashboard-sankey-data'; -let i18n; let currencies = []; let afterPromises = false; let chart = null; @@ -350,31 +349,26 @@ export default () => ({ init() { // console.log('sankey init'); transactions = []; - Promise.all([getVariable('autoConversion', false), getVariable('language', 'en_US')]).then((values) => { + Promise.all([getVariable('autoConversion', false)]).then((values) => { this.autoConversion = values[0]; autoConversion = values[0]; - i18n = new I18n(); - const locale = values[1].replace('-', '_'); - i18n.locale = locale; - loadTranslations(i18n, locale).then(() => { // some translations: - translations.all_money = i18n.t('firefly.all_money'); - translations.category = i18n.t('firefly.category'); - translations.in = i18n.t('firefly.money_flowing_in'); - translations.out = i18n.t('firefly.money_flowing_out'); - translations.unknown_category = i18n.t('firefly.unknown_category_plain'); - translations.unknown_source = i18n.t('firefly.unknown_source_plain'); - translations.unknown_dest = i18n.t('firefly.unknown_dest_plain'); - translations.unknown_account = i18n.t('firefly.unknown_any_plain'); - translations.unknown_budget = i18n.t('firefly.unknown_budget_plain'); - translations.expense_account = i18n.t('firefly.expense_account'); - translations.revenue_account = i18n.t('firefly.revenue_account'); - translations.budget = i18n.t('firefly.budget'); + translations.all_money = i18next.t('firefly.all_money'); + translations.category = i18next.t('firefly.category'); + translations.in = i18next.t('firefly.money_flowing_in'); + translations.out = i18next.t('firefly.money_flowing_out'); + translations.unknown_category = i18next.t('firefly.unknown_category_plain'); + translations.unknown_source = i18next.t('firefly.unknown_source_plain'); + translations.unknown_dest = i18next.t('firefly.unknown_dest_plain'); + translations.unknown_account = i18next.t('firefly.unknown_any_plain'); + translations.unknown_budget = i18next.t('firefly.unknown_budget_plain'); + translations.expense_account = i18next.t('firefly.expense_account'); + translations.revenue_account = i18next.t('firefly.revenue_account'); + translations.budget = i18next.t('firefly.budget'); // console.log('sankey after promises'); afterPromises = true; this.loadChart(); - }); }); window.store.observe('end', () => { diff --git a/resources/assets/v2/pages/dashboard/subscriptions.js b/resources/assets/v2/pages/dashboard/subscriptions.js index 4027f7cdde..6a90e1f2d3 100644 --- a/resources/assets/v2/pages/dashboard/subscriptions.js +++ b/resources/assets/v2/pages/dashboard/subscriptions.js @@ -20,17 +20,14 @@ import {getVariable} from "../../store/get-variable.js"; import Get from "../../api/v2/model/subscription/get.js"; import {format} from "date-fns"; -import {I18n} from "i18n-js"; -import {loadTranslations} from "../../support/load-translations.js"; import {getCacheKey} from "../../support/get-cache-key.js"; import {Chart} from "chart.js"; import formatMoney from "../../util/format-money.js"; - +import i18next from "i18next"; // let chart = null; // let chartData = null; let afterPromises = false; -let i18n; // for translating items in the chart. let apiData = []; let subscriptionData = {}; @@ -47,7 +44,7 @@ function downloadSubscriptions(params) { //console.log(current); if (current.attributes.active && current.attributes.pay_dates.length > 0) { let objectGroupId = null === current.attributes.object_group_id ? 0 : current.attributes.object_group_id; - let objectGroupTitle = null === current.attributes.object_group_title ? i18n.t('firefly.default_group_title_name_plain') : current.attributes.object_group_title; + let objectGroupTitle = null === current.attributes.object_group_title ? i18next.t('firefly.default_group_title_name_plain') : current.attributes.object_group_title; let objectGroupOrder = null === current.attributes.object_group_order ? 0 : current.attributes.object_group_order; if (!subscriptionData.hasOwnProperty(objectGroupId)) { subscriptionData[objectGroupId] = { @@ -84,7 +81,7 @@ function downloadSubscriptions(params) { // set variables bill.expected_amount = params.autoConversion ? formatMoney(bill.native_amount, bill.native_currency_code) : formatMoney(bill.amount, bill.currency_code); - bill.expected_times = i18n.t('firefly.subscr_expected_x_times', { + bill.expected_times = i18next.t('firefly.subscr_expected_x_times', { times: current.attributes.pay_dates.length, amount: bill.expected_amount }); @@ -198,7 +195,6 @@ export default () => ({ // reset subscription data subscriptionData = {}; this.subscriptions = []; - console.log('cache is invalid, must download'); let params = { start: format(start, 'y-MM-dd'), end: format(end, 'y-MM-dd'), @@ -206,7 +202,6 @@ export default () => ({ page: 1 }; downloadSubscriptions(params).then(() => { - console.log('Done with download!'); let set = Object.values(subscriptionData); // convert subscriptionData to usable data (especially for the charts) for (let i in set) { @@ -236,11 +231,11 @@ export default () => ({ const currencyCode = this.autoConversion ? data.native_currency_code : data.currency_code; const chartData = { labels: [ - i18n.t('firefly.paid'), - i18n.t('firefly.unpaid') + i18next.t('firefly.paid'), + i18next.t('firefly.unpaid') ], datasets: [{ - label: i18n.t('firefly.subscriptions_in_group', {title: groupTitle}), + label: i18next.t('firefly.subscriptions_in_group', {title: groupTitle}), data: [paidAmount, unpaidAmount], backgroundColor: [ 'rgb(54, 162, 235)', @@ -272,20 +267,13 @@ export default () => ({ }, init() { - console.log('subscriptions init'); - Promise.all([getVariable('autoConversion', false), getVariable('language', 'en_US')]).then((values) => { - console.log('subscriptions after promises'); + Promise.all([getVariable('autoConversion', false)]).then((values) => { this.autoConversion = values[0]; afterPromises = true; - i18n = new I18n(); - const locale = values[1].replace('-', '_'); - i18n.locale = locale; - loadTranslations(i18n, locale).then(() => { - if (false === this.loading) { - this.startSubscriptions(); - } - }); + if (false === this.loading) { + this.startSubscriptions(); + } }); @@ -293,7 +281,6 @@ export default () => ({ if (!afterPromises) { return; } - console.log('subscriptions observe end'); if (false === this.loading) { this.startSubscriptions(); } @@ -302,7 +289,6 @@ export default () => ({ if (!afterPromises) { return; } - console.log('subscriptions observe autoConversion'); this.autoConversion = newValue; if (false === this.loading) { this.startSubscriptions(); diff --git a/resources/assets/v2/pages/shared/dates.js b/resources/assets/v2/pages/shared/dates.js index 0982e02ce7..0942252c3c 100644 --- a/resources/assets/v2/pages/shared/dates.js +++ b/resources/assets/v2/pages/shared/dates.js @@ -33,6 +33,7 @@ import { subMonths } from "date-fns"; import format from '../../util/format' +import i18next from "i18next"; export default () => ({ range: { @@ -44,8 +45,7 @@ export default () => ({ language: 'en_US', init() { - // console.log('Dates init'); - + console.log(`Loading page component "DATES" with language "${i18next.t('key')}".`); this.range = { start: new Date(window.store.get('start')), end: new Date(window.store.get('end')) @@ -67,23 +67,6 @@ export default () => ({ this.range.end = new Date(newValue); this.buildDateRange(); }); - - //this.range = this.setDatesFromViewRange(this.range.start); - // get values from store and use them accordingly. - // this.viewRange = window.BasicStore.get('viewRange'); - // this.locale = window.BasicStore.get('locale'); - // this.language = window.BasicStore.get('language'); - // this.locale = 'equal' === this.locale ? this.language : this.locale; - // window.__localeId__ = this.language; - // - // // the range is always null but later on we will store it in BasicStore. - // if (null === this.range.start && null === this.range.end) { - // console.log('start + end = null, calling setDatesFromViewRange()'); - // this.range = this.setDatesFromViewRange(new Date); - // } - // console.log('MainApp: set defaultRange'); - // this.defaultRange = this.setDatesFromViewRange(new Date); - // // default range is always the current period (initialized ahead) }, diff --git a/resources/assets/v2/pages/transactions/create.js b/resources/assets/v2/pages/transactions/create.js index 6d51844392..f6557d603a 100644 --- a/resources/assets/v2/pages/transactions/create.js +++ b/resources/assets/v2/pages/transactions/create.js @@ -25,7 +25,6 @@ import {parseFromEntries} from "./shared/parse-from-entries.js"; import formatMoney from "../../util/format-money.js"; import Post from "../../api/v2/model/transaction/post.js"; import {getVariable} from "../../store/get-variable.js"; -import {I18n} from "i18n-js"; import {loadTranslations} from "../../support/load-translations.js"; import {loadCurrencies} from "./shared/load-currencies.js"; import {loadBudgets} from "./shared/load-budgets.js"; @@ -46,14 +45,13 @@ import {processAttachments} from "./shared/process-attachments.js"; import {spliceErrorsIntoTransactions} from "./shared/splice-errors-into-transactions.js"; import Tags from "bootstrap5-tags"; import {addLocation} from "./shared/manage-locations.js"; +import i18next from "i18next"; // TODO upload attachments to other file // TODO fix two maps, perhaps disconnect from entries entirely. // TODO group title // TODO map location from preferences // TODO field preferences -let i18n; - const urls = getUrls(); let transactions = function () { @@ -272,21 +270,13 @@ let transactions = function () { this.notifications.wait.show = false; this.notifications.error.show = true; this.formStates.isSubmitting = false; - this.notifications.error.text = i18n.t('firefly.errors_upload'); + this.notifications.error.text = i18next.t('firefly.errors_upload'); console.error(event); }, init() { - // get translations - // TODO loading translations could be better, but do this later. - Promise.all([getVariable('language', 'en_US')]).then((values) => { - i18n = new I18n(); - const locale = values[0].replace('-', '_'); - i18n.locale = locale; - loadTranslations(i18n, locale).then(() => { - this.addSplit(); - }); - }); + this.addSplit(); + // load currencies and save in form data. loadCurrencies().then(data => { this.formStates.loadingCurrencies = false; @@ -389,7 +379,7 @@ let transactions = function () { if (attachmentCount > 0) { // if count is more than zero, system is processing transactions in the background. this.notifications.wait.show = true; - this.notifications.wait.text = i18n.t('firefly.wait_attachments'); + this.notifications.wait.text = i18next.t('firefly.wait_attachments'); return; } @@ -418,7 +408,7 @@ let transactions = function () { this.notifications.success.show = true; this.notifications.success.url = 'transactions/show/' + this.groupProperties.id; - this.notifications.success.text = i18n.t('firefly.stored_journal_js', {description: this.groupProperties.title}); + this.notifications.success.text = i18next.t('firefly.stored_journal_js', {description: this.groupProperties.title}); if (this.formStates.resetButton) { this.entries = []; @@ -436,7 +426,7 @@ let transactions = function () { this.notifications.success.show = false; this.notifications.wait.show = false; this.formStates.isSubmitting = false; - this.notifications.error.text = i18n.t('firefly.errors_submission', {errorMessage: data.message}); + this.notifications.error.text = i18next.t('firefly.errors_submission', {errorMessage: data.message}); if (data.hasOwnProperty('errors')) { this.entries = spliceErrorsIntoTransactions(i18n, data.errors, this.entries); @@ -454,7 +444,7 @@ let transactions = function () { liveServer: true, clearEnd: true, allowNew: true, - notFoundMessage: i18n.t('firefly.nothing_found'), + notFoundMessage: i18next.t('firefly.nothing_found'), noCache: true, fetchOptions: { headers: { @@ -469,7 +459,7 @@ let transactions = function () { // addedSplit, is called from the HTML // for source account const renderAccount = function (item, b, c) { - return item.name_with_balance + '
' + i18n.t('firefly.account_type_' + item.type) + ''; + return item.name_with_balance + '
' + i18next.t('firefly.account_type_' + item.type) + ''; }; addAutocomplete({ selector: 'input.ac-source', diff --git a/resources/assets/v2/pages/transactions/edit.js b/resources/assets/v2/pages/transactions/edit.js index 5cd83d1e46..9785aec8ba 100644 --- a/resources/assets/v2/pages/transactions/edit.js +++ b/resources/assets/v2/pages/transactions/edit.js @@ -21,7 +21,6 @@ import '../../boot/bootstrap.js'; import dates from '../../pages/shared/dates.js'; import {getVariable} from "../../store/get-variable.js"; -import {I18n} from "i18n-js"; import {loadTranslations} from "../../support/load-translations.js"; import formatMoney from "../../util/format-money.js"; import Get from "../../api/v2/model/transaction/get.js"; @@ -40,6 +39,7 @@ import {loadBudgets} from "./shared/load-budgets.js"; import {loadPiggyBanks} from "./shared/load-piggy-banks.js"; import {loadSubscriptions} from "./shared/load-subscriptions.js"; import Tags from "bootstrap5-tags"; +import i18next from "i18next"; // TODO upload attachments to other file // TODO fix two maps, perhaps disconnect from entries entirely. @@ -49,7 +49,6 @@ import Tags from "bootstrap5-tags"; // TODO filters // TODO parse amount -let i18n; const urls = getUrls(); let transactions = function () { @@ -116,7 +115,7 @@ let transactions = function () { // addedSplit, is called from the HTML // for source account const renderAccount = function (item, b, c) { - return item.name_with_balance + '
' + i18n.t('firefly.account_type_' + item.type) + ''; + return item.name_with_balance + '
' + i18next.t('firefly.account_type_' + item.type) + ''; }; addAutocomplete({ selector: 'input.ac-source', @@ -218,7 +217,7 @@ let transactions = function () { liveServer: true, clearEnd: true, allowNew: true, - notFoundMessage: i18n.t('firefly.nothing_found'), + notFoundMessage: i18next.t('firefly.nothing_found'), noCache: true, fetchOptions: { headers: { @@ -232,17 +231,9 @@ let transactions = function () { init() { // download translations and get the transaction group. - Promise.all([getVariable('language', 'en_US')]).then((values) => { - i18n = new I18n(); - const locale = values[0].replace('-', '_'); - i18n.locale = locale; - loadTranslations(i18n, locale).then(() => { - //this.addSplit(); - this.notifications.wait.show = true; - this.notifications.wait.text = i18n.t('firefly.wait_loading_transaction'); - this.getTransactionGroup(); - }); - }); + this.notifications.wait.show = true; + this.notifications.wait.text = i18next.t('firefly.wait_loading_transaction'); + this.getTransactionGroup(); // load meta data. loadCurrencies().then(data => { diff --git a/resources/assets/v2/support/load-translations.js b/resources/assets/v2/support/load-translations.js index 17162a8065..bab2a39fce 100644 --- a/resources/assets/v2/support/load-translations.js +++ b/resources/assets/v2/support/load-translations.js @@ -18,16 +18,49 @@ * along with this program. If not, see . */ -let loaded = false; -async function loadTranslations(i18n, locale) { - if (false === loaded) { - locale = locale.replace('-', '_'); - const response = await fetch(`./v2/i18n/${locale}.json`); - const translations = await response.json(); - i18n.store(translations); +import i18next from "i18next"; +import ChainedBackend from "i18next-chained-backend"; +import HttpBackend from "i18next-http-backend"; +import LocalStorageBackend from "i18next-localstorage-backend"; + + + + +let loaded = false; +let count = 0; + +function loadTranslations(locale) { + if (false === loaded && 0 === count) { + console.log('Loading translations: ' + count); + const replacedLocale = locale.replace('-', '_'); + loaded = true; + count++; + + return i18next + .use(ChainedBackend) + .init({ + fallbackLng: "en_US", + lng: replacedLocale, + debug: true, + // ... your i18next config + backend: { + backends: [ + LocalStorageBackend, + HttpBackend + ], + backendOptions: [{ + expirationTime: 7 * 24 * 60 * 60 * 1000 // 7 days + }, { + // const response = await fetch(`./v2/i18n/${locale}.json`); + loadPath: './v2/i18n/{{lng}}.json' + }] + } + }); } - //loaded = true; + count++; + console.warn('Loading translations skipped because count is:' + count); + return Promise.resolve(); } export {loadTranslations}; From 70b60f756bef20dadcbd5303ed025c937353f3cb Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 7 Jan 2024 07:02:53 +0100 Subject: [PATCH 07/39] Rebuild frontend [skip ci] --- ....js => autocomplete-functions-3410a57d.js} | 2 +- public/build/assets/create-8992c704.js | 1 + public/build/assets/create-d5d549ca.js | 1 - public/build/assets/dashboard-1d6bb3a8.js | 1 + public/build/assets/dashboard-e693d6f4.js | 1 - public/build/assets/edit-9f80420b.js | 1 - public/build/assets/edit-ab5008f2.js | 1 + public/build/assets/get-51a7c3ed.js | 1 + .../{get-c2292133.js => get-c23f6e9c.js} | 2 +- public/build/assets/get-c53daca3.js | 1 - public/build/assets/vendor-4332182f.js | 52 --------------- public/build/assets/vendor-824d08a0.js | 53 +++++++++++++++ public/build/manifest.json | 64 +++++++++---------- 13 files changed, 91 insertions(+), 90 deletions(-) rename public/build/assets/{autocomplete-functions-31caaca5.js => autocomplete-functions-3410a57d.js} (98%) create mode 100644 public/build/assets/create-8992c704.js delete mode 100644 public/build/assets/create-d5d549ca.js create mode 100644 public/build/assets/dashboard-1d6bb3a8.js delete mode 100644 public/build/assets/dashboard-e693d6f4.js delete mode 100644 public/build/assets/edit-9f80420b.js create mode 100644 public/build/assets/edit-ab5008f2.js create mode 100644 public/build/assets/get-51a7c3ed.js rename public/build/assets/{get-c2292133.js => get-c23f6e9c.js} (64%) delete mode 100644 public/build/assets/get-c53daca3.js delete mode 100644 public/build/assets/vendor-4332182f.js create mode 100644 public/build/assets/vendor-824d08a0.js diff --git a/public/build/assets/autocomplete-functions-31caaca5.js b/public/build/assets/autocomplete-functions-3410a57d.js similarity index 98% rename from public/build/assets/autocomplete-functions-31caaca5.js rename to public/build/assets/autocomplete-functions-3410a57d.js index 8d7a04bb34..1df7865161 100644 --- a/public/build/assets/autocomplete-functions-31caaca5.js +++ b/public/build/assets/autocomplete-functions-3410a57d.js @@ -1 +1 @@ -import{f as m,m as p}from"./vendor-4332182f.js";import{a as _,b as f,G as g}from"./get-c53daca3.js";function l(){return{id:"",name:"",alpine_name:""}}function y(){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 I(){let t=m(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",foreign_amount:"",foreign_currency_code:"",source_account:l(),destination_account:l(),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:y()}}let b=class{list(t){return _.get("/api/v2/currencies",{params:t})}};function x(){let e={page:1,limit:1337};return new b().list(e).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 i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i];if(r.attributes.enabled){let u={id:r.id,name:r.attributes.name,code:r.attributes.code,default:r.attributes.default,symbol:r.attributes.symbol,decimal_places:r.attributes.decimal_places};u.default&&(n.defaultCurrency=u),n.enabledCurrencies.push(u),n.nativeCurrencies.push(u),n.foreignCurrencies.push(u)}}return n})}class h{list(t){return _.get("/api/v2/budgets",{params:t})}}function q(){let e={page:1,limit:1337};return new h().list(e).then(a=>{let n=[{id:0,name:"(no budget)"}];for(let i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i],u={id:r.id,name:r.attributes.name};n.push(u)}return n})}function C(){let e={page:1,limit:1337};return new f().list(e).then(a=>{let n={0:{id:0,name:"(no group)",order:0,piggyBanks:[{id:0,name:"(no piggy bank)",order:0}]}};for(let i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i],u=r.attributes.object_group_id??"0",c=r.attributes.object_group_title??"(no group)",o={id:r.id,name:r.attributes.name,order:r.attributes.order};n.hasOwnProperty(u)||(n[u]={id:u,name:c,order:r.attributes.object_group_order??0,piggyBanks:[]}),n[u].piggyBanks.push(o),n[u].piggyBanks.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{})})}function w(){let e={page:1,limit:1337};return new g().list(e).then(a=>{let n={0:{id:0,name:"(no group)",order:0,subscriptions:[{id:0,name:"(no subscription)",order:0}]}};for(let i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i],u=r.attributes.object_group_id??"0",c=r.attributes.object_group_title??"(no group)",o={id:r.id,name:r.attributes.name,order:r.attributes.order};n.hasOwnProperty(u)||(n[u]={id:u,name:c,order:r.attributes.object_group_order??0,subscriptions:[]}),n[u].subscriptions.push(o),n[u].subscriptions.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{})})}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 $(e){const t={server:e.serverUrl,serverParams:{},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,highlightTyped:!0,liveServer:!0};typeof e.filters<"u"&&e.filters.length>0&&(t.serverParams.types=e.filters),typeof e.onRenderItem<"u"&&e.onRenderItem!==null&&(t.onRenderItem=e.onRenderItem),e.valueField&&(t.valueField=e.valueField),e.labelField&&(t.labelField=e.labelField),e.onSelectItem&&(t.onSelectItem=e.onSelectItem),e.onChange&&(t.onChange=e.onChange),e.hiddenValue&&(t.hiddenValue=e.hiddenValue),p.init(e.selector,t)}function A(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof e<"u"&&e.name){document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=e.name;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=t._searchInput.value}function G(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof e<"u"&&e.description){document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=e.description;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=t._searchInput.value}function O(e,t){if(typeof e>"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 B(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={id:e.id,name:e.name,alpine_name:e.name,type:e.type,currency_code:e.currency_code},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}function P(e,t){if(typeof e>"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 D(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={id:e.id,name:e.name,alpine_name:e.name,type:e.type,currency_code:e.currency_code},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}export{q as a,C as b,w as c,y as d,I as e,$ as f,P as g,O as h,B as i,j,A as k,x as l,G as m,D as s}; +import{f as m,r as p}from"./vendor-824d08a0.js";import{a as _,b as f,G as g}from"./get-51a7c3ed.js";function l(){return{id:"",name:"",alpine_name:""}}function y(){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 I(){let t=m(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",foreign_amount:"",foreign_currency_code:"",source_account:l(),destination_account:l(),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:y()}}let b=class{list(t){return _.get("/api/v2/currencies",{params:t})}};function x(){let e={page:1,limit:1337};return new b().list(e).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 i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i];if(r.attributes.enabled){let u={id:r.id,name:r.attributes.name,code:r.attributes.code,default:r.attributes.default,symbol:r.attributes.symbol,decimal_places:r.attributes.decimal_places};u.default&&(n.defaultCurrency=u),n.enabledCurrencies.push(u),n.nativeCurrencies.push(u),n.foreignCurrencies.push(u)}}return n})}class h{list(t){return _.get("/api/v2/budgets",{params:t})}}function q(){let e={page:1,limit:1337};return new h().list(e).then(a=>{let n=[{id:0,name:"(no budget)"}];for(let i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i],u={id:r.id,name:r.attributes.name};n.push(u)}return n})}function C(){let e={page:1,limit:1337};return new f().list(e).then(a=>{let n={0:{id:0,name:"(no group)",order:0,piggyBanks:[{id:0,name:"(no piggy bank)",order:0}]}};for(let i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i],u=r.attributes.object_group_id??"0",c=r.attributes.object_group_title??"(no group)",o={id:r.id,name:r.attributes.name,order:r.attributes.order};n.hasOwnProperty(u)||(n[u]={id:u,name:c,order:r.attributes.object_group_order??0,piggyBanks:[]}),n[u].piggyBanks.push(o),n[u].piggyBanks.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{})})}function w(){let e={page:1,limit:1337};return new g().list(e).then(a=>{let n={0:{id:0,name:"(no group)",order:0,subscriptions:[{id:0,name:"(no subscription)",order:0}]}};for(let i in a.data.data)if(a.data.data.hasOwnProperty(i)){let r=a.data.data[i],u=r.attributes.object_group_id??"0",c=r.attributes.object_group_title??"(no group)",o={id:r.id,name:r.attributes.name,order:r.attributes.order};n.hasOwnProperty(u)||(n[u]={id:u,name:c,order:r.attributes.object_group_order??0,subscriptions:[]}),n[u].subscriptions.push(o),n[u].subscriptions.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{})})}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 $(e){const t={server:e.serverUrl,serverParams:{},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,highlightTyped:!0,liveServer:!0};typeof e.filters<"u"&&e.filters.length>0&&(t.serverParams.types=e.filters),typeof e.onRenderItem<"u"&&e.onRenderItem!==null&&(t.onRenderItem=e.onRenderItem),e.valueField&&(t.valueField=e.valueField),e.labelField&&(t.labelField=e.labelField),e.onSelectItem&&(t.onSelectItem=e.onSelectItem),e.onChange&&(t.onChange=e.onChange),e.hiddenValue&&(t.hiddenValue=e.hiddenValue),p.init(e.selector,t)}function A(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof e<"u"&&e.name){document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=e.name;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=t._searchInput.value}function G(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof e<"u"&&e.description){document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=e.description;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=t._searchInput.value}function O(e,t){if(typeof e>"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 B(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={id:e.id,name:e.name,alpine_name:e.name,type:e.type,currency_code:e.currency_code},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}function P(e,t){if(typeof e>"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 D(e,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={id:e.id,name:e.name,alpine_name:e.name,type:e.type,currency_code:e.currency_code},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}export{q as a,C as b,w as c,y as d,I as e,$ as f,P as g,O as h,B as i,j,A as k,x as l,G as m,D as s}; diff --git a/public/build/assets/create-8992c704.js b/public/build/assets/create-8992c704.js new file mode 100644 index 0000000000..a0c3a48d6f --- /dev/null +++ b/public/build/assets/create-8992c704.js @@ -0,0 +1 @@ +import{a as v,d as E,f as _}from"./get-51a7c3ed.js";import{l as P,a as S,b as T,c as L,d as k,e as A,f as h,g as x,s as D,h as O,i as B,j as F,k as y,m as w}from"./autocomplete-functions-3410a57d.js";import{o as g,i as d,q as z}from"./vendor-824d08a0.js";function M(e,n){let t=[];for(let r in e)if(e.hasOwnProperty(r)){const o=e[r];let i={};i.description=o.description,i.source_name=o.source_account.name,i.destination_name=o.destination_account.name,i.amount=o.amount,i.currency_code=o.currency_code,i.date=o.date,i.interest_date=o.interest_date,i.book_date=o.book_date,i.process_date=o.process_date,i.due_date=o.due_date,i.payment_date=o.payment_date,i.invoice_date=o.invoice_date,i.budget_id=o.budget_id,i.category_name=o.category_name,i.piggy_bank_id=o.piggy_bank_id,i.bill_id=o.bill_id,i.tags=o.tags,i.notes=o.notes,i.internal_reference=o.internal_reference,i.external_url=o.external_url,i.store_location=!1,o.hasLocation&&(i.store_location=!0,i.longitude=o.longitude.toString(),i.latitude=o.latitude.toString(),i.zoom_level=o.zoomLevel),typeof o.foreign_currency_code<"u"&&o.foreign_currency_code.toString()!==""&&(i.foreign_currency_code=o.foreign_currency_code,typeof o.foreign_amount<"u"&&o.foreign_amount.toString()!==""&&(i.foreign_amount=o.foreign_amount),(typeof o.foreign_amount>"u"||o.foreign_amount.toString()==="")&&(delete i.foreign_amount,delete i.foreign_currency_code)),typeof o.source_account.id<"u"&&o.source_account.id.toString()!==""&&(i.source_id=o.source_account.id),typeof o.destination_account.id<"u"&&o.destination_account.id.toString()!==""&&(i.destination_id=o.destination_account.id),i.type=n,t.push(i)}return t}let U=class{post(n){let t="/api/v2/transactions";return v.post(t,n)}};class I{post(n,t,r){let o="/api/v1/attachments";return v.post(o,{filename:n,attachable_type:t,attachable_id:r})}upload(n,t){let r="./api/v1/attachments/"+n+"/upload";return axios.post(r,t)}}let R=function(e){let n=e.length,t=0,r=!1;for(const o in e)if(e.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294&&r===!1){let i=new I;i.post(e[o].name,"TransactionJournal",e[o].journal).then(s=>{let a=parseInt(s.data.data.id);i.upload(a,e[o].content).then(u=>{if(t++,t===n){const l=new CustomEvent("upload-success",{some:"details"});document.dispatchEvent(l)}}).catch(u=>{console.error("Could not upload"),console.error(u),t++;const l=new CustomEvent("upload-failed",{error:u});document.dispatchEvent(l),r=!0})}).catch(s=>{console.error("Could not create upload."),console.error(s),t++;const a=new CustomEvent("upload-failed",{error:s});document.dispatchEvent(a),r=!0})}};function N(e,n){n=n.reverse();let t=[],r=0,o=[],i=document.querySelectorAll('input[name="attachments[]"]');for(const s in i)if(i.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294)for(const a in i[s].files)i[s].files.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&(t.push({journal:n[s].transaction_journal_id,file:i[s].files[a]}),r++);for(const s in t)t.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&function(a,u){let l=new FileReader;l.onloadend=function(m){m.target.readyState===FileReader.DONE&&(o.push({name:t[u].file.name,journal:t[u].journal,content:new Blob([m.target.result])}),o.length===r&&R(o))},l.readAsArrayBuffer(a.file)}(t[s],s);return r}function $(e,n,t){let r=[];for(let o in t)t.hasOwnProperty(o)&&r.push(t[o].replace(e,n));return r}function j(e,n,t){let r,o,i;for(const s in n)if(n.hasOwnProperty(s)){if(s==="group_title"){console.error("Cannot handle error in group title.");continue}if(r=parseInt(s.split(".")[1]),o=s.split(".")[2],i=$(s,o,n[s]),!t.hasOwnProperty(r)){console.error("Cannot handle errors in index #"+r);continue}switch(o){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[r].errors[o]=i;break;case"source_name":case"source_id":t[r].errors.source_account=t[r].errors.source_account.concat(i);break;case"type":t[r].errors.source_account=t[r].errors.source_account.concat([e.t("validation.bad_type_source")]),t[r].errors.destination_account=t[r].errors.destination_account.concat([e.t("validation.bad_type_destination")]);break;case"destination_name":case"destination_id":t[r].errors.destination_account=t[r].errors.destination_account.concat(i);break;case"foreign_amount":case"foreign_currency_id":t[r].errors.foreign_amount=t[r].errors.foreign_amount.concat(i);break}typeof t[r]<"u"&&(t[r].errors.source_account=Array.from(new Set(t[r].errors.source_account)),t[r].errors.destination_account=Array.from(new Set(t[r].errors.destination_account)))}return console.log(t[0].errors),t}let c=[],f=[];document.addEventListener("location-remove",e=>{f[e.detail.index].remove()});function q(e){let n=0;if(document.querySelector("#form")._x_dataStack[0].$data.entries[n].hasLocation===!1){f[n]=new g.marker(e.latlng,{draggable:!0}),f[n].on("dragend",H),f[n].addTo(c[n]);const r=new CustomEvent("location-set",{detail:{latitude:e.latlng.lat,longitude:e.latlng.lng,index:n,zoomLevel:c[n].getZoom()}});document.dispatchEvent(r)}}function Z(e){let n=0;const t=new CustomEvent("location-zoom",{detail:{index:n,zoomLevel:c[n].getZoom()}});document.dispatchEvent(t)}function H(e){let n=e.target,t=n.getLatLng();n.setLatLng(new g.LatLng(t.lat,t.lng),{draggable:"true"});const r=new CustomEvent("location-move",{detail:{latitude:t.lat,longitude:t.lng,index:0}});document.dispatchEvent(r)}function K(e){if(e>0){console.warn("Corwardly refuse to add a map on split #"+(e+1));return}if(typeof c[e]>"u"){let n=document.getElementById("location_map");c[e]=g.map(n).setView([n.dataset.latitude,n.dataset.longitude],n.dataset.zoomLevel),g.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© OpenStreetMap'}).addTo(c[e]),c[e].on("click",q),c[e].on("zoomend",Z)}}const p=F();let V=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",n=this.entries[0].destination_account.type??"unknown";if(e==="unknown"&&n==="unknown"){this.groupProperties.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(e===n&&["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(n)){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"&&n==="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)&&n==="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(n)){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(e)&&n==="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 "'+n+'".')},formattedTotalAmount(){return this.entries.length===0?_(this.groupProperties.totalAmount,"EUR"):_(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},filterForeignCurrencies(e){let n=[],t;for(let r in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(r)){let o=this.formData.enabledCurrencies[r];o.code===e&&(t=o)}n.push(t),this.formData.foreignCurrencies=n,n.length===1&&n[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),n.length===1&&n[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 r in this.entries)this.entries.hasOwnProperty(r)&&(this.entries[r].foreign_currency_code=e)},filterNativeCurrencies(e){let n=[],t;for(let r in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(r)){let o=this.formData.enabledCurrencies[r];o.code===e&&(t=o)}n.push(t),this.formData.nativeCurrencies=n;for(let r in this.entries)this.entries.hasOwnProperty(r)&&(this.entries[r].currency_code=e)},changedAmount(e){const n=parseInt(e.target.dataset.index);this.entries[n].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[t].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=d.t("firefly.errors_upload"),console.error(e)},init(){this.addSplit(),P().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}),S().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),T().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),L().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 r in this.entries)this.entries.hasOwnProperty(r)&&(this.entries[r].errors=k());this.formStates.isSubmitting=!0,this.detectTransactionType();let e=M(this.entries,this.groupProperties.transactionType),n={group_title:this.groupProperties.title,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:e};this.groupProperties.title===null&&e.length>1&&(n.group_title=e[0].description);let t=new U;console.log(n),t.post(n).then(r=>{const o=r.data.data;if(this.groupProperties.id=parseInt(o.id),this.groupProperties.title=o.attributes.group_title??o.attributes.transactions[0].description,N(this.groupProperties.id,o.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=d.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(r=>{this.submitting=!1,console.log(r),typeof r.response<"u"&&this.parseErrors(r.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=d.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=d.t("firefly.errors_submission",{errorMessage:e.message}),e.hasOwnProperty("errors")&&(this.entries=j(i18n,e.errors,this.entries))},addSplit(){this.entries.push(A()),setTimeout(()=>{z.init("select.ac-tags",{allowClear:!0,server:p.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:d.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;K(e);const n=function(t,r,o){return t.name_with_balance+'
'+d.t("firefly.account_type_"+t.type)+""};h({selector:"input.ac-source",serverUrl:p.account,onChange:x,onSelectItem:D,hiddenValue:this.items[e].source_account.alpine_name}),h({selector:"input.ac-dest",serverUrl:p.account,filters:this.filters.destination,onRenderItem:n,onChange:O,onSelectItem:B}),h({selector:"input.ac-category",serverUrl:p.category,valueField:"id",labelField:"name",onChange:y,onSelectItem:y}),h({selector:"input.ac-description",serverUrl:p.description,valueField:"id",labelField:"description",onChange:w,onSelectItem:w})},150)},removeSplit(e){this.entries.splice(e,1),document.querySelector("#split-0-tab").click()},clearLocation(e){e.preventDefault();const n=e.currentTarget,t=parseInt(n.attributes["data-index"].value);this.entries[t].hasLocation=!1,this.entries[t].latitude=null,this.entries[t].longitude=null,this.entries[t].zoomLevel=null;const r=new CustomEvent("location-remove",{detail:{index:t}});return document.dispatchEvent(r),!1}}},b={transactions:V,dates:E};function C(){Object.keys(b).forEach(e=>{console.log(`Loading page component "${e}"`);let n=b[e]();Alpine.data(e,()=>n)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),C()});window.bootstrapped&&(console.log("Loaded through window variable."),C()); diff --git a/public/build/assets/create-d5d549ca.js b/public/build/assets/create-d5d549ca.js deleted file mode 100644 index dbeac69f59..0000000000 --- a/public/build/assets/create-d5d549ca.js +++ /dev/null @@ -1 +0,0 @@ -import{a as v,d as P,f as _,g as E,l as S}from"./get-c53daca3.js";import{l as T,a as L,b as k,c as A,d as x,e as D,f as h,g as O,s as B,h as F,i as I,j as U,k as y,m as w}from"./autocomplete-functions-31caaca5.js";import{k as g,I as z,l as M}from"./vendor-4332182f.js";function R(e,t){let o=[];for(let r in e)if(e.hasOwnProperty(r)){const n=e[r];let i={};i.description=n.description,i.source_name=n.source_account.name,i.destination_name=n.destination_account.name,i.amount=n.amount,i.currency_code=n.currency_code,i.date=n.date,i.interest_date=n.interest_date,i.book_date=n.book_date,i.process_date=n.process_date,i.due_date=n.due_date,i.payment_date=n.payment_date,i.invoice_date=n.invoice_date,i.budget_id=n.budget_id,i.category_name=n.category_name,i.piggy_bank_id=n.piggy_bank_id,i.bill_id=n.bill_id,i.tags=n.tags,i.notes=n.notes,i.internal_reference=n.internal_reference,i.external_url=n.external_url,i.store_location=!1,n.hasLocation&&(i.store_location=!0,i.longitude=n.longitude.toString(),i.latitude=n.latitude.toString(),i.zoom_level=n.zoomLevel),typeof n.foreign_currency_code<"u"&&n.foreign_currency_code.toString()!==""&&(i.foreign_currency_code=n.foreign_currency_code,typeof n.foreign_amount<"u"&&n.foreign_amount.toString()!==""&&(i.foreign_amount=n.foreign_amount),(typeof n.foreign_amount>"u"||n.foreign_amount.toString()==="")&&(delete i.foreign_amount,delete i.foreign_currency_code)),typeof n.source_account.id<"u"&&n.source_account.id.toString()!==""&&(i.source_id=n.source_account.id),typeof n.destination_account.id<"u"&&n.destination_account.id.toString()!==""&&(i.destination_id=n.destination_account.id),i.type=t,o.push(i)}return o}let N=class{post(t){let o="/api/v2/transactions";return v.post(o,t)}};class ${post(t,o,r){let n="/api/v1/attachments";return v.post(n,{filename:t,attachable_type:o,attachable_id:r})}upload(t,o){let r="./api/v1/attachments/"+t+"/upload";return axios.post(r,o)}}let j=function(e){let t=e.length,o=0,r=!1;for(const n in e)if(e.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294&&r===!1){let i=new $;i.post(e[n].name,"TransactionJournal",e[n].journal).then(s=>{let a=parseInt(s.data.data.id);i.upload(a,e[n].content).then(l=>{if(o++,o===t){const d=new CustomEvent("upload-success",{some:"details"});document.dispatchEvent(d)}}).catch(l=>{console.error("Could not upload"),console.error(l),o++;const d=new CustomEvent("upload-failed",{error:l});document.dispatchEvent(d),r=!0})}).catch(s=>{console.error("Could not create upload."),console.error(s),o++;const a=new CustomEvent("upload-failed",{error:s});document.dispatchEvent(a),r=!0})}};function q(e,t){t=t.reverse();let o=[],r=0,n=[],i=document.querySelectorAll('input[name="attachments[]"]');for(const s in i)if(i.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294)for(const a in i[s].files)i[s].files.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&(o.push({journal:t[s].transaction_journal_id,file:i[s].files[a]}),r++);for(const s in o)o.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&function(a,l){let d=new FileReader;d.onloadend=function(m){m.target.readyState===FileReader.DONE&&(n.push({name:o[l].file.name,journal:o[l].journal,content:new Blob([m.target.result])}),n.length===r&&j(n))},d.readAsArrayBuffer(a.file)}(o[s],s);return r}function Z(e,t,o){let r=[];for(let n in o)o.hasOwnProperty(n)&&r.push(o[n].replace(e,t));return r}function V(e,t,o){let r,n,i;for(const s in t)if(t.hasOwnProperty(s)){if(s==="group_title"){console.error("Cannot handle error in group title.");continue}if(r=parseInt(s.split(".")[1]),n=s.split(".")[2],i=Z(s,n,t[s]),!o.hasOwnProperty(r)){console.error("Cannot handle errors in index #"+r);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":o[r].errors[n]=i;break;case"source_name":case"source_id":o[r].errors.source_account=o[r].errors.source_account.concat(i);break;case"type":o[r].errors.source_account=o[r].errors.source_account.concat([e.t("validation.bad_type_source")]),o[r].errors.destination_account=o[r].errors.destination_account.concat([e.t("validation.bad_type_destination")]);break;case"destination_name":case"destination_id":o[r].errors.destination_account=o[r].errors.destination_account.concat(i);break;case"foreign_amount":case"foreign_currency_id":o[r].errors.foreign_amount=o[r].errors.foreign_amount.concat(i);break}typeof o[r]<"u"&&(o[r].errors.source_account=Array.from(new Set(o[r].errors.source_account)),o[r].errors.destination_account=Array.from(new Set(o[r].errors.destination_account)))}return console.log(o[0].errors),o}let u=[],f=[];document.addEventListener("location-remove",e=>{f[e.detail.index].remove()});function H(e){let t=0;if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].hasLocation===!1){f[t]=new g.marker(e.latlng,{draggable:!0}),f[t].on("dragend",J),f[t].addTo(u[t]);const r=new CustomEvent("location-set",{detail:{latitude:e.latlng.lat,longitude:e.latlng.lng,index:t,zoomLevel:u[t].getZoom()}});document.dispatchEvent(r)}}function K(e){let t=0;const o=new CustomEvent("location-zoom",{detail:{index:t,zoomLevel:u[t].getZoom()}});document.dispatchEvent(o)}function J(e){let t=e.target,o=t.getLatLng();t.setLatLng(new g.LatLng(o.lat,o.lng),{draggable:"true"});const r=new CustomEvent("location-move",{detail:{latitude:o.lat,longitude:o.lng,index:0}});document.dispatchEvent(r)}function X(e){if(e>0){console.warn("Corwardly refuse to add a map on split #"+(e+1));return}if(typeof u[e]>"u"){let t=document.getElementById("location_map");u[e]=g.map(t).setView([t.dataset.latitude,t.dataset.longitude],t.dataset.zoomLevel),g.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© OpenStreetMap'}).addTo(u[e]),u[e].on("click",H),u[e].on("zoomend",K)}}let c;const p=U();let G=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?_(this.groupProperties.totalAmount,"EUR"):_(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},filterForeignCurrencies(e){let t=[],o;for(let r in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(r)){let n=this.formData.enabledCurrencies[r];n.code===e&&(o=n)}t.push(o),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 r in this.entries)this.entries.hasOwnProperty(r)&&(this.entries[r].foreign_currency_code=e)},filterNativeCurrencies(e){let t=[],o;for(let r in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(r)){let n=this.formData.enabledCurrencies[r];n.code===e&&(o=n)}t.push(o),this.formData.nativeCurrencies=t;for(let r in this.entries)this.entries.hasOwnProperty(r)&&(this.entries[r].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 o in this.entries)this.entries.hasOwnProperty(o)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[o].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=c.t("firefly.errors_upload"),console.error(e)},init(){Promise.all([E("language","en_US")]).then(e=>{c=new z;const t=e[0].replace("-","_");c.locale=t,S(c,t).then(()=>{this.addSplit()})}),T().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}),L().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),k().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),A().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 r in this.entries)this.entries.hasOwnProperty(r)&&(this.entries[r].errors=x());this.formStates.isSubmitting=!0,this.detectTransactionType();let e=R(this.entries,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 o=new N;console.log(t),o.post(t).then(r=>{const n=r.data.data;if(this.groupProperties.id=parseInt(n.id),this.groupProperties.title=n.attributes.group_title??n.attributes.transactions[0].description,q(this.groupProperties.id,n.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=c.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(r=>{this.submitting=!1,console.log(r),typeof r.response<"u"&&this.parseErrors(r.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=c.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=c.t("firefly.errors_submission",{errorMessage:e.message}),e.hasOwnProperty("errors")&&(this.entries=V(c,e.errors,this.entries))},addSplit(){this.entries.push(D()),setTimeout(()=>{M.init("select.ac-tags",{allowClear:!0,server:p.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:c.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;X(e);const t=function(o,r,n){return o.name_with_balance+'
'+c.t("firefly.account_type_"+o.type)+""};h({selector:"input.ac-source",serverUrl:p.account,onChange:O,onSelectItem:B,hiddenValue:this.items[e].source_account.alpine_name}),h({selector:"input.ac-dest",serverUrl:p.account,filters:this.filters.destination,onRenderItem:t,onChange:F,onSelectItem:I}),h({selector:"input.ac-category",serverUrl:p.category,valueField:"id",labelField:"name",onChange:y,onSelectItem:y}),h({selector:"input.ac-description",serverUrl:p.description,valueField:"id",labelField:"description",onChange:w,onSelectItem:w})},150)},removeSplit(e){this.entries.splice(e,1),document.querySelector("#split-0-tab").click()},clearLocation(e){e.preventDefault();const t=e.currentTarget,o=parseInt(t.attributes["data-index"].value);this.entries[o].hasLocation=!1,this.entries[o].latitude=null,this.entries[o].longitude=null,this.entries[o].zoomLevel=null;const r=new CustomEvent("location-remove",{detail:{index:o}});return document.dispatchEvent(r),!1}}},b={transactions:G,dates:P};function C(){Object.keys(b).forEach(e=>{console.log(`Loading page component "${e}"`);let t=b[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),C()});window.bootstrapped&&(console.log("Loaded through window variable."),C()); diff --git a/public/build/assets/dashboard-1d6bb3a8.js b/public/build/assets/dashboard-1d6bb3a8.js new file mode 100644 index 0000000000..056050b168 --- /dev/null +++ b/public/build/assets/dashboard-1d6bb3a8.js @@ -0,0 +1 @@ +import{a as O,f,g as w,P as vt,G as mt,b as Ct,d as kt}from"./get-51a7c3ed.js";import{f as p,C as m,a as F,i as g,B as Pt,b as Dt,c as xt,S as Ot,F as Mt,L as St,d as Ft,A as Bt,e as At,T as jt,P as Wt,g as $t,h as It,p as Vt,j as Kt,k as Lt,l as Et,m as Gt,n as Tt}from"./vendor-824d08a0.js";import{G as Rt}from"./get-c23f6e9c.js";class qt{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=p(e,"y-MM-dd")+"_"+p(n,"y-MM-dd")+"_"+t;return console.log("getCacheKey: "+a),String(a)}let z=!1;const Nt=()=>({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 qt().get(p(t,"yyyy-MM-dd"),p(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([w("viewRange"),w("autoConversion",!1)]).then(t=>{z=!0,this.autoConversion=t[1],this.loadBoxes()}),window.store.observe("end",()=>{z&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",t=>{z&&(this.autoConversion=t,this.loadBoxes())})}});class Ut{put(e,n){let a="/api/v1/preferences/"+e;return O.put(a,{data:n})}}function Yt(t,e=null){window.store.set(t,e),new Ut().put(t,e).then(a=>{}).catch(()=>{new vt().post(t,e).then(r=>{})})}let zt=class{dashboard(e,n){let a=p(e,"y-MM-dd"),r=p(n,"y-MM-dd");return O.get("/api/v2/chart/account/dashboard",{params:{start:a,end:r}})}expense(e,n){let a=p(e,"y-MM-dd"),r=p(n,"y-MM-dd");return O.get("/api/v2/chart/account/expense-dashboard",{params:{start:a,end:r}})}};class lt{get(e,n){let a={date:p(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=p(n.start,"y-MM-dd")),n.hasOwnProperty("end")&&(a.end=p(n.end,"y-MM-dd")),O.get("/api/v2/accounts/"+e+"/transactions",{params:a})}}function U(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 N=new m("#36a2eb"),$=new m("#ff6384"),T=new m("#4bc0c0"),pt=new m("#ff9f40"),Ht=new m("#9966ff"),Jt=new m("#ffcd56"),Zt=new m("#c9cbcf"),ut=0;window.theme==="dark"&&($.darken(.3).desaturate(.3),T.darken(.3).desaturate(.3),N.darken(.3).desaturate(.3),pt.darken(.3).desaturate(.3));let H=[$,pt,N,T,Ht,Jt,Zt,T];function j(t,e){let n={borderColor:$.rgbString(),backgroundColor:$.rgbString()},a;switch(t){default:let o=Math.floor(ut/2)%H.length;a=new m(H[o].rgbString()),a.lighten(.38),n={borderColor:H[o].hexString(),backgroundColor:a.hexString()};break;case"spent":a=new m(N.rgbString()),a.lighten(.38),n={borderColor:N.rgbString(),backgroundColor:a.rgbString()};break;case"left":a=new m(T.rgbString()),a.lighten(.38),n={borderColor:T.rgbString(),backgroundColor:a.rgbString()};break;case"overspent":a=new m($.rgbString()),a.lighten(.22),n={borderColor:$.rgbString(),backgroundColor:a.rgbString()};break}return ut++,e==="border"?n.borderColor:e==="background"?n.backgroundColor:"#FF0000"}let B=[],I=null,J=null,Z=!1;const Qt=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Yt("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 zt().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){B=[];let e=U("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([w("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 lt().get(_,new Date(window.store.get("end"))).then(v=>{let C=v.data.data;const wt={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new lt().transactions(C.id,wt).then(nt=>{let rt=[];for(let A=0;A=o);A++){let M=nt.data.data[A],ot={title:M.attributes.group_title===null?"":M.attributes.group_title,id:M.id,transactions:[]};for(let Y=0;YA.order-M.order),this.accountList=u,this.loadingAccounts=!1,window.store.set(n,u))})})}}})},init(){Promise.all([w("viewRange","1M"),w("autoConversion",!1),w("language","en_US")]).then(t=>{this.autoConversion=t[1],Z=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{Z&&(J=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{Z&&(this.loadChart(),this.loadAccounts())})}});let Xt=class{dashboard(e,n){let a=p(e,"y-MM-dd"),r=p(n,"y-MM-dd");return O.get("/api/v2/chart/budget/dashboard",{params:{start:a,end:r}})}},V=[],R=null,S=null,Q=!1;const te=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,S!==null){this.drawChart(this.generateOptions(S)),this.loading=!1;return}this.getFreshData()}},drawChart(t){if(R!==null){R.data.datasets=t.data.datasets,R.update();return}R=new F(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"){S=r,this.drawChart(this.generateOptions(S)),this.loading=!1;return}new Xt().dashboard(t,e,null).then(i=>{S=i.data,this.drawChart(this.generateOptions(S)),window.store.set(n,S),this.loading=!1})},generateOptions(t){V=[];let e=U("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:g.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:j("spent","background"),borderColor:j("spent","border")},{label:g.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:j("left","background"),borderColor:j("left","border")},{label:g.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([w("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Q=!0,this.loading===!1&&this.loadChart()}),window.store.observe("end",()=>{Q&&this.loading===!1&&(S=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Q&&(this.autoConversion=t,this.loading===!1&&this.loadChart())})}});class ee{dashboard(e,n){let a=p(e,"y-MM-dd"),r=p(n,"y-MM-dd");return O.get("/api/v2/chart/category/dashboard",{params:{start:a,end:r}})}}let ct=[],K=null,W=null,X=!1;const ae=()=>({loading:!1,autoConversion:!1,generateOptions(t){ct=[];let e=U("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:{}},ct.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 F(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 ee().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([w("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],X=!0,this.loadChart()}),window.store.observe("end",()=>{X&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",t=>{X&&(this.autoConversion=t,this.loadChart())})}});let dt=!1,L=0;function ne(t){if(dt===!1&&L===0){console.log("Loading translations: "+L);const e=t.replace("-","_");return dt=!0,L++,g.use(Pt).init({fallbackLng:"en_US",lng:e,debug:!0,backend:{backends:[Dt,xt],backendOptions:[{expirationTime:7*24*60*60*1e3},{loadPath:"./v2/i18n/{{lng}}.json"}]}})}return L++,console.warn("Loading translations skipped because count is:"+L),Promise.resolve()}F.register({SankeyController:Ot,Flow:Mt});const ht="dashboard-sankey-data";let tt=!1,q=null,D=[],b=!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 ft=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 E(t,e,n,a){if(t==="category"&&e!==null&&n==="in")return s.category+' "'+e+'" ('+s.in+(b?", "+a+")":")");if(t==="category"&&e===null&&n==="in")return s.unknown_category+" ("+s.in+(b?", "+a+")":")");if(t==="category"&&e!==null&&n==="out")return s.category+' "'+e+'" ('+s.out+(b?", "+a+")":")");if(t==="category"&&e===null&&n==="out")return s.unknown_category+" ("+s.out+(b?", "+a+")":")");if(t==="account"&&e===null&&n==="in")return s.unknown_source+(b?" ("+a+")":"");if(t==="account"&&e!==null&&n==="in")return s.revenue_account+'"'+e+'"'+(b?" ("+a+")":"");if(t==="account"&&e===null&&n==="out")return s.unknown_dest+(b?" ("+a+")":"");if(t==="account"&&e!==null&&n==="out")return s.expense_account+' "'+e+'"'+(b?" ("+a+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(b?" ("+a+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(b?" ("+a+")":"");console.error('Cannot handle: type:"'+t+'", dir: "'+n+'"')}function G(t,e,n){if(t==="category"&&e!==null)return s.category+' "'+e+'"'+(b?" ("+n+")":"");if(t==="category"&&e===null)return s.unknown_category+(b?" ("+n+")":"");if(t==="account"&&e===null)return s.unknown_account+(b?" ("+n+")":"");if(t==="account"&&e!==null)return e+(b?" ("+n+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(b?" ("+n+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(b?" ("+n+")":"");console.error('Cannot handle: type:"'+t+'"')}const re=()=>({loading:!1,autoConversion:!1,generateOptions(){let t=U("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=E("category",l.category_name,"in",u),_=E("account",l.source_name,"in",u);n[c]=G("category",l.category_name,u),n[_]=G("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=E("budget",l.budget_name,"out",u);n[c]=G("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 _=E("category",l.category_name,"out",u);n[_]=G("category",l.category_name,u),h=c+"-"+_+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:_,amount:0}),e[h].amount+=d;let v=E("account",l.destination_name,"out",u);n[v]=G("account",l.destination_name,u),h=_+"-"+v+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:v,amount:0}),e[h].amount+=d}}}let a={label:"Firefly III dashboard sankey chart",data:[],colorFrom:r=>ft(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].from:""),colorTo:r=>ft(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(q!==null){q.data.datasets=t.data.datasets,q.update();return}q=new F(document.querySelector("#sankey-chart"),t)},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"){D=r,this.drawChart(this.generateOptions()),this.loading=!1;return}let o={start:p(t,"y-MM-dd"),end:p(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(ht,e,n);new Rt().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([w("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],b=t[0],s.all_money=g.t("firefly.all_money"),s.category=g.t("firefly.category"),s.in=g.t("firefly.money_flowing_in"),s.out=g.t("firefly.money_flowing_out"),s.unknown_category=g.t("firefly.unknown_category_plain"),s.unknown_source=g.t("firefly.unknown_source_plain"),s.unknown_dest=g.t("firefly.unknown_dest_plain"),s.unknown_account=g.t("firefly.unknown_any_plain"),s.unknown_budget=g.t("firefly.unknown_budget_plain"),s.expense_account=g.t("firefly.expense_account"),s.revenue_account=g.t("firefly.revenue_account"),s.budget=g.t("firefly.budget"),tt=!0,this.loadChart()}),window.store.observe("end",()=>{tt&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",t=>{tt&&(this.autoConversion=t,this.loadChart())})}});let et=!1,y={};function _t(t){return new mt().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?g.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;y.hasOwnProperty(i)||(y[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=g.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 v={amount:t.autoConversion?f(c.native_amount,c.native_currency_code):f(c.amount,c.currency_code),percentage:_,date:p(new Date(c.date),"PP"),foreign_amount:null};c.foreign_currency_code!==null&&(v.foreign_amount=t.autoConversion?c.foreign_native_amount:c.foreign_amount,v.foreign_currency_code=t.autoConversion?c.native_currency_code:c.foreign_currency_code),d.transactions.push(v)}if(y[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;y[i].payment_info.hasOwnProperty(d.currency_code)||(y[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}),y[i].payment_info[d.currency_code].unpaid+=h,y[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];y[i].payment_info.hasOwnProperty(c.currency_code)||(y[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,v=parseFloat(c.native_amount)*-1;y[i].payment_info[c.currency_code].paid+=_,y[i].payment_info[c.currency_code].native_paid+=v}}}}return parseInt(n.data.meta.pagination.total_pages)>t.page?(t.page++,_t(t)):Promise.resolve()})}const oe=()=>({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",y={},this.subscriptions=[];let r={start:p(t,"y-MM-dd"),end:p(e,"y-MM-dd"),autoConversion:this.autoConversion,page:1};_t(r).then(()=>{let o=Object.values(y);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:[g.t("firefly.paid"),g.t("firefly.unpaid")],datasets:[{label:g.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=F.getChart(document.querySelector(a));typeof d<"u"&&d.destroy(),new F(document.querySelector(a),u)},init(){Promise.all([w("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],et=!0,this.loading===!1&&this.startSubscriptions()}),window.store.observe("end",()=>{et&&this.loading===!1&&this.startSubscriptions()}),window.store.observe("autoConversion",t=>{et&&(this.autoConversion=t,this.loading===!1&&this.startSubscriptions())})}});let x={},at=!1;const gt="dashboard-piggies-data",ie=()=>({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(gt,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:p(t,"y-MM-dd"),end:p(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(gt,e,n);new Ct().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??g.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([w("autoConversion",!1)]).then(t=>{at=!0,this.autoConversion=t[0],this.loadPiggyBanks()}),window.store.observe("end",()=>{at&&(x=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",t=>{at&&(this.autoConversion=t,this.loadPiggyBanks())})}});F.register({LineController:St,LineElement:Ft,ArcElement:Bt,BarController:At,TimeScale:jt,PieController:Wt,BarElement:$t,Filler:It,Colors:Vt,LinearScale:Kt,CategoryScale:Lt,PointElement:Et,Tooltip:Gt,Legend:Tt});const bt={dates:kt,boxes:Nt,accounts:Qt,budgets:te,categories:ae,sankey:re,subscriptions:oe,piggies:ie};function yt(t){Promise.all([w("language","en_US")]).then(e=>{ne(e[0]).then(()=>{Object.keys(t).forEach(n=>{let a=t[n]();Alpine.data(n,()=>a)}),Alpine.start()})})}document.addEventListener("firefly-iii-bootstrapped",()=>{yt(bt)});window.bootstrapped&&yt(bt); diff --git a/public/build/assets/dashboard-e693d6f4.js b/public/build/assets/dashboard-e693d6f4.js deleted file mode 100644 index 28a741bebc..0000000000 --- a/public/build/assets/dashboard-e693d6f4.js +++ /dev/null @@ -1 +0,0 @@ -import{a as O,f as g,g as y,P as Pt,l as z,G as kt,b as Dt,d as xt}from"./get-c53daca3.js";import{f,C as m,a as A,I as H,S as Ot,F as Mt,L as St,b as Ft,A as At,B as Bt,T as $t,P as jt,c as It,i as Wt,p as Vt,d as Kt,e as Et,g as Lt,h as Gt,j as Tt}from"./vendor-4332182f.js";import{G as Rt}from"./get-c2292133.js";class Ut{get(t,n,a){return O.get("/api/v2/summary/basic",{params:{start:t,end:n,code:a}})}}function k(e,t,n){const a=f(t,"y-MM-dd")+"_"+f(n,"y-MM-dd")+"_"+e;return console.log("getCacheKey: "+a),String(a)}let Q=!1;const qt=()=>({balanceBox:{amounts:[],subtitles:[]},billBox:{paid:[],unpaid:[]},leftBox:{left:[],perDay:[]},netBox:{net:[]},autoConversion:!1,loading:!1,boxData:null,boxOptions:null,getFreshData(){const e=new Date(window.store.get("start")),t=new Date(window.store.get("end")),n=k("dashboard-boxes-data",e,t),a=window.store.get("cacheValid");let o=window.store.get(n);if(a&&typeof o<"u"){this.boxData=o,this.generateOptions(this.boxData);return}new Ut().get(f(e,"yyyy-MM-dd"),f(t,"yyyy-MM-dd"),null).then(i=>{this.boxData=i.data,window.store.set(n,i.data),this.generateOptions(this.boxData)})},generateOptions(e){this.balanceBox={amounts:[],subtitles:[]},this.billBox={paid:[],unpaid:[]},this.leftBox={left:[],perDay:[]},this.netBox={net:[]};let t={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n];if(!a.hasOwnProperty("key"))continue;let o=a.key;if(this.autoConversion){if(o.startsWith("balance-in-native")){this.balanceBox.amounts.push(g(a.value,a.currency_code)),t.hasOwnProperty(a.currency_code)||(t[a.currency_code]="");continue}if(o.startsWith("spent-in-native")){t.hasOwnProperty(a.currency_code)||(t[a.currency_code]=""),t[a.currency_code]=t[a.currency_code]+g(a.value,a.currency_code);continue}if(o.startsWith("earned-in-native")){t.hasOwnProperty(a.currency_code)||(t[a.currency_code]=""),t[a.currency_code]=g(a.value,a.currency_code)+" + "+t[a.currency_code];continue}if(o.startsWith("bills-unpaid-in-native")){this.billBox.unpaid.push(g(a.value,a.currency_code));continue}if(o.startsWith("bills-paid-in-native")){this.billBox.paid.push(g(a.value,a.currency_code));continue}if(o.startsWith("left-to-spend-in-native")){this.leftBox.left.push(g(a.value,a.currency_code));continue}if(o.startsWith("left-per-day-to-spend-in-native")){this.leftBox.perDay.push(g(a.value,a.currency_code));continue}if(o.startsWith("net-worth-in-native")){this.netBox.net.push(g(a.value,a.currency_code));continue}}if(!this.autoConversion&&!o.endsWith("native")){if(o.startsWith("balance-in-")){this.balanceBox.amounts.push(g(a.value,a.currency_code));continue}if(o.startsWith("spent-in-")){t.hasOwnProperty(a.currency_code)||(t[a.currency_code]=""),t[a.currency_code]=t[a.currency_code]+g(a.value,a.currency_code);continue}if(o.startsWith("earned-in-")){t.hasOwnProperty(a.currency_code)||(t[a.currency_code]=""),t[a.currency_code]=g(a.value,a.currency_code)+" + "+t[a.currency_code];continue}if(o.startsWith("bills-unpaid-in-")){this.billBox.unpaid.push(g(a.value,a.currency_code));continue}if(o.startsWith("bills-paid-in-")){this.billBox.paid.push(g(a.value,a.currency_code));continue}if(o.startsWith("left-to-spend-in-")){this.leftBox.left.push(g(a.value,a.currency_code));continue}if(o.startsWith("left-per-day-to-spend-in-")){this.leftBox.perDay.push(g(a.value,a.currency_code));continue}o.startsWith("net-worth-in-")&&this.netBox.net.push(g(a.value,a.currency_code))}}for(let n in t)t.hasOwnProperty(n)&&this.balanceBox.subtitles.push(t[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([y("viewRange"),y("autoConversion",!1)]).then(e=>{Q=!0,this.autoConversion=e[1],this.loadBoxes()}),window.store.observe("end",()=>{Q&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",e=>{Q&&(this.autoConversion=e,this.loadBoxes())})}});class Nt{put(t,n){let a="/api/v1/preferences/"+t;return O.put(a,{data:n})}}function Yt(e,t=null){window.store.set(e,t),new Nt().put(e,t).then(a=>{}).catch(()=>{new Pt().post(e,t).then(o=>{})})}let zt=class{dashboard(t,n){let a=f(t,"y-MM-dd"),o=f(n,"y-MM-dd");return O.get("/api/v2/chart/account/dashboard",{params:{start:a,end:o}})}expense(t,n){let a=f(t,"y-MM-dd"),o=f(n,"y-MM-dd");return O.get("/api/v2/chart/account/expense-dashboard",{params:{start:a,end:o}})}};class ht{get(t,n){let a={date:f(n,"y-MM-dd").slice(0,10)};return n?O.get("/api/v2/accounts/"+t,{params:a}):O.get("/api/v2/accounts/"+t)}transactions(t,n){const a={page:n.page??1};return n.hasOwnProperty("start")&&(a.start=f(n.start,"y-MM-dd")),n.hasOwnProperty("end")&&(a.end=f(n.end,"y-MM-dd")),O.get("/api/v2/accounts/"+t+"/transactions",{params:a})}}function J(e){return e==="sankey"?{type:"sankey",data:{datasets:[]},options:{animations:!1}}:e==="pie"?{type:"pie",data:{datasets:[]}}:e==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(t){let n=t.dataset.currency_code;return g(t.raw,n)}}}},maintainAspectRatio:!1,scales:{}}}:e==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(t){let n=t.dataset.currency_code;return g(t.raw,n)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let Y=new m("#36a2eb"),V=new m("#ff6384"),R=new m("#4bc0c0"),yt=new m("#ff9f40"),Ht=new m("#9966ff"),Jt=new m("#ffcd56"),Zt=new m("#c9cbcf"),gt=0;window.theme==="dark"&&(V.darken(.3).desaturate(.3),R.darken(.3).desaturate(.3),Y.darken(.3).desaturate(.3),yt.darken(.3).desaturate(.3));let X=[V,yt,Y,R,Ht,Jt,Zt,R];function j(e,t){let n={borderColor:V.rgbString(),backgroundColor:V.rgbString()},a;switch(e){default:let r=Math.floor(gt/2)%X.length;a=new m(X[r].rgbString()),a.lighten(.38),n={borderColor:X[r].hexString(),backgroundColor:a.hexString()};break;case"spent":a=new m(Y.rgbString()),a.lighten(.38),n={borderColor:Y.rgbString(),backgroundColor:a.rgbString()};break;case"left":a=new m(R.rgbString()),a.lighten(.38),n={borderColor:R.rgbString(),backgroundColor:a.rgbString()};break;case"overspent":a=new m(V.rgbString()),a.lighten(.22),n={borderColor:V.rgbString(),backgroundColor:a.rgbString()};break}return gt++,t==="border"?n.borderColor:t==="background"?n.backgroundColor:"#FF0000"}let B=[],K=null,tt=null,et=!1;const Qt=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Yt("autoConversion",this.autoConversion)},getFreshData(){const e=new Date(window.store.get("start")),t=new Date(window.store.get("end")),n=k("dashboard-accounts-chart",e,t),a=window.store.get("cacheValid");let o=window.store.get(n);if(a&&typeof o<"u"){console.log(o),this.drawChart(this.generateOptions(o)),this.loading=!1;return}new zt().dashboard(e,t,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(e){B=[];let t=J("line");for(let n=0;n0){this.loadingAccounts=!1;return}const e=new Date(window.store.get("start")),t=new Date(window.store.get("end")),n=k("dashboard-accounts-data",e,t),a=window.store.get("cacheValid");let o=window.store.get(n);if(a&&typeof o<"u"){this.accountList=o,this.loadingAccounts=!1;return}const r=10;let i=0,l=0,u=[];Promise.all([y("frontpageAccounts")]).then(d=>{i=d[0].length;for(let h in d[0]){let c=d[0];if(c.hasOwnProperty(h)){let p=c[h];new ht().get(p,new Date(window.store.get("end"))).then(v=>{let C=v.data.data;const Ct={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new ht().transactions(C.id,Ct).then(st=>{let lt=[];for(let $=0;$=r);$++){let M=st.data.data[$],ut={title:M.attributes.group_title===null?"":M.attributes.group_title,id:M.id,transactions:[]};for(let Z=0;Z$.order-M.order),this.accountList=u,this.loadingAccounts=!1,window.store.set(n,u))})})}}})},init(){Promise.all([y("viewRange","1M"),y("autoConversion",!1),y("language","en_US")]).then(e=>{this.autoConversion=e[1],et=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{et&&(tt=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{et&&(this.loadChart(),this.loadAccounts())})}});let Xt=class{dashboard(t,n){let a=f(t,"y-MM-dd"),o=f(n,"y-MM-dd");return O.get("/api/v2/chart/budget/dashboard",{params:{start:a,end:o}})}},E=[],U=null,S=null,at=!1,I;const te=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,S!==null){this.drawChart(this.generateOptions(S)),this.loading=!1;return}this.getFreshData()}},drawChart(e){if(U!==null){U.data.datasets=e.data.datasets,U.update();return}U=new A(document.querySelector("#budget-chart"),e)},getFreshData(){const e=new Date(window.store.get("start")),t=new Date(window.store.get("end")),n=k("dashboard-budgets-chart",e,t),a=window.store.get("cacheValid");let o=window.store.get(n);if(a&&typeof o<"u"){S=o,this.drawChart(this.generateOptions(S)),this.loading=!1;return}new Xt().dashboard(e,t,null).then(i=>{S=i.data,this.drawChart(this.generateOptions(S)),window.store.set(n,S),this.loading=!1})},generateOptions(e){E=[];let t=J("column");t.options.locale=window.store.get("locale").replace("_","-"),t.options.plugins={tooltip:{callbacks:{title:function(n){return n.label},label:function(n){let a=n.dataset.label||"";return a&&(a+=": "),a+" "+g(n.parsed.y,E[n.parsed.x]??"EUR")}}}},t.data={labels:[],datasets:[{label:I.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:j("spent","background"),borderColor:j("spent","border")},{label:I.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:j("left","background"),borderColor:j("left","border")},{label:I.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:j("overspent","background"),borderColor:j("overspent","border")}]};for(const n in e)if(e.hasOwnProperty(n)){let a=e[n],o=a.label+" ("+a.currency_code+")";t.data.labels.push(o),this.autoConversion&&(E.push(a.native_currency_code),t.data.datasets[0].data.push(parseFloat(a.native_entries.spent)*-1),t.data.datasets[1].data.push(parseFloat(a.native_entries.left)),t.data.datasets[2].data.push(parseFloat(a.native_entries.overspent))),this.autoConversion||(E.push(a.currency_code),t.data.datasets[0].data.push(parseFloat(a.entries.spent)*-1),t.data.datasets[1].data.push(parseFloat(a.entries.left)),t.data.datasets[2].data.push(parseFloat(a.entries.overspent)))}return t.options.scales={y:{ticks:{callback:function(n){return g(n,E[0]??"EUR")}}}},t},init(){Promise.all([y("autoConversion",!1),y("language","en_US")]).then(e=>{I=new H;const t=e[1].replace("-","_");I.locale=t,z(I,t).then(()=>{this.autoConversion=e[0],at=!0,this.loading===!1&&this.loadChart()})}),window.store.observe("end",()=>{at&&this.loading===!1&&(S=null,this.loadChart())}),window.store.observe("autoConversion",e=>{at&&(this.autoConversion=e,this.loading===!1&&this.loadChart())})}});class ee{dashboard(t,n){let a=f(t,"y-MM-dd"),o=f(n,"y-MM-dd");return O.get("/api/v2/chart/category/dashboard",{params:{start:a,end:o}})}}let ft=[],L=null,W=null,nt=!1;const ae=()=>({loading:!1,autoConversion:!1,generateOptions(e){ft=[];let t=J("column"),n={};for(const o in e)if(e.hasOwnProperty(o)){let r=e[o],i=r.currency_code;this.autoConversion&&(i=r.native_currency_code),n.hasOwnProperty(i)||(n[i]={name:i,yAxisID:"",data:{}},ft.push(i))}for(const o in e)if(e.hasOwnProperty(o)){let r=e[o],i=r.currency_code;this.autoConversion&&(i=r.native_currency_code);for(const l in n)if(n.hasOwnProperty(l)){let u=0;i===l&&(u=parseFloat(r.amount),""+r.currency_code,this.autoConversion&&(u=parseFloat(r.native_amount),""+r.native_currency_code)),n[l].data.hasOwnProperty(r.label)&&(n[l].data[r.label]=n[l].data[r.label]+u),n[l].data.hasOwnProperty(r.label)||(n[l].data[r.label]=u)}t.data.labels.includes(r.label)||t.data.labels.push(r.label)}let a=0;for(const o in n){let r="y"+o,i={label:o,currency_code:o,yAxisID:r,data:[]};for(const l in n[o].data)i.data.push(n[o].data[l]);t.data.datasets.push(i),t.options.scales.hasOwnProperty(r)||(t.options.scales[r]={beginAtZero:!0,type:"linear",position:a===1?"right":"left",ticks:{callback:function(l,u,d){return g(l,o)}}},a++)}return t},drawChart(e){if(L!==null){L.options=e.options,L.data=e.data,L.update();return}L=new A(document.querySelector("#category-chart"),e)},getFreshData(){const e=new Date(window.store.get("start")),t=new Date(window.store.get("end")),n=k("dashboard-categories-chart",e,t),a=window.store.get("cacheValid");let o=window.store.get(n);if(a&&typeof o<"u"){W=o,this.drawChart(this.generateOptions(W)),this.loading=!1;return}new ee().dashboard(e,t,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([y("autoConversion",!1)]).then(e=>{this.autoConversion=e[0],nt=!0,this.loadChart()}),window.store.observe("end",()=>{nt&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",e=>{nt&&(this.autoConversion=e,this.loadChart())})}});A.register({SankeyController:Ot,Flow:Mt});const pt="dashboard-sankey-data";let b,ot=!1,q=null,D=[],_=!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 _t=function(e){return e.includes(s.revenue_account)?"forestgreen":e.includes("("+s.in+",")?"green":e.includes(s.budget)||e.includes(s.unknown_budget)?"Orchid":e.includes("("+s.out+",")?"MediumOrchid":e.includes(s.all_money)?"blue":"red"};function G(e,t,n,a){if(e==="category"&&t!==null&&n==="in")return s.category+' "'+t+'" ('+s.in+(_?", "+a+")":")");if(e==="category"&&t===null&&n==="in")return s.unknown_category+" ("+s.in+(_?", "+a+")":")");if(e==="category"&&t!==null&&n==="out")return s.category+' "'+t+'" ('+s.out+(_?", "+a+")":")");if(e==="category"&&t===null&&n==="out")return s.unknown_category+" ("+s.out+(_?", "+a+")":")");if(e==="account"&&t===null&&n==="in")return s.unknown_source+(_?" ("+a+")":"");if(e==="account"&&t!==null&&n==="in")return s.revenue_account+'"'+t+'"'+(_?" ("+a+")":"");if(e==="account"&&t===null&&n==="out")return s.unknown_dest+(_?" ("+a+")":"");if(e==="account"&&t!==null&&n==="out")return s.expense_account+' "'+t+'"'+(_?" ("+a+")":"");if(e==="budget"&&t!==null)return s.budget+' "'+t+'"'+(_?" ("+a+")":"");if(e==="budget"&&t===null)return s.unknown_budget+(_?" ("+a+")":"");console.error('Cannot handle: type:"'+e+'", dir: "'+n+'"')}function T(e,t,n){if(e==="category"&&t!==null)return s.category+' "'+t+'"'+(_?" ("+n+")":"");if(e==="category"&&t===null)return s.unknown_category+(_?" ("+n+")":"");if(e==="account"&&t===null)return s.unknown_account+(_?" ("+n+")":"");if(e==="account"&&t!==null)return t+(_?" ("+n+")":"");if(e==="budget"&&t!==null)return s.budget+' "'+t+'"'+(_?" ("+n+")":"");if(e==="budget"&&t===null)return s.unknown_budget+(_?" ("+n+")":"");console.error('Cannot handle: type:"'+e+'"')}const ne=()=>({loading:!1,autoConversion:!1,generateOptions(){let e=J("sankey"),t={},n={};for(let o in D)if(D.hasOwnProperty(o)){let r=D[o];for(let i in r.attributes.transactions)if(r.attributes.transactions.hasOwnProperty(i)){let l=r.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=G("category",l.category_name,"in",u),p=G("account",l.source_name,"in",u);n[c]=T("category",l.category_name,u),n[p]=T("account",l.source_name,u),h=p+"-"+c+"-"+u,t.hasOwnProperty(h)||(t[h]={from:p,to:c,amount:0}),t[h].amount+=d,h=c+"-"+s.all_money+"-"+u,t.hasOwnProperty(h)||(t[h]={from:c,to:s.all_money+(this.autoConversion?" ("+u+")":""),amount:0}),t[h].amount+=d}if(l.type==="withdrawal"){let c=G("budget",l.budget_name,"out",u);n[c]=T("budget",l.budget_name,u),h=s.all_money+"-"+c+"-"+u,t.hasOwnProperty(h)||(t[h]={from:s.all_money+(this.autoConversion?" ("+u+")":""),to:c,amount:0}),t[h].amount+=d;let p=G("category",l.category_name,"out",u);n[p]=T("category",l.category_name,u),h=c+"-"+p+"-"+u,t.hasOwnProperty(h)||(t[h]={from:c,to:p,amount:0}),t[h].amount+=d;let v=G("account",l.destination_name,"out",u);n[v]=T("account",l.destination_name,u),h=p+"-"+v+"-"+u,t.hasOwnProperty(h)||(t[h]={from:p,to:v,amount:0}),t[h].amount+=d}}}let a={label:"Firefly III dashboard sankey chart",data:[],colorFrom:o=>_t(o.dataset.data[o.dataIndex]?o.dataset.data[o.dataIndex].from:""),colorTo:o=>_t(o.dataset.data[o.dataIndex]?o.dataset.data[o.dataIndex].to:""),colorMode:"gradient",labels:n,size:"min"};for(let o in t)if(t.hasOwnProperty(o)){let r=t[o];a.data.push({from:r.from,to:r.to,flow:r.amount})}return e.data.datasets.push(a),e},drawChart(e){if(q!==null){q.data.datasets=e.data.datasets,q.update();return}q=new A(document.querySelector("#sankey-chart"),e)},getFreshData(){const e=new Date(window.store.get("start")),t=new Date(window.store.get("end")),n=k(pt,e,t),a=window.store.get("cacheValid");let o=window.store.get(n);if(a&&typeof o<"u"){D=o,this.drawChart(this.generateOptions()),this.loading=!1;return}let r={start:f(e,"y-MM-dd"),end:f(t,"y-MM-dd"),type:"withdrawal,deposit",page:1};this.downloadTransactions(r)},downloadTransactions(e){const t=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=k(pt,t,n);new Rt().list(e).then(r=>{if(D=[...D,...r.data.data],parseInt(r.data.meta.pagination.total_pages)>e.page){e.page++,this.downloadTransactions(e);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([y("autoConversion",!1),y("language","en_US")]).then(e=>{this.autoConversion=e[0],_=e[0],b=new H;const t=e[1].replace("-","_");b.locale=t,z(b,t).then(()=>{s.all_money=b.t("firefly.all_money"),s.category=b.t("firefly.category"),s.in=b.t("firefly.money_flowing_in"),s.out=b.t("firefly.money_flowing_out"),s.unknown_category=b.t("firefly.unknown_category_plain"),s.unknown_source=b.t("firefly.unknown_source_plain"),s.unknown_dest=b.t("firefly.unknown_dest_plain"),s.unknown_account=b.t("firefly.unknown_any_plain"),s.unknown_budget=b.t("firefly.unknown_budget_plain"),s.expense_account=b.t("firefly.expense_account"),s.revenue_account=b.t("firefly.revenue_account"),s.budget=b.t("firefly.budget"),ot=!0,this.loadChart()})}),window.store.observe("end",()=>{ot&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",e=>{ot&&(this.autoConversion=e,this.loadChart())})}});let rt=!1,F,w={};function wt(e){return new kt().list(e).then(n=>{let a=n.data.data;for(let o in a)if(a.hasOwnProperty(o)){let r=a[o];if(r.attributes.active&&r.attributes.pay_dates.length>0){let i=r.attributes.object_group_id===null?0:r.attributes.object_group_id,l=r.attributes.object_group_title===null?F.t("firefly.default_group_title_name_plain"):r.attributes.object_group_title,u=r.attributes.object_group_order===null?0:r.attributes.object_group_order;w.hasOwnProperty(i)||(w[i]={id:i,title:l,order:u,payment_info:{},bills:[]});let d={id:r.id,name:r.attributes.name,amount_min:r.attributes.amount_min,amount_max:r.attributes.amount_max,amount:(parseFloat(r.attributes.amount_max)+parseFloat(r.attributes.amount_min))/2,currency_code:r.attributes.currency_code,native_amount_min:r.attributes.native_amount_min,native_amount_max:r.attributes.native_amount_max,native_amount:(parseFloat(r.attributes.native_amount_max)+parseFloat(r.attributes.native_amount_min))/2,native_currency_code:r.attributes.native_currency_code,transactions:[],pay_dates:r.attributes.pay_dates,paid:r.attributes.paid_dates.length>0};d.expected_amount=e.autoConversion?g(d.native_amount,d.native_currency_code):g(d.amount,d.currency_code),d.expected_times=F.t("firefly.subscr_expected_x_times",{times:r.attributes.pay_dates.length,amount:d.expected_amount});for(let h in r.attributes.paid_dates)if(r.attributes.paid_dates.hasOwnProperty(h)){const c=r.attributes.paid_dates[h];let p=100;e.autoConversion&&(p=Math.round(-100+parseFloat(c.native_amount)*-1/parseFloat(d.native_amount)*100)),e.autoConversion||(p=Math.round(-100+parseFloat(c.amount)*-1/parseFloat(d.amount)*100));let v={amount:e.autoConversion?g(c.native_amount,c.native_currency_code):g(c.amount,c.currency_code),percentage:p,date:f(new Date(c.date),"PP"),foreign_amount:null};c.foreign_currency_code!==null&&(v.foreign_amount=e.autoConversion?c.foreign_native_amount:c.foreign_amount,v.foreign_currency_code=e.autoConversion?c.native_currency_code:c.foreign_currency_code),d.transactions.push(v)}if(w[i].bills.push(d),r.attributes.paid_dates.length===0){const h=r.attributes.pay_dates.length*d.amount,c=r.attributes.pay_dates.length*d.native_amount;w[i].payment_info.hasOwnProperty(d.currency_code)||(w[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}),w[i].payment_info[d.currency_code].unpaid+=h,w[i].payment_info[d.currency_code].native_unpaid+=c}if(r.attributes.paid_dates.length>0){for(let h in r.attributes.paid_dates)if(r.attributes.paid_dates.hasOwnProperty(h)){let c=r.attributes.paid_dates[h];w[i].payment_info.hasOwnProperty(c.currency_code)||(w[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 p=parseFloat(c.amount)*-1,v=parseFloat(c.native_amount)*-1;w[i].payment_info[c.currency_code].paid+=p,w[i].payment_info[c.currency_code].native_paid+=v}}}}return parseInt(n.data.meta.pagination.total_pages)>e.page?(e.page++,wt(e)):Promise.resolve()})}const oe=()=>({loading:!1,autoConversion:!1,subscriptions:[],startSubscriptions(){this.loading=!0;let e=new Date(window.store.get("start")),t=new Date(window.store.get("end"));const n=window.store.get("cacheValid");let a=window.store.get(k("subscriptions-data-dashboard",e,t));n&&typeof a<"u",w={},this.subscriptions=[],console.log("cache is invalid, must download");let o={start:f(e,"y-MM-dd"),end:f(t,"y-MM-dd"),autoConversion:this.autoConversion,page:1};wt(o).then(()=>{console.log("Done with download!");let r=Object.values(w);for(let i in r)if(r.hasOwnProperty(i)){let l=r[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(e,t,n){let a="#pie_"+e+"_"+n.currency_code;const o=this.autoConversion?n.native_unpaid:n.unpaid,r=this.autoConversion?n.native_paid:n.paid,i=this.autoConversion?n.native_currency_code:n.currency_code,u={type:"doughnut",data:{labels:[F.t("firefly.paid"),F.t("firefly.unpaid")],datasets:[{label:F.t("firefly.subscriptions_in_group",{title:t}),data:[r,o],backgroundColor:["rgb(54, 162, 235)","rgb(255, 99, 132)"],hoverOffset:4}]},options:{plugins:{tooltip:{callbacks:{label:function(h){return h.dataset.label+": "+g(h.raw,i)}}}}}};var d=A.getChart(document.querySelector(a));typeof d<"u"&&d.destroy(),new A(document.querySelector(a),u)},init(){console.log("subscriptions init"),Promise.all([y("autoConversion",!1),y("language","en_US")]).then(e=>{console.log("subscriptions after promises"),this.autoConversion=e[0],rt=!0,F=new H;const t=e[1].replace("-","_");F.locale=t,z(F,t).then(()=>{this.loading===!1&&this.startSubscriptions()})}),window.store.observe("end",()=>{rt&&(console.log("subscriptions observe end"),this.loading===!1&&this.startSubscriptions())}),window.store.observe("autoConversion",e=>{rt&&(console.log("subscriptions observe autoConversion"),this.autoConversion=e,this.loading===!1&&this.startSubscriptions())})}});let x={},it=!1,N;const bt="dashboard-piggies-data",re=()=>({loading:!1,autoConversion:!1,sankeyGrouping:"account",piggies:[],getFreshData(){const e=new Date(window.store.get("start")),t=new Date(window.store.get("end")),n=k(bt,e,t),a=window.store.get("cacheValid");let o=window.store.get(n);if(a&&typeof o<"u"){x=o,this.parsePiggies(),this.loading=!1;return}let r={start:f(e,"y-MM-dd"),end:f(t,"y-MM-dd"),page:1};this.downloadPiggyBanks(r)},downloadPiggyBanks(e){const t=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=k(bt,t,n);new Dt().list(e).then(r=>{if(x=[...x,...r.data.data],parseInt(r.data.meta.pagination.total_pages)>e.page){e.page++,this.downloadPiggyBanks(e);return}window.store.set(a,x),this.parsePiggies(),this.loading=!1})},parsePiggies(){let e=[];for(let t in x)if(x.hasOwnProperty(t)){let n=x[t];if(n.attributes.percentage>=100||n.attributes.percentage===0)continue;let a=n.object_group_title??N.t("firefly.default_group_title_name_plain");e.hasOwnProperty(a)||(e[a]={id:n.object_group_id??0,title:a,order:n.object_group_order??0,piggies:[]});let o={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};e[a].piggies.push(o)}this.piggies=Object.values(e)},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([y("autoConversion",!1),y("language","en_US")]).then(e=>{N=new H;const t=e[1].replace("-","_");N.locale=t,z(N,t).then(()=>{it=!0,this.autoConversion=e[0],this.loadPiggyBanks()})}),window.store.observe("end",()=>{it&&(x=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",e=>{it&&(this.autoConversion=e,this.loadPiggyBanks())})}});A.register({LineController:St,LineElement:Ft,ArcElement:At,BarController:Bt,TimeScale:$t,PieController:jt,BarElement:It,Filler:Wt,Colors:Vt,LinearScale:Kt,CategoryScale:Et,PointElement:Lt,Tooltip:Gt,Legend:Tt});const vt={dates:xt,boxes:qt,accounts:Qt,budgets:te,categories:ae,sankey:ne,subscriptions:oe,piggies:re};function mt(e){Object.keys(e).forEach(t=>{console.log(`Loading page component "${t}"`);let n=e[t]();Alpine.data(t,()=>n)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{mt(vt)});window.bootstrapped&&mt(vt); diff --git a/public/build/assets/edit-9f80420b.js b/public/build/assets/edit-9f80420b.js deleted file mode 100644 index 974f543643..0000000000 --- a/public/build/assets/edit-9f80420b.js +++ /dev/null @@ -1 +0,0 @@ -import{d as h,f as l,g as p,l as m}from"./get-c53daca3.js";import{f,l as _,I as y}from"./vendor-4332182f.js";import{G as b}from"./get-c2292133.js";import{e as w,f as r,g as v,s as A,h as S,i as C,l as P,a as D,b as x,c as L,j as k,k as c,m as u}from"./autocomplete-functions-31caaca5.js";function B(e){let o=[];for(let i in e)if(e.hasOwnProperty(i)){let t=e[i],n=w();n.bill_id=t.bill_id,n.budget_id=t.budget_id,n.category_name=t.category_name,n.piggy_bank_id=t.piggy_bank_id,n.book_date=t.book_date,n.due_date=t.due_date,n.interest_date=t.interest_date,n.invoice_date=t.invoice_date,n.payment_date=t.payment_date,n.process_date=t.process_date,n.external_url=t.external_url,n.internal_reference=t.internal_reference,n.notes=t.notes,n.tags=t.tags,n.amount=parseFloat(t.amount).toFixed(t.currency_decimal_places),n.currency_code=t.currency_code,t.foreign_amount!==null&&(n.forein_currency_code=t.foreign_currency_code,n.foreign_amount=parseFloat(t.foreign_amount).toFixed(t.foreign_currency_decimal_places)),n.date=f(new Date(t.date),"yyyy-MM-dd HH:mm"),n.description=t.description,n.destination_account={id:t.destination_id,name:t.destination_name,type:t.destination_type,alpine_name:t.destination_name},n.source_account={id:t.source_id,name:t.source_name,type:t.source_type,alpine_name:t.source_name},t.latitude!==null&&(n.hasLocation=!0,n.latitude=t.latitude,n.longitude=t.longitude,n.zoomLevel=t.zoom_level),console.log(n.tags),o.push(n)}return o}let s;const a=k();let E=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:"edit",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:[]},addedSplit(){setTimeout(()=>{const e=function(o,i,t){return o.name_with_balance+'
'+s.t("firefly.account_type_"+o.type)+""};r({selector:"input.ac-source",serverUrl:a.account,filters:this.filters.source,onRenderItem:e,onChange:v,onSelectItem:A}),console.log("ok"),console.log(this.entries[0].source_account.alpine_name),r({selector:"input.ac-dest",serverUrl:a.account,filters:this.filters.destination,onRenderItem:e,onChange:S,onSelectItem:C}),r({selector:"input.ac-category",serverUrl:a.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),r({selector:"input.ac-description",serverUrl:a.description,valueField:"id",labelField:"description",onChange:u,onSelectItem:u})},250)},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(e){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(e){return console.log("at get tags "+e),console.log(this.entries[e].tags),this.entries[e].tags??[]},getTransactionGroup(){this.entries=[];const e=window.location.href.split("/"),o=parseInt(e[e.length-1]);new b().show(o,{}).then(t=>{const n=t.data.data;this.groupProperties.id=parseInt(n.id),this.groupProperties.transactionType=n.attributes.transactions[0].type,this.groupProperties.title=n.attributes.title??n.attributes.transactions[0].description,this.entries=B(n.attributes.transactions),this.notifications.wait.show=!1}).then(()=>{this.groupProperties.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[t].amount),this.filters.source.push(this.entries[t].source_account.type),this.filters.destination.push(this.entries[t].source_account.type));console.log(this.filters),setTimeout(()=>{_.init("select.ac-tags",{allowClear:!0,server:a.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:s.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}})},150)})},init(){Promise.all([p("language","en_US")]).then(e=>{s=new y;const o=e[0].replace("-","_");s.locale=o,m(s,o).then(()=>{this.notifications.wait.show=!0,this.notifications.wait.text=s.t("firefly.wait_loading_transaction"),this.getTransactionGroup()})}),P().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}),D().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),x().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),L().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})},changedAmount(e){const o=parseInt(e.target.dataset.index);this.entries[o].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[i].amount))}}},d={transactions:E,dates:h};function g(){Object.keys(d).forEach(e=>{console.log(`Loading page component "${e}"`);let o=d[e]();Alpine.data(e,()=>o)}),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/edit-ab5008f2.js b/public/build/assets/edit-ab5008f2.js new file mode 100644 index 0000000000..d5ad1fa5d4 --- /dev/null +++ b/public/build/assets/edit-ab5008f2.js @@ -0,0 +1 @@ +import{d as h,f as l}from"./get-51a7c3ed.js";import{f as p,q as m,i as a}from"./vendor-824d08a0.js";import{G as f}from"./get-c23f6e9c.js";import{e as _,f as r,g as y,s as b,h as w,i as v,l as A,a as C,b as S,c as D,j as P,k as c,m as u}from"./autocomplete-functions-3410a57d.js";function x(e){let i=[];for(let o in e)if(e.hasOwnProperty(o)){let t=e[o],n=_();n.bill_id=t.bill_id,n.budget_id=t.budget_id,n.category_name=t.category_name,n.piggy_bank_id=t.piggy_bank_id,n.book_date=t.book_date,n.due_date=t.due_date,n.interest_date=t.interest_date,n.invoice_date=t.invoice_date,n.payment_date=t.payment_date,n.process_date=t.process_date,n.external_url=t.external_url,n.internal_reference=t.internal_reference,n.notes=t.notes,n.tags=t.tags,n.amount=parseFloat(t.amount).toFixed(t.currency_decimal_places),n.currency_code=t.currency_code,t.foreign_amount!==null&&(n.forein_currency_code=t.foreign_currency_code,n.foreign_amount=parseFloat(t.foreign_amount).toFixed(t.foreign_currency_decimal_places)),n.date=p(new Date(t.date),"yyyy-MM-dd HH:mm"),n.description=t.description,n.destination_account={id:t.destination_id,name:t.destination_name,type:t.destination_type,alpine_name:t.destination_name},n.source_account={id:t.source_id,name:t.source_name,type:t.source_type,alpine_name:t.source_name},t.latitude!==null&&(n.hasLocation=!0,n.latitude=t.latitude,n.longitude=t.longitude,n.zoomLevel=t.zoom_level),console.log(n.tags),i.push(n)}return i}const s=P();let L=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:"edit",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:[]},addedSplit(){setTimeout(()=>{const e=function(i,o,t){return i.name_with_balance+'
'+a.t("firefly.account_type_"+i.type)+""};r({selector:"input.ac-source",serverUrl:s.account,filters:this.filters.source,onRenderItem:e,onChange:y,onSelectItem:b}),console.log("ok"),console.log(this.entries[0].source_account.alpine_name),r({selector:"input.ac-dest",serverUrl:s.account,filters:this.filters.destination,onRenderItem:e,onChange:w,onSelectItem:v}),r({selector:"input.ac-category",serverUrl:s.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),r({selector:"input.ac-description",serverUrl:s.description,valueField:"id",labelField:"description",onChange:u,onSelectItem:u})},250)},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(e){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(e){return console.log("at get tags "+e),console.log(this.entries[e].tags),this.entries[e].tags??[]},getTransactionGroup(){this.entries=[];const e=window.location.href.split("/"),i=parseInt(e[e.length-1]);new f().show(i,{}).then(t=>{const n=t.data.data;this.groupProperties.id=parseInt(n.id),this.groupProperties.transactionType=n.attributes.transactions[0].type,this.groupProperties.title=n.attributes.title??n.attributes.transactions[0].description,this.entries=x(n.attributes.transactions),this.notifications.wait.show=!1}).then(()=>{this.groupProperties.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[t].amount),this.filters.source.push(this.entries[t].source_account.type),this.filters.destination.push(this.entries[t].source_account.type));console.log(this.filters),setTimeout(()=>{m.init("select.ac-tags",{allowClear:!0,server:s.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:a.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=a.t("firefly.wait_loading_transaction"),this.getTransactionGroup(),A().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}),S().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),D().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})},changedAmount(e){const i=parseInt(e.target.dataset.index);this.entries[i].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let o in this.entries)this.entries.hasOwnProperty(o)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[o].amount))}}},d={transactions:L,dates:h};function g(){Object.keys(d).forEach(e=>{console.log(`Loading page component "${e}"`);let i=d[e]();Alpine.data(e,()=>i)}),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/get-51a7c3ed.js b/public/build/assets/get-51a7c3ed.js new file mode 100644 index 0000000000..ac66d9a5e0 --- /dev/null +++ b/public/build/assets/get-51a7c3ed.js @@ -0,0 +1 @@ +import{s as y,t as l,u as d,v as m,w as A,x as w,y as b,z as _,D as N,E as D,G as c,H as i,I as C,J as P,f as B,K as x,M as O,N as E,O as S,Q as G,R as I,U as T,V as U,W,X as L,Y as $,Z as Q,_ as V,$ as Y,a0 as q,a1 as z,a2 as X,a3 as j,a4 as F,a5 as H,a6 as J,a7 as K,a8 as Z,a9 as tt,aa as et,ab as at,ac as st,ad as nt,ae as rt,af as dt,ag as lt,ah as it,i as ot,ai as ut,aj as gt}from"./vendor-824d08a0.js";const v="/",o=y.create({baseURL:v,withCredentials:!0});y.defaults.withCredentials=!0;y.defaults.baseURL=v;class R{getByName(t){return o.get("/api/v1/preferences/"+t)}getByNameNow(t){return o.get("/api/v1/preferences/"+t)}postByName(t,e){return o.post("/api/v1/preferences",{name:t,data:e})}}class k{post(t,e){let s="/api/v1/preferences";return o.post(s,{name:t,data:e})}}function ct(a,t=null){return new R().getByName(a).then(s=>Promise.resolve(f(a,s))).catch(()=>{new k().post(a,t).then(u=>Promise.resolve(f(a,u)))})}function f(a,t){return t.data.data.attributes.data}function h(a,t=null){const e=window.store.get("cacheValid");if(e&&window.hasOwnProperty(a))return Promise.resolve(window[a]);const s=window.store.get(a);return e&&typeof s<"u"?Promise.resolve(s):new R().getByName(a).then(g=>Promise.resolve(M(a,g))).catch(()=>{new k().post(a,t).then(n=>Promise.resolve(M(a,n)))})}function M(a,t){let e=t.data.data.attributes.data;return window.store.set(a,e),e}function wt(a,t){let e,s;switch(a){case"last365":e=l(c(t,365)),s=d(t);break;case"last90":e=l(c(t,90)),s=d(t);break;case"last30":e=l(c(t,30)),s=d(t);break;case"last7":e=l(c(t,7)),s=d(t);break;case"YTD":e=D(t),s=d(t);break;case"QTD":e=m(t),s=d(t);break;case"MTD":e=w(t),s=d(t);break;case"1D":e=l(t),s=d(t);break;case"1W":e=l(_(t,{weekStartsOn:1})),s=d(N(t,{weekStartsOn:1}));break;case"1M":e=l(w(t)),s=d(b(t));break;case"3M":e=l(m(t)),s=d(A(t));break;case"6M":t.getMonth()<=5&&(e=new Date(t),e.setMonth(0),e.setDate(1),e=l(e),s=new Date(t),s.setMonth(5),s.setDate(30),s=d(e)),t.getMonth()>5&&(e=new Date(t),e.setMonth(6),e.setDate(1),e=l(e),s=new Date(t),s.setMonth(11),s.setDate(31),s=d(e));break;case"1Y":e=new Date(t),e.setMonth(0),e.setDate(1),e=l(e),s=new Date(t),s.setMonth(11),s.setDate(31),s=d(s);break}return{start:e,end:s}}i.addPlugin(C);window.bootstrapped=!1;window.store=i;ct("lastActivity").then(a=>{const t=i.get("lastActivity");i.set("cacheValid",t===a),i.set("lastActivity",a),console.log("Server value: "+a),console.log("Local value: "+t),console.log("Cache valid: "+(t===a))}).then(()=>{Promise.all([h("viewRange"),h("darkMode"),h("locale"),h("language")]).then(a=>{if(!i.get("start")||!i.get("end")){const e=wt(a[0],new Date);i.set("start",e.start),i.set("end",e.end)}window.__localeId__=a[2],i.set("language",a[3]),i.set("locale",a[3]);const t=new Event("firefly-iii-bootstrapped");document.dispatchEvent(t),window.bootstrapped=!0})});window.axios=y;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.Alpine=P;const p={bg:x,cs:O,da:E,de:S,el:G,enGB:I,enUS:T,es:U,ca:W,fi:L,fr:$,hu:Q,id:V,it:Y,ja:q,ko:z,nb:X,nn:j,nl:F,pl:H,ptBR:J,pt:K,ro:Z,ru:tt,sk:et,sl:at,sv:st,tr:nt,uk:rt,vi:dt,zhTW:lt,zhCN:it};function r(a,t="PP"){let e=window.__localeId__.replace("_","");return B(a,t,{locale:p[e]??p[e.slice(0,2)]??p.enUS})}const yt=()=>({range:{start:null,end:null},defaultRange:{start:null,end:null},language:"en_US",init(){console.log(`Loading page component "DATES" with language "${ot.t("key")}".`),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",a=>{this.range.start=new Date(a)}),window.store.observe("end",a=>{this.range.end=new Date(a),this.buildDateRange()})},buildDateRange(){let a=this.getNextRange(),t=this.getPrevRange(),e=this.lastDays(7),s=this.lastDays(30),u=this.mtd(),g=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(a.start)+" - "+r(a.end),n.setAttribute("data-start",r(a.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(a.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-prev")[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-7d")[0],n.setAttribute("data-start",r(e.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(e.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(u.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(u.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-ytd")[0],n.setAttribute("data-start",r(g.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(g.end,"yyyy-MM-dd"))},getNextRange(){let a=w(this.range.start),t=ut(a,1),e=b(t);return{start:t,end:e}},getPrevRange(){let a=w(this.range.start),t=gt(a,1),e=b(t);return{start:t,end:e}},ytd(){let a=new Date;return{start:D(this.range.start),end:a}},mtd(){let a=new Date;return{start:w(this.range.start),end:a}},lastDays(a){let t=new Date;return{start:c(t,a),end:t}},changeDateRange(a){a.preventDefault();let t=a.currentTarget,e=new Date(t.getAttribute("data-start")),s=new Date(t.getAttribute("data-end"));return window.store.set("start",e),window.store.set("end",s),!1}});function pt(a,t){let e=window.__localeId__.replace("_","-");return Intl.NumberFormat(e,{style:"currency",currency:t}).format(a)}let bt=class{list(t){return o.get("/api/v2/subscriptions",{params:t})}paid(t){return o.get("/api/v2/subscriptions/sum/paid",{params:t})}unpaid(t){return o.get("/api/v2/subscriptions/sum/unpaid",{params:t})}};class ft{list(t){return o.get("/api/v2/piggy-banks",{params:t})}}export{bt as G,k as P,o as a,ft as b,yt as d,pt as f,h as g}; diff --git a/public/build/assets/get-c2292133.js b/public/build/assets/get-c23f6e9c.js similarity index 64% rename from public/build/assets/get-c2292133.js rename to public/build/assets/get-c23f6e9c.js index ae3eb6dd81..78b242e5f8 100644 --- a/public/build/assets/get-c2292133.js +++ b/public/build/assets/get-c23f6e9c.js @@ -1 +1 @@ -import{a as s}from"./get-c53daca3.js";class p{list(a){return s.get("/api/v2/transactions",{params:a})}show(a,t){return s.get("/api/v2/transactions/"+a,{params:t})}}export{p as G}; +import{a as s}from"./get-51a7c3ed.js";class p{list(a){return s.get("/api/v2/transactions",{params:a})}show(a,t){return s.get("/api/v2/transactions/"+a,{params:t})}}export{p as G}; diff --git a/public/build/assets/get-c53daca3.js b/public/build/assets/get-c53daca3.js deleted file mode 100644 index df70a4c8e3..0000000000 --- a/public/build/assets/get-c53daca3.js +++ /dev/null @@ -1 +0,0 @@ -import{n as y,s as l,o as d,q as f,r as A,t as w,u as b,v as _,w as N,x as D,y as c,z as i,D as C,E as P,f as B,G as x,H as O,J as E,K as S,M as G,N as T,O as U,Q as W,R as I,U as $,V as q,W as L,X as Q,Y as V,Z as Y,_ as j,$ as z,a0 as X,a1 as F,a2 as H,a3 as J,a4 as K,a5 as Z,a6 as tt,a7 as et,a8 as at,a9 as st,aa as nt,ab as rt,ac as dt,ad as lt,ae as it,af as ot,ag as ut}from"./vendor-4332182f.js";const v="/",o=y.create({baseURL:v,withCredentials:!0});y.defaults.withCredentials=!0;y.defaults.baseURL=v;class R{getByName(t){return o.get("/api/v1/preferences/"+t)}getByNameNow(t){return o.get("/api/v1/preferences/"+t)}postByName(t,a){return o.post("/api/v1/preferences",{name:t,data:a})}}class k{post(t,a){let s="/api/v1/preferences";return o.post(s,{name:t,data:a})}}function gt(e,t=null){return new R().getByName(e).then(s=>Promise.resolve(m(e,s))).catch(()=>{new k().post(e,t).then(u=>Promise.resolve(m(e,u)))})}function m(e,t){return t.data.data.attributes.data}function h(e,t=null){const a=window.store.get("cacheValid");if(a&&window.hasOwnProperty(e))return Promise.resolve(window[e]);const s=window.store.get(e);return a&&typeof s<"u"?Promise.resolve(s):new R().getByName(e).then(g=>Promise.resolve(M(e,g))).catch(()=>{new k().post(e,t).then(n=>Promise.resolve(M(e,n)))})}function M(e,t){let a=t.data.data.attributes.data;return window.store.set(e,a),a}function ct(e,t){let a,s;switch(e){case"last365":a=l(c(t,365)),s=d(t);break;case"last90":a=l(c(t,90)),s=d(t);break;case"last30":a=l(c(t,30)),s=d(t);break;case"last7":a=l(c(t,7)),s=d(t);break;case"YTD":a=D(t),s=d(t);break;case"QTD":a=f(t),s=d(t);break;case"MTD":a=w(t),s=d(t);break;case"1D":a=l(t),s=d(t);break;case"1W":a=l(_(t,{weekStartsOn:1})),s=d(N(t,{weekStartsOn:1}));break;case"1M":a=l(w(t)),s=d(b(t));break;case"3M":a=l(f(t)),s=d(A(t));break;case"6M":t.getMonth()<=5&&(a=new Date(t),a.setMonth(0),a.setDate(1),a=l(a),s=new Date(t),s.setMonth(5),s.setDate(30),s=d(a)),t.getMonth()>5&&(a=new Date(t),a.setMonth(6),a.setDate(1),a=l(a),s=new Date(t),s.setMonth(11),s.setDate(31),s=d(a));break;case"1Y":a=new Date(t),a.setMonth(0),a.setDate(1),a=l(a),s=new Date(t),s.setMonth(11),s.setDate(31),s=d(s);break}return{start:a,end:s}}i.addPlugin(C);window.bootstrapped=!1;window.store=i;gt("lastActivity").then(e=>{const t=i.get("lastActivity");i.set("cacheValid",t===e),i.set("lastActivity",e),console.log("Server value: "+e),console.log("Local value: "+t),console.log("Cache valid: "+(t===e))}).then(()=>{Promise.all([h("viewRange"),h("darkMode"),h("locale"),h("language")]).then(e=>{if(!i.get("start")||!i.get("end")){const a=ct(e[0],new Date);i.set("start",a.start),i.set("end",a.end)}window.__localeId__=e[2],i.set("language",e[3]),i.set("locale",e[3]);const t=new Event("firefly-iii-bootstrapped");document.dispatchEvent(t),window.bootstrapped=!0})});window.axios=y;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.Alpine=P;const p={bg:x,cs:O,da:E,de:S,el:G,enGB:T,enUS:U,es:W,ca:I,fi:$,fr:q,hu:L,id:Q,it:V,ja:Y,ko:j,nb:z,nn:X,nl:F,pl:H,ptBR:J,pt:K,ro:Z,ru:tt,sk:et,sl:at,sv:st,tr:nt,uk:rt,vi:dt,zhTW:lt,zhCN:it};function r(e,t="PP"){let a=window.__localeId__.replace("_","");return B(e,t,{locale:p[a]??p[a.slice(0,2)]??p.enUS})}const ht=()=>({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",e=>{this.range.start=new Date(e)}),window.store.observe("end",e=>{this.range.end=new Date(e),this.buildDateRange()})},buildDateRange(){let e=this.getNextRange(),t=this.getPrevRange(),a=this.lastDays(7),s=this.lastDays(30),u=this.mtd(),g=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(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-prev")[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-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(u.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(u.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-ytd")[0],n.setAttribute("data-start",r(g.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(g.end,"yyyy-MM-dd"))},getNextRange(){let e=w(this.range.start),t=ot(e,1),a=b(t);return{start:t,end:a}},getPrevRange(){let e=w(this.range.start),t=ut(e,1),a=b(t);return{start:t,end:a}},ytd(){let e=new Date;return{start:D(this.range.start),end:e}},mtd(){let e=new Date;return{start:w(this.range.start),end:e}},lastDays(e){let t=new Date;return{start:c(t,e),end:t}},changeDateRange(e){e.preventDefault();let t=e.currentTarget,a=new Date(t.getAttribute("data-start")),s=new Date(t.getAttribute("data-end"));return window.store.set("start",a),window.store.set("end",s),!1}});function yt(e,t){let a=window.__localeId__.replace("_","-");return Intl.NumberFormat(a,{style:"currency",currency:t}).format(e)}async function pt(e,t){{t=t.replace("-","_");const s=await(await fetch(`./v2/i18n/${t}.json`)).json();e.store(s)}}let bt=class{list(t){return o.get("/api/v2/subscriptions",{params:t})}paid(t){return o.get("/api/v2/subscriptions/sum/paid",{params:t})}unpaid(t){return o.get("/api/v2/subscriptions/sum/unpaid",{params:t})}};class mt{list(t){return o.get("/api/v2/piggy-banks",{params:t})}}export{bt as G,k as P,o as a,mt as b,ht as d,yt as f,h as g,pt as l}; diff --git a/public/build/assets/vendor-4332182f.js b/public/build/assets/vendor-4332182f.js deleted file mode 100644 index b2d9cb282d..0000000000 --- a/public/build/assets/vendor-4332182f.js +++ /dev/null @@ -1,52 +0,0 @@ -var ra=Object.defineProperty;var aa=(e,t,n)=>t in e?ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>(aa(e,typeof t!="symbol"?t+"":t,n),n);function bind$4(e,t){return function(){return e.apply(t,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(e=>t=>{const n=toString$7.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray:isArray$d}=Array,isUndefined=typeOfTest("undefined");function isBuffer$3(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction$6(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}const isString$1=typeOfTest("string"),isFunction$6=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$c=e=>e!==null&&typeof e=="object",isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject$c(e)&&isFunction$6(e.pipe),isFormData=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction$6(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction$6(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim$2=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,r;if(typeof e!="object"&&(e=[e]),isArray$d(e))for(i=0,r=e.length;i0;)if(r=n[i],t===r.toLowerCase())return r;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge$1(){const{caseless:e}=isContextDefined(this)&&this||{},t={},n=(i,r)=>{const a=e&&findKey$1(t,r)||r;isPlainObject(t[a])&&isPlainObject(i)?t[a]=merge$1(t[a],i):isPlainObject(i)?t[a]=merge$1({},i):isArray$d(i)?t[a]=i.slice():t[a]=i};for(let i=0,r=arguments.length;i(forEach(t,(r,a)=>{n&&isFunction$6(r)?e[a]=bind$4(r,n):e[a]=r},{allOwnKeys:i}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject=(e,t,n,i)=>{let r,a,o;const l={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),a=r.length;a-- >0;)o=r[a],(!i||i(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},toArray=e=>{if(!e)return null;if(isArray$d(e))return e;let t=e.length;if(!isNumber$1(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},isTypedArray$3=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const i=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=i.next())&&!r.done;){const a=r.value;t.call(e,a[0],a[1])}},matchAll=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),hasOwnProperty$c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};forEach(n,(r,a)=>{let o;(o=t(r,a,e))!==!1&&(i[a]=o||r)}),Object.defineProperties(e,i)},freezeMethods=e=>{reduceDescriptors(e,(t,n)=>{if(isFunction$6(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(isFunction$6(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet=(e,t)=>{const n={},i=r=>{r.forEach(a=>{n[a]=!0})};return isArray$d(e)?i(e):i(String(e).split(t)),n},noop$4=()=>{},toFiniteNumber=(e,t)=>(e=+e,Number.isFinite(e)?e:t),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(e=16,t=ALPHABET.ALPHA_DIGIT)=>{let n="";const{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function isSpecCompliantForm(e){return!!(e&&isFunction$6(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const toJSONObject=e=>{const t=new Array(10),n=(i,r)=>{if(isObject$c(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[r]=i;const a=isArray$d(i)?[]:{};return forEach(i,(o,l)=>{const u=n(o,r+1);!isUndefined(u)&&(a[l]=u)}),t[r]=void 0,a}}return i};return n(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject$c(e)||isFunction$6(e))&&isFunction$6(e.then)&&isFunction$6(e.catch),utils$1={isArray:isArray$d,isArrayBuffer,isBuffer:isBuffer$3,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean,isObject:isObject$c,isPlainObject,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$6,isStream,isURLSearchParams,isTypedArray:isTypedArray$3,isFileList,forEach,merge:merge$1,extend,trim:trim$2,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$c,hasOwnProp:hasOwnProperty$c,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$4,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(e,t,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r)}utils$1.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors$1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors$1[e]={value:e}});Object.defineProperties(AxiosError,descriptors$1);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(e,t,n,i,r,a)=>{const o=Object.create(prototype$1);return utils$1.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),AxiosError.call(o,e.message,t,n,i,r),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,n){return e?e.concat(t).map(function(r,a){return r=removeBrackets(r),!n&&a?"["+r+"]":r}).join(n?".":""):t}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(t){return/^is[A-Z]/.test(t)});function toFormData(e,t,n){if(!utils$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=utils$1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,x){return!utils$1.isUndefined(x[E])});const i=n.metaTokens,r=n.visitor||m,a=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(r))throw new TypeError("visitor must be a function");function d(w){if(w===null)return"";if(utils$1.isDate(w))return w.toISOString();if(!u&&utils$1.isBlob(w))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(w)||utils$1.isTypedArray(w)?u&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function m(w,E,x){let M=w;if(w&&!x&&typeof w=="object"){if(utils$1.endsWith(E,"{}"))E=i?E:E.slice(0,-2),w=JSON.stringify(w);else if(utils$1.isArray(w)&&isFlatArray(w)||(utils$1.isFileList(w)||utils$1.endsWith(E,"[]"))&&(M=utils$1.toArray(w)))return E=removeBrackets(E),M.forEach(function(R,W){!(utils$1.isUndefined(R)||R===null)&&t.append(o===!0?renderKey([E],W,a):o===null?E:E+"[]",d(R))}),!1}return isVisitable(w)?!0:(t.append(renderKey(x,E,a),d(w)),!1)}const g=[],_=Object.assign(predicates,{defaultVisitor:m,convertValue:d,isVisitable});function v(w,E){if(!utils$1.isUndefined(w)){if(g.indexOf(w)!==-1)throw Error("Circular reference detected in "+E.join("."));g.push(w),utils$1.forEach(w,function(M,S){(!(utils$1.isUndefined(M)||M===null)&&r.call(t,M,utils$1.isString(S)?S.trim():S,E,_))===!0&&v(M,E?E.concat(S):[S])}),g.pop()}}if(!utils$1.isObject(e))throw new TypeError("data must be an object");return v(e),t}function encode$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(t,n){this._pairs.push([t,n])};prototype.toString=function(t){const n=t?function(i){return t.call(this,i,encode$1)}:encode$1;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,n){if(!t)return e;const i=n&&n.encode||encode,r=n&&n.serialize;let a;if(r?a=r(t,n):a=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,n).toString(i),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class InterceptorManager{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils$1.forEach(this.handlers,function(i){i!==null&&t(i)})}}const InterceptorManager$1=InterceptorManager,transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv=(e=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,t){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,a){return platform.isNode&&utils$1.isBuffer(n)?(this.append(i,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},n=Object.keys(e);let i;const r=n.length;let a;for(i=0;i=n.length;return o=!o&&utils$1.isArray(r)?r.length:o,u?(utils$1.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!l):((!r[o]||!utils$1.isObject(r[o]))&&(r[o]=[]),t(n,i,r[o],a)&&utils$1.isArray(r[o])&&(r[o]=arrayToObject(r[o])),!l)}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const n={};return utils$1.forEachEntry(e,(i,r)=>{t(parsePropPath(i),r,n,0)}),n}return null}function stringifySafely(e,t,n){if(utils$1.isString(e))try{return(t||JSON.parse)(e),utils$1.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const defaults$1={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(t,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,a=utils$1.isObject(t);if(a&&utils$1.isHTMLForm(t)&&(t=new FormData(t)),utils$1.isFormData(t))return r&&r?JSON.stringify(formDataToJSON(t)):t;if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t))return t;if(utils$1.isArrayBufferView(t))return t.buffer;if(utils$1.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(t,this.formSerializer).toString();if((l=utils$1.isFileList(t))||i.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return toFormData(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return a||r?(n.setContentType("application/json",!1),stringifySafely(t)):t}],transformResponse:[function(t){const n=this.transitional||defaults$1.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&utils$1.isString(t)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?AxiosError.from(l,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],e=>{defaults$1.headers[e]={}});const defaults$2=defaults$1,ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const t={};let n,i,r;return e&&e.split(` -`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||t[n]&&ignoreDuplicateOf[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},$internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,t,n,i,r){if(utils$1.isFunction(i))return i.call(this,t,n);if(r&&(t=n),!!utils$1.isString(t)){if(utils$1.isString(i))return t.indexOf(i)!==-1;if(utils$1.isRegExp(i))return i.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function buildAccessors(e,t){const n=utils$1.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(r,a,o){return this[i].call(this,t,r,a,o)},configurable:!0})})}class AxiosHeaders{constructor(t){t&&this.set(t)}set(t,n,i){const r=this;function a(l,u,d){const m=normalizeHeader(u);if(!m)throw new Error("header name must be a non-empty string");const g=utils$1.findKey(r,m);(!g||r[g]===void 0||d===!0||d===void 0&&r[g]!==!1)&&(r[g||u]=normalizeValue(l))}const o=(l,u)=>utils$1.forEach(l,(d,m)=>a(d,m,u));return utils$1.isPlainObject(t)||t instanceof this.constructor?o(t,n):utils$1.isString(t)&&(t=t.trim())&&!isValidHeaderName(t)?o(parseHeaders(t),n):t!=null&&a(n,t,i),this}get(t,n){if(t=normalizeHeader(t),t){const i=utils$1.findKey(this,t);if(i){const r=this[i];if(!n)return r;if(n===!0)return parseTokens(r);if(utils$1.isFunction(n))return n.call(this,r,i);if(utils$1.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=normalizeHeader(t),t){const i=utils$1.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||matchHeaderValue(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let r=!1;function a(o){if(o=normalizeHeader(o),o){const l=utils$1.findKey(i,o);l&&(!n||matchHeaderValue(i,i[l],l,n))&&(delete i[l],r=!0)}}return utils$1.isArray(t)?t.forEach(a):a(t),r}clear(t){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const a=n[i];(!t||matchHeaderValue(this,this[a],a,t,!0))&&(delete this[a],r=!0)}return r}normalize(t){const n=this,i={};return utils$1.forEach(this,(r,a)=>{const o=utils$1.findKey(i,a);if(o){n[o]=normalizeValue(r),delete n[a];return}const l=t?formatHeader(a):String(a).trim();l!==a&&delete n[a],n[l]=normalizeValue(r),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return utils$1.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=t&&utils$1.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[$internals]=this[$internals]={accessors:{}}).accessors,r=this.prototype;function a(o){const l=normalizeHeader(o);i[l]||(buildAccessors(r,o),i[l]=!0)}return utils$1.isArray(t)?t.forEach(a):a(t),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});utils$1.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(e,t){const n=this||defaults$2,i=t||n,r=AxiosHeaders$1.from(i.headers);let a=i.data;return utils$1.forEach(e,function(l){a=l.call(n,a,r.normalize(),t?t.status:void 0)}),r.normalize(),a}function isCancel(e){return!!(e&&e.__CANCEL__)}function CanceledError(e,t,n){AxiosError.call(this,e??"canceled",AxiosError.ERR_CANCELED,t,n),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new AxiosError("Request failed with status code "+n.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const cookies=platform.hasStandardBrowserEnv?{write(e,t,n,i,r,a){const o=[e+"="+encodeURIComponent(t)];utils$1.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),utils$1.isString(i)&&o.push("path="+i),utils$1.isString(r)&&o.push("domain="+r),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t){return e&&!isAbsoluteURL(t)?combineURLs(e,t):t}const isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function r(a){let o=a;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=r(window.location.href),function(o){const l=utils$1.isString(o)?r(o):o;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}();function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r=0,a=0,o;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),m=i[a];o||(o=d),n[r]=u,i[r]=d;let g=a,_=0;for(;g!==r;)_+=n[g++],g=g%e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),d-o{const a=r.loaded,o=r.lengthComputable?r.total:void 0,l=a-n,u=i(l),d=a<=o;n=a;const m={loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o&&d?(o-a)/u:void 0,event:r};m[t?"download":"upload"]=!0,e(m)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(n,i){let r=e.data;const a=AxiosHeaders$1.from(e.headers).normalize();let{responseType:o,withXSRFToken:l}=e,u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let m;if(utils$1.isFormData(r)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((m=a.getContentType())!==!1){const[E,...x]=m?m.split(";").map(M=>M.trim()).filter(Boolean):[];a.setContentType([E||"multipart/form-data",...x].join("; "))}}let g=new XMLHttpRequest;if(e.auth){const E=e.auth.username||"",x=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(E+":"+x))}const _=buildFullPath(e.baseURL,e.url);g.open(e.method.toUpperCase(),buildURL(_,e.params,e.paramsSerializer),!0),g.timeout=e.timeout;function v(){if(!g)return;const E=AxiosHeaders$1.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),M={data:!o||o==="text"||o==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:e,request:g};settle(function(R){n(R),d()},function(R){i(R),d()},M),g=null}if("onloadend"in g?g.onloadend=v:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(v)},g.onabort=function(){g&&(i(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,g)),g=null)},g.onerror=function(){i(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let x=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const M=e.transitional||transitionalDefaults;e.timeoutErrorMessage&&(x=e.timeoutErrorMessage),i(new AxiosError(x,M.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,g)),g=null},platform.hasStandardBrowserEnv&&(l&&utils$1.isFunction(l)&&(l=l(e)),l||l!==!1&&isURLSameOrigin(_))){const E=e.xsrfHeaderName&&e.xsrfCookieName&&cookies.read(e.xsrfCookieName);E&&a.set(e.xsrfHeaderName,E)}r===void 0&&a.setContentType(null),"setRequestHeader"in g&&utils$1.forEach(a.toJSON(),function(x,M){g.setRequestHeader(M,x)}),utils$1.isUndefined(e.withCredentials)||(g.withCredentials=!!e.withCredentials),o&&o!=="json"&&(g.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&g.addEventListener("progress",progressEventReducer(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&g.upload&&g.upload.addEventListener("progress",progressEventReducer(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=E=>{g&&(i(!E||E.type?new CanceledError(null,e,g):E),g.abort(),g=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const w=parseProtocol(_);if(w&&platform.protocols.indexOf(w)===-1){i(new AxiosError("Unsupported protocol "+w+":",AxiosError.ERR_BAD_REQUEST,e));return}g.send(r||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils$1.forEach(knownAdapters,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||e===null||e===!1,adapters$1={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let a=0;a`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since : -`+a.map(renderReason).join(` -`):" "+renderReason(a[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError(null,e)}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders$1.from(e.headers),e.data=transformData.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),adapters$1.getAdapter(e.adapter||defaults$2.adapter)(e).then(function(i){return throwIfCancellationRequested(e),i.data=transformData.call(e,e.transformResponse,i),i.headers=AxiosHeaders$1.from(i.headers),i},function(i){return isCancel(i)||(throwIfCancellationRequested(e),i&&i.response&&(i.response.data=transformData.call(e,e.transformResponse,i.response),i.response.headers=AxiosHeaders$1.from(i.response.headers))),Promise.reject(i)})}const headersToObject=e=>e instanceof AxiosHeaders$1?e.toJSON():e;function mergeConfig(e,t){t=t||{};const n={};function i(d,m,g){return utils$1.isPlainObject(d)&&utils$1.isPlainObject(m)?utils$1.merge.call({caseless:g},d,m):utils$1.isPlainObject(m)?utils$1.merge({},m):utils$1.isArray(m)?m.slice():m}function r(d,m,g){if(utils$1.isUndefined(m)){if(!utils$1.isUndefined(d))return i(void 0,d,g)}else return i(d,m,g)}function a(d,m){if(!utils$1.isUndefined(m))return i(void 0,m)}function o(d,m){if(utils$1.isUndefined(m)){if(!utils$1.isUndefined(d))return i(void 0,d)}else return i(void 0,m)}function l(d,m,g){if(g in t)return i(d,m);if(g in e)return i(void 0,d)}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(d,m)=>r(headersToObject(d),headersToObject(m),!0)};return utils$1.forEach(Object.keys(Object.assign({},e,t)),function(m){const g=u[m]||r,_=g(e[m],t[m],m);utils$1.isUndefined(_)&&g!==l||(n[m]=_)}),n}const VERSION$1="1.6.5",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{validators$1[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function(t,n,i){function r(a,o){return"[Axios v"+VERSION$1+"] Transitional option '"+a+"'"+o+(i?". "+i:"")}return(a,o,l)=>{if(t===!1)throw new AxiosError(r(o," has been removed"+(n?" in "+n:"")),AxiosError.ERR_DEPRECATED);return n&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,l):!0}};function assertOptions(e,t,n){if(typeof e!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const a=i[r],o=t[a];if(o){const l=e[a],u=l===void 0||o(l,a,e);if(u!==!0)throw new AxiosError("option "+a+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new AxiosError("Unknown option "+a,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(t){this.defaults=t,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mergeConfig(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:a}=n;i!==void 0&&validator.assertOptions(i,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),r!=null&&(utils$1.isFunction(r)?n.paramsSerializer={serialize:r}:validator.assertOptions(r,{encode:validators.function,serialize:validators.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&utils$1.merge(a.common,a[n.method]);a&&utils$1.forEach(["delete","get","head","post","put","patch","common"],w=>{delete a[w]}),n.headers=AxiosHeaders$1.concat(o,a);const l=[];let u=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(u=u&&E.synchronous,l.unshift(E.fulfilled,E.rejected))});const d=[];this.interceptors.response.forEach(function(E){d.push(E.fulfilled,E.rejected)});let m,g=0,_;if(!u){const w=[dispatchRequest.bind(this),void 0];for(w.unshift.apply(w,l),w.push.apply(w,d),_=w.length,m=Promise.resolve(n);g<_;)m=m.then(w[g++],w[g++]);return m}_=l.length;let v=n;for(g=0;g<_;){const w=l[g++],E=l[g++];try{v=w(v)}catch(x){E.call(this,x);break}}try{m=dispatchRequest.call(this,v)}catch(w){return Promise.reject(w)}for(g=0,_=d.length;g<_;)m=m.then(d[g++],d[g++]);return m}getUri(t){t=mergeConfig(this.defaults,t);const n=buildFullPath(t.baseURL,t.url);return buildURL(n,t.params,t.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function(t){Axios.prototype[t]=function(n,i){return this.request(mergeConfig(i||{},{method:t,url:n,data:(i||{}).data}))}});utils$1.forEach(["post","put","patch"],function(t){function n(i){return function(a,o,l){return this.request(mergeConfig(l||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Axios.prototype[t]=n(),Axios.prototype[t+"Form"]=n(!0)});const Axios$1=Axios;class CancelToken{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const i=this;this.promise.then(r=>{if(!i._listeners)return;let a=i._listeners.length;for(;a-- >0;)i._listeners[a](r);i._listeners=null}),this.promise.then=r=>{let a;const o=new Promise(l=>{i.subscribe(l),a=l}).then(r);return o.cancel=function(){i.unsubscribe(a)},o},t(function(a,o,l){i.reason||(i.reason=new CanceledError(a,o,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new CancelToken(function(r){t=r}),cancel:t}}}const CancelToken$1=CancelToken;function spread(e){return function(n){return e.apply(null,n)}}function isAxiosError(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([e,t])=>{HttpStatusCode[t]=e});const HttpStatusCode$1=HttpStatusCode;function createInstance(e){const t=new Axios$1(e),n=bind$4(Axios$1.prototype.request,t);return utils$1.extend(n,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return createInstance(mergeConfig(e,r))},n}const axios=createInstance(defaults$2);axios.Axios=Axios$1;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel;axios.VERSION=VERSION$1;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(t){return Promise.all(t)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e);axios.getAdapter=adapters$1.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const axios$1=axios;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var assign=make_assign(),create$2=make_create(),trim$1=make_trim(),Global$5=typeof window<"u"?window:commonjsGlobal,util$7={assign,create:create$2,trim:trim$1,bind:bind$3,slice:slice$2,each:each$9,map:map$2,pluck:pluck$1,isList:isList$1,isFunction:isFunction$5,isObject:isObject$b,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(t,n,i,r){for(var a=1;a"u"?null:console;if(e){var t=e.warn?e.warn:e.log;t.apply(e,arguments)}}function createStore(e,t,n){n||(n=""),e&&!isList(e)&&(e=[e]),t&&!isList(t)&&(t=[t]);var i=n?"__storejs_"+n+"_":"",r=n?new RegExp("^"+i):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:i,_namespaceRegexp:r,_testStorage:function(u){try{var d="__storejs__test__";u.write(d,d);var m=u.read(d)===d;return u.remove(d),m}catch{return!1}},_assignPluginFnProp:function(u,d){var m=this[d];this[d]=function(){var _=slice$1(arguments,0),v=this;function w(){if(m)return each$8(arguments,function(x,M){_[M]=x}),m.apply(v,_)}var E=[w].concat(_);return u.apply(v,E)}},_serialize:function(u){return JSON.stringify(u)},_deserialize:function(u,d){if(!u)return d;var m="";try{m=JSON.parse(u)}catch{m=u}return m!==void 0?m:d},_addStorage:function(u){this.enabled||this._testStorage(u)&&(this.storage=u,this.enabled=!0)},_addPlugin:function(u){var d=this;if(isList(u)){each$8(u,function(_){d._addPlugin(_)});return}var m=pluck(this.plugins,function(_){return u===_});if(!m){if(this.plugins.push(u),!isFunction$4(u))throw new Error("Plugins must be function values that return objects");var g=u.call(this);if(!isObject$a(g))throw new Error("Plugins must return an object of function properties");each$8(g,function(_,v){if(!isFunction$4(_))throw new Error("Bad plugin property: "+v+" from plugin "+u.name+". Plugins should only return functions.");d._assignPluginFnProp(_,v)})}},addStorage:function(u){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(u)}},l=create$1(o,storeAPI,{plugins:[]});return l.raw={},each$8(l,function(u,d){isFunction$4(u)&&(l.raw[d]=bind$2(l,u))}),each$8(e,function(u){l._addStorage(u)}),each$8(t,function(u){l._addPlugin(u)}),l}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$7,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(e){return localStorage().getItem(e)}function write$6(e,t){return localStorage().setItem(e,t)}function each$7(e){for(var t=localStorage().length-1;t>=0;t--){var n=localStorage().key(t);e(read$6(n),n)}}function remove$5(e){return localStorage().removeItem(e)}function clearAll$5(){return localStorage().clear()}var util$4=util$7,Global$3=util$4.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$5,write:write$5,each:each$6,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(e){return globalStorage[e]}function write$5(e,t){globalStorage[e]=t}function each$6(e){for(var t=globalStorage.length-1;t>=0;t--){var n=globalStorage.key(t);e(globalStorage[n],n)}}function remove$4(e){return globalStorage.removeItem(e)}function clearAll$4(){each$6(function(e,t){delete globalStorage[e]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$5,remove:remove$3,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$4(e,t){if(!disable){var n=fixKey(e);_withStorageEl(function(i){i.setAttribute(n,t),i.save(storageName)})}}function read$4(e){if(!disable){var t=fixKey(e),n=null;return _withStorageEl(function(i){n=i.getAttribute(t)}),n}}function each$5(e){_withStorageEl(function(t){for(var n=t.XMLDocument.documentElement.attributes,i=n.length-1;i>=0;i--){var r=n[i];e(t.getAttribute(r.name),r.name)}})}function remove$3(e){var t=fixKey(e);_withStorageEl(function(n){n.removeAttribute(t),n.save(storageName)})}function clearAll$3(){_withStorageEl(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(storageName);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(e){return e.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var e="script",t,n,i;try{n=new ActiveXObject("htmlfile"),n.open(),n.write("<"+e+">document.w=window'),n.close(),t=n.w.frames[0].document,i=t.createElement("div")}catch{i=doc$1.createElement("div"),t=doc$1.body}return function(r){var a=[].slice.call(arguments,0);a.unshift(i),t.appendChild(i),i.addBehavior("#default#userData"),i.load(storageName),r.apply(this,a),t.removeChild(i)}}var util$2=util$7,Global$1=util$2.Global,trim=util$2.trim,cookieStorage={name:"cookieStorage",read:read$3,write:write$3,each:each$4,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(e){if(!e||!_has(e))return null;var t="(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(t),"$1"))}function each$4(e){for(var t=doc.cookie.split(/; ?/g),n=t.length-1;n>=0;n--)if(trim(t[n])){var i=t[n].split("="),r=unescape(i[0]),a=unescape(i[1]);e(a,r)}}function write$3(e,t){e&&(doc.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(e){!e||!_has(e)||(doc.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$4(function(e,t){remove$2(t)})}function _has(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$1=util$7,Global=util$1.Global,sessionStorage_1={name:"sessionStorage",read:read$2,write:write$2,each:each$3,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(e){return sessionStorage().getItem(e)}function write$2(e,t){return sessionStorage().setItem(e,t)}function each$3(e){for(var t=sessionStorage().length-1;t>=0;t--){var n=sessionStorage().key(t);e(read$2(n),n)}}function remove$1(e){return sessionStorage().removeItem(e)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$2,remove,clearAll},memoryStorage={};function read$1(e){return memoryStorage[e]}function write$1(e,t){memoryStorage[e]=t}function each$2(e){for(var t in memoryStorage)memoryStorage.hasOwnProperty(t)&&e(memoryStorage[t],t)}function remove(e){delete memoryStorage[e]}function clearAll(e){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1],json2$1={},hasRequiredJson2;function requireJson2(){return hasRequiredJson2||(hasRequiredJson2=1,typeof JSON!="object"&&(JSON={}),function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(t){var n=meta[t];return typeof n=="string"?n:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,i,r,a,o=gap,l,u=t[e];switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(e)),typeof rep=="function"&&(u=rep.call(t,e,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,l=[],Object.prototype.toString.apply(u)==="[object Array]"){for(a=u.length,n=0;nlastFlushedIndex&&queue.splice(t,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let e=0;ee.effect(t,{scheduler:n=>{shouldSchedule?scheduler(n):n()}}),raw=e.raw}function overrideEffect(e){effect$3=e}function elementBoundEffect(e){let t=()=>{};return[i=>{let r=effect$3(i);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(a=>a())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),release(r))},r},()=>{t()}]}function dispatch(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function walk(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(r=>walk(r,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let i=e.firstElementChild;for(;i;)walk(i,t),i=i.nextElementSibling}function warn(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var started=!1;function start$1(){started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `