diff --git a/app/Api/V1/Controllers/Autocomplete/AccountController.php b/app/Api/V1/Controllers/Autocomplete/AccountController.php index 13de86cfc9..c89d5bf775 100644 --- a/app/Api/V1/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V1/Controllers/Autocomplete/AccountController.php @@ -41,7 +41,7 @@ class AccountController extends Controller { use AccountFilter; - /** @var array */ + /** @var array */ private array $balanceTypes; private AccountRepositoryInterface $repository; @@ -120,8 +120,8 @@ class AccountController extends Controller $return, static function (array $left, array $right) { $order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE]; - $posA = (int) array_search($left['type'], $order, true); - $posB = (int) array_search($right['type'], $order, true); + $posA = (int)array_search($left['type'], $order, true); + $posB = (int)array_search($right['type'], $order, true); return $posA - $posB; } diff --git a/app/Api/V1/Controllers/Controller.php b/app/Api/V1/Controllers/Controller.php index b07b9025ea..da267e9baf 100644 --- a/app/Api/V1/Controllers/Controller.php +++ b/app/Api/V1/Controllers/Controller.php @@ -88,8 +88,8 @@ abstract class Controller extends BaseController if ($page < 1) { $page = 1; } - if ($page > 2** 16) { - $page = 2** 16; + if ($page > 2 ** 16) { + $page = 2 ** 16; } $bag->set('page', $page); diff --git a/app/Api/V1/Controllers/Data/Bulk/TransactionController.php b/app/Api/V1/Controllers/Data/Bulk/TransactionController.php index c5db390690..38ac56d84e 100644 --- a/app/Api/V1/Controllers/Data/Bulk/TransactionController.php +++ b/app/Api/V1/Controllers/Data/Bulk/TransactionController.php @@ -89,7 +89,7 @@ class TransactionController extends Controller } /** - * @param array $params>> + * @param array $params >> * * @return bool */ diff --git a/app/Api/V1/Controllers/Data/DestroyController.php b/app/Api/V1/Controllers/Data/DestroyController.php index 8c697d8aab..4f7a211e43 100644 --- a/app/Api/V1/Controllers/Data/DestroyController.php +++ b/app/Api/V1/Controllers/Data/DestroyController.php @@ -289,7 +289,7 @@ class DestroyController extends Controller } /** - * @param array $types + * @param array $types */ private function destroyAccounts(array $types): void { @@ -314,7 +314,7 @@ class DestroyController extends Controller } /** - * @param array $types + * @param array $types */ private function destroyTransactions(array $types): void { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php index 9259afde53..5ce99fb923 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php @@ -255,7 +255,7 @@ class ListController extends Controller $unfiltered = $recurringRepos->getAll(); // filter selection - $collection = $unfiltered->filter( /** @phpstan-ignore-line */ + $collection = $unfiltered->filter(/** @phpstan-ignore-line */ static function (Recurrence $recurrence) use ($currency) { // @phpstan-ignore-line /** @var RecurrenceTransaction $transaction */ foreach ($recurrence->recurrenceTransactions as $transaction) { @@ -305,7 +305,7 @@ class ListController extends Controller $ruleRepos = app(RuleRepositoryInterface::class); $unfiltered = $ruleRepos->getAll(); - $collection = $unfiltered->filter( /** @phpstan-ignore-line */ + $collection = $unfiltered->filter(/** @phpstan-ignore-line */ static function (Rule $rule) use ($currency) { // @phpstan-ignore-line /** @var RuleTrigger $trigger */ foreach ($rule->ruleTriggers as $trigger) { diff --git a/app/Api/V1/Requests/Models/Rule/StoreRequest.php b/app/Api/V1/Requests/Models/Rule/StoreRequest.php index 8e128c980f..b9ae6ac673 100644 --- a/app/Api/V1/Requests/Models/Rule/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Rule/StoreRequest.php @@ -197,7 +197,7 @@ class StoreRequest extends FormRequest */ protected function atLeastOneActiveTrigger(Validator $validator): void { - $data = $validator->getData(); + $data = $validator->getData(); /** @var string|int|array|null $triggers */ $triggers = $data['triggers'] ?? []; // need at least one trigger @@ -227,7 +227,7 @@ class StoreRequest extends FormRequest */ protected function atLeastOneActiveAction(Validator $validator): void { - $data = $validator->getData(); + $data = $validator->getData(); /** @var string|int|array|null $actions */ $actions = $data['actions'] ?? []; // need at least one trigger diff --git a/app/Api/V1/Requests/Models/Webhook/CreateRequest.php b/app/Api/V1/Requests/Models/Webhook/CreateRequest.php index 5041c5e30b..9aab513693 100644 --- a/app/Api/V1/Requests/Models/Webhook/CreateRequest.php +++ b/app/Api/V1/Requests/Models/Webhook/CreateRequest.php @@ -57,9 +57,9 @@ class CreateRequest extends FormRequest // this is the way. $return = $this->getAllData($fields); - $return['trigger'] = $triggers[$return['trigger']] ?? (int) ($return['trigger']); - $return['response'] = $responses[$return['response']] ?? (int) ($return['response']); - $return['delivery'] = $deliveries[$return['delivery']] ?? (int) ($return['delivery']); + $return['trigger'] = $triggers[$return['trigger']] ?? (int)($return['trigger']); + $return['response'] = $responses[$return['response']] ?? (int)($return['response']); + $return['delivery'] = $deliveries[$return['delivery']] ?? (int)($return['delivery']); return $return; } diff --git a/app/Api/V2/Controllers/Autocomplete/AccountController.php b/app/Api/V2/Controllers/Autocomplete/AccountController.php index 70cc04e509..e7346a67b4 100644 --- a/app/Api/V2/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V2/Controllers/Autocomplete/AccountController.php @@ -125,8 +125,8 @@ class AccountController extends Controller $allItems, static function (array $a, array $b): int { $order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE]; - $pos_a = (int) array_search($a['type'], $order, true); - $pos_b = (int) array_search($b['type'], $order, true); + $pos_a = (int)array_search($a['type'], $order, true); + $pos_b = (int)array_search($b['type'], $order, true); return $pos_a - $pos_b; } diff --git a/app/Api/V2/Controllers/Chart/BudgetController.php b/app/Api/V2/Controllers/Chart/BudgetController.php index 23177fa36c..2171576a35 100644 --- a/app/Api/V2/Controllers/Chart/BudgetController.php +++ b/app/Api/V2/Controllers/Chart/BudgetController.php @@ -170,7 +170,7 @@ class BudgetController extends Controller */ private function noBudgetLimits(Budget $budget, Carbon $start, Carbon $end): array { - $spent = $this->opsRepository->listExpenses($start, $end, null, new Collection([$budget])); + $spent = $this->opsRepository->listExpenses($start, $end, null, new Collection([$budget])); return $this->processExpenses($budget->id, $spent, $start, $end); } @@ -274,7 +274,7 @@ class BudgetController extends Controller */ private function processLimit(Budget $budget, BudgetLimit $limit): array { - $end = clone $limit->end_date; + $end = clone $limit->end_date; $end->endOfDay(); $spent = $this->opsRepository->listExpenses($limit->start_date, $end, null, new Collection([$budget])); $limitCurrencyId = $limit->transaction_currency_id; diff --git a/app/Api/V2/Controllers/Controller.php b/app/Api/V2/Controllers/Controller.php index 0be425bb1e..e79c61130b 100644 --- a/app/Api/V2/Controllers/Controller.php +++ b/app/Api/V2/Controllers/Controller.php @@ -108,10 +108,10 @@ class Controller extends BaseController } if (null !== $date) { try { - $obj = Carbon::parse((string) $date, config('app.timezone')); + $obj = Carbon::parse((string)$date, config('app.timezone')); } catch (InvalidDateException | InvalidFormatException $e) { // don't care - app('log')->warning(sprintf('Ignored invalid date "%s" in API v2 controller parameter check: %s', substr((string) $date, 0, 20), $e->getMessage())); + app('log')->warning(sprintf('Ignored invalid date "%s" in API v2 controller parameter check: %s', substr((string)$date, 0, 20), $e->getMessage())); } // out of range? set to null. if (null !== $obj && ($obj->year <= 1900 || $obj->year > 2099)) { diff --git a/app/Api/V2/Controllers/Model/Budget/ShowController.php b/app/Api/V2/Controllers/Model/Budget/ShowController.php index fc43498b0b..26c505a401 100644 --- a/app/Api/V2/Controllers/Model/Budget/ShowController.php +++ b/app/Api/V2/Controllers/Model/Budget/ShowController.php @@ -29,7 +29,6 @@ use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Request\Generic\DateRequest; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; -use FireflyIII\Support\Http\Api\ConvertsExchangeRates; use Illuminate\Http\JsonResponse; /** diff --git a/app/Api/V2/Controllers/Model/Budget/SumController.php b/app/Api/V2/Controllers/Model/Budget/SumController.php index 21a3ffa6bc..6f6c29446c 100644 --- a/app/Api/V2/Controllers/Model/Budget/SumController.php +++ b/app/Api/V2/Controllers/Model/Budget/SumController.php @@ -26,9 +26,7 @@ namespace FireflyIII\Api\V2\Controllers\Model\Budget; use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Request\Generic\DateRequest; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; -use FireflyIII\Support\Http\Api\ConvertsExchangeRates; use Illuminate\Http\JsonResponse; /** @@ -63,8 +61,8 @@ class SumController extends Controller */ public function budgeted(DateRequest $request): JsonResponse { - $data = $request->getAll(); - $result = $this->repository->budgetedInPeriod($data['start'], $data['end']); + $data = $request->getAll(); + $result = $this->repository->budgetedInPeriod($data['start'], $data['end']); return response()->json($result); } @@ -79,8 +77,8 @@ class SumController extends Controller */ public function spent(DateRequest $request): JsonResponse { - $data = $request->getAll(); - $result = $this->repository->spentInPeriod($data['start'], $data['end']); + $data = $request->getAll(); + $result = $this->repository->spentInPeriod($data['start'], $data['end']); return response()->json($result); } diff --git a/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php b/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php index 4cfbb19069..65c6fefc6d 100644 --- a/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php +++ b/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php @@ -26,12 +26,8 @@ namespace FireflyIII\Api\V2\Controllers\Model\BudgetLimit; use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Request\Generic\DateRequest; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Budget; -use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface; -use FireflyIII\Transformers\V2\BudgetLimitTransformer; use Illuminate\Http\JsonResponse; -use Illuminate\Pagination\LengthAwarePaginator; /** * Class ListController diff --git a/app/Api/V2/Controllers/Summary/NetWorthController.php b/app/Api/V2/Controllers/Summary/NetWorthController.php index 1519926d1d..90cb1dac90 100644 --- a/app/Api/V2/Controllers/Summary/NetWorthController.php +++ b/app/Api/V2/Controllers/Summary/NetWorthController.php @@ -30,7 +30,6 @@ use FireflyIII\Helpers\Report\NetWorthInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Repositories\UserGroups\Account\AccountRepositoryInterface; -use FireflyIII\Support\Http\Api\ConvertsExchangeRates; use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait; use Illuminate\Http\JsonResponse; diff --git a/package-lock.json b/package-lock.json index 4a79bc4800..5e595ed529 100644 --- a/package-lock.json +++ b/package-lock.json @@ -452,9 +452,9 @@ "dev": true }, "node_modules/axios": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", - "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dev": true, "dependencies": { "follow-redirects": "^1.15.0", diff --git a/public/build/assets/create-4f2f5765.js b/public/build/assets/create-9a14f86d.js similarity index 99% rename from public/build/assets/create-4f2f5765.js rename to public/build/assets/create-9a14f86d.js index 7f338da1ba..1eda02547e 100644 --- a/public/build/assets/create-4f2f5765.js +++ b/public/build/assets/create-9a14f86d.js @@ -1 +1 @@ -var q=Object.defineProperty;var H=(n,e,t)=>e in n?q(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>(H(n,typeof e!="symbol"?e+"":e,t),t);import{x as P,w as M,J as j,z as R,I as $,A as z,y as V}from"./load-translations-7cdd7b0e.js";function T(){return{id:"",name:"",alpine_name:""}}function B(){let e=P(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",source_account:T(),destination_account:T(),date:e}}function W(n,e){let t=[];for(let s in n)if(n.hasOwnProperty(s)){const i=n[s];let o={};o.description=i.description,o.source_name=i.source_account.name,o.destination_name=i.destination_account.name,o.amount=i.amount,o.date=i.date,o.currency_code=i.currency_code,typeof i.source_account.id<"u"&&i.source_account.id.toString()!==""&&(o.source_id=i.source_account.id),typeof i.destination_account.id<"u"&&i.destination_account.id.toString()!==""&&(o.destination_id=i.destination_account.id),o.type=e,t.push(o)}return t}const A={showAllSuggestions:!1,suggestionsThreshold:1,maximumItems:0,autoselectFirst:!0,ignoreEnter:!1,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!1,fixed:!1,fuzzy:!1,startsWith:!1,preventBrowserAutocomplete:!1,itemClass:"",activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",items:[],source:null,hiddenInput:!1,hiddenValue:"",clearControl:"",datalist:"",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>e,onSelectItem:(n,e)=>{},onServerResponse:(n,e)=>n.json(),onChange:(n,e)=>{},onBeforeFetch:n=>{},onAfterFetch:n=>{}},x="is-loading",k="is-active",p="show",_="next",y="prev",g=new WeakMap;let L=0,v=0;function U(n,e=300){let t;return(...s)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,s)},e)}}function G(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function b(n){return n?G(n.toString()).toLowerCase():""}function K(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let s=0;se+"‍").join("")}class S{constructor(e,t={}){C(this,"handleEvent",e=>{["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)});if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}g.set(e,this),L++,v++,this._searchInput=e,this._configure(t),this._preventInput=!1,this._keyboardNavigation=!1,this._searchFunc=U(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._configureSearchInput(),this._configureDropElement(),this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this));const s=this._getClearControl();s&&s.addEventListener("click",this),["focus","change","blur","input","keydown"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this._fetchData()}static init(e="input.autocomplete",t={}){document.querySelectorAll(e).forEach(i=>{this.getOrCreateInstance(i,t)})}static getInstance(e){return g.has(e)?g.get(e):null}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,t)}dispose(){v--,["focus","change","blur","input","keydown"].forEach(t=>{this._searchInput.removeEventListener(t,this)}),["mousemove","mouseleave"].forEach(t=>{this._dropElement.removeEventListener(t,this)});const e=this._getClearControl();e&&e.removeEventListener("click",this),this._config.fixed&&v<=0&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._dropElement.parentElement.removeChild(this._dropElement),g.delete(this._searchInput)}_getClearControl(){if(this._config.clearControl)return document.querySelector(this._config.clearControl)}_configure(e={}){this._config=Object.assign({},A);const t={...e,...this._searchInput.dataset},s=i=>["true","false","1","0",!0,!1].includes(i)&&!!JSON.parse(i);for(const[i,o]of Object.entries(A)){if(t[i]===void 0)continue;const r=t[i];switch(typeof o){case"number":this._config[i]=parseInt(r);break;case"boolean":this._config[i]=s(r);break;case"string":this._config[i]=r.toString();break;case"object":if(Array.isArray(o))if(typeof r=="string"){const a=r.includes("|")?"|":",";this._config[i]=r.split(a)}else this._config[i]=r;else this._config[i]=typeof r=="string"?JSON.parse(r):r;break;case"function":this._config[i]=typeof r=="string"?window[r]:r;break;default:this._config[i]=r;break}}}_configureSearchInput(){if(this._searchInput.autocomplete="off",this._searchInput.spellcheck=!1,w(this._searchInput,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false",role:"combobox"}),this._searchInput.id&&this._config.preventBrowserAutocomplete){const e=document.querySelector(`[for="${this._searchInput.id}"]`);e&&X(e)}this._hiddenInput=null,this._config.hiddenInput&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.value=this._config.hiddenValue,this._hiddenInput.name=this._searchInput.name,this._searchInput.name="_"+this._searchInput.name,O(this._searchInput,this._hiddenInput))}_configureDropElement(){this._dropElement=document.createElement("ul"),this._dropElement.id="ac-menu-"+L,this._dropElement.classList.add("dropdown-menu","autocomplete-menu","p-0"),this._dropElement.style.maxHeight="280px",this._config.fullWidth||(this._dropElement.style.maxWidth="360px"),this._config.fixed&&(this._dropElement.style.position="fixed"),this._dropElement.style.overflowY="auto",this._dropElement.style.overscrollBehavior="contain",this._dropElement.style.textAlign="unset",O(this._searchInput,this._dropElement),this._searchInput.setAttribute("aria-controls",this._dropElement.id)}onclick(e){e.target.matches(this._config.clearControl)&&this.clear()}oninput(e){this._preventInput||(this._hiddenInput&&(this._hiddenInput.value=null),this.showOrSearch())}onchange(e){const t=this._searchInput.value,s=Object.values(this._items).find(i=>i.label===t);this._config.onChange(s,this)}onblur(e){this.hideSuggestions()}onfocus(e){this.showOrSearch()}onkeydown(e){switch(e.keyCode||e.key){case 13:case"Enter":if(this.isDropdownVisible()){const s=this.getSelection();s&&s.click(),(s||!this._config.ignoreEnter)&&e.preventDefault()}break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(y);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(_):this.showOrSearch(!1);break;case 27:case"Escape":this.isDropdownVisible()&&(this._searchInput.focus(),this.hideSuggestions());break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}getConfig(e=null){return e!==null?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}setData(e){this._items={},this._addItems(e)}enable(){this._searchInput.setAttribute("disabled","")}disable(){this._searchInput.removeAttribute("disabled")}isDisabled(){return this._searchInput.hasAttribute("disabled")||this._searchInput.disabled||this._searchInput.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(p)}clear(){this._searchInput.value="",this._hiddenInput&&(this._hiddenInput.value="")}getSelection(){return this._dropElement.querySelector("a."+k)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,k]}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=_,t=null){const s=this.getSelection();if(s){const i=e===_?"nextSibling":"previousSibling";t=s.parentNode;do t=t[i];while(t&&!this._isItemEnabled(t));t?(s.classList.remove(...this._activeClasses()),e===y?t.parentNode.scrollTop=t.offsetTop-t.parentNode.offsetTop:t.offsetTop>t.parentNode.offsetHeight-t.offsetHeight&&(t.parentNode.scrollTop+=t.offsetHeight)):s&&(t=s.parentElement)}else{if(e===y)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const i=t.querySelector("a");i.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",i.id),this._config.updateOnSelect&&(this._searchInput.value=i.dataset.label)}else this._searchInput.setAttribute("aria-activedescendant","");return t}_shouldShow(){return this.isDisabled()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions();return}this._config.liveServer?this._searchFunc():this._config.source?this._config.source(this._searchInput.value,t=>{this.setData(t),this._showSuggestions()}):this._showSuggestions()}_createGroup(e){const t=this._createLi(),s=document.createElement("span");return t.append(s),s.classList.add("dropdown-header","text-truncate"),s.innerHTML=e,t}_createItem(e,t){let s=t.label;if(this._config.highlightTyped){const r=b(s).indexOf(e);r!==-1&&(s=s.substring(0,r)+`${s.substring(r,r+e.length)}`+s.substring(r+e.length,s.length))}s=this._config.onRenderItem(t,s,this);const i=this._createLi(),o=document.createElement("a");if(i.append(o),o.id=this._dropElement.id+"-"+this._dropElement.children.length,o.classList.add("dropdown-item","text-truncate"),this._config.itemClass&&o.classList.add(...this._config.itemClass.split(" ")),o.setAttribute("data-value",t.value),o.setAttribute("data-label",t.label),o.setAttribute("tabindex","-1"),o.setAttribute("role","menuitem"),o.setAttribute("href","#"),o.innerHTML=s,t.data)for(const[r,a]of Object.entries(t.data))o.dataset[r]=a;return o.addEventListener("mouseenter",r=>{this._keyboardNavigation||(this.removeSelection(),i.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{r.preventDefault(),this._preventInput=!0,this._searchInput.value=J(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),i}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=b(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let s=0,i=null;const o=[];for(let r=0;r0&&this._config.searchFields.forEach(d=>{const f=b(c[d]);let m=!1;if(this._config.fuzzy)m=K(f,e);else{const E=f.indexOf(e);m=this._config.startsWith?E===0:E>=0}m&&(l=!0)});const N=l||e.length===0;if(h||l){if(s++,c.group&&!o.includes(c.group)){const f=this._createGroup(c.group);this._dropElement.appendChild(f),o.push(c.group)}const d=this._createItem(e,c);if(!i&&N&&(i=d),this._dropElement.appendChild(d),this._config.maximumItems>0&&s>=this._config.maximumItems)break}}if(i&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(_,i)),s===0)if(this._config.notFoundMessage){const r=this._createLi();r.innerHTML=`${this._config.notFoundMessage}`,this._dropElement.appendChild(r),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(p),this._dropElement.setAttribute("role","menu"),w(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(p)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(p),w(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),s=e.direction==="rtl",i=this._config.fullWidth,o=this._config.fixed;let r=null,a=null;o&&(r=t.x,a=t.y+t.height,s&&!i&&(r-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",i&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),r!==null&&(this._dropElement.style.left=r+"px"),a!==null&&(this._dropElement.style.top=a+"px");const c=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(c.y+c.height>h){const l=i?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+l+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const s=Array.from(t.children).map(i=>{const o=i.getAttribute("value")??i.innerHTML.toLowerCase(),r=i.innerHTML;return{value:o,label:r}});this._addItems(s)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let s=0;sc.group=o.group),this._addItems(o.items);continue}const r=typeof o=="string"?o:o.label,a=typeof o!="object"?{}:o;a.label=o[this._config.labelField]??r,a.value=o[this._config.valueField]??i,a.label&&(this._items[a.value]=a)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const s=Object.assign({},this._config.serverParams,t);if(s[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(s.t=Date.now()),s.related){const a=document.getElementById(s.related);if(a){s.related=a.value;const c=a.getAttribute("name");c&&(s[c]=a.value)}}const i=new URLSearchParams(s);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=i:o+="?"+i.toString(),this._searchInput.classList.add(x),this._config.onBeforeFetch(this),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const c=a[this._config.serverDataKey]||a;this.setData(c),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._searchInput.classList.remove(x),this._config.onAfterFetch(this)})}}class Y{post(e){let t="/api/v2/transactions";return M.post(t,e)}}class Q{list(e){return M.get("/api/v2/currencies",{params:e})}}let u;const I={description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts"};let Z=function(){return{count:0,totalAmount:0,transactionType:"unknown",showSuccessMessage:!1,showErrorMessage:!1,entries:[],loadingCurrencies:!0,defaultCurrency:{},enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],filters:{source:[],destination:[]},errorMessageText:"",detectTransactionType(){const n=this.entries[0].source_account.type??"unknown",e=this.entries[0].destination_account.type??"unknown";if(n==="unknown"&&e==="unknown"){this.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(n===e&&["Asset account","Loan","Debt","Mortgage"].includes(n)){this.transactionType="transfer",console.log('Transaction type is detected to be "'+this.transactionType+'".'),console.log("filter down currencies for transfer.");return}if(n==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="withdrawal",console.log('[a] Transaction type is detected to be "'+this.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(n==="Asset account"&&e==="unknown"){this.transactionType="withdrawal",console.log('[b] Transaction type is detected to be "'+this.transactionType+'".'),console.log(this.entries[0].source_account),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Expense account"){this.transactionType="withdrawal",console.log('[c] Transaction type is detected to be "'+this.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(n==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Asset account"){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}console.warn('Unknown account combination between "'+n+'" and "'+e+'".')},selectSourceAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={id:n.id,name:n.name,alpine_name:n.name,type:n.type,currency_code:n.currency_code},console.log("Changed source account into a known "+n.type.toLowerCase()),document.querySelector("#form")._x_dataStack[0].detectTransactionType()},filterNativeCurrencies(n){console.log('filterNativeCurrencies("'+n+'")');let e=[],t;for(let s in this.enabledCurrencies)if(this.enabledCurrencies.hasOwnProperty(s)){let i=this.enabledCurrencies[s];i.code===n&&(t=i)}e.push(t),this.nativeCurrencies=e;for(let s in this.entries)this.entries.hasOwnProperty(s)&&(this.entries[s].currency_code=n)},changedAmount(n){const e=parseInt(n.target.dataset.index);this.entries[e].amount=parseFloat(n.target.value),this.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.totalAmount=this.totalAmount+parseFloat(this.entries[t].amount));console.log("Changed amount to "+this.totalAmount)},selectDestAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={id:n.id,name:n.name,alpine_name:n.name,type:n.type,currency_code:n.currency_code},console.log("Changed destination account into a known "+n.type.toLowerCase()),document.querySelector("#form")._x_dataStack[0].detectTransactionType()},loadCurrencies(){console.log("Loading user currencies."),new Q().list({}).then(e=>{for(let t in e.data.data)if(e.data.data.hasOwnProperty(t)){let s=e.data.data[t];if(s.attributes.enabled){let i={id:s.id,name:s.attributes.name,code:s.attributes.code,default:s.attributes.default,symbol:s.attributes.symbol,decimal_places:s.attributes.decimal_places};i.default&&(this.defaultCurrency=i),this.enabledCurrencies.push(i),this.nativeCurrencies.push(i)}}this.loadingCurrencies=!1,console.log(this.enabledCurrencies)})},changeSourceAccount(n,e){if(console.log("changeSourceAccount"),typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account.name===e._searchInput.value){console.warn('Ignore hallucinated source account name change to "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType();return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={name:e._searchInput.value,alpine_name:e._searchInput.value},console.log('Changed source account into a unknown account called "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType()}},changeDestAccount(n,e){if(document.querySelector("#form")._x_dataStack[0].$data.entries[0].destination_account,typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account.name===e._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType();return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={name:e._searchInput.value,alpine_name:e._searchInput.value},console.log('Changed destination account into a unknown account called "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType()}},showError:!1,showSuccess:!1,addedSplit(){console.log("addedSplit"),S.init("input.ac-source",{server:I.account,serverParams:{types:this.filters.source},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,highlightTyped:!0,liveServer:!0,onChange:this.changeSourceAccount,onSelectItem:this.selectSourceAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'
'+u.t("firefly.account_type_"+n.type)+""}}),S.init("input.ac-dest",{server:I.account,serverParams:{types:this.filters.destination},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,liveServer:!0,highlightTyped:!0,onSelectItem:this.selectDestAccount,onChange:this.changeDestAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'
'+u.t("firefly.account_type_"+n.type)+""}}),this.filters.destination=[],S.init("input.ac-description",{server:I.description,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},valueField:"id",labelField:"description",highlightTyped:!0,onSelectItem:console.log})},init(){Promise.all([R("language","en_US")]).then(n=>{u=new $;const e=n[0].replace("-","_");u.locale=e,z(u,e).then(()=>{this.addSplit()})}),this.loadCurrencies(),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.detectTransactionType();let n=W(this.entries,this.transactionType),e={group_title:null,fire_webhooks:!1,apply_rules:!1,transactions:n};n.length>1&&(e.group_title=n[0].description);let t=new Y;console.log(e),t.post(e).then(s=>{this.showSuccessMessage=!0,console.log(s),window.location="transactions/show/"+s.data.data.id+"?transaction_group_id="+s.data.data.id+"&message=created"}).catch(s=>{this.showErrorMessage=!0,this.errorMessageText=s.response.data.message})},addSplit(){this.entries.push(B())},removeSplit(n){this.entries.splice(n,1),document.querySelector("#split-0-tab").click()},formattedTotalAmount(){return V(this.totalAmount,"EUR")}}},D={transactions:Z,dates:j};function F(){Object.keys(D).forEach(n=>{console.log(`Loading page component "${n}"`);let e=D[n]();Alpine.data(n,()=>e)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),F()});window.bootstrapped&&(console.log("Loaded through window variable."),F()); +var q=Object.defineProperty;var H=(n,e,t)=>e in n?q(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>(H(n,typeof e!="symbol"?e+"":e,t),t);import{x as P,w as M,J as j,z as R,I as $,A as z,y as V}from"./load-translations-66c1b55b.js";function T(){return{id:"",name:"",alpine_name:""}}function B(){let e=P(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",source_account:T(),destination_account:T(),date:e}}function W(n,e){let t=[];for(let s in n)if(n.hasOwnProperty(s)){const i=n[s];let o={};o.description=i.description,o.source_name=i.source_account.name,o.destination_name=i.destination_account.name,o.amount=i.amount,o.date=i.date,o.currency_code=i.currency_code,typeof i.source_account.id<"u"&&i.source_account.id.toString()!==""&&(o.source_id=i.source_account.id),typeof i.destination_account.id<"u"&&i.destination_account.id.toString()!==""&&(o.destination_id=i.destination_account.id),o.type=e,t.push(o)}return t}const A={showAllSuggestions:!1,suggestionsThreshold:1,maximumItems:0,autoselectFirst:!0,ignoreEnter:!1,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!1,fixed:!1,fuzzy:!1,startsWith:!1,preventBrowserAutocomplete:!1,itemClass:"",activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",items:[],source:null,hiddenInput:!1,hiddenValue:"",clearControl:"",datalist:"",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>e,onSelectItem:(n,e)=>{},onServerResponse:(n,e)=>n.json(),onChange:(n,e)=>{},onBeforeFetch:n=>{},onAfterFetch:n=>{}},x="is-loading",k="is-active",p="show",_="next",y="prev",g=new WeakMap;let L=0,v=0;function U(n,e=300){let t;return(...s)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,s)},e)}}function G(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function b(n){return n?G(n.toString()).toLowerCase():""}function K(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let s=0;se+"‍").join("")}class S{constructor(e,t={}){C(this,"handleEvent",e=>{["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)});if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}g.set(e,this),L++,v++,this._searchInput=e,this._configure(t),this._preventInput=!1,this._keyboardNavigation=!1,this._searchFunc=U(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._configureSearchInput(),this._configureDropElement(),this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this));const s=this._getClearControl();s&&s.addEventListener("click",this),["focus","change","blur","input","keydown"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this._fetchData()}static init(e="input.autocomplete",t={}){document.querySelectorAll(e).forEach(i=>{this.getOrCreateInstance(i,t)})}static getInstance(e){return g.has(e)?g.get(e):null}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,t)}dispose(){v--,["focus","change","blur","input","keydown"].forEach(t=>{this._searchInput.removeEventListener(t,this)}),["mousemove","mouseleave"].forEach(t=>{this._dropElement.removeEventListener(t,this)});const e=this._getClearControl();e&&e.removeEventListener("click",this),this._config.fixed&&v<=0&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._dropElement.parentElement.removeChild(this._dropElement),g.delete(this._searchInput)}_getClearControl(){if(this._config.clearControl)return document.querySelector(this._config.clearControl)}_configure(e={}){this._config=Object.assign({},A);const t={...e,...this._searchInput.dataset},s=i=>["true","false","1","0",!0,!1].includes(i)&&!!JSON.parse(i);for(const[i,o]of Object.entries(A)){if(t[i]===void 0)continue;const r=t[i];switch(typeof o){case"number":this._config[i]=parseInt(r);break;case"boolean":this._config[i]=s(r);break;case"string":this._config[i]=r.toString();break;case"object":if(Array.isArray(o))if(typeof r=="string"){const a=r.includes("|")?"|":",";this._config[i]=r.split(a)}else this._config[i]=r;else this._config[i]=typeof r=="string"?JSON.parse(r):r;break;case"function":this._config[i]=typeof r=="string"?window[r]:r;break;default:this._config[i]=r;break}}}_configureSearchInput(){if(this._searchInput.autocomplete="off",this._searchInput.spellcheck=!1,w(this._searchInput,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false",role:"combobox"}),this._searchInput.id&&this._config.preventBrowserAutocomplete){const e=document.querySelector(`[for="${this._searchInput.id}"]`);e&&X(e)}this._hiddenInput=null,this._config.hiddenInput&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.value=this._config.hiddenValue,this._hiddenInput.name=this._searchInput.name,this._searchInput.name="_"+this._searchInput.name,O(this._searchInput,this._hiddenInput))}_configureDropElement(){this._dropElement=document.createElement("ul"),this._dropElement.id="ac-menu-"+L,this._dropElement.classList.add("dropdown-menu","autocomplete-menu","p-0"),this._dropElement.style.maxHeight="280px",this._config.fullWidth||(this._dropElement.style.maxWidth="360px"),this._config.fixed&&(this._dropElement.style.position="fixed"),this._dropElement.style.overflowY="auto",this._dropElement.style.overscrollBehavior="contain",this._dropElement.style.textAlign="unset",O(this._searchInput,this._dropElement),this._searchInput.setAttribute("aria-controls",this._dropElement.id)}onclick(e){e.target.matches(this._config.clearControl)&&this.clear()}oninput(e){this._preventInput||(this._hiddenInput&&(this._hiddenInput.value=null),this.showOrSearch())}onchange(e){const t=this._searchInput.value,s=Object.values(this._items).find(i=>i.label===t);this._config.onChange(s,this)}onblur(e){this.hideSuggestions()}onfocus(e){this.showOrSearch()}onkeydown(e){switch(e.keyCode||e.key){case 13:case"Enter":if(this.isDropdownVisible()){const s=this.getSelection();s&&s.click(),(s||!this._config.ignoreEnter)&&e.preventDefault()}break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(y);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(_):this.showOrSearch(!1);break;case 27:case"Escape":this.isDropdownVisible()&&(this._searchInput.focus(),this.hideSuggestions());break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}getConfig(e=null){return e!==null?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}setData(e){this._items={},this._addItems(e)}enable(){this._searchInput.setAttribute("disabled","")}disable(){this._searchInput.removeAttribute("disabled")}isDisabled(){return this._searchInput.hasAttribute("disabled")||this._searchInput.disabled||this._searchInput.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(p)}clear(){this._searchInput.value="",this._hiddenInput&&(this._hiddenInput.value="")}getSelection(){return this._dropElement.querySelector("a."+k)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,k]}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=_,t=null){const s=this.getSelection();if(s){const i=e===_?"nextSibling":"previousSibling";t=s.parentNode;do t=t[i];while(t&&!this._isItemEnabled(t));t?(s.classList.remove(...this._activeClasses()),e===y?t.parentNode.scrollTop=t.offsetTop-t.parentNode.offsetTop:t.offsetTop>t.parentNode.offsetHeight-t.offsetHeight&&(t.parentNode.scrollTop+=t.offsetHeight)):s&&(t=s.parentElement)}else{if(e===y)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const i=t.querySelector("a");i.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",i.id),this._config.updateOnSelect&&(this._searchInput.value=i.dataset.label)}else this._searchInput.setAttribute("aria-activedescendant","");return t}_shouldShow(){return this.isDisabled()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions();return}this._config.liveServer?this._searchFunc():this._config.source?this._config.source(this._searchInput.value,t=>{this.setData(t),this._showSuggestions()}):this._showSuggestions()}_createGroup(e){const t=this._createLi(),s=document.createElement("span");return t.append(s),s.classList.add("dropdown-header","text-truncate"),s.innerHTML=e,t}_createItem(e,t){let s=t.label;if(this._config.highlightTyped){const r=b(s).indexOf(e);r!==-1&&(s=s.substring(0,r)+`${s.substring(r,r+e.length)}`+s.substring(r+e.length,s.length))}s=this._config.onRenderItem(t,s,this);const i=this._createLi(),o=document.createElement("a");if(i.append(o),o.id=this._dropElement.id+"-"+this._dropElement.children.length,o.classList.add("dropdown-item","text-truncate"),this._config.itemClass&&o.classList.add(...this._config.itemClass.split(" ")),o.setAttribute("data-value",t.value),o.setAttribute("data-label",t.label),o.setAttribute("tabindex","-1"),o.setAttribute("role","menuitem"),o.setAttribute("href","#"),o.innerHTML=s,t.data)for(const[r,a]of Object.entries(t.data))o.dataset[r]=a;return o.addEventListener("mouseenter",r=>{this._keyboardNavigation||(this.removeSelection(),i.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{r.preventDefault(),this._preventInput=!0,this._searchInput.value=J(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),i}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=b(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let s=0,i=null;const o=[];for(let r=0;r0&&this._config.searchFields.forEach(d=>{const f=b(c[d]);let m=!1;if(this._config.fuzzy)m=K(f,e);else{const E=f.indexOf(e);m=this._config.startsWith?E===0:E>=0}m&&(l=!0)});const N=l||e.length===0;if(h||l){if(s++,c.group&&!o.includes(c.group)){const f=this._createGroup(c.group);this._dropElement.appendChild(f),o.push(c.group)}const d=this._createItem(e,c);if(!i&&N&&(i=d),this._dropElement.appendChild(d),this._config.maximumItems>0&&s>=this._config.maximumItems)break}}if(i&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(_,i)),s===0)if(this._config.notFoundMessage){const r=this._createLi();r.innerHTML=`${this._config.notFoundMessage}`,this._dropElement.appendChild(r),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(p),this._dropElement.setAttribute("role","menu"),w(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(p)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(p),w(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),s=e.direction==="rtl",i=this._config.fullWidth,o=this._config.fixed;let r=null,a=null;o&&(r=t.x,a=t.y+t.height,s&&!i&&(r-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",i&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),r!==null&&(this._dropElement.style.left=r+"px"),a!==null&&(this._dropElement.style.top=a+"px");const c=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(c.y+c.height>h){const l=i?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+l+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const s=Array.from(t.children).map(i=>{const o=i.getAttribute("value")??i.innerHTML.toLowerCase(),r=i.innerHTML;return{value:o,label:r}});this._addItems(s)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let s=0;sc.group=o.group),this._addItems(o.items);continue}const r=typeof o=="string"?o:o.label,a=typeof o!="object"?{}:o;a.label=o[this._config.labelField]??r,a.value=o[this._config.valueField]??i,a.label&&(this._items[a.value]=a)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const s=Object.assign({},this._config.serverParams,t);if(s[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(s.t=Date.now()),s.related){const a=document.getElementById(s.related);if(a){s.related=a.value;const c=a.getAttribute("name");c&&(s[c]=a.value)}}const i=new URLSearchParams(s);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=i:o+="?"+i.toString(),this._searchInput.classList.add(x),this._config.onBeforeFetch(this),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const c=a[this._config.serverDataKey]||a;this.setData(c),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._searchInput.classList.remove(x),this._config.onAfterFetch(this)})}}class Y{post(e){let t="/api/v2/transactions";return M.post(t,e)}}class Q{list(e){return M.get("/api/v2/currencies",{params:e})}}let u;const I={description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts"};let Z=function(){return{count:0,totalAmount:0,transactionType:"unknown",showSuccessMessage:!1,showErrorMessage:!1,entries:[],loadingCurrencies:!0,defaultCurrency:{},enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],filters:{source:[],destination:[]},errorMessageText:"",detectTransactionType(){const n=this.entries[0].source_account.type??"unknown",e=this.entries[0].destination_account.type??"unknown";if(n==="unknown"&&e==="unknown"){this.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(n===e&&["Asset account","Loan","Debt","Mortgage"].includes(n)){this.transactionType="transfer",console.log('Transaction type is detected to be "'+this.transactionType+'".'),console.log("filter down currencies for transfer.");return}if(n==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="withdrawal",console.log('[a] Transaction type is detected to be "'+this.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(n==="Asset account"&&e==="unknown"){this.transactionType="withdrawal",console.log('[b] Transaction type is detected to be "'+this.transactionType+'".'),console.log(this.entries[0].source_account),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Expense account"){this.transactionType="withdrawal",console.log('[c] Transaction type is detected to be "'+this.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(n==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(e)){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(n)&&e==="Asset account"){this.transactionType="deposit",console.log('Transaction type is detected to be "'+this.transactionType+'".');return}console.warn('Unknown account combination between "'+n+'" and "'+e+'".')},selectSourceAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={id:n.id,name:n.name,alpine_name:n.name,type:n.type,currency_code:n.currency_code},console.log("Changed source account into a known "+n.type.toLowerCase()),document.querySelector("#form")._x_dataStack[0].detectTransactionType()},filterNativeCurrencies(n){console.log('filterNativeCurrencies("'+n+'")');let e=[],t;for(let s in this.enabledCurrencies)if(this.enabledCurrencies.hasOwnProperty(s)){let i=this.enabledCurrencies[s];i.code===n&&(t=i)}e.push(t),this.nativeCurrencies=e;for(let s in this.entries)this.entries.hasOwnProperty(s)&&(this.entries[s].currency_code=n)},changedAmount(n){const e=parseInt(n.target.dataset.index);this.entries[e].amount=parseFloat(n.target.value),this.totalAmount=0;for(let t in this.entries)this.entries.hasOwnProperty(t)&&(this.totalAmount=this.totalAmount+parseFloat(this.entries[t].amount));console.log("Changed amount to "+this.totalAmount)},selectDestAccount(n,e){const t=parseInt(e._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={id:n.id,name:n.name,alpine_name:n.name,type:n.type,currency_code:n.currency_code},console.log("Changed destination account into a known "+n.type.toLowerCase()),document.querySelector("#form")._x_dataStack[0].detectTransactionType()},loadCurrencies(){console.log("Loading user currencies."),new Q().list({}).then(e=>{for(let t in e.data.data)if(e.data.data.hasOwnProperty(t)){let s=e.data.data[t];if(s.attributes.enabled){let i={id:s.id,name:s.attributes.name,code:s.attributes.code,default:s.attributes.default,symbol:s.attributes.symbol,decimal_places:s.attributes.decimal_places};i.default&&(this.defaultCurrency=i),this.enabledCurrencies.push(i),this.nativeCurrencies.push(i)}}this.loadingCurrencies=!1,console.log(this.enabledCurrencies)})},changeSourceAccount(n,e){if(console.log("changeSourceAccount"),typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account.name===e._searchInput.value){console.warn('Ignore hallucinated source account name change to "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType();return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].source_account={name:e._searchInput.value,alpine_name:e._searchInput.value},console.log('Changed source account into a unknown account called "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType()}},changeDestAccount(n,e){if(document.querySelector("#form")._x_dataStack[0].$data.entries[0].destination_account,typeof n>"u"){const t=parseInt(e._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account.name===e._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType();return}document.querySelector("#form")._x_dataStack[0].$data.entries[t].destination_account={name:e._searchInput.value,alpine_name:e._searchInput.value},console.log('Changed destination account into a unknown account called "'+e._searchInput.value+'"'),document.querySelector("#form")._x_dataStack[0].detectTransactionType()}},showError:!1,showSuccess:!1,addedSplit(){console.log("addedSplit"),S.init("input.ac-source",{server:I.account,serverParams:{types:this.filters.source},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,highlightTyped:!0,liveServer:!0,onChange:this.changeSourceAccount,onSelectItem:this.selectSourceAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'
'+u.t("firefly.account_type_"+n.type)+""}}),S.init("input.ac-dest",{server:I.account,serverParams:{types:this.filters.destination},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,preventBrowserAutocomplete:!0,liveServer:!0,highlightTyped:!0,onSelectItem:this.selectDestAccount,onChange:this.changeDestAccount,onRenderItem:function(n,e,t){return n.name_with_balance+'
'+u.t("firefly.account_type_"+n.type)+""}}),this.filters.destination=[],S.init("input.ac-description",{server:I.description,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},valueField:"id",labelField:"description",highlightTyped:!0,onSelectItem:console.log})},init(){Promise.all([R("language","en_US")]).then(n=>{u=new $;const e=n[0].replace("-","_");u.locale=e,z(u,e).then(()=>{this.addSplit()})}),this.loadCurrencies(),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.detectTransactionType();let n=W(this.entries,this.transactionType),e={group_title:null,fire_webhooks:!1,apply_rules:!1,transactions:n};n.length>1&&(e.group_title=n[0].description);let t=new Y;console.log(e),t.post(e).then(s=>{this.showSuccessMessage=!0,console.log(s),window.location="transactions/show/"+s.data.data.id+"?transaction_group_id="+s.data.data.id+"&message=created"}).catch(s=>{this.showErrorMessage=!0,this.errorMessageText=s.response.data.message})},addSplit(){this.entries.push(B())},removeSplit(n){this.entries.splice(n,1),document.querySelector("#split-0-tab").click()},formattedTotalAmount(){return V(this.totalAmount,"EUR")}}},D={transactions:Z,dates:j};function F(){Object.keys(D).forEach(n=>{console.log(`Loading page component "${n}"`);let e=D[n]();Alpine.data(n,()=>e)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),F()});window.bootstrapped&&(console.log("Loaded through window variable."),F()); diff --git a/public/build/assets/dashboard-ec60c532.js b/public/build/assets/dashboard-76bd62a6.js similarity index 99% rename from public/build/assets/dashboard-ec60c532.js rename to public/build/assets/dashboard-76bd62a6.js index 4308c741cf..d24666ed49 100644 --- a/public/build/assets/dashboard-ec60c532.js +++ b/public/build/assets/dashboard-76bd62a6.js @@ -1,4 +1,4 @@ -var Sa=Object.defineProperty;var Oa=(n,t,e)=>t in n?Sa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>(Oa(n,typeof t!="symbol"?t+"":t,e),e);import{r as z,a as ai,t as wt,s as Yi,g as ji,b as ls,c as mr,d as j,e as br,f as yr,_ as an,h as Aa,i as Ui,j as _r,k as La,l as Ra,m as xr,n as Fa,o as Os,p as Ia,q as As,u as Ea,v as za,w as vt,x as J,y as V,z as bt,P as Ba,I as li,A as ci,B as Na,C as Wa,D as Ha,E as Va,F as Ls,G as Ya,H as ja,J as Ua}from"./load-translations-7cdd7b0e.js";var $a=36e5;function qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*$a)}var Xa=864e5;function Ka(n,t){z(2,arguments);var e=Yi(n),i=Yi(t),s=e.getTime()-ji(e),o=i.getTime()-ji(i);return Math.round((s-o)/Xa)}var Ga=6e4;function Qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*Ga)}function Za(n,t){z(2,arguments);var e=wt(t),i=e*3;return ls(n,i)}function Ja(n,t){z(2,arguments);var e=wt(t);return ai(n,e*1e3)}function tl(n,t){z(2,arguments);var e=wt(t),i=e*7;return mr(n,i)}function el(n,t){z(2,arguments);var e=wt(t);return ls(n,e*12)}function tn(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getTime()-i.getTime();return s<0?-1:s>0?1:s}var ui=6e4,hi=36e5,nl=1e3;function il(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getFullYear()-i.getFullYear(),o=e.getMonth()-i.getMonth();return s*12+o}function sl(n,t){z(2,arguments);var e=j(n),i=j(t);return e.getFullYear()-i.getFullYear()}function Rs(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function vr(n,t){z(2,arguments);var e=j(n),i=j(t),s=Rs(e,i),o=Math.abs(Ka(e,i));e.setDate(e.getDate()-s*o);var r=+(Rs(e,i)===-s),a=s*(o-r);return a===0?0:a}function di(n,t){return z(2,arguments),j(n).getTime()-j(t).getTime()}var Fs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},ol="trunc";function bn(n){return n?Fs[n]:Fs[ol]}function rl(n,t,e){z(2,arguments);var i=di(n,t)/hi;return bn(e==null?void 0:e.roundingMethod)(i)}function al(n,t,e){z(2,arguments);var i=di(n,t)/ui;return bn(e==null?void 0:e.roundingMethod)(i)}function ll(n){z(1,arguments);var t=j(n);return br(t).getTime()===yr(t).getTime()}function wr(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(il(e,i)),r;if(o<1)r=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*o);var a=tn(e,i)===-s;ll(j(n))&&o===1&&tn(n,i)===1&&(a=!1),r=s*(o-Number(a))}return r===0?0:r}function cl(n,t,e){z(2,arguments);var i=wr(n,t)/3;return bn(e==null?void 0:e.roundingMethod)(i)}function ul(n,t,e){z(2,arguments);var i=di(n,t)/1e3;return bn(e==null?void 0:e.roundingMethod)(i)}function hl(n,t,e){z(2,arguments);var i=vr(n,t)/7;return bn(e==null?void 0:e.roundingMethod)(i)}function dl(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(sl(e,i));e.setFullYear(1584),i.setFullYear(1584);var r=tn(e,i)===-s,a=s*(o-Number(r));return a===0?0:a}function fl(n){z(1,arguments);var t=j(n);return t.setSeconds(0,0),t}function gl(n){z(1,arguments);var t=j(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function pl(n){z(1,arguments);var t=j(n);return t.setMinutes(59,59,999),t}function ml(n){z(1,arguments);var t=j(n);return t.setSeconds(59,999),t}function bl(n){z(1,arguments);var t=j(n);return t.setMilliseconds(999),t}function yl(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Is(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +var Sa=Object.defineProperty;var Oa=(n,t,e)=>t in n?Sa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>(Oa(n,typeof t!="symbol"?t+"":t,e),e);import{r as z,a as ai,t as wt,s as Yi,g as ji,b as ls,c as mr,d as j,e as br,f as yr,_ as an,h as Aa,i as Ui,j as _r,k as La,l as Ra,m as xr,n as Fa,o as Os,p as Ia,q as As,u as Ea,v as za,w as vt,x as J,y as V,z as bt,P as Ba,I as li,A as ci,B as Na,C as Wa,D as Ha,E as Va,F as Ls,G as Ya,H as ja,J as Ua}from"./load-translations-66c1b55b.js";var $a=36e5;function qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*$a)}var Xa=864e5;function Ka(n,t){z(2,arguments);var e=Yi(n),i=Yi(t),s=e.getTime()-ji(e),o=i.getTime()-ji(i);return Math.round((s-o)/Xa)}var Ga=6e4;function Qa(n,t){z(2,arguments);var e=wt(t);return ai(n,e*Ga)}function Za(n,t){z(2,arguments);var e=wt(t),i=e*3;return ls(n,i)}function Ja(n,t){z(2,arguments);var e=wt(t);return ai(n,e*1e3)}function tl(n,t){z(2,arguments);var e=wt(t),i=e*7;return mr(n,i)}function el(n,t){z(2,arguments);var e=wt(t);return ls(n,e*12)}function tn(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getTime()-i.getTime();return s<0?-1:s>0?1:s}var ui=6e4,hi=36e5,nl=1e3;function il(n,t){z(2,arguments);var e=j(n),i=j(t),s=e.getFullYear()-i.getFullYear(),o=e.getMonth()-i.getMonth();return s*12+o}function sl(n,t){z(2,arguments);var e=j(n),i=j(t);return e.getFullYear()-i.getFullYear()}function Rs(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function vr(n,t){z(2,arguments);var e=j(n),i=j(t),s=Rs(e,i),o=Math.abs(Ka(e,i));e.setDate(e.getDate()-s*o);var r=+(Rs(e,i)===-s),a=s*(o-r);return a===0?0:a}function di(n,t){return z(2,arguments),j(n).getTime()-j(t).getTime()}var Fs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},ol="trunc";function bn(n){return n?Fs[n]:Fs[ol]}function rl(n,t,e){z(2,arguments);var i=di(n,t)/hi;return bn(e==null?void 0:e.roundingMethod)(i)}function al(n,t,e){z(2,arguments);var i=di(n,t)/ui;return bn(e==null?void 0:e.roundingMethod)(i)}function ll(n){z(1,arguments);var t=j(n);return br(t).getTime()===yr(t).getTime()}function wr(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(il(e,i)),r;if(o<1)r=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*o);var a=tn(e,i)===-s;ll(j(n))&&o===1&&tn(n,i)===1&&(a=!1),r=s*(o-Number(a))}return r===0?0:r}function cl(n,t,e){z(2,arguments);var i=wr(n,t)/3;return bn(e==null?void 0:e.roundingMethod)(i)}function ul(n,t,e){z(2,arguments);var i=di(n,t)/1e3;return bn(e==null?void 0:e.roundingMethod)(i)}function hl(n,t,e){z(2,arguments);var i=vr(n,t)/7;return bn(e==null?void 0:e.roundingMethod)(i)}function dl(n,t){z(2,arguments);var e=j(n),i=j(t),s=tn(e,i),o=Math.abs(sl(e,i));e.setFullYear(1584),i.setFullYear(1584);var r=tn(e,i)===-s,a=s*(o-Number(r));return a===0?0:a}function fl(n){z(1,arguments);var t=j(n);return t.setSeconds(0,0),t}function gl(n){z(1,arguments);var t=j(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function pl(n){z(1,arguments);var t=j(n);return t.setMinutes(59,59,999),t}function ml(n){z(1,arguments);var t=j(n);return t.setSeconds(59,999),t}function bl(n){z(1,arguments);var t=j(n);return t.setMilliseconds(999),t}function yl(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Is(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,r=!1,a;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return o=c.done,c},e:function(c){r=!0,a=c},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(r)throw a}}}}function D(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function $i(n,t){return $i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,s){return i.__proto__=s,i},$i(n,t)}function B(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&$i(n,t)}function Gn(n){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gn(n)}function xl(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vl(n,t){if(t&&(an(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(n)}function N(n){var t=xl();return function(){var i=Gn(n),s;if(t){var o=Gn(this).constructor;s=Reflect.construct(i,arguments,o)}else s=i.apply(this,arguments);return vl(this,s)}}function I(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function wl(n,t){if(an(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(an(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Mr(n){var t=wl(n,"string");return an(t)==="symbol"?t:String(t)}function zs(n,t){for(var e=0;e0,i=e?t:1-t,s;if(i<=50)s=n||100;else{var o=i+50,r=Math.floor(o/100)*100,a=n>=o%100;s=n+r-(a?100:0)}return e?s:1-s}function Dr(n){return n%400===0||n%4===0&&n%100!==0}var Dl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r0}},{key:"set",value:function(s,o,r){var a=s.getUTCFullYear();if(r.isTwoDigitYear){var l=Pr(r.year,a);return s.setUTCFullYear(l,0,1),s.setUTCHours(0,0,0,0),s}var c=!("era"in o)||o.era===1?r.year:1-r.year;return s.setUTCFullYear(c,0,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Tl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r0}},{key:"set",value:function(s,o,r,a){var l=Aa(s,a);if(r.isTwoDigitYear){var c=Pr(r.year,l);return s.setUTCFullYear(c,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Ui(s,a)}var u=!("era"in o)||o.era===1?r.year:1-r.year;return s.setUTCFullYear(u,0,a.firstWeekContainsDate),s.setUTCHours(0,0,0,0),Ui(s,a)}}]),e}(Y),Sl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=4}},{key:"set",value:function(s,o,r){return s.setUTCMonth((r-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Ll=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=4}},{key:"set",value:function(s,o,r){return s.setUTCMonth((r-1)*3,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Rl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=11}},{key:"set",value:function(s,o,r){return s.setUTCMonth(r,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Fl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=11}},{key:"set",value:function(s,o,r){return s.setUTCMonth(r,1),s.setUTCHours(0,0,0,0),s}}]),e}(Y);function Il(n,t,e){z(2,arguments);var i=j(n),s=wt(t),o=La(i,e)-s;return i.setUTCDate(i.getUTCDate()-o*7),i}var El=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=53}},{key:"set",value:function(s,o,r,a){return Ui(Il(s,r,a),a)}}]),e}(Y);function zl(n,t){z(2,arguments);var e=j(n),i=wt(t),s=Ra(e)-i;return e.setUTCDate(e.getUTCDate()-s*7),e}var Bl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=53}},{key:"set",value:function(s,o,r){return _r(zl(s,r))}}]),e}(Y),Nl=[31,28,31,30,31,30,31,31,30,31,30,31],Wl=[31,29,31,30,31,30,31,31,30,31,30,31],Hl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=Wl[l]:o>=1&&o<=Nl[l]}},{key:"set",value:function(s,o,r){return s.setUTCDate(r),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Vl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(s,o,r){return s.setUTCMonth(0,r),s.setUTCHours(0,0,0,0),s}}]),e}(Y);function us(n,t,e){var i,s,o,r,a,l,c,u;z(2,arguments);var h=xr(),d=wt((i=(s=(o=(r=e==null?void 0:e.weekStartsOn)!==null&&r!==void 0?r:e==null||(a=e.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:h.weekStartsOn)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=j(n),g=wt(t),p=f.getUTCDay(),m=g%7,b=(m+7)%7,y=(b=0&&o<=6}},{key:"set",value:function(s,o,r,a){return s=us(s,r,a),s.setUTCHours(0,0,0,0),s}}]),e}(Y),jl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=6}},{key:"set",value:function(s,o,r,a){return s=us(s,r,a),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Ul=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=6}},{key:"set",value:function(s,o,r,a){return s=us(s,r,a),s.setUTCHours(0,0,0,0),s}}]),e}(Y);function $l(n,t){z(2,arguments);var e=wt(t);e%7===0&&(e=e-7);var i=1,s=j(n),o=s.getUTCDay(),r=e%7,a=(r+7)%7,l=(a=1&&o<=7}},{key:"set",value:function(s,o,r){return s=$l(s,r),s.setUTCHours(0,0,0,0),s}}]),e}(Y),Xl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=12}},{key:"set",value:function(s,o,r){var a=s.getUTCHours()>=12;return a&&r<12?s.setUTCHours(r+12,0,0,0):!a&&r===12?s.setUTCHours(0,0,0,0):s.setUTCHours(r,0,0,0),s}}]),e}(Y),Zl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=23}},{key:"set",value:function(s,o,r){return s.setUTCHours(r,0,0,0),s}}]),e}(Y),Jl=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=11}},{key:"set",value:function(s,o,r){var a=s.getUTCHours()>=12;return a&&r<12?s.setUTCHours(r+12,0,0,0):s.setUTCHours(r,0,0,0),s}}]),e}(Y),tc=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&o<=24}},{key:"set",value:function(s,o,r){var a=r<=24?r%24:r;return s.setUTCHours(a,0,0,0),s}}]),e}(Y),ec=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=59}},{key:"set",value:function(s,o,r){return s.setUTCMinutes(r,0,0),s}}]),e}(Y),nc=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=0&&o<=59}},{key:"set",value:function(s,o,r){return s.setUTCSeconds(r,0),s}}]),e}(Y),ic=function(n){B(e,n);var t=N(e);function e(){var i;I(this,e);for(var s=arguments.length,o=new Array(s),r=0;r=1&&A<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=wt((g=(p=(m=(b=i==null?void 0:i.weekStartsOn)!==null&&b!==void 0?b:i==null||(y=i.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&m!==void 0?m:M.weekStartsOn)!==null&&p!==void 0?p:(v=M.locale)===null||v===void 0||(_=v.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&g!==void 0?g:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(C==="")return w===""?j(e):new Date(NaN);var R={firstWeekContainsDate:A,weekStartsOn:O,locale:T},st=[new Cl],gt=C.match(uc).map(function(ct){var q=ct[0];if(q in Os){var St=Os[q];return St(ct,T.formatLong)}return ct}).join("").match(cc),W=[],U=Es(gt),Q;try{var Mt=function(){var q=Q.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&Ia(q)&&As(q,C,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Ea(q)&&As(q,C,n);var St=q[0],wn=lc[St];if(wn){var Ds=wn.incompatibleTokens;if(Array.isArray(Ds)){var Ts=W.find(function(Ss){return Ds.includes(Ss.token)||Ss.token===St});if(Ts)throw new RangeError("The format string mustn't contain `".concat(Ts.fullToken,"` and `").concat(q,"` at the same time"))}else if(wn.incompatibleTokens==="*"&&W.length>0)throw new RangeError("The format string mustn't contain `".concat(q,"` and any other token at the same time"));W.push({token:St,fullToken:q});var xi=wn.run(w,q,T.match,R);if(!xi)return{v:new Date(NaN)};st.push(xi.setter),w=xi.rest}else{if(St.match(gc))throw new RangeError("Format string contains an unescaped latin alphabet character `"+St+"`");if(q==="''"?q="'":St==="'"&&(q=mc(q)),w.indexOf(q)===0)w=w.slice(q.length);else return{v:new Date(NaN)}}};for(U.s();!(Q=U.n()).done;){var lt=Mt();if(an(lt)==="object")return lt.v}}catch(ct){U.e(ct)}finally{U.f()}if(w.length>0&&fc.test(w))return new Date(NaN);var Kt=st.map(function(ct){return ct.priority}).sort(function(ct,q){return q-ct}).filter(function(ct,q,St){return St.indexOf(ct)===q}).map(function(ct){return st.filter(function(q){return q.priority===ct}).sort(function(q,St){return St.subPriority-q.subPriority})}).map(function(ct){return ct[0]}),Gt=j(e);if(isNaN(Gt.getTime()))return new Date(NaN);var Tt=za(Gt,ji(Gt)),Qt={},Rt=Es(Kt),Zt;try{for(Rt.s();!(Zt=Rt.n()).done;){var Jt=Zt.value;if(!Jt.validate(Tt,R))return new Date(NaN);var vn=Jt.set(Tt,Qt,R);Array.isArray(vn)?(Tt=vn[0],yl(Qt,vn[1])):Tt=vn}}catch(ct){Rt.e(ct)}finally{Rt.f()}return Tt}function mc(n){return n.match(hc)[1].replace(dc,"'")}function bc(n){z(1,arguments);var t=j(n);return t.setMinutes(0,0,0),t}function yc(n){z(1,arguments);var t=j(n);return t.setMilliseconds(0),t}function _c(n,t){var e;z(1,arguments);var i=wt((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var s=Mc(n),o;if(s.date){var r=kc(s.date,i);o=Cc(r.restDateString,r.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(s.time&&(l=Pc(s.time),isNaN(l)))return new Date(NaN);if(s.timezone){if(c=Dc(s.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),h=new Date(0);return h.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),h.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),h}return new Date(a+l+c)}var Mn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},xc=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vc=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,wc=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Mc(n){var t={},e=n.split(Mn.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Mn.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Mn.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var s=Mn.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function kc(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:n.slice((i[1]||i[2]).length)}}function Cc(n,t){if(t===null)return new Date(NaN);var e=n.match(xc);if(!e)return new Date(NaN);var i=!!e[4],s=Be(e[1]),o=Be(e[2])-1,r=Be(e[3]),a=Be(e[4]),l=Be(e[5])-1;if(i)return Lc(t,a,l)?Tc(t,a,l):new Date(NaN);var c=new Date(0);return!Oc(t,o,r)||!Ac(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}function Be(n){return n?parseInt(n):1}function Pc(n){var t=n.match(vc);if(!t)return NaN;var e=vi(t[1]),i=vi(t[2]),s=vi(t[3]);return Rc(e,i,s)?e*hi+i*ui+s*1e3:NaN}function vi(n){return n&&parseFloat(n.replace(",","."))||0}function Dc(n){if(n==="Z")return 0;var t=n.match(wc);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Fc(i,s)?e*(i*hi+s*ui):NaN}function Tc(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var s=i.getUTCDay()||7,o=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+o),i}var Sc=[31,null,31,30,31,30,31,31,30,31,30,31];function Tr(n){return n%400===0||n%4===0&&n%100!==0}function Oc(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Sc[t]||(Tr(n)?29:28))}function Ac(n,t){return t>=1&&t<=(Tr(n)?366:365)}function Lc(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Rc(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Fc(n,t){return t>=0&&t<=59}class Ic{get(t,e,i){return vt.get("/api/v2/summary/basic",{params:{start:t,end:e,code:i}})}}function Nt(n,t,e){const i=J(t,"y-MM-dd")+"_"+J(e,"y-MM-dd")+"_"+n;return console.log("getCacheKey: "+i),String(i)}let wi=!1;const Ec=()=>({balanceBox:{amounts:[],subtitles:[]},billBox:{paid:[],unpaid:[]},leftBox:{left:[],perDay:[]},netBox:{net:[]},autoConversion:!1,loading:!1,boxData:null,boxOptions:null,getFreshData(){const n=new Date(window.store.get("start")),t=new Date(window.store.get("end")),e=Nt("dashboard-boxes-data",n,t),i=window.store.get("cacheValid");let s=window.store.get(e);if(i&&typeof s<"u"){this.boxData=s,this.generateOptions(this.boxData);return}new Ic().get(J(n,"yyyy-MM-dd"),J(t,"yyyy-MM-dd"),null).then(r=>{this.boxData=r.data,window.store.set(e,r.data),this.generateOptions(this.boxData)})},generateOptions(n){this.balanceBox={amounts:[],subtitles:[]},this.billBox={paid:[],unpaid:[]},this.leftBox={left:[],perDay:[]},this.netBox={net:[]};let t={};for(const e in n)if(n.hasOwnProperty(e)){const i=n[e];if(!i.hasOwnProperty("key"))continue;let s=i.key;if(this.autoConversion){if(s.startsWith("balance-in-native")){this.balanceBox.amounts.push(V(i.value,i.currency_code)),t.hasOwnProperty(i.currency_code)||(t[i.currency_code]="");continue}if(s.startsWith("spent-in-native")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=t[i.currency_code]+V(i.value,i.currency_code);continue}if(s.startsWith("earned-in-native")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=V(i.value,i.currency_code)+" + "+t[i.currency_code];continue}if(s.startsWith("bills-unpaid-in-native")){this.billBox.unpaid.push(V(i.value,i.currency_code));continue}if(s.startsWith("bills-paid-in-native")){this.billBox.paid.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-to-spend-in-native")){this.leftBox.left.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-per-day-to-spend-in-native")){this.leftBox.perDay.push(V(i.value,i.currency_code));continue}if(s.startsWith("net-worth-in-native")){this.netBox.net.push(V(i.value,i.currency_code));continue}}if(!this.autoConversion&&!s.endsWith("native")){if(s.startsWith("balance-in-")){this.balanceBox.amounts.push(V(i.value,i.currency_code));continue}if(s.startsWith("spent-in-")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=t[i.currency_code]+V(i.value,i.currency_code);continue}if(s.startsWith("earned-in-")){t.hasOwnProperty(i.currency_code)||(t[i.currency_code]=""),t[i.currency_code]=V(i.value,i.currency_code)+" + "+t[i.currency_code];continue}if(s.startsWith("bills-unpaid-in-")){this.billBox.unpaid.push(V(i.value,i.currency_code));continue}if(s.startsWith("bills-paid-in-")){this.billBox.paid.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-to-spend-in-")){this.leftBox.left.push(V(i.value,i.currency_code));continue}if(s.startsWith("left-per-day-to-spend-in-")){this.leftBox.perDay.push(V(i.value,i.currency_code));continue}s.startsWith("net-worth-in-")&&this.netBox.net.push(V(i.value,i.currency_code))}}for(let e in t)t.hasOwnProperty(e)&&this.balanceBox.subtitles.push(t[e]);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([bt("viewRange"),bt("autoConversion",!1)]).then(n=>{wi=!0,this.autoConversion=n[1],this.loadBoxes()}),window.store.observe("end",()=>{wi&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",n=>{wi&&(this.autoConversion=n,this.loadBoxes())})}});class zc{put(t,e){let i="/api/v1/preferences/"+t;return vt.put(i,{data:e})}}function Bc(n,t=null){window.store.set(n,t),new zc().put(n,t).then(i=>{}).catch(()=>{new Ba().post(n,t).then(s=>{})})}let Nc=class{dashboard(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/account/dashboard",{params:{start:i,end:s}})}expense(t,e){let i=J(t,"y-MM-dd"),s=J(e,"y-MM-dd");return vt.get("/api/v2/chart/account/expense-dashboard",{params:{start:i,end:s}})}},Bs=class{get(t,e){let i={date:J(e,"y-MM-dd").slice(0,10)};return e?vt.get("/api/v2/accounts/"+t,{params:i}):vt.get("/api/v2/accounts/"+t)}transactions(t,e){const i={page:e.page??1};return e.hasOwnProperty("start")&&(i.start=J(e.start,"y-MM-dd")),e.hasOwnProperty("end")&&(i.end=J(e.end,"y-MM-dd")),vt.get("/api/v2/accounts/"+t+"/transactions",{params:i})}};/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme diff --git a/public/build/assets/load-translations-7cdd7b0e.js b/public/build/assets/load-translations-66c1b55b.js similarity index 88% rename from public/build/assets/load-translations-7cdd7b0e.js rename to public/build/assets/load-translations-66c1b55b.js index 2d3b397d78..0a5f9e2fe3 100644 --- a/public/build/assets/load-translations-7cdd7b0e.js +++ b/public/build/assets/load-translations-66c1b55b.js @@ -1,19 +1,19 @@ -function bind$4(t,e){return function(){return t.apply(e,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(t=>e=>{const a=toString$7.call(e);return t[a]||(t[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=t=>(t=t.toLowerCase(),e=>kindOf(e)===t),typeOfTest=t=>e=>typeof e===t,{isArray:isArray$c}=Array,isUndefined=typeOfTest("undefined");function isBuffer$3(t){return t!==null&&!isUndefined(t)&&t.constructor!==null&&!isUndefined(t.constructor)&&isFunction$5(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&isArrayBuffer(t.buffer),e}const isString$1=typeOfTest("string"),isFunction$5=typeOfTest("function"),isNumber=typeOfTest("number"),isObject$b=t=>t!==null&&typeof t=="object",isBoolean=t=>t===!0||t===!1,isPlainObject=t=>{if(kindOf(t)!=="object")return!1;const e=getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=t=>isObject$b(t)&&isFunction$5(t.pipe),isFormData=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||isFunction$5(t.append)&&((e=kindOf(t))==="formdata"||e==="object"&&isFunction$5(t.toString)&&t.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim$2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(t,e,{allOwnKeys:a=!1}={}){if(t===null||typeof t>"u")return;let r,n;if(typeof t!="object"&&(t=[t]),isArray$c(t))for(r=0,n=t.length;r0;)if(n=a[r],e===n.toLowerCase())return n;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=t=>!isUndefined(t)&&t!==_global;function merge(){const{caseless:t}=isContextDefined(this)&&this||{},e={},a=(r,n)=>{const i=t&&findKey$1(e,n)||n;isPlainObject(e[i])&&isPlainObject(r)?e[i]=merge(e[i],r):isPlainObject(r)?e[i]=merge({},r):isArray$c(r)?e[i]=r.slice():e[i]=r};for(let r=0,n=arguments.length;r(forEach(e,(n,i)=>{a&&isFunction$5(n)?t[i]=bind$4(n,a):t[i]=n},{allOwnKeys:r}),t),stripBOM=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),inherits=(t,e,a,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),a&&Object.assign(t.prototype,a)},toFlatObject=(t,e,a,r)=>{let n,i,o;const s={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)o=n[i],(!r||r(o,t,e))&&!s[o]&&(e[o]=t[o],s[o]=!0);t=a!==!1&&getPrototypeOf(t)}while(t&&(!a||a(t,e))&&t!==Object.prototype);return e},endsWith=(t,e,a)=>{t=String(t),(a===void 0||a>t.length)&&(a=t.length),a-=e.length;const r=t.indexOf(e,a);return r!==-1&&r===a},toArray=t=>{if(!t)return null;if(isArray$c(t))return t;let e=t.length;if(!isNumber(e))return null;const a=new Array(e);for(;e-- >0;)a[e]=t[e];return a},isTypedArray$3=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll=(t,e)=>{let a;const r=[];for(;(a=t.exec(e))!==null;)r.push(a);return r},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,r,n){return r.toUpperCase()+n}),hasOwnProperty$c=(({hasOwnProperty:t})=>(e,a)=>t.call(e,a))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(t,e)=>{const a=Object.getOwnPropertyDescriptors(t),r={};forEach(a,(n,i)=>{let o;(o=e(n,i,t))!==!1&&(r[i]=o||n)}),Object.defineProperties(t,r)},freezeMethods=t=>{reduceDescriptors(t,(e,a)=>{if(isFunction$5(t)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const r=t[a];if(isFunction$5(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},toObjectSet=(t,e)=>{const a={},r=n=>{n.forEach(i=>{a[i]=!0})};return isArray$c(t)?r(t):r(String(t).split(e)),a},noop$3=()=>{},toFiniteNumber=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(t=16,e=ALPHABET.ALPHA_DIGIT)=>{let a="";const{length:r}=e;for(;t--;)a+=e[Math.random()*r|0];return a};function isSpecCompliantForm(t){return!!(t&&isFunction$5(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const toJSONObject=t=>{const e=new Array(10),a=(r,n)=>{if(isObject$b(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[n]=r;const i=isArray$c(r)?[]:{};return forEach(r,(o,s)=>{const u=a(o,n+1);!isUndefined(u)&&(i[s]=u)}),e[n]=void 0,i}}return r};return a(t,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=t=>t&&(isObject$b(t)||isFunction$5(t))&&isFunction$5(t.then)&&isFunction$5(t.catch),utils$1={isArray:isArray$c,isArrayBuffer,isBuffer:isBuffer$3,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean,isObject:isObject$b,isPlainObject,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$5,isStream,isURLSearchParams,isTypedArray:isTypedArray$3,isFileList,forEach,merge,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$3,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(t,e,a,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),a&&(this.config=a),r&&(this.request=r),n&&(this.response=n)}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={};["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(t=>{descriptors[t]={value:t}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(t,e,a,r,n,i)=>{const o=Object.create(prototype$1);return utils$1.toFlatObject(t,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),AxiosError.call(o,t.message,e,a,r,n),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const httpAdapter=null;function isVisitable(t){return utils$1.isPlainObject(t)||utils$1.isArray(t)}function removeBrackets(t){return utils$1.endsWith(t,"[]")?t.slice(0,-2):t}function renderKey(t,e,a){return t?t.concat(e).map(function(n,i){return n=removeBrackets(n),!a&&i?"["+n+"]":n}).join(a?".":""):e}function isFlatArray(t){return utils$1.isArray(t)&&!t.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(t,e,a){if(!utils$1.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,a=utils$1.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,M){return!utils$1.isUndefined(M[O])});const r=a.metaTokens,n=a.visitor||l,i=a.dots,o=a.indexes,u=(a.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(e);if(!utils$1.isFunction(n))throw new TypeError("visitor must be a function");function c(T){if(T===null)return"";if(utils$1.isDate(T))return T.toISOString();if(!u&&utils$1.isBlob(T))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(T)||utils$1.isTypedArray(T)?u&&typeof Blob=="function"?new Blob([T]):Buffer.from(T):T}function l(T,O,M){let C=T;if(T&&!M&&typeof T=="object"){if(utils$1.endsWith(O,"{}"))O=r?O:O.slice(0,-2),T=JSON.stringify(T);else if(utils$1.isArray(T)&&isFlatArray(T)||(utils$1.isFileList(T)||utils$1.endsWith(O,"[]"))&&(C=utils$1.toArray(T)))return O=removeBrackets(O),C.forEach(function(L,D){!(utils$1.isUndefined(L)||L===null)&&e.append(o===!0?renderKey([O],D,i):o===null?O:O+"[]",c(L))}),!1}return isVisitable(T)?!0:(e.append(renderKey(M,O,i),c(T)),!1)}const p=[],v=Object.assign(predicates,{defaultVisitor:l,convertValue:c,isVisitable});function S(T,O){if(!utils$1.isUndefined(T)){if(p.indexOf(T)!==-1)throw Error("Circular reference detected in "+O.join("."));p.push(T),utils$1.forEach(T,function(C,w){(!(utils$1.isUndefined(C)||C===null)&&n.call(e,C,utils$1.isString(w)?w.trim():w,O,v))===!0&&S(C,O?O.concat(w):[w])}),p.pop()}}if(!utils$1.isObject(t))throw new TypeError("data must be an object");return S(t),e}function encode$1(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function AxiosURLSearchParams(t,e){this._pairs=[],t&&toFormData(t,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,a){this._pairs.push([e,a])};prototype.toString=function(e){const a=e?function(r){return e.call(this,r,encode$1)}:encode$1;return this._pairs.map(function(n){return a(n[0])+"="+a(n[1])},"").join("&")};function encode(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(t,e,a){if(!e)return t;const r=a&&a.encode||encode,n=a&&a.serialize;let i;if(n?i=n(e,a):i=utils$1.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,a).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class InterceptorManager{constructor(){this.handlers=[]}use(e,a,r){return this.handlers.push({fulfilled:e,rejected:a,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils$1.forEach(this.handlers,function(r){r!==null&&e(r)})}}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=(t=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(t)<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(t,e){return toFormData(t,new platform.classes.URLSearchParams,Object.assign({visitor:function(a,r,n,i){return platform.isNode&&utils$1.isBuffer(a)?(this.append(r,a.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(t){return utils$1.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(t){const e={},a=Object.keys(t);let r;const n=a.length;let i;for(r=0;r=a.length;return o=!o&&utils$1.isArray(n)?n.length:o,u?(utils$1.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s):((!n[o]||!utils$1.isObject(n[o]))&&(n[o]=[]),e(a,r,n[o],i)&&utils$1.isArray(n[o])&&(n[o]=arrayToObject(n[o])),!s)}if(utils$1.isFormData(t)&&utils$1.isFunction(t.entries)){const a={};return utils$1.forEachEntry(t,(r,n)=>{e(parsePropPath(r),n,a,0)}),a}return null}function stringifySafely(t,e,a){if(utils$1.isString(t))try{return(e||JSON.parse)(t),utils$1.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(a||JSON.stringify)(t)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(e,a){const r=a.getContentType()||"",n=r.indexOf("application/json")>-1,i=utils$1.isObject(e);if(i&&utils$1.isHTMLForm(e)&&(e=new FormData(e)),utils$1.isFormData(e))return n&&n?JSON.stringify(formDataToJSON(e)):e;if(utils$1.isArrayBuffer(e)||utils$1.isBuffer(e)||utils$1.isStream(e)||utils$1.isFile(e)||utils$1.isBlob(e))return e;if(utils$1.isArrayBufferView(e))return e.buffer;if(utils$1.isURLSearchParams(e))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((s=utils$1.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return toFormData(s?{"files[]":e}:e,u&&new u,this.formSerializer)}}return i||n?(a.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const a=this.transitional||defaults.transitional,r=a&&a.forcedJSONParsing,n=this.responseType==="json";if(e&&utils$1.isString(e)&&(r&&!this.responseType||n)){const o=!(a&&a.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?AxiosError.from(s,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],t=>{defaults.headers[t]={}});const defaults$1=defaults,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=t=>{const e={};let a,r,n;return t&&t.split(` -`).forEach(function(o){n=o.indexOf(":"),a=o.substring(0,n).trim().toLowerCase(),r=o.substring(n+1).trim(),!(!a||e[a]&&ignoreDuplicateOf[a])&&(a==="set-cookie"?e[a]?e[a].push(r):e[a]=[r]:e[a]=e[a]?e[a]+", "+r:r)}),e},$internals=Symbol("internals");function normalizeHeader(t){return t&&String(t).trim().toLowerCase()}function normalizeValue(t){return t===!1||t==null?t:utils$1.isArray(t)?t.map(normalizeValue):String(t)}function parseTokens(t){const e=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=a.exec(t);)e[r[1]]=r[2];return e}const isValidHeaderName=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function matchHeaderValue(t,e,a,r,n){if(utils$1.isFunction(r))return r.call(this,e,a);if(n&&(e=a),!!utils$1.isString(e)){if(utils$1.isString(r))return e.indexOf(r)!==-1;if(utils$1.isRegExp(r))return r.test(e)}}function formatHeader(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,a,r)=>a.toUpperCase()+r)}function buildAccessors(t,e){const a=utils$1.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+a,{value:function(n,i,o){return this[r].call(this,e,n,i,o)},configurable:!0})})}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,a,r){const n=this;function i(s,u,c){const l=normalizeHeader(u);if(!l)throw new Error("header name must be a non-empty string");const p=utils$1.findKey(n,l);(!p||n[p]===void 0||c===!0||c===void 0&&n[p]!==!1)&&(n[p||u]=normalizeValue(s))}const o=(s,u)=>utils$1.forEach(s,(c,l)=>i(c,l,u));return utils$1.isPlainObject(e)||e instanceof this.constructor?o(e,a):utils$1.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)?o(parseHeaders(e),a):e!=null&&i(a,e,r),this}get(e,a){if(e=normalizeHeader(e),e){const r=utils$1.findKey(this,e);if(r){const n=this[r];if(!a)return n;if(a===!0)return parseTokens(n);if(utils$1.isFunction(a))return a.call(this,n,r);if(utils$1.isRegExp(a))return a.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,a){if(e=normalizeHeader(e),e){const r=utils$1.findKey(this,e);return!!(r&&this[r]!==void 0&&(!a||matchHeaderValue(this,this[r],r,a)))}return!1}delete(e,a){const r=this;let n=!1;function i(o){if(o=normalizeHeader(o),o){const s=utils$1.findKey(r,o);s&&(!a||matchHeaderValue(r,r[s],s,a))&&(delete r[s],n=!0)}}return utils$1.isArray(e)?e.forEach(i):i(e),n}clear(e){const a=Object.keys(this);let r=a.length,n=!1;for(;r--;){const i=a[r];(!e||matchHeaderValue(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){const a=this,r={};return utils$1.forEach(this,(n,i)=>{const o=utils$1.findKey(r,i);if(o){a[o]=normalizeValue(n),delete a[i];return}const s=e?formatHeader(i):String(i).trim();s!==i&&delete a[i],a[s]=normalizeValue(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const a=Object.create(null);return utils$1.forEach(this,(r,n)=>{r!=null&&r!==!1&&(a[n]=e&&utils$1.isArray(r)?r.join(", "):r)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,a])=>e+": "+a).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...a){const r=new this(e);return a.forEach(n=>r.set(n)),r}static accessor(e){const r=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function i(o){const s=normalizeHeader(o);r[s]||(buildAccessors(n,o),r[s]=!0)}return utils$1.isArray(e)?e.forEach(i):i(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:t},e)=>{let a=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[a]=r}}});utils$1.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(t,e){const a=this||defaults$1,r=e||a,n=AxiosHeaders$1.from(r.headers);let i=r.data;return utils$1.forEach(t,function(s){i=s.call(a,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function isCancel(t){return!!(t&&t.__CANCEL__)}function CanceledError(t,e,a){AxiosError.call(this,t??"canceled",AxiosError.ERR_CANCELED,e,a),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(t,e,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?t(a):e(new AxiosError("Request failed with status code "+a.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}const cookies=platform.hasStandardBrowserEnv?function(){return{write:function(a,r,n,i,o,s){const u=[];u.push(a+"="+encodeURIComponent(r)),utils$1.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),utils$1.isString(i)&&u.push("path="+i),utils$1.isString(o)&&u.push("domain="+o),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(a){const r=document.cookie.match(new RegExp("(^|;\\s*)("+a+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(a){this.write(a,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a");let r;function n(i){let o=i;return e&&(a.setAttribute("href",o),o=a.href),a.setAttribute("href",o),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return r=n(window.location.href),function(o){const s=utils$1.isString(o)?n(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const a=new Array(t),r=new Array(t);let n=0,i=0,o;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),l=r[i];o||(o=c),a[n]=u,r[n]=c;let p=i,v=0;for(;p!==n;)v+=a[p++],p=p%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),c-o{const i=n.loaded,o=n.lengthComputable?n.total:void 0,s=i-a,u=r(s),c=i<=o;a=i;const l={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&c?(o-i)/u:void 0,event:n};l[e?"download":"upload"]=!0,t(l)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(a,r){let n=t.data;const i=AxiosHeaders$1.from(t.headers).normalize(),o=t.responseType;let s;function u(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}let c;if(utils$1.isFormData(n)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((c=i.getContentType())!==!1){const[T,...O]=c?c.split(";").map(M=>M.trim()).filter(Boolean):[];i.setContentType([T||"multipart/form-data",...O].join("; "))}}let l=new XMLHttpRequest;if(t.auth){const T=t.auth.username||"",O=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(T+":"+O))}const p=buildFullPath(t.baseURL,t.url);l.open(t.method.toUpperCase(),buildURL(p,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function v(){if(!l)return;const T=AxiosHeaders$1.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),M={data:!o||o==="text"||o==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:T,config:t,request:l};settle(function(w){a(w),u()},function(w){r(w),u()},M),l=null}if("onloadend"in l?l.onloadend=v:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(v)},l.onabort=function(){l&&(r(new AxiosError("Request aborted",AxiosError.ECONNABORTED,t,l)),l=null)},l.onerror=function(){r(new AxiosError("Network Error",AxiosError.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let O=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const M=t.transitional||transitionalDefaults;t.timeoutErrorMessage&&(O=t.timeoutErrorMessage),r(new AxiosError(O,M.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,t,l)),l=null},platform.hasStandardBrowserEnv){const T=isURLSameOrigin(p)&&t.xsrfCookieName&&cookies.read(t.xsrfCookieName);T&&i.set(t.xsrfHeaderName,T)}n===void 0&&i.setContentType(null),"setRequestHeader"in l&&utils$1.forEach(i.toJSON(),function(O,M){l.setRequestHeader(M,O)}),utils$1.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),o&&o!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",progressEventReducer(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",progressEventReducer(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=T=>{l&&(r(!T||T.type?new CanceledError(null,t,l):T),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const S=parseProtocol(p);if(S&&platform.protocols.indexOf(S)===-1){r(new AxiosError("Unsupported protocol "+S+":",AxiosError.ERR_BAD_REQUEST,t));return}l.send(n||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils$1.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const renderReason=t=>`- ${t}`,isResolvedHandle=t=>utils$1.isFunction(t)||t===null||t===!1,adapters={getAdapter:t=>{t=utils$1.isArray(t)?t:[t];const{length:e}=t;let a,r;const n={};for(let i=0;i`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since : +function bind$4(t,e){return function(){return t.apply(e,arguments)}}const{toString:toString$7}=Object.prototype,{getPrototypeOf}=Object,kindOf=(t=>e=>{const a=toString$7.call(e);return t[a]||(t[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=t=>(t=t.toLowerCase(),e=>kindOf(e)===t),typeOfTest=t=>e=>typeof e===t,{isArray:isArray$c}=Array,isUndefined=typeOfTest("undefined");function isBuffer$3(t){return t!==null&&!isUndefined(t)&&t.constructor!==null&&!isUndefined(t.constructor)&&isFunction$5(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&isArrayBuffer(t.buffer),e}const isString$1=typeOfTest("string"),isFunction$5=typeOfTest("function"),isNumber=typeOfTest("number"),isObject$b=t=>t!==null&&typeof t=="object",isBoolean=t=>t===!0||t===!1,isPlainObject=t=>{if(kindOf(t)!=="object")return!1;const e=getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=t=>isObject$b(t)&&isFunction$5(t.pipe),isFormData=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||isFunction$5(t.append)&&((e=kindOf(t))==="formdata"||e==="object"&&isFunction$5(t.toString)&&t.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim$2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(t,e,{allOwnKeys:a=!1}={}){if(t===null||typeof t>"u")return;let r,n;if(typeof t!="object"&&(t=[t]),isArray$c(t))for(r=0,n=t.length;r0;)if(n=a[r],e===n.toLowerCase())return n;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=t=>!isUndefined(t)&&t!==_global;function merge(){const{caseless:t}=isContextDefined(this)&&this||{},e={},a=(r,n)=>{const i=t&&findKey$1(e,n)||n;isPlainObject(e[i])&&isPlainObject(r)?e[i]=merge(e[i],r):isPlainObject(r)?e[i]=merge({},r):isArray$c(r)?e[i]=r.slice():e[i]=r};for(let r=0,n=arguments.length;r(forEach(e,(n,i)=>{a&&isFunction$5(n)?t[i]=bind$4(n,a):t[i]=n},{allOwnKeys:r}),t),stripBOM=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),inherits=(t,e,a,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),a&&Object.assign(t.prototype,a)},toFlatObject=(t,e,a,r)=>{let n,i,o;const s={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)o=n[i],(!r||r(o,t,e))&&!s[o]&&(e[o]=t[o],s[o]=!0);t=a!==!1&&getPrototypeOf(t)}while(t&&(!a||a(t,e))&&t!==Object.prototype);return e},endsWith=(t,e,a)=>{t=String(t),(a===void 0||a>t.length)&&(a=t.length),a-=e.length;const r=t.indexOf(e,a);return r!==-1&&r===a},toArray=t=>{if(!t)return null;if(isArray$c(t))return t;let e=t.length;if(!isNumber(e))return null;const a=new Array(e);for(;e-- >0;)a[e]=t[e];return a},isTypedArray$3=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll=(t,e)=>{let a;const r=[];for(;(a=t.exec(e))!==null;)r.push(a);return r},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,r,n){return r.toUpperCase()+n}),hasOwnProperty$c=(({hasOwnProperty:t})=>(e,a)=>t.call(e,a))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(t,e)=>{const a=Object.getOwnPropertyDescriptors(t),r={};forEach(a,(n,i)=>{let o;(o=e(n,i,t))!==!1&&(r[i]=o||n)}),Object.defineProperties(t,r)},freezeMethods=t=>{reduceDescriptors(t,(e,a)=>{if(isFunction$5(t)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const r=t[a];if(isFunction$5(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},toObjectSet=(t,e)=>{const a={},r=n=>{n.forEach(i=>{a[i]=!0})};return isArray$c(t)?r(t):r(String(t).split(e)),a},noop$3=()=>{},toFiniteNumber=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(t=16,e=ALPHABET.ALPHA_DIGIT)=>{let a="";const{length:r}=e;for(;t--;)a+=e[Math.random()*r|0];return a};function isSpecCompliantForm(t){return!!(t&&isFunction$5(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const toJSONObject=t=>{const e=new Array(10),a=(r,n)=>{if(isObject$b(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[n]=r;const i=isArray$c(r)?[]:{};return forEach(r,(o,s)=>{const u=a(o,n+1);!isUndefined(u)&&(i[s]=u)}),e[n]=void 0,i}}return r};return a(t,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=t=>t&&(isObject$b(t)||isFunction$5(t))&&isFunction$5(t.then)&&isFunction$5(t.catch),utils$1={isArray:isArray$c,isArrayBuffer,isBuffer:isBuffer$3,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean,isObject:isObject$b,isPlainObject,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$5,isStream,isURLSearchParams,isTypedArray:isTypedArray$3,isFileList,forEach,merge,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$3,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(t,e,a,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),a&&(this.config=a),r&&(this.request=r),n&&(this.response=n)}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={};["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(t=>{descriptors[t]={value:t}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(t,e,a,r,n,i)=>{const o=Object.create(prototype$1);return utils$1.toFlatObject(t,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),AxiosError.call(o,t.message,e,a,r,n),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const httpAdapter=null;function isVisitable(t){return utils$1.isPlainObject(t)||utils$1.isArray(t)}function removeBrackets(t){return utils$1.endsWith(t,"[]")?t.slice(0,-2):t}function renderKey(t,e,a){return t?t.concat(e).map(function(n,i){return n=removeBrackets(n),!a&&i?"["+n+"]":n}).join(a?".":""):e}function isFlatArray(t){return utils$1.isArray(t)&&!t.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(t,e,a){if(!utils$1.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,a=utils$1.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,M){return!utils$1.isUndefined(M[O])});const r=a.metaTokens,n=a.visitor||d,i=a.dots,o=a.indexes,u=(a.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(e);if(!utils$1.isFunction(n))throw new TypeError("visitor must be a function");function l(A){if(A===null)return"";if(utils$1.isDate(A))return A.toISOString();if(!u&&utils$1.isBlob(A))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(A)||utils$1.isTypedArray(A)?u&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function d(A,O,M){let C=A;if(A&&!M&&typeof A=="object"){if(utils$1.endsWith(O,"{}"))O=r?O:O.slice(0,-2),A=JSON.stringify(A);else if(utils$1.isArray(A)&&isFlatArray(A)||(utils$1.isFileList(A)||utils$1.endsWith(O,"[]"))&&(C=utils$1.toArray(A)))return O=removeBrackets(O),C.forEach(function(N,D){!(utils$1.isUndefined(N)||N===null)&&e.append(o===!0?renderKey([O],D,i):o===null?O:O+"[]",l(N))}),!1}return isVisitable(A)?!0:(e.append(renderKey(M,O,i),l(A)),!1)}const h=[],v=Object.assign(predicates,{defaultVisitor:d,convertValue:l,isVisitable});function S(A,O){if(!utils$1.isUndefined(A)){if(h.indexOf(A)!==-1)throw Error("Circular reference detected in "+O.join("."));h.push(A),utils$1.forEach(A,function(C,w){(!(utils$1.isUndefined(C)||C===null)&&n.call(e,C,utils$1.isString(w)?w.trim():w,O,v))===!0&&S(C,O?O.concat(w):[w])}),h.pop()}}if(!utils$1.isObject(t))throw new TypeError("data must be an object");return S(t),e}function encode$1(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function AxiosURLSearchParams(t,e){this._pairs=[],t&&toFormData(t,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,a){this._pairs.push([e,a])};prototype.toString=function(e){const a=e?function(r){return e.call(this,r,encode$1)}:encode$1;return this._pairs.map(function(n){return a(n[0])+"="+a(n[1])},"").join("&")};function encode(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(t,e,a){if(!e)return t;const r=a&&a.encode||encode,n=a&&a.serialize;let i;if(n?i=n(e,a):i=utils$1.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,a).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class InterceptorManager{constructor(){this.handlers=[]}use(e,a,r){return this.handlers.push({fulfilled:e,rejected:a,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils$1.forEach(this.handlers,function(r){r!==null&&e(r)})}}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=(t=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(t)<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(t,e){return toFormData(t,new platform.classes.URLSearchParams,Object.assign({visitor:function(a,r,n,i){return platform.isNode&&utils$1.isBuffer(a)?(this.append(r,a.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(t){return utils$1.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(t){const e={},a=Object.keys(t);let r;const n=a.length;let i;for(r=0;r=a.length;return o=!o&&utils$1.isArray(n)?n.length:o,u?(utils$1.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s):((!n[o]||!utils$1.isObject(n[o]))&&(n[o]=[]),e(a,r,n[o],i)&&utils$1.isArray(n[o])&&(n[o]=arrayToObject(n[o])),!s)}if(utils$1.isFormData(t)&&utils$1.isFunction(t.entries)){const a={};return utils$1.forEachEntry(t,(r,n)=>{e(parsePropPath(r),n,a,0)}),a}return null}function stringifySafely(t,e,a){if(utils$1.isString(t))try{return(e||JSON.parse)(t),utils$1.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(a||JSON.stringify)(t)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(e,a){const r=a.getContentType()||"",n=r.indexOf("application/json")>-1,i=utils$1.isObject(e);if(i&&utils$1.isHTMLForm(e)&&(e=new FormData(e)),utils$1.isFormData(e))return n&&n?JSON.stringify(formDataToJSON(e)):e;if(utils$1.isArrayBuffer(e)||utils$1.isBuffer(e)||utils$1.isStream(e)||utils$1.isFile(e)||utils$1.isBlob(e))return e;if(utils$1.isArrayBufferView(e))return e.buffer;if(utils$1.isURLSearchParams(e))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((s=utils$1.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return toFormData(s?{"files[]":e}:e,u&&new u,this.formSerializer)}}return i||n?(a.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const a=this.transitional||defaults.transitional,r=a&&a.forcedJSONParsing,n=this.responseType==="json";if(e&&utils$1.isString(e)&&(r&&!this.responseType||n)){const o=!(a&&a.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?AxiosError.from(s,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],t=>{defaults.headers[t]={}});const defaults$1=defaults,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=t=>{const e={};let a,r,n;return t&&t.split(` +`).forEach(function(o){n=o.indexOf(":"),a=o.substring(0,n).trim().toLowerCase(),r=o.substring(n+1).trim(),!(!a||e[a]&&ignoreDuplicateOf[a])&&(a==="set-cookie"?e[a]?e[a].push(r):e[a]=[r]:e[a]=e[a]?e[a]+", "+r:r)}),e},$internals=Symbol("internals");function normalizeHeader(t){return t&&String(t).trim().toLowerCase()}function normalizeValue(t){return t===!1||t==null?t:utils$1.isArray(t)?t.map(normalizeValue):String(t)}function parseTokens(t){const e=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=a.exec(t);)e[r[1]]=r[2];return e}const isValidHeaderName=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function matchHeaderValue(t,e,a,r,n){if(utils$1.isFunction(r))return r.call(this,e,a);if(n&&(e=a),!!utils$1.isString(e)){if(utils$1.isString(r))return e.indexOf(r)!==-1;if(utils$1.isRegExp(r))return r.test(e)}}function formatHeader(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,a,r)=>a.toUpperCase()+r)}function buildAccessors(t,e){const a=utils$1.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+a,{value:function(n,i,o){return this[r].call(this,e,n,i,o)},configurable:!0})})}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,a,r){const n=this;function i(s,u,l){const d=normalizeHeader(u);if(!d)throw new Error("header name must be a non-empty string");const h=utils$1.findKey(n,d);(!h||n[h]===void 0||l===!0||l===void 0&&n[h]!==!1)&&(n[h||u]=normalizeValue(s))}const o=(s,u)=>utils$1.forEach(s,(l,d)=>i(l,d,u));return utils$1.isPlainObject(e)||e instanceof this.constructor?o(e,a):utils$1.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)?o(parseHeaders(e),a):e!=null&&i(a,e,r),this}get(e,a){if(e=normalizeHeader(e),e){const r=utils$1.findKey(this,e);if(r){const n=this[r];if(!a)return n;if(a===!0)return parseTokens(n);if(utils$1.isFunction(a))return a.call(this,n,r);if(utils$1.isRegExp(a))return a.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,a){if(e=normalizeHeader(e),e){const r=utils$1.findKey(this,e);return!!(r&&this[r]!==void 0&&(!a||matchHeaderValue(this,this[r],r,a)))}return!1}delete(e,a){const r=this;let n=!1;function i(o){if(o=normalizeHeader(o),o){const s=utils$1.findKey(r,o);s&&(!a||matchHeaderValue(r,r[s],s,a))&&(delete r[s],n=!0)}}return utils$1.isArray(e)?e.forEach(i):i(e),n}clear(e){const a=Object.keys(this);let r=a.length,n=!1;for(;r--;){const i=a[r];(!e||matchHeaderValue(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){const a=this,r={};return utils$1.forEach(this,(n,i)=>{const o=utils$1.findKey(r,i);if(o){a[o]=normalizeValue(n),delete a[i];return}const s=e?formatHeader(i):String(i).trim();s!==i&&delete a[i],a[s]=normalizeValue(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const a=Object.create(null);return utils$1.forEach(this,(r,n)=>{r!=null&&r!==!1&&(a[n]=e&&utils$1.isArray(r)?r.join(", "):r)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,a])=>e+": "+a).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...a){const r=new this(e);return a.forEach(n=>r.set(n)),r}static accessor(e){const r=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function i(o){const s=normalizeHeader(o);r[s]||(buildAccessors(n,o),r[s]=!0)}return utils$1.isArray(e)?e.forEach(i):i(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:t},e)=>{let a=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[a]=r}}});utils$1.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(t,e){const a=this||defaults$1,r=e||a,n=AxiosHeaders$1.from(r.headers);let i=r.data;return utils$1.forEach(t,function(s){i=s.call(a,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function isCancel(t){return!!(t&&t.__CANCEL__)}function CanceledError(t,e,a){AxiosError.call(this,t??"canceled",AxiosError.ERR_CANCELED,e,a),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(t,e,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?t(a):e(new AxiosError("Request failed with status code "+a.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}const cookies=platform.hasStandardBrowserEnv?{write(t,e,a,r,n,i){const o=[t+"="+encodeURIComponent(e)];utils$1.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),utils$1.isString(r)&&o.push("path="+r),utils$1.isString(n)&&o.push("domain="+n),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a");let r;function n(i){let o=i;return e&&(a.setAttribute("href",o),o=a.href),a.setAttribute("href",o),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return r=n(window.location.href),function(o){const s=utils$1.isString(o)?n(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const a=new Array(t),r=new Array(t);let n=0,i=0,o;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),d=r[i];o||(o=l),a[n]=u,r[n]=l;let h=i,v=0;for(;h!==n;)v+=a[h++],h=h%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),l-o{const i=n.loaded,o=n.lengthComputable?n.total:void 0,s=i-a,u=r(s),l=i<=o;a=i;const d={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&l?(o-i)/u:void 0,event:n};d[e?"download":"upload"]=!0,t(d)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(a,r){let n=t.data;const i=AxiosHeaders$1.from(t.headers).normalize();let{responseType:o,withXSRFToken:s}=t,u;function l(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}let d;if(utils$1.isFormData(n)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((d=i.getContentType())!==!1){const[O,...M]=d?d.split(";").map(C=>C.trim()).filter(Boolean):[];i.setContentType([O||"multipart/form-data",...M].join("; "))}}let h=new XMLHttpRequest;if(t.auth){const O=t.auth.username||"",M=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(O+":"+M))}const v=buildFullPath(t.baseURL,t.url);h.open(t.method.toUpperCase(),buildURL(v,t.params,t.paramsSerializer),!0),h.timeout=t.timeout;function S(){if(!h)return;const O=AxiosHeaders$1.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:O,config:t,request:h};settle(function(N){a(N),l()},function(N){r(N),l()},C),h=null}if("onloadend"in h?h.onloadend=S:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(S)},h.onabort=function(){h&&(r(new AxiosError("Request aborted",AxiosError.ECONNABORTED,t,h)),h=null)},h.onerror=function(){r(new AxiosError("Network Error",AxiosError.ERR_NETWORK,t,h)),h=null},h.ontimeout=function(){let M=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const C=t.transitional||transitionalDefaults;t.timeoutErrorMessage&&(M=t.timeoutErrorMessage),r(new AxiosError(M,C.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,t,h)),h=null},platform.hasStandardBrowserEnv&&(s&&utils$1.isFunction(s)&&(s=s(t)),s||s!==!1&&isURLSameOrigin(v))){const O=t.xsrfHeaderName&&t.xsrfCookieName&&cookies.read(t.xsrfCookieName);O&&i.set(t.xsrfHeaderName,O)}n===void 0&&i.setContentType(null),"setRequestHeader"in h&&utils$1.forEach(i.toJSON(),function(M,C){h.setRequestHeader(C,M)}),utils$1.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),o&&o!=="json"&&(h.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&h.addEventListener("progress",progressEventReducer(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",progressEventReducer(t.onUploadProgress)),(t.cancelToken||t.signal)&&(u=O=>{h&&(r(!O||O.type?new CanceledError(null,t,h):O),h.abort(),h=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u)));const A=parseProtocol(v);if(A&&platform.protocols.indexOf(A)===-1){r(new AxiosError("Unsupported protocol "+A+":",AxiosError.ERR_BAD_REQUEST,t));return}h.send(n||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils$1.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const renderReason=t=>`- ${t}`,isResolvedHandle=t=>utils$1.isFunction(t)||t===null||t===!1,adapters={getAdapter:t=>{t=utils$1.isArray(t)?t:[t];const{length:e}=t;let a,r;const n={};for(let i=0;i`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since : `+i.map(renderReason).join(` -`):" "+renderReason(i[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:knownAdapters};function throwIfCancellationRequested(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new CanceledError(null,t)}function dispatchRequest(t){return throwIfCancellationRequested(t),t.headers=AxiosHeaders$1.from(t.headers),t.data=transformData.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(t.adapter||defaults$1.adapter)(t).then(function(r){return throwIfCancellationRequested(t),r.data=transformData.call(t,t.transformResponse,r),r.headers=AxiosHeaders$1.from(r.headers),r},function(r){return isCancel(r)||(throwIfCancellationRequested(t),r&&r.response&&(r.response.data=transformData.call(t,t.transformResponse,r.response),r.response.headers=AxiosHeaders$1.from(r.response.headers))),Promise.reject(r)})}const headersToObject=t=>t instanceof AxiosHeaders$1?t.toJSON():t;function mergeConfig(t,e){e=e||{};const a={};function r(c,l,p){return utils$1.isPlainObject(c)&&utils$1.isPlainObject(l)?utils$1.merge.call({caseless:p},c,l):utils$1.isPlainObject(l)?utils$1.merge({},l):utils$1.isArray(l)?l.slice():l}function n(c,l,p){if(utils$1.isUndefined(l)){if(!utils$1.isUndefined(c))return r(void 0,c,p)}else return r(c,l,p)}function i(c,l){if(!utils$1.isUndefined(l))return r(void 0,l)}function o(c,l){if(utils$1.isUndefined(l)){if(!utils$1.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function s(c,l,p){if(p in e)return r(c,l);if(p in t)return r(void 0,c)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials: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:s,headers:(c,l)=>n(headersToObject(c),headersToObject(l),!0)};return utils$1.forEach(Object.keys(Object.assign({},t,e)),function(l){const p=u[l]||n,v=p(t[l],e[l],l);utils$1.isUndefined(v)&&p!==s||(a[l]=v)}),a}const VERSION$1="1.6.1",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function(e,a,r){function n(i,o){return"[Axios v"+VERSION$1+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(e===!1)throw new AxiosError(n(o," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(n(o," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(i,o,s):!0}};function assertOptions(t,e,a){if(typeof t!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const i=r[n],o=e[i];if(o){const s=t[i],u=s===void 0||o(s,i,t);if(u!==!0)throw new AxiosError("option "+i+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=mergeConfig(this.defaults,a);const{transitional:r,paramsSerializer:n,headers:i}=a;r!==void 0&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),n!=null&&(utils$1.isFunction(n)?a.paramsSerializer={serialize:n}:validator.assertOptions(n,{encode:validators.function,serialize:validators.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let o=i&&utils$1.merge(i.common,i[a.method]);i&&utils$1.forEach(["delete","get","head","post","put","patch","common"],T=>{delete i[T]}),a.headers=AxiosHeaders$1.concat(o,i);const s=[];let u=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(a)===!1||(u=u&&O.synchronous,s.unshift(O.fulfilled,O.rejected))});const c=[];this.interceptors.response.forEach(function(O){c.push(O.fulfilled,O.rejected)});let l,p=0,v;if(!u){const T=[dispatchRequest.bind(this),void 0];for(T.unshift.apply(T,s),T.push.apply(T,c),v=T.length,l=Promise.resolve(a);p{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i;const o=new Promise(s=>{r.subscribe(s),i=s}).then(n);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,s){r.reason||(r.reason=new CanceledError(i,o,s),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}static source(){let e;return{token:new CancelToken(function(n){e=n}),cancel:e}}}const CancelToken$1=CancelToken;function spread(t){return function(a){return t.apply(null,a)}}function isAxiosError(t){return utils$1.isObject(t)&&t.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(([t,e])=>{HttpStatusCode[e]=t});const HttpStatusCode$1=HttpStatusCode;function createInstance(t){const e=new Axios$1(t),a=bind$4(Axios$1.prototype.request,e);return utils$1.extend(a,Axios$1.prototype,e,{allOwnKeys:!0}),utils$1.extend(a,e,null,{allOwnKeys:!0}),a.create=function(n){return createInstance(mergeConfig(t,n))},a}const axios=createInstance(defaults$1);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(e){return Promise.all(e)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=t=>formDataToJSON(utils$1.isHTMLForm(t)?new FormData(t):t);axios.getAdapter=adapters.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(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}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$8,map,pluck:pluck$1,isList:isList$1,isFunction:isFunction$4,isObject:isObject$a,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,a,r,n){for(var i=1;i"u"?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function createStore(t,e,a){a||(a=""),t&&!isList(t)&&(t=[t]),e&&!isList(e)&&(e=[e]);var r=a?"__storejs_"+a+"_":"",n=a?new RegExp("^"+r):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:r,_namespaceRegexp:n,_testStorage:function(u){try{var c="__storejs__test__";u.write(c,c);var l=u.read(c)===c;return u.remove(c),l}catch{return!1}},_assignPluginFnProp:function(u,c){var l=this[c];this[c]=function(){var v=slice$1(arguments,0),S=this;function T(){if(l)return each$7(arguments,function(M,C){v[C]=M}),l.apply(S,v)}var O=[T].concat(v);return u.apply(S,O)}},_serialize:function(u){return JSON.stringify(u)},_deserialize:function(u,c){if(!u)return c;var l="";try{l=JSON.parse(u)}catch{l=u}return l!==void 0?l:c},_addStorage:function(u){this.enabled||this._testStorage(u)&&(this.storage=u,this.enabled=!0)},_addPlugin:function(u){var c=this;if(isList(u)){each$7(u,function(v){c._addPlugin(v)});return}var l=pluck(this.plugins,function(v){return u===v});if(!l){if(this.plugins.push(u),!isFunction$3(u))throw new Error("Plugins must be function values that return objects");var p=u.call(this);if(!isObject$9(p))throw new Error("Plugins must return an object of function properties");each$7(p,function(v,S){if(!isFunction$3(v))throw new Error("Bad plugin property: "+S+" from plugin "+u.name+". Plugins should only return functions.");c._assignPluginFnProp(v,S)})}},addStorage:function(u){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(u)}},s=create$1(o,storeAPI,{plugins:[]});return s.raw={},each$7(s,function(u,c){isFunction$3(u)&&(s.raw[c]=bind$2(s,u))}),each$7(t,function(u){s._addStorage(u)}),each$7(e,function(u){s._addPlugin(u)}),s}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$6,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(t){return localStorage().getItem(t)}function write$6(t,e){return localStorage().setItem(t,e)}function each$6(t){for(var e=localStorage().length-1;e>=0;e--){var a=localStorage().key(e);t(read$6(a),a)}}function remove$5(t){return localStorage().removeItem(t)}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$5,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(t){return globalStorage[t]}function write$5(t,e){globalStorage[t]=e}function each$5(t){for(var e=globalStorage.length-1;e>=0;e--){var a=globalStorage.key(e);t(globalStorage[a],a)}}function remove$4(t){return globalStorage.removeItem(t)}function clearAll$4(){each$5(function(t,e){delete globalStorage[t]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$4,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(t,e){if(!disable){var a=fixKey(t);_withStorageEl(function(r){r.setAttribute(a,e),r.save(storageName)})}}function read$4(t){if(!disable){var e=fixKey(t),a=null;return _withStorageEl(function(r){a=r.getAttribute(e)}),a}}function each$4(t){_withStorageEl(function(e){for(var a=e.XMLDocument.documentElement.attributes,r=a.length-1;r>=0;r--){var n=a[r];t(e.getAttribute(n.name),n.name)}})}function remove$3(t){var e=fixKey(t);_withStorageEl(function(a){a.removeAttribute(e),a.save(storageName)})}function clearAll$3(){_withStorageEl(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(storageName);for(var a=e.length-1;a>=0;a--)t.removeAttribute(e[a].name);t.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(t){return t.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var t="script",e,a,r;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+t+">document.w=window'),a.close(),e=a.w.frames[0].document,r=e.createElement("div")}catch{r=doc$1.createElement("div"),e=doc$1.body}return function(n){var i=[].slice.call(arguments,0);i.unshift(r),e.appendChild(r),r.addBehavior("#default#userData"),r.load(storageName),n.apply(this,i),e.removeChild(r)}}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$3,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(t){if(!t||!_has(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$3(t){for(var e=doc.cookie.split(/; ?/g),a=e.length-1;a>=0;a--)if(trim(e[a])){var r=e[a].split("="),n=unescape(r[0]),i=unescape(r[1]);t(i,n)}}function write$3(t,e){t&&(doc.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(t){!t||!_has(t)||(doc.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$3(function(t,e){remove$2(e)})}function _has(t){return new RegExp("(?:^|;\\s*)"+escape(t).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$2,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(t){return sessionStorage().getItem(t)}function write$2(t,e){return sessionStorage().setItem(t,e)}function each$2(t){for(var e=sessionStorage().length-1;e>=0;e--){var a=sessionStorage().key(e);t(read$2(a),a)}}function remove$1(t){return sessionStorage().removeItem(t)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$1,remove,clearAll},memoryStorage={};function read$1(t){return memoryStorage[t]}function write$1(t,e){memoryStorage[t]=e}function each$1(t){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&t(memoryStorage[e],e)}function remove(t){delete memoryStorage[t]}function clearAll(t){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(t){return t<10?"0"+t:t}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(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(e){var a=meta[e];return typeof a=="string"?a:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var a,r,n,i,o=gap,s,u=e[t];switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(t)),typeof rep=="function"&&(u=rep.call(e,t,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,s=[],Object.prototype.toString.apply(u)==="[object Array]"){for(i=u.length,a=0;at instanceof AxiosHeaders$1?t.toJSON():t;function mergeConfig(t,e){e=e||{};const a={};function r(l,d,h){return utils$1.isPlainObject(l)&&utils$1.isPlainObject(d)?utils$1.merge.call({caseless:h},l,d):utils$1.isPlainObject(d)?utils$1.merge({},d):utils$1.isArray(d)?d.slice():d}function n(l,d,h){if(utils$1.isUndefined(d)){if(!utils$1.isUndefined(l))return r(void 0,l,h)}else return r(l,d,h)}function i(l,d){if(!utils$1.isUndefined(d))return r(void 0,d)}function o(l,d){if(utils$1.isUndefined(d)){if(!utils$1.isUndefined(l))return r(void 0,l)}else return r(void 0,d)}function s(l,d,h){if(h in e)return r(l,d);if(h in t)return r(void 0,l)}const u={url:i,method:i,data:i,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:s,headers:(l,d)=>n(headersToObject(l),headersToObject(d),!0)};return utils$1.forEach(Object.keys(Object.assign({},t,e)),function(d){const h=u[d]||n,v=h(t[d],e[d],d);utils$1.isUndefined(v)&&h!==s||(a[d]=v)}),a}const VERSION$1="1.6.2",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function(e,a,r){function n(i,o){return"[Axios v"+VERSION$1+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(e===!1)throw new AxiosError(n(o," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(n(o," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(i,o,s):!0}};function assertOptions(t,e,a){if(typeof t!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const i=r[n],o=e[i];if(o){const s=t[i],u=s===void 0||o(s,i,t);if(u!==!0)throw new AxiosError("option "+i+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=mergeConfig(this.defaults,a);const{transitional:r,paramsSerializer:n,headers:i}=a;r!==void 0&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),n!=null&&(utils$1.isFunction(n)?a.paramsSerializer={serialize:n}:validator.assertOptions(n,{encode:validators.function,serialize:validators.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let o=i&&utils$1.merge(i.common,i[a.method]);i&&utils$1.forEach(["delete","get","head","post","put","patch","common"],A=>{delete i[A]}),a.headers=AxiosHeaders$1.concat(o,i);const s=[];let u=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(a)===!1||(u=u&&O.synchronous,s.unshift(O.fulfilled,O.rejected))});const l=[];this.interceptors.response.forEach(function(O){l.push(O.fulfilled,O.rejected)});let d,h=0,v;if(!u){const A=[dispatchRequest.bind(this),void 0];for(A.unshift.apply(A,s),A.push.apply(A,l),v=A.length,d=Promise.resolve(a);h{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i;const o=new Promise(s=>{r.subscribe(s),i=s}).then(n);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,s){r.reason||(r.reason=new CanceledError(i,o,s),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}static source(){let e;return{token:new CancelToken(function(n){e=n}),cancel:e}}}const CancelToken$1=CancelToken;function spread(t){return function(a){return t.apply(null,a)}}function isAxiosError(t){return utils$1.isObject(t)&&t.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(([t,e])=>{HttpStatusCode[e]=t});const HttpStatusCode$1=HttpStatusCode;function createInstance(t){const e=new Axios$1(t),a=bind$4(Axios$1.prototype.request,e);return utils$1.extend(a,Axios$1.prototype,e,{allOwnKeys:!0}),utils$1.extend(a,e,null,{allOwnKeys:!0}),a.create=function(n){return createInstance(mergeConfig(t,n))},a}const axios=createInstance(defaults$1);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(e){return Promise.all(e)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=t=>formDataToJSON(utils$1.isHTMLForm(t)?new FormData(t):t);axios.getAdapter=adapters.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(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}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$8,map,pluck:pluck$1,isList:isList$1,isFunction:isFunction$4,isObject:isObject$a,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,a,r,n){for(var i=1;i"u"?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function createStore(t,e,a){a||(a=""),t&&!isList(t)&&(t=[t]),e&&!isList(e)&&(e=[e]);var r=a?"__storejs_"+a+"_":"",n=a?new RegExp("^"+r):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:r,_namespaceRegexp:n,_testStorage:function(u){try{var l="__storejs__test__";u.write(l,l);var d=u.read(l)===l;return u.remove(l),d}catch{return!1}},_assignPluginFnProp:function(u,l){var d=this[l];this[l]=function(){var v=slice$1(arguments,0),S=this;function A(){if(d)return each$7(arguments,function(M,C){v[C]=M}),d.apply(S,v)}var O=[A].concat(v);return u.apply(S,O)}},_serialize:function(u){return JSON.stringify(u)},_deserialize:function(u,l){if(!u)return l;var d="";try{d=JSON.parse(u)}catch{d=u}return d!==void 0?d:l},_addStorage:function(u){this.enabled||this._testStorage(u)&&(this.storage=u,this.enabled=!0)},_addPlugin:function(u){var l=this;if(isList(u)){each$7(u,function(v){l._addPlugin(v)});return}var d=pluck(this.plugins,function(v){return u===v});if(!d){if(this.plugins.push(u),!isFunction$3(u))throw new Error("Plugins must be function values that return objects");var h=u.call(this);if(!isObject$9(h))throw new Error("Plugins must return an object of function properties");each$7(h,function(v,S){if(!isFunction$3(v))throw new Error("Bad plugin property: "+S+" from plugin "+u.name+". Plugins should only return functions.");l._assignPluginFnProp(v,S)})}},addStorage:function(u){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(u)}},s=create$1(o,storeAPI,{plugins:[]});return s.raw={},each$7(s,function(u,l){isFunction$3(u)&&(s.raw[l]=bind$2(s,u))}),each$7(t,function(u){s._addStorage(u)}),each$7(e,function(u){s._addPlugin(u)}),s}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$6,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(t){return localStorage().getItem(t)}function write$6(t,e){return localStorage().setItem(t,e)}function each$6(t){for(var e=localStorage().length-1;e>=0;e--){var a=localStorage().key(e);t(read$6(a),a)}}function remove$5(t){return localStorage().removeItem(t)}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$5,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(t){return globalStorage[t]}function write$5(t,e){globalStorage[t]=e}function each$5(t){for(var e=globalStorage.length-1;e>=0;e--){var a=globalStorage.key(e);t(globalStorage[a],a)}}function remove$4(t){return globalStorage.removeItem(t)}function clearAll$4(){each$5(function(t,e){delete globalStorage[t]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$4,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(t,e){if(!disable){var a=fixKey(t);_withStorageEl(function(r){r.setAttribute(a,e),r.save(storageName)})}}function read$4(t){if(!disable){var e=fixKey(t),a=null;return _withStorageEl(function(r){a=r.getAttribute(e)}),a}}function each$4(t){_withStorageEl(function(e){for(var a=e.XMLDocument.documentElement.attributes,r=a.length-1;r>=0;r--){var n=a[r];t(e.getAttribute(n.name),n.name)}})}function remove$3(t){var e=fixKey(t);_withStorageEl(function(a){a.removeAttribute(e),a.save(storageName)})}function clearAll$3(){_withStorageEl(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(storageName);for(var a=e.length-1;a>=0;a--)t.removeAttribute(e[a].name);t.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(t){return t.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var t="script",e,a,r;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+t+">document.w=window'),a.close(),e=a.w.frames[0].document,r=e.createElement("div")}catch{r=doc$1.createElement("div"),e=doc$1.body}return function(n){var i=[].slice.call(arguments,0);i.unshift(r),e.appendChild(r),r.addBehavior("#default#userData"),r.load(storageName),n.apply(this,i),e.removeChild(r)}}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$3,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(t){if(!t||!_has(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$3(t){for(var e=doc.cookie.split(/; ?/g),a=e.length-1;a>=0;a--)if(trim(e[a])){var r=e[a].split("="),n=unescape(r[0]),i=unescape(r[1]);t(i,n)}}function write$3(t,e){t&&(doc.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(t){!t||!_has(t)||(doc.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$3(function(t,e){remove$2(e)})}function _has(t){return new RegExp("(?:^|;\\s*)"+escape(t).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$2,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(t){return sessionStorage().getItem(t)}function write$2(t,e){return sessionStorage().setItem(t,e)}function each$2(t){for(var e=sessionStorage().length-1;e>=0;e--){var a=sessionStorage().key(e);t(read$2(a),a)}}function remove$1(t){return sessionStorage().removeItem(t)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$1,remove,clearAll},memoryStorage={};function read$1(t){return memoryStorage[t]}function write$1(t,e){memoryStorage[t]=e}function each$1(t){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&t(memoryStorage[e],e)}function remove(t){delete memoryStorage[t]}function clearAll(t){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(t){return t<10?"0"+t:t}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(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(e){var a=meta[e];return typeof a=="string"?a:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var a,r,n,i,o=gap,s,u=e[t];switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(t)),typeof rep=="function"&&(u=rep.call(e,t,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,s=[],Object.prototype.toString.apply(u)==="[object Array]"){for(i=u.length,a=0;alastFlushedIndex&&queue.splice(e,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let t=0;tt.effect(e,{scheduler:a=>{shouldSchedule?scheduler(a):a()}}),raw=t.raw}function overrideEffect(t){effect$3=t}function elementBoundEffect(t){let e=()=>{};return[r=>{let n=effect$3(r);return t._x_effects||(t._x_effects=new Set,t._x_runEffects=()=>{t._x_effects.forEach(i=>i())}),t._x_effects.add(n),e=()=>{n!==void 0&&(t._x_effects.delete(n),release(n))},n},()=>{e()}]}function dispatch(t,e,a={}){t.dispatchEvent(new CustomEvent(e,{detail:a,bubbles:!0,composed:!0,cancelable:!0}))}function walk(t,e){if(typeof ShadowRoot=="function"&&t instanceof ShadowRoot){Array.from(t.children).forEach(n=>walk(n,e));return}let a=!1;if(e(t,()=>a=!0),a)return;let r=t.firstElementChild;for(;r;)walk(r,e),r=r.nextElementSibling}function warn(t,...e){console.warn(`Alpine Warning: ${t}`,...e)}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 `